AI Chat Paper
Note: Please note that the following content is generated by AMiner AI. SciOpen does not take any responsibility related to this content.
{{lang === 'zh_CN' ? '文章概述' : 'Summary'}}
{{lang === 'en_US' ? '中' : 'Eng'}}
Chat more with AI
PDF (4.6 MB)
Collect
Submit Manuscript AI Chat Paper
Show Outline
Outline
Show full outline
Hide outline
Outline
Show full outline
Hide outline
Publishing Language: Chinese

Feed residue detection on pig farms using improved YOLOv11n

Yixue LIU1,2, Yaqiong ZENG1,2, Yiyong HU3, Renli QI1,2, Xiangfang TANG4, Benhai XIONG4( ), Hao WANG1,2( )
Chongqing Academy of Animal Sciences, Chongqing 402460, China
National Swine Industry Technology Innovation Center, Chongqing 402460, China
Muyuan Foods Co., Ltd. NanYang 473000, China
Institute of Animal Sciences, Chinese Academy of Agricultural Sciences, Beijing 100193, China
Show Author Information

Abstract

Feed residue state in troughs has been one of the key indicators to optimize feed conversion rate and reduc waste, providing for early warnings of health abnormalities. Feed costs account for 60%–70% of total expenses in commercial pig production. It is often required to accurately monitor feed residues in troughs. However, residue levels show high inter-class visual similarity, with subtle boundaries between adjacent categories. Existing deep learning models are also confined to environmental factors and mage interference, including uneven illumination, suspended feed dust, and trough reflection. It is still lacking in the fine-grained feature extraction to separate visually similar states, such as small and medium residue. In this study, an improved YOLOv11n model, SWF-YOLO (Spatial and Channel Synergistic Attention Weight Fusion YOLO), was proposed for the end-to-end classification of four residue states. Accurate residue detection was realized to integrate into the baseline. The C2f modules in the backbone were replaced with C2f-SCSA modules for fine-grained feature extraction. A weight-fusion strategy replaced neck concatenation for adaptive multi-scale fusion. A C2PSA module was added to capture long-range spatial dependencies. A dataset of 7748 annotated samples was constructed from 308 growing pigs in 52 pens. A genetic algorithm was then used to optimize 16 hyperparameters over 300 iterations. The results show that the SWF-YOLO achieved a mean average precision at an IoU threshold of 0.5 (mAP50) of 93.78% on the test set. Its precision was 84.21%, recall was 89.40%, and F1-score was 86.73%. Compared with the YOLOv11n baseline, mAP50, recall, and F1-score were improved by 2.21, 4.92, and 3.96 percentage points, respectively. Parameters were reduced by 26.74% to 1.89 M, while the computational cost was 3.51 GFLOPs, and the inference speed reached 50.2 frames per second. These configurations fully met the requirements of real-time edge deployment. Ablation experiments showed that the SCSA module contributed the largest precision gain of 6.26 percentage points. The weight-fusion strategy improved the greatest efficiency, where computational cost was reduced by 16.14%. The full three-module combination yielded the best balance between accuracy and efficiency. Fine-grained discrimination also improved markedly. After genetic algorithm optimization, class-specific F1-scores reached 94.91%, 88.19%, 84.56%, and 80.23% for the no-, small-, medium-, and large-residue categories, respectively. Comparative experiments showed that the SWF-YOLO outperformed Faster R-CNN, YOLOv8n, YOLOv9t, YOLOv10n, and YOLOv12n. The mAP50 improvements were 2.54, 2.53, 1.95, 2.56, and 2.80 percentage points, respectively. Favorable accuracy and efficiency were balanced, suitable for resource-constrained edge devices in commercial pig farms. Grad-CAM visualization showed that the SCSA mechanism directed attention more precisely toward critical trough regions than the SE, CBAM, ECA, SGA, and CA modules. Fine-grained classification of feed residues can be expected to integrate spatial and channel attention, adaptive weighted feature fusion, and position-sensitive attention. High accuracy can also remain lightweight, particularly for feed-waste control and early health warning in precision livestock farming. These findings can provide a practical reference to develop intelligent monitoring equipment in commercial pig production.

CLC number: S24 Document code: A Article ID: 1002-6819(2026)-11-0069-10

References

【1】
【1】
 
 
Transactions of the Chinese Society of Agricultural Engineering
Pages 69-78

{{item.num}}

Comments on this article

Go to comment

< Back to all reports

Review Status: {{reviewData.commendedNum}} Commended , {{reviewData.revisionRequiredNum}} Revision Required , {{reviewData.notCommendedNum}} Not Commended Under Peer Review

Review Comment

Close
Close
Cite this article:
LIU Y, ZENG Y, HU Y, et al. Feed residue detection on pig farms using improved YOLOv11n. Transactions of the Chinese Society of Agricultural Engineering, 2026, 42(11): 69-78. https://doi.org/10.11975/j.issn.1002-6819.202601273

2

Views

0

Downloads

0

Crossref

0

Web of Science

0

Scopus

Received: 30 January 2026
Revised: 10 April 2026
Published: 15 June 2026
© Chinese Society of Agricultural Engineering 2026