## 3 Materials and Methods  
### Dataset Description  
The Open Science Framework (OSF) has the Kvasir-Capsule dataset [1]. It was created in partnership with the Vestre Viken Health Trust to aid research in computer-assisted diagnosis systems for gastrointestinal endoscopy. The Kvasir-Capsule is a WCE dataset with various labeled images that have been made available to the public. It was made in 2020 and brought up to date in 2021 [15]. The entirety of the dataset's data records is summarized in Table 1. The dataset includes 4,741,621 main data records, comprising 47,238 images with labels, 43 corresponding labeled videos (the videos from which the images were extracted), and 74 un-labeled videos (the videos from which the labeled images were not extracted). Further, 4,694,266 un-labeled images from all of the videos can be extracted. Figure 1 depicts examples of images from the Kvasir-Capsule dataset. Due to unnecessary data duplication, the un-labeled images were not extracted or included in the uploaded data. However, they can be easily extracted from the videos. Videos were gathered from a series of clinical examinations at the Department of Medicine, the Barium Hospital, and the Vestre Viken Hospital Trust in Norway, which \begin{table}
\begin{tabular}{c c} \hline \hline
**Class** & **Image Count** \\ \hline Labeled images & 47,238 \\ Labeled videos & 43 \\ Un-labeled images & 4,694,266 \\ Un-labeled videos & 74 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: A description of the Kvasir-Capsule dataset. Figure 1: Images from the Kvasir-Capsule dataset: (**a**) polyp; (**b**) reduced mucosal; (**c**) pylorus; (**d**) ulcer; (**e**) lymphangiectasia; (**f**) ileococcal valve; (**g**) foreign body; (**h**) erythema; (**i**) erosion; (**j**) blood hematin; (**k**) blood fresh; (**l**) telangiectasia; (**m**) ampulla of Vater; and (**n**) normal clean mucosa. serves 490,000 people and covers about 200,000 of them. At a resolution of 336 \(\times\) 336, the videos were initially recorded at a rate of 2 frames per second. The videos were exported in AVI format using the Olympus system's export tool. It was packed, but the export tool changed the specification for the frame rate to 30 fps [18]. The fourteen distinct classes in this dataset were created by extracting video frames from WCE videos. The fourteen distinct classes are ampulla of Vater (class 0), telangiectasia (class 1), blood fresh (class 2), blood hematin (class 3), erosion (class 4), erythema (class 5), foreign body (class 6), ileococcal valve (class 7), lymphangiectasia (class 8), normal mucosa (class 9), polyp (class 10), pylorus (class 11), reduced mucosal (class 12), and ulcer (class 13) [18]. The samples of the Kvasir-Capsule dataset are individual RGB images with three channels and a dimension of 128 \(\times\) 128 pixels that belong to four distinct classes [23]. Table 1 shows a description of the Kvasir-Capsule dataset. The Kvasir-Capsule dataset is imbalanced because the normal class clean mucosa contains too many images (34,338) in comparison to other class samples. The class ulcer has 854 images; the class reduced mucosal has 2906 images; the class pylorus has 1529; the class polypy has 55 images; the class lymphangiectasia has 592 images; the class ileococcal valve has 4189 images; the class foreign body has 776 images; the class erythema has 159 images; the class erosion has 506 images; the class blood hematin has 12 images; the class blood fresh has 446 images; the class telangiectasia has 866 images; and the class ampulla of Vater has ten images, as shown in Figure 1[18]. We divided the Kvasir-Capsule dataset into three sets: a training set with 26,453 images (70%), a test set with 5669 images (15%), and a validation set with 5668 images (15%). Table 2 presents the number of images for each class in the three sets. The second dataset is the KVASIR v2 dataset [24]. The Kvasir v2 dataset comprises a collection of images that were annotated and verified by medical professionals, specifically experienced endoscopists.