Abstract
Deep learning-based methods have advanced animal pose estimation, enhancing accuracy, and efficiency in quantifying animal behavior. However, these methods frequently experience tracking drift, where noise-induced jumps in body point estimates compromise reliability. Here, we present the anti-drift pose tracker (ADPT), a transformer-based tool that mitigates tracking drift in behavioral analysis. Extensive experiments across cross-species datasets—including proprietary mouse and monkey recordings and public Drosophila and macaque datasets—demonstrate that ADPT significantly reduces drift and surpasses existing models like DeepLabCut and SLEAP in accuracy. Moreover, ADPT achieved 93.16% identification accuracy for 10 unmarked mice and 90.36% accuracy for freely interacting unmarked mice, which can be further refined to 99.72%, enhancing both anti-drift performance and pose estimation accuracy in social interactions. With its end-to-end design, ADPT is computationally efficient and suitable for real-time analysis, offering a robust solution for reproducible animal behavior studies. The ADPT code is available at https://github.com/tangguoling/ADPT.
Introduction: The Challenge of Tracking Drift
Quantifying animal behavior relies on accurately tracking body parts (keypoints) across video frames. While tools like DeepLabCut (DLC) and SLEAP have revolutionized the field, they frequently suffer from tracking drift. This occurs when noise, occlusions, or similar-looking objects cause the model to "jump" a keypoint to the wrong location—for instance, mistaking a shadow for a mouse's ear or an eye for a nearby object.
Current solutions are often "band-aids": manual human refinement (too slow), signal filters (which can erase real high-frequency data like tremors), or linear dynamic models (which fail during long-duration drifts). The authors of ADPT argue that drift needs to be solved at the architectural level, not through post-processing.
Methods: A Hybrid CNN-Transformer Architecture
ADPT introduces a hybrid architecture designed to capture both local features and global context:
- CNN Backbone: Uses the first two stacks of a ResNet50 to extract shallow, local features such as textures and edges.
- Transformer Module: Processes features at a 1/16 scale using a multi-head attention mechanism. This allows the model to learn "global dependencies"—essentially understanding the geometric relationship between body parts (e.g., a tail tip must be connected to the tail base), which prevents keypoints from drifting to unrelated parts of the frame.
- Multi-Task Heads: The network simultaneously performs Low-Resolution Semantic Segmentation (LRSS) and calculates Body Affinity Fields (BAF). LRSS helps identify which pixels belong to which individual animal, while BAF acts as a "link" between keypoints, ensuring limbs are associated with the correct body—a vital feature for tracking multiple unmarked animals.
Key Results and Performance
The researchers validated ADPT across an impressive range of species, including mice, monkeys, flies, and dogs.
- Accuracy: On the public fly dataset, ADPT achieved a 92.8% mAP, surpassing both DLC and SLEAP.
- Drift Reduction: In 240-minute mouse videos, ADPT showed significantly lower Root Mean Squared Error (RMSE) compared to competitors, particularly for challenging parts like the tail tip.
- Social Tracking: For freely interacting unmarked mice, ADPT reached 90.36% identity accuracy, which improved to 99.72% after simple temporal correction.
- Speed: Despite the Transformer overhead, ADPT runs at ~90 frames per second (fps) on an RTX 4090, making it suitable for real-time behavioral analysis.
Discussion and Future Directions
One of the most significant findings was ADPT's data efficiency; it achieved acceptable performance with as few as 350 annotated images, making it highly practical for researchers. While ADPT excels at reducing drift, the authors note that tail tracking in dense social contexts remains a challenge due to complex occlusions. Future work will focus on integrating more powerful backbones and expanding synthetic data generation to better simulate natural social behaviors.
Summary updated