delvendahl / miniML

A deep learning framework for synaptic event detection
MIT License
6 stars 3 forks source link

can i use miniML to detect sIPSC #7

Closed Dexiao211 closed 2 months ago

Dexiao211 commented 2 months ago

Thanks for developing such a useful model. We recorded sIPSCs of pyramidal neurons at a holding potential of 0 mV, so the currents are positive. Can I use miniML to detect sIPSCs, or should I create a transfer learning model? Thanks.

delvendahl commented 2 months ago

Hello Dexiao211,

Yes, miniML can be used to detect and analyse sIPSCs as well.

  1. You can try using the base model for detection first. If the events in your data are outward currents, you can invert the data traces. After you have loaded your data into a miniTrace object (see tutorial), inverting the data is easy by setting the direction parameter: direction = 'positive' If your sampling rate and/or kinetics differ from the training data (50kHz sampling, decay kinetics of events approx. 1ms), resampling can improve the detection performance. Resampling is done by adjusting the window size parameter (win_size = 600). This parameter represents the number of samples used for each model inference. A single event should be fully covered by this number of samples. E.g., if your data is sampled at 50kHz and your events have decay time constant of approx. 2ms, an increase of the window size may be necessary: win_size = 1200 Often, this approach provides good results on data that is relatively distinct from the original training data.

  2. On the long run, training a TL model may perform better. We have provided some initial documentation on how to use TL, and there will be more detailed information added in the future. If you need help with model training, please do get in touch.

Dexiao211 commented 2 months ago

Hello Dexiao211,

Yes, miniML can be used to detect and analyse sIPSCs as well.

  1. You can try using the base model for detection first. If the events in your data are outward currents, you can invert the data traces. After you have loaded your data into a miniTrace object (see tutorial), inverting the data is easy by setting the direction parameter: direction = 'positive' If your sampling rate and/or kinetics differ from the training data (50kHz sampling, decay kinetics of events approx. 1ms), resampling can improve the detection performance. Resampling is done by adjusting the window size parameter (win_size = 600). This parameter represents the number of samples used for each model inference. A single event should be fully covered by this number of samples. E.g., if your data is sampled at 50kHz and your events have decay time constant of approx. 2ms, an increase of the window size may be necessary: win_size = 1200 Often, this approach provides good results on data that is relatively distinct from the original training data.
  2. On the long run, training a TL model may perform better. We have provided some initial documentation on how to use TL, and there will be more detailed information added in the future. If you need help with model training, please do get in touch.

Thanks very much. Can i load a raw Axon abf file into a miniTrace object? Can you give me an example? Thanks.

delvendahl commented 2 months ago

Axon .abf files can be loaded as follows:

trace = MiniTrace.from_axon_file(filepath, channel, scaling, unit)

You have to specify the relative or absolute file path to your recording file. In addition, channel (default: 0), a scaling factor (default: 1), as well as the data unit can be specified.

Dexiao211 commented 2 months ago

Axon .abf files can be loaded as follows:

trace = MiniTrace.from_axon_file(filepath, channel, scaling, unit)

You have to specify the relative or absolute file path to your recording file. In addition, channel (default: 0), a scaling factor (default: 1), as well as the data unit can be specified.

Thanks.