CowCare: A Unified Visual Framework for Viewpoint-Robust Cattle Tracking and Spatiotemporal Heat-Stress Analysis
Organizations: College of Information and Electrical Engineering, China Agricultural University, Beijing, 100083, China · National Innovation Center for Digital Fishery, Ministry of Agriculture and Rural Affairs, Beijing, 100083, China · Key Laboratory of Smart Farming Technologies for Aquatic Animal and Livestock, Ministry of Agriculture and Rural Affairs, Beijing, 100083, China · Key Laboratory of Agricultural Informatization Standardization, Ministry of Agriculture and Rural Affairs, Beijing, 100083, China
Abstract
Reliable individual monitoring is essential for dairy cattle welfare and early heat stress detection in Precision Livestock Farming (PLF). However, translating raw multi-camera videos into automated diagnostics remains challenging due to disconnected tracking and recognition pipelines and complex physical environments. Dense mutual occlusions and cross-camera viewpoint variations fragment identities, while environmental noise, including camera vibrations, and limited agricultural data obscure subtle heat stress cues such as rapid breathing and flank undulations. To bridge low-level visual features and high-level behavioral diagnostics, we propose CowCare, a unified framework combining viewpoint-robust tracking with spatiotemporal heat stress recognition. Its tracking module, CowTrack, maintains cross-camera identity consistency through a View-Decoupled Aggregation Network (VDA-Net). Instead of relying on static global representations, VDA-Net aggregates localized textures under heavy occlusion and uses a Viewpoint Decoupling Transformer (VDT) to suppress transient viewpoint variations. CowTrack further incorporates a causal online self-supervision mechanism for continuous adaptation to dynamic farm scenes. The resulting tracklets are subsequently processed by TSDF-Net, a fine-grained video understanding network. Its Temporal Stabilization and Aggregation Module (TSAM) suppresses high-frequency jitter, while a Diffusion Semantic Prior (DSP) uses frozen pre-trained diffusion semantics to enhance subtle behavioral signals and mitigate overfitting. Extensive evaluations on two real-world farm benchmarks demonstrate the framework's effectiveness: CowTrack achieves 83.48% HOTA and 87.72% IDF1 for global multi-object tracking on MVCow, and TSDF-Net achieves 87.72% Top-1 accuracy on HSCow. These results establish CowCare as a robust end-to-end framework for automated livestock health monitoring.
Figures & tables
| Dataset | Farm Location | Area | Time | Videos | Purpose |
| MVCow | Yanqing, Beijing | Intersection of milking channel and parlor | Apr 2025 | 12 Clips | Train and evaluate object detection, ReID, and MOT models |
| HSCow | Shandong | Barn cooling zone | Jun-Sep 2025 | 6 Clips | Train and evaluate heat stress behavior recognition models |
| Task | Data Format | Split Method | Training Set | Testing Set |
| Object Detection | YOLO | Frame | 7,128 Frames | 3,056 Frames |
| Multi-Object Tracking | MOT17 | Video Clip | — | 12 Clips |
| Re-Identification | Market-1501 | Identity | 115 IDs / 54,230 Images | Query: 33 IDs / 103 Images Gallery: 33 IDs / 24,223 Images |
| Category | Number of Clips | Avg. Duration (s) |
| Normal | 748 | 15.17 |
| Heat Stress | 383 | 13.78 |
| Total | 1131 | 14.70 |
| Method | Rank-1 | Rank-5 | mAP |
| CLIP-ReID ( Li et al., 2023 ) | 97.36 | 99.84 | 82.45 |
| DGNet ( Zheng et al., 2019 ) | 92.89 | 97.81 | 81.79 |
| HOReID ( Wang et al., 2021 ) | 61.28 | 62.89 | 62.67 |
| OSNet ( Zhou et al., 2019 ) | 98.90 | 99.90 | 99.60 |
| PCB ( Sun et al., 2018 ) | 61.79 | 63.04 | 63.07 |
| PersonViT ( Hu et al., 2025 ) | 94.90 | 99.10 | 93.20 |
| Method | HOTA | MOTA | IDF1 |
| BoostTrack ( Stanojević and Todorović, 2024 ) | 77.49 | 82.76 | 81.40 |
| ByteTrack ( Zhang et al., 2022b ) | 75.18 | 79.47 | 82.09 |
| BoT-SORT ( Aharon et al., 2022 ) | 68.87 | 79.04 | 72.11 |
| DeepSORT ( Wojke et al., 2017 ) | 75.07 | 80.03 | 81.30 |
| Deep OC-SORT ( Maggiolino et al., 2023 ) | 75.29 | 80.00 | 81.58 |
| Depth-OC-SORT ( Zhu et al., 2026 ) | 74.99 | 75.77 | 80.13 |
| Model | Top-1 | Precision | Recall | F1 |
| ActionDiff ( Guimarães et al., 2026 ) | 76.32 | 78.30 | 76.08 | 75.78 |
| SlowOnly-R50 ( Feichtenhofer et al., 2019 ) | 78.07 | 82.36 | 78.39 | 77.44 |
| SlowFast ( Feichtenhofer et al., 2019 ) | 70.18 | 81.11 | 70.69 | 67.62 |
| TSN ( Wang et al., 2016 ) | 78.07 | 78.51 | 77.96 | 77.93 |
| TSM ( Lin et al., 2019 ) | 76.32 | 76.97 | 76.45 | 76.23 |
| TimeSformer ( Bertasius et al., 2021 ) | 70.18 | 70.55 | 70.04 | 69.94 |
| Configuration | Rank-1 | Rank-5 | Rank-10 | mAP |
| Baseline | 96.03 | 98.72 | 99.05 | 96.69 |
| Outlook | 97.50 | 99.29 | 99.33 | 97.54 |
| vs. previous | ||||
| VDT | 99.83 | 99.98 | 99.98 | 99.67 |
| vs. previous |
| Configuration | HOTA | MOTA | IDF1 |
| Baseline | 77.49 | 82.76 | 81.40 |
| VDA-Net (Static) | 81.67 | 89.50 | 85.55 |
| vs. previous | |||
| Online Adaptation | 83.48 | 89.50 | 87.72 |
| vs. previous |
| Configuration | Top-1 | Precision | Recall | F1 |
| Baseline | 82.46 | 83.06 | 82.57 | 82.41 |
| TSAM | 83.30 | 87.33 | 83.62 | 82.95 |
| vs. previous | ||||
| DSP | 87.72 | 89.35 | 87.90 | 87.62 |
| vs. previous |
| Setup | Rank-1 | Rank-5 | Rank-10 | mAP |
| Single-CAM | 98.30 | 99.20 | 99.73 | 88.93 |
| Multi-CAM | 99.83 | 99.98 | 99.98 | 99.67 |
| Gain (pp) |
| Input Frames | Frame Interval | Top-1 | Precision | Recall | F1 | Heat Stress F1 | Heat Stress Recall |
| 4 | 1 | 88.60 | 88.68 | 88.64 | 88.60 | 88.70 | 91.07 |
| 4 | 8 | 89.47 | 89.63 | 89.53 | 89.47 | 89.66 | 92.86 |
| 6 | 1 | 86.84 | 88.17 | 87.01 | 86.76 | 87.80 | 96.43 |
| 6 | 8 | 87.72 | 88.83 | 87.87 | 87.66 | 88.52 | 96.43 |
| 8 | 1 | 86.84 | 88.74 | 87.04 | 86.72 | 88.00 | 98.21 |
| 8 | 8 | 87.72 | 89.35 | 87.90 | 87.62 | 88.71 | 98.21 |