## 4 Discussion
### Ability of an Open-Source Sensing System to Classify Behaviors  
The analysis of animal behavior has been extensively explored with the advancement of precision technologies, which allow for automatically monitoring animal behaviors with a degree of detail not possible previously. However, such technologies for monitoring behavior have not been widely used in heat-stressed animals, and it is not clear whether traditional behavioral classification algorithms need to be updated to reflect the distribution of behaviors expected during HS. In sheep, the use of wearable sensors, mainly accelerometers, has been explored to detect behaviors such as lying, ruminating, walking, and grazing [52; 53; 54] and more specific applications for health monitoring such as lameness detection [55]. Nevertheless, these technologies can also be applied to understand the physiological state of an animal by monitoring its responses in a specific environment. Therefore, sensing technologies to distinguish the activities of animals under thermoneutral and stressed conditions that are more sensitive across the true distribution of behaviors during exposure to heat load is critical for more precise management of HS conditions. Before sensing technologies can be used to understand behaviors, machine learning algorithms are needed to translate sensed data into meaningful output. The RF algorithm in this study could differentiate between behaviors with medium-high accuracy (Table 2) when derived and evaluated across all data from all temperature ranges. The eating activity was the most accurately (78%) classified behavior, followed by laying, laying, and ruminating (77% and 76%, respectively). These accuracies were lower in comparison with the 95% performance for standing and laying classification in sheep found by [56] and for standing and lying (87% and 84% accuracy, respectively) classification in cows found by [57]. The authors in [58] evaluated the use of an accelerometer to classify seven behaviors of interest in cows and found similar accuracy (80%) and lower sensitivity (52%) for feeding behavior in comparison with the present study even though a different algorithm was used. Overall, developing an approach that maintains satisfactory levels of accuracy while minimizing the amount of data analyzed is considered a main obstacle in using IMU [59]. Several factors can influence the accuracy of algorithms used in classifying behaviors, including the placement and orientations of the sensors, appropriate sampling frequency, number of animals, and the accelerometer itself [60]. Despite the significant progress of technologies, there is a gap in the use of those technologies to measure the behavior and adaptations of livestock to environmental challenges. Specifically, the lack of appropriate algorithms that are robust across climate conditions. In this context, to evaluate the robustness of the algorithm in different temperatures, the accuracy and precision of the random forest algorithm across the different temperature ranges were also tested (Table 3). In general, the results show a similar range of accuracies when evaluated within the temperature range used for derivation. Interestingly, the accuracy of eating behavior classification was highest in the 27 \({}^{\circ}\)C environment, while the lower accuracies for standing and ruminating while standing behaviors were consistent among all environments. Although lying behavior was the most frequent among all thermal environments, it was not always the best classified, which suggests that the imbalance of data associated with normal time budget differences among behaviors was not solely responsible for creating deviations in the accuracy of the models. When models derived under specific thermal environments were evaluated based on data obtained from different temperatures, there were notable shifts in model performance (Table 4).