# The Lightweight Deep Learning Model in Sunflower Disease Identification: A Comparative Study
## 2 Materials and Methods
### Experiments Settings and Performance Evaluation Methods  
In this study, our main objective was to find an optimized model among these lightweight models that could classify and identify sunflower disease images effectively. When comparing various models, it was necessary to use the same hyper-parameters, software platform, and evaluation methods. Therefore, we chose to run the program on the GPU server V100S with the CUDA 12.1. The version of the Python environment was 3.10. The python Torch version was 2.1, and the Torch Vision version was 0.16. The hyper-parameters of models were set according to Table 5. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Model Name** & **\# of Params (M)** & **Top-1 Acc (\%)** \\ \hline SqueezeNet [33] & 4.76 & 57.5 \\ ShuffleNetV2 (1x) [35] & 8.69 & 69.4 \\ MnasNet-A1 [36] & 3.9 & 75.2 \\ MobileNetV3-Small [39] & 2.9 & 67.4 \\ EfficientNetV2-Small [41] & 22 & 83.9 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The performance of five lightweight deep learning models on ImageNet: # of Params, number of trainable parameters; Top-1 Acc, the top-1 accuracy on the ImageNet validation set. Figure 8: The architecture of EfficientNetV2-Small and the modules: (**a**) the architecture of EfficientNetV2-Small, (**b**) the MBConv module, and (**c**) the Fused-MBConv module. To measure the performance of the model in classifying sunflower disease images, we selected accuracy, precision, recall, and F1 score as metrics. During the model testing, we could obtain the results of the classification. In a binary classification task, if the true label of a sample was positive and the model also predicted it as positive, then this sample belonged to a true positive (TP). If the true label of a sample was negative and the model also predicted it as negative, then this sample belonged to a true negative (TN). If the true label of a sample was positive but the model incorrectly predicted it as negative, then this sample belonged to a false negative (FN). If the true label of a sample was negative but the model incorrectly predicted it as positive, then this sample belonged to a false positive (FP). In a multi-class classification task, the concepts of TP, TN, FN, and FP were similar to those in a binary classification problem, but they needed to be calculated separately for each class. In our task, there were four classes in the dataset, so after model testing, each sample received a recognition result. These results could be entered in a table to form a confusion matrix as shown in Table 6.  
In Table 6, each element \(\mathrm{C_{ij}}\) represents the number of samples whose true label is class i but are predicted as class j. From the confusion matrix, the values of \(\mathrm{TP_{i}}\), \(\mathrm{TN_{i}}\), \(\mathrm{FN_{i}}\), and \(\mathrm{FP_{i}}\) for class i could be extracted as shown in Equations (1)-(4). \[\mathrm{TP_{i}}=\mathrm{C_{ii}} \tag{1}\]  
\[\mathrm{TN_{i}}=\sum_{j\
eq i}\mathrm{C_{ij}} \tag{2}\]  
\[\mathrm{FP_{i}}=\sum_{j\
eq i}\mathrm{C_{ji}} \tag{3}\]  
\[\mathrm{FN_{i}}=\left(\sum_{i=1}^{4}\sum_{j=1}^{4}\mathrm{C_{ij}}\right)- \mathrm{TP_{i}}-\mathrm{TN_{i}}-\mathrm{FP_{i}} \tag{4}\]  
The model accuracy refers to the ratio of the number of samples that are accurately identified to the total number of samples, and the formula is shown as Equation (5). For each class, precision, also known as the precision rate, represents the proportion of samples that are actually positive among those predicted as positive, and the formula is shown as Equation (6). Recall, also known as the recall rate, represents the proportion of samples that are predicted as positive among those that are actually positive, and the formula is shown as Equation (7). The F1 score is the harmonic mean of precision and recall, and the calculation method is shown as Equation (8). The i in Equations (6)-(8) represents the ith class.