Issues with mixed-size animal tracking #2443
-
|
Hi everyone, I’m using SLEAP (v1.5.1) for multi-animal tracking in a homecage setup with a Dam and prewean pups, and I have a few questions: Animals moving out of frame / becoming invisible Different-sized animals in the same video
Animal changing apparent size (moving close to camera) Overfitting after recursive labeling Thanks for any advice or experience with similar homecage setups! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hey @Jiaming-He !
When an animal moves partly out of frame / becomes "invisible", you don't have to skip these frames, as you can right-click on the occluded nodes in that frame in order to mark them as "not visible" when they leave frame. However, if the animal is completely not there, then there is no need to label. This also prevents making over-confident predictions on occluded parts. It is better to just label visible nodes and mark non-visible as occluded (set visibility to False). See more about proof-reading here.
For when animals differ greatly in size, the centroid receptive field size should be set larger to accommodate a size as large as your biggest animal in order to give the model enough context. To increase receptive field, it is important to control both max stride (increase to increase receptive field) and input scaling (decrease to increase receptive field). For example, relying on solely aggressive scaling reduces the resolution and can degrade performance. Additionally, scale augmentations would be better since the animals all vary in size. In your case, it is better to just train one model for all animals instead of separating per size group. Separate models are usually only needed if one group is extremely underrepresented or looks basically like a different species (very different shape/appearance across ages).
Here, we wouldn't recommend top-down here since using top-down would detect the centroid & crop the animal before sending the crop to the centered instance model and the big animals are going to be cropped. Instead try using bottom-up and label representative instances with all sizes while making sure your receptive field size is large enough so that the model knows what it is looking at without being so large that the features per animal are not discernible. Additionally, you could try lens correction to assist in visibility. For example, a pinhole model correction can help restore the original of shape of your equipment/mice. However ideally, for more consistent data, it may be worth considering change to experimental design such as moving the camera further up to accommodate for these situations.
Adding augmentations (i.e. scale, rotation, etc.) would help and enabling early stopping might help (if not already enabled). Sorry about the late response... Let us know if you have further questions! Best, |
Beta Was this translation helpful? Give feedback.
-
|
Dear Amick, Thank you for the clear and helpful guidance! The tips on training a single model for entire homecage and all age groups, labeling occlusions and using scale augmentations are very useful. We're changing our experimental design for better video qualities and thus better inference performance. Really appreciate your support which gives us a nice path forward. Best, |
Beta Was this translation helpful? Give feedback.


Hey @Jiaming-He !
To answer your questions:
When an animal moves partly out of frame / becomes "invisible", you don't have to skip these frames, as you can right-click on the occluded nodes in that frame in order to mark them as "not visible" when they leave frame. However, if the animal is completely not there, then there is no need to label. This also prevents making over-confident predictions on occlude…