# Enhancing Pig Behavior Recognition in Complex Environments: A Transfer Learning-Assisted YOLO11 Network with Wavelet Convolution and Synergistic Attention

**Authors:** Taoyang Wang, Yu Hu, Hua Yin

PMC · DOI: 10.3390/ani16060964 · Animals : an Open Access Journal from MDPI · 2026-03-19

## TL;DR

This paper introduces a new AI system for accurately and efficiently recognizing pig behaviors in real-time, using advanced techniques to improve performance and scalability in smart farming.

## Contribution

A novel lightweight YOLO11-based system with wavelet convolution and attention mechanisms for high-accuracy pig behavior recognition in complex environments.

## Key findings

- The proposed model achieves 97.4% mAP@0.5 and 72.28 FPS, balancing lightweight characteristics and accuracy.
- Ablation studies confirm the effectiveness of individual components like SCSA-CBAM, WFU, and WTConv.
- The system outperforms baselines in accuracy while maintaining low computational requirements.

## Abstract

Pigs’ behavioral changes are important indicators of their health and welfare. Traditional manual monitoring is inefficient, labor intensive, and lacks scalability for continuous real-time livestock management. This study targets six core pig behaviors covering feeding, resting, activity, and behaviors associated with physiological metabolism. We propose a lightweight and high-precision pig behavior recognition system based on YOLO11n, combined with Spatial Cross-Scale Attention (SCSA), a Weighted Feature Fusion Unit (WFU), and Wavelet Transform Convolution (WTConv). We adopt a two-stage transfer learning strategy: freezing the backbone during initial training, and then fine-tuning the full network. Experiments show that the model achieves 97.4% mAP@0.5 and 72.28 FPS, balancing lightweight characteristics and recognition accuracy. This system supports intelligent pig farming and animal welfare monitoring, offering a practical solution for smart livestock management.

Pig behavior recognition plays a vital role for early disease detection, animal welfare evaluation, and precision agriculture. Current deep learning methods tend to be complex, parameter intensive, or lack generalization in unstructured farming scenarios, hindering their deployment on resource-limited devices. To address this issue, we propose three optimizations based on the lightweight YOLO11n: (1) embed SCSA-CBAM in C3k2 layers to enhance multi-scale feature discrimination; (2) introduce WFU in the neck for dynamic cross-scale feature integration; and (3) replace standard convolutions in the backbone with WTConv to reduce the computational overhead. Initialized with COCO pre-trained weights, the proposed model employs a two-stage transfer learning approach combined with data augmentation. On a self-built six-category pig behavior dataset based on public datasets of 2480 original images (split into training/validation sets at an 8:2 ratio via stratified random sampling), the optimized YOLO11n-SCSA-WFU-WT achieves an mAP@0.5 of 0.974 and mAP@0.5:0.95 of 0.785, with 3.40 M parameters, 7.8 GFLOPs, and 72.28 FPS, while achieving substantial accuracy improvements over the baseline and maintaining lightweight performance over the baseline. Ablation experiments verify the independent contributions of each module, and comparisons with mainstream models demonstrate a more favorable accuracy–efficiency trade-off. The overall results confirm the effectiveness of our method, which facilitates real-time pig behavior detection in future smart livestock management.

## Full-text entities

- **Species:** Sus scrofa (pig, species) [taxon 9823]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC13023269/full.md

## Figures

15 figures with captions in the complete paper: https://tomesphere.com/paper/PMC13023269/full.md

## References

43 references — full list in the complete paper: https://tomesphere.com/paper/PMC13023269/full.md

---
Source: https://tomesphere.com/paper/PMC13023269