Skip to content
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

Improve point trajectory estimation by aggregating across sources #349

Open
sfmig opened this issue Nov 22, 2024 · 6 comments
Open

Improve point trajectory estimation by aggregating across sources #349

sfmig opened this issue Nov 22, 2024 · 6 comments
Labels
enhancement New optional feature

Comments

@sfmig
Copy link
Contributor

sfmig commented Nov 22, 2024

The simplest case may be centroid tracking, for example obtained with idtracker and SLEAP independently.

The question is: can we combine these two (or more) sources of information to produce a more accurate trajectory for the centroid?

This may be more relevant for a multi-animal case in which there are id swaps, but the two methods to get the data may fail in different cases.

Some options could be: to use the most reliable one to correct the other (for a given definition of reliable), take some kind of consensus, consider sensor fusion approaches like Kalman filter, or taking the rolling median filter using both sources of data. Another approach could be taking the mean of both sources (so somewhat related to this #271).

Some sample data that we could use for this is the EPM:

  • DLC_single-mouse_EPM.predictions.csv (or the equiv .h5 file) as the "more reliable" source, and
  • SLEAP_single-mouse_EPM.analysis.h5 (or the equivalent .slp file), which is generated using a model trained on less data (should be less reliable).
  • They differ in the number of keypoints so we could using the intersection set, or the centroid for this analysis.
@sfmig sfmig added the enhancement New optional feature label Nov 22, 2024
@sfmig sfmig moved this to 🤔 Triage in movement progress tracker Nov 22, 2024
@roaldarbol
Copy link

For reference, trex can output "tracklets" or each individual: Small egocentric videos of each individual (centered on their centroid) which can then be tracked using SLEAP or DLC. Haven't tried it myself though.

@sfmig
Copy link
Contributor Author

sfmig commented Dec 9, 2024

thanks @roaldarbol for pointing this out, idtracker can do this too (see the tip box here)

@roaldarbol
Copy link

Ah, so cool, didn't know they did it too!!!

@parikshit14
Copy link

Hi @sfmig, is this issue still relevant? I would be happy to take it up.

@sfmig
Copy link
Contributor Author

sfmig commented Mar 25, 2025

Hi @parikshit14, yes we are still interested in exploring how to best support this.

You can find the datasets mentioned above in the movement test data repo. You can see an example on how to access them here. Other datasets that may be useful are:

  • SLEAP_two-mice_social-interaction.analysis.h5 and SLEAP_two-mice_social-interaction.predictions.slp (I am not sure if there is a more reliable one)
  • SLEAP_three-mice_Aeon_mixed-labels.analysis.h5 as the "less reliable" and SLEAP_three-mice_Aeon_proofread.analysis.h5 as the more reliable.

Let me know if you need any help!

@niksirbi
Copy link
Member

SLEAP_two-mice_social-interaction.analysis.h5 and SLEAP_two-mice_social-interaction.predictions.slp (I am not sure if there is a more reliable one)

I think these two files contain the exact same data in different formats, so probably not very helpful for trying out aggregation approaches.

SLEAP_three-mice_Aeon_mixed-labels.analysis.h5 as the "less reliable" and SLEAP_three-mice_Aeon_proofread.analysis.h5 as the more reliable.

This one should work for that purpose though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New optional feature
Projects
Status: 🤔 Triage
Development

No branches or pull requests

4 participants