Pig counting is an important task in pig sales and breeding supervision. Currently, manual counting is low-efficiency and high-cost and presents challenges in terms of statistical analysis. In response to the difficulties faced in pig part feature detection, the loss of tracking due to rapid movement, and the large counting deviation in pig video tracking and counting research, this paper proposes an improved pig counting algorithm (Mobile Pig Counting Algorithm with YOLOv5xpig and DeepSORTPig (MPC-YD)) based on YOLOv5 + DeepSORT model. The algorithm improves the detection rate of pig body parts by adding two different sizes of SPP networks and using SoftPool instead of MaxPool operations in YOLOv5x. In addition, the algorithm includes a pig reidentification network, a pig-tracking method based on spatial state correction, and a pig counting method based on frame number judgment on the DeepSORT algorithm to improve pig tracking accuracy. Experimental analysis shows that the MPC-YD algorithm achieves an average precision of 99.24% in pig object detection and an accuracy of 85.32% in multitarget pig tracking. In the aisle environment of the slaughterhouse, the MPC-YD algorithm achieves a correlation coefficient (R2) of 98.14% in pig counting from video, and it achieves stable pig counting in a breeding environment. The algorithm has a wide range of application prospects.
10 October 2025 in Computers and Electronics in Agriculture
Accurate individual egg-laying detection is crucial for eliminating low-yielding breeder ducks and improving production efficiency. However, existing methods are often expensive and require strict environmental conditions. This study proposes a data processing method based on wearable sensors and joint time-frequency representation (TFR), aimed at accurately identifying egg-laying in ducks. First, the sensors continuously monitor the ducks' activity and collect corresponding X-axis acceleration data. Next, a sliding window combined with Short-Time Fourier Transform (STFT) is applied to convert the continuous data into spectrograms within consecutive windows. SqueezeNet is then used to detect spectrograms containing key features of the egg-laying process, marking these as egg-laying state windows. Finally, Kalman filtering was used to continuously predict the detected egg-laying status, allowing for the precise determination of the egg-laying period. The best detection performance was achieved by applying the 10-fold cross-validation to a dataset of 59,135 spectrograms, using a window size of 50 min and a step size of 3 min. This configuration yielded an accuracy of 95.73 % for detecting egg-laying status, with an inference time of only 2.1511 milliseconds per window. The accuracy for identifying the egg-laying period reached 92.19 %, with a precision of 93.57 % and a recall rate of 91.95 %. Additionally, we explored the scalability of the joint time-frequency representation to reduce the computational complexity of the model.
Recent progress in deep learning has significantly improved remote sensing change detection. However, existing methods often struggle with pseudo-changes, multi-scale targets, and the trade-off between accuracy and efficiency. We present MSA-Net, a novel Multi-Scale Adaptive Network aimed at mitigating these challenges. MSA-Net builds upon a Resnet50 backbone and introduces three key components: (1) a Spatially Gated Fusion Module (SGFM) to suppress pseudo-changes via an invariance-aware gating mechanism; (2) a Multi-Scale Object Adaptive (MSOA) module that dynamically adjusts receptive fields to handle varying object scales; and (3) an enhanced Mamba decoder for efficient global context modeling with linear complexity. Extensive experiments on LEVIR-CD, WHU-CD, and SYSU-CD demonstrate that MSA-Net achieves state-of-the-art F1-scores of 91.49 %, 94.46 % and 83.86 %, respectively, all while maintaining high computational efficiency.