DOI: 10.3390/ani16162520 ISSN: 2076-2615

DMFRNet: Dynamic Multi-Scale Feature Reweighting Network for Dairy Cow Detection

Zhihang Wei, Gaohan Zhao, Zhiyu Yu, Xiaoqian Li, Qiuchen Li, Donghui Wei

Achieving accurate cattle detection in complex barn environments is a critical technical challenge for smart livestock farming. Cattle exhibit highly similar appearances, severe occlusion, and significant multi-scale variations, making it difficult for existing detection methods to balance accuracy with model efficiency. This paper proposes a lightweight cattle detection model, DMFRNet, with YOLO11 as the baseline. To address these challenges, DMFRNet introduces three targeted improvements. First, C3K2-DIMB is designed to enhance multi-scale feature extraction by adaptively reweighting multi-branch depthwise convolution features, thereby improving the representation of cattle with different body sizes, poses, and viewing distances. Second, SimAM is embedded after the SPPF layer to refine high-level semantic features without introducing additional parameters, which improves feature discrimination under occlusion, low contrast, and complex backgrounds. Third, LSCDH replaces the original decoupled detection head to reduce parameter redundancy through cross-scale shared convolution while preserving multi-scale prediction capability. These designs jointly address the key challenges of multi-scale cattle appearance, occlusion, and lightweight model construction in complex barn scenes. Experimental results on the combined CBVD-5 and Dairy Cow dataset demonstrate that DMFRNet achieves a Precision of 93.49%, F1 of 89.84%, mAP50 of 93.85%, and mAP50–95 of 61.74%, with only 2.16 M parameters, 5.10 GFLOPs, and a model size of 4.5 MB. Comparative experiments demonstrate that DMFRNet provides a favorable accuracy–efficiency trade-off for lightweight dairy cow detection.

More from our Archive