# Low-Complexity Microclimate Classification in Smart Greenhouses: A Fuzzy-Neural Approach
## 4 Methodology
### Hybrid Neural Network and Fuzzy Proposed Approach
With reference to tomato plant cultivation, we set the optimal growth thresholds for temperature and humidity according to Table 3, based on [44]. Each cell follows the format [a, b, c], as in Equation (5). Additionally, \(m_{t}\) and \(m_{h}\) represent the global minimum temperature and humidity values in the dataset, while \(M_{t}\) and \(M_{h}\) denote their respective global maximum values, as shown in Table 2. In this \begin{table}
\begin{tabular}{c c c} \hline \hline
**Level** & **Temperature (\({}^{\circ}\)C)** & **Humidity (\%)** \\ \hline Low & [\(m_{t}\), 16, 19] & [\(m_{h}\), 35, 45] \\ \hline Optimal & [18, 24, 30] & [40, 55, 70] \\ \hline High & [29, 32, \(M_{t}\)] & [65, 73, \(M_{h}\)] \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Fuzzy sets thresholds. way, each temperature and humidity value will be associated with a fuzzy set through a specific degree of membership for each membership function, ranging from zero to one. The membership functions constructed in this manner take into account all input values from the dataset, from the minimum to the maximum. To resume, the fuzzy layer consists of six triangular membership functions, each corresponding to a different class of temperature and humidity: low temperature, optimal temperature, high temperature, low humidity, optimal humidity, and high humidity. Using these six membership functions, we defined the final microclimate classifications based on a rule set that combines temperature and humidity membership functions. This rule set uses the values of the membership functions to determine their influence on the final classification. Specifically, the final classification is computed by finding the minimum of the membership degrees for each combination of temperature and humidity membership functions, resulting in nine decision classification degrees, corresponding to the entries of Table 4, excluding Out of Knowledge (OOK). Among the nine decision classification degrees, the maximum is identified and selected as the final classification. If the maximum is zero, the system will return the OOK classification. As detailed in Table 4, the possible final classifications are Optimal, Acceptable, Hostile microclimate conditions, and OOK prediction. An additional advantage of the proposed approach is the ability to output an OOK classification, enhancing the reliability of classifications derived from the FFNN's numerical predictions. It is well known that NNs always generate an output, even in cases where the prediction is unreliable. To mitigate this issue, our approach introduces a dedicated OOK classification when the predicted temperature and/or humidity values do not fall within any of the previously defined triangular fuzzy sets. This prevents the generation of misleading outputs outside the reliability ranges, i.e., the range of values present in the dataset used for training, from which the NN learned the temporal patterns. Finally, to evaluate the overall performance of the proposed approach (FFNN + fuzzy) and the standard approach, we employed the \(F_{1}score\) metric, defined by the following Equation (6):  
\[F_{1}score=\frac{2\,TP}{2\,TP+FP+FN}, \tag{6}\]  
where \(TP=\#True\,Positive\), \(FP=\#False\,Positive\), and \(FN=\#False\,Negative\).