TL;DR
This paper introduces a lightweight, real-time cattle behavior recognition system using an enhanced YOLOv11n architecture. By integrating novel attention, feature fusion, and efficient convolution modules, the model achieves high accuracy in identifying standing, lying, and eating behaviors while being small and fast enough for deployment on low-power edge devices on farms.
What Problem Does This Paper Address?
Monitoring cattle behavior is crucial for animal health, welfare, and productivity. Manual observation is time-consuming and prone to errors. While wearable sensors exist, they can be expensive, stressful for animals, and difficult to maintain. Existing automated vision-based methods often prioritize accuracy at the cost of computational complexity, making them unsuitable for deployment on resource-constrained farm edge devices. This creates a gap for affordable, efficient, and non-intrusive real-time monitoring solutions that can be readily adopted by small and medium-sized farms.
Methods
The core of this research is an improved YOLOv11n architecture designed for lightweight deployment. Key enhancements include:
- Multidimensional Collaborative Attention (MCA): This mechanism helps the model focus on discriminative regions within an image, improving feature extraction for behaviors like head posture during feeding or body contours during lying.
- Generalized Efficient Layer Aggregation Network (GELAN): This module enhances multi-scale feature integration and gradient flow, improving the model's ability to capture subtle behavioral features.
- Bidirectional Feature Pyramid Network (BiFPN): Used for efficient cross-scale feature fusion, allowing the model to combine information from different resolution levels.
- Depthwise Separable Convolution (DWConv): Replaces standard convolutions to significantly reduce model parameters and computational load, making it suitable for edge devices.
- Layer-Adaptive Magnitude-based Pruning (LAMP): A post-training optimization technique that further compresses the model by adaptively removing redundant weights, achieving significant reductions in size and computational cost while minimizing accuracy loss.
Datasets
The study utilized the Korean Beef Cattle Farming Monitoring Dataset. This dataset contains annotations for three key cattle behaviors: standing, lying down, and feeding. The images were captured under various lighting conditions (daylight, artificial, infrared) and include complex scenarios like mutual occlusion and barrier obstructions. For this study, the dataset was split into training (10,698 images), validation (1100 images), and test (1000 images) sets at an 8:1:1 ratio.
Key Insights and Ideas
- Lightweight architecture is paramount for farm deployment: The paper strongly emphasizes that high accuracy alone is insufficient; models must be computationally efficient to be practical for real-world farm applications.
- Attention and feature fusion are key to robust behavior recognition: Integrating MCA and BiFPN significantly improves the model's ability to discern subtle behavioral cues, even in challenging visual conditions.
- DWConv is a critical component for edge deployment: Replacing standard convolutions with DWConv drastically reduces model size and computational demands without a substantial hit to accuracy.
- LAMP pruning offers a powerful, adaptive compression strategy: This algorithm effectively reduces model size and computational cost by intelligently removing weights, outperforming simpler pruning methods by adapting sparsity levels per layer.
- Real-time monitoring is achievable on low-cost hardware: The combination of architectural improvements and pruning makes the system viable for deployment on inexpensive edge devices, democratizing precision livestock farming.
Key Results
- The improved YOLOv11n model achieved high recognition accuracies: 91.2% for standing, 91.0% for lying, and 93.9% for eating ([email protected]).
- After pruning with LAMP, the model was compressed to 1.06 × 10<sup>6</sup> parameters, with a computational cost of 6.3 GFLOPS and a weight size of 2.4 MB.
- The pruned model retained 90.7% [email protected], demonstrating excellent accuracy retention.
- The system achieved a frame rate of 153.9 FPS at a 1.50x acceleration ratio, enabling real-time monitoring.
- The model showed good robustness under different lighting conditions, with [email protected] values of 91.7% (daylight) and 91.1% (artificial light). A slight performance drop was observed under infrared light (88.5%), attributed to reduced visual cues.
Limitations and Future Work
- Limited behavioral repertoire: The current model is trained on three static behaviors (standing, lying, eating). Future work should expand to include dynamic actions (walking, drinking, ruminating) and critical abnormal behaviors (lameness, aggression).
- Single-image analysis: The model currently operates on individual images. Incorporating temporal information by extending to video sequence analysis could improve robustness and enable behavior prediction.
- Dataset diversity: While the dataset includes various lighting conditions, future research could benefit from training on more extensive datasets with diverse environmental challenges, occlusions, and different cattle breeds to further enhance generalization.
Summary updated