Abstract
In modern large-scale pig farming, accurately identifying sow estrus and ensuring timely breeding are crucial for maximizing economic benefits. However, the short duration of estrus and the reliance on subjective human judgment pose significant challenges for precise insemination timing. To enable non-contact, automated estrus detection, this study proposes an improved algorithm, Enhanced Context-Attention YOLO (ECA-YOLO), based on YOLOv11. The model utilizes ocular appearance features-eye's spirit, color, shape, and morphology-across different estrus stages as key indicators. The MSCA module enhances small-object detection efficiency, while the PPA and GAM modules improve feature extraction capabilities. Additionally, the Adaptive Threshold Focal Loss (ATFL) function increases the model's sensitivity to hard-to-classify samples, enabling accurate estrus stage classification. The model was trained and validated on a dataset comprising 4461 images of sow eyes during estrus and was benchmarked against YOLOv5n, YOLOv7tiny, YOLOv8n, YOLOv10n, YOLOv11n, and Faster R-CNN. Experimental results demonstrate that ECA-YOLO achieves a mean average precision (mAP) of 93.2%, an F1-score of 88.0%, with 5.31M parameters, and FPS reaches 75.53 frames per second, exhibiting superior overall performance. The findings confirm the feasibility of using ocular features for estrus detection and highlight the potential of ECA-YOLO for real-time, accurate monitoring of sow estrus under complex farming conditions. This study lays the groundwork for automated estrus detection in intensive pig farming.