Abstract
Accurate monitoring of cattle behavioral time budgets is crucial for early disease detection and welfare assessment. Changes in durations of standing, lying, and eating are known to be early indicators of health issues such as lameness and metabolic disorders. To enable low-cost, non-invasive, and real-time monitoring, this study proposes a lightweight cattle behavior recognition method based on an improved YOLO11n architecture. The model enhances multi-scale feature integration through a generalized efficient layer aggregation network (GELAN), improves feature extraction via a multidimensional collaborative attention (MCA) mechanism, and achieves efficient cross-scale fusion using a bidirectional feature pyramid network (BiFPN). Depthwise separable convolution (DWConv) is incorporated to reduce computational load. Experimental results demonstrate high recognition accuracy, with mAP@0.5 values of 91.2%, 91.0%, and 93.9% for standing, lying, and eating, respectively. The model was subsequently compressed using a Layer-adaptive Magnitude-based Pruning (LAMP) algorithm, resulting in a final model of only 1.06 × 10(6) parameters, a computational cost of 6.3 GFLOPS, and a weight size of 2.4 MB, while retaining 90.7% mAP@0.5. This highly efficient system is suitable for deployment on resource-constrained edge devices, providing a practical tool for continuous cattle monitoring. It offers a viable pathway for farmers to adopt precision livestock farming practices, facilitating early health intervention and promoting animal welfare.