Kilosort icon indicating copy to clipboard operation
Kilosort copied to clipboard

KS4 over-merging units

Open florgf88 opened this issue 10 months ago • 6 comments

Describe the issue:

Hi, I have recently tried KS4, which yielded nice clusters across some regions in a NP 1 recording. However, in one of the areas I'm interested in, which has high activity during my experiments, not several clusters were detected (highlighted in white in the spike position across the probe plot). Screenshot 2024-04-12 180243

When I looked at the units from this area in Phy, I noticed that most of them are MUAs with high violations in the RP. In this example, the distribution of the amplitude looks bimodal: Capture

I have compared the results in pyKilosort for this area, and it seems that KS4 is over-merging clusters. Is there any way to control this? I tried adjusting Th(universal) and Th(learned), but it didn't help.

I appreciate any help or suggestion, many thanks!

florgf88 avatar Apr 18 '24 11:04 florgf88

Have you tried to split this unit by amplitude to see if it's really two units? Sometimes a small amplitude unit like that can look bimodal. Also, please send side by side plots from pykilosort to show how that worked better.

On Thu, Apr 18, 2024, 7:15 AM Florencia Gonzalez Fleitas < @.***> wrote:

Describe the issue:

Hi, I have recently tried KS4, which yielded nice clusters across some regions in a NP 1 recording. However, in one of the areas I'm interested in, which has high activity during my experiments, not several clusters were detected (highlighted in white in the spike position across the probe plot). Screenshot.2024-04-12.180243.png (view on web) https://github.com/MouseLand/Kilosort/assets/68202933/4ad155f8-f659-4530-a352-faf0b99c4151

When I looked at the units from this area in Phy, I noticed that most of them are MUAs with high violations in the RP. In this example, the distribution of the amplitude looks bimodal: Capture.PNG (view on web) https://github.com/MouseLand/Kilosort/assets/68202933/dde1d77d-d71d-4ebd-b1ef-6db49bd8e740

I have compared the results in pyKilosort for this area, and it seems that KS4 is over-merging clusters. Is there any way to control this? I tried adjusting Th(universal) and Th(learned), but it didn't help.

I appreciate any help or suggestion, many thanks!

— Reply to this email directly, view it on GitHub https://github.com/MouseLand/Kilosort/issues/667, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6AYDRLZQJWBDBMWI5T6DTY56TMBAVCNFSM6AAAAABGNBWSCWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2TANBSGM4DMNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

marius10p avatar Apr 18 '24 13:04 marius10p

Hi Marius, many thanks for the response.

I tried to split it, here's the result: Screenshot 2024-04-18 141554

In pyKilosort the clusters look like this: image

florgf88 avatar Apr 18 '24 13:04 florgf88

Thanks, can you please show the good cluster view for this entire area like you did for Kilosort4? It's possible that individual cluster exmaples are segmented better by one algorithm or another, but it would be good to see a picture showing KS2.5 consistently being better in this area.

marius10p avatar Apr 18 '24 13:04 marius10p

Yes, of course. I hope this picture helps. It's the area between 2800-2500 um. Screenshot 2024-04-18 160825

florgf88 avatar Apr 18 '24 15:04 florgf88

Looks similar doesn't it? The area in 1800-2200 looks like there are plenty of units for both algorithms and the 2200-2800 is similarly sparse for both. That area 2200-2800 just seems like higher noise / lower amplitude units, right?

marius10p avatar Apr 18 '24 15:04 marius10p

Yes, exactly. Units in this area have lower amplitude generally. It's true that there are not that many, but we still have some. I tried to decrease the learned Th first, but it got worse in general.

florgf88 avatar Apr 18 '24 15:04 florgf88

I am not sure if this message means you agree with us, but basically to me it looks like both algorithms perform similarly in terms of how many good units they find in that particular region. Perhaps the different visualizations make this harder to compare but if I just try to count them, I don't see a big difference.

marius10p avatar May 10 '24 18:05 marius10p