Adaptive Neuro-Fuzzy Inference Systems for Modeling Greenhouse Climate

The objective of this work was to solve the problem of non linear time variant multi-input multi-output of greenhouse internal climate for tomato seedlings. Artificial intelligent approaches including neural networks and fuzzy inference have been used widely to model expert behavior. In this paper we proposed the Adaptive Neuro-Fuzzy Inference Systems (ANFIS) as methodology to synthesize a robust greenhouse climate model for prediction of air temperature, air humidity, CO2 concentration and internal radiation during seedlings growth. A set of ten input meteorological and control actuators parameters that have a major impact on the greenhouse climate was chosen to represent the growing process of tomato plants. In this contribution we discussed the construction of an ANFIS system that seeks to provide a linguistic model for the estimation of greenhouse climate from the meteorological data and control actuators during 48 days of seedlings growth embedded in the trained neural network and optimized using the back propagation and the least square algorithm with 500 iterations. The simulation results have shown the efficiency of the proposed model. Keywords—Greenhouse climate; Modeling; ANFIS; NeuroFuzzy


I. INTRODUCTION
In recent decades, a considerable effort was devoted to develop adequate greenhouse climate and crop models, for driving simulation, control and managing [1][2]. The objective in a greenhouse climate control is to further improve the environmental conditions of plants growth in order to optimize the production process [3]. The dynamic behavior of the internal microclimate of the greenhouse is a combination of physical processes involving energy transfer (radiation and heat and mass balance (water vapor fluxes and CO2 concentration) [4]. These processes depend on the outside environmental conditions, structure of the greenhouse, type and state of the crop and on the effect of the control actuators (typically ventilation and heating to modify inside temperature and humidity conditions, shading and artificial light to change internal radiation, CO2 injection to influence photosynthesis and fogging/cooling for humidity enrichment). The practical goal of this work is to model the greenhouse air temperature, air humidity, CO2 concentration and internal radiation using Adaptive Neuro-Fuzzy Inference Systems from real data in order to predict the behavior inside the greenhouse. The main advantages of using automated climate control are energy conservation, better productivity, and reduced human intervention [5].
Greenhouses are considered as complex processes. In fact, they are nonlinear, multi-input multi output (MIMO) systems which present time-varying behaviors, and they are subject to relevant disturbances depending generally on meteorological conditions. All these make it difficult to describe a greenhouse with analytic models and to control them with classical controllers [6][7].
Many conventional methods for controlling a greenhouse climate are not effective since they are based on either on-off control methods, or PID approaches. This results in a loss of energy, labor, and productivity [8]. To maintain a steady climate, a more complex control system must be used [5]. The necessities for climate control the energy consumption or maximize economic profit have instigated many researchers in this area. Today, there are various papers dealing with modeling, short term climate control, and long horizon control devised either to minimize. In [6], a model of a greenhouse using the energy balance has been presented. The proposed model is then used to carry out a simulation on the greenhouse climate (temperature and humidity) with optimal control for part of a day. In [9] the author has proposed a greenhouse model including the crop transpiration. They then made a comparison between optimal and predictive control on the considered greenhouse for part of a day. In [10] the authors have described the application of model predictive control (MPC) for temperature regulation in agricultural processes (a greenhouse). In [11], the authors have proposed the application of fuzzy logic to identify and control some multidimensional systems. They describe a method to reduce the complexity of a fuzzy controller and they show an application International Conference on Automatic control, Telecommunications and Signals (ICATS15) University BADJI Mokhtar -Annaba -Algeria -November 16-18, 2015 on a real system (a greenhouse). In [12], a recurrent neural network based on an Elman structure [13][14] is trained to emulate the direct dynamics of the greenhouse. In [15] the construction of fuzzy systems by fuzzy c-means for modeling a greenhouse climate is described then the comparison with adaptive neuro-fuzzy inference system (ANFIS) and neural networks have presented. In [16] the authors have described the Greenhouse Design and Control using the adaptive neurofuzzy inference system. Modern control techniques have been developed in various branches [17][18]. During the last two decades, considerable effort was devoted to develop adequate greenhouse climate and crop models, for simulation, control and management purposes [19][20]. A proper model for a greenhouse climate is an essential tool for its control [21][22]. The model can be designed in two ways. One method is based on the physical laws involved in the process and the other on the analysis of the input-output data of the process. In the first method, the thermodynamic properties of the greenhouse system are employed. However, the parameters of the equations are time variant and weather-dependent, so it is difficult to obtain accurate mathematical models of the greenhouse climate. The second approach is based on the theory of system identification [21]. Conventional methods based on system identification such as ARX approaches can not correctly model the nonlinear behavior of greenhouse climate. Intelligent methods seem to be the most proper choices for the modeling of this type of systems [3]. Because of the properties of universal approximation, they can model nonlinear systems with trained data by arbitrary fitness.
In contrast with a neural network identifier, a fuzzy identifier has some essential advantages which are described in the following. Due to its capability to handle both numerical data and linguistic information, it is feasible to apply fuzzy logic system for greenhouse climate modeling and then provide prediction for choosing optimal controlling decision. The growing process of tomato plants inside the greenhouse was modeled in this paper using the ANFIS system to predict the effect of meteorological variables and control actuators on air temperature, air humidity, CO2 concentration and internal radiation inside the greenhouse. Specifically the relationship between the sensors signals and internal climate components is first captured via a neural network and is subsequently reflected in linguistic form with the help of a fuzzy logic based algorithm. It uses training examples as input and constructs the fuzzy if-then rules and the membership functions of the fuzzy sets involved in these rules as output. After training the estimator, its performance was tested under various internal climate conditions. Test data sets collected from a wide range of internal climate conditions (meteorological data and control actuators during 48 days of seedlings growth) were applied to the estimator for evaluating the magnitude of air temperature, air humidity, CO2 concentration and internal radiation inside the greenhouse. The present paper describes simulation results of an ANFIS system that seeks to provide a linguistic model optimized by back-propagation and the least square algorithm for predicting the greenhouse climate.

II. EXPERIMENTAL SET-UP
The recordings were made during the period of February 20 th to April 7 th , 2014 on the site of BENOMOR, nursery of tomatoes seedlings, Guelma (Algeria), in order to prepare them for the tomatoes season. The greenhouse in which all the experimental recordings were carried out is a plastic greenhouse multi chapels, multi inflatable wall, 3600 m 3 of volume and 1000 m 2 of surface. Their major axis is parallel to the East-West direction. The roof and the side walls are polythene. This greenhouse with its climatic vectors of inputoutputs is identified as a climate model represented in the " Fig. 1,". To carry out our work, we divided the 48 days of data file in three parts (every day divided in three parts) the first part include the values of first 8 hours, were used as training data, the second part for the checking and the third for testing. In a conventional fuzzy inference system, the number of rules is decided by an expert who is familiar with the system to be modeled. In this particular case study the rules generated by an agriculture expert and the number of membership functions assigned to each input is chosen from real data. This is carried out by examining the desired and real input-output data. This situation is much the same as ANN's. In this section ANFIS topology and the learning method used for this neurofuzzy network are presented. Both neural network and fuzzy logic are model-free estimators and share the common ability to deal with the uncertainties and noise. It is possible to convert fuzzy logic architecture to a neural network and vice versa [18]. This makes it possible to combine the advantages of neural network and fuzzy logic [10][11]. Layer 1: Every node in i in this layer is a square node with a node function   International Conference on Automatic control, Telecommunications and Signals (ICATS15) University BADJI Mokhtar -Annaba -Algeria -November [16][17][18]2015 Where x is the input node i, and A i is the linguistic label (Minimum, Moderate, Maximum) associated with this node function. In other words, As the values of these parameters change, the best bell-shaped functions vary accordingly, thus exhibiting various forms of membership functions on linguistic label A i . In fact, any continuous and piecewise differentiable functions, such as commonly used trapezoidal or triangular-shaped membership functions are also qualified candidates for node functions in this layer. Parameters in this layer are referred to as premise parameters. Layer 2: Every node in this layer is a circle node labeled ∏ which multiplies the incoming signals and sends the product out.  For convenience, outputs of this layer are called normalized firing strengths. Layer 4: Every node in this layer is a square node with a node function Where i w is the output of layer 3, and {p i , q i , r i } is the parameter set. Parameters in this layer will be referred to as consequent parameters. Layer 5: The single node in this layer is a circle node labeled Σ that computes the overall output as the summation of all incoming signals. 5 1 Thus we have constructed an adaptive network which is functionally equivalent to a fuzzy inference system [11][12]. The hybrid algorithm is applied to this architecture. This means that, in the forward pass of the hybrid learning algorithm, functional signals go forward up to fourth layer and the consequent parameters are identified by the least and consequent parameters are identified by the least squares estimation. In the last backward and the premise parameters are updated by the gradient descent [11].

A. ANFIS Predictive Architecture
Using a given input/output data set, the ANFIS method constructs a fuzzy inference system (FIS) whose membership function parameters are tuned (adjusted) using either a backpropagation algorithm alone, or in combination with a least squares type of method. This allows fuzzy systems to learn from the data they are modeling. FIS Structure is a network-type structure similar to that of a neural network, which maps inputs through input membership functions and associated parameters, and then through output membership functions and associated parameters to outputs [23].
In our case ANFIS is a four-layer neural network that simulates the working principle of a fuzzy inference system. The linguistic nodes in layers one and four represent the input and output linguistic variables, respectively. Nodes in layers two are term nodes acting as membership functions for input variables. Each neuron in the third layer represents one fuzzy rule, with input connections representing preconditions of the rule and the output connection representing consequences of the rules. Initially, all these layers are fully connected, representing all possible rules. Ten feature variables, ventilation, heating, shading, artificial light, CO 2 injection, fogging/cooling, external temperature, external humidity, global radiation and wind speed, are selected as inputs of the ANFIS. Three membership functions (Mfs) are assigned to each linguistic variable. The suggested ANFIS model is shown in "Fig. 2,". It shows the fuzzy rule architecture of ANFIS when the trapezoidal membership function is adopted. The architecture consists of 40 fuzzy rules. During preliminary experiments the proposed architecture proved to be sufficiently capable of extracting greenhouse climate model from the control actuators and meteorological data. "Fig. 4," shows the flow chart for predicting the internal climate via ANFIS.

B. ANFIS Modeling, Training and Testing
ANFIS modeling process starts by obtaining a data set (input-output data) and dividing it into training, testing and checking data sets. Training data constitutes a set of input and output vectors. The data is normalized in order to make it suitable for the training process. This was done by mapping each term to a value between 00, 01 and 10 using the Min, moderate and Max method. This normalized data was utilized as the inputs (control actuators conditions and meteorological data) and outputs (internal climate) to train the ANFIS. In other words, two vectors are formed in order to train the ANFIS (see " Fig. 3,"): Input vector = [ventilation, heating, shading, artificial light, CO 2 injection, fogging/cooling, external temperature, external humidity, global radiation and wind speed]. The output vector = [internal temperature, internal humidity, CO 2 concentration and internal radiation]. The ANFIS registers the input data only in the numerical form therefore the information about the control actuators, internal and external climate of the greenhouse must be transformed into numerical code. The training data set is used to find the initial premise parameters for the membership functions by equally spacing each of the membership functions. A threshold value for the error between the actual and desired output is determined. The consequent parameters are found using the least-squares method.
Then an error for each data pair is found. If this error is larger than the threshold value, update the premise parameters using the gradient decent method as the following (Qnext=Qnov+ηd, where Q is a parameter that minimizes the error, η the learning rate, and d is a direction vector). The process is terminated when the error becomes less than the threshold value. Then the checking data set is used to compare the model with actual system. A lower threshold value is used if the model does not represent the system. " Fig. 5," shows the uniform falling of the value of testing error ETest with the number of iterations during the testing process for the ANFIS configuration with traingular Mf and with gaussian Mf. The smallest error of testing (ETest) is reached at iteration 145 (traingular Mf) and at iteration 107 for Gaussian Mf. It can be seen in the " Fig. 5," that error converges not to zero but to 12% and 2%. This is caused by the presence of some contradicting examples in the training and testing set. Training of the ANFIS can be stopped by two methods. In the first method, ANFIS will be stopped to learn only when the testing error is less than the tolerance limit. This tolerance limit would be defined at the beginning of the training. It is obvious that the performance of the ANFIS that is trained with lower tolerance is greater than ANFIS that is trained with higher tolerance limit. In this method the learning time will change with the architecture of the ANFIS. The second method to stop the learning is to put constraint on the number of learning iterations. In our study, the ANFIS architecture is stopped to learn after 500 training iterations.

IV. DISCUSSION OF RESULTS
This chapter presents the results of experiments and the comparison and analysis of results between the experimental and ANFIS model depending on the greenhouse internal climate parameters. The results and/or the values of internal temperature, internal humidity, CO 2 concentration and internal radiation are graphically represented by means of diagrams depending on the seedlings growth time " Fig. 6,". The values from prediction coincide well with the values from experiments. The predictive capability of using neural network and ANFIS approaches are compared using statistics, which showed that ANFIS predictions for internal temperature (E test _T int = 0.723), internal humidity (E test _T int = 0.556), CO 2 concentration (E test _CO 2 = 0.521) and internal radiation (E test _R int = 0.385) were for 2% closer to the experimental measurements, compared to 6% using only neural network method. International Conference on Automatic control, Telecommunications and Signals (ICATS15) University BADJI Mokhtar -Annaba -Algeria -November 16-18, 2015

CONCLUSION
In this paper, an ANFIS is used to successfully estimate the greenhouse climate during seedlings growth process. It can be claimed that the comparison of the results obtained from the ANFIS model and of the experimental results confirms the efficiency and accuracy of the model for predicting the greenhouse climate. By using a backpropagation and least square training method, the ANFIS system is trained to an accuracy of 2% error for all four components. The error of the internal climate values predicted by ANFIS with the combination of sigmoidal and gaussian membership function is only 2%, reaching an accuracy as high as 98%. When the traingular membership function is adopted the average error is around 12%, with an accuracy of 92%.