Greenhouse Climate Modeling Using Fuzzy Neural Network Machine Learning Technique

Greenhouse Climate Modeling Using Fuzzy Neural Network Machine Learning Technique

Charaf Eddine LachouriKhaled Mansouri Mohamed M. Lafifi 

Laboratory of Automatics and Signals Annaba (LASA), University of Badji Mokhtar Annaba, Annaba 23005, Algeria

Corresponding Author Email: 
lachouric1@gator.uhd.edu
Page: 
925-930
|
DOI: 
https://doi.org/10.18280/ria.360614
Received: 
15 August 2022
|
Revised: 
10 December 2022
|
Accepted: 
20 December 2022
|
Available online: 
31 December 2022
| Citation

© 2022 IIETA. This article is published by IIETA and is licensed under the CC BY 4.0 license (http://creativecommons.org/licenses/by/4.0/).

OPEN ACCESS

Abstract: 

The greenhouse climate is a non-linear system that contains multiple inputs (predictors) and multiple outputs (responses). This project aimed to provide a solution, aided by artificial intelligence, to the issue of variations in time, input and output factors in a greenhouse internal climate that can adversely affect tomato seedlings. Machine learning Methodologies such as fuzzy inference and neural networks have been applied to mimic idealistic behavior. This paper proposes an adaptive system based on artificial neural networks technique embedded with fuzzy logic technique calls Adaptive Neuro Fuzzy Inference System (ANFIS) to predict air humidity, air temperature, internal radiation, and CO2 concentration while the seeds grow, in order to produce favorable greenhouse climate conditions. The input parameters include ten meteorological and control actuators that majorly influence tomato plants during their growth process in the greenhouse climate. This discussion revolves around a linguistic ANFIS model that will operate during the 48 days that it takes for the seedlings to grow. It will provide estimates of the greenhouse climate using meteorological data along with control actuators rooted in trained neural networks with back propagation optimization algorithm, and 500 iterations of the least square algorithm. Simulations have revealed the efficiency of this model.

Keywords: 

ANFIS, artificial neural network, control, fuzzy logic, greenhouse climate, machine learning, modeling, neuro-fuzzy

1. Introduction

The latter forty years have seen significant development in simulation, management and control methods for crop growth and optimal greenhouse climate [1, 2]. Greenhouse climate control aids in providing plants with enhanced environmental conditions that result in a more efficient production process [3]. A controlled greenhouse climate constructs perfect environmental conditions for plants or yields, along with automation. While it's applied originally to shelter plants from undesirable climatic conditions, it's promoted to provide increased production, maximizing profits, disease and pest prevention, year-round growing, increased stability and security and reduced labor and resource costs using sensors to monitor conditions and automation to perform menial tasks based on the data. Mass balance (CO2 concentration and water vapor flows) and energy transfer (heat and radiation) are the physical processes that cause fluctuations in the greenhouse’s internal microclimate [4]. Factors that impact these processes include the greenhouse structure, external environmental conditions, and plant type and state. Beyond that, control actuators also have an effect, which usually includes modifying humidity and temperature through heating/ventilation, humidity enrichment with cooling/fogging, driving photosynthesis with CO2 injections, and changes in internal radiation through artificial light/shades. Due to the variety of parameters and strong combination, developing a physical model based on thermodynamic principles is quite difficult and leads to insufficiently misleading results. The primary goal here is to use real data to implement the Adaptive Neuro-Fuzzy Inference Systems and create a model of greenhouse internal radiation, air humidity, CO2 levels and air temperature that will enable the prediction of greenhouse behavior. The benefits derived from an automated climate regulatory system are mainly an improved productivity, energy conservation and reduced need for human management [5].

Complex processes are necessary to create a greenhouse model. It consists of a multi-input multi-output (MIMO) nonlinear system with time variants, and it can be influenced by various changes that occur in meteorological conditions. This volatility creates challenges in using analytic models or conventional controllers to simulate a greenhouse [6, 7].

Greenhouse climates often fail to be effectively regulated through conventional means due to the use of either PID or on-off control systems. This issue can be a waste of labor and energy that leads to reduced productivity [8]. A more intricate control model is therefore necessary to sustain a balanced microclimate [5]. Currently, several papers can be found presenting a long horizon and short-term climate control models, since targets like maximizing profits or reducing energy consumption have motivated many researchers to focus on this niche. Oueslati [6] is a presentation of a greenhouse with an energy balancing system. In this model, a simulation then carries out optimal control of the temperature and humidity in a greenhouse for some time during the day. Souissi [9] also accounts for crop transpiration in the greenhouse model. Later, a comparison was made between predictive and real climate control for some part of the day. A description of the model predictive control (MPC) when it is applied to regulate temperature in greenhouses can be found in Reference [10]. To detect and manage certain multidimensional systems, the authors suggest applying fuzzy logic [11]. This proposed method is applied on an actual greenhouse after reducing the fuzzy controller’s complexity. In the study [12], an Elman structure [13, 14] is used as the basis for a recurrent neural network that is programmed to imitate greenhouse dynamics directly. The presentation [15] deals with the use of fuzzy c-means clustering to build a fuzzy greenhouse climate model is compared against an artificial neural network (ANN) model and an adaptive neuro-fuzzy inference system (ANFIS) model. The authors use the adaptive neuro-fuzzy inference system to present a representation of the greenhouse design and control in the study [16].

There has been considerable development in modern control techniques for various areas [17, 18]. The previous couple of decades saw significant advancement in greenhouse climate and crop technologies for improved management, simulation and control [19, 20]. To have adequate control over a greenhouse climate necessitates the application of an effective model [21, 22]. There are two ways to design this model; either by using the physical laws of this process or by analyzing input-output data received from it. The first approach utilizes the thermodynamic properties found in the greenhouse, but it hinders the ability to create an accurate mathematical microclimate model due to equations that are based on fluctuating weather and time parameters. The second method utilizes the system recognition theory [21]. ARX and other conventional identification systems are unable to accurately mimic the nonlinear patterns of a greenhouse climate. This makes intelligent models more suitable for modeling these processes [3]. They are able to emulate nonlinear systems due to universal approximation capabilities, using data compiled from the arbitrary fitness function.

As opposed to neural network identifiers, there are some advantages of using fuzzy identifiers: a fuzzy logic model can process both linguistic and numerical data to predict, which controlling decision would be ideal for the greenhouse climate. The ANFIS model was applied on tomato plants grown in a greenhouse for this paper in order to collect information on how air humidity, temperature, internal radiation and CO2 concentration are impacted by control actuators and meteorological variables. A neural network initially captures how the internal climate properties and sensor signals interact, which is then shown linguistically via an algorithm based on fuzzy logic. Training examples from the input which is used to create the output of fuzzy logic if–then conditions and the fuzzy logic sets’ membership functions. The estimator was tested with a range of internal environmental conditions after the training was done. Application of test data derived from control actuators and meteorological conditions over 48 days of seed growth assisted the estimator in determining the levels of humidity, temperature, radiation and CO2 concentration in the greenhouse. The results obtained by an ANFIS simulation have been described in this paper, with the intention of constructing an optimized linguistic model that uses the least square algorithm and back-propagation to provide projections about greenhouse climate. The ANFIS model has fitted our real data very well and showed minimal residuals variation, high significance and very good normal distrubtion for all our inputs (predictors). The results obtained of our fitted Neuro-Fuzzy model shows an excellent prediction accuracy for our outputs (responses) of 98%. In contrast, the Neural Networks model shows 92% prediction accuracy.

2. Experimental Set-Up

The nursery where the tomato seedlings were being prepared was at BENOMOR, Guelma (Algeria). Observations were recorded between February 20th to April 7th, 2020. The experimental observations were recorded in a multi chapel, inflatable wall greenhouse made of plastic with a surface area of 1000 m2 and a volume of 3600 m3. Its primary axis parallels the East-West side. The side walls and roof consist of polythene. The greenhouse schematic can be seen in Figure 1 with its input/output climatic vectors.

Three sections were made out of the data collected over 48 days. The first section contained the values that were to be used as training data from the first 16 days, the second section was to carry out checks and the last was meant for tests.

Figure 1. Greenhouse climate schema

3. ANFIS Architecture

The ANFIS model utilizes the available input/output data set to build a fuzzy inference system. The parameters of membership function for this FIS can either be adapted with just the back-propagation algorithm or submerged with the least squares algorithm. The fuzzy system is able to train itself by modeling data this way. The structure of an FIS is comparable to a neural network, since it uses input membership functions with relevant parameters to chart inputs, and output membership functions with its relevant parameters to chart outputs [23].

The ANFIS model in this simulation has a four-layer neural network operating along the principles that run a fuzzy inference system [23]. The layer one linguistic node signifies the input linguistic variable, and the layer four node signifies the output variable. The layer two nodes are period nodes that act as membership functions for the input data. In layer three, a fuzzy rule is represented by each neuron, and preconditions for the rule are determined by input connections while their consequences are signified through the output connection. In the beginning, every possible rule is given representation through fully connected layers.

The ten variable inputs chosen for the ANFIS consist of: external temperature, ventilation, external humidity, heating, artificial light, shading, fogging/cooling, wind speed, CO2 injection and global radiation. Each semantic variable is given three trapezoidal membership functions. The proposed ANFIS model can be seen in Figure 2.

The fuzzy rule construct of ANFIS can be seen with the implementation of the trapezoidal membership function. There are 40 fuzzy rules present in this structure. Initial experiments revealed it to have adequate capability for greenhouse climate modeling through the extraction of meteorological data and control actuators. The flowchart depicting ANFIS predictions of internal climate can be seen in Figure 3.

Figure 2. Greenhouse climate ANFIS model

Figure 3. The prediction of ANFIS system

ANFS system of order zero is represented by the following equations:

$w_i=\prod_{j=1}^m \mu_{A_{j i}}\left(x_j\right)$ and $\overline{w_i}=\frac{w_i}{\sum_{i=1}^n w_i}$         (1)

$y=\sum_{i=1}^n \overline{w_i} f_i=\sum_{i=1}^n y_i$        (2)

where, fi is a constant defined by: fi = ri

In the presence of the target exits (y T), the network can be adjusted to reduce the error rate. The adjustable parameters are the membership functions of input/output of the type of singleton ri.

$r_i\left(t^{\prime}+1\right)=r_i\left(t^{\prime}\right)-\operatorname{lr} \frac{\partial E}{\partial r_i}$       (3)

$\Leftrightarrow r_i\left(t^{\prime}+1\right)=r_i\left(t^{\prime}\right)-\operatorname{lr} \frac{\mu^{\prime}}{\sum_{i=1}^n \mu_i^p}\left(y^p-y^{rp}\right.$      (4)

First order ANFIS system’s conclusion parameters (p, q, and r) of nth rule are connected linearly by a first order polynomial in the following form:

$f_n=p_n x_1+q_n x_2+r_n$              (5)

If the output of the nodes in each respective layer is represented by: Oil, where is nth node of the layer l.

Layer 1: generation of the degree of membership:

$o_i^1=\mu_{A_i}(x)$                  (6)

Layer 2: generation of the weight of rules i:

$o_i^2=w_i=\prod_{j=1}^m \mu_{A_i}(x)$                 (7)

Layer 3: aggregation of the weights of rules:

$o_i^3=\overline{w_i}=\frac{w_i}{w_1+w_2}$                 (8)

Layer 4: calculating the output of the rules according to the conclusion parameters:

$o_i^4=y_i=\overline{w_i} f_i=\overline{w_i}\left(p_i x_1+q_i x_2+r_i\right)$                    (9)

Layer 5: summing all the inputs starting from layer 4:

$o_i^5=\sum_i y_i=\sum_i \overline{w_i} f_i=\left(\overline{w_i} x_i\right) p_1+\left(\overline{w_1 x_2}\right) q_1+\overline{w_1} r_1+\left(\overline{w_2} x_2\right) p_2+\left(\overline{w_2} x_2\right) q_1+\overline{w_2} r_2$           (10)

In this last layer the conclusion’s parameters can be optimized using the least squares algorithm. The above equation becomes in the following form:

$o_1^5=y=\left(w_1 x_1\right) p_1+\left(w_1 x_2\right) q_1+w_1 r_1+\left(w_2 x_1\right) p_2+\left(w_2 x_2\right) q_2+w_2 r_2$       (11)

$y=\left[w_1 x_1 w_1 x_2 w_1 w_2 x_1 w_2 x_2 w_2\right]\left[p_1 q_1 r_1 q_2 r_2\right]^T=X W$      (12)

4. ANFIS Modeling, Training and Testing

The ANFIS model begins the process of training, testing and checking after it receives a data set of input-output data. A batch of inputs-outputs form the training data, which is then normalized so that it is appropriate for training. This was achieved with the Min, moderate and Max approach that helped map each vector to a value between 00, 01 and 10. The inputs (meteorological data, control actuators) and outputs (internal climate) that trained the ANFIS were subsequently derived from the normalized data. So, for the ANFIS training, two vectors needed to be formed (see Figure 4). Input vector = [external temperature, wind speed, global radiation, shading, ventilation, CO2 injection, heating, artificial light, fogging/cooling and external humidity]. The output vector = [CO2 concentration, internal temperature, internal radiation and internal humidity]. The data consisting of control actuators, internal and external greenhouse climate needs to be converted into numerical code since input data can only be registered with the ANFIS in numerical form.

Figure 4. Fuzzy rules architecture

With the help of training data, initial base parameters for trapezoidal membership functions can be discovered. This necessitates equal spacing between the membership functions. Then, a threshold is set as the margin of error between desired and real output. The resulting parameters are determined with the least-squares algorithm.

For every data pair an error is appeared. If the error surpasses threshold value, the base parameters need to be updated with the gradient decent approach; (Qnext=Qnov+ηd, where the parameter Q decreases the error, d is the vector direction and η is the learning rate). The end of this process occurs as soon as the error falls below the determined threshold values. A comparison is made between the model and actual system using the checking data set. The threshold is lowered if the system fails to be represented accurately by the model.

Figure 5. Testing error for ANFIS configuration with Gaussian Mf and Traingular Mf

Figure 6. Trainning, checking and testing data of the internal temperature

While ANFIS is configured during testing using gaussian Mf and triangular Mf, there is uniformity in the way testing error values, ETest fall according to the number of iterations, as evident in Figure 5. Iteration 107 (Gaussian Mf) and iteration 145 (triangular Mf) is the point where the lowest testing error (ETest) occurs. It is observed in Figure 5 that the error does not fall to zero, but rather converges at 8% and 2%. The reason for this phenomenon is some values in the training and testing data that were contradictory.

There are two approaches to ending ANFIS training. The first way it will stop learning is when testing errors are below the tolerance limit that would already be specified when the training began. An ANFIS trained with lesser tolerance will perform greater than it would with higher tolerance parameters. The training time in this approach is dependent on the ANFIS architecture. The second way to end learning is by limiting the number of training iterations. In order to have an adequate trainning process for our ANFIS model, we splitted our internal temperature/humidity data into 60% trainning, 20% checking and 20% testing (see Figure 6 and Figure 7). This study had a cap of 500 learning iterations in place after which the ANFIS model would stop training.

Figure 7. Trainning, checking and testing data of the internal humidity

5. Discussion of Results

In this section, the outcomes of the experiments are analyzed and presented, along with a comparison between the results of the ANFIS versus the experimental model based on parameters determined for the greenhouse microclimate. The graphical representations in Figure 8 diagrams show the values and/or results of CO2 concentration, internal humidity, temperature and radiation in connection with the seedlings' growth period. Parallels are evident between the predicted values and the data collected from experiments.

Statistics have been used to display the aptitude of ANFIS versus neural networks, which make it clear that predictions received from ANFIS for the internal humidity (Etest_Hint = 0.557), CO2 concentration (Etest_CO2 = 0.520), inner radiation (Etest_Rint = 0.387) and inner temperature (Etest_Tint = 0.725) were 2% nearer the measurements in the experiment, in contrast to 8% when just neural networks were used.

6. Conclusion

Couple maching learning techniques have been used aiming to build an efficient model to control the green house climate in the last forty years but unfortunately due to the non-stationarity and non-seasonality of enviremental conditions time series process, the non-linearity of inputs/outputs, non-normal distributions, we couldn't really get to an efficient robust model for a greenhouse climate. This paper successfully employs the ANFIS to simulate greenhouse climate while tomato seedlings are grown. An assessment of results derived from the experimental model alongside the ANFIS model brings us to the conclusion that ANFIS is an accurate and efficient prediction method for greenhouse climates. This system can yield accuracy as high as 98% in all of the four components when trained with the least square algorithm and back propagation. Chances of error in predicting internal climate values in combination with gaussian and sigmoidal membership function is just 2%. Accuracy with the adoption of the triangular membership function would be 92% with an average error chance of 8%.

Figure 8. Measured versus predicted greenhouse internal climate models

  References

[1] Guzmán-Cruz, R., Castañeda-Miranda, R., García-Escalante, J.J., López-Cruz, I.L., Lara-Herrera, A., De la Rosa, J.I. (2009). Calibration of a greenhouse climate model using evolutionary algorithms. Biosystems Engineering, 104(1): 135-142. https://doi.org/10.1016/j.biosystemseng.2009.06.006

[2] Rico-Garcia, E., Lopez-Cruz, I.L., Herrera-Ruiz, G., Soto-Zarazua, G.M., Castaneda-Miranda, R. (2008). Effect of temperature on greenhouse natural ventilation under hot conditions: Computational Fluid Dynamics simulations. Journal of Applied Sciences, 8(24): 4543-4551. https://doi.org/10.3923/jas.2008.4543.4551

[3] Yousefi, M.R., Hasanzadeh, S., Mirinejad, H., Ghasemian, M. (2010, July). A hybrid neuro-fuzzy approach for greenhouse climate modeling. In 2010 5th IEEE International Conference Intelligent Systems, London, UK, pp. 212-217. https://doi.org/10.1109/IS.2010.5548375

[4] Rodríguez, F., Berenguel, M. (2002). Design, implementation, calibration and validation of a dynamic model of greenhouse climate based on physical principles. Doctoral dissertation, University of Almería, Spain.

[5] Sriraman, A., Mayorga, R.V. (2004). A fuzzy inference system approach for greenhouse climate control. Environmental Informatics Archives, 2(1): 630-641. 

[6] Oueslati, L. (1990). Commande multivariable d'une serre agricole par minimisation d'un critere quadratique. Doctoral dissertation, University of Toulon.

[7] Mirinejad, H., Sadati, S.H., Hasanzadeh, S., Shahri, A. M., Ghasemian, M. (2008). Design and simulation of an automated system for greenhouse using LabVIEW. American-Eurasian J. Agric. and Environ. Sci, 3(2): 279-284.

[8] Mirinejad, H., Sadati, S.H., Ghasemian, M., Torab, H. (2008). Control techniques in heating, ventilating and air conditioning (hvac) systems. J. Comput. Sci., 4(9): 777-783.

[9] Souissi, M. (2002). Modélisation et commande du climat d’une serre agricole. Thesis, Faculty of Mathematical, Physical and Natural Sciences ELMANAR University, Tunisia.

[10] El Ghoumari, M.Y., Tantau, H.J., Serrano, J. (2005). Non-linear constrained MPC: Real-time implementation of greenhouse air temperature control. Computers and Electronics in Agriculture, 49(3): 345-356. https://doi.org/10.1016/j.compag.2005.08.005

[11] Lafont, F., Balmat, J.F. (2004). Fuzzy logic to the identification and the command of the multidimensional systems. International Journal of Computational Cognition, 2(2): 21-47. 

[12] Fourati, F., Chtourou, M. (2007). A greenhouse control with feed-forward and recurrent neural networks. Simulation Modelling Practice and Theory, 15(8): 1016-1028. https://doi.org/10.1016/j.simpat.2007.06.001

[13] Elman, J.L. (1990). Finding structure in time. Cognitive Science, 14(2): 179-211. https://doi.org/10.1207/s15516709cog1402_1

[14] Berrezzek, F., Khelil, K., Bouadjila, T. (2019). Efficient wind speed forecasting using discrete wavelet transform and artificial neural networks. Revue d'Intelligence Artificielle, 33(6): 447-452. https://doi.org/10.18280/ria.330607

[15] Efren, G.H., Antonio, A.F.M., Carlos, P.O.J., Manuel, R.A.J., Artemio, S.O., Saúl, T.A. (2012). Greenhouse Fuzzy and Neuro-Fuzzy Modeling Techniques. INTECH Open Access Publisher. 

[16] Liu, L., Qiao, X. Shi, X.D., Wang, Y. Shi, Y.G. (2019). Apple binocular visual identification and positioning system. Revue d'Intelligence Artificielle, 33(2): 133-137. https://doi.org/10.18280/ria.330208

[17] Lee, J.H., Yoo, W.S. (2009). An improved model-based predictive control of vehicle trajectory by using nonlinear function. Journal of Mechanical Science and Technology, 23(4): 918-922. https://doi.org/10.1007/s12206-009-0312-9

[18] Cho, H.C., Lee, K.S. (2008). Adaptive control and stability analysis of nonlinear crane systems with perturbation. Journal of Mechanical Science and Technology, 22(6): 1091-1098. https://doi.org/10.1007/s12206-008-0216-0

[19] Salgado, P., Cunha, J.B. (2005). Greenhouse climate hierarchical fuzzy modelling. Control Engineering Practice, 13(5): 613-628. https://doi.org/10.1016/j.conengprac.2004.05.007

[20] Shukla, A., Tiwari, G.N., Sodha, M.S. (2008). Experimental study of effect of an inner thermal curtain in evaporative cooling system of a cascade greenhouse. Solar Energy, 82(1): 61-72. https://doi.org/10.1016/j.solener.2007.04.003

[21] Lafont, F., Balmat, J.F. (2002). Optimized fuzzy control of a greenhouse. Fuzzy sets and systems, 128(1): 47-59. 

[22] Herrero, J.M., Blasco, X., Martínez, M., Ramos, C., Sanchis, J. (2008). Robust identification of non-linear greenhouse model using evolutionary algorithms. Control Engineering Practice, 16(5): 515-530. https://doi.org/10.1016/j.conengprac.2007.06.001

[23] Jang, J.S. (1993). ANFIS: adaptive-network-based fuzzy inference system. IEEE transactions on systems, man, and cybernetics, 23(3): 665-685. https://doi.org/10.1109/21.256541