Develop a Smart Microclimate Control System for Greenhouses through System Dynamics and Machine Learning Techniques

: Agriculture is extremely vulnerable to climate change. Greenhouse farming is recognized as a promising measure against climate change. Nevertheless, greenhouse farming frequently encoun-ters environmental adversity, especially greenhouses built to protect against typhoons. Short-term microclimate prediction is challenging because meteorological variables are strongly interconnected and change rapidly. Therefore, this study proposes a water-centric smart microclimate-control system (SMCS) that fuses system dynamics and machine-learning techniques in consideration of the internal hydro-meteorological process to regulate the greenhouse micro-environment within the canopy for environmental cooling with improved resource-use efﬁciency. SMCS was assessed by in situ data collected from a tomato greenhouse in Taiwan. The results demonstrate that the proposed SMCS could save 66.8% of water and energy (electricity) used for early spraying during the entire cultivation period compared to the traditional greenhouse-spraying system based mainly on operators’ experiences. The proposed SMCS suggests a practicability niche in machine-learning-enabled greenhouse automation with improved crop productivity and resource-use efﬁciency. This will increase agricultural resilience to hydro-climate uncertainty and promote resource preservation, which offers a pathway towards carbon-emission mitigation and a sustainable water–energy–food nexus.


Introduction
The Sustainable Development Goals (SDGs) call for imperative action to ensure food security while preserving natural resources and maintaining environmental sustainability, especially in the era of climate change [1]. Significant changes in Earth's climate have fostered more extreme weather events in recent decades and therefore have increasingly impacted global agriculture by deeply implicating the fate of food systems and directly affecting the future of "eating" for humans. For instance, Taiwan suffered from 15 extreme weather events in 2016, including 4 typhoons, 3 torrential rains, 4 severe rains, and 4 cold snaps. The huge agricultural loss caused by these extreme weather events accounted for 10.3% of the total value of agricultural production, resulting in severe fluctuations in food prices and disturbance in social equilibrium. Besides, changes in temperature and precipitation patterns may increase crop failures and production declines [2].
Agricultural systems are vulnerable to changes not only in climate but also in other evolving factors like farming practices and technology. The impacts of climate change on agricultural systems globally have been investigated in recent decades [3][4][5][6]. Greenhouses are an expensive and technological solution for the challenges climate change poses to agriculture. However, they are not a universal tool that will solve all problems since it is infeasible to grow all crops indoors. For specific, high-value crops, this makes sense. Climate-smart agriculture is an integrated approach that seeks to manage landscapes by assessing interlinked food security and climate change to simultaneously improve crop productivity as well as reduce agricultural vulnerability to pests and climate-related risks [7].
Greenhouse cultivation that creates a controllable and stable environment facilitating crop growth and yield could be a climate-smart practice [8][9][10]. Hemming et al. [11] indicated that the opportunities and challenges for the future implementation of sensor systems in greenhouses could be explored by using artificial-intelligence techniques. Greenhouse farming is recognized as a promising measure to cope with climate change because this physical practice can promote crop growth and productivity by adequately controlling a microclimate to increase food security [12][13][14]. Due to the high agricultural loss induced by extreme weather events in 2016, the Council of Agriculture in Taiwan launched a five-year funding program in December of 2016 to encourage greenhouse construction or upgrades (2000 ha expected) for mitigating agricultural losses and maintaining stable food prices in the future. Among limited managerial tools, spraying plays a pivotal role in greenhouse control of environmental cooling, especially for places like Taiwan with hot and humid weather, where environmental adversity can occur in greenhouses. For instance, Bwambale et al. [15] conducted a review of smart irrigation-monitoring and control strategies that aimed to improve water-use efficiency in precision agriculture. Tona et al. [16] conducted a technical-economic analysis on spraying equipment for specialty crops and indicated that the purchase price would make the robotic platform profitable. Spraying systems are evidently one of the key environmental-control strategies for greenhouse cultivation. Nevertheless, most of the previous research related to spraying for environmental cooling focused mainly on cooling effects [17], without considering resource consumption. For resource preservation, it is required to consider the resource-use efficiency of spraying for environmental cooling.
Greenhouse cultivation by nature substantially depends on environmental controls to stabilize crop productivity [18,19]. Accurate prediction or simulation of a greenhouse internal environment is needed to evaluate environmental-control strategies for crop growth [20][21][22][23][24][25]. Besides, short-term microclimate prediction is challenging because meteorological variables are strongly interconnected with values changing rapidly during an event. With the motivation to fill the research gap and support the above-mentioned governmental greenhouse policy to achieve SDGs #2 (Zero Hunger), #12 (Responsible Consumption and Production), and #13 (Climate Action), this study developed a watercentric smart microclimate-control system (SMCS) for greenhouse cultivation in response to climatic variation. The SMCS was designed to automatically activate early spraying for environmental cooling while consuming less water and energy. The SMCS seamlessly integrates a system-dynamics (SD) model coupled with a physically based (i.e., a hydrometeorological process) estimation model, a machine-learning prediction model, and a spray mechanism. A traditional greenhouse-spraying system based on the physically based estimation model and the spray mechanism coupled with operators' experience served as a benchmark for exploring the usefulness and applicability of the proposed SMCS. A tomato greenhouse located in Changhua County of Taiwan formed the case study, where the in situ datasets for use in this study were collected by Internet of Things (IoT) devices. The SMCS is expected to increase greenhouse automation and reinforce the efficiency of resource utilization, which can pave the way to reducing carbon emissions and promoting water-energy-food-nexus synergies in greenhouse farming.

Materials and Methods
This study proposes a water-centric SMCS that fuses system-dynamics and machinelearning techniques to regulate the greenhouse micro-environment within the canopy, with improved resource-use efficiency. The research flow chart is shown in Figure 1. We first collected the historical IoT monitoring data of the investigative greenhouse. Based on the IoT data, the SD model simulated the greenhouse microclimate within the canopy before and after spraying for environmental cooling. The back-propagation neural-network (BPNN) model predicted one-hour-ahead greenhouse internal temperature and relative humidity, where the initial inputs were the IoT data. Based on the prediction results, a spray mechanism was designed to determine the necessity of early spraying for environmental cooling. Consequently, the impacts of spraying on the internal environment and resource consumption were investigated. This study further compared the spray effects between the SMCS and the traditional greenhouse-spraying system (a benchmark), with the main focus on the resource consumption of spraying for environmental cooling. In the end, the potential of the SMCS for agricultural-loss mitigation in the perspective of water-energyfood-nexus synergies was discussed. It was noted that both traditional and machinelearning-based systems were constructed based on the IoT data collected from the same trial during 20 May and 20 July 2019. learning techniques to regulate the greenhouse micro-environment within the canopy, with improved resource-use efficiency. The research flow chart is shown in Figure 1. We first collected the historical IoT monitoring data of the investigative greenhouse. Based on the IoT data, the SD model simulated the greenhouse microclimate within the canopy before and after spraying for environmental cooling. The back-propagation neural-network (BPNN) model predicted one-hour-ahead greenhouse internal temperature and relative humidity, where the initial inputs were the IoT data. Based on the prediction results, a spray mechanism was designed to determine the necessity of early spraying for environmental cooling. Consequently, the impacts of spraying on the internal environment and resource consumption were investigated. This study further compared the spray effects between the SMCS and the traditional greenhouse-spraying system (a benchmark), with the main focus on the resource consumption of spraying for environmental cooling. In the end, the potential of the SMCS for agricultural-loss mitigation in the perspective of waterenergy-food-nexus synergies was discussed. It was noted that both traditional and machine-learning-based systems were constructed based on the IoT data collected from the same trial during 20 May and 20 July 2019.

Study Area and Materials
In this study, a total of 1488 hourly meteorological datasets related to tomato cultivation were collected on 20 May and 20 July 2019 by IoT devices installed inside and outside a privately owned greenhouse located in Changhua County of Taiwan ( Figure 2). The IoT devices ( Figure 2) installed in the greenhouse were developed by the Taiwan Agricultural Research Institute. The size of the greenhouse is about 52 m × 30 m × 6 m (length × width × height), indicating that the land area of the greenhouse is about 1560 m 2 . Monitoring items consisted of internal/external temperature, internal/external relative humidity, external insolation, wind speed, and wind direction (Table 1). It is noted that this study adopted IoT datasets for model-construction and evaluation purposes only. a privately owned greenhouse located in Changhua County of Taiwan ( Figure 2). The IoT devices ( Figure 2) installed in the greenhouse were developed by the Taiwan Agricultural Research Institute. The size of the greenhouse is about 52 m × 30 m × 6 m (length × width × height), indicating that the land area of the greenhouse is about 1560 m 2 . Monitoring items consisted of internal/external temperature, internal/external relative humidity, external insolation, wind speed, and wind direction (Table 1). It is noted that this study adopted IoT datasets for model-construction and evaluation purposes only.

System Dynamics (SD) for Simulating Greenhouse Environment
SD is a set of process-oriented research methods specializing in the causal-feedback relationship among many variables and high-order non-linear systems [26][27][28]. It also specializes in explaining the results of system behavior through structural reasons behind the

System Dynamics (SD) for Simulating Greenhouse Environment
SD is a set of process-oriented research methods specializing in the causal-feedback relationship among many variables and high-order non-linear systems [26][27][28]. It also specializes in explaining the results of system behavior through structural reasons behind the behavior [29]. SD has been widely used for simulating the non-linear behaviors in complex systems over time in various fields, including greenhouse management, forecasting and experimentation [30][31][32], rooftop farming [33], and the water-food-energy nexus [34,35].
This study explored the causal loops of SD for greenhouse cultivation by consideration the spray effect ( Figure 3a). It is noted that the SMCS was constructed to reduce internal temperature and increase internal relative humidity by raising the partial pressure of water vapor to achieve the effect of cooling and humidification. A physically based model was constructed based on the SD model to estimate the greenhouse internal temperature and relative humidity before and after spraying. The framework of the SD model coupled with the physically based estimation model is shown in Figure 3.
This study explored the causal loops of SD for greenhouse cultivation by consideration the spray effect ( Figure 3a). It is noted that the SMCS was constructed to reduce internal temperature and increase internal relative humidity by raising the partial pressure of water vapor to achieve the effect of cooling and humidification. A physically based model was constructed based on the SD model to estimate the greenhouse internal temperature and relative humidity before and after spraying. The framework of the SD model coupled with the physically based estimation model is shown in Figure 3. Referring to Lee et al. [17], greenhouse internal relative humidity and temperature were considered to be a function of the conservation of mass and the conservation of energy, which consisted of two parts. Part 1 estimated the internal relative humidity by calculating enthalpy and heat conduction. Part 2 estimated the internal temperature by calculating the variation in moisture in the air. The formulation of greenhouse internal relative humidity and temperature is briefly introduced below.

Formulation of Greenhouse Internal Relative Humidity
The physically based estimation model of internal relative humidity was constructed by the equations of the conservation of mass and the conservation of energy (Equation (1)).
where dH dt is the indoor absolute humidity change rate in a time period (kg/m 3 h), β i,t is the spray efficiency (%), Water i,t denotes the amount of spray (kg), Vent i,t denotes the indoor ventilation (kg/h), and H i,t (H o,t ) denote the internal (external) absolute humidity (kg/m 3 ) at t. V GH denotes the total capacity of the greenhouse (m 3 ), and D air denotes the air density (1.2 kg/m 3 ).
where RH i,t (RH o,t ) denotes the indoor (external) relative humidity (%) at t, esi i,t (esi o,t ) denotes the indoor (external) saturated vapor pressure (kpa) at t, and P atm denotes the atmospheric pressure (101 kpa).
where C i,t is the ventilation utilization factor at t, A GH is the ventilation area of the greenhouse (m 2 ), and WS t denotes the wind speed (m/h) at t.
where H i,t+1 and H i,t denote the indoor absolute humidity at t + 1 and t (kg/m 3 ), respectively.
where ei i,t+1 denotes the indoor partial pressure of water vapor (kpa) at t + 1. Consequently, the internal relative humidity (RH i,t+1 ) at t + 1 could be calculated by Equation (10).

Formulation of Greenhouse Internal Temperature
The internal temperature was also constructed by the equations of the conservation of mass and the conservation of energy (Equation (11)).
where dh dt denotes the indoor change rate of enthalpy in a time period (kj/kg h); h i,t and h o,t denote the indoor and external enthalpies (kj/kg) in the air at t, respectively; Vent i,t denotes the ventilation rate (m 3 /h) at t; V GH denotes the total capacity of the greenhouse (m 3 ); D air denotes the air density (1.2 kg/m 3 ); K in denotes the indoor coating material's heatconvection parameter in the air (6.4 W/m 2 • C); A w denotes the area of the coating material (m 2 ); T s,t , T i,t , and T f,t denote the indoor temperature ( • C) of the coating material, the indoor temperature ( • C), and the indoor ground temperature ( • C) at t, respectively; A f denotes the total ground area of the greenhouse (m 2 ); and K f denotes the indoor ground-to-air heat convection parameter (4.65 W/m 2 • C).
where H i,t denotes the indoor absolute humidity (kg/m 3 ) at t.
where T o,t denotes the external temperature ( • C) at t, and H o,t denotes the external absolute humidity (kg/m 3 ) at t.
where a is the solar-absorption rate on the surface of the material (0.65%), Rn o,t denotes the external solar radiation (W/m 2 ) at t, and K out denotes the thermal conductivity on the surface of the material (6.3 W/m 2 • C).
where ref denotes the ground reflectivity (0.2), par o,t denotes the external insolation at t (W/m 2 ), and Rn lon denotes the atmospheric long-wave radiation (343 W/m 2 ).
where B is the Boltzmann constant (5.67 × 10 −8 Wm −2 K −4 ). Because this study considered spray to be a means of humidification and cooling, it required calculating the internal heat moving away due to spray, as shown in Equation (17) (refer to [36]).
where Q t denotes the heat moving away due to spray (kj/h), β i,t denotes the indoor spray efficiency (%) at t, Water i,t denotes the indoor spray amount (kg/h) at t, and H fg denotes the latent heat of water evaporation (2256.6 kj/kg). (18) where dT denotes the indoor temperature change in a time period ( • C/h), and C p denotes the specific heat of the air (1.0052 kj/kg • C). Consequently, the internal temperature at t + 1 could be obtained from Equation (19).
where T i,t+1 and T i,t denote the indoor temperature ( • C) at t + 1 and t, respectively. Details of the formulation of greenhouse relative humidity (Part 1) and internal temperature (Part 2) can be found in the Supplementary Material.
The BPNN is one of the most widely used ANNs. This study utilized the BPNN to predict one-hour-ahead greenhouse internal temperature (T i (t + 1)) and relative humidity (RH i (t + 1)) based on current information on six meteorological factors, including external temperature (T o ), external relative humidity (RH o ), external insolation (par o ) and wind speed (WS), internal temperature (T i ), and internal relative humidity (RH i ) (Figure 3b). The construction of the BPNN prediction model was based on a total of 1488 hourly IoT data, where 64, 16, and 20% of the data were shuffled and randomly allocated into training, validation, and testing stages, respectively. The architecture of the BPNN model constructed in this study is illustrated in Figure 3b. The parameter setting of the BPNN model is shown in Table 2, where the number of neurons in the hidden layer and the batch size were determined to be 20 and 64, respectively, through trial-and-error processes. The relevant trial-and-error results are presented in Tables 3 and 4.    Figure 4 presents the spray-simulation flow chart of the SMCS. According to the onehour-ahead predictions (t + 1) of greenhouse internal temperature and relative humidity obtained from the BPNN model, a spray mechanism with spraying criteria was designed to determine the time to spray, which is introduced as follows. According to Xue et al. [58] on greenhouse cultivation, the net photosynthetic rate and cumulative photosynthesis of tomato leaves could be significantly improved when the internal relative humidity reached 70%. Liou et al. [59] indicated that the formation of lycopene in tomatoes would be reduced if the greenhouse internal temperature exceeded 28 °C. Therefore, this study managed to activate sprayers for environmental cooling under two conditions: when the internal relative humidity fell below 70%, and when the internal relative humidity and the internal temperature exceeded 90% and 28 °C, respectively.

Construction of the Spray Mechanism
To avoid resource over-consumption, sprayers would not be activated if the internal relative humidity exceeded 90% or the internal temperature fell below 25 °C. Besides, the switching on/off of the sprayers would be carried out based on the predicted values of internal relative humidity and temperature. Therefore, the spray mechanism would activate sprayers for environmental cooling subject to two criteria: (1) the one-hour-ahead prediction of internal relative humidity would be less than 70% and the one-hour-ahead prediction of internal temperature would be higher than 25 °C, and (2) the one-hour-ahead According to Xue et al. [58] on greenhouse cultivation, the net photosynthetic rate and cumulative photosynthesis of tomato leaves could be significantly improved when the internal relative humidity reached 70%. Liou et al. [59] indicated that the formation of lycopene in tomatoes would be reduced if the greenhouse internal temperature exceeded 28 • C. Therefore, this study managed to activate sprayers for environmental cooling under two conditions: when the internal relative humidity fell below 70%, and when the internal relative humidity and the internal temperature exceeded 90% and 28 • C, respectively.
To avoid resource over-consumption, sprayers would not be activated if the internal relative humidity exceeded 90% or the internal temperature fell below 25 • C. Besides, the switching on/off of the sprayers would be carried out based on the predicted values of internal relative humidity and temperature. Therefore, the spray mechanism would activate sprayers for environmental cooling subject to two criteria: (1) the one-hour-ahead prediction of internal relative humidity would be less than 70% and the one-hour-ahead prediction of internal temperature would be higher than 25 • C, and (2) the one-hour-ahead prediction of internal relative humidity would be less than 90% and the one-hour-ahead prediction of internal temperature would be higher than 28 • C. Spraying would terminate either when the internal temperature and relative humidity met the environmental suitability for tomato growth or when the total amount of spray exceeded the maximal spray volume within one hour (i.e., 1.35 kg).
In the case of no spraying being required for environmental cooling, the one-hourahead predictions of internal temperature and relative humidity obtained from the BPNN model would be fed back to the system and serve as the initial input values of the BPNN model at the next time-step (the orange dotted line in Figure 4). If either above-mentioned activation criterion for spraying was met, a spray of 0.001 kg would be carried out, leading to a re-calculation of the internal temperature and relative humidity after spraying by using the physically based estimation model. The spraying process would repeat until reaching the stop criteria. It is noted that a sprayer would not be activated if the required amount of spray was less than its minimal spray volume (=the minimal duration of spray × the rate of spray). When spraying terminates, the final one-hour-ahead estimates (t + 1) of internal temperature and relative humidity obtained from the physically based model would be fed back to the system and serve as the initial input values of the BPNN model at the next time-step (the orange dotted line in Figure 4). For the greenhouse investigated and the sprayer selected for use in this study, it would require three sprayers to cover the entire greenhouse farm (1560 m 2 ). The weight of spray each time would be 0.001 kg per sprayer, and the total weight of spray per hour would be 1.35 kg for three sprayers. Therefore, the control loop would be evaluated at a rate of 8 s.

Evaluation of Model Performances
To explore the spray effect of the SMCS on greenhouse farming, the above-mentioned spraying process for environmental cooling was implemented on all 1488 IoT data collected in this study. For comparison purposes, a traditional greenhouse-spraying system was established by integrating the physically based estimation model with the spray mechanism only, whereas the physically based model was responsible for estimating one-hour-ahead greenhouse internal temperature and relative humidity before and after spraying.
This study used the root-mean-square error (RMSE) and the coefficient of determination (R 2 ) as the statistical indicators to evaluate model performance. Their mathematical formulas refer to Equations (20) and (21).
Root-Mean-Square Error Coefficient of Determination where N is the total number of data, y i is the output value of the model, o i is the observation value, and y and o are the average of the output value and the observation value, respectively. According to the definitions of the two indicators, it is obvious that a model is considered to perform well if it produces a higher R 2 value but a lower RMSE value than the comparative model(s).

Results
This study developed a water-centric SMCS dedicated to greenhouse farming and the spray effect on greenhouse microclimate for environmental cooling with the relevant resource consumption being investigated. The operation of the SMCS was composed of four main phases: to simulate greenhouse environmental dynamics in consideration of the spray effect (by the SD model), to predict one-hour-ahead internal temperature and relative humidity (by the BPNN model), to determine the necessity of spraying for environmental cooling (by the spray mechanism), and to estimate the required amount of spray to manage a microclimate suitable for tomato growth in the coming hour (by the physically based model). The SMCS was applied to the 1488 in situ data collected from a greenhouse on 20 May 2019 and 20 July 2019. The modeling results are presented and discussed as follows. Table 5 shows the performance of the physically based estimation model and the BPNN prediction model with respect to greenhouse internal temperature and relative humidity based on test datasets. For the physically based estimation model, the R 2 and RMSE values of the internal temperature were 0.80 and 1.89 • C, respectively, whereas those of the internal relative humidity were 0.79 and 8.17%, respectively. The results demonstrate the accuracy and reliability of the physically based model. As for the BPNN prediction model, its R 2 and RMSE values of the internal temperature were 0.83 and 1.37 • C, respectively, whereas those of the internal relative humidity were 0.88 and 3.9%, respectively. The results also demonstrate the accuracy and reliability of the BPNN model. It appears that the BPNN model is superior to the physically based model in terms of higher R 2 and lower RMSE values.  Figures 5 and 6 show the errors and error distributions of internal-temperature and relative-humidity estimates obtained from the physically based model and the BPNN model, respectively. In both error plots, positive values indicate overestimation whereas negative values indicate underestimation. Regarding the physically based estimation model, it can be seen in Figure 5a that the errors of the internal temperature mostly fell within 1 and 2 • C (overestimated), with an overestimation occurrence frequency (1098 times) much higher than the underestimation one (387 times). According to Figure 5b, the errors in the internal relative humidity were mostly concentrated within −3% and −6% (underestimated), with an underestimation occurrence frequency (787 times) higher than the overestimation one (699 times).

Comparison of Model Accuracy and Reliability between the Physically Based and ANN Models
Regarding the BPNN prediction model, the results of Figure 6a indicate that the errors of the internal temperature mainly fell within −1 and 0 • C (under prediction), where underprediction (1176 times) occurred more frequently than overprediction (302 times). According to Figure 6b, the errors in the internal relative humidity were mainly concentrated within −3% and 0%, where underprediction (959 times) also occurred more frequently than overprediction (517 times). It also appears that the BPNN model performed better than the physically based model in terms of smaller error ranges and error distributions centering at zero.
Furthermore, the results shown in Table 5 and Figures 5 and 6 are quite consistent, which shows that the overall performance of the BPNN model was slightly better than that of the physically based model. This recommended the incorporation of the BPNN model into the SMCS to predict one-hour-ahead internal temperature and relative humidity in this study.    Tables 6 and 7 show the results of internal temperature and relative humidity before and after spraying by the traditional spraying system and the proposed SMCS, respectively. Table 6. Results of greenhouse environmental control on internal temperature and relative humidity before and after spraying for environmental cooling by the traditional spraying system (20 May 2019-20 July 2019).

Temperature
Relative Humidity Before After Before After The results of Table 6 indicate that the average and standard deviation of the internal temperature after spraying decreased by 2.6 and 2.3 • C, respectively. For the internal relative humidity after spraying, the average value increased from 72% to 86%, whereas the standard deviation dropped from 16% to 7%.
The results of Table 7 show that both the average and standard deviation of the internal temperature after spraying decreased by 1.4 • C. For the internal relative humidity after spraying, the average value increased from 74% to 89%, whereas the standard deviation dropped from 12% to 4%. These results demonstrate that the SMCS could more effectively reduce the internal temperature while increasing the internal relative humidity after spraying than the traditional one, which supports the practicability of the proposed SMCS on greenhouse farms.

Comparison of Resource Consumption between Traditional and Smart Microclimate-Control Systems
Concerning spray-related resources utilization for greenhouse environmental control over the entire investigative period, water consumption could be obtained directly from summing up the amount of spray at each time-step while power consumption would be converted from horsepower and the total operating hours of the sprayers. For spraysimulation purposes, this study adopted the "FH-09 power spray motor" sprayer launched by the Fog Century Environmental Protection and Energy Saving Enterprise Co. Ltd., located in Taichung City, Taiwan. The main specifications of the sprayer are a horsepower of 1.125 kW, a water absorption of 0.15 kg/h, and an applicable area of about 400 to 600 m 2 . Considering the greenhouse investigated in this study occupies an area of 1560 m 2 , it would require three sprayers to cover the entire greenhouse farm. Table 8 compares the traditional and the proposed control systems regarding the resource consumption of spraying for environmental cooling. It is noted that the numbers of the on/off switches of the sprayers associated with the two comparative systems differed slightly (736 times for the traditional system vs. 726 times for the smart system). Therefore, the difference of the two systems in power consumption enabling the switching on/off of the sprayers could be ignored. Under this assumption, the traditional system consumed about 129,478 kg of water and 90 kWh of electric power for greenhouse environmental control during the entire tomato-cultivation period. In contrast, the SMCS only consumed about 42,962 kg of water and 29.8 kWh of electric power. The results demonstrate that the SMCS consumed far fewer resources for spraying than the traditional system, with water-and power-saving rates reaching 66.8%. It was further noticed that early spraying for environmental cooling suggested by the SMCS allowed the wind to blow away excess internal water vapor one hour ahead, leading to a decrease in the internal relative humidity. Spray efficiency is known to be inversely proportional to the internal relative humidity. Therefore, the amount of spray could be reduced due to early spraying.

Evaluation of Hazard Mitigation by the SMCS
This study further evaluated the potential contribution of the proposed SMCS to the governmental greenhouse policy launched in 2016 regarding the construction of 2000 ha of reinforced greenhouses within five years. Taking the agricultural loss in 2020 released by the Council of Agriculture in Taiwan as an example, under the scenario that all 2000 ha of greenhouses could be equipped with the SMCS, the agricultural loss caused by extreme weather events would be significantly reduced by 22% (=2000 (greenhouse area in ha)/9097 (total damaged area in ha)) on average. Besides, resource saving in water and energy would achieve 1,109,918 tons (=((86,516 kg/1560 m 2 ) × 10,000) × 2000 ha/1000) and 771,795 kWh (=((60.2 kWh/1560 m 2 ) × 10,000) × 2000 ha), respectively (Table 8). This suggests the smart greenhouse microclimate-control practice bears high potential for tackling climate change and can significantly promote the nexus synergies among water, energy, and food, especially when encountering extreme weather events.

Conributions of the SMCS
The proposed SMCS makes two main contributions. Firstly, for maintaining an environment suitable for crop growth, the traditional greenhouse-spraying system requires monitoring sensors like IoT devices to detect the internal temperature or relative humidity for switching sprayers on/off. Nevertheless, this may impose the risk of an unsuitable environment on greenhouse farming between two time-steps. For example, the operational time interval was one hour in this study. Even if the greenhouse environment complies with the suitability conditions of crop growth at the current minute, it may violate the suitability conditions in the next minute. In contrast, the SMCS can predict the greenhouse microclimate for the next hour well, thereby spraying in advance to prevent an unsuitable environment for crop growth. Besides, the SMCS avoids using IoT sensors because the extra hardware and maintenance costs of the monitoring devices also place a heavy burden on greenhouse owners. Secondly, the SMCS consumes fewer resources of water and energy (electricity) when spraying for environmental cooling than the traditional method, indicating that the SMCS can mitigate greenhouse-gas emissions. Low resource consumption also represents cost-effectiveness and relatively high profits, leading to more commercial value that can be achieved by the SMCS.
The greenhouse-management practice developed can be applied to crops and areas of interest with adequate modification of the environmental suitability for crop growth. Similar methodology for developing the SMCS can also be applied to different greenhouse types. Future research can consider incorporating crop evapotranspiration, soil-moisture content, nutrients, and fertilization into the SMCS to increase the prediction accuracy of the greenhouse environment and promote crop productivity and quality. Ventilation is also a major factor in the control of greenhouse temperature. In future research, ventilation will be considered by incorporating the greenhouse-control factors (e.g., skylight, roller shades on each wall, and inner shade net) into the proposed water-centric smart microclimate-control system (SMCS) to increase its operational efficiency and effectiveness.

Conclusions
This study proposed a water-centric smart microclimate-control system (SMCS) for greenhouse farming, with a mission to manage the microclimate through efficient spraying for environmental cooling. The SMCS can maintain stable crop productivity when extreme weather events occur. The SMCS can determine the necessity of spraying for environmental cooling according to the predictions of greenhouse internal temperature and relative humidity. The results demonstrate that the SMCS could achieve the same environmental-control effect as the traditional one while consuming far fewer resources for spraying, which makes greenhouse farming move towards carbon-emission mitigation and sustainable management of the water-energy-food nexus. There are four main findings drawn from this study, shown below.
Firstly, the cost of sensor installation is a major concern for farmers in Taiwan, especially concerning device investment and maintenance issues. The BPNN model could (Figure 1) predict greenhouse microclimate based on external climate conditions with less water and energy. After the BPNN model is constructed, this science-based management practice requires no in situ monitoring sensors, which favorably lessens greenhouse owners' investment in environmental control and makes a positive contribution to the overall cost-benefit ratio of greenhouse farming. The physically based model engaging the internal hydro-meteorological process could produce satisfactory accuracy and reliability in estimating greenhouse microclimate, despite it performing slightly worse than the BPNN prediction model.
Secondly, the SMCS could predict the greenhouse internal environment well one hour ahead and spray in advance when needed for environmental cooling, which prevents crops from being exposed to an unsuitable cultivation environment.
Thirdly, the SMCS could achieve savings as high as 66.8% of water and energy compared to the traditional method. Therefore, the SMCS gains more commercial value than the traditional method because low resource consumption means low production cost and relatively high profits.
Fourthly, the reduction in agricultural loss caused by extreme weather events in 2020 would reach 22% if the SMCS could be implemented in 2000 ha of greenhouses (the goal of the governmental greenhouse policy launched in 2016 in Taiwan). This would lead to effective resource saving in water and energy of 1,109,918 tons and 771,795 kWh per year, respectively. This greenhouse-control strategy significantly contributes to environmental sustainability and greenhouse-gas-emission mitigation.
This study suggests a practicability niche in machine-learning-enabled greenhouse automation with improved crop productivity and resource-use efficiency. The proposed SMCS substantially moves greenhouse farming towards the SDGs in the perspectives of food security, natural-resource preservation, and environmental sustainability.