1. Introduction
Understanding and mitigating broiler discomfort in commercial housing is paramount for optimizing poultry production, ensuring animal welfare, and improving economic viability. Modern broiler breeds exhibit rapid growth rates and efficient feed conversion, resulting in high production volumes and competitive prices. However, these genetic and nutritional advances have also increased the birds’ vulnerability to environmental and physiological stressors, especially under intensive housing systems [
1,
2]. As consumer demand for ethical and sustainable poultry production intensifies, producers face growing pressure to adopt housing systems that ensure welfare, transparency, and productivity [
3].
Broilers, as homeothermic animals, maintain their internal body temperature within a narrow physiological range of 39 °C to 42.2 °C, even amidst environmental fluctuations [
4]. This thermoregulatory ability is essential for maintaining homeostasis; however, their limited feather coverage and absence of sweat glands restrict heat dissipation, making them highly vulnerable to heat stress [
5,
6]. Prolonged exposure to suboptimal thermal environments disrupts physiological equilibrium, adversely affecting immune competence and overall productivity [
7,
8]. When ambient temperatures exceed the thermoneutral zone, broilers exhibit characteristic stress responses such as panting, elevated respiratory rate, peripheral vasodilation, and diminished feed intake [
4,
9]. These responses can impair immune defenses, slow growth performance, and elevate mortality rates, collectively resulting in substantial economic repercussions [
10].
Environmental conditions, including air temperature, humidity, air quality, and ventilation, play a pivotal role in influencing broiler welfare and productivity. Insufficient ventilation and inconsistent airflow patterns can create localized thermal gradients, exposing birds to zones of heat or cold stress, particularly in older birds or under increased stocking densities [
11]. Elevated values of the temperature-humidity index (THI) correlate with reduced feed consumption, impaired weight gain, and altered hematological profiles [
12]. Excessive airspeed may provoke cold stress in younger birds if not appropriately moderated [
13]. Furthermore, relative humidity modulates concentrations of ammonia and airborne particulates, with direct implications for respiratory health and litter conditions [
14]. Although novel thermal assessment technologies, such as infrared thermography, have been introduced, their in-field application and validation across seasonal gradients remain limited [
15,
16].
Despite ongoing technological progress, many current studies rely heavily on controlled experiments or examine isolated environmental factors, limiting their translational impact in commercial settings [
17,
18,
19,
20]. Leveraging real-time data within sophisticated modeling structures has the potential to bridge this gap, enabling year-round optimization of broiler comfort and production efficiency [
21]. The potential of big data analytics and precision livestock farming tools remains untapped, mainly in the context of welfare optimization [
17,
19]. This gap highlights the need for translational research that applies predictive models, such as decision trees and data mining algorithms, to real-world contexts [
22,
23]. These methods have proven effective in identifying critical variables and enhancing environmental suitability assessments. Within this framework, precision animal agriculture emerges as a robust paradigm, aligning environmental conditions with broiler welfare needs and ensuring that animals can reach their full production potential [
24].
Maintaining broiler welfare is essential for both animal well-being and production efficiency. However, limited field data exist on how environmental and litter variables jointly affect comfort across seasons. This study addresses that gap by analyzing field data collected from commercial broiler operations to explore the dynamics of seasonal discomfort. Specifically, we aim to: (i) identify the temporal patterns of discomfort across weekly production cycles in summer and winter, (ii) determine the environmental and litter parameters most associated with comfort loss, and (iii) develop a predictive model to classify broiler discomfort based on measurable housing variables.
We hypothesized that: (1) broiler discomfort would be significantly higher during winter, particularly in the early and final weeks of production, (2) environmental parameters such as temperature, ammonia, and litter quality would show strong associations with discomfort, and (3) a predictive model using these recorded variables could accurately classify broiler comfort status. These insights are expected to enhance the implementation of automated, data-driven welfare management strategies in commercial poultry systems, contributing to more resilient and sustainable broiler production. Testing these hypotheses would not only clarify seasonal risk patterns but also enable the practical implementation of comfort monitoring tools in commercial farms.
2. Materials and Methods
2.1. Animals and Husbandry
The experiment was conducted in four commercial poultry houses located in the municipality of Capivari, São Paulo state, Brazil. A total of 1200 mixed-sex Cobb 500 broilers were placed at day-old and reared under standard commercial conditions until slaughter age (1–42 days). The poultry house operated under a negative-pressure tunnel ventilation system, designed to maintain airflow from cooling pads at one end to exhaust fans at the opposite end. Minimum ventilation was controlled by a timed system using sidewall fans, and a ridge vent allowed for natural airflow during milder conditions. The roof insulation is made of fiber cement tiles, and the ceiling insulation uses a black polyethylene curtain. The side insulation of the poultry houses is achieved with a black polyethylene curtain on the inner face and silver on the outer face. The construction materials include masonry structures for pillars and beams, a metallic structure to support the roof, a concrete floor, a 0.40 m high masonry curb, and bird-proof netting (0.02 m diameter).
The ventilation system comprises 10 axial exhaust fans (WF5015TCP, 50″, Munters® Borgarfjordsgatan, Kista, Sweden with 1.50 CV, three-phase, with louvers and a cone with a protective screen, 60 Hz, propeller rotation, three blades of 580 rpm) and a nominal flow rate of 47,572 m3/h, with a circular section of 1.30 m diameter, located on one side of each poultry house. The cooling system consists of evaporative pads made of ceramic bricks with six holes (side evaporative panel with dimensions of 20.12 × 2.24 m and a rear one with dimensions of 12.30 × 2.63 m). These pads were wetted by nebulizers, located on the side opposite the exhaust fans and the sides at the back of each poultry house, with nebulizing lines arranged transversely along the entire length of the poultry house, spaced 8.80 m apart. The heating system consists of an automatic diesel heater positioned in the center of the brooding area, utilizing a heating tube. This system consumed 740 L of diesel during winter and 180 L during summer.
The poultry houses were 16.00 m wide × 120.00 m long × 2.90 m high. Broilers were stocked at an initial density of 12 birds/m
2, which was maintained consistently throughout the entire production cycle. During the brooding period, the average temperature in the brooding zone was 33.2 ± 0.4 °C, following commercial thermal guidelines for early life stages. They are equipped with five lines of automatic feeders and 10 lines of nipple drinkers. Reused wood shavings from a second flock (depth 0.08 m) served as litter material.
Figure 1 illustrates the schematic of the variables assessed to assess broiler housing conditions.
2.2. Data Recording
Data on air temperature (°C), relative humidity (%), air speed (m/s), chicken litter pH, carbon dioxide concentration (ppm), ammonia concentration (ppm), illuminance (lx), and chicken weight (g) were collected at 12 equidistant points inside the poultry house, at bird height, at proximately 0.30 m from the floor (
Figure 2).
Ammonia concentration was recorded using an ammonia detector (Akso Electronic, Model SP2nd, São Leopoldo, Brazil), with a Limit of Detection (LOD) of 1.0 ppm and a Limit of Quantification (LOQ) of 2.5 ppm. Values below the LOD were recorded as 0.0 ppm, and those between LOD and LOQ were considered detectable but not quantifiable. Carbon dioxide concentration was recorded using a portable CO2 gas meter (Akso Electronic, Model AK786, São Leopoldo, Brazil). Air temperature and relative humidity were recorded by a data logger (AKSO Electronic, Model AK174). Air velocity was recorded using a VelociCalc® 9545 hot-wire anemometer (TSI Inc., Shoreview, MN, USA), which features a measurement range of 0 to 30 m/s, a resolution of 0.01 m/s, and an accuracy of ±0.015 m/s. The litter pH was measured using a digital pH meter with a measurement range of 0–14 ppm (Analion®, Model PM608, São Paulo, Brazil). Light was recorded using a THDL 400 multi-function digital meter (Instrutherm, São Paulo, Brazil) with a range: 0 to 20,000 lx, ± 2% of repeatability. Bird weight was measured to the nearest gram using a Pesola Light-Line spring scale (Pesola AG, Baar, Switzerland) with a scale interval of 1 g, a capacity of 5–20 kg, and an error limit of ±0.3% of the maximum capacity. Data were collected from four poultry houses with controlled environments.
Monitoring was conducted on one flock during the summer and another flock during the winter, spanning the six-week life cycle of the broiler chickens. For each flock, data were collected at three distinct times: from 7:00 AM to 9:00 AM, from 11:00 AM to 1:00 PM, and from 3:00 PM to 5:00 PM. These periods were chosen to represent the primary thermal phases of the day under commercial housing conditions. Evening measurements were excluded to avoid potential disruption of the broilers’ nocturnal rest patterns, which could induce unnecessary stress and compromise the birds’ welfare and behavior during the dark cycle. Each flock was monitored at 12 points per house, three times per day, over four houses, for six weeks, and across two seasons, resulting in n = 1728 measurement events. Each event recorded all environmental and litter variables simultaneously.
The Temperature-Humidity Index (THI) is a widely used indicator to assess thermal comfort or heat stress in animals, including broilers. It combines air temperature and relative humidity into a single metric. It was calculated using Equation (1). We calculated the THI according to Tao and Xin [
12].
where T = Air temperature in °C and RH = relative humidity (%).
To objectively assess broiler comfort, a binary comfort index was constructed based on environmental and physiological thresholds from current literature to influence broiler welfare. Each observational point was classified as: 1 (Comfort) = if environmental and bird-related variables (for instance, air temperature, air relative humidity, gas concentrations (NH3 and CO2)), remained within acceptable thresholds indicative of thermal and welfare comfort and 0 (Discomfort) = if any of the monitored parameters exceeded ranges associated with physiological stress, poor air quality (such as high NH3 or CO2), or adverse thermal conditions.
Comfort was classified as a binary variable based on threshold deviations in temperature and air quality parameters. These thresholds were: Temperature—Week 1 = 32–34 °C; Week 2 = 30–32 °C; Week 3 = 28–30 °C; Week 4 = 26–28 °C; Weeks 5–6 = 22–26 °C; Relative humidity: 50–70%; Ammonia ≤ 20 ppm; CO
2 ≤ 3000 ppm; Air speed: 0.1–0.3 m/s for weeks 1–2, 0.3–0.8 m/s thereafter (Binary Comfort Point). These thresholds were derived from established broiler welfare guidelines that define optimal thermal and gas concentration ranges for minimizing stress [
12,
25].
2.3. Data Analysis
To investigate the influence of housing environment and litter conditions on broiler comfort, a multifaceted statistical approach was employed. The dataset, derived from two commercial flocks (winter and summer), was first screened for normality, leading to the use of non-parametric methods where appropriate.
Since the dataset had a non-normal data distribution, Spearman’s correlation was applied [
13,
26]. Given the biological nature of the environmental data (e.g., zero-inflated ammonia levels, skewed air speed) and the non-normality of distributions, non-parametric methods were selected. The Mann–Whitney U test was used to compare environmental variables across seasons, and Spearman’s rank correlation was applied to explore monotonic associations with broiler comfort. These tests offer robust inference without requiring data transformation or parametric assumptions, which are often violated in farm-based datasets. These methods were complemented by a Random Forest model, offering predictive insights beyond pairwise associations.
A Random Forest classification model was developed to predict broiler comfort status based solely on recorded variables, with model performance assessed via accuracy, sensitivity, and specificity metrics. Feature importance scores revealed which variables most strongly contributed to discomfort. Random Forest was selected due to its robustness in handling non-linear relationships, multicollinearity, and noisy field data, making it well-suited for datasets with environmental variability typical of broiler housing conditions. This choice aligns with findings from agricultural studies where Random Forest consistently outperformed simpler models in predicting complex biological outcomes [
27]. Additionally, the Temperature-Humidity Index (THI) was calculated to contextualize thermal stress, and comfort distribution was stratified by week and season to uncover dynamic welfare patterns.
This integrated analytical framework enabled both descriptive and predictive insights into broiler welfare across production stages. The analyses and modeling were conducted using Python 3.10 (Python Software Foundation, Wilmington, DE, USA)with the libraries Pandas (for data processing), SciPy (for statistical testing), Scikit-learn (for machine learning), and Matplotlib version 3.7.1 and Seaborn version 0.12 (for visualization). All libraries (Michael Waskom, Python Software Foundation, Wilmington, DE, USA) are developed and implemented in Python 3.10.
3. Results
The analysis revealed distinct seasonal and temporal patterns in broiler comfort, supported by environmental and litter condition measurements collected across two production cycles.
3.1. Descriptive Analysis
Table 1 presents the Mann–Whitney U test for the seasonal variation of the variables. Median values for key broiler house parameters and significant differences (
p < 0.05) are presented, indicating variables influenced by seasonal conditions.
Figure 3 illustrates the trend analysis of the variables observed in the flocks during both the summer and winter seasons. The comparison highlights the influence of seasonal variation on the microclimate of broiler houses and bird performance over a 6-week production cycle.
Weekly discomfort frequencies were calculated as the percentage of observations classified as ‘discomfort’ within each week, based on the binary comfort classification. These values represent raw proportions (not smoothed) and provide a direct view of how discomfort evolved across the production cycle.
Figure 4 illustrates Spearman’s correlation matrix, highlighting the monotonic associations between housing environmental factors, litter parameters, and broiler comfort. The results reveal moderate positive correlations between broiler weight (r = 0.52) and air speed (r = 0.44) with comfort, suggesting that as birds grow and ventilation improves, comfort levels tend to increase. Weak positive correlations were observed for relative humidity (r = 0.16) and litter pH (r = 0.20), indicating that while these variables influence comfort, their effect is less direct or more gradual.
Conversely, ammonia and CO
2 concentrations showed negative correlations, confirming their detrimental effects on broiler welfare. Overall, thermal and air quality parameters, particularly temperature and ammonia, exert the most decisive influence on comfort status. Litter pH showed only weak correlations with discomfort compared to temperature, ammonia, and broiler weight. Microbial lag effects may explain this, as changes in litter pH occur gradually through microbial decomposition and fermentation processes, delaying their effect on ammonia volatilization and subsequent discomfort [
28]. Spearman’s method was essential here, as it captures these non-linear and non-normal relationships typical of field data. Also, the method confirms the multifaceted influence on broiler comfort, with thermal and air quality parameters being the most critical. It is especially valuable when assumptions of normality and linearity do not hold, as is often the case in real farm data.
Figure 5 presents the weekly frequency of discomfort levels by season. Discomfort levels were highest during the early (week 1), particularly in winter. Summer conditions showed consistently lower discomfort rates, indicating improved thermal and ventilation dynamics. These trends underscore the importance of implementing season-specific environmental management strategies to ensure broiler welfare.
Discomfort analysis across the production cycle revealed clear seasonal patterns. Winter flocks (Flock 1) exhibited higher discomfort rates throughout the first three weeks, with particularly elevated levels in week 1. These peaks likely reflect the difficulty in achieving stable thermal conditions during colder periods, especially during brooding and late growth stages when bird heat output and litter accumulation intensify. In contrast, summer flocks (Flock 2) experienced consistently lower discomfort levels. This outcome may be partly attributed to behavioral adaptations in more favorable thermal gradients, where birds tend to spread out more evenly within the house, thereby reducing localized heat accumulation and competition for cooler microzones. Such spatial redistribution behavior is less common in winter when birds huddle for warmth, potentially exacerbating litter moisture and localized discomfort. This result suggests that warmer ambient conditions and improved ventilation during summer contributed to a more favorable welfare environment for broilers.
3.2. Comfort Random Forest Model
A Random Forest classifier was trained using only directly recorded variables (excluding calculated indices, such as THI). The Random Forest model achieved high predictive accuracy, with broiler weight, ammonia, and temperature emerging as the most important variables. Prior to modeling, we evaluated potential multicollinearity using a correlation matrix (Spearman’s rank). We confirmed that no variables exhibited excessively high correlation (|ρ| > 0.85), ensuring that each contributed unique information to the model. This step minimized redundant predictors and improved the interpretability of feature importance rankings.
Table 2 presents a summary of the results. The table ranks environmental and litter-related variables based on their contribution to classifying broiler comfort (Comfort vs. Discomfort). Higher scores indicate greater predictive influence, with broiler weight, ammonia concentration, and air temperature emerging as dominant predictors. The variable importance chart shows that Broiler Weight, Air speed, and Temperature are the top contributors to predicting comfort. These align with known welfare drivers in broiler management. Group cross-validation results (5-fold) reveal the Mean Accuracy = 75.96% and the Standard Deviation = ±22.9%
Table 3 shows the model performance metrics. The model was trained on recorded environmental and broiler variables, with performance evaluated on a 30% holdout test set. Metrics include precision, recall, and F1-score for each class (Comfort vs. Discomfort), and the overall accuracy of the model, demonstrating high predictive accuracy (97.1%) and balanced performance across both comfort outcomes.
The confusion matrix heatmap is presented in
Figure 6. The x-axis shows predicted labels, and the y-axis shows actual (true) labels. Cells are color-coded for interpretability: comfort conditions are shown in blue, and discomfort conditions in red. The model demonstrates high classification accuracy, with strong sensitivity and specificity, particularly in identifying scenarios that may compromise broiler welfare. High values along the diagonal reflect strong model performance in correctly classifying both comfort and discomfort cases.
To assess the robustness and generalizability of the discomfort classification model, a grouped cross-validation approach was employed using Flock ID as the grouping variable. This procedure ensured that data from a single flock was not split between training and validation sets, thus minimizing the risk of overfitting due to temporal or management-specific biases. The Random Forest classifier confirmed strong predictive performance, achieving an average accuracy of 82.2%, precision of 71.8%, recall of 64.7%, F1-score of 54.4%, and area under the ROC curve (AUC) of 73.6%. These results indicate that the model performs reliably in distinguishing between comfort and discomfort conditions under varied seasonal and environmental contexts. The model’s sensitivity (recall) highlights its potential utility in early detection of discomfort events, while the overall balance across metrics supports its application in real-world broiler monitoring systems.
4. Discussion
This study provides new evidence on how seasonality and housing microenvironment interact to influence broiler comfort in commercial poultry production. Through a detailed, week-by-week analysis of two flocks raised under summer and winter conditions, we observed clear trends of discomfort that underscore the importance of targeted environmental management throughout the broiler lifecycle. Our binary classification (Comfort = 1, Discomfort = 0) was developed to enable rapid integration into automated welfare monitoring systems for commercial farms. The thresholds used (age-specific temperature, RH, NH
3, CO
2, air speed) were drawn from established welfare guidelines [
12,
20,
25]. While synergistic effects of sub-threshold deviations are important, this initial binary framework allows for practical on-farm decision-making.
Seasonal discomfort patterns highlight the challenges of maintaining stable housing conditions and underscore the need for adaptive management. Beyond welfare implications, heat stress also has a measurable economic effect, resulting in reduced feed efficiency, slower growth rates, and higher mortality, which collectively contribute to significant financial losses in the poultry industry [
1,
29]. This further underlines the importance of developing predictive tools that allow early intervention to mitigate both welfare and economic risks.
Discomfort rates were markedly higher in the winter flock (Flock 1), particularly during the first three weeks of rearing. These findings align with known challenges in maintaining adequate thermal comfort during cold periods, especially when broilers are either very young or nearing market weight. The summer flock (Flock 2) also exhibited higher discomfort across the first three weeks. This seasonal contrast suggests that warmer ambient conditions and improved natural airflow in summer may help maintain thermal stability and litter quality, two factors known to influence broiler welfare [
2,
11]. Similar seasonal effects on broiler microclimate and welfare were reported by Du et al. [
30] using CFD optimization models for tunnel ventilation.
The Random Forest model identified broiler weight, air speed, and temperature as the most influential variables, achieving high predictive accuracy. Similar applications of Machine Learning have been shown to effectively classify environmental conditions and predict welfare outcomes in poultry houses [
18], supporting the potential of data-driven approaches to enhance decision-making in commercial production systems. These findings are consistent with established literature, which indicates that air temperature remains a primary determinant of thermoregulation [
12,
13]. Previous studies have also highlighted air quality, which is related to air renovation, as a key determinant of welfare in broilers [
20,
31]. Broiler weight likely serves as a proxy for age-related physiological changes and the bird’s ability to buffer thermal stress. Air speed and relative humidity were also relevant but less predictive, suggesting their effects may be more indirect or modulated by other variables.
Higher ammonia concentrations in winter were strongly associated with discomfort, highlighting the need for improved ventilation and litter management strategies. Ammonia is a well-documented risk factor for respiratory irritation, immunosuppression, and increased susceptibility to secondary infections in broilers [
20]. This outcome highlights the importance of implementing season-specific mitigation strategies, such as targeted litter amendments and controlled ventilation, to reduce ammonia volatilization without compromising thermal comfort. These may include strategies such as increasing litter turning frequency, applying acid-based litter amendments, and utilizing strategic ventilation bursts during warmer parts of the day to avoid excessive heat loss while promoting air exchange. Studies have shown that such interventions, especially litter acidifiers and improved airflow management [
31,
32], can significantly reduce ammonia volatilization and its associated welfare risks without compromising thermal comfort. Moreover, field measurements confirm that winter-season ammonia emissions are exacerbated by reduced ventilation, especially in houses using reused litter, and thus require proactive abatement strategies [
33].
The high accuracy and interpretability of the discomfort prediction model make it well-suited for integration into sensor-based monitoring platforms commonly used in precision livestock farming. Environmental sensors can continuously capture real-time data on temperature, humidity, ammonia, and CO
2 levels, which are then fed directly into the trained model for automated comfort classification. Alerts could be triggered when discomfort probability thresholds are surpassed, prompting immediate ventilation or litter management adjustments. Such Internet of Things (IoT) based welfare monitoring systems can automate early detection and interventions in poultry housing by continuously capturing environmental and behavioral data. Similar approaches have already been applied successfully in broiler production, where sensor networks combined with predictive algorithms improved ventilation control and reduced welfare risks [
34]. Integrating this model into existing sensor platforms could enable real-time comfort classification in broilers, enhancing decision support for precision livestock farming [
21]. This integration would enable farms to transition from reactive to predictive welfare management, optimizing resource use while maintaining high standards of welfare. This approach aligns with recent trends in smart farming, where machine learning models are embedded within IoT infrastructures for continuous monitoring of animal health and environmental control.
The discomfort classification model used only recorded environmental variables, making it adaptable for real-time decision support in precision farming systems. These results offer practical applications for broiler producers, particularly in identifying early signs of stress and adjusting ventilation, heating, or litter strategies accordingly. The integration of both descriptive statistics and machine learning modeling strengthens this study. Spearman’s correlation further highlighted how non-linear relationships between variables can still yield actionable insights when normality assumptions are not met [
26], a common challenge in field-based agricultural datasets.
While the model achieved a high mean accuracy of 97.1%, the relatively large standard deviation (SD = 22.9%) observed across cross-validation folds suggests some variability in performance depending on data partitions. The dataset exhibited a strong class imbalance, with discomfort cases accounting for 81.97% of all observations and comfort cases comprising only 18.03%. This imbalance may explain part of the variability observed in the cross-validation results. This imbalance likely reflects real housing conditions, where environmental parameters frequently deviate from ideal comfort ranges due to seasonal variation, litter accumulation, and ventilation constraints, resulting in more frequent discomfort classifications. Such skewed distributions are common in field-based welfare monitoring, where perfect comfort conditions are rarely sustained across an entire production cycle. While the model handled this imbalance reasonably well, future iterations could benefit from class-balancing techniques (such as SMOTE) to further stabilize performance across folds. Future studies should validate this predictive framework across multiple farms with different housing designs, management practices, and genetic strains to ensure its robustness and broader applicability to diverse commercial settings.
Although the findings are compelling, the study is limited to two flocks across distinct seasons. Future work should incorporate additional cycles, geographic regions, and broiler breeds to enhance generalizability. Moreover, integrating sensor-based, real-time monitoring systems could automate the comfort index classification and trigger environmental corrections more responsively.