Explainable machine learning for skin temperature estimation in group-housed finishing pigs
• An explainable LightGBM model was developed for pig skin temperature estimation. • The model achieved strong performance in both small and large group-housed pigs. • SHAP analysis revealed air temperature as the most influential environmental factor. • The model remained accurate across functional zones and time periods. • First study on skin temperature estimation in large-group-housed finishing pigs. Accurate assessment of heat stress in group-housed pigs remains challenging. Although skin temperature (ST) can be efficiently estimated using machine learning, existing studies often lack model explainability and validation under complex large-group housing conditions. To address these limitations, explainable machine learning models for ST estimation were developed and evaluated in finishing pigs under group-housed conditions, including different spatial zones and time periods in large-group housing systems equipped with a sorting system. Environmental and physiological data, including air temperature, relative humidity (RH), air velocity, and corresponding ST, were collected from a pig barn comprising both small- and large-group housing systems. The small-group dataset was used for model training and validation, while the large-group dataset was used for independent testing. Among five machine learning models, LightGBM achieved the best performance on the small-group dataset (RMSE = 0.59°C, MAE = 0.46°C, R = 0.92). SHAP-based analysis identified air temperature as the dominant factor positively associated with ST, followed by negatively correlated air velocity and weakly correlated RH, with limited feature interactions under low-temperature or low-velocity conditions. The model maintained robust performance on the large-group dataset (RMSE = 0.59°C, MAE = 0.47°C, R = 0.87) and consistent accuracy across different time periods and functional zones, demonstrating good generalization under more complex housing environments. The proposed model demonstrates high estimation accuracy (MAE = 0.47°C) and supports temporal- and zone-level analysis with improved explainability, providing practical support for real-time heat stress assessment and zone-specific environmental control.
Authors
- Hengyi Ji (ORCID: https://orcid.org/0000-0003-4654-425X)
- Yanrong Zhuang (ORCID: https://orcid.org/0000-0002-1507-2395)
- Ziqing Hao
- Zhenyu Zhou (ORCID: https://orcid.org/0000-0001-9447-6023)
- Chunjiang Zhao (ORCID: https://orcid.org/0009-0005-6314-7661)
- Qifeng Li
- Gan Yang
- Guanghui Teng
- Yu Liu
- Ligen Yu
Institutions
- Harbin Institute of Technology (CN)
- Ministry of Agriculture and Rural Affairs (CN)
- National Engineering Research Center for Information Technology in Agriculture (CN)
- China Agricultural University (CN)
Publication Details
- Journal
- Smart Agricultural Technology
- Published
- 2026-01-28
- DOI
- https://doi.org/10.1016/j.atech.2026.101843
- Primary Topic
- Effects of Environmental Stressors on Livestock
- Type
- article
- Field-Weighted Citation Impact
- 0.00