# Neural Network Model for Greenhouse Microclimate Predictions

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

_{2}), have an important contribution to the system.

_{2}concentration, and illumination. From this model, coefficients of determination greater than 0.9 were obtained, and more specifically their values for temperature and relative humidity were equal to 0.925 and 0.937, respectively. Moreover, Salah & Fourati [23] combined an Elman network with a deep multilayer FF neural network for the greenhouse control. The first network for the simulation of the direct dynamics of the internal processes was used, whereas the second one was for the inverse dynamics. Finally, Taki, et al. [24] compared three different models for the estimation of three different temperatures inside the greenhouse, the air temperature, the soil temperature, and the plants’ temperatures. After comparing a radial basis function (RBF) model, an MLP, and a support vector machine (SVM) model, it was found that the first one presented the best results.

_{in}) and relative humidity (RH

_{in}) inside the greenhouse, based on outside temperature (T

_{out}) and relative humidity RH

_{out}), wind speed (WS), solar irradiance (SR), as well as internal temperature and relative humidity up to half an hour before. After extensive research in the literature in recent years, no similar study has been found. The goal is for the model to show as low a maximum error as possible between the predicted and observed data so that it can respond adequately to a decision support system (DSS).

## 2. Materials and Methods

#### 2.1. Greenhouse

_{g}) is equal to 204.8 m

^{2}, the total volume (V) is 798.72 m

^{3}, and the surface of the cover (A

_{c}) is 461.44 m

^{2}. It is a high-tech greenhouse constructed of high-quality materials. Its frame is made up of steel pieces with different cross-sections. These glass panes in particular can withstand chemicals, high wind speeds, and pollution.

^{2}) was used. Within this section, in the center of the width of the unit and the positions corresponding to ¼ and ¾ of the length of the greenhouse, two ad hoc data acquisition systems have been installed. These systems are equipped with sensors that can record the inside temperature and relative humidity, the solar irradiance transmitted through the cover, and the photosynthetically active radiation (PAR). In addition to the sensors inside the greenhouse, an automatic weather station (AWS) has been placed outside the greenhouse facing the east side of it. The station can record environmental conditions, such as temperature, relative humidity, wind speed, solar radiation, sky temperature, IR radiation, and rainfall. The recorded data from the inside and outside of the greenhouse is stored in a data logger installed on the station and taken remotely. The sensors inside and outside the greenhouse are presented in Table 1.

#### 2.2. Data and Methodology

_{s}) is equal to 10 min. Data from 28 February 2022 9:20 to 3 March 2022 10:00 were missing. Therefore, the total amount of data is equal to 8594 samples. As independent input variables, data of the external environmental parameters were used, i.e., the outside temperature (T

_{out}), the outside relative humidity (RH

_{out}), the wind speed (WS), and the solar irradiance (SR). In addition to the parameters describing the external conditions, for the estimation of the temperature (T

_{in}) and relative humidity (RH

_{in}) inside the greenhouse at time t

_{0}equal to 0, as input variables were also used for the internal temperature and relative humidity with a time delay of one (t = t

_{0}− t

_{s}), two (t = t

_{0}− 2t

_{s}) and three (t = t

_{0}− 3t

_{s}) timesteps. The internal temperature and relative humidity were calculated as the average value of the two individual stations installed inside the greenhouse, which allows a more reliable view of the indoor conditions. The relationships between input and output variables are described by:

_{0}) are presented. On the right-hand side of these equations, the independent variables of the model are presented, based on what function f will give the predictions for the dependent variables. More specifically, the variables presented in Equations (1) and (2) are:

- –
- T
_{in}(t_{0}): the indoor temperature at time t_{0}[°C] - –
- RH
_{in}(t_{0}): the indoor relative humidity at time t_{0}[%] - –
- T
_{out}(t_{0}): the indoor temperature at time t_{0}[°C] - –
- RH
_{out}(t_{0}): the indoor relative humidity at time t_{0}[%] - –
- WS (t
_{0}): the wind speed at time t_{0}[m·s^{−1}] - –
- SR (t
_{0}): the solar irradiance at time t_{0}[W·m^{−2}] - –
- T
_{in}(t_{0}− t_{s}): the indoor temperature with a time delay of one timestep (t_{s}) [°C] - –
- RH
_{in}(t_{0}− t_{s}): the indoor relative humidity with a time delay of one timestep (t_{s}) [%] - –
- T
_{in}(t_{0}− 2 × t_{s}): the indoor temperature with a time delay of two timesteps (2 × t_{s}) [°C] - –
- RH
_{in}(t_{0}− 2 × t_{s}): the indoor relative humidity with a time delay of two timesteps (2 × t_{s}) [%] - –
- T
_{in}(t_{0}− 3 × t_{s}): the indoor temperature with a time delay of three timesteps (3 × t_{s}) [°C] - –
- RH
_{in}(t_{0}− 3 × t_{s}): the indoor relative humidity with a time delay of three timesteps (3 × t_{s}) [%] - –
- t
_{0}: the time equal to 0 - –
- t
_{s}: the timestep equal to 10 min

^{2}. Inside the greenhouse, the temperature ranges between 3.2 °C and 50.7 °C, whereas relative humidity shows a minimum of 5.7% and a maximum of 89.3%.

_{max}and r

_{min}are equal to 0.99 and 0.01, respectively. Min/max normalization was chosen because it is the fastest, easiest, and the most flexible normalization method, and with the addition of the parameters r

_{max}and r

_{min}, the normalization range can be easily changed depending on the needs of each activation function, setting the corresponding maximum and minimum limit of the range on them.

_{i}presents the normalized value of the X

_{i}; X

_{max}and X

_{min}present the maximum and the minimum value of the variable X, respectively; and the parameters r

_{max}and r

_{min}obtain the values of the desired normalization range limits. This range was chosen due to the use of the logistic sigmoid activation function in the hidden layer of the neural network. The logistic sigmoid activation function is characterized by Equation (4) and receives values in a range of 0 to 1, as shown in Figure 7; however, it was chosen to use narrower boundaries due to the existence of possible discontinuities at the range limits. At the end of the process, the values were denormalized to complete the comparison between predictions and observations.

^{2}) (Equations (4)–(6)), as well as the maximum error were calculated. The maximum error is a very important value for a decision support system, which will activate the various system management devices based on the results of the model.

#### 2.3. Neural Network Model

_{0}. As for the intermediate layers, the addition of a single hidden layer was chosen because according to Kolmogorov’s theorem, in an MLP neural network one hidden layer with a suitable number of nodes can give reliable results for any process [2,26].

## 3. Results and Discussion

^{2}, and the maximum error, it was found that the best structure of the neural network is 10-7-2, which gave the most reliable results for the testing period. The model structure extracted from MATLAB is presented in Figure 9, whereas the values of the aforementioned indices are presented in Table 3, both for temperature and relative humidity. According to the specific structure of the neural network, the following graphs of comparison were made between the observed and predicted values of the two variables.

^{−5}. This value was obtained through the normalized input and output variables and presents the best performance of the model.

^{2}, for both temperature and relative humidity, proved to be very good, presenting values very close to 1. Finally, the maximum error is not a widespread data comparison value; however, for the needs of this work, it was a very useful parameter, with its value being quite small [29].

## 4. Conclusions

^{2}were calculated to equal 0.218 K, 0.271 K, and 0.999 for temperature, and to 0.339%, 0.481%, and 0.999 for relative humidity. The above values, both for the maximum error and for the rest of the statistics, prove that the specific model can satisfactorily meet the requirements of a decision support system.

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Aslan, M.F.; Durdu, A.; Sabanci, K.; Ropelewska, E.; Gültekin, S.S. A Comprehensive Survey of the Recent Studies with UAV for Precision Agriculture in Open Fields and Greenhouses. Appl. Sci.
**2022**, 12, 1047. [Google Scholar] [CrossRef] - Singh, V.K.; Tiwari, K.N. Prediction of greenhouse micro-climate using artificial neural network. Appl. Ecol. Environ. Res.
**2017**, 15, 767–778. [Google Scholar] [CrossRef] - Shamshiri, R.R.; Jones, J.W.; Thorp, K.R.; Ahmad, D.; Man, H.C.; Taheri, S. Review of optimum temperature, humidity, and vapour pressure deficit for microclimate evaluation and control in greenhouse cultivation of tomato: A review. Int. Agrophys.
**2018**, 32, 287–302. [Google Scholar] [CrossRef] - Rabbi, B.; Chen, Z.-H.; Sethuvenkatraman, S. Protected Cropping in Warm Climates: A Review of Humidity Control and Cooling Methods. Energies
**2019**, 12, 2737. [Google Scholar] [CrossRef][Green Version] - Soussi, M.; Chaibi, M.T.; Buchholz, M.; Saghrouni, Z. Comprehensive Review on Climate Control and Cooling Systems in Greenhouses under Hot and Arid Conditions. Agronomy
**2022**, 12, 626. [Google Scholar] [CrossRef] - Shen, Y.; Wei, R.; Xu, L. Energy Consumption Prediction of a Greenhouse and Optimization of Daily Average Temperature. Energies
**2018**, 11, 65. [Google Scholar] [CrossRef][Green Version] - Savvas, D.; Ropokis, A.; Ntatsi, G.; Kittas, C. Current situation of greenhouse vegetable production in Greece. In Proceedings of the VI Balkan Symposium on Vegetables and Potatoes, Zagreb, Croatia, 29 September 2014. [Google Scholar]
- Kavga, A.; Thomopoulos, V.; Barouchas, P.; Stefanakis, N.; Liopa-Tsakalidi, A. Research on Innovative Training on Smart Greenhouse Technologies for Economic and Environmental Sustainability. Sustainability
**2021**, 13, 10536. [Google Scholar] [CrossRef] - Stull, R. An Introduction to Boundary Layer Meteorology, 1st ed.; Kluwer Academic Publishers: Dordrecht, The Netherlands, 1988; pp. 2–3. [Google Scholar]
- Maher, A.; Kamel, E.; Enrico, F.; Abdelkader, M. An intelligent system for the climate control and energy savings in agricultural greenhouses. Energy Effic.
**2016**, 9, 1241–1255. [Google Scholar] [CrossRef] - Francik, S.; Kurpaska, S. The Use of Artificial Neural Networks for Forecasting of Air Temperature inside a Heated Foil Tunnel. Sensors
**2020**, 20, 652. [Google Scholar] [CrossRef][Green Version] - Cañadas, J.; Sánchez-Molina, J.A.; Rodríguez, F.; del Águila, I.M. Improving automatic climate control with decision support techniques to minimize disease effects in greenhouse tomatoes. Inf. Process. Agric.
**2017**, 4, 50–63. [Google Scholar] [CrossRef] - Lopez-Cruz, I.L.; Fitz-Rodríguez, E.; Raquel, S.; Rojano-Aguilar, A.; Kacira, M. Development and analysis of dynamical mathematical models of greenhouse climate: A review. Eur. J. Hortic. Sci.
**2018**, 83, 269–279. [Google Scholar] [CrossRef] - Choab, N.; Allouhi, A.; El Maakoul, A.; Kousksou, T.; Saadeddine, S.; Jamil, A. Review on greenhouse microclimate and application: Design parameters, thermal modeling and simulation, climate controlling technologies. Sol. Energy
**2019**, 191, 109–137. [Google Scholar] [CrossRef] - Su, Y.; Xu, L. Towards discrete time model for greenhouse climate control. Eng. Agric. Environ. Food
**2017**, 10, 157–170. [Google Scholar] [CrossRef] - Zhang, P. Industrial control system simulation routines. In Advanced Industrial Control Technology, 1st ed.; Elsevier Inc.: Amsterdam, The Netherlands, 2010; pp. 781–810. [Google Scholar] [CrossRef]
- Esteves, M.S.; Perdicoúlis, T.P.A.; dos Santos, P.L. System Identification Methods for Identification of State Models. In Proceedings of the 11th Portuguese Conference on Automatic Control (CONTROLO’2014), Porto, Portugal, 21–23 July 2014; Volume 321. [Google Scholar] [CrossRef]
- Escamilla-García, A.; Soto-Zarazúa, G.M.; Toledano-Ayala, M.; Rivas-Araiza, E.; Gastélum-Barrios, A. Applications of Artificial Neural Networks in Greenhouse Technology and Overview for Smart Agriculture Development. Appl. Sci.
**2020**, 10, 3835. [Google Scholar] [CrossRef] - Calderón, A.; González, I. Neural Networks-based models for greenhouse climate control. In Proceedings of the XXXIX Jornadas de Automática, Badajoz, Spain, 5–7 September 2018. [Google Scholar]
- Castañeda-Miranda, A.; Castaño, V. Smart frost control in greenhouses by neural networks models. Comput. Electron. Agric.
**2017**, 137, 102–114. [Google Scholar] [CrossRef] - Choi, H.; Moon, T.; Jung, D.H.; Son, J.E. Prediction of Air Temperature and Relative Humidity in Greenhouse via a Mutlilayer Perceptron Using Environmental Factors. Prot. Hortic. Plant Fact.
**2019**, 28, 95–103. [Google Scholar] [CrossRef] - Hongkang, W.; Li, L.; Yong, W.; Fanjia, M.; Haihua, W.; Sigrimis, N.A. Recurrent Neural Network Model for Prediction of Microclimate in Solar Greenhouse. In Proceedings of the 6th IFAC Conference on Bio-Robotics (BIOROBOTICS 2018), Beijing, China, 13–15 July 2018. [Google Scholar] [CrossRef]
- Salah, L.B.; Fourati, F. A greenhouse modeling and control using deep neural networks. Appl. Artif. Intell.
**2021**, 35, 1905–1929. [Google Scholar] [CrossRef] - Taki, M.; Mehdizadeh, S.A.; Rohani, A.; Rahnama, M.; Rahmati-Joneidabad, M. Applied machine learning in greenhouse simulation; new application and analysis. Inf. Process. Agric.
**2018**, 5, 253–268. [Google Scholar] [CrossRef] - Bhanja, S.; Das, A. Impact of Data Normalization on Deep Neural Network for Time Series Forecasting. arXiv
**2018**, arXiv:1812.05519. [Google Scholar] - Schmidt-Hieber, J. The Kolmogorov-Arnold representation theorem revisited. Neural Netw.
**2021**, 137, 119–126. [Google Scholar] [CrossRef] - Yang, B.; Chen, Y.; Guo, Z.; Wang, J.; Zeng, C.; Li, D.; Shu, H.; Shan, J.; Fu, T.; Zang, X. Levenberg-Marquardt backpropagation algorithm for parameter identification of solid oxide fuel cells. Int. J. Energy Res.
**2021**, 45, 17903–17923. [Google Scholar] [CrossRef] - Lv, C.; Xing, Y.; Zhang, J.; Na, X.; Li, Y.; Liu, T.; Cao, D.; Wang, F.Y. Levenberg–Marquardt Backpropagation Training of Multilayer Neural Networks for State Estimation of a Safety-Critical Cyber-Physical System. IEEE Trans. Ind. Inform.
**2018**, 14, 3436–3446. [Google Scholar] [CrossRef][Green Version] - Aslan, M.F.; Durdu, A.; Sabanci, K. Human action recognition with bag of visual words using different machine learning methods and hyperparameter optimization. Neural Comput. Appl.
**2020**, 32, 8585–8597. [Google Scholar] [CrossRef]

**Figure 11.**Comparison between indoor temperature predictions and observations for the testing period and 10-7-2 NN structure.

**Figure 12.**Errors between indoor temperature predictions and observations for the testing period and 10-7-2 NN structure.

**Figure 13.**Comparison between indoor relative humidity predictions and observations for the testing period and 10-7-2 NN structure.

**Figure 14.**Errors between indoor relative humidity and observations for the testing period and 10-7-2 NN structure.

Recorded Parameter | Sensor | Manufacturer |
---|---|---|

Automatic Weather Station | ||

Datalogger | CR1000 | Campbell Scientific |

Temperature (T_{out}) | MP101A-T7-WAW at 3 m | Rotronic |

Relative Humidity (RH_{out}) | MP101A-T7-WAW at 3 m | Rotronic |

Wind Speed (WS) | A100K at 6 m | Scienter |

Solar Radiation (SR_{out}) | CMP3 at 5 m | Kipp & Zonen |

Rainfall (R) | 52203 | Campbell Scientific |

Sky Temperature (T_{sky}) | CGR3 at 5 m | Kipp & Zonen |

IR Radiation (IR_{rad}) | CGR3 at 5 m | Kipp & Zonen |

Greenhouse | ||

Temperature (T_{in,1} & T_{in,2}) | MP101A-T7-WAW | Rotronic |

Relative Humidity (RH_{in,1} & RH_{in,2}) | MP101A-T7-WAW | Rotronic |

Solar Radiation (SR_{in,1} & SR_{in,2}) | CMP3 | Kipp & Zonen |

Photosynthetically Active Radiation (PAR_{1} & PAR_{2}) | ParLite | Kipp & Zonen |

Name | MATLAB Coding |
---|---|

Training Algorithm | |

Levenberg–Marquardt backpropagation | “trainlm” |

Bayesian Regularization backpropagation | “trainbr” |

BFGS Quasi Newton backpropagation | “trainbfg” |

Activation Function | |

Logistic Sigmoid | “logsig” |

Hyperbolic Tangent Sigmoid | “tansig” |

Radial Basis | “radbas” |

Positive Linear | “poslin” |

**Table 3.**Statistical indicators of comparison between observed and predicted values of internal temperature and relative humidity.

Statistical Indicators | Temperature | Relative Humidity |
---|---|---|

MAE | 0.218 K | 0.339% |

RMSE | 0.271 K | 0.481% |

R^{2} | 0.999 | 0.999 |

MAX ERROR | 0.877 K | 2.838% |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Petrakis, T.; Kavga, A.; Thomopoulos, V.; Argiriou, A.A.
Neural Network Model for Greenhouse Microclimate Predictions. *Agriculture* **2022**, *12*, 780.
https://doi.org/10.3390/agriculture12060780

**AMA Style**

Petrakis T, Kavga A, Thomopoulos V, Argiriou AA.
Neural Network Model for Greenhouse Microclimate Predictions. *Agriculture*. 2022; 12(6):780.
https://doi.org/10.3390/agriculture12060780

**Chicago/Turabian Style**

Petrakis, Theodoros, Angeliki Kavga, Vasileios Thomopoulos, and Athanassios A. Argiriou.
2022. "Neural Network Model for Greenhouse Microclimate Predictions" *Agriculture* 12, no. 6: 780.
https://doi.org/10.3390/agriculture12060780