PREDICTION OF FREE-STALL OCCUPANCY RATE IN DAIRYCATTLE BARNS THROUGH FUZZY SETS

The goal of this study was to develop a fuzzy model to predict the occupancy rate of free-stalls facilities of dairy cattle, aiding to optimize the design of projects. The following input variables were defined for the development of the fuzzy system: dry bulb temperature (Tdb, °C), wet bulb temperature (Twb, °C) and black globe temperature (Tbg, °C). Based on the input variables, the fuzzy system predicts the occupancy rate (OR, %) of dairy cattle in free-stall barns. For the model validation, data collecting were conducted on the facilities of the Intensive System of Milk Production (SIPL), in the Dairy Cattle National Research Center (CNPGL) of Embrapa. The OR values, estimated by the fuzzy system, presented values of average standard deviation of 3.93%, indicating low rate of errors in the simulation. Simulated and measured results were statistically equal (P>0.05, t Test). After validating the proposed model, the average percentage of correct answers for the simulated data was 89.7%. Therefore, the fuzzy system developed for the occupancy rate prediction of free-stalls facilities for dairy cattle allowed a realistic prediction of stalls occupancy rate, allowing the planning and design of free-stall barns.


INTRODUCTION
The animals, in general, are adaptable, able to maintain the life and performance in a wide range of physical, chemical, biological and social environments (BERTIPAGLIA et al., 2007).However, the understanding of the relationship between the animal and the complex environmental interactions is not yet fully defined (RODRIGUES et al., 2010).
The thermal environment has a strong influence on animal performance, since it affects the mechanisms of heat transfer and thus the thermal balance between the animal and the environment (PERISSINOTTO et al., 2007a;NAVARINI et al., 2009).In the tropics, a major problem for the cattle industry, especially for dairy cattle, lies in the dissipation of body heat to the environment (ALMEIDA et al., 2010).High temperatures, when associated with high relative humidity in confinement sheds especially when designed improperly, further contribute to the low performance of dairy cattle under heat stress conditions (FARIA et al., 2008).For maximum profitability in the production of dairy cattle, a good productive and reproductive performance of the cattle is necessary.Environmental factors, in different circumstances, may affect milk production and fertility of animals, compromising the profitability of the activity (FERRO et al., 2010).
Seeking to better production, producers increasingly adopt intensive animal production systems.These systems have a direct influence on the condition of comfort and well-being of the animals.Heat exchange between the animal and the environment as well as the expression of its natural behaviors may be affected in this type of facilities, requiring greater care so that there is no impairment of their productive and reproductive performance.Adaptation to climate conditions of the dairy breeds of European origin constitutes a problem in breeding these animals which, due to high productive capacity, often suffer physiological and behavioral changes caused by heat stress, causing a reduction in milk production (PERISSINOTO et al., 2007b).
For animals kept in confinement, the study of animal behavior is of great importance (DAMASCENO & TARGA, 1997), being able to indicate the welfare of dairy cows (BOND et al., 2012).
According to COOK et al. (2005) in a free stall system, after the morning milking, the goal is that 85% of cows are lying down.However, environmental factors can affect the number of animals lying in the stalls.According to ALBRIGHT et al. (1989), cows normally prefer to ruminate lying in thermoneutral situation, this allows the physiological rest and physical recovery of the animal.However, these animals spend more time ruminating on foot, to facilitate heat dissipation (DAMASCENO et al., 1998).It is important for the welfare of the animal to provide a clean, dry and comfortable surface for cows to rest, since they remain about 12 hours a day lying on the surface, resting (HALEY et al, 2001).
A production system is evaluated with some precision by means of appropriate variables measures such as weight gain, feed efficiency and quantity of milk (BARBOSA et al., 2004).However, given the current market demands, we can no longer evaluate a system of animal production or supply chain considering only productivity.The concept of welfare in animal production becomes a necessity when seeking to optimize production rates and to make the activity competitive.
To better assess the environment in animal production, the help of innovative methods, noninvasive tools of welfare assessment and control are being searched (BORGES et al., 2010).In this sense, the study of animal behavior becomes an important tool for the evaluation of farming systems, besides providing answers to many basic questions of ethology (BARBOSA FILHO et al., 2007).
The estimation of animal welfare, considering all the possibilities for critical associations of the thermal environment, constitutes a problem where the application of the theory of fuzzy sets may appear promising (PONCIANO et al., 2011).
Several environmental control systems and prediction of productive responses in zootechnical facilities, using computational mathematical modeling, were developed by NÄÄS et al. (2008) in estimation of estrus in dairy cows using predictive quantitative methods, SCHIASSI et al. (2008) using fuzzy model to evaluate the increase of body temperature of broilers, and FERREIRA et al. (2010) in predicting rectal temperature of broilers using a neuro-fuzzy network, and these studies obtained satisfactory results when considering the level of control that the proposed models have provided to the production.
Given the above, the aim of the present study was to develop a fuzzy model for predicting the occupancy rate of free-stalls facilities for dairy cattle, assisting in the optimization of project designs.

MATERIAL AND METHODS
A fuzzy model was elaborated based on experimental data arising from field collection in which it was sought to verify the influence of the environment on the occupancy rate of stalls for dairy cows in free-stall facility.
To develop the fuzzy system, we defined as input variables: the dry bulb temperature (T db , °C), wet bulb temperature (T wb , °C) and black globe temperature (T bg , °C).Based on the input variables, the fuzzy system predicts the occupancy rate (OR, %) of stalls for dairy cows in free-stall.
For analysis, we used the Mamdani inference method, which brings as a response a fuzzy set originated from the combination of input values with their respective pertinence degree, by the minimum operator and then by the superposition of the rules through maximum operator.The defuzzification was performed using the method of Center of Gravity (Centroid or Area Center), which considers all possibilities of output, transforming the fuzzy set originated by inference into numerical value, as proposed by TANAKA (1997) andSIVANANDAM et al. (2007).
The domains in the intervals of the input variables are shown in Figure 1  In building the fuzzy sets, we used as output variable a trapezoidal model, because it is the one that best adjusts when the output variable contains regions with similar weight of pertinence degree to small changes in input variables, as proposed by YANAGI JUNIOR et al. ( 2012) and PONCIANO et al. (2012), with six characterizations regarding the occupancy rate (OR), Figure 2, distributed in ranges between 0-20, [90][91][92][93][94][95][96][97][98][99][100].Pertinence curves for the output variable of occupancy rate (%).The fuzzy rules system was created based on information from the literature and through the assistance of experts, in the form of linguistic sentences.Three experts were selected according to fuzzy expert selection methodology proposed by CORNELISSEN et al. (2002) and used by ESCOBAR & GALINDO (2004).This methodology ensures desired characteristics of an expert (AYYUB & KLIR, 2006), given its direct influence on the reliability and quality of results (MARTINO, 1983;PREBLE, 1984;TAYLOR, 1988).
In accordance with combinations of input data, 125 rules were defined and, for each rule, a weighting factor equal to 1 was assigned.The weighting factor equal to 1, usually adopted as default, was chosen because it was suitable to the proposed model based on the behavior of the results obtained by the simulations.Moreover, this value has been adopted in many fuzzy models reported in the literature (FERREIRA et al., 2007;SCHIASSI et al., 2008;CREMASCO et al., 2010).
For the validation of the model proposed, we used field data collected at the facilities of the Intensive System of Milk Production (SIPL), of the Dairy Cattle National Research Center (CNPGL) of Embrapa, located in Coronel Pacheco citystate of Minas Gerais (MG), in Brazil, Zona da Mata region in the state of Minas Gerais.
The environmental (T db , T wb and T bg ) and behavioral (occupancy of the stalls) data were collected at regular intervals of one hour, from 8 to 17 hours, during the summer, totaling at least 30 days of collection.
The occupancy of the stalls (OR) was evaluated in the same periods of data collection of the thermal environment.With the aid of the floor plan of the facility, we marked the stalls that were being occupied by cows.The number of animals that occupied the stalls during the evaluation in relation to the total number of stalls was turned into a percentage.
Geographically, SIPL is located at latitude 21º33'22" S and longitude 43º06'15" W, with an altitude of 414m (CAMPOS et al., 2002).The region climate, according to Köppen, is Cwa, i.e., hot weather, rainy temperate, with a dry season in winter, and a hot summer.
A free-stall shed was evaluated, with 37.02m long, 26.20m wide, 7.00m high, in the center, and 3.50m of ceiling height, with a capacity to accommodate 80 adult animals, divided in four lots.
The shed had the following characteristics: full opening at the four sides, precast concrete pillars, slotted concrete floor for better water and waste drainage, central feed corridor measuring 4.50m wide, and handling corridor of 3.82m to conduct groups for milking parlor.
The beds were covered with sand, containing inside whole tires, to reduce the loss of sand.
The roof had fiber cement tiles, with an area of discovery ridge, to obtain ventilation by thermosyphon effect.The gables were sealed with fiber cement tiles, installed in the vertical position, aiming to reduce the incidence of direct solar radiation inside the facility.
Black globe thermometers were installed in the center of four stalls, in a row, with the objective of evaluating the temperature distribution in the facility (Figure 3).In these same points, we collected air speed, however, this variable was not used in the proposed model.Along with globe thermometers, in each stall employed, digital thermohigrometers were installed, to determine the parameters: ambient temperature, relative humidity, maximum daily temperature, maximum daily relative humidity, and psychrometers, for determining the wet bulb temperature.
In a weather station located on the outside, near the shed, we installed maximum and minimum thermometers, dry bulb and wet bulb thermometer.
When new computer systems are created in order to support decisions, it is necessary to adopt measures that analyze the descriptive power of the new system created.Such measures serve, for example, to evaluate the efficiency of a system in generating responses on the prediction of occupancy rate that are very close to reality.Thus, when a system of mathematical modeling is developed, it is important to evaluate the classification power of the system, in this case, the power to predict the occupancy rate of stalls in free-stall facility related to variations in the thermal environment within the facilities.
In this study, the model was assessed by the standard deviation presented between the values experimentally measured and the ones presented by the model and by statistical analysis in a completely randomized design, developed in the statistical program SISVAR 5.3.

RESULTS AND DISCUSSION
Figure 4 shows the surfaces generated from the interaction between T db , T wb , and T bg and its effects on the occupancy rate.The peaks shown in Figure 4 indicate the range where OR is high.The highest values of OR, in general, were found when the environment had lower values of the variables analyzed (T db , T wb , T bg ).However, when we separately evaluate the influence of each variable on the model, it is observed that T db has the greatest effect on the OR, because when this variable has high values (higher than 30°C) it does not depend on the variation of T wb and T bg , its values of OR remain constant (Figure 4a and 4b).The regions where there were changes in the environmental variables and OR remained constant represent situations in which the interaction between these variables did not influence the behavior of animals as the occupancy rate of the stalls, a result similar to that observed by HERNÁNDEZ JULIO et al. (2012) when analyzing the physiological and behavioral responses of dairy cattle in free-stall facility.

Twb Tdb Twb Tbg
Tbg Tdb Considering the different effects and interactions of the environment on the occupancy rate of the stalls in free-stall facility for dairy cattle, the comfort condition of these animals would imply in decision making aiming at suitability of the environment, the fuzzy system could be triggered to send a warning, aiming the activation of temperature control systems, thereby preventing the exposure of the animal to stressful environment.
In Table 1, it is possible to observe the standard deviation obtained for each set of validation data for the fuzzy model proposed to estimate the OR of dairy cows in free-stall facility.
The results of the OR estimated by fuzzy system presented value of average standard deviation of 3.93% when compared to the values observed experimentally, and the highest deviation observed was 7.42%, and the lowest was 0.21%.
The standard deviation is a measure of the dispersion used with the mean that measures the variability of values around the mean.To consider or not the high standard deviation depends on the type of variable that is being evaluated, then for greater accuracy of results obtained by the fuzzy model developed, we carried out a statistical analysis, which showed that the results obtained by the model and the measured values showed no difference by T test (P>0.05).The coefficient of determination (R 2 , %) was calculated, because it is a measure of quality of the model in relation to its ability to correctly estimate the values of the response variable.The evaluation of the functional relation between the values observed and simulated by the model (R 2 ) is shown in Figure 5.The R 2 found showed that 75.45% of the variation may be explained by the model.The permanence of dairy cattle in stalls in free-stall facilities depends not only on environmental variations, but factors such as food and rumination influence the pursuit of animals to stalls.DAMASCENO et al. (1999), when studying the behavior of Holstein cows in free-stall facilities, observed that most animals ruminated lying in the stalls.However, during the hottest hours of the day, there was greater frequency of animals standing, ruminating in the corridors from 14h, reaching highest concentrations of this behavior around 18h.
In order to validate the proposed model, field data of environmental variables were used as input in the fuzzy system developed, and the responses obtained were compared with the values of occupancy rate observed in the field, considering that the percentage of the total hit to the simulated data was 89.7%.
In studies carried out using fuzzy logic, aiming to estimate estrus in dairy cows, NÄÄS et al. (2008) obtained a mean hit percentage of 62%, while BRUNASSI et al. (2010) observed hit rate of 84.2% in the detection of estrus.According to the authors, these results indicate that the system can efficiently detect estrus improving automatic detection in dairy cows.
Given this, the hit rate of the coefficient of determination of 75.45% obtained in this study for the simulated data demonstrates the efficiency of the developed model, and it may be used as a tool to aid in the design of facilities for dairy cattle, optimizing the facility and avoiding unnecessary expenses related to improper planning of the occupancy of stalls.

CONCLUSIONS
The fuzzy system developed to predict the occupancy rate of stalls in free-stall facility for dairy cattle, based on dry bulb temperature (T db ), wet bulb temperature (T wb ) and black globe temperature (T bg ), provided low values of standard deviation, allowing a realistic prediction of occupancy rate of stalls, aiming the planning and design of free-stall facilities.
Fuzzy logic is a promising technology in predicting occupancy rate of stalls for dairy cattle, and it may be used to support the decision making on the control of thermal packaging systems for free-stall facilities.
FIGURE 1. Pertinence curves for the input variables, (a) dry bulb temperature (T db ), (b) wet bulb temperature (T wb ), and (c) black globe temperature (T bg ).

FIGURE 3 .
FIGURE 3. Floor plan of facility with points of data collection.
Occupancy rate of dairy cattle in free-stall facility in function of T wb and T db (a), T wb and T bg (b) , T bg and T db (c).

FIGURE 5 .
FIGURE 5. Regression model and coefficient of determination (R 2 ) generated between the stall occupancy rate observed and the stall occupancy rate estimated by fuzzy logic.

TABLE 1 .
Comparison of occupancy rate (OR) observed and simulated by the fuzzy system.