## 4 Model Implementation and Evaluation
### Model Implementation

Table 7: The results of multi-classification for the balanced Kvasir v2 dataset. to 17.5 epochs, both the training and validation losses become more stable, with the training loss continuing to decrease slightly and the validation loss leveling off. The validation loss remains slightly higher than the training loss, suggesting that while the model has learned effectively, it may be beginning to overfit the training data. The small gap between the two losses indicates that overfitting is not significant. The stability of the validation loss during this phase is encouraging, showing that the model has reached a point of reasonable generalization. Overall, the model displays positive learning behavior, as evidenced by the consistent decrease in both training and validation losses. For the models ResNet101V2, InceptionV3, and InceptionResNetV2, both the training and validation loss begin at a high level and decrease quickly during the first few epochs. This pattern is common as the models start to recognize the patterns in the training data. Throughout this phase, the training and validation losses are closely aligned, indicating effective learning without overfitting at this stage. As training continues, both losses keep decreasing, although the rate of decline begins to slow down. Around epoch 5, there is a noticeable fluctuation in the validation loss, which may suggest that the models are starting to experience some instability when trying to generalize to new unseen data. This is a typical occurrence during training, especially as models refine their understanding of data. Eventually, both the training and validation losses level off, with training loss showing a gradual decrease while validation loss stabilizes. The small gap between the training and validation losses indicates that the model is not significantly overfitting. However, there is a slight increase in the validation loss toward the end, which could signal an early indication of overfitting if training were to continue for additional epochs. Overall, the models demonstrate good learning behavior, with both training and validation losses decreasing steadily and remaining closely aligned for the majority of the training process. Figure 4: The training and validation loss of the four CNN models for each epoch using the test set with the ILRC. Figure 5 displays the training and validation accuracy for the four models: EfficientNet-B0, ResNet101V2, InceptionV3, and InceptionResNetV2. For EfficientNet-B0, from 0 to 2.5 epochs, both the training and validation accuracy start at low levels and increase rapidly during the initial epochs. The training accuracy climbs quickly, while the validation accuracy experiences more fluctuations, particularly between epochs 1 and 3. The validation accuracy curve shows significant oscillations, indicating that the model is having difficulty generalizing well during the early training stages. This may be attributed to the model's attempts to adapt to the validation data, resulting in varying performance. From 2.5 to 7.5 epochs, the training accuracy continues to improve and eventually stabilizes near 1.0, suggesting that the model is fitting the training data very well. However, the validation accuracy continues to fluctuate significantly, with noticeable increases and decreases. ResNet101V2 performance analysis shows that from 0 to 3 epochs, both the training and validation accuracy start at around 0.6 and increase rapidly. Initially, the training accuracy is slightly lower than the validation accuracy, which is typical as the model begins to adapt to the training data. By about epoch 3, the validation accuracy briefly exceeds the training accuracy, indicating that the model is learning general features that are effective for both datasets. From 3 to 10 epochs, the training accuracy continues to rise, approaching 1.0, which shows that the model fits the training data very well.