Publications
Sort:
Issue
Detecting abnormal body temperature in group-housed pigs using dual-spectrum image registration and YOLO-DT
Transactions of the Chinese Society of Agricultural Engineering 2026, 42(11): 120-131
Published: 15 June 2026
Abstract PDF (3.1 MB) Collect
Downloads:0

Body temperature has been widely recognized as one of the most important physiological indicators to reflect the health status of pigs. A major challenge is to monitor individual health under intensive production, where a large number of animals are housed together. However, conventional visual inspection cannot identify the individual pigs with abnormal body temperatures, as subtle physiological changes are difficult to observe. Furthermore, rectal temperature measurement can often induce stress responses in pigs, particularly because the procedure is time-consuming and labor-intensive. These stress reactions compromise animal welfare and represent a biosecurity risk due to the increased likelihood of pathogen transmission. In the present study, a non-invasive real-time system was proposed to detect abnormal body temperatures in group-housed pigs using visible-light and infrared thermal imaging. The hardware platform consisted of a Xiaomi 10 Pro smartphone (Xiaomi Technology Co., Ltd., Beijing, China) paired with an InfiRay Xtherm T3S infrared thermal imager (InfiRay System Technology Co., Ltd., Anhui, China). A mobile application was self-developed to synchronously acquire visible-light images and infrared thermal matrices. Intrinsic and extrinsic camera parameters were calibrated to accurately align between the two modalities. Shooting distances were measured to derive the geometric relationships necessary for spatial registration. A dual-spectrum fusion registration was subsequently applied for the pixel-level mapping between visible-light and infrared images. Precise correspondence between pig contours and thermal data was obtained for image analysis. An improved segmentation, named YOLO-DT, was developed to incorporate two architectural modifications using YOLOv11n-seg. (1) The C3k2 module was replaced with a C3k2_DIMB one in the backbone, which was integrated with dynamic Inception depth convolution (DIMB). The effective receptive field was enlarged to maintain computational efficiency. (2) The original detection head was substituted with a task-aligned dynamic detection head (TADDH), particularly for the coordination between classification and localization tasks. Boundary discrimination was improved under diverse postures and partial occlusions at varying scales. (3) Pig regions in visible-light images were mapped to the infrared thermal matrix after segmentation, thereby allowing precise extraction of body surface temperatures. Four thermal features—mean temperature of high-temperature regions (Th_mean), group deviation rate (D), proportion of high-temperature regions (Rh), and temperature standard deviation (Tstd), were extracted to serve as the inputs into an Isolation Forest (IF) for abnormal temperature detection. YOLO-DT was trained on augmented 5040 visible-light images and validated on 210 images. Experimental results demonstrated that the high accuracy of the YOLO-DT model was achieved in the superior performance, with mAP0.5 of 98.0% and mAP0.5-0.95 of 86.0%, thus outperforming Mask R-CNN, Mask2former, YOLOv5n-seg, YOLOv11n-seg, and YOLOv12n-seg. An inference speed of 220 frames per second was also achieved with a relatively small parameter size (2.49 M) and computational cost (9.1 G). The lightweight improved model was deployed in practical farm environments. The Isolation Forest (IF) algorithm outperformed the K-Nearest Neighbor (KNN), Support Vector Machine (SVM), and Random Forest (RF) algorithms in abnormal body temperature detection. The accuracy of IF reached 96.3%, which was higher than that of the other three algorithms. In terms of precision, IF achieved 82%, slightly lower than the maximum value of 83% obtained by RF, while still maintaining competitive performance. For recall, IF attained 95.7%, significantly surpassing the other three methods, which enabled the comprehensive identification of all pigs with abnormal body temperatures. The F1-score of IF was 96.0%, markedly higher than all comparison algorithms (≤ 87.3%), which verified the outstanding overall reliability and stability of the IF model. In conclusion, a feasible and practical solution was presented to monitor pig health in intensive farming. Dual-spectrum imaging was combined with advanced segmentation and anomaly detection, indicating accurate individual localization and high detection efficiency. The training dataset can be expanded into the different growth stages, thereby enhancing the generalizability and applicability for long-term health in intensive pig production.

Total 1