## 5 Results  
In this section, we present the experimental results of our models and assess their behavior. We consider two samples of tabular data with their corresponding thermal images. In sample A, we have information about the temperature-humidity index (THI) at the moment of each of the 138 measurements, as well as the respiration frequency, pulse, and rectal temperature of 118 dairy cows from one farm. Sample B consists of 522 data instances for 295 animals, this time coming from two different farms and with the exception of the pulse measurements that are not available for all the animals; hence, we can discard them in this setting. In both cases, we begin with clearing the data and encoding the hour of the day in which the corresponding measurement has been taken, as the physiological parameters may differ according to the time of the day. Thus, we have a binary-encoded time variable, in addition to the numerical features and the infrared images, and a target which we want our model to be able to predict with a reasonable degree of precision. Neither the images nor the tabular data alone are sufficient to achieve this goal, even when using highly advanced machine learning algorithms. Our test shows \(R^{2}<0.3\) and a mean absolute error (MAE) to within a couple of degrees Celsius.  
After processing the image layer in the standard manner using a convolutional neural network (CNN), and by concatenating the result with our tabular data containing numerical features and dummy variables, we let the AutoML engine rank the models for both samples with respect to the \(R^{2}\), MAE, MedAE, and \(\text{RMSE}=\sqrt{\text{MSE}}\) metrics. The ensemble learning algorithms and neural networks provide the most accurate results: the 'winners' for both samples are XGBoost, CatBoost, and NeuralNetTorch. The WeightedEnsemble_L2 model essentially provides a weighted sum (stacking) in order to refine the final prediction, and the improvement for the two datasets can be seen in Tables 2 and 3. The evaluation is based on cross-validation, which tends to provide a more accurate and objective assessment.  
\begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Model** & \(\mathbf{R^{2}}\) & **MAE** & **MedAE** & **RMSE** \\ \hline WeightedEnsemble\_L2 & 0.645 & 0.219 \({}^{\circ}\)C & 0.092 \({}^{\circ}\)C & 0.254 \({}^{\circ}\)C \\ NeuralNetTorch & 0.624 & 0.278 \({}^{\circ}\)C & 0.092 \({}^{\circ}\)C & 0.262 \({}^{\circ}\)C \\ XGBoost & 0.457 & 0.238 \({}^{\circ}\)C & 0.158 \({}^{\circ}\)C & 0.314 \({}^{\circ}\)C \\ CatBoost & 0.385 & 0.227 \({}^{\circ}\)C & 0.119 \({}^{\circ}\)C & 0.334 \({}^{\circ}\)C \\ \hline \hline \end{tabular}
\end{table}
Table 2: Best performing models for the regression task for sample A, according to AutoGluon.  
Finally, we plot the data from the measurements and the predicted values to visualize the overlap between the two sets (see Figures 8 and 9). There are some outliers which may be analyzed further in the context of detecting pathological tendencies such as illness or thermal stress in animals. Let us note that if one attempts to reverse the problem, e.g., predicting the pulse or respiration frequency based on thermal images and the remaining tabular data, the accuracy of the regression model is significantly reduced: \(R^{2}\) varies in a wide range and the relative error is up to 60%, and so the target choice is not quite arbitrary. We also find predictions based on the \(R^{2}\) cross-validation metric to be better fitting for both samples.