## 5 Comparison and Validation
Taking a closer look at the two predictive models described in Sections 3.1 and 3.2, and based on the results in Table 3, as well as the accuracy rate in Table 4, we used the ensemble average method to increase the accuracy of the forecasting for the classification of nutritional deficiencies in the leaves and fruits of tomato plants. The prediction performance of the ensemble learning is compared with that of both models in Table 5. Accordingly, based on the accuracy and error rates achieved by each predictive result, it is revealed that the ensemble learning technique in our study is more robust than the two previous mentioned methods (see Table 5) used in our study. The 91% achieved by the ensemble is higher than the 87.27% of Inception-ResNet v2 and the 79.09% of Autoencoder for our study. By using this simple method to evaluate the effectiveness of the DL models, we use the confusion matrix to compare the forecast results for both the training and validation datasets. According to Tables 6 and 7, it can be seen that the Inception-ResNet v2 model achieves better evaluation indicators than the Autoencoder model with the training dataset that we collected under greenhouse conditions. For the total of 461 images captured for use as the training dataset, Autoencoder achieves an average accuracy of 95.87% during the model training process. Compared to this value in Table 6, this result reveals that the Inception-ResNet v2 model in this study is stronger than Autoencoder. Table 7 shows the predictive results based on the observed data and the classifier results of Autoencoder for the training dataset. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **Top-3 Accuracy** & **Top-3 Error Rate** & **Epoch** & **Learning Rate** \\ \hline Inception-ResNet v2 & 87.27\% & 12.73\% & 50 & 0.0001 \\ Autoencoder & 79.09\% & 20.91\% & 50 & 0.0001 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Top-3 accuracy and error rates for two forecast models. Figure 10: Cost function profile of both prediction models. (**a**) Inception-ResNet v2; (**b**) Autoencoder. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Model** & **Top-3 Accuracy** & **Top-3 Error** \\ \hline Inception-ResNet v2 & 87.27\% & 12.73\% \\ Autoencoder & 79.09\% & 20.91\% \\ Ensemble & 91\% & 9\% \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Performance of ensemble in comparison with the different model architectures based on CNN. Tables 8 and 9 show the precision when both models were verified using the validation dataset. It is noticeable that Inception-ResNet v2 has a higher accuracy than Autoencoder for the classification of all three observed nutrients. However, in both models, forecast and classification of Nitrogen deficiency has a lower accuracy when compared with the others, with concrete results of around 78.26% for Inception-ResNet v2 and 69.56% for Autoencoder. This is one cause of the bad predictive results when we randomly tested the images of Nitrogen shortage in Figure 7g,h and Figure 9g,h. In addition, according to Table 9, the accuracy of forecasting for Calcium in the Autoencoder model is only 80.32%, so the results in Figure 9a are completely incorrect (see Table 3). previous studies have only focused on the use of machine learning methods to identify and classify the expressions of disease in plants, particularly with respect to tomato plants. Therefore, accurate assessment and forecasting of the early stages of nutrient deficiency is an urgent matter in agricultural sectors, especially in the farming industry working with greenhouse environments. To this end, our study addressed the key issues by comparing and evaluating the effectiveness of the different models based on the CNN structure to predict and classify early and late phenomena resulting from nutrient deficiencies in tomato plants.