spikeinterface icon indicating copy to clipboard operation
spikeinterface copied to clipboard

Automatic curation with metrics

Open anoushkajain opened this issue 1 year ago • 2 comments

Solves #2479

anoushkajain avatar May 29 '24 11:05 anoushkajain

Scikit-learn is not a dependency either - how do we want to handle this? It would be needed for both the prediction and training steps, if we implement that too

jakeswann1 avatar Jun 05 '24 10:06 jakeswann1

You should move the imports into the functions that use it ;)

alejoe91 avatar Jun 05 '24 11:06 alejoe91

@chrishalcrow just noticed this in the curation model based tutorial: image Possibly an ordering issue? maybe using set would be better there

alejoe91 avatar Oct 31 '24 12:10 alejoe91

TODO:

@chrishalcrow @anoushkajain

API

  • [x] (Chris) Add consistency check for metric params:

    • training: with multiple analyzer, if params a metric from different analyzers are not the same, warn and skip metric from params
    • predicting: add enforce_metric_params=False in auto_label_units. If params are different for a metric, warn the user but do not raise. In case enforce_metric_params==True, throw an error
  • [x] (Chris) auto_label_units should return a pandas.Dataframe

Models

  • [ ] (Anoushka) Update model on HF:
    • [ ] cascaded_classifier.skops -> noise_sua_mua_model.skops
    • [ ] meta_data.json -> metadata.json
    • [ ] add model_info.json

Docs

  • [x] (Chris) Favore trust_model=True instead of trusted=... in tutorials and how to
  • [x] (Chris) Update A more realistic example: Neuropixels data with the ``noise_sua_mua_model.skopsand run on the existingsorting_analyzer`
  • [x] (Chris) model_info.json: all entries should be lists

alejoe91 avatar Oct 31 '24 14:10 alejoe91

Hi, I was wondering if the classification here is different compared to the one implemented at the Allen Institute. I see that @alejoe91 is involved in both. I am interested especially regarding Neuropixel data (both 1 & 2). Thanks!

RobertoDF avatar Nov 15 '24 18:11 RobertoDF

Hi, I was wondering if the classification here is different compared to the one implemented at the Allen Institute. I see that @alejoe91 is involved in both. I am interested especially regarding Neuropixel data (both 1 & 2). Thanks!

Hi @RobertoDF

They are essentially the same models, but this PR adds some backbone machinery and should minimize the amount of custom steps to apply the models :) Once this is merged and release, I plan to update the Allen institute classifier to use this SpikeInterface wrapper.

We apply the same model to both NP1 and NP2 data and it gives quite good results on both, especially in identifying noisy units.

alejoe91 avatar Nov 16 '24 12:11 alejoe91

Thanks!

RobertoDF avatar Nov 16 '24 16:11 RobertoDF

@chrishalcrow @anoushkajain let's have a final push on this.

Just reviewing the generated docs, there are some failures:

  1. In the Training a model for automated curation image

  2. At the end of Model Based Curation

  • si.auto_label_units should be sc.auto_label_units image
  • Some rendering/formatting issue at the end: image

alejoe91 avatar Jan 08 '25 12:01 alejoe91

Question for @anoushkajain and @chrishalcrow

Shouldn't this be "sua"/"mua" and this "noise"/"neuron"?

alejoe91 avatar Jan 08 '25 14:01 alejoe91

@chrishalcrow fixed a couple of broken refs in the docs due to the mertics -> metrics correction in the file name.

Merging this! thank you all for working on this!

It's a great contribution for the community :)

alejoe91 avatar Jan 10 '25 14:01 alejoe91