# Image Classification of Pests with Residual Neural Network Based on Transfer Learning
## 4 Results and Discussion  
### Results  
Considering the hardware performance and training time, the batch size for both testing and training is set to 32, the test interval and display interval are set to 1 cycle and the maximum number of training rounds is set to 110 cycles. The data of experiment are shown in Table 2.  
Figure 5: Schematic of CutMix.  
We conducted experiments to compare the performance of our proposed scheme with different models. Table 3 presents the results of those models on IP102. Among those models, ResNeXt-50 (32 \(\times\) 4d) achieves the best performance for accuracy, average precision, average recall and average F1 scores, an improvement of 4.95 percentage points on the accuracy of DenseNet121.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Group ID**} & **Learning** & **Data Augmentation** & **Learning Rate** & **Training Loss** & **Test Losses** & **Training Accuracy** & **Testing Accuracy** \\ \hline  
ransfer & & 0.0001 & 0.1768 & 1.5413 & 94.22\% & 73.86\% \\
23 & learning + & B & 0.0005 & 0.2522 & 1.5639 & 91.74\% & 72.33\% \\
24 & Fine-tuning & & 0.0010 & 0.3476 & 1.4343 & 88.96\% & 71.99\% \\
25 & & & **0.0001** & **1.0959** & **0.5157** & **79.11\%** & **86.95\%** \\
26 & & C & 0.0005 & 1.2358 & 0.6788 & 75.64\% & 81.50\% \\
27 & & & 0.0010 & 1.5114 & 0.7895 & 69.26\% & 77.06\% \\ \hline \hline \end{tabular} Note: A, B, and C are data augmentation methods: A means no enhancement to transform the input image into a 224 \(\times\) 224 pixel image; B means basic enhancement with basic transformation operations such as rotation, toning and stretching of the input image; C means CutMix to enhance the input sample image first and then conduct the CutMix operation based on the maximum mixing number of 2. Data enhancement refers to the direct sample modification during the model training, which has no influence on the quantity and distribution of the samples. New learning refers to all parameters of the model being randomly generated, and the model is only trained in the target dataset, transfer learning + freezing refers to the model being pre-trained in similar datasets first, then the pre-training parameters are frozen during the training in the target dataset and only the fully connected output layer is trained; transfer learning + fine-tuning refers to the model being pre-trained in a similar dataset first, and then all the model parameters are trained in the target dataset, including the parameters of the pre-training and the newly added fully connected layers.  
\end{table}
Table 3: The comparison among different proposed models.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multirow{2}{*}{**Accuracy**} & **Average Precision** & **Average Recall** & **Average F1 Score** \\ \hline Densenet121 & 81.55\% & 78.03\% & 73.93\% & 75.92\% \\ Efficientnet-B0 & 80.28\% & 78.75\% & 73.66\% & 76.12\% \\ VGG19 & 78.80\% & 78.21\% & 74.54\% & 76.33\% \\ ResNet-50 & 71.20\% & 70.06\% & 65.39\% & 67.64\% \\ ResNeSt-50 & 80.28\% & 78.47\% & 71.47\% & 74.81\% \\ ResNeXt-50 (32 \(\times\) 4d) & 86.50\% & 84.62\% & 85.55\% & 85.08\% \\ \hline \hline \end{tabular}
\end{table}
Table 2: Loss and accuracy of model training and test.