HelmchenLabSoftware / Cascade

Calibrated inference of spiking from calcium ΔF/F data using deep networks
GNU General Public License v3.0
123 stars 34 forks source link

1Hz Inference in Teleost (Danionella cerebrum) #38

Closed MaximilianHoffmann closed 6 months ago

MaximilianHoffmann commented 2 years ago

Would it be possible to train a network on subsampled Zebrafish data, that we might try on our GCamp7s OPM recordings in Danionella at 1Hz volume rate?

PTRRupprecht commented 2 years ago

We can give it a try. 1 Hz is rather slow, so we have to see what we get. I will train a network with all data and another network with only the zebrafish data, you can then check out both.

Probably the trained network will be available in ca. 10 days, because I'm on holidays the entire next week ;-)

MaximilianHoffmann commented 2 years ago

Sounds good, thanks!

PTRRupprecht commented 2 years ago

I just uploaded a few models pretrained on the ground truth that was resampled to 1 Hz. In step (7) of the Colab Notebook, you can now select one of these models:

The first comes with lesser smoothing (it tries to be more temporally precise). The first two ("Global") have been trained on the entire ground truth (excluding the interneuron datasets), the last one only on data from the zebrafish forebrain (including the olfactory bulb). I would go with _Global_EXC_1Hzsmoothing1000ms first.

Overall, I'm a bit skeptical whether it will work out or not. When I downsample my calcium recordings from 30 Hz to 1 Hz, I barely see anything left. But with lower temperature in Danionella, and using a slow GCaMP7s, it might work.

I'd be happy to see some of the results, if you are able to post them as a screenshot or send me an email. I think also others would be interested in knowing how supervised spike inference works for slow volumetric sampling.

PTRRupprecht commented 2 years ago

P.S. If the trained network does not work, let me know. Due to the different timescale, I had to adapt the network structure on the fly, and if it turns out to be overfitting, this can be adapted easily by shrinking the number of parameters.

PTRRupprecht commented 2 years ago

Hi Max,

You might also want to check out issue #39.

This is also an application of Cascade to fish (zebrafish) data recorded at relatively low framerate (4.3 Hz). Here, it turned out to be important that the noise level (as defined in the paper) was rather high (in the range of 15). Therefore, specific retraining of the network was necessary to get good results.

So, if you plot the distribution of noise levels of your dataset, and it is not centered in the range of 2-8 but something higher, you could come back to me and we could train a model specifically for higher noise level ranges.

MaximilianHoffmann commented 2 years ago

Hi Peter,

thank you for training the networks and for pointing me to the issue. Unfortunatley, I haven't yet gotten to testing it (have been travelling), but I'll report back as soon as I have tried it out.