You are currently on the new version of our website. Access the old version .
AgricultureAgriculture
  • This is an early access version, the complete PDF, HTML, and XML versions will be available soon.
  • Article
  • Open Access

15 January 2026

YOLOv11n-CGSD: Lightweight Detection of Dairy Cow Body Temperature from Infrared Thermography Images in Complex Barn Environments

,
,
,
,
,
,
,
and
1
College of Engineering, Heilongjiang Bayi Agricultural University, Daqing 163319, China
2
Daqing Normal University, Daqing 163712, China
3
M3-BIORES Research Group, Division of Animal and Human Health Engineering, Faculty of Bioscience Engineering, Katholieke Universiteit Leuven (KU LEUVEN), Kasteelpark Arenberg 30, Heverlee, 3001 Leuven, Belgium
*
Authors to whom correspondence should be addressed.
Agriculture2026, 16(2), 229;https://doi.org/10.3390/agriculture16020229 
(registering DOI)
This article belongs to the Section Farm Animal Production

Simple Summary

This study proposes a lightweight automatic body temperature detection method for dairy cows that integrates deep learning with infrared thermography (IRT). The method effectively alleviates the decline in detection efficiency caused by complex background interference, low resolution, poor contrast, weak structural representation of regions of interest, and insufficient texture information in IRT images. Compared with RGB-based detection approaches, it is robust to illumination variations while maintaining real-time performance and ease of deployment, making it suitable for application in dairy cow barn production environments and enabling non-contact automatic acquisition of dairy cow body temperature.

Abstract

Dairy cow body temperature is a key physiological indicator that reflects metabolic level, immune status, and environmental stress responses, and it has been widely used for early disease recognition. Infrared thermography (IRT), as a non-contact imaging technique capable of remotely acquiring the surface radiation temperature distribution of animals, is regarded as a powerful alternative to traditional temperature measurement methods. Under practical cowshed conditions, IRT images of dairy cows are easily affected by complex background interference and generally suffer from low resolution, poor contrast, indistinct boundaries, weak structural perception, and insufficient texture information, which lead to significant degradation in target detection and temperature extraction performance. To address these issues, a lightweight detection model named YOLOv11n-CGSD is proposed for dairy cow IRT images, aiming to improve the accuracy and robustness of region of interest (ROI) detection and body temperature extraction under complex background conditions. At the architectural level, a C3Ghost lightweight module based on the Ghost concept is first constructed to reduce redundant feature extraction while lowering computational cost and enhancing the network capability for preserving fine-grained features during feature propagation. Subsequently, a space-to-depth convolution module is introduced to perform spatial rearrangement of feature maps and achieve channel compression via non-strided convolution, thereby improving the sensitivity of the model to local temperature variations and structural details. Finally, a dynamic sampling mechanism is embedded in the neck of the network, where the upsampling and scale alignment processes are adaptively driven by feature content, enhancing the model response to boundary temperature changes and weak-texture regions. Experimental results indicate that the YOLOv11n-CGSD model can effectively shift attention from irrelevant background regions to ROI contour boundaries and increase attention coverage within the ROI. Under complex IRT conditions, the model achieves P, R, and mAP50 values of 89.11%, 86.80%, and 91.94%, which represent improvements of 3.11%, 5.14%, and 4.08%, respectively, compared with the baseline model. Using Tmax as the temperature extraction parameter, the maximum error (Max. Error) and mean error (MAE. Error) in the lower udder region are reduced by 33.3% and 25.7%, respectively, while in the around the anus region, the Max. Error and MAE. Error are reduced by 87.5% and 95.0%, respectively. These findings demonstrate that, under complex backgrounds and low-quality IRT imaging conditions, the proposed model achieves lightweight and high-performance detection for both lower udder (LU) and around the anus (AA) regions and provides a methodological reference and technical support for non-contact body temperature measurement of dairy cows in practical cowshed production environments.

Article Metrics

Citations

Article Access Statistics

Article metric data becomes available approximately 24 hours after publication online.