Timely and accurate detection of sow oestrus is crucial for enhancing reproductive efficiency and reducing non-productive days (NPDs) in large-scale pig farms. However, traditional manual observation is labour-intensive and subjective, while cloud-based deep learning solutions face challenges such as high latency and privacy risks when applied in intensive housing environments. This study developed an edge-intelligent monitoring system that integrates deep temporal modelling with sound source localisation technology. A three-stage hierarchical screening strategy was utilised to select and deploy a lightweight Stacked-LSTM model on the resource-constrained ESP32-S3 hardware platform. This model was trained and calibrated using a high-quality acoustic dataset validated against serum reproductive hormones, specifically follicle-stimulating hormone (FSH), luteinising hormone (LH), and progesterone (). Experimental results demonstrate that the optimised model achieved a classification accuracy of 96.17%, with an inference latency of only 41 ms, thereby fully satisfying the stringent real-time monitoring requirements while maintaining a minimal memory footprint. Furthermore, the system integrates a localisation algorithm based on Generalised Cross-Correlation with Phase Transform (GCC-PHAT). Through spatial geometric modelling, the system successfully implements the functional mapping of vocalisation events to individual gestation stalls (Stall IDs). Laboratory pressure tests validated the robustness and low-cost deployment advantages of the “edge recognition–cloud synchronization” architecture, providing a reliable technical framework for the precision management of smart livestock farming.
Accidental crushing by sows is the primary cause of pre-weaning piglet mortality in intensive production, often due to the spatiotemporal lag of manual inspection. While Internet of Things (IoT) solutions exist, they frequently face challenges such as vision occlusion, high hardware costs, and latency. To address these, this study developed a low-cost multi-modal edge computing system based on TinyML. Using an ESP32-S3 microcontroller, the system employs a “Motion-Gated Acoustic Detection” strategy, activating a lightweight 1D-CNN model to identify piglet screams only when an IMU detects high-risk postural transitions of the sow. Results show the quantized model (5.1 KB) achieves 95.56% accuracy and 2 ms inference latency. The total end-to-end response latency is within 179 ms, ensuring intervention within the early “golden rescue window.” The low-power design enables the battery life to cover the entire lactation period. Field tests demonstrated that the system intercepted identified crushing risks within the monitored cohort, supporting its potential for significantly improving piglet survival probability. This research overcomes the limitations of single-modal monitoring and provides a scalable, cost-effective engineering intervention for enhancing animal welfare and achieving intelligent, unattended supervision in precision livestock farming.