ESTIMATION OF RESPIRATORY FREQUENCY AND RECTAL TEMPERATURE ON PIGS IN HEAT STRESS BY FUZZY LOGIC 1

Physiological parameters such as respiratory frequency and rectal temperature stand out as indicators for heat stress in pigs, however, requiring time and labor for measurements. The possibility of using infrared thermography associated with prediction systems of these physiological variables can help in decision making, allowing greater welfare and productivity of the animals. With this objective, an experiment was carried out with growing pigs submitted to acute and chronic heat stress, working with a thermoneutrality temperature (22° C) and heat stress (34° C). The results were used for the development of a fuzzy model using as input variables: air dry bulb temperature (°C), average surface temperature (°C) and, as output variables: respiratory frequency (movements/minute) and rectal temperature (°C). The method of inference used was the one of Mamdani having been elaborated six rules and the defuzzification technique used was the one of the Center of Gravity. In the obtained results on simulation model when compared with experimental data was evidenced satisfactory efficiency in respiratory frequency determination and the rectal temperature, in which the R values calculated were respectively 0.997 and 0.951 for acute stress and 0.993 and 0.964 for chronic heat stress.


INTRODUCTION
In the current competitive scenario, building and managing knowledge to support experts in process control, in general can be useful for a production unit whether industrial or agricultural, especially when it comes to processes that occur under uncertainties and with incomplete data.
The physical environment, because it encompasses the meteorological elements that affect the mechanisms of energy transfer, regulation and thermal balance between the animal and the environment, exerts a strong influence on the performance and health of the animals (Pandorfi et al., 2012).Heat stress is one of the constraints on Brazilian production, so the animals' adaptability to constant temperature changes must be the object of observations and adaptations by producers (Sommerfelt & Rempel, 2015).
Precision animal husbandry is related to optimized loss reduction, throughout the process managed through modern information technologies to collect process and make decisions (Nääs, 2011).Thus, it is called "Precision Poultry" part of the swine industry, which employs the use of information technology, sensors and actuators to record information related to the production system and the interference of environmental variables in production units.
Precision pig farming aims to reduce or avoid localized losses which provide better control over the use of the resources involved in the production chain.The technologies provide simple and efficient solutions to major problems related to the environment, equipment management and control of livestock in the industrial pig production (Pandorfi et al., 2012).
A well-developed system can respond to situations of adversity in an intelligent way with the incorporation of computational tools with the use of neural networks and fuzzy logic.The feasibility of using RNA to predict animal husbandry technical indexes based on the variables, air temperature and respiratory frequency in swine breeding stock showed good performance in this type of problem and allowed the representation on thermal comfort condition and animal welfare (Pandorfi et al., 2011, Goel et al., 2013).
Engenharia Agrícola, Jaboticabal, v.38, n.4, p.457-470, jul./ago. 2018 Fuzzy logic is a technique that can solve complex modeling problems with qualitative aspects subject to relevant probabilistic variations, or described by different and incomplete databases.The fuzzy logic use is especially suited to biological problems, since these have the following characteristics: the process is defined in a vague, imprecise, uncertain way; there are situations of difficult estimation or evaluation on the parameters that define the process; the system is nonlinear and time variant; there are situations in which it is difficult to record the value of the variables; the measures may be unreliable (Vasconcelos de Oliveira, 2014).
Based on this principle, the introduction of the knowledge on fuzzy sets theory in animal production area, mainly relating to the built environment systems and the rural constructions themselves, is innovative and current.The built environment constitutes the urban form as a humanized space being analyzed from the urban morphology and the built typology while the rural constructions is a part of the rural engineering of great importance in any type of planning to foment agricultural activities as well in animal breeding as in agriculture, in general.Its field of activity is very broad aiming at increasing productivity through rationalization production methods, such as animal facilities, storage and production processing, use of by-products, industrialization and market, as the main examples.It should be considered that this tool can greatly help decision-making in automation projects in air-conditioned environments, considering a series of input variables that can efficiently reflect the user's responses, in animal case (Scattone, 2014).The use of fuzzy set theory allowed us to infer environmental data from the gestation sector, with 24 gilts matrices, 12 female housed in individual feedlots and 12 in collective feedlots with those established in the literature, through a rule base for the determination of environmental thermal comfort applied to matrices in the gestation phase (Pandorfi et al., 2007).
The information obtained from production systems is usually interpreted in linguistic terms.Performance indices, the quality of the final product, the breeding environment and, currently, animal welfare are qualitatively evaluated parameters and classified by linguistic variables.In this way, the application of fuzzy sets theory has been occurring in the ambience and animal production areas, by Brazilian researchers (Yanagi Junior et al., 2011;Yanagi Junior et al., 2012;Schiassi et al., 2014) whom prove the effectiveness on this tool use in their studies of ambience and animal welfare.
In view of the presented versatility by this computational mathematical tool, the present study had the objective of developing a fuzzy model for predicting the rectal temperature of pigs submitted to acute and chronic heat stress.

MATERIAL AND METHODS
The use of animals on the experiment was approved by the CEUA (Ethics Committee for the Use of Animals) of Federal University of Lavras (UFLA) with protocol number 059/14.
Twenty-four castrated male pigs were used from commercial hybrid lineage of high genetic potential with initial average weight of 30.5 ± 0.6 kg and average age of 77 ± 2 days.The animals were housed in two climatic chambers with temperature control, relative humidity and ventilation.The temperature control and the air relative humidity inside were carried out by means of two sensors that were connected to a panel located in the antechambers that was operated to maintain constant temperature and humidity.Each chamber had six experimental feedlots with concrete floor, useful area of 2.3 x 1.5 m, equipped with semi-automatic feeder and water taps, pacifier type with height adjustment.
In each chamber were housed 12 pigs (two animals per feedlots), being the feedlot an experimental unit (n=6).The animals were distributed in a randomized complete block design, constituting two treatments: (Treatment 1thermoneutrality at 22°C, n=6) and (Treatment 2 -heat stress at 34°C, n=6).The established temperatures were based by Renaudeau et al. (2011) which determined the temperature at 24º C as the critical point temperature in pigs' growth and finishing phases, considering the thermoneutral zone proposed by Perdomo (1994), for pigs at this stage between 18 and 23ºC.Temperatures at 22 and 34ºC were also evaluated by Manno et al. (2006) and Batista et al. (2011), respectively.The experiment had two experimental periods, with the purpose of characterizing two types of stress: acute stress (short period of time) and chronic stress (long period of time) by heat.The experimental period of acute heat stress lasted 48 hours, and chronic stress lasted 71 days.The initial weight was used as criterion for the formation of blocks.
The environmental conditions of the climatic chambers were monitored during the whole experimental period by a digital thermohygrometer (Model 7666.02.0.00,Manufacturer: Cotronic Technology Ltd -Incoterm, China, with an accuracy of ± 1°C and ± 5% RH), with internal sensor and external sensor connected to the black globe.Four (two in each chamber) equipment were kept at different points of the experimental units at half height of the animals' body.
The animals received a diet formulated with corn and soybean meal, supplemented with vitamins and minerals (Table 1) to meet the minimum requirements suggested by the Brazilian Tables of nutritional requirements for pigs (Rostagno et al., 2011).
Engenharia Agrícola,Jaboticabal,v.38,n.4,jul./ago.4 Calculated composition based on the requirements of castrated male pigs of high genetic potential with average performance, suggested by the Brazilian Tables published by Rostagno, et al. (2011) p.196.
The recommendations for castrated males were considered with high genetic potential with average weight of 30 to 50, 50 to 70 and 70 to 100 kg.The animals received water and formula feed at will during the experimental periods.
Thermographic images of the housed animals in the two chambers were used to evaluate their average surface temperature (AST).In the acute stress study, the images, together with the respiratory frequency (RF), and rectal temperature (RT) of the pigs were collected at the beginning of the experiment and every four hours.In the study of the chronic stress, after the research on acute stress, the same variables were collected every seven days until the end of the experimental period.To collect RF data, we performed the counts of each animal's flank movements for 15 seconds, and the result multiplied by four to obtain the movements per minute (mov/min).Subsequently, AST and RT were measured.AST was collected using a Fluke Ti55 thermal imager with an accuracy of ± 2°C.From the thermographic images of the animals, the body surface of one animal per experimental unit was delineated to determine the average surface temperature values.We measured the RT using a digital clinical thermometer with an accuracy of ± 0.2°C.The data collection was performed only by, and the same person in each chamber, in silence and in the same sequence, minimizing the interference of the collector' presence in the results.
After the experimental collection, we tabulated the data of air temperature, RF, AST and RT for each treatment which we used for the validation of the proposed mathematical model.
The sets were elaborated to characterize each variable, determining a function of pertinence for each set.In order to quantify the importance of the stress duration by heat in this research, they assigned as input variables average air temperature (°C) and average surface temperature (° C) in acute and chronic heat stress.Thus, we determined the intervals for each input variable for each stress, according to Table 2 for acute and chronic stress, by heat and their respective pertinence curves (Figure 1).
Engenharia Agrícola,Jaboticabal,v.38,n.4,julIn order to carry out all the fuzzy logic, the Mamdani inference method was applied which provides the answers of a set according to the combinations of the input values with their relative degrees of pertinence by means of a minimal operator, and then by the rules definitions through the maximum operator (Leite et al., 2010).We used the Center of Gravity (Centroid or Area Center) method in the defuzzification, where it admits all the exit alternatives, converting the sets into numeric values (Leite et al., 2010).
The rules were defined by means of linguistic sentences based on data collected from acute and chronic stress by heat (Table 3) and integrated in a substantial characteristic on the temperature of a fuzzy inference system which will have a certain rectal temperature according to predetermined rules.Thus, for the development of fuzzy logic it is necessary that the professional is qualified to avoid possibilities of contradictions in the interactions between the rules (Cherri et al., 2011).

Acute stress 1
If (Air temperature is T2) and (Average surface temperature is SA1) then (ART is 4) and (ARF is 5) 2 If (Air temperature is T2) and (Average surface temperature is SA2) then (ART is 4) and (ARF is 4) 3 If (Air temperature is T2) and (Average surface temperature is SA3) then (ART is 4) and (ARF is 4) 4 If (Air temperature is T1) and (Average surface temperature is SA1) then (ART is 1) and (ARF is 1) 5 If (Air temperature is T1) and (Average surface temperature is SA2) then (ART is 2) and (ARF is 2) 6 If (Air temperature is T1) and (Average surface temperature is SA3) then (ART is 3) and (ARF is 3) Chronic stress 1 If (Air temperature is T2) and (Average surface temperature is SC1) then (CRT is 4) and (CRF is 4) 2 If (Air temperature is T2) and (Average surface temperature is SC2) then (CRT is 4) and (CRF is 3) 3 If (Air temperature is T2) and (Average surface temperature is SC3) then (CRT is 4) and (CRF is 5) 4 If (Air temperature is T1) and (Average surface temperature is SC1) then (CRT is 3) and (CRF is 2) 5 If (Air temperature is T1) and (Average surface temperature is SC2) then (CRT is 2) and (CRF is 1) 6 If (Air temperature is T1) and (Average surface temperature is SC3) then (CRT is 1) and (CRF is 2) According to the combinations of air temperature, respiratory frequency and average surface temperature, six rules were defined for each type of heat stress (acute and chronic) and, for each rule was assigned a weighting factor of one (1), because all the rules have the same importance in determining the model responses as adopted by several authors (Yanagi Junior et al., 2012, Schiassi et al., 2014).In addition, performed tests assigning other weights to the rules did not result in reduction of the simulation errors.
The simulations were used with the help of Fuzzy Toolbox® from Matlab®, software version 7,13,0,564 (R2011b) where all the modeling was elaborated.In the evaluation of the proposed model, we simulated the physiological response of the pigs, as well as compared to the acquired experimentally data through the standard deviation and percentage error.
These tests aim to assess the ability of how modeling can predict RT value by addressing all likely combinations of initial variables.Thus, pigs RT in the growth and finishing phases, provided as response of the system can be used as a tool for decision making on the control of the productive environment in cases of acute and chronic stress by heat.

RESULTS AND DISCUSSION
The heat promoted an increase in RT above the range considered normal for pigs (38.6 to 39.3ºC) (Oliveira et al., 2015, Sobrinho et al., 2013), with an increase of 0.6° C in acute stress (Table 4) and 0.2º C in chronic stress (Table 5), above the range.According to Brêtas et al. (2011) any higher elevation at room temperature above that considered as thermal comfort can cause an increase in the body temperature of these animals.The difference found for RT of the animals submitted to acute stress by heat compared to the animals in thermal comfort may indicate that the mechanisms responsible for reducing heat production and increasing heat dissipation did not have sufficient time to prevent an increase body temperature.However, this change in RT can also be considered as a part of the swine mechanism to maintain gradient temperature between the nucleus and the surface temperature (Renaudeau et al., 2008).The RF also presented an increase in acute and chronic stress by heat, presenting values of the order of 125.2 and 86.4 mov/min, respectively, showing above the normal condition for animals of this category (Pandorfi et al., 2007).The respiratory frequency may increase as a function of thermal stress, according to Sobrinho et al. (2013).When the respiratory frequency is high it is assumed that the air temperature is close to body temperature, heat is stored in the body and the value of body temperature increases above normal values, this response is due to direct stimulation on the heat center in the hypothalamus which sends impulse to the cardiorespiratory system in an attempt to eliminate heat by evaporation through respiration which, in this case, presents an outstanding increase (Pandorfi et al., 2007).
Over time, after the physiological responses on heat dissipation the RT begins to decrease over the days (chronic stress).As the rectal temperature of the animals did not show a sudden change after 71 days it can be inferred that the increase in respiratory frequency (the main mechanism of heat dissipation in pigs) was an efficient physiological adjustment for the maintenance of thermoregulation.The pigs when subjected to the high temperature situation have metabolic mechanisms that act in the maintenance of homoeothermic (Baptista et al., 2011).
However, there is evidence of a two-phase heat acclimatization pattern.In the first period, the pig went through an adaptation phase characterized by rapid changes, including changes in feed intake and respiratory and cardiac frequencies (Huynh et al., 2005).The second period is characterized by an increase in rectal temperature in the first 24 hours of exposure, with gradual decrease in later days (Renaudeau et al., 2007).From this period, heat dissipation through respiration becomes more efficient associated with consumption and metabolism reduction.
The mean value of the standard deviation for acute and chronic stress by heat was 2.92 for RF and 0.14 for RT, and 1.18 for RF and 0.05 for RT, respectively, and the respective percentage errors were 3.52% for RF and 0.50% for RT in acute stress and 2.81% for RF and 0.17% for RT in chronic stress (Tables 4 and 5), values considered low and ideal, demonstrating the efficiency of fuzzy model proposed in simulating respiratory frequency and rectal temperature.
In Figures 4 and 5, simple linear regressions of the values were obtained experimentally and by fuzzy-shaped in which the coefficients of determination (R 2 ) presented for RF from acute and chronic stress by heat were 0.997 and 0.993, respectively, for RT were 0.951 and 0.964, respectively.In order to evaluate the acoustic environment in pork nursery as a function of temperature and relative humidity, Silva et al. ( 2007) developed a mathematical model to predict noise levels and found a determination coefficient of 0.075, lower than that obtained in this study.These results prove the efficiency of fuzzy model when compared to statistical models.Engenharia Agrícola, Jaboticabal, v.38, n.4, p.457-470, jul./ago. 2018 FIGURE 5. Linear regressions on rectal temperature responses measured experimentally and simulated: a) acute stress by heat and b) chronic stress by heat in growing pigs.
The response surface in Figure 6 illustrates the interaction between air temperature and average surface temperature, as a function of RT of swine subjected to acute stress by heat.The air temperature ranges between 20 and 24°C, indicate where the RT increased to the point where it is considered normal.From 26°C, the RT increases considerably, and stay between 39.5 and 40°C, above the range considered normal for pigs (38.6 to 39.3°C) (Oliveira et al., 2015).The analysis can be done in relation to the average surface temperature and adopted temperature.It can be observed that when the AST is increased, an increase in the rectal temperature was obtained, similarly to the different ambient temperatures, that is, the more outside the comfort range, the higher is the rectal temperature (Brêtas et al., 2011).The presented results in Table 5 and Figure 5 demonstrate that the mechanisms of heat dissipation were not sufficient to maintain homoeothermic after 48 hours.Thus, it can be stated that, in order to evaluate the body temperature on growing pigs submitted to acute stress by heat, we should use the interaction on thermal stress temperature together with the animal average surface temperature.
The surface presented in Figure 7 illustrates the interaction between the thermal stress temperature and the average surface temperature, as a function of the RF on pigs submitted to acute stress by heat.In the ambient temperature range between 20 and 23°C, temperatures that are within the thermal comfort range (Miranda et al., 2012), caused the respiratory frequency (RF) to vary between 40 and 50 mov/min and the average surface temperature remained below 36°C, surface temperature considered normal in pigs (Huynh et al., 2005).From 26°C, the RF begins to increase, also increasing significantly the AST, but the RF on pigs did not remain above 110 mov / min, in the range of AST between 34 and 40 ° C. Engenharia Agrícola,Jaboticabal,v.38,n.4,jul./ago.
The response surface in Figure 8 illustrates the interaction between air temperature and the average surface temperature as a function of RT on swine undergoing chronic stress by heat.Different from acute stress, the air temperature range indicating an increase in RT to the point where it is considered normal was 20 to 30 °C, indicating a possible acclimatization to the heat.The analysis can be done in relation to the average surface temperature and the adopted temperature.It can be observed that, when the AST increased, we obtained an increase in the rectal temperature, the same happened with the different ambient temperatures.Nunes et. al. (2011), working with females of swine on concrete floor and wood shavings bed, observed that in bed the air temperature rises.These authors observed a decrease in the gradient between the air temperature and the surface temperature when the animals were kept in bed during the morning and at noon, that is, in a warmer environment there is difficulty in thermolysis by sensitive mechanisms.The mechanisms that allow to increase the heat dissipation have been able to fully compensate the excessive heat load which can explain the result of the RT after 71 days of exposure.The surface presented in Figure 9 shows the interaction between the thermal stress temperature and the average surface temperature, as a function of the RF on pigs submitted to chronic stress by heat.We obtained similar responses to acute stress where in the ambient temperature range between 20 and 24 ºC, the respiratory frequency (FR) varied between 40 and mov/min.From 26 °C, RF starts to increase also considerably increasing the AST, but the RF on pigs did not stay above mov / min, different from what was found in acute stress by heat.FIGURE 9. Simulated respiratory frequency (RF) as a function of surface temperature and air temperature on growing pigs submitted to chronic stress by heat.
Engenharia Agrícola, Jaboticabal, v.38, n.4, p.457-470, jul./ago. 2018 The increase on RF confirms that, in situations of stress by heat the pigs activate physiological mechanisms to dissipate heat and maintain their homeothermy, the same was verified by Renaudeau et al. (2008) where they reported an increase in the respiratory frequency of the animals under conditions of stress by heat, in animals exposed to temperatures from 28 to 36 °C.With these results, it is evident that heat dissipation through evaporation represents practically all the heat dissipation in high temperature situations and that the pigs, by having the sweat glands not very active (Renaudeau et al., 2008), depend mainly from evaporation through respiration to lose latent heat.
As the animals' rectal temperature did not vary much among the treatments it can be inferred that the increase on the respiratory frequency in the animals under chronic stress by heat was an efficient physiological adjustment for the maintenance of thermoregulation which was not observed in the acute stress.
These results confirm that, under stress conditions by heat, the pigs activate physiological mechanisms to dissipate heat and maintain their homeothermy and that pigs, under high temperature conditions do not react only by maintaining the respiratory frequency, but also by the increase in surface temperature.

CONCLUSIONS
Fuzzy modeling can be used to efficiently predict the respiratory frequency and rectal temperature on growing pigs submitted to acute and chronic stress by heat, as a function of dry bulb temperatures and superficial temperature of the animals.

FIGURE 1 .
FIGURE 1. Relevance functions for the input variables of acute and chronic stress by heat: a) Air temperature (°C), b) Acute surface average temperature, c) Chronic surface average temperature.

FIGURE 4 .
FIGURE 4. Linear regressions of experimentally and simulated respiratory frequency responses: a) acute stress by heat and b) chronic stress by heat in growing pigs.

FIGURE 6 .
FIGURE 6. Rectal temperature (RT) simulated as a function of air temperature and surface temperature on growing pigs submitted to acute stress by heat.

FIGURE 7 .
FIGURE 7. Simulated respiratory frequency (RF) as a function of surface temperature and air temperature on growing pigs submitted to acute stress by heat.

FIGURE 8 .
FIGURE 8. Rectal temperature (RT) simulated as a function of air temperature and surface temperature on growing pigs submitted to chronic stress by heat.

TABLE 1 .
Centesimal and chemical composition of the experimental formula feed.

TABLE 2 .
Sets for the input variables of acute and chronic stress by heat. ./ago.2018

TABLE 4 .
Comparison on respiratory frequency (mov/min) and rectal temperature (°C) for acutely stressed pigs, experimentally and simulated by the model.

TABLE 5 .
Comparison of respiratory frequency (mov/min) and rectal temperature (°C) for pigs submitted to chronic stress, experimentally and simulated by the model.