## 4 Model Implementation and Evaluation
### Model Implementation
With an accuracy of 91.3%, the InceptionV3 model correctly predicted 168 images. A total of 174 images were predicted with 94.5% accuracy by the InceptionResNetV2 model. After utilizing the imbalanced small Kvasir-Capsule dataset, we conducted a third experiment where we combined the ILRC process with the four DL models. In this experiment, we implemented under-sampling and data augmentation (over-sampling) techniques on the imbalanced small Kvasir-Capsule dataset. In the balanced Kvasir-Capsule dataset, ten classes of the test set have 200 images. The results of the third experiment for the four CNN models with the balanced Kvasir-Capsule dataset, including EfficientNet-B0, ResNet101v2, InceptionV3, and InceptionRestNetV2, are shown in Table 9. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **Accuracy (\%)** & **Recall (\%)** & **Precision (\%)** & **F1-Score (\%)** \\ \hline EfficientNet-B0 & 99.906 & 99.929 & 99.929 & 99.929 \\ ResNet101V2 & 98.765 & 98.765 & 98.628 & 98.598 \\ InceptionV3 & 98.312 & 97.835 & 98.765 & 98.244 \\ InceptionResNetV2 & 99.344 & 99.500 & 99.509 & 99.500 \\ \hline \hline \end{tabular}
\end{table} 
Table 9: The results of multi-classification for the balanced Kvasir-Capsule dataset using the ILRC. Figure 8: The training and validation accuracy of the four CNN models for each epoch using the imbalanced Kvasir-Capsule dataset. As shown in Table 9, the average accuracy rates for EfficientNet-B0, ResNet101V2, InceptionV3, and InceptionResNetV2 are 99.906%, 98.765%, 98.312%, and 99.344%, respectively. The EfficientNet-B0 model achieved the highest average accuracy, recall, precision, and F1-score, with values of 99.906%, 99.929%, 99.929%, and 99.929%. In contrast, the InceptionV3 model recorded the lowest average accuracy, recall, and F1-score, which are 98.312%, 97.835%, and 98.244%, respectively. Additionally, the ResNet101V2 model had the lowest average precision at 98.628%. The loss and accuracy for each epoch of the validation and training sets are shown in Figures 10 and 11. The EfficientNet-B0 model's training and validation accuracies were close to 100% after epoch 15. The training and validation loss ranged between 0 and 1. The ResNet101V2 model achieved a training accuracy close to 100% and achieved a validation accuracy ranging between 80 and 100%. ResNet101V2's training and validation loss ranged from 0 to 2. The InceptionV3 model had a training and validation accuracy of close to 100%. InceptionV3's training and validation loss ranged from 0 to 2. The InceptionRestNetV2 model was 100% accurate during training and validation, and its training and validation losses were close to 0. Figure 9: The confusion matrices for the CNN models using the imbalanced Kvasir-Capsule dataset. Figure 11: _Cont._  
Figure 10: The loss of the four CNN models for each epoch after balancing the Kvasir-Capsule dataset. Figure 12 shows the confusion matrices for the four CNN models in the balanced test set. There were fourteen classes in the test dataset. Ten classes of the test set have 200 images. With an accuracy of 100%, the EfficientNet-B0 model correctly predicted 200 images out of 200 for the class normal mucosa. With an accuracy of 96%, the ResNet101V2 model correctly predicted 192 images. With an accuracy of 99.5%, the InceptionV3 and InceptionResNetV2 models correctly predicted 199 images. Out of 200 images, the EfficientNet-B0 model correctly predicted 200, achieving an accuracy of 100% for the class ileocecal valve. With an accuracy of 98.5%, the ResNet101V2 model correctly predicted 197 images. With an accuracy of 99.5%, the InceptionV3 and InceptionResNetV2 models correctly predicted 199 images. The EfficientNet-B0 model correctly predicted 200 images out of 200 images for the class pylorus, with an accuracy of 100%. ResNet101V2 correctly predicted 193 images with an accuracy of 96.5%. The InceptionV3 model correctly predicted 190 images with an accuracy of 95%. The InceptionResNetV2 model correctly predicted 193 images with 96.5 percent accuracy.