# A Hybrid Approach for the Detection and Classification of Tomato Leaf Diseases
## 5 Discussion  
The proposed hybrid model was able to separate the data with high accuracy, although different diseases cause similar symptoms, resulting in low-class variance. Furthermore, it avoids overfitting, and resultant validation accuracy is conditional on training accuracy, as shown in Table 6. The biggest challenge related to this hybrid system was to conduct separate training at different stages, as every stage may have different loss functions. We tried different CNN architectures, including VGG16 and ResNet-50, but, finally, ResNet-50 is selected as a backbone for our proposed model due to better accuracy. We also tried different attention techniques and achieved different results but, ultimately, CBAM suited well to our model. It is also worth mentioning that training the entire model from scratch by introducing CNN layers and squared hinge loss function gave us inferior results and needed more epochs to reach acceptable results.  
Although our two-stage hybrid approach is more complex, it improved the learning speed dramatically because we froze the base model layers during the second stage of training, which decreased massively the number of trainable parameters. Most importantly, compared to other techniques, we were able to reach comparable results in a considerably lower number of epochs, which helped us in the early detection of existing diseases. The main improvement in our approach was the speed at which the model was learning, especially during the second stage. However, there is always room for improvement, for example, more than one CBAM attention module can be utilized in the same model. Furthermore, different attention techniques can be combined to achieve better preferences. Additionally, we do not recommend using a deeper network, such as ResNet-101 or ResNet-152, for this under-studied problem.  
Initially, the proposed model is enough to separate the 10 different classes and deepen the network. The performance of the proposed model is compared with some existing research studies, as shown in Table 7. Table 7 compares the performance of existing semantic models that are similar to our system and used the same tomato disease datasets, named PlantVillage, and all of them studied the same number of disease classes (10 diseases). It was found that the results of some studies have better accuracy as compared to ours, but the results of our model could be improved by training more epochs, changing the value of the learning rate and the optimizer, and reducing the dropout ratio. Overall, our model has good overall performance and acceptable diagnostic accuracy, adding the benefit of early detection of tomato leaf diseases.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multicolumn{2}{c}{**Training**} & \multicolumn{2}{c}{**Validation**} \\ \cline{2-5}  & **Loss** & **Accuracy** & **Loss** & **Accuracy** \\ \hline ResNet-50-CBAM (MLP) & 0.108 & 0.9664 & 0.076 & 0.9778 \\ \hline ResNet-50-CBAM (SVM) & 0.087 & 0.9632 & 0.891 & 0.9723 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Training and validation of our two different models with obtained accuracy and loss.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Refs.** & **Algorithm** & **Accuracy** \\ \hline
[2] & EfficientNet-B4 & 99.89\% \\ \hline
[8] & ResNet-50 + SeNet & 96.81\% \\ \hline
[9] & Light weight CNN & 99.69\% \\ \hline
[11] & Hybrid CNN (Hy-CNN) & 98.7\% \\ \hline
[12] & Segmentation-based CNN & 98.49\% \\ \hline
[13] & CNN model & 91.2\% \\ \hline Our Model & ResNet50-CBAM + SVM & 97.2\% \\ \hline \hline \end{tabular}
\end{table}
Table 7: Performance comparison of the proposed model with related work.