Research on Video Behavior Detection and Analysis Model for Sow Estrus Cycle Based on Deep Learning

Kaidong Lei, Bugao Li, Shan Zhong, Hua Yang, Hao Wang, Xiangfang Tang, Benhai XiongAgriculture 2025 · DOI

TL;DR

This paper introduces a novel 3D-CNN model for automatically detecting and analyzing specific sow behaviors related to their estrus cycle using video data. By accurately identifying behaviors like fence-biting and head stillness, the model offers a non-invasive, efficient solution for precision livestock farming, improving breeding success and animal welfare.

What Problem Does This Paper Address?

Traditional methods for managing sow reproduction, particularly identifying the estrus cycle, are labor-intensive, subjective, and can be inefficient. This leads to missed breeding opportunities, reduced productivity, and potential welfare issues. While precision livestock farming aims to address these challenges with technology, accurately monitoring sow behavior in real-time, especially during the complex estrus period, remains difficult due to factors like individual pig variability, interference from other pigs, and subtle behavioral cues. This paper tackles the need for an automated, objective, and non-invasive system to monitor sow estrus behavior, thereby enhancing farm management and animal welfare.

Methods

The core of this research is a 3D Convolutional Neural Network (3D-CNN) model. Unlike traditional 2D-CNNs that process static images, 3D-CNNs are designed to capture spatiotemporal information, meaning they analyze both the spatial features within video frames and the temporal relationships between consecutive frames. This is crucial for understanding dynamic behaviors.

The authors employed a hybrid approach:

  • Feature Extraction: A ResNet50V2 model was used to extract spatial features from individual video frames. This is a well-established deep learning architecture for image analysis.
  • Spatiotemporal Learning: A 3D convolutional layer (Conv3D) was then applied to learn the dynamic patterns and temporal evolution of behaviors across multiple frames.
  • Attention Mechanism: An attention mechanism was integrated to focus on the most relevant parts of the video and key feature moments, helping to reduce noise and improve the detection of subtle behavioral cues.
  • Residual Connections: These were used to facilitate the training of deeper networks, improving the model's ability to learn complex patterns.
  • TimeDistributed Layer: This enabled the ResNet model to process each frame independently before feeding into the 3D-CNN, allowing for efficient handling of video sequences.

The model was trained and validated using Python and specifically designed for the four defined sow estrus behaviors: fence-biting (SOB), head stillness with ear erect posture (SOS), sniffing boar pheromones (SOC), and significant head swinging (SOW).

Datasets

The study utilized video data collected from 68 Canadian Landrace sows over a period from 2020 to 2024. The data was collected from the Core Breeding Center of the Chongqing Academy of Animal Science Farm and in Shandong, China. The dataset was split into training, verification, and testing sets in a 7:2:1 ratio. The paper does not explicitly state the creation of a new benchmark dataset but rather the use of collected video data for training and evaluating their proposed model.

Key Insights and Ideas

  • Spatiotemporal Analysis is Key: The paper strongly emphasizes that for animal behavior analysis, especially dynamic actions like those during estrus, simply looking at individual frames (2D) is insufficient. Capturing the motion and temporal sequence (3D) is critical for accurate recognition.
  • Behavioral Overlap is a Challenge: The authors highlight that during the estrus cycle, certain behaviors can overlap (e.g., restlessness leading to fence-biting, or general agitation causing head swinging). This overlap makes classification difficult and is a significant factor in misclassifications.
  • Attention Enhances Specificity: The integration of an attention mechanism proved valuable in focusing the model on crucial behavioral moments, helping to distinguish between similar-looking actions and reduce interference from irrelevant movements.
  • Non-Invasive Monitoring is Crucial: The research underscores the importance of non-contact, non-stressful monitoring methods for animal welfare and data integrity, especially in the context of disease prevention (like African Swine Fever).

Key Results

The 3D-CNN model demonstrated strong performance in classifying and semantically recognizing sow estrus behaviors:

  • Typical Behavior Classification:
    • SOB: Accuracy (1.00), Recall (0.90), F1-score (0.95)
    • SOC: Accuracy (0.96), Recall (0.98), F1-score (0.97)
    • SOS: Accuracy (1.00), Recall (0.96), F1-score (0.98)
    • SOW: Accuracy (0.86), Recall (1.00), F1-score (0.93)
    • Overall accuracy was approximately 96%.
  • Semantic Recognition (under challenging conditions like multi-pig interference and non-specific labeling):
    • SOB: Accuracy (1.00), Recall (0.90), F1-score (0.95)
    • SOC: Accuracy (0.89), Recall (0.89), F1-score (0.89)
    • SOS: Accuracy (0.91), Recall (1.00), F1-score (0.95)
    • SOW: Accuracy (1.00), Recall (1.00), F1-score (1.00)
    • Overall accuracy in these conditions was 95%.

A key qualitative finding is that the SOW behavior (significant head swinging) was the most prone to misclassification, often being confused with SOB (fence-biting), due to behavioral overlap.

Limitations and Future Work

The authors acknowledge several limitations:

  • Farm Access Difficulties: Due to ongoing African Swine Fever (ASF) control measures, accessing farms for data collection was challenging.
  • Predicting Sow Behavior: Accurately predicting sow behavior remains a complex task.
  • Hardware Dependency and Cost: The current model relies on high-performance hardware, which can lead to high deployment costs for field applications.

Future work suggested includes:

  • Further Data Collection: Expanding the dataset to improve model robustness and generalization.
  • Lower-Cost Hardware: Investigating the use of more affordable hardware for on-site validation and deployment.
  • Digital Twin Integration: Exploring the integration of digital twin technology to reconstruct and simulate sow estrus cycle behavior patterns, providing a more comprehensive tool for analysis and management.

Summary updated

Abstract

Against the backdrop of precision livestock farming, sow behavior analysis holds significant theoretical and practical value. Traditional production methods face challenges such as low production efficiency, high labor intensity, and increased disease prevention risks. With the rapid advancement of optoelectronic technology and deep learning, more technologies are being integrated into smart agriculture. Intelligent large-scale pig farming has become an effective means to improve sow quality and productivity, with behavior recognition technology playing a crucial role in intelligent pig farming. Specifically, monitoring sow behavior enables an effective assessment of health conditions and welfare levels, ensuring efficient and healthy sow production. This study constructs a 3D-CNN model based on video data from the sow estrus cycle, achieving analysis of SOB, SOC, SOS, and SOW behaviors. In typical behavior classification, the model attains accuracy, recall, and F1-score values of (1.00, 0.90, 0.95; 0.96, 0.98, 0.97; 1.00, 0.96, 0.98; 0.86, 1.00, 0.93), respectively. Additionally, under conditions of multi-pig interference and non-specifically labeled data, the accuracy, recall, and F1-scores for the semantic recognition of SOB, SOC, SOS, and SOW behaviors based on the 3D-CNN model are (1.00, 0.90, 0.95; 0.89, 0.89, 0.89; 0.91, 1.00, 0.95; 1.00, 1.00, 1.00), respectively. These findings provide key technical support for establishing the classification and semantic recognition of typical sow behaviors during the estrus cycle, while also offering a practical solution for rapid video-based behavior detection and welfare monitoring in precision livestock farming.
BibTeX
@inproceedings{lei2025research,
  author = {Kaidong Lei and Bugao Li and Shan Zhong and Hua Yang and Hao Wang and Xiangfang Tang and Benhai Xiong},
  title = {{Research on Video Behavior Detection and Analysis Model for Sow Estrus Cycle Based on Deep Learning}},
  booktitle = {Agriculture},
  year = {2025},
  doi = {10.3390/agriculture15090975},
}
Figure