# Automatic Detection of Tomato Diseases Using Deep Transfer Learning
## 3 Results and Discussion  
The performance evaluation was performed in order to gauge and compare the classification capabilities of the various deep transfer learning models using well-known and reflective performance indices. Moreover, the evaluation was repeated for 10 times to account for random choices for the various data subsets. In addition, the time requirements for training/validation were reported for all models under the various setups. Three data split strategies were used (i.e., 50/50, 70/30, and 90/10), which may reveal the abilities of the different models in learning from more data, and any underfitting/overfitting anomalies. Table 1 shows the mean over 10 runs for the overall F1 score, precision, recall, specificity, and MCC using 50% of the data for training. Most models performed exceptionally well with the highest mean F1 score of 98.5% using DenseNet-201. The worst performing model was SqueezeNet with a 90.9% F1 score. These performance values are corroborated by the confusion matrices for the best and worst performing models as shown in Figure 3. The matrix for SqueezeNet shows a problematic trend of misclassifying leaves with diseases as healthy, especially spider mites and target spots. \begin{table}
\begin{tabular}{l c c c c c} \hline \hline
**Model** & **F1 Score** & **Precision** & **Recall** & **Specificity** & **MCC** \\ \hline SqueezeNet & 90.9\% & 91.9\% & 91.2\% & 99.2\% & 0.897 \\ GoogLeNet & 93.6\% & 93.7\% & 93.9\% & 99.5\% & 0.924 \\ Inceptionv3 & 97.9\% & 98.0\% & 97.8\% & 99.8\% & 0.975 \\ DenseNet-201 & 98.5\% & 98.6\% & 98.3\% & 99.9\% & 0.983 \\ MobileNet2 & 96.3\% & 96.5\% & 96.3\% & 99.7\% & 0.958 \\ Resnet01 & 98.3\% & 98.3\% & 98.3\% & 99.9\% & 0.983 \\ Resnet50 & 98.1\% & 98.1\% & 98.2\% & 99.9\% & 0.981 \\ Resnet18 & 97.2\% & 97.4\% & 97.1\% & 99.8\% & 0.969 \\ Xception & 95.8\% & 96.1\% & 95.6\% & 99.7\% & 0.947 \\ ShuffleNet & 96.7\% & 96.6\% & 96.8\% & 99.7\% & 0.991 \\ DarkNet-53 & 98.2\% & 98.4\% & 98.1\% & 99.8\% & 0.982 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The mean overall F1 score, Precision, Recall, Specificity, and MCC using 50% of the data for training. The results are an average of 10 runs. Figure 3: Sample confusion matrices for the best (DenseNet-201) and the worst (SqueezeNet) performing models using 50% of the data for training. (**a**) DenseNet-201; (**b**) SqueezeNet. Further insight into the results is provided by Figure 4, which shows the mean, minimum, and maximum accuracy for all algorithms over 10 randomized runs for the 50/50 data split. Three models (i.e., SqueezeNet, GoogLeNet, and Darknet53) experienced high variability over the 10 random runs in comparison with the other models, which indicates their relative sensitivity to the choice of images included in the training/validations sets. The maximum standard deviation was 2.0% for SqueezeNet. The highest average accuracy was 98.8% for DesneNet-201. Although the number of images is somewhat acceptable considering the corresponding results, it is worthwhile to explore the effect of increasing the size of the training dataset. Deep learning models, in comparison to traditional machine learning algorithms, are well-known to achieve better performance with more data. Table 2 shows the mean over 10 runs for the overall F1 score, precision, recall, specificity, and MCC using 70% of the data for training. All models achieved better performance although with diminishing returns. SqueezeNet improved to 91.8% F1 score and DenseNet201 performed the best with an F1 score of 99.0%. The confusion matrices in Figure 5 corroborate the performance values and reveal a drastically improved diagnosis in comparison with the matrix in Figure 3 with relation to misclassifying spider mites and target spots as healthy. Figure 6 shows the fluctuation of the accuracy results for the eleven models over 10 randomized runs. In comparison to Figure 4, Darknet-53 displayed much less fluctuation with more training data, which means the model had the potential for better learning with more data.