-
Notifications
You must be signed in to change notification settings - Fork 251
3. More on drift correction
Here we get into the details of drift: why it happens, what it looks like, how you can characterize it for your own recordings, and how you can tell if Kilosort2 is fixing it.
Some amount of drift is unavoidable: the brain floats inside the skull, and moves when the animal moves on fast timescales, while on slow timescales physiological changes happen, some of which may be induced by the presence of the probe itself. Thus, there are two main types of drift, which we treat differently: slow (10s of minutes) and fast (10s of seconds). Slow drift is not a huge problem if the recording is short (<20 minutes). Fast drift is not a huge problem if the animal is not behaving. However, neither is true in a typical neuroscience experiment: the animal is performing a task which involves some motor actions, and it takes at least 30-60 minutes to characterize the neural activity. In a typical recording of 1-2 hours, the amount of slow and fast drift we'd expect is comparable, and can be anywhere from 5 to 20um and more if your preparation is unstable.
To recognize drift, look for changes in spike amplitude over time, or changes in feature amplitudes, where the feature can be the projection on the principal components of a channel. More dramatically, a cluster may simply "drop out" and its spikes lost when drift is too large. See the two examples below of slow and fast drift that Kilosort2 tracked, as well as a third cluster that was lost halfway through the recording.
Slow drift is generally easier to recognize and fix. A well-known version of slow drift happens after probe insertion in an acute experiment, which is why it is typical to wait 20-30 minutes for the tissue to relax before recording. However, even after that initial phase, there is a smaller amplitude, slow timescale drift that continues for at least a few hours, and has been reported to us even in chronic implants. Cumulative over time, slow drift can have a significant impact on spike sorting.
Fast drift is harder to diagnose but potentially more dangerous, because it may introduce behavior-dependent biases into the data. The bias may be produced if every time an animal performs a certain motor action, the probe moves a little, in which case the spikes from a small neuron may be completely lost. It will then appear as if this neuron was inhibited by movement. Conversely, a neuron may only come into the range of the electrodes during the movement, in which case it will appear as if that neuron is activated by movement. This behavior also makes fast drift harder to diagnose, because most neurons in the brain genuinely have movement-related spiking activity.
The main way to diagnose drift is, in fact, to run the first step of Kilosort2, which produces an interpretable picture of the spike waveform similarities between any two moments in the recording.