ASABE Logo

Article Request Page ASABE Journal Article

Modeling Neonatal Piglet Rectal Temperature with Thermography and Machine Learning

Yijie Xiong1,2,*, Guoming Li3,4, Naomi C. Willard5, Michael Ellis5, Richard S. Gates6,7


Published in Journal of the ASABE 66(2): 193-204 (doi: 10.13031/ja.14998). Copyright 2023 American Society of Agricultural and Biological Engineers.


1 Animal Science, University of Nebraska-Lincoln, Lincoln, Nebraska, USA.

2 Biological Systems Engineering, University of Nebraska-Lincoln, Lincoln, Nebraska, USA.

3Poultry Science, University of Georgia, Athens, Georgia, USA.

4 Institute for Integrative Precision Agriculture, University of Georgia, Athens, Georgia, USA.

5Animal Sciences, University of Illinois Urbana-Champaign, Urbana, Illinois, USA.

6Agricultural and Biosystems Engineering, Iowa State University, Ames, Iowa, USA.

7 Animal Science, Iowa State University, Ames, Iowa, USA.

*Correspondence: yijie.xiong@unl.edu

The authors have paid for open access for this article. This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License https://creative commons.org/licenses/by-nc-nd/4.0/

Submitted for review on 22 December 2021 as manuscript number PAFS 14998; approved for publication as a Research Article by Associate Editor Dr. Tami Brown-Brandl and Community Editor Dr. Jun Zhu of the Plant, Animal, & Facility Systems Community of ASABE on 12 December 2022.

Highlights

Abstract. Piglet body temperature can drop rapidly after birth, and the magnitude of this drop can delay recovery to homoeothermic status and compromise the vigor of piglets. Understanding piglet body temperature changes provides critical insights into piglet thermal comfort management and preweaning mortality prevention. However, measuring neonatal piglet body temperature at birth is not generally practical in production facilities, and alternative sensing and modeling methods should be explored. The objectives of this research were to (1) quantify the rectal temperature of wet neonatal piglets without any drying treatments across the first day of birth; (2) develop and evaluate thermography and machine learning models to predict piglet rectal temperature within the same period; and (3) compare the machine learning model’s performance with a simple regression model using the piglets’ thermographic information. Rectal temperatures and thermal images of the back of the ears were obtained at 0, 15, 30, 45, 60, 90, 120, 180, 240, and 1440 minutes after birth for 99 neonatal piglets from 9 litters. Maximum ear base temperature extracted from thermal images, piglet gender, initial weight, and environmental variables (room temperature, relative humidity, and wet-bulb temperature) were used as inputs for machine learning model evaluation. A simple regression and fourteen machine learning models were compared for their performance in predicting piglets’ rectal temperature. Piglets dropped an average of 5.1°C in rectal temperature and reached the lowest temperature (33.6 ± 2.2°C) 30 (±15) minutes after birth, demonstrating a significant reduction from their birth rectal temperature (38.7 ± 0.8°C). The maximum ear base temperature had the highest feature importance score (= 0.606) among all input variables for the machine learning model’s development. A direct regression of maximum ear base temperature against measured rectal temperature produced a standard error of prediction of 1.7°C, while the best-performing machine-learning model (the Lasso regressor) produced a standard error of prediction of 1.5°C. Either prediction model is appropriate, with the direct regression model being more straightforward for field application.

Keywords. Computer vision, Farrowing, Precision livestock farming, Pre-wean mortality.

Pre-weaning mortality of piglets is not only an economic concern but also a welfare issue in commercial swine production. Although many efforts, such as improved management practices, have increased piglet viability and survival, pre-weaning mortality has remained a challenge over the past 30 years (Baxter and Edwards, 2018; Bush, 1995; Lay et al., 2002). In general, pre-weaning piglet mortality historically ranged from 8.7% to 15.4% for indoor housing systems and from 12% to 25% for outdoor farrowing systems (Alonso-Spilsbury et al., 2007). According to a recently released report, the pre-weaning piglet mortality in the US is approximately 15% (PigCHAMP Benchmarking, 2021). The first two to three days are the most critical to neonatal piglets and the most vulnerable of a pig’s entire life, as thermoregulation functions are not fully developed (Alonso-Spilsbury et al., 2007; Baxter and Edwards, 2018; Marchant et al., 2000). Many studies have found that most piglet deaths occur during these first days, accounting for most of the total mortality over the entire pre-weaning period (Lay et al., 2002; Rudd and Marchant, 1995). Many causes, including crushing, starvation, disease, and congenital abnormality, have been identified as underlying reasons or predisposing factors for pre-weaning piglet mortality (Baxter and Edwards, 2018; Lay et al., 2002).

Hypothermia, resulting from piglets experiencing severe cold stress, is one of the major causes of preweaning mortality, and it is also interlinked with crushing, starvation, and disease (Baxter and Edwards, 2018). Piglets that experience hypothermia soon after birth may have compromised development and growth performance even after they finally overcome it (Baxter and Edwards, 2018). Providing supplemental heat is one effective method to prevent hypothermia in neonatal piglets with underdeveloped thermoregulatory systems. The thermal environment of farrowing facilities is generally controlled at thermoneutral conditions for sows (15°C to 19°C), while newborn piglets are thermally comfortable at a substantially higher temperature, from 32°C to 35°C (Stinn and Xin, 2014). As a result, supplemental heat is needed in creep areas to satisfy the energetic requirements of piglets (Milan et al., 2019). Modern supplemental heating devices can dynamically provide piglets with appropriate thermal comfort based on their real-time body temperature (Li et al., 2021c). A key procedure for controlling the heating devices and further improving piglet viability and survival is to precisely obtain the piglets’ body temperatures. Furthermore, accurate piglet body temperature measurements can alert caregivers to take appropriate action.

Piglet body temperature can be obtained from various anatomical parts, such as the ear, neck, and abdomen, and the rectal temperature detected in the rectum is a common and feasible metric to understand the core body temperature of pigs (Hanneman et al., 2004; Zhang et al., 2019). The gold standard method for measuring rectal temperature is to catch and restrain the piglet of interest before inserting a temperature sensor, such as a thermometer or thermocouple, to measure the temperature. Although such a method is simple, the sensor insertion and human handling can cause piglet stress (Petry et al., 2017; Sund-Levander and Grodzinsky, 2009). Because of the intensive labor required, the manual method is not performed on a routine basis in modern concentrated pig production. Moreover, the method requires contact among animals, sensors, and humans to complete the measurement of multiple pigs, increasing the risk of cross-contamination and disease transmission (Zhang et al., 2019).

Contactless infrared thermography is an alternative technique for measuring pig body temperature, overcoming some of the disadvantages mentioned above for contact-type measuring methods (Petry et al., 2017; Zhang et al., 2019). Because thermal images are used to obtain object surface temperatures, its use to directly measure animals’ rectal or internal temperature is challenging; therefore, additional models are needed to relate piglets’ rectal temperature to their skin temperatures (Xiong et al., 2018). Among different body portions of a piglet, the ear or ear base temperature has been considered a reasonable reference to reflect the body temperature of the piglet (Lu et al., 2018; Schmitt and O’Driscoll, 2021; Zhang et al., 2019). Machine learning models are good at addressing nonlinear regression problems, and multiple input features (e.g., ambient temperature, relative humidity, piglet gender, and piglet birth weight) can be included to boost model prediction performance (Jia et al., 2020). Thermography combined with machine learning modeling has been introduced to predict pig core body temperature. Jia et al. (2020) extracted surface temperatures of the eye, ear base, back, and vulva from thermal images; these features, along with simultaneously monitored air temperature and humidity, were used with machine learning models based on Backpropagation Neural Network, Random Forest, and Support Vector Regression algorithms, to predict the core body temperature of non-pregnant sows of parities 2 and 3. Gorczyca et al. (2018) used thermography and machine learning models of Deep Neural Networks, Gradient Boosted Machines, Random Forests, and Generalized Linear Regression to predict the core, skin, and hair-coat temperatures of 5-day-old dry piglets. Although these studies achieved good results in core body temperature prediction, demonstrated the feasibility of the combination methods, and supported precision pig management, few have focused on non-interfered (i.e., undried, warmed, etc.) neonatal piglets within the first 24 hours after birth, during which most of the pre-weaning mortality occurs.

Neonatal piglets are susceptible to hypothermia during the first several hours after birth because of a combination of a sparse hair coat, a lack of body fat, and limited body surface insulation (Vande Pol et al., 2021; Xiong et al., 2018). They are born wet, and energy is lost from their body surface when residual amniotic fluid is evaporated, causing the evaporative cooling of piglet skin (Curtis, 1970). Furthermore, newborn piglets have low body energy reserves and do not possess brown fat, which reduces their ability for thermoregulatory heat production (Curtis, 1970; Trayhurn et al., 1989). Pattison et al. (1990) quantified piglet rectal temperatures from 10 to 90 minutes after birth with 10 minute intervals, and from 2 to 36 hours with 1 hour intervals. Nowland et al. (2020) and Vande Pol et al. (2021) summarized piglet rectal temperatures measured at 10, 1440, and 4320 minutes after birth and at 0, 20, 30, 45, 60, 120, and 1440 minutes after birth, respectively, although their studies were conducted with additional treatments, such as caffeine supplementation, toweling or desiccant drying, and supplemental oxygen. Contactless infrared thermography combined with machine learning modeling may provide a better estimation of body temperature for supplemental heating device controls and thus decrease the probability of mortality within the first day of birth (Marchant et al., 2000). In addition, precise quantification of rectal temperatures throughout the first day of birth may benchmark the appropriate timing of supplemental heating and management strategies to improve the viability and vigor of neonatal piglets. Modern pig genetics, management practices, and housing facilities are vastly different from those of 30 years ago, and thus it is necessary to reevaluate piglet rectal temperature modeling to provide insights into pre-wean mortality prevention.

The objectives of this research were to (1) quantify the rectal temperature of wet neonatal piglets without any drying treatments across the first day of birth; (2) develop and evaluate thermography and machine learning models to predict piglet rectal temperature within the same period; and (3) compare the machine learning model’s performance with a simple regression model’s using the piglets’ thermographic information.

Materials and Methods

Animals, Environment, and Facility

The study was conducted at the farrowing facility of the Swine Research Center at the University of Illinois at Urbana-Champaign (Cooper et al., 2018). All animal care procedures were approved by the University of Illinois Institutional Animal Care and Use Committee (IACUC Protocol Number: 16163). The sows were from commercial dam lines of Yorkshire and Landrace origin and had been mated to commercial sire lines. The sows were from parities 2 to 4. A total of 9 litters and 99 neonatal male and female piglets were used. The farrowing facility has 20 pens, with each pen (3.5 m2 of total floor space) having a farrowing crate and a surrounding piglet area with a heat lamp on one side only. The indoor environment of the farrowing facility was managed under typical farrowing house conditions. The thermostat controlling the room temperature was set at approximately 23°C. Pen temperature and relative humidity (RH) were recorded every 5 minutes during the experiment using environmental measurement sensors (HOBO UX100-011, Onset Computer Corp., Bourne, MA, USA). The data loggers were placed on the top portion of the side of the farrowing crate that is opposite from the heat lamp side to avoid interference caused by the heat lamps. The wet-bulb temperature was calculated from the dry-bulb temperature and the relative humidity (RH) extracted from the data logger.

Piglet Rectal Temperature Measurement and Processing

On each experiment day, piglets from one or two litters were measured and weighed. Rectal temperature was measured at 10 time points (0, 15, 30, 45, 60, 90, 120, 180, 240, and 1440 minutes) after birth. Modified and calibrated Type K thermocouples (OMEGA Engineering, Inc., Norwalk, CT, USA) were used to measure the piglet’s rectal temperature. Prior to each measurement day at the facility, the thermocouples were checked and calibrated against a National Institute of Standards and Technology certified temperature calibrator (CL 134-1, OMEGA Engineering, Inc., Norwalk, CT, USA), over a calibration range from 30°C to 40°C at a 2°C interval, and all temperature measurements were adjusted based on the calibration equation. The thermocouples were covered with heat shrink and liquid tape to avoid causing any discomfort for piglets during measurement. Time 0 measurements represent immediately after the piglets were born and prior to their first colostrum. After each measurement, the piglets were then placed back in the same farrowing crate at the sow’s underline. In this study, interventional drying methods, in which piglet residual amniotic fluids are commonly dried or wiped off, were not executed.

Figure 1. Example thermal image of piglet’s back, head, and ears, with black-to-purple colors representing lower surface temperature, and orange-to-yellow colors representing higher surface temperatures. Minimum, average, and maximum surface temperature for each piglet’s ear bases and ear base to tip were analyzed.

Descriptive statistical summaries, including the median, quartiles, mean, standard deviation, and average temperature drop since birth for each time point, were tabulated. A two-sample t-test was performed to determine if the rectal temperature measured at each time point was significantly different from the initial rectal temperature, with significance at P < 0.05. The rectal temperature results were plotted against the 10 time points (i.e., elapsed time after birth). Due to uncontrollable factors such as crushing, disease, and necessary euthanasia, a limited number (7) of data points were missing at the time points of 240 and 1440 min. A box-whisker plot was drawn for each of the 10 time points, illustrating means, medians, interquartile ranges (IQR, 25% to 75% of readings), ±1.5 IQR, and outliers for the population of piglets. Means were linked together with red dotted lines to show the overall trend of the piglet's rectal temperature changing over post-natal time. 

Piglet Surface Temperature Measurement and Processing

A calibrated thermal camera (FLIR T450sc, FOL 18mm, FLIR Systems, Inc., Wilsonville, OR, USA) was used to take thermal images of the entire back, head, and ears of each piglet immediately after the rectal temperature measurement. The images were captured using the factory settings, which included an emissivity of 0.98, a reflecting temperature of 20°C, and a resolution of 320 × 240 pixels. The accuracy of the thermal camera is ± 2°C or 2% of the reading, whichever is greater, at a 25°C nominal surrounding temperature. The distance between the thermal camera and the piglet’s back was approximately 30 cm. Figure 1 presents an example thermal image of a piglet’s back, head, and ears, with black-to-purple colors representing lower surface temperatures and orange-to-yellow colors representing higher surface temperatures. Temperature information on the back of piglet ears was extracted from each thermal image using FLIR Camera software (FLIR Tools, FLIR Systems, Inc., Wilsonville, OR, USA). The Thermal Multi-Spectral Dynamic Imaging features and selection tool provided in the software were used to manually choose regions of interest for subsequent analysis. Two ellipses (denoted as El1 and El2 in fig. 1) that covered the warmest surface areas on the two ear bases were identified. Two straight lines, denoted as Li1 and Li2 in figure 1, were then drawn from the ellipses to the ear tips, from which the degree of potential temperature drop was explored. The minimum, average, and maximum surface temperatures within the areas of the ear bases and tips for each image were calculated and provided by the software.

The temperature difference between the rectal and the maximum ear base readings was used as an outlier filtering method to refine our dataset. The absolute value of the 3rd quartile + 3IQR of the difference in means was used to identify extreme outliers, resulting in a mean extreme difference value of 5.3°C. Data from piglets with a greater absolute temperature difference than 5.3°C at any measurement time were excluded from model development, resulting in the removal of six piglets from the dataset.

Model Development and Evaluation

Machine Learning Model Description

All regression models in the open-access Python-based machine learning library, Scikit-learn (Pedregosa et al., 2011), were first investigated to explore their feasibility for multiple-feature regression. A total of 14 machine learning algorithms (“regressors”) from the library were selected and used to determine the best one for predicting piglet rectal temperature (table 1). The Scikit-learn library categorizes these models into linear, neighbor, cross decomposition, neural network, tree, and ensemble models. Detailed descriptions of these machine-learning algorithms were reviewed in recent articles (Benos et al., 2021; Liakos et al., 2018), and important features of these models from the Scikit-learn library are included in table 1.

Machine learning model performance is considerably affected by training hyperparameters. Hyperparameters for each model were selected based on the recommendations outlined in Scikit-learn (2007) and used to optimize the respective models. These selections are documented in table 2. Detailed explanations of these hyperparameters can be found in the Scikit-learn library.

Table 1. General information of the 14-machine learning regressors from the Scikit-learn library (Pedregosa et al., 2011).
Scikit-learn
Category
Model NameHighlights
Linear modelLinear Regressor
(Geoffrey, 1967)
Fits regression coefficients to minimize the residual sum of
squares between modeled and observed targets in a dataset
Lasso Regressor
(Tibshirani, 1996)
Fits linear models by minimizing residuals with regularization
Ridge Regressor
(Hilt and Seegrist, 1977)
Fits model by minimizing residuals by minimizing residuals with regularization
Bayesian Ridge Regressor
(Box and Tiao, 2011)
Fits model like Ridge Regression but with parameter searching based on a
posteriori estimation under a Gaussian prior over the coefficients or weights.
Stochastic Gradient Descent Regressor
(Kiefer and Wolfowitz, 1952)
Minimizes training loss using a Stochastic Gradient Descent and or regularization
NeighborsK-Nearest Neighbors Regressor
(Altman, 1992)
Estimates an optimal number of neighbors, within which the target is predicted
by local interpolation of the nearest neighbor targets identified in a training set
Cross
decomposition
Partial Least Squares Regressor
(Wold et al., 2001)
Finds the multidimensional direction in the X space that explains
the maximum multidimensional variance direction in the Y space
Neural
network
Multi-layer Perceptron Regressor
(Murtagh, 1991)
Optimizes squared errors with backpropagation based on
Broyden–Fletcher–Goldfarb–Shanno algorithm or Stochastic Gradient Descent
TreeDecision Tree Regressor
(Quinlan, 1986)
Develops tree nodes for predicting a target location in specific ranges of target features
Extra Tree Regressor
(Geurts et al., 2006)
Separates tree nodes with extremely randomized feature selection
EnsembleRandom Forest Regressor
(Tin Kam, 1995)
Fits several regression decision trees with various sub-samples in the dataset
and uses averaging to improve predictive accuracy and control overfitting
Bagging Regressor
(Breiman, 1996)
Fits base regressors to random subsets of the original dataset and then aggregates
their predictions (either by voting or by averaging) to form a final prediction
Adaptive Boosting Regressor
(Solomatine and Shrestha, 2004)
Fits a regressor and additional copies of the regressor to the original dataset with weigh coefficients adjusted according to errors of the prediction.
XGBoost Regressor
(Chen and Guestrin, 2016)
Combines a set of classification and regression trees
with Graphics Processing Unit acceleration

Three analyses were sequentially conducted to develop the machine learning models for predicting piglet rectal temperature, including (1) thermal temperature feature selection, (2) comparative evaluation of machine learning models, and (3) feature importance analysis. All computations were performed on a computer equipped with an Intel Core (TM) i7-10710U CPU @ 4.7 GHz, 16.0 GB of installed RAM, a 64-bit Windows system, and Intel UHD Graphics.

Thermal Temperature Feature Selection

There were 12 original features extracted from the thermal images, including maximum, minimum, and average surface temperatures of the left ear base (El2), the right ear base (El1), the left ear base to tip (Li2), and the right ear base to tip (Li1). A Pearson correlation analysis was used on these 12 thermal temperature features to determine the highest feature correlating with piglet rectal temperature in order to simplify feature dimensions and reduce feature repetition for subsequent analysis. The Pearson correlation coefficient (r) was used to evaluate the correlation effects between piglet rectal temperature and the 12 thermal temperature features, with significance at a P ? 0.05. The highest correlated feature was augmented with five other features (e.g., piglet gender, birth weight, dry-bulb temperature, RH, and wet-bulb temperature) to form a formal machine-learning model development dataset.

Machine Learning Models Performance Evaluation

The 14 machine learning models (table 1) were developed with the full dataset formed from the six features described in the previous section, with each feature containing 433 records. 80% of the data points were randomly selected for training, with the remaining 20% used for testing to determine the final inference performance of the models. Data reshuffling was conducted with a set of random numbers to achieve consistent training data for each model development. A grid search algorithm was used to determine the best hyperparameters (table 2) for training specific models, and a 10-fold cross-validation strategy was deployed to iterate through the training data to reduce overfitting. Nine folds of data were used for training and one fold for validation during the training process. The model with the highest validation performance was used for subsequent analysis. Cross-validation training was repeated three times with another set of random numbers to further increase the randomness of the data splitting. The model with the highest validation performance (represented by the standard deviation of the performance) during cross-validation was selected for testing. The training loss (indicated by R2) should be maintained low (indicated by the standard deviation) before the training stops.

Four metrics were used to evaluate the prediction performance of the models, including the coefficient of determination (R2), mean squared error (MSE), mean absolute error (MAE), and mean absolute percentage error (MAPE). Their calculation equations are presented in equations 1-4:

Table 2. Hyperparameter space used to optimize hyperparameters for training the machine learning regressors.
Model NameHyperparameterDistribution
Linear RegressorFit_intercept(True, False)
Normalize(True, False)
Copy_X(True, False)
Lasso RegressorAlpha(0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8)
Normalize(True, False)
Copy_X(True, False)
Precompute(True, False)
Max_iter(500,1000,1500,2000)
Ridge RegressorAlpha(0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8)
Normalize(True, False)
Copy_X(True, False)
Solver('auto','svd','cholesky','lsqr','sparse_cg','sag','saga','lbfgs')
Max_iter(500,1000,1500,2000)
Bayesian Ridge RegressorAlpha_1(10-3,10-4,10-5,10-6,10-7,10-8,10-9,10-10)
Alpha_2(10-3,10-4,10-5,10-6,10-7,10-8,10-9,10-10)
Normalize(True, False)
Copy_X(True, False)
Lambda_1(10-3,10-4,10-5,10-6,10-7,10-8,10-9,10-10)
Lambda_2(10-3,10-4,10-5,10-6,10-7,10-8,10-9,10-10)
N_iter(100,200,300,400,500,600,700,800,900,1000)
Stochastic Gradient Descent RegressorLoss('huber','epsilon_insensitive','squared_epsilon_insensitive')
Penalty('l2','l1','elasticnet')
Alpha(0.01,0.001,0.0001,0.00001)
L1_ratio(0,0.2,0.4,0.6,0.8,1)
Fit_intercept(True, False)
Epsilon(0.01,0.1,1)
Learning_rate('constant','optimal','invscaling','adaptive')
Max_iter(500,1000,1500,2000)
K-Nearest Neighbors RegressorN_neighbors(3,6,9,12)
Weights('uniform','distance')
Algorithm('auto','ball_tree','kd_tree','brute')
Leaf_size(10,20,30,40,50)
P(1,2)
Partial Least Squares RegressorN_components(1,2,3,4,5)
Max_iter(500,1000,1500,2000)
Copy(True, False)
Multi-layer Perceptron RegressorHidden_layer_sizes(50,100,150,200)
Activation('identity','logistic','tanh','relu')
Solver('lbfgs','sgd','adam')
Learning_rate('constant','invscaling','adaptive')
Decision/
Extra Tree Regressor
Criterion('friedman_mse','poisson')
Splitter('best','random')
Max_features('auto', 'sqrt','log2','None')
Random
Forest Regressor
N_estimators(50,100,150)
Criterion('squared_error','absolute_error','poisson')
Min_samples_split(2,4,6)
Min_samples_leaf(1,2,3,4)
Bagging RegressorN_estimators(50,100,150)
Max_features(1,2,3,4)
Max_samples(1,2,3,4)
Bootstrap(True, False)
Warm_start(True, False)
Adaptive Boosting RegressorN_estimators(50,100,150)
Learning_rate(0.01,0.1,1,2)
Loss('linear','square','exponential')
XGBoost RegressorBooster('gbtree','gblinear')
Silent(0,1)

(1)

(2)

(3)

(4)

where

yi = the ith piglet rectal temperature value

y^i = the ith predicted rectal temperature value

    = the mean value of piglet rectal temperature value

n = the total number of examined data points

? = an arbitrary small yet strictly positive number to avoid undefined results.

These four metrics were selected to evaluate the efficacy of each model. R2 describes the overall fitness of regression, with smaller values indicating poorer fitness. The MSE, MAE, and MAPE evaluate the degree of deviation between predicted and measured temperatures, with smaller values suggesting better model performance. The ranking of the four metrics was used to form a 14 × 4 matrix, with each row representing one of the 14 models and each column representing one of the four metrics. The matrix was then fed into open-source libraries, Scikit_posthocs, and Pingouin to conduct the Friedman test, which was used to examine machine learning performance based on an F-test, with significance at P < 0.05 indicating a performance difference among models (Ghorbani and Ghousi, 2020).

In addition, a comprehensive index (CI) was developed to balance the two opposite sets of metrics and select an optimal model if the Friedman test failed to differentiate model performance. Using the testing dataset, the model performance was first ranked based on the four regression evaluation metrics, in which a larger R2 value had a higher ranking and a lower value of the MSE, MAE, and MAPE had a higher ranking. Then the ranks were combined with equal weighing, as shown in equation 5. The lowest CI identifies the best model.

(5)

where the variables Orderi are integers ranging from (1:4), and the subscripts refer to the appropriate metric of interest.

Feature Importance Analysis

The feature importance scoring is an impurity-based method and is critical for reducing unnecessary or redundant model features (Nembrini et al., 2018). A feature with a higher score plays a more important role in predicting piglet rectal temperature, and scores near zero indicate little or no relevance to temperature prediction, and their removal may not influence prediction accuracy and can reduce computational complexity (Kalousis et al., 2007). After comparison and selection, the optimal model provided a feature importance score for each input feature, where the six features were ranked based on the feature importance score outputs (i.e., R2). Ablation studies were then conducted for various sets of features (e.g., the top scoring feature, the top two scoring features, etc., up to all six features based on R2, MSE, MAE, and MAPE) in the full dataset to verify the possibility of reducing unnecessary features and improving model performance.

Results

Farrowing Room Environmental Conditions

Table 3 provides a summary of the descriptive statistics of the environmental data for each piglet measurement time, including the mean, standard deviation, minimum and maximum measures of the dry-bulb air temperature, relative humidity (RH), and wet-bulb temperature. 

Table 3. Descriptive statistics, including the mean, standard deviation (std), the minimum (Min), and the maximum (Max) value of environmental measurements in the farrowing room for each measurement time between 0 and 4 hours after piglets’ birth.
Farrowing room environmental information at each measurement time
0H15
min
30
min
45
min
1H90
min
2H3H4H
Dry-bulb air temperature (°C)
Mean23.423.523.523.523.523.623.623.723.8
std0.970.930.780.780.820.930.971.051.17
Min 19.719.821.821.821.821.921.821.821.7
Max25.125.225.025.025.125.125.225.826.0
Relative humidity (RH,%)
Mean47.147.046.646.646.545.444.643.641.1
std 10.310.710.310.19.359.118.887.797.12
Min 29.828.129.831.031.631.031.030.628.4
Max66.369.369.369.363.866.666.261.852.1
Wet-bulb temperature (°C)
Mean16.116.216.116.116.116.015.915.815.5
std2.032.081.961.911.811.771.801.781.84
Min 10.910.513.013.013.313.213.212.411.9
Max20.320.820.820.819.719.420.319.618.4

Change in Piglet Rectal Temperature

Table 4 and figure 2 show the rectal temperatures and changes over time for the 99 neonatal piglets over the first 24 hours after birth. The average initial piglet weight was 1.47 ± 0.39 kg, and 52.5% of piglets were barrows. Piglet’s rectal temperature fluctuated significantly after birth. Piglets had a uniform and high initial rectal temperature (38.7 ± 0.88°C) when they were born, and their temperature dropped 4.4°C on average within the first 15 min. Most piglets showed the lowest body temperature when measured 30 minutes after birth, with a mean of 33.6 ± 2.2°C and an average drop of 5.1°C. With the limitation of data collection every 15 minutes, it is plausible that the actual lowest rectal temperature occurred somewhere between the 15 and 30 or 30 and 45 minute timeframes. From 30 to 45 minutes after birth, the piglets continued to experience low body temperatures with a minor mean increase of 0.3°C, and then started to steadily increase their body temperature by less than 1°C increment per hour from 60 to 240 minutes after birth, eventually recovering to their initial temperature after 140 minutes (24 hours).

As shown in table 4 and figure 2, the IQR and standard deviations between 15 and 120 minutes after birth were larger than those at time points of 0 minutes and 180 to 1440 minutes, indicating substantial variation among individuals within the former period. Additionally, between 15 and 120 minutes after birth, the number of piglets that fell outside of the ±1.5 IQR (99.3% of the total sample population) increased with time, indicating that specific piglets likely had more difficulty regulating their metabolism and maintaining their ideal body temperature range. Notably, at 60 minutes after birth, some piglets had rectal temperatures of 24 °C, representing a 14°C drop from birth. At 180 min, 13 piglets were still below the lower limit of 1.5 IQR. At the end of the first day, two piglets remained below the lower 1.5 IQR.

Selection of Surface Thermal Temperature Features

The correlation between the rectal temperature and the maximum, minimum, and average of the four selected surface temperatures ranged from 0.725 to 0.814, 0.391 to 0.688, and 0.596 to 0.764, respectively, and all correlations were positive and significant (r > 0, P < 0.001) (table 5). The maximum ear base surface temperature was highly and positively correlated with piglet rectal temperature (r = 0.780 and 0.814), whereas the minimum surface temperature of ear bases to tips was less so (r = 0.391 and 0.393. Therefore, the greater of the two maximum ear base surface temperatures was selected for model development.

Model Performance on Rectal Temperature Prediction

Hyperparameters were extensively tested to optimize model performance; the optimal hyperparameters for each of the 14 models are presented in table 6. These were subsequently used to develop the machine learning models. The same hyperparameters varied in values for specific models. For example, the optimal constant (a) that multiplies the L1 term for regularization was 0 for Lasso Regressor, 0.4 for Ridge Regressor, and 0.01 for the Stochastic Gradient Descent Regressor, demonstrating the importance of tuning hyperparameters for specific model development. The linear models (i.e., Linear, Lasso, Ridge, Bayesian Ridge, and Stochastic Gradient Descent Regressors) had similar validation performance (R2=0.643 to 0.645), while the Decision Tree, Extra Tree, and Bagging Regressors had poorer performance (R2=0.461, 0.465, and 0.341, respectively) when compared with other models.

Table 4. Descriptive statistical summary of piglet rectal temperature at each measurement time point.[a],[b]
Time Elapsed After Birth (min)Piglet Rectal Temperature (°C)
015304560901201802401440
Mean38.734.333.633.934.435.635.936.837.438.7
Standard deviation0.881.832.192.712.763.112.732.441.690.81
Mean rectal temperature drop since birth[c]-4.45.14.84.33.12.81.91.30.0
P-value[d]-< 0.001< 0.001< 0.001< 0.001< 0.001< 0.001< 0.001< 0.0010.7781

    [a]Piglets mean birth weight: 1.47 ± 0.39 kg.

    [b]Piglet gender: 52.5% barrow, 47.5% gilt.

    [c] The mean RT drop since birth is the rectal temperature difference between 0 minutes and other time points. ‘-’ indicates there was no rectal temperature drop at birth.

    [d] The P-value results of a two-sample t test between piglet initial rectal temperature (measured at 0 minutes time point) and the piglet rectal temperature measured at other time points. The results indicate that the two rectal temperature means are significantly different with a P-value < 0.05.

Figure 2. Range of piglet rectal temperatures and change with elapsed time after birth.

Table 7 demonstrates that the Friedman test alone was not sufficient to determine the models' performance (P = 0.054). Model performance metrics, as shown in table 8, further indicate that the best performance was 0.791 for R2, 1.806°C for MSE, 1.018°C for MAE, and 0.029 for MAPE. Seven models (Linear, Lasso, Ridge, Bayesian Ridge, Stochastic Gradient Descent, Partial Least Squares, and XGBoost) had decent prediction performance, as indicated by the four regression evaluation metrics, and the performance difference among these models was as small as 0.001, making the selection of the “best” model for piglet rectal temperature prediction unclear. Thus, the CI was used. Lasso and Ridge Regressors had the smallest CI value (2.00), thus the highest ranking. In addition, the Lasso Regressor had slightly better performance when compared to the Ridge Regressor (indicated by R2, MSE, and MAPE). Therefore, the Lasso Regressor was selected as the best model for predicting neonatal piglet rectal temperature.

Feature Importance Analysis for Model Improvement

The results of feature importance scores are depicted in figure 3. The sorted features from the most important to the least important were max ear base temperature (0.606), dry-bulb temperature (0.106), initial birth weight (0.082), RH (0.078), wet-bulb temperature (0.072), and gender (0.055).

Ablation studies were conducted based on the sorted features in figure 3, and a regression evaluation conducted with different features is shown in table 9. Although validation performance was slightly improved when more features were included in the training dataset (from 0.619±0.223 with the single top feature included to 0.644±0.232 with all features included), such an improvement was not obvious in the testing results because the regression using the top two features demonstrated slightly poorer performance than that with the top feature alone. Some less important features (e.g., gender) can be removed from the training dataset due to being less important than other selected features; however, including more features may enhance the model’s performance.

After model optimization, the optimal model, the Lasso Regressor with the coefficients and intercept, was selected (eq. 6) for predicting piglet rectal temperature.

(6)

where

RT = Piglet rectal temperature (°C)

PG = Piglet gender with 0 being male and 1 being female

BW = Body weight (kg)

MEBT = Max ear base temperature extracted from a thermal image (°C)

    DBT = Dry-bulb temperature (°C)

RH = Relative humidity (%)

WBT = Wet-bulb temperature (°C).

The optimized model was used to calculate predicted rectal temperature from the existing dataset using equation 6, and the predicted values were regressed against measured rectal temperature (fig. 4, left). A direct regression of the maximum ear base temperature against the measured rectal temperature was also performed (fig. 4, right). The two models are comparable in accuracy, with the standard errors of prediction being 1.275°C and 1.267°C for the Lasso model and conventional regression, respectively. The direct regression model can be easily inverted to estimate rectal temperature from maximum ear base temperature, with a standard error of prediction of 1.267/0.7548 = 1.7°C. By contrast, the Lasso model is 1.275/0.8369 = 1.5°C. Either is appropriate, with the direct measure being more straightforward for field application.

Table 9. Lasso Regressor performance with various numbers of features included based on feature importance scores.[a]
Features
Included
ValidationTesting
R2R2MSE
(°C)
MAE
(°C)
MAPE
Top one scoring0.619±0.2230.7292.3391.1670.034
Top two scoring0.621±0.2510.7272.3571.1600.034
Top three scoring0.628±0.2390.7492.1651.1230.032
Top four scoring0.635±0.2320.7811.8911.0610.031
Top five scoring0.635±0.2320.7831.8771.0580.031
All0.644±0.2320.7901.8191.0190.029

    [a]MSE is mean square error; MAE is mean absolute error; and MAPE is mean absolute percentage error.

Discussion

Piglet Rectal Temperature over Time

The trends of piglet rectal temperature changes over time agreed with a previous study (Pattison et al., 1990), with two differences noted. One is that by 30 minutes post-birth (fig. 2), piglets dropped 5.1°C on average in this study, whereas a 3.0°C to 4.5°C drop was reported by other researchers (Pattison et al., 1990; Vande Pol et al., 2020). This may be because the piglets in this study were not dried or intervened with, and thus more heat may have been lost by evaporating fluids from the skin surface (Curtis, 1970), suggesting the importance of drying and warming piglets after birth. The other difference is that all piglets in this study recovered to their initial rectal temperatures within 24 hours after birth, while piglets in the Pattison et al. (1990) study took over 30 hours to recover. Improved genetics, nutrition, facility, environment, and management practices over the past 30 years may contribute to the faster restoration of piglet body temperature and thermal regulation (Gebhardt et al., 2020).

Figure 4. Linear regression of: (Left) Lasso model predictions against rectal temperature, and (Right) maximum ear base temperature against rectal temperature. Overall prediction standard errors were each 1.27°C.

If a piglet’s core body temperature drops more than 2°C from its normal core body temperature (39°C), they have a higher chance of suffering from reduced locomotor vigor and eventually becoming lethargic (Stephens, 1971). Busija and Leffler (1987) reported that for newborn piglets with a reduced rectal temperature from 39°C to 34°C, their cerebral blood flow and metabolic rate decreased by 40% to 50%. Such challenges bring extreme difficulties for the piglets in thermal regulation and can make them less competitive in finding a teat for colostrum and thus weaker and more likely to be crushed by their dam (English and Wilkinson, 1982). Piglet rectal temperature dropped by 2.8°C to 5.1°C on average in the first 15 to 120 minutes after birth, with large standard deviations and IQRs indicating that some piglets faced significantly greater thermal regulation challenges than others. 

Thermography and Surface Temperature

Although thermography has several advantages in the contactless measurement of piglet body temperature, some aspects should be considered for practical applications. Unlike rectal temperature, body surface temperature is more affected by environmental and other external factors. The back of the ears was selected as the region of interest because they are relatively sheltered and have less hair than other body surface areas; hairy areas often show colder temperatures than less hairy skin areas in a thermal image (Feng et al., 2019) and can influence the infrared temperature measurement accuracy. The selection of infrared temperature measurement is frequently based on human observations or experiences, limiting the technique's widespread application. Modern machine learning, deep learning object detection, and image processing algorithms may help automate the area selection procedure (Li et al., 2021b; Lu et al., 2018), but would require verification in piglet applications. Moreover, the thermal camera needs to be held steady during data collection, and the current available subsequent data processing or modeling is performed offline. Other factors, such as camera warmup, standby time, battery life, image capture, storage, and processing, and camera installation places in a pig house, should also be considered for practical real-time applications. The results from this study demonstrated that the maximum surface temperature outperformed other metrics regarding its correlation with piglet rectal temperatures. Kammersgaard et al. (2013) also compared correlations among the same surface temperature metrics used in this study for older piglets, with the maximum value (0.82) being higher than that (0.77) in this study. Perhaps the maximum ear-base temperature was less affected by hair conditions and residual amniotic fluid in that study.

Machine Learning Modeling

Overall, the best regression performance in this study (R2=0.791, MSE=1.806°C, MAE=1.018°C, and MAPE = 0.029) was slightly poorer than that in other studies using thermography combined with machine learning modeling for mature pig body temperature prediction. The MAPE values were 0.0036, 0.0062, and 0.0135 for predicting rectal, skin surface, and hair-coat surface temperature based on environmental data in a piglet study (Gorczyca et al., 2018). Jia et al. (2020) predicted swine rectal temperature with a maximum MAE of 0.48°C, a minimum MAE of 0.12°C, and an MSE of 0.16°C. Besides the differences in the machine learning model, animal age, environment, and breed, variations in the ranges of predicted outputs may play an important role in explaining the performance discrepancies. For example, the rectal temperature to be predicted ranged from 25.2 to 40.0°C in the current study, 37.28 to 38.55°C by Gorczyca et al. (2018), and 33.77 to 38.76°C by Jia et al. (2020). Larger variations in the range of predicted outputs require more data for training to boost machine learning model performance, and the current dataset (433 data points for each feature) may be insufficient to fully explore the machine learning model’s ability to handle the variations (Li et al., 2021a).

Interestingly, some popular and powerful ensemble machine learning models, such as the XGBoost Regressor (Chen and Guestrin, 2016), did not perform better than the linear models used in this study. Jia et al. (2020) compared the Backpropagation Neural Net regressor, Random Forest Regressor, and Support Vector Regressor, of which the latter had better performance. Gorczyca et al. (2018) investigated Deep Neural Networks (DNN), Gradient Boosted Machines, Random Forests, and Generalized Linear Regression (GLR), with DNN performing the best and GLR performing the worst in pig rectal temperature prediction. These results demonstrate that the Neighbor, Cross decomposition, neural network, and ensemble algorithms may perform better when addressing nonlinear issues. In this study, the most important feature, maximum ear base temperature, had a significant and positive linear relationship with the rectal temperature and may influence the prediction results over the other five features (Casalicchio et al., 2019). Although results show that the Lasso Regressor performed slightly better than other linear models, this does not necessarily suggest that it is the optimal model for all applications. The main structure of these five models was similar, with variations in optimization and regularization methods among the different models. Some models may not reach their optimal performance with current hyperparameter settings. For example, the minimum of Lambda_1 for the Bayesian Ridge Regressor was 10-10, and the final optimal Lambda_1 was 10-10; the maximum number of iterations for the Stochastic Gradient Descent Regressor was 1000, and the final optimal solution was at 1000 iterations. These suggest that there may be additional room to improve the model’s performance if the hyperparameters had a wider range, though it is difficult to balance the degree of performance improvement, time, and resources invested in model tuning.

Although maximum ear base temperature played the most important role in rectal temperature prediction, it does not suggest that other features should be removed from the input feature list. In contrast, including more features besides the most important one did indeed improve model performance slightly. Jia et al. (2020) also found that including environmental features (i.e., air temperature and humidity) as inputs considerably improved the MAE, RMSE, and r for predicting pig rectal temperature, compared to those trained without environmental features. A wider range in these variables than found in this study would better address this issue, but pig farrowing environments are relatively closely controlled.

Model Application

Regardless of the analytical performance of any model, the practical utilization of such a model is an important factor for improving routine swine production efficiency and reducing preweaning piglet mortality. As discussed above, the performance of the Lasso Regressor model exceeded that of the other 13 machine learning models evaluated in this paper, as evident by a better CI ranking (eq. 5). However, the model requires multiple input variables, such as piglet birth weight, gender, and environmental conditions, to predict the final output variable, i.e., rectal temperature, which would require more time and effort from the producer to input all variables. On the other hand, the simple linear regression of the maximum ear base surface temperature vs. rectal temperature performed nearly as well as the Lasso Regressor model (fig. 4). During the preliminary linear model development effort, Xiong et al. (2018) reported an R2 of 0.72 and a SE of 1.5°C for a linear regression model that included all piglets’ maximum ear base temperatures and an R2 of 0.81 and a SE of 1.24°C for an improved linear regression model that only contained data for dry piglets (namely measurements taken from 45 minutes to 24 hours). It is challenging to conclude whether one model outperforms another regarding the field application, and requirements such as output accuracy, prediction purpose, and allocable time for data collection should all be considered for the practical application of such models.

Limitations

Besides the offline analysis, there are still some bottlenecks in this study. The number of data points per feature was relatively small compared to the rule of thumb for machine learning, in which 5,000 data points or instances per feature are commonly recommended (Li et al., 2021a). But on the other hand, the number of data points and the number of piglets were equal to or higher than those in other thermography modeling studies (table 10). Meanwhile, additional factors such as piglet handling for photographing, the expense of animal experiments and housing, and manual labeling of thermal images should be considered prior to data collection for future technique development.

Table 10. Development dataset information and purpose in various studies related to thermography modeling.
SourceNumber of
Pigs/Piglets
Number of Data
Points per Feature
Purpose
Current study99433Piglet rectal temperature prediction
Da Fonseca et al. (2020)72516Piglet Stress status prediction
Feng et al. (2019)99124Sow rectal temperature prediction
Gorczyca et al. (2018)10200Piglet core, skin, and hair-coat temperature prediction
Jia et al. (2020)18216Sow rectal temperature prediction
Lu et al. (2018)20600Piglet part identification
Sasaki et al. (2016)7272Piglet body weight estimation

Predicting piglet temperature precisely based on the elapsed time post-birth (or maximum temperature drop and time to recover to thermal vitality) could better inform management decisions, particularly intervention strategies for pre-weaning mortality prevention. However, there were insufficient and disproportionate data for training at each time point in this study, precluding its investigation.

The overall average dry-bulb temperatures for all the measurement time intervals were smaller than 23.8°C, with an average RH of below 50%. Our records showed that the air temperatures were slightly greater than the recommended range; however, since the dry-bulb temperature and RH data loggers were attached to the farrowing crate for more representative measurements for the sows, it is possible that the heat lamps in the farrowing crate had some influence. In addition, because the environmental conditions in the farrowing facility were maintained relatively constant year-round, it brought challenges and limitations regarding the development of prediction models and their application. It is critical to collect data in appropriately representative environmental conditions for the development of prediction models and to achieve one model that can be applied to a broader range of swine house conditions. 

Conclusions

This paper summarizes model development efforts to predict neonatal piglets’ rectal temperature using thermography and machine learning techniques. The results highlighted those piglets who experienced the lowest rectal temperature at 30 minutes after birth, with a significant drop from their initial birth rectal temperature, suggesting immediate and significant body temperature reduction. Model performance metrics were compared between a direct regression model using the maximum ear base temperature vs. rectal temperature and a Lasso Regressor machine learning model using the maximum ear base temperature and the additional piglet and environment measures as input variables. The two models performed similarly in predicting neonatal piglets’ rectal temperatures. Either prediction model is appropriate, with the direct measure being more straightforward for use in the field.

Acknowledgments

The authors would like to thank the undergraduate student, Thais Maurin, from the University of São Paulo-Pirasununga, Brazil, for her efforts in assisting in data collection and thermal image analyses. The University of Illinois at Urbana-Champaign Swine Research Center's staff and graduate students are also acknowledged by the authors for their tireless efforts during data collection.

References

Alonso-Spilsbury, M., Ramírez-Necoechea, R., Gonzlez-Lozano, M., Mota-Rojas, D., & Trujillo-Ortega, M. (2007). Piglet survival in early lactation: A review. J. Anim. Vet. Adv., 6(1), 76-86.

Altman, N. S. (1992). An introduction to kernel and nearest-neighbor nonparametric regression. Am. Stat., 46(3), 175-185. https://doi.org/10.1080/00031305.1992.10475879

Baxter, E. M., & Edwards, S. A. (2018). Chapter 3 - Piglet mortality and morbidity: Inevitable or unacceptable? In M. Špinka (Ed.), Advances in pig welfare (pp. 73-100). Woodhead Publ. https://doi.org/10.1016/B978-0-08-101012-9.00003-4

Benos, L., Tagarakis, A. C., Dolias, G., Berruto, R., Kateris, D., & Bochtis, D. (2021). Machine learning in agriculture: A comprehensive updated review. Sensors, 21(11), 3758. https://doi.org/10.3390/s21113758

Box, G. E., & Tiao, G. C. (2011). Bayesian inference in statistical analysis (Vol. 40). John Wiley & Sons.

Breiman, L. (1996). Bagging predictors. Mach. Learn., 24(2), 123-140. https://doi.org/10.1007/BF00058655

Bush, E. J. (1995). Swine ‘95 - Part I: Reference of 1995 swine management practices. https://doi.org/10.22004/ag.econ.32739

Busija, D. W., & Leffler, C. W. (1987). Hypothermia reduces cerebral metabolic rate and cerebral blood flow in newborn pigs. Am. J. Physiol.-Heart Circulatory Physiol., 253(4), H869-H873. https://doi.org/10.1152/ajpheart.1987.253.4.H869

Casalicchio, G., Molnar, C., & Bischl, B. (2019). Visualizing the feature importance for black box models. In Machine learning and knowledge discovery in databases: European conference, ECML PKDD 2018 (pp. 655-670). Springer International Publ. https://doi.org/10.1007/978-3-030-10925-7_40

Chen, T., & Guestrin, C. (2016). XGBoost: A scalable tree boosting system. Proc. 22nd ACM SIGKDD Int. Conf. Knowledge Discovery and Data Mining. https://doi.org/10.1145/2939672.2939785

Cooper, N. C., Ellis, M., Xiong, Y., & Gates, R. (2018). Effect of piglet birth weight on post-natal changes in body temperature. J. Anim. Sci., 96(suppl_2), 2-3. https://doi.org/10.1093/jas/sky073.003

Curtis, S. E. (1970). Environmental — Thermoregulatory interactions and neonatal piglet survival. J. Anim. Sci., 31(3), 576-587. https://doi.org/10.2527/jas1970.313576x

da Fonseca, F. N., Abe, J. M., de Alencar Nääs, I., da Silva Cordeiro, A. F., do Amaral, F. V., & Ungaro, H. C. (2020). Automatic prediction of stress in piglets (Sus Scrofa) using infrared skin temperature. Comput. Electron. Agric., 168, 105148. https://doi.org/10.1016/j.compag.2019.105148

English, P. R., & Wilkinson, V. (1982). 23 - Management of the sow and litter in late pregnancy and lactation in relation to piglet survival and growth. In D. J. Cole, & G. R. Foxcroft (Eds.), Control of pig reproduction (pp. 479-506). Butterworth-Heinemann. https://doi.org/10.1016/B978-0-408-10768-6.50028-9

Feng, Y.-Z., Zhao, H.-T., Jia, G.-F., Ojukwu, C., & Tan, H.-Q. (2019). Establishment of validated models for non-invasive prediction of rectal temperature of sows using infrared thermography and chemometrics. Int. J. Biometeorol., 63(10), 1405-1415. https://doi.org/10.1007/s00484-019-01758-2

Gebhardt, J. T., Tokach, M. D., Dritz, S. S., DeRouchey, J. M., Woodworth, J. C., Goodband, R. D., & Henry, S. C. (2020). Postweaning mortality in commercial swine production. I: Review of non-infectious contributing factors. Transl. Anim. Sci., 4(2), 462-484. https://doi.org/10.1093/tas/txaa068

Geurts, P., Ernst, D., & Wehenkel, L. (2006). Extremely randomized trees. Mach. Learn., 63(1), 3-42. https://doi.org/10.1007/s10994-006-6226-1

Ghorbani, R., & Ghousi, R. (2020). Comparing different resampling methods in predicting students’ performance using machine learning techniques. IEEE Access, 8, 67899-67911. https://doi.org/10.1109/ACCESS.2020.2986809

Gorczyca, M. T., Milan, H. F. M., Maia, A. S. C., & Gebremedhin, K. G. (2018). Machine learning algorithms to predict core, skin, and hair-coat temperatures of piglets. Comput. Electron. Agric., 151, 286-294. https://doi.org/10.1016/j.compag.2018.06.028

Hanneman, S. K., Jesurum-Urbaitis, J. T., & Bickel, D. R. (2004). Comparison of methods of temperature measurement in swine. Lab. Anim., 38(3), 297-306. https://doi.org/10.1258/002367704323133682

Hilt, D. E., & Seegrist, D. W. (1977). Ridge, a computer program for calculating ridge regression estimates (Vol. 236). Upper Darby, PA: Dept. of Agriculture, Forest Service, Northeastern Forest Experiment Station. https://doi.org/10.5962/bhl.title.68934

Jia, G., Li, W., Meng, J., Tan, H., & Feng, Y. (2020). Non-contact evaluation of pigs’ body temperature incorporating environmental factors. Sensors, 20(15), 4282. https://doi.org/10.3390/s20154282

Kalousis, A., Prados, J., & Hilario, M. (2007). Stability of feature selection algorithms: A study on high-dimensional spaces. Knowl. Inf. Syst., 12(1), 95-116. https://doi.org/10.1007/s10115-006-0040-8

Kammersgaard, T. S., Malmkvist, J., & Pedersen, L. J. (2013). Infrared thermography – A non-invasive tool to evaluate thermal status of neonatal pigs based on surface temperature. Animal, 7(12), 2026-2034. https://doi.org/10.1017/S1751731113001778

Kiefer, J., & Wolfowitz, J. (1952). Stochastic estimation of the maximum of a regression function. Ann. Math. Stat., 23(3), 462-466. https://doi.org/10.1214/aoms/1177729392

Lay, D. C., Matteri, R. L., Carroll, J. A., Fangman, T. J., & Safranski, T. J. (2002). Preweaning survival in swine. J. Anim. Sci., 80(E-suppl_1), E74-E86.

Li, G., Huang, Y., Chen, Z., Chesser, G. D., Purswell, J. L., Linhoss, J., & Zhao, Y. (2021a). Practices and applications of convolutional neural network-based computer vision systems in animal farming: A review. Sensors, 21(4), 1492. https://doi.org/10.3390/s21041492

Li, G., Zhao, Y., Porter, Z., & Purswell, J. L. (2021b). Automated measurement of broiler stretching behaviors under four stocking densities via faster region-based convolutional neural network. Animal, 15(1), 100059. https://doi.org/10.1016/j.animal.2020.100059

Li, X., Ye, Z., Li, G., Shen, P., Zhu, S., Zhao, S.,... Gao, W. (2021c). Effects of intelligent carbon fiber heater on pig behavior, production performance, and energy consumption. Trans. ASABE, 64(1), 259-272. https://doi.org/10.13031/trans.14104

Liakos, K. G., Busato, P., Moshou, D., Pearson, S., & Bochtis, D. (2018). Machine learning in agriculture: A review. Sensors, 18(8), 2674. https://doi.org/10.3390/s18082674

Lu, M., He, J., Chen, C., Okinda, C., Shen, M., Liu, L.,... Berckmans, D. (2018). An automatic ear base temperature extraction method for top view piglet thermal image. Comput. Electron. Agric., 155, 339-347. https://doi.org/10.1016/j.compag.2018.10.030

Marchant, J. N., Rudd, A. R., Mendl, M. T., Broom, D. M., Meredith, M. J., Corning, S., & Simmins, P. H. (2000). Timing and causes of piglet mortality in alternative and conventional farrowing systems. Vet. Rec., 147(8), 209-214. https://doi.org/10.1136/vr.147.8.209

Milan, H. F., Campos Maia, A. S., & Gebremedhin, K. G. (2019). Prediction of optimum supplemental heat for piglets. Trans. ASABE, 62(2), 321-342. https://doi.org/10.13031/trans.13015

Murtagh, F. (1991). Multilayer perceptrons for classification and regression. Neurocomputing, 2(5), 183-197. https://doi.org/10.1016/0925-2312(91)90023-5

Nembrini, S., König, I. R., & Wright, M. N. (2018). The revival of the Gini importance? Bioinformatics, 34(21), 3711-3718. https://doi.org/10.1093/bioinformatics/bty373

Nowland, T. L., Kind, K., Hebart, M. L., & van Wettere, W. H. E. J. (2020). Caffeine supplementation at birth, but not 8 to 12 h post-birth, increased 24 h pre-weaning mortality in piglets. Animal, 14(7), 1529-1535. https://doi.org/10.1017/S175173111900301X

Pattison, R. J., English, P. R., MacPherson, O., Roden, J. A., & Birnie, M. (1990). Hypothermia and its attempted control in newborn piglets. Proc. British Soc. Anim. Prod. (1972), 1990, 81-81. https://doi.org/10.1017/S0308229600018626

Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O.,... Dubourg, V. (2011). Scikit-learn: Machine learning in Python. J. Machi. Learn. Res., 12, 2825-2830.

Petry, A., McGilvray, W., Rakhshandeh, A. R., & Rakhshandeh, A. (2017). Technical note: Assessment of an alternative technique for measuring body temperature in pigs. J. Anim. Sci., 95(7), 3270-3274. https://doi.org/10.2527/jas.2017.1566

PigCHAMP Benchmarking. (2021). US 2021-2nd quarter summary. Retrieved from https://www.pigchamp.com/Portals/0/Documents/Benchmarking%20Summaries/usa2021-1st-2nd-quarter-summary.pdf

Quinlan, J. R. (1986). Induction of decision trees. Mach. Learn., 1(1), 81-106. https://doi.org/10.1007/BF00116251

Rudd, A. R., & Marchant, J. N. (1995). Aspects of farrowing and lactating sow behaviour. Pig J., 34, 21-30.

Sasaki, Y., Furusho, K., Ushijima, R., Tokunaga, T., Uemura, R., & Sueyoshi, M. (2016). Body surface temperature of suckling piglets measured by infrared thermography and its association with body weight change. Japan Agri. Res. Q., 50(4), 361-368. https://doi.org/10.6090/jarq.50.361

Schmitt, O., & O’Driscoll, K. (2021). Use of infrared thermography to noninvasively assess neonatal piglet temperature. Transl. Anim. Sci., 5(1). https://doi.org/10.1093/tas/txaa208

Scikit-learn. (2007). Machine learning in Python. Retrieved from https://scikit-learn.org/stable/

Solomatine, D. P., & Shrestha, D. L. (2004). AdaBoost.RT: A boosting algorithm for regression problems. Proc. 2004 IEEE Int. Joint Conf. Neural Networks, 2, pp. 1163-1168 vol.2. https://doi.org/10.1109/IJCNN.2004.1380102

Stephens, D. B. (1971). Piglet survival: A review of some physiological considerations. Vet. Ann., 12, 64-73.

Stinn, J. P., & Xin, H. (2014). Heat lamp vs. Heat mat as localized heat source in swine farrowing crate. Iowa State University Animal Industry Report, 11(1). https://doi.org/10.31274/ans_air-180814-1213

Sund-Levander, M., & Grodzinsky, E. (2009). Time for a change to assess and evaluate body temperature in clinical practice. Int. J. Nurs. Pract., 15(4), 241-249. https://doi.org/10.1111/j.1440-172X.2009.01756.x

Tibshirani, R. (1996). Regression shrinkage and selection via the lasso. J. Royal Stat. Soc.: Ser. B (Methodol.), 58(1), 267-288. https://doi.org/10.1111/j.2517-6161.1996.tb02080.x

Tin Kam, H. (1995). Random decision forests. Proc. 3rd Int. Conf. on Document Analysis and Recognition. https://doi.org/10.1109/ICDAR.1995.598994

Trayhurn, P., Temple, N. J., & Van Aerde, J. (1989). Evidence from immunoblotting studies on uncoupling protein that brown adipose tissue is not present in the domestic pig. Can. J. Physiol. Pharmacol., 67(12), 1480-1485. https://doi.org/10.1139/y89-239

Vande Pol, K. D., Tolosa, A. F., Bautista, R. O., Willard, N. C., Gates, R. S., Shull, C. M.,... Ellis, M. (2021). Effects of drying and providing supplemental oxygen to piglets at birth on rectal temperature over the first 24 h after birth. Transl. Anim. Sci., 5(3). https://doi.org/10.1093/tas/txab095

Vande Pol, K. D., Tolosa, A. F., Shull, C. M., Brown, C. B., Alencar, S. A., & Ellis, M. (2020). Effect of drying and/or warming piglets at birth on rectal temperature over the first 24 h after birth. Transl. Anim. Sci., 4(4). https://doi.org/10.1093/tas/txaa184

Watson, G. S. (1967). Linear least squares regression. Ann. Math. Stat., 38(6), 1679-1699. https://doi.org/10.1214/aoms/1177698603

Wold, S., Sjöström, M., & Eriksson, L. (2001). PLS-regression: A basic tool of chemometrics. Chemom. Intell. Lab. Syst., 58(2), 109-130. https://doi.org/10.1016/S0169-7439(01)00155-1

Xiong, Y., Gates, R. S., Cooper, N. C., & Ellis, M. (2018). Neonatal piglet core body temperature model from surface temperature and environment measurements. Proc. 10th Int. Livestock Environment Symp. (ILES X). ASABE. https://doi.org/10.13031/iles.18-128

Zhang, Z., Zhang, H., & Liu, T. (2019). Study on body temperature detection of pig based on infrared technology: A review. Artif. Intell. Agric., 1, 14-26. https://doi.org/10.1016/j.aiia.2019.02.002