## 4 Artificial Neural Networks in Energy Optimization of Greenhouses  
Another problem of interest in greenhouses is the optimization of energy consumption derived mainly from heating and, ventilation systems, among other control elements [143]. Optimal control strategies, for the most part, are based on mathematical models for calculating greenhouse energy consumption and mathematical methods to minimize total energy consumption. An example is the state energy balance model's use. The use of this model is not new [144], nor is its use for real-time energy optimization [9]. However, the implementation of these techniques with sustainable technologies such as photovoltaic (PV) collectors have allowed predicting performance and establishing better systems for energy consumption [145]. Furthermore, greenhouses with systems that optimize energy consumption must assess heating needs before being implemented, and one of the ways to do this is through mass flow and energy transfer models [146]. Currently these models are still being developed to predict heating requirements. They make it possible to resolve different issues related to this topic, such as the forecast of the hourly energy requirements based on the entry of the parameters of environmental control inside the greenhouse, the physical and thermal properties of the crops and the construction materials [147]. In addition, CFD-based energy saving and system performance models have been proposed [148]. The use of other types of models such as based optimization techniques such as particle swarm optimization (PSO) and GA have also shown good results [149], as well as with NNs [10]. Energy consumption is largely derived from two factors that influence the aforementioned control elements, temperature, and humidity. [PERSON] et al. [150] developed a predictor of energy consumption for greenhouses from an MLP, also compared the ANN model with a non-linear regression model. The results obtained show that the prediction power of the network is superior to the regression model with a significant accuracy level (95%). Regarding the structure of the network, a cascade architecture was carried out where the input variables were temperature, relative humidity, time and electrical consumption, on the other hand, the output variable considered was the electrical consumption. Several MLP models were tested, where the hidden layer was the only variant with five, four, three and two neurons. While the Levenberg-Marquardt reverse propagation algorithm was used for the learning procedure. The MLP model with the best results was the model with three nodes in the hidden layer, also compared to the regression model. The use of elements that help the energetic production in greenhouses is also a topic of interest, in the same way, its energy management and optimization. Photovoltaic modules are a viable option for this task, [PERSON] et al. [151] developed a photovoltaic greenhouse, where the use of ANNs focused on the prediction of instantaneous production of the system. The network used was feedforward trained using an LM algorithm. The input variables considered were ambient temperature, relative humidity, wind speed, wind direction, and radiation. As output variables, only photovoltaic energy production was considered. The hidden layer of the network consisted of 140 neurons, the tests were obtained in 1 second and prediction errors for the instantaneous production of electricity below 20 Watts. Other studies have used ANNs to predict greenhouse production using the amount of energy use as a basis. Such is the case of [PERSON] et al. [152] who, through an MLP network, predicted greenhouse tomato production. They used as inputs the energy equivalences of chemical products, human energy, machinery, chemical fertilizers, diesel fuel, electricity, and irrigation water. The architecture used consisted of 7 inputs, 10 neurons for each of the two hidden layers and one output (tomato production).