-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow drift tracking and correction #807
Comments
Hello, All versions of Kilosort after Kilosort2 do not track slow drift in the way you're describing, they only adjust full sections of the probe on a batch-by-batch basis. Adding separate tracking of slower drift is something we're currently working on. As for the
|
I see, thank you! What if we turn on drift correction and increase batch size to a few minutes? Do you think it could potentially give better results? |
That is not likely to work, since it would require so much additional memory. You could try increasing the batch size to something like 6s or 10s for your sampling rate (or larger if your machine can handle it), which may help get better drift estimates, but in principle the type of drift that we're correcting for should be handled well by the smaller batch size as well. |
Also wanted to add: after reading your original post again, it sounds like maybe you never tried the existing drift correction algorithm? You should definitely try setting |
Thank you for your message! We have tried setting |
If the drift estimates match your expectations, switching to Kilosort2 will not offer any benefit. Have you tried running with |
Hmm I see. Yes I have tried this, and the results described above are what we see using nblocks=1 and batch_size = 80000 (2s). |
Can you please attach some screenshots of the drift plots and the clustering issues you're seeing? |
How many good clusters total across all shanks? |
There are 443 good clusters in total across all shanks. |
@Tingchen-G In that case, it sounds like you're not likely to get much (if any) improvement by tweaking parameters. We expect some amount of error with automated sorting, and seeing oversplitting / merging in ~10% of good units is not unreasonable. I will also point out that it looks like the splits you're seeing are directly related to something happening during the recording. The drift amount starts to change suddenly just before ~30000s, and that lines up pretty closely with the times you're seeing the splits happen at. You can also see that the cross-correlograms for the units you've selected are not refractory (which would be expected for the same unit), which is most likely why they were not merged. Whether that's because they're actually different units (for example, some neurons dropping in or out at that point in the recording) or some other issue is unclear. |
Hi!
Kilosort 4 does not seem to be tracking slow drift as well as we might hope. We record under anesthesia and do not have a lot of fast drift, so we have set nblocks to 0 to turn off “drift correction”. Will Kilosort still track slow drift as suggested in the Wiki with the statements about “initialize the templates at one end of the recording, and then sweep the recording in time, adjusting the templates to keep track of the slightly-changing waveforms of each neuron” and “slow tracking strategy of incremental small updates to a cluster's template as we progress through the batches”?
What parameter controls the timescale etc over which the templates are updated for this slow tracking?
Could “drift_smoothing” also help? The comment for that parameter is somewhat confusing. It says “amount of gaussian smoothing to apply to the spatiotemporal drift estimation, for correlation, time (units of registration blocks), and y (units of batches) axes. The y smoothing has no effect for "nblocks = 1”. Should it say instead “time (units of batches), and y (units of registration blocks)”?
Ideally, we would update our templates on the timescale of ~10 mins. If we want to smooth over time to get the tracking timescale of 10 mins, what would be a good value for the drift_smoothing parameter?
The text was updated successfully, but these errors were encountered: