Genetic fuzzy system for prediction of respiratory rate of chicks subject to thermal challenges

Sistema genético difuso para a predição da frequência respiratória de pintinhos sujeitos a desafios térmicos R E S U M O Objetivou-se neste trabalho estimar e comparar as frequências respiratórias (respirações min-1) de pintinhos submetidos a diferentes intensidades e durações de exposição térmica durante a primeira semana de vida utilizando um Sistema de Inferência Fuzzy e um Sistema Genético Difuso Baseado em Regras Fuzzy. O experimento foi conduzido em quatro túneis de vento climatizados e utilizou-se 210 pintinhos. O Sistema de Inferência Fuzzy foi estruturado com base em duas variáveis de entrada: duração da exposição térmica (dias) e a temperatura do bulbo seco (°C), e a variável de saída foi frequências respiratórias. O Sistema Genético Difuso Baseado em Regras Fuzzy ajustou os parâmetros das variáveis de entrada e saída do modelo Sistema de Inferência Fuzzy com o propósito de aumentar a precisão da predição dos valores das frequências respiratórias. Os dois sistemas (Sistema de Inferência Fuzzy e Sistema Genético Difuso Baseado em Regras Fuzzy) mostraram-se capazes de predizer as frequências respiratórias de pintinhos. O Sistema Genético Difuso Baseado em Regras Fuzzy interagiu satisfatoriamente com o modelo Sistema de Inferência Fuzzy previamente desenvolvido, apresentando uma melhora na precisão da predição das frequências respiratórias. O Sistema de Inferência Fuzzy apresentou erro percentual médio de 2,77 e para o Sistema Genético Difuso Baseado em Regras Fuzzy o erro foi de 0,87, o que indica uma melhora na acurácia da predição da frequência respiratória quando utiliza a ferramenta de algoritmos genéticos.


Introduction
For the poultry industry to reach levels of excellence it has sought to improve productivity, without, however, increasing production costs (Ponciano et al., 2011).It is known that when the thermal conditions are inadequate, this can affect their well-being and negatively impacting production performance (Schiassi et al., 2015).
The respiratory rate (RR) is the first physiological response that the birds use in order to maintain and control homeothermy, releasing internal heat by evaporation to the environment, which is the most efficient mechanism when animals are subjected to temperatures above the comfort temperatures (Saraiva et al., 2011).
When considering the various possibilities of thermal environment associations and the estimation of animal welfare, the application of the fuzzy inference system can be presented as a favorable methodology (Nascimento et al., 2016).The genetic algorithms techniques arose in order to improve and refine the modeling of Fuzzy Systems (FIS).Their use stands out because of the possibility of sorting data for a purpose (Fogel et al., 2004).
A Genetic Fuzzy Rule-Based System (GFRBS) is basically a Fuzzy Inference System application that has been augmented by a learning process based on evolutionary computation, such as genetic algorithms, genetic programming, and evolutionary strategies, among other algorithms (Eiben & Smith, 2003).According to Georgieva (2016), genetic algorithms provide a high degree of flexibility, which makes them suitable for optimization of fuzzy inference systems and development and implementation of systems that can assist in decision making related to the diagnosis, monitoring and management of systems.
Thus the aim of the present work was to estimate and compare the respiratory rate (RR) of chicks under different intensities and durations of thermal exposure during the first week of life through a Fuzzy Inference System (FIS) and Genetic Fuzzy Rule-Based System (GFRBS).

Material and Methods
The experiment was conducted in four air-conditioned wind tunnels installed in the laboratory.The procedures used in this experiment were approved by the Ethics Committee on Animal Use (CEUA) of the Federal University of Lavras (Minas Gerais, Brazil), according to Protocol 001/12.Thirteen treatments were performed in which the duration and intensity of the thermal challenge to which chicks were subjected during the first week of life was varied.Due to the amount of space available in the cages, 210 mixed-sex chicks of the Cobb breed were used for the entire experiment.The chicks were randomly distributed among the treatments.Each trial, with four treatments, began with 60 birds, 15 per treatment, distributed in three replicates of five birds each.Each treatment was conducted in a wind tunnel, and in each tunnel, 15 Cobb ® chicks were housed, divided into batches of mixed sex, with three replicates for each treatment, for a total of 210 birds.Different numbers of replicates (unbalanced) were used for the control treatment.Specifically, the ninth treatment had 30 birds, whereas the other treatments had 60 animals per treatment (Table 1).This is the reason why the total number of birds for all the treatments was 210 instead of the expected 240.
Within the wind tunnel, the birds were housed in cages with dimensions of 0.40 x 0.60 m, divided into three compartments with identical dimensions of 0.08 m².The cages were built with steel bars and wire netting mesh of 1 x 1 cm.
During the experiment, water and commercial pre-starter feed was given to the birds ad libitum in order to meet their nutritional requirements.The feed used was the same for all the chicks throughout the experiment with no change in its formulation.During the experimental period, a continuous lighting program was adopted (Abreu et al., 2011).
On the first day of life, the chicks arriving from the incubator were housed inside the environmentally controlled wind tunnels and submitted to the comfort temperature of 33 °C during the first week of life (Menegali et al., 2013).However, from day 2 of life, each group of 15 chicks was subjected to one of the 13 treatments described in Table 1, varying the intensity and duration of the dry bulb temperature (t db ) of the heat challenge.
After the period of thermal exposure, when the chicks were submitted to each treatment, they were returned to the t db for the comfort temperature for the first week of life (33 ºC).
Every day, one chick from each repetition of each treatment was captured at random to have its respiratory rate (RR) evaluated with the aid of a digital timer (± 0.01 s), totaling three animals in each treatment.Respiratory movements of the bird were monitored for 15 s and then multiplied by 4 to give breaths per minute.
A Fuzzy Inference System was developed for the prediction of RR of broiler chicks exposed to different intensities and durations of thermal challenges.Thermal challenge duration (D, days) and dry bulb temperature (t db , °C) were used as input variables (Table 2).
The basis of experimental data was composed of 114 experimental observations for each of the two system input variables.Triangular membership function (MF) curves were used for best representing the input data according Ponciano et al. (2012) and Schiassi et al. (2012).The membership function used for the RR output variable was the trapezoidal type for best representing the data set under study.The experimental values that formed the basis for the definition of the membership curves have an amplitude of 40-88 breath min -1 .
For RR prediction, the inference method applied was that of Mamdani type, which brings as answers a fuzzy set by combining the input values with their relative degrees of membership using the minimum operator and, in sequence, the definitions of the rules by the maximum operator (Leite et al., 2010).The defuzzification was made using the center of gravity method, which allows all output options, converting the fuzzy set into a numerical value.
The basic rules were defined from experimental data and with the help of experts in the field, presented as IF-and-THEN 16 rules for each variable response and, for each rule, a weighting factor was assigned equal to 1.
In order to further improve the fuzzy inference model, the technique of genetic algorithms was used.To do the necessary analysis for the development of a GFRBS, the 114 observations for each response variable were divided randomly into three subsets distributed as follows: training (70% of the data), validation (15% of the data) and test (15% of the data), according to the methodology proposed by Ferraz et al. (2014) and Hernández-Julio et al. (2014).In addition to these subsets, another subset for the overall validation of system performance was used, formed by the average values of the observations made in experiments, totaling 16 means.
The methodology used for genetic adjustment of the fuzzy system was proposed by, Pires (2004), Valdez et al. (2011), Starczewski et al. (2014), Georgieva (2016) and Tan et al. (2016).In this methodology, there is a knowledge base to which a genetic tuning process is applied to improve system performance without changing the basis of existing rules.This is done in order to adjust the fuzzy system parameters to improve their performance by adjusting the relevance functions and output variables.The method consists of two steps.The first is the generation of rules by a method driven by data for the rapid construction of the rule base, focusing on simplicity and transparency of the rules.The second relates to the genetic optimization of system performance by tuning the membership functions.
According to Pires (2004), after the construction of the rule base, it is necessary to find a database that best suits it by a genetic learning process.This is done by adjusting the parameters of the membership functions that define the fuzzy sets associated with each linguistic variable of the data set in question.Genetic operators must respect the range of variables, so that values outside the domain are not assigned to them.
For the development of GFRBS it was necessary to use a decimal vector in the form of a chromosome, used to represent the actual values of the relevance functions of the RR output variable.The array size depends on the desired accuracy, in this case 14 decimal places, which is the default value of Matlab (MathWorks, 2016) software working with this type of numbers.
The RR variable ranged between 40 and 88 breath min -1 and was divided into five fuzzy sets.The relevance function used was the trapezoidal; therefore, this means that 20 bits are needed to conform the chromosome.The initial population of chromosomes was created by setting the lower and upper limits of output variables obtained experimentally (40 and 88 breath min -1 ).Therefore, the boundaries of the proposed sets respect the restriction of values, according to the methodology proposed by Pires (2004).
Each chromosome is represented by a decimal vector of 20 bits.The first two bits of chromosome belong to the values of the MF1 set and were intended to store the values of the lower limit of the set in mention.The following 16 bits of each chromosome were randomly initialized and generated decimal values with values intermediate to the previously established range for the RR output variable.The last two bits of chromosomes store the upper limit values of the MF5 set.To avoid violation of the above restrictions, at the time of making the population, it is programmed that this condition was respected in both the first and last values of the chromosome.Coding was of the real type (with real values) and it was not necessary to decode any variable.
For the implementation of GFRBS, it was done the loading in memory of the input and output observed data for making a permutation of them to test their performance.The percentages of training, validation and test data were requested.These values can be chosen for the user.After this, the initial population was generated (four chromosomes with 20 genes each), three randomized chromosomes and one with the output variable data (RR) obtained from the original fuzzy logic data.The lower limit (40) were inserted in the first two genes and the upper limit (88) were inserted in the last two genes.The other genes' values were randomly generated between the lower and upper limits.After the population began, fuzzy sets were established representing each of the four values of the trapezoidal membership functions.After this, the sets of the input variables and the rules of the original fuzzy logic were added.Once this process was carried out, each of the files was saved with the name of each one of the chromosomes randomly generated and with the chromosome who saved the original fuzzy set output data, usually identified with the number 4.Then, these files were loaded in memory one by one and with the use of the Evalfis function were tested with each of the subsets previously created to train, validate, and test the GFRBS performance.Thus, the correlation coefficient value of each one of the subsets (training, validation and test) was calculated.The average of those three values (R 2 was calculated and chose the one with greater R 2 (elitism).Then, this obtained value with the reached R 2 by the original Fuzzy logic was compared.If the calculated value was higher than this  , 3, 4] [3, 4, 5] [27, 27, 30] [27, 30, 33] [30, 33, 36] [33, 36, 36] value, then it was saved with the name placed at the beginning, concatenated with the obtained R 2 .After this, the genetic algorithms were applied trying to improve the performance by changing the output set values of the FIS-winning file.In this case, the genetic algorithm systems selection and crossing methods were applied.According to Pires (2004), the evaluation function E(C i ) (Eq. 1) is based on the performance of the rule base or parameter values of the relevance functions that were generated from the information contained in the chromosomes, calculated by the number of patterns correctly classified using the method of fuzzy reasoning.
The results of the performance of the GFRBS system in relation to the predicted output variable, RR, are listed in Table 5.
Once the process of analysis, design and programming of GFRBS was completed, descriptive statistics were computed to evaluate its effectiveness in improving the FIS proposed to predict RR of birds.The performance results of FIS and GFRBS for the subset of the test data averages are listed in Table 6.
The functional relationships between the RR values predicted by FIS and GFRBS and values observed during the experiment period were done and the equations found for the FIS system (Eq.2) and GFRBS (Eq.3), respectively, were: Bold values mean the difference between original Fuzzy Inference System (FIS) and the modified by Genetic Fuzzy Rule-Based System (GFRBS)

Parameters
Respiration rate (RR, breath min -1 ) Fuzzy inference system (FIS) Table 3. Genetic algorithms parameters for the output variables, respiratory rate (RR, breath min -1 ) in which NPC (C i ) is the number of patterns correctly classified by the database for the relevance functions generated by chromosome C i (Cordón et al., 2001).The parameters of the genetic algorithm such as maximum number of generations, population size, the mutation and crossing probabilities and percentage of elitism were defined empirically and are listed in Table 3 (Pires, 2004).
For the development of GFRBS, the software tool Matlab (MathWorks, 2016) was used.The script was done using the original programming of genetic algorithms.

Results and Discussion
According to Georgieva (2016), the main objective of GFRBS is to adjust the parameters of input and output variables of the fuzzy model for the purpose of increasing or not, the accuracy of prediction of the output variable values (RR) and reduce the prediction error.In this work, the parameters of the input variables had been experimentally defined and the FIS followed these parameters.Thus, GFRBS acted in the change only in the ranges of the relevance curves of the output variables, in order to try to optimize the model.Table 4   The approximate values of RR for both models were similar to those observed experimentally.In addition, when comparing the relationship between RR observed and simulated by the models it is clear that both models showed similar performance.However, it can be observed that in all parameters, the prediction of GFRBS showed better results than the FIS prepared, as can be seen in Table 6.The statistical indices indicate the importance of computational tools to improve the development of the models made by (1) (2) (3) the specialists.It can be observed that modifying a simple parameter can influence the performance of the developed model, for example, the minimum and maximum values of the absolute and standard deviations and percentage error had visible differences.The FIS had mean percentage error of 2.77 and for GFRBS it was 0.87, thus indicating an improvement in the accuracy of prediction of RR when using the tool of genetic algorithms, as the statistical indices demonstrate.RR is one of the variables widely used and considered the simplest ones for the evaluation of physiological conditions of animals (Bianca & Kunz, 1978).RR is a variable of easy measurement, which can be through visual analysis (Damasceno et al., 2010).The RR of birds is an important parameter for evaluation of their comfort and well-being, because as t db increases, the RR also increases to enhance heat dissipation (Altan et al., 2003).This increase is the primary, and most efficient method, to dissipate heat in birds subjected to high temperatures (Oliveira Neto et al., 2000).
According to Marchini et al. (2007) in the first week of life RR of birds submitted to t db within the comfort range features RR ranging from 48.4 ± 4.8 to 56.8 ± 9.9 breaths min -1 .By observing the values found in the trial period it is evident that in some situations the birds were in a thermal discomfort situation, as presented by RR with values above those found in the literature.Furthermore, with increasing duration of the thermal challenge at higher temperatures, RR also increased, showing the influence of the thermal environment on this bird's physiological response.
The application of hybrid models that combine FIS and genetic algorithms allows the improvement of models reducing simulation errors, making the results more realistic.Specifically, in relation to FISs, it is emphasized that the genetic algorithms allow the improvement of the relevance curves that depend directly on the behavior of the data and experiences of experts.Furthermore, genetic algorithms are characterized as techniques that allow simplicity of operations, ease of implementation, and effectiveness in the pursuit of maximum or minimum and overall good performance in execution (Tumuluru & McCulloch, 2016).

Conclusions
1.The Fuzzy Inference System (FIS) and the Genetic Fuzzy Rule-Based System -GFRBS were shown to predict the respiratory rate of chicks under different thermal challenges in the first week of life through simple models and with high precision.
2. The GFRBS interacted well with the FIS model previously developed showing an improvement in the precision of respiratory rate prediction, with the potential to be applied in models of prediction of animal physiological responses in research on the ambient area.

Table 2 .
Fuzzy sets for the input variables

Table 4 .
Comparison between the pertinence functions of the output variable, Respiratory Rate (RR, breath min -1 ), created by the Fuzzy Inference System (FIS) and Genetic Fuzzy Rule-Based System (GFRBS) is a comparison of the intervals of the relevance curves for the output for FIS and GFRBS.

Table 6 .
Statistical indices applied to respiration rate predicted by the Fuzzy Inference System (FIS) and genetic fuzzy rule base system (GFRBS) and obtained experimentally