## 4 Model Implementation and Evaluation
### Model Implementation
Table 8 shows the results of the second experiment conducted with EfficientNet-B0, ResNet101V2, InceptionV3, and InceptionResNetV2. In this experiment, we integrated the ILRC process with the four DL models. The Kvasir-Capsule dataset was utilized to evaluate the performance of the models prior to implementing under-sampling and data augmentation techniques. For multi-classification, we used the four CNN models on the Kvasir-Capsule dataset to distinguish images from fourteen distinct classes named normal mucosa, ampulla of Vater, telangiectasia, blood fresh, blood hematin, erosion, erythema, foreign body, ileocecal valve, lymphangiectasia, polyp, pylorus, reduced mucosal, and ulcer. According to Table 8, the accuracy averages of EfficientNet-B0, ResNet101V2, InceptionV3, and InceptionResNetV2 were, respectively, 99.295%, 98.413%, 97.354%, and 98.765%. Accuracy, recall, precision, and F1-score averages were all the highest in the EfficientNet-B0 model, with 99.295%, 99.306%, 99.295%, and 99.261%, respectively. Accuracy, recall, precision, and F1-score averages were all the lowest in the InceptionV3 model, with 97.354%, 97.363%, 97.354%, and 97.091%, respectively. Figures 7 and 8 illustrate the loss and accuracy for each epoch of both the validation and training datasets. After approximately epoch 17.5, the training accuracy of the EfficientNet-B0 model neared 100%, while the validation accuracy surpassed 98%. The training and validation losses were comparable, fluctuating between 0.0 and 0.5. For the ResNet101V2 model, both the training and validation accuracies exceeded 95%, with losses ranging from 0.0 to 1. The InceptionV3 model achieved a training accuracy of over 98%, with validation accuracy also at 98%. The training and validation losses for InceptionV3 varied between 0.0 and 1. The InceptionRestNetV2 model recorded training and validation accuracies above 95%, with losses also falling within the range of 0.0 to 1. Figure 6: The confusion matrices for the four CNN models using the test set with the ILRC. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **Accuracy (\%)** & **Recall (\%)** & **Precision (\%)** & **F1-Score (\%)** \\ \hline EfficientNet-B0 & 99.295 & 99.306 & 99.295 & 99.261 \\ ResNet101V2 & 98.413 & 98.445 & 98.413 & 98.384 \\ InceptionV3 & 97.354 & 97.363 & 97.354 & 97.091 \\ InceptionResNetV2 & 98.765 & 98.628 & 98.765 & 98.598 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: The results of multi-classification for the imbalanced Kvasir-Capsule dataset using the ILRC. Figure 8: _Cont_. Figure 7: The training and validation loss of the four CNN models for each epoch using the imbalanced Kvasir-Capsule dataset. The confusion matrices for the four CNN models in the imbalanced test set are depicted in Figure 9. The test dataset was divided into fourteen categories: normal mucosa (4121 images), ampulla of Vater (1 image), telangiectasia (104 images), blood fresh (53 images), blood hematin (1 image), erosion (61 images), erythema (19 images), foreign body (93 images), ileococal valve (503 images), lymphangiectasia (71 images), polyp (6 images), pylorus (184 images), reduced mucosal (349 images), and ulcer (103 images). With an accuracy of 99.8%, EfficientNet-B0 correctly predicted 4115 images out of 4121 for the class normal mucosa. With an accuracy of 99.2%, the ResNet101V2 model correctly predicted 4092 images. With an accuracy of 99.5%, the InceptionV3 model correctly predicted 4101 images. The InceptionResNetV2 model was 99.8% accurate and correctly predicted 4116 images. The EfficientNet-B0 model correctly predicted 493 images out of 503, giving it an accuracy of 98% for the class ileococal valve. The ResNet101V2 and InceptionV3 models correctly predicted 481 images, giving them an accuracy of 95.6%. The InceptionResNetV2 model was 97% accurate in predicting 488 images. Out of 184 images, the EfficientNet-B0 model correctly predicted 175, achieving an accuracy of 95.1% for the class pylorus. With an accuracy of 84.2%, ResNet101V2 correctly predicted 155 images.