WorksComputer Science
Rethinking Evaluation for Video Capsule Endoscopy: Validation Protocol, Source-Video Diversity, and Cross-Dataset Shift
Abstract
Automated video capsule endoscopy (VCE) classification remains challenging due to severe class imbalance, limited source-video diversity, and variations in image appearance across datasets. Although deep learning models have demonstrated promising performance on established benchmarks, their reliability under different validation protocols and external dataset shift remains insufficiently understood. In this work, we introduce DMSNet, a deformable adaptive multi-scale edge-guided attention network integrating adaptive multi-scale feature fusion, deformable lesion refinement, edge-guided attention, and sparse feature selection. We benchmark DMSNet against 18 representative convolutional, transformer-based, and pretrained vision architectures on Kvasir-Capsule under random frame-level and source-video-disjoint validation protocols. We further identify source-video overlap between the original training and test splits and evaluate model performance on both the complete test set and a source-video-disjoint subset. Under random frame-level validation, DMSNet achieves an MCC of 0.442 0.020 on complete test set and 0.456 0.037 on the source-video-disjoint subset. On the external CV2024 dataset, ConvNeXt-Tiny achieves the highest MCC of 0.207, while performance degrades substantially across architectures relative to in-domain evaluation. We further investigate source-video diversity using a per-class cap of 200 training frames. With the total training-set size held fixed, increasing the maximum source-video coverage from four to eight improves MCC for 17 of 19 evaluated architectures. Overall, these findings demonstrate that model rankings and classification performance depend substantially on evaluation protocol, training-source diversity, and cross-dataset shift, emphasizing the need for source-aware validation and rigorous external evaluation of VCE classification systems.
Introduction
Video capsule endoscopy (VCE) is a non-invasive imaging technique that enables visualization of the gastrointestinal (GI) tract, particularly regions such as the small intestine that are difficult to examine using conventional endoscopy. During an examination, a swallowable capsule equipped with a miniature camera captures tens of thousands of images, allowing clinicians to identify abnormalities such as ulcers, erosions, and angiectasia. However, reviewing such large volumes of image data is time-consuming and places a substantial workload on gastroenterologists. The large number of frames, together with subtle pathological findings and variations in image quality, also makes reliable interpretation challenging. Consequently, computer-aided diagnosis (CAD) systems have received increasing attention as a means of supporting efficient and consistent VCE image analysis. Recent advances in convolutional neural networks (CNNs), vision transformers (ViTs), and large-scale pretrained vision models have substantially improved classification performance. CNN-based architectures He et al. [ [12], Howard et al. [ [13], Huang et al. [ [15], Radosavovic et al. [ [26], Tan and Le [ [31, 32], Woo et al. [ [39], Liu et al. [ [22] effectively capture local spatial features, while vision transformer-based models Dosovitskiy et al. [ [6], Tu et al. [ [35], Touvron et al. [ [34], Liu et al. [ [20, 21] offer stronger global context modeling through self-attention. More recently, self-supervised foundation models Siméoni et al. [ [27], Fang et al. [ [7], Wang et al. [ [37] pretrained on large-scale natural images or on endoscopic data have demonstrated promising transfer capabilities. However, strong performance under conventional frame-level validation does not necessarily indicate reliable generalization in video capsule endoscopy. Frames originating from the same source video can exhibit substantial visual redundancy, while individual gastrointestinal findings may be represented by only a limited number of independent source videos. Consequently, the number of annotated frames alone may not accurately reflect the diversity available for learning generalizable representations. Random frame-level partitioning can place highly correlated frames from the same source video in both the training and validation sets. Moreover, strong performance on an in-domain benchmark may not translate to the data collected under different acquisition protocols. These considerations motivate a broader investigation of how model architecture, validation strategy, and source-video diversity influence measured generalization in VCE classification. In this work, we investigate VCE classification from both architectural and generalization perspectives. We introduce DMSNet, a deformable multi-scale network built on an EfficientNetV2-S Tan and Le [ [31] backbone. The proposed architecture integrates adaptive multi-scale feature fusion, deformable lesion refinement, edge-guided attention, and sparse feature selection to capture complementary spatial and semantic representations. Unlike conventional fixed feature aggregation, the adaptive fusion module learns input-dependent weights for combining features extracted at different backbone stages. We evaluate DMSNet alongside 18 representative CNN, transformer, and pretrained vision architectures using random frame-level and source-video-disjoint validation strategies on Kvasir-Capsule. In addition to comparing validation protocols, we examine performance on both the original test set and a source-video-disjoint test subset obtained by excluding frames whose source-video identifiers overlap with those in the training fold. We further investigate source-video diversity by imposing a per-class cap of 200 training frames and varying the maximum number of source videos from one to eight. Although data-limited classes may not always reach the frame cap, the four- and eight-video settings contain the same total number of training frames, enabling the cleanest comparison of broader source-video coverage without increasing the overall training-set size. Finally, we assess cross-dataset generalization on the eight categories shared between Kvasir-Capsule and CV2024.
The main contributions of this work are as follows:
We conduct a systematic evaluation of DMSNet and 18 representative CNN, transformer, and pretrained vision architectures under random frame-level and source-video-disjoint validation. We further compare their performance on the original Kvasir-Capsule test set and a source-video-disjoint test subset, demonstrating how evaluation protocols influence model rankings and class-wise performance
We study source-video diversity across 19 architectures and show that, with the total training-set size fixed at 2,010 frames, increasing the maximum source-video coverage from four to eight improves mean MCC for 17 of 19 models. A paired one-sided Wilcoxon signed-rank test confirms a significant positive shift across architectures.
We evaluate Kvasir-Capsule-trained models on the eight categories shared with CV2024 and observe substantial cross-dataset performance degradation, showing that strong in-domain performance does not consistently translate to stronger external performance.
We introduce DMSNet, a competitive deformable multi-scale edge-guided attention network combining multi-scale feature fusion, deformable refinement, edge-guided attention, and sparse feature selection.
Related Work
Deep Learning for Capsule Endoscopy
Deep learning has been widely adopted for automated classification of gastrointestinal findings in video capsule endoscopy (VCE). Kvasir-Capsule Smedsrud et al. [ [28] is a common benchmark, with subsequent work exploring focal modulation Srivastava et al. [ [29], explainable AI Varam et al. [ [36], binary classification Oukdach et al. [ [25], and semi-supervised learning Muruganantham and Balakrishnan [ [24]. CNNs, vision transformers such as ViT Dosovitskiy et al. [ [6] and DeiT Touvron et al. [ [33], and pretrained models including DINOv3 Siméoni et al. [ [27], EVA-02 Fang et al. [ [7], and Endo-FM Wang et al. [ [37] have all been investigated for visual representation learning. Despite these advances, VCE classification remains challenging because of severe class imbalance and limited independent source-video diversity.
Imbalanced and Multi-Scale Feature Learning
Class imbalance is a persistent challenge in medical imaging. Common strategies include over-sampling Krawczyk et al. [ [17], Asaduzzaman et al. [ [1], He et al. [ [10], Chawla et al. [ [4], focal loss Lin et al. [ [19], class-balanced loss Cui et al. [ [5], LDAM Cao et al. [ [3], logit adjustment Zhang et al. [ [40], and classifier re-training Kang et al. [ [16], Lu et al. [ [23]. In medical video datasets, however, large frame counts do not necessarily imply high independent sample diversity because many visually similar frames may originate from the same recording. Complementary architectural work has investigated multi-scale and attention-based feature learning using spatial pyramids He et al. [ [11], Lin et al. [ [18], Zhao et al. [ [41], channel and spatial attention Hu et al. [ [14], Woo et al. [ [38], and deformable convolutions Dai et al. [2017], Zhu et al. [ [42]. DMSNet builds on these ideas by combining multi-scale adaptive feature fusion, deformable refinement, edge-guided attention, and sparse feature selection.
Evaluation Protocol and Model Selection
The importance of grouping correlated medical images during dataset partitioning is well established. Tampu et al. [ [30] showed that per-image splitting of correlated OCT images can inflate estimated performance relative to subject-wise partitioning, while Bussola et al. [ [2] reported similar leakage effects in digital pathology. In VCE, we therefore use source-video grouping as the available unit of independence. Our contribution is not to rediscover image-level leakage, but to quantify how validation strategy changes relative model rankings and conclusions across VCE architectures. Concurrent work Hanson and Jha [ [9] studies cross-target model-selection instability by evaluating 11 pretrained backbones across Kvasir-Capsule, CV2024, and Galar. In our study, we compare random frame-level and source-video-disjoint validation within Kvasir-Capsule, control source-video diversity under a capped frame budget, and evaluate the resulting models under external shift on CV2024.
Methodology
Backbone and Adaptive Multi-Scale Feature Fusion
We adopt EfficientNetV2-S as the feature extraction backbone. Given an input image , features are extracted from four stages of increasing depth:
where denotes the EfficientNetV2-S backbone. Shallow features retain fine-grained spatial and boundary information, whereas deeper features encode higher-level semantic representations. Figure 1 illustrates the overall architecture of the proposed framework, consisting of six major components: EfficientNetV2-S backbone, Adaptive Multi-Scale Feature Fusion (AMSFF), Deformable Lesion Refinement (DLR), Edge-Guided Attention (EGA), Sparse Feature Selection (SFS), and the final classification head.

Figure 1. Overall architecture of the proposed DMSNet framework.
To integrate information from different feature extraction stages, we implement an adaptive fusion mechanism that dynamically determines the contribution of each scale. First, each backbone feature map is projected to a channel dimension of 256 using a convolution–BatchNorm-SiLU block. The projected features are then aligned through bilinear interpolation to the spatial resolution of the second selected backbone feature map:
where and denote the spatial dimensions of .
Rather than concatenating the aligned features, the proposed module learns an input-dependent importance weight for each scale. A global average pooling operation generates a channel descriptor for each aligned feature map, which is subsequently passed through a scale-specific linear layer:
where represents the importance score of the -th scale. The scores are normalized using a softmax function:
where denotes the normalized contribution of the -th feature scale. The aligned representations are then aggregated through weighted summation:
To further refine the spatial information within the fused representation, a spatial attention mechanism is applied. Channel-wise average and maximum pooling are performed on , and the resulting spatial descriptors are concatenated and processed using a convolution followed by a sigmoid activation:
where and denote channel-wise average and maximum pooling, respectively. The spatially attended representation is computed as
Finally, the attended features are processed using two successive convolutional blocks. The first block includes BatchNorm and SiLU activation, while the second includes BatchNorm without an activation. A residual connection from the original weighted fused representation is used to preserve the aggregated multi-scale information:
where denotes the two-block convolutional refinement operation. The resulting feature representation contains 256 channels at the spatial resolution of the second selected backbone feature map.
Deformable Lesion Refinement
Gastrointestinal abnormalities often exhibit irregular shapes and boundaries. To adapt the receptive field to such spatial variations, we apply deformable convolution Dai et al. [2017] to the fused representation:
where denotes the regular sampling location and is a learned offset. The deformable representation is combined with the original fused features through a residual connection,
Edge-Guided Attention
To incorporate explicit boundary information, the input image is converted to grayscale and processed using Sobel operators. The resulting edge magnitude is passed through a lightweight convolutional branch to generate a spatial attention map:
where denotes the convolutional attention branch, is the sigmoid function, and denotes elementwise multiplication. The residual formulation emphasizes boundary-aware regions while preserving the underlying semantic representation.
Sparse Feature Selection and Classification
The feature representation is summarized by combining Global Average Pooling (GAP) and Global Max Pooling (GMP):
A two-layer gating network then produces a feature-selection mask,
where denotes the SiLU activation. The gated representation is passed to a linear classifier to produce logits for the classes:
The network is optimized using focal loss together with mean gate-activation sparsity penalty,
where denotes the -th sigmoid gate activation and is the number of gated feature dimensions. We set in all DMSNet experiments. The sparsity term penalizes the mean gate activation, encouraging suppression of less relevant feature dimensions.
Experiments
We evaluate DMSNet and 18 representative CNN, transformer, and pretrained vision architectures under three experimental settings: (1) in-domain evaluation on Kvasir-Capsule using random frame-level and source-video-disjoint validation, with performance assessed on both the original test set and a source-video-disjoint test subset; (2) a controlled source-video diversity study with a per-class cap of 200 training frames; and (3) cross-dataset evaluation on CV2024 using eight shared categories.
Datasets
Kvasir-Capsule
Kvasir-Capsule contains 47,238 labeled frames from 14 original categories. We construct an 11-class task by retaining Blood-fresh as Blood and excluding Blood-hematin, Ampulla of Vater, and Polyp. The resulting classes are Normal, Pylorus, Ileo-cecal Valve, Angiectasia, Blood, Erosion, Erythematous, Foreign Bodies, Lymphangiectasia, Reduced Mucosal View, and Ulcer. Source-video identifiers are extracted from frame filenames and used to construct group-aware data partitions. In this study, source-video identifiers correspond to individual VCE recordings rather than verified patient identities; therefore, source-video-disjoint partitioning does not necessarily imply patient-level independence.
CV2024
For external evaluation, we use the independent test set of CV2024 Handa et al. [ [8], collected at the All India Institute of Medical Sciences (AIIMS), India. Although the CV2024 training set includes Kvasir-Capsule data, its test set comprises independently collected AIIMS data. Evaluation is restricted to the eight semantically corresponding classes shared between the two datasets, with the complete label mapping provided in the supplementary material.
Models and Training Setup
We compare DMSNet with 18 representative CNN, transformer, and pretrained vision architectures. The complete model list and implementation details are provided in the supplementary material. All baseline models were fully fine-tuned on the target training set. DINOv3, Endo-FM, and ViT-L/16 (MAE) were evaluated using a linear probing protocol, where the pretrained backbone was frozen and only a linear classification head was trained. All models use inputs and are trained with AdamW (batch size 16, learning rate , weight decay ) for up to 100 epochs, with early stopping based on validation MCC. For the controlled architecture comparison, all models including DMSNet are trained using unweighted focal loss with . All experiments are repeated using three random seeds (41, 42, and 43), and results are reported as mean standard deviation.
Validation strategies
Random frame-level validation
Frames from the official Kvasir-Capsule training pool are randomly partitioned into training and validation subsets. Since the partition is performed at the frame level, visually correlated frames originating from the same source video may occur in both training and validation sets.
Source-Video-Disjoint Validation and Test Evaluation
To mitigate potential data leakage arising from shared source videos, we adopt source-video-disjoint validation and test evaluation. For validation, all frames from a given source video are assigned to a single partition. Within the official Kvasir-Capsule training pool, Blood, Erythematous, Lymphangiectasia, and Ulcer each originate from a single source video, while Foreign Bodies originates from two. These rare classes are therefore retained entirely in training. The remaining multi-video classes are partitioned using four-fold StratifiedGroupKFold, with source-video identifiers as grouping variables, yielding 15 training and 4 validation videos with no source-video overlap. Since five rare classes are absent from validation, validation MCC is used for early stopping and checkpoint selection rather than as a comprehensive estimate of 11-class performance. Additionally, an examination of the official Kvasir-Capsule splits revealed that seven source-video identifiers are shared between the official training and test sets, accounting for approximately 22% of the original test frames. To assess generalization without source-video overlap, we construct a source-video-disjoint test subset by excluding test frames associated with these shared identifiers. The resulting subset contains approximately 18,000 frames, with no source-video identifiers shared with the training set. All models are evaluated on both the full official test set and the source-video-disjoint test subset. Figure 2 illustrates the class distributions and label availability across random and source-video-disjoint training/validation partitions, the full official test set, and the source-video-disjoint test subset. While random validation includes all 11 classes, source-video-disjoint validation contains only six, as recordings from five rare classes are retained in training. Both test partitions preserve all 11 classes, although excluding overlapping source videos alters their class distributions.

Figure 2. Class distribution and label availability across Kvasir-Capsule partitions. (A) Frame counts are annotated within each cell, with color representing the within-partition class proportion using square-root color scaling. (B) Class availability across random and source-video-disjoint training/validation partitions, the full official test set, and the source-unseen test subset. Source-video-disjoint validation contains six of the eleven classes, whereas both test partitions retain all eleven classes.
Source-Video Diversity Experiment
We vary the maximum number of source videos sampled per class and seed as . Training is capped at 200 frames per class, distributed as evenly as possible across the selected videos; when fewer frames are available, all are retained. The resulting training sets contain 1434, 1723, 2010, and 2010 frames for and , respectively. Thus, lower- comparisons vary in both frame count and source-video coverage, whereas versus provides the cleanest controlled comparison at a fixed total of 2010 frames. Only 5 of 11 classes contain more than four source videos, so this comparison changes source-video coverage only for those classes. Complete results are provided in the supplementary material.
Cross-Dataset Evaluation
To assess external generalization, models trained on Kvasir-Capsule dataset using random frame-level validation are evaluated on held out test set of CV2024 dataset. CV2024 although uses mixed-source training data, they have seperate private held-out test set. Evaluation is restricted to the eight categories shared by the two datasets. The three Kvasir-Capsule classes that are absent in CV2024: Ileo-cecal Valve, Pylorus, and Reduced Mucosal View are masked from the prediction space before the final argmax, restricting predictions to the eight shared categories.
Evaluation Metrics
The performance of the proposed DMSNet and the baseline models was evaluated using four widely adopted classification metrics: Matthews Correlation Coefficient (MCC), macro recall, macro F1-score, and overall accuracy.
Results
Computational Efficiency
Table 1 compares the computational requirements of the evaluated architectures. DMSNet contains 22.01M parameters and requires 7.561 GFLOPs per frame, while achieving 565 frames/s and 1.770 ms per-image latency on a single NVIDIA Tesla V100. Although lightweight CNNs are more efficient, DMSNet remains computationally lighter than several larger transformer-based models, supporting its practical use for large-scale VCE frame analysis.
| Model | Params (M) | Trainable (M) | GFLOPs | Throughput | Latency (ms/img) |
| ResNet50 | 23.53 | 23.53 | 8.26 | 1000/s | 1.000 |
| MobileNetV3-L | 4.22 | 4.22 | 0.43 | 2642/s | 0.378 |
| DenseNet-121 | 6.97 | 6.97 | 5.67 | 851/s | 1.176 |
| RegNetY-16GF | 80.60 | 80.60 | 31.82 | 265/s | 3.781 |
| EfficientNetV2-S | 20.19 | 20.19 | 5.42 | 897/s | 1.115 |
| ConvNeXtV2 | 87.70 | 87.70 | 30.71 | 234/s | 4.278 |
| ConvNeXt-Tiny | 27.83 | 27.83 | 8.91 | 797/s | 1.254 |
| ViT-B/16 | 85.81 | 85.81 | 33.70 | 310/s | 3.229 |
| MaxViT | 118.71 | 118.71 | 46.69 | 134/s | 7.461 |
| ViT-L/16 (MAE) | 303.31 | 0.01 | 119.29 | 92/s | 10.819 |
| DeiT | 85.82 | 85.82 | 33.70 | 304/s | 3.288 |
| CaiT-S24 | 46.54 | 46.54 | 17.27 | 312/s | 3.202 |
| SwinV1 | 86.75 | 86.75 | 30.34 | 249/s | 4.010 |
| SwinV2 | 48.93 | 48.93 | 17.68 | 352/s | 2.844 |
| DINOv3 | 85.65 | 0.01 | 34.37 | 278/s | 3.599 |
| Endo-FM | 121.27 | 0.01 | 47.61 | 201/s | 4.986 |
| EVA-02 | 85.77 | 85.77 | 43.89 | 191/s | 5.239 |
| DMSNet | 22.01 | 22.01 | 7.561 | 565/s | 1.770 |
Table 1. Computational efficiency comparison at input resolution. Computational cost is estimated using THOP and reported as GFLOPs with the convention MAC = FLOPs. Throughput and per-image latency are measured on a single NVIDIA Tesla V100 GPU.
In-Domain Benchmark and Validation Strategy
Table 2 compares DMSNet with 18 representative architectures under random frame-level and source-video-disjoint validation. In both settings, models are evaluated on the full official Kvasir-Capsule test set. Under random frame-level validation, DMSNet achieves the highest MCC of 0.442 ± 0.020, followed by Swin-V1 (0.417 ± 0.019) and DINOv3 (0.407 ± 0.002). DMSNet also achieves a macro recall of 0.321 ± 0.016 and a macro F1-score of 0.325 ± 0.015. Under source-video-disjoint validation, MaxViT achieves the highest MCC of 0.452 ± 0.026, while DMSNet obtains 0.426 ± 0.050. Model performance varies across validation strategies, indicating that model rankings are sensitive to the validation protocol. Table 3 reports the corresponding results on the source-video-disjoint test subset, constructed by excluding recordings whose source-video identifiers overlap with the original training set. Under random frame-level validation, DMSNet achieves an MCC of 0.456 ± 0.037, macro recall of 0.289 ± 0.029, and macro F1-score of 0.272 ± 0.033. DINOv3 obtains
| Model | Random Validation Split | Source-Video-Disjoint Validation Split | ||||||
| MCC | Recall | F1 | Acc. | MCC | Recall | F1 | Acc. | |
| ResNet50 | 0.347 ± 0.021 | 0.266 ± 0.022 | 0.241 ± 0.008 | 0.690 ± 0.012 | 0.302 ± 0.020 | 0.199 ± 0.005 | 0.184 ± 0.000 | 0.690 ± 0.002 |
| MobileNetV3-L | 0.386 ± 0.022 | 0.258 ± 0.011 | 0.251 ± 0.004 | 0.711 ± 0.004 | 0.369 ± 0.031 | 0.246 ± 0.023 | 0.226 ± 0.020 | 0.700 ± 0.011 |
| DenseNet-121 | 0.375 ± 0.013 | 0.253 ± 0.012 | 0.233 ± 0.004 | 0.694 ± 0.011 | 0.367 ± 0.014 | 0.255 ± 0.011 | 0.232 ± 0.011 | 0.698 ± 0.005 |
| RegNetY-16GF | 0.369 ± 0.018 | 0.289 ± 0.012 | 0.278 ± 0.002 | 0.700 ± 0.010 | 0.367 ± 0.057 | 0.272 ± 0.023 | 0.247 ± 0.030 | 0.691 ± 0.027 |
| EfficientNetV2-S | 0.398 ± 0.028 | 0.278 ± 0.008 | 0.278 ± 0.010 | 0.720 ± 0.011 | 0.388 ± 0.016 | 0.266 ± 0.020 | 0.265 ± 0.030 | 0.720 ± 0.007 |
| EfficientNet-B7 | 0.397 ± 0.027 | 0.296 ± 0.032 | 0.272 ± 0.035 | 0.713 ± 0.024 | 0.426 ± 0.049 | 0.308 ± 0.029 | 0.285 ± 0.034 | 0.720 ± 0.026 |
| ConvNeXtV2 | 0.335 ± 0.016 | 0.240 ± 0.025 | 0.223 ± 0.010 | 0.694 ± 0.008 | 0.319 ± 0.022 | 0.225 ± 0.014 | 0.235 ± 0.020 | 0.713 ± 0.006 |
| ConvNeXt-Tiny | 0.396 ± 0.018 | 0.280 ± 0.022 | 0.279 ± 0.020 | 0.721 ± 0.007 | 0.390 ± 0.029 | 0.266 ± 0.027 | 0.286 ± 0.036 | 0.729 ± 0.013 |
| ViT-B/16 | 0.327 ± 0.027 | 0.255 ± 0.024 | 0.245 ± 0.017 | 0.698 ± 0.003 | 0.283 ± 0.025 | 0.237 ± 0.036 | 0.219 ± 0.043 | 0.676 ± 0.015 |
| MaxViT | 0.398 ± 0.024 | 0.278 ± 0.010 | 0.288 ± 0.013 | 0.728 ± 0.005 | 0.452 ± 0.026 | 0.312 ± 0.014 | 0.307 ± 0.016 | 0.730 ± 0.023 |
| ViT-L/16 (MAE) | 0.150 ± 0.004 | 0.113 ± 0.002 | 0.113 ± 0.003 | 0.686 ± 0.000 | 0.174 ± 0.006 | 0.119 ± 0.001 | 0.118 ± 0.000 | 0.695 ± 0.002 |
| DeiT | 0.347 ± 0.019 | 0.235 ± 0.017 | 0.240 ± 0.019 | 0.709 ± 0.010 | 0.301 ± 0.012 | 0.224 ± 0.009 | 0.223 ± 0.013 | 0.695 ± 0.020 |
| CaiT-S24 | 0.374 ± 0.011 | 0.269 ± 0.037 | 0.276 ± 0.030 | 0.724 ± 0.006 | 0.377 ± 0.034 | 0.250 ± 0.031 | 0.262 ± 0.036 | 0.728 ± 0.011 |
| SwinV1 | 0.417 ± 0.019 | 0.273 ± 0.041 | 0.269 ± 0.029 | 0.732 ± 0.005 | 0.365 ± 0.046 | 0.245 ± 0.032 | 0.256 ± 0.031 | 0.717 ± 0.013 |
| SwinV2 | 0.378 ± 0.036 | 0.235 ± 0.004 | 0.255 ± 0.009 | 0.726 ± 0.009 | 0.372 ± 0.041 | 0.245 ± 0.030 | 0.248 ± 0.032 | 0.718 ± 0.012 |
| DINOv3 | 0.407 ± 0.002 | 0.229 ± 0.002 | 0.235 ± 0.002 | 0.736 ± 0.001 | 0.307 ± 0.047 | 0.160 ± 0.035 | 0.165 ± 0.031 | 0.712 ± 0.005 |
| Endo-FM | 0.303 ± 0.007 | 0.192 ± 0.005 | 0.198 ± 0.003 | 0.697 ± 0.001 | 0.295 ± 0.021 | 0.178 ± 0.015 | 0.180 ± 0.013 | 0.700 ± 0.001 |
| EVA-02 | 0.315 ± 0.008 | 0.203 ± 0.013 | 0.199 ± 0.010 | 0.698 ± 0.003 | 0.313 ± 0.019 | 0.283 ± 0.060 | 0.239 ± 0.049 | 0.689 ± 0.017 |
| DMSNet | 0.442 ± 0.020 | 0.321 ± 0.016 | 0.325 ± 0.015 | 0.740 ± 0.007 | 0.426 ± 0.050 | 0.299 ± 0.024 | 0.290 ± 0.026 | 0.724 ± 0.025 |
Table 2. Performance comparison under random and source-video-disjoint validation splits. Results are reported as mean ± standard deviation over three random seeds. Higher values indicate better performance.
| Model | Random Validation Split | Source-Video-Disjoint Validation Split | ||||||
| MCC | Recall | F1 | Acc. | MCC | Recall | F1 | Acc. | |
| ResNet50 | 0.369 ± 0.033 | 0.266 ± 0.034 | 0.231 ± 0.019 | 0.723 ± 0.016 | 0.334 ± 0.026 | 0.197 ± 0.004 | 0.170 ± 0.003 | 0.729 ± 0.004 |
| MobileNetV3-L | 0.417 ± 0.021 | 0.223 ± 0.005 | 0.202 ± 0.008 | 0.744 ± 0.009 | 0.386 ± 0.030 | 0.215 ± 0.017 | 0.186 ± 0.015 | 0.731 ± 0.010 |
| DenseNet-121 | 0.403 ± 0.017 | 0.228 ± 0.009 | 0.199 ± 0.012 | 0.723 ± 0.014 | 0.385 ± 0.012 | 0.226 ± 0.010 | 0.200 ± 0.010 | 0.733 ± 0.004 |
| RegNetY-16GF | 0.378 ± 0.009 | 0.257 ± 0.018 | 0.232 ± 0.009 | 0.727 ± 0.009 | 0.374 ± 0.051 | 0.227 ± 0.013 | 0.202 ± 0.019 | 0.718 ± 0.026 |
| EfficientNetV2-S | 0.419 ± 0.042 | 0.273 ± 0.025 | 0.263 ± 0.031 | 0.752 ± 0.013 | 0.397 ± 0.032 | 0.235 ± 0.016 | 0.219 ± 0.026 | 0.749 ± 0.012 |
| EfficientNet-B7 | 0.404 ± 0.018 | 0.277 ± 0.030 | 0.237 ± 0.023 | 0.740 ± 0.022 | 0.434 ± 0.041 | 0.262 ± 0.023 | 0.233 ± 0.023 | 0.749 ± 0.024 |
| ConvNeXtV2 | 0.361 ± 0.014 | 0.221 ± 0.022 | 0.202 ± 0.017 | 0.732 ± 0.010 | 0.330 ± 0.014 | 0.210 ± 0.017 | 0.204 ± 0.028 | 0.748 ± 0.008 |
| ConvNeXt-Tiny | 0.422 ± 0.026 | 0.275 ± 0.034 | 0.256 ± 0.029 | 0.754 ± 0.008 | 0.385 ± 0.011 | 0.237 ± 0.023 | 0.223 ± 0.031 | 0.751 ± 0.009 |
| ViT-B/16 | 0.342 ± 0.047 | 0.261 ± 0.030 | 0.238 ± 0.027 | 0.733 ± 0.010 | 0.282 ± 0.010 | 0.214 ± 0.027 | 0.189 ± 0.032 | 0.702 ± 0.013 |
| MaxViT | 0.423 ± 0.029 | 0.272 ± 0.008 | 0.262 ± 0.011 | 0.763 ± 0.006 | 0.456 ± 0.024 | 0.268 ± 0.008 | 0.253 ± 0.008 | 0.755 ± 0.019 |
| ViT-L/16 (MAE) | 0.174 ± 0.006 | 0.118 ± 0.003 | 0.119 ± 0.004 | 0.727 ± 0.000 | 0.197 ± 0.007 | 0.127 ± 0.002 | 0.125 ± 0.000 | 0.735 ± 0.002 |
| DeiT | 0.365 ± 0.028 | 0.247 ± 0.016 | 0.236 ± 0.027 | 0.742 ± 0.015 | 0.322 ± 0.020 | 0.220 ± 0.010 | 0.214 ± 0.034 | 0.732 ± 0.024 |
| CaiT-S24 | 0.396 ± 0.002 | 0.273 ± 0.026 | 0.264 ± 0.029 | 0.758 ± 0.006 | 0.406 ± 0.033 | 0.236 ± 0.031 | 0.236 ± 0.034 | 0.767 ± 0.005 |
| SwinV1 | 0.461 ± 0.029 | 0.289 ± 0.024 | 0.280 ± 0.033 | 0.772 ± 0.010 | 0.372 ± 0.051 | 0.207 ± 0.022 | 0.195 ± 0.016 | 0.748 ± 0.011 |
| SwinV2 | 0.403 ± 0.056 | 0.253 ± 0.037 | 0.256 ± 0.044 | 0.761 ± 0.014 | 0.406 ± 0.053 | 0.257 ± 0.033 | 0.241 ± 0.042 | 0.756 ± 0.017 |
| DINOv3 | 0.487 ± 0.005 | 0.246 ± 0.003 | 0.246 ± 0.004 | 0.789 ± 0.001 | 0.378 ± 0.055 | 0.174 ± 0.033 | 0.175 ± 0.029 | 0.761 ± 0.008 |
| Endo-FM | 0.348 ± 0.010 | 0.218 ± 0.011 | 0.214 ± 0.007 | 0.736 ± 0.001 | 0.334 ± 0.022 | 0.196 ± 0.015 | 0.187 ± 0.009 | 0.737 ± 0.001 |
| EVA-02 | 0.337 ± 0.005 | 0.218 ± 0.020 | 0.197 ± 0.012 | 0.735 ± 0.005 | 0.346 ± 0.019 | 0.278 ± 0.045 | 0.240 ± 0.048 | 0.732 ± 0.017 |
| DMSNet | 0.456 ± 0.037 | 0.289 ± 0.029 | 0.272 ± 0.033 | 0.768 ± 0.013 | 0.454 ± 0.051 | 0.275 ± 0.016 | 0.256 ± 0.026 | 0.760 ± 0.026 |
Table 3. Performance comparison on the source-video-disjoint test subset under random and source-video-disjoint validation splits. Results are reported as mean ± standard deviation over three random seeds. Higher values indicate better performance.
the highest MCC of 0.487 ± 0.005 in this setting. Under source-video-disjoint validation, MaxViT achieves the highest MCC of 0.456 ± 0.024, followed closely by DMSNet at 0.454 ± 0.051. These results show that DMSNet remains competitive on previously unseen source recordings, although it does not consistently outperform the baseline architectures. Taken together, Tables 2 and 3 reveal that model rankings are sensitive to both validation strategy and test-set composition. Although DMSNet achieves the highest MCC on the full test set under random frame-level validation, DINOv3 performs best on the source-video-disjoint subset under the same validation protocol. Under source-video-disjoint validation, MaxViT achieves the highest MCC on both test sets, with DMSNet remaining competitive. These findings highlight the importance of evaluating architectures across different validation protocols and source-video partitions rather than drawing conclusions from a single benchmark configuration.
Effect of Source-Video Diversity
Table 5 summarizes representative results, with complete results for all 19 architectures provided in the supplementary material. Under a per-class cap of 200 training frames, the and settings provide the cleanest comparison because both contain 2,010 frames. Increasing source-video coverage from to improves MCC for 17 of 19 architectures. MaxViT improves from 0.245 ± 0.071 to 0.311 ± 0.051,
| Model | ||||
| DMSNet | ||||
| MaxViT | ||||
| ConvNeXtV2 | ||||
| ViT-B/16 | ||||
| DINOv3 |
Table 5. Effect of source-video diversity under a per-class cap of 200 training frames. Representative architectures from different model families are shown. Complete results for all architectures are provided in the supplementary material. MCC values are reported as mean standard deviation over three random seeds.
ViT-B/16 from to , and DMSNet from to . A paired one-sided Wilcoxon signed-rank test confirms a significant positive shift across architectures indicating that the benefit of broader source-video coverage is not specific to a single model family.
Cross-Dataset Generalization
Models trained on Kvasir-Capsule using random frame-level validation are evaluated without additional fine-tuning on the independent, held-out CV2024 test set, restricted to the eight classes shared between the two datasets. As shown in Table 4, all architectures exhibit limited external generalization, with the highest MCC reaching only . ConvNeXt-Tiny achieves the highest MCC, followed by MaxViT (), ConvNeXtV2 (), and DINOv3 (). DMSNet obtains an MCC of , a macro recall of , and a macro F1-score of , indicating limited transfer to the external dataset.
| Model | MCC | Macro Recall | Macro F1 | Accuracy |
| ResNet50 | ||||
| MobileNetV3-L | ||||
| DenseNet-121 | ||||
| RegNetY-16GF | ||||
| EfficientNetV2-S | ||||
| EfficientNet-B7 | ||||
| ConvNeXtV2 | ||||
| ConvNeXt-Tiny | ||||
| ViT-B/16 | ||||
| MaxViT | ||||
| ViT-L/16 (MAE) | ||||
| DeiT | ||||
| CaiT-S24 | ||||
| SwinV1 | ||||
| SwinV2 | ||||
| DINOv3 | ||||
| Endo-FM | ||||
| EVA-02 | ||||
| DMSNet |
Table 4. Cross-dataset evaluation on the CV2024 dataset Handa et al. [ [8]. Results are reported as mean standard deviation over three random seeds.
Although, DMSNet achieves the highest MCC on the full Kvasir-Capsule test set under random frame-level validation but performs substantially worse on CV2024. The relative rankings of architectures also change across datasets, suggesting that strong in-domain performance does not necessarily indicate robust external generalization. Although differences in acquisition conditions and dataset characteristics may contribute to this decline, the external evaluation also involves a restricted eight-class prediction space rather than the original eleven-class task. These findings emphasize the need for external evaluation when assessing the reliability of VCE classification models.
Ablation Study
To evaluate the contribution of each component, we conduct a leave-one-module-out ablation study while keeping the training configuration fixed. Table 6 presents the results. The complete DMSNet achieves an MCC of , and removing any of its components reduces mean MCC. The largest reduction is observed when deformable lesion refinement (DLR) is removed, decreasing MCC to , followed by sparse feature selection (SFS) at , edge-guided attention (EGA) at , and adaptive feature fusion (AFF) at . These results suggest that DLR, SFS, and EGA make substantial contributions to the overall classification performance, whereas AFF provides a smaller incremental improvement. The full architecture achieves the highest mean MCC, supporting the complementary roles of its components.
| Configuration | MCC | Macro Recall | Macro F1 | Accuracy |
| Full DMSNet | ||||
| w/o DLR | ||||
| w/o AFF | ||||
| w/o SFS | ||||
| w/o EGA |
Table 6. Component-wise ablation of DMSNet. Results are reported as mean standard deviation over three random seeds.
Class-Wise Error Analysis
The confusion matrix in Figure 3 reveals substantial class-wise variation. DMSNet achieves high recall for Normal (92.2%) and Pylorus (69.9%), while several pathological classes are frequently confused with normal or anatomical categories. For example, 74.2% of Blood samples are predicted as Pylorus, while 66.9% of Erosion and 56.8% of Erythematous samples are predicted as Normal. Similarly, 60.1% of Foreign Bodies and 65.7% of Reduced Mucosal View samples are misclassified as Normal. These errors are consistent with the challenges posed by severe class imbalance and limited source-video diversity.

Figure 3. Confusion matrix for DMSNet.
Limitations and Future Work
Several limitations remain. Source-video availability is highly imbalanced across classes, preventing all categories from contributing equally to source-video-disjoint validation and diversity experiments. The lower- diversity conditions also differ in frame count, making the fixed-size versus comparison the cleanest controlled setting. Moreover, DMSNet exhibits limited generalization to CV2024, indicating that competitive in-domain performance does not ensure robustness across independently acquired datasets. External evaluation is also restricted to the eight categories shared between Kvasir-Capsule and CV2024. Finally, our study focuses on frame-level classification and does not model temporal information. Future work should therefore evaluate source-aware training on larger multi-center datasets and incorporate temporal modeling of complete VCE examinations.
Conclusion
This study demonstrates that VCE classification performance is sensitive to validation strategy, source-video composition,and external dataset shift. Through a systematic comparison of 19 architectures, we observe changes in model rankings across random frame-level and source-video-disjoint validation protocols. On the full Kvasir-Capsule test set, DMSNet achieves the highest MCC of under random frame-level validation, whereas MaxViT achieves the highest MCC of under source-video-disjoint validation. Evaluation on the source-video-disjoint test subset further reveals differences in model rankings, highlighting the importance of assessing performance on previously unseen recordings. Our source-video diversity experiments show that, with the training size fixed at 2,010 frames, increasing the maximum source-video coverage from four to eight improves MCC for 17 of 19 architectures. However, external evaluation on CV2024 reveals substantial generalization limitations, with ConvNeXt-Tiny achieving the highest MCC of , while DMSNet obtains . Overall, these findings emphasize that competitive in-domain performance alone is insufficient to establish robust VCE classification and underscore the importance of source-aware evaluation, training-source diversity, and independent cross-dataset testing.
Appendix
Baseline Architectures
We compare DMSNet against 18 representative architectures covering convolutional neural networks, vision transformers, and large-scale pretrained vision models. The evaluated CNN-based models include ResNet-50 He et al. [ [12], DenseNet-121 Huang et al. [ [15], MobileNetV3-L Howard et al. [ [13], RegNetY-16GF Radosavovic et al. [ [26], EfficientNet-B7 Tan and Le [ [32], EfficientNetV2-S Tan and Le [ [31], ConvNeXt-Tiny Liu et al. [ [22], and ConvNeXtV2 Woo et al. [ [39]. Transformer-based architectures include ViT-B/16 Dosovitskiy et al. [ [6], DeiT Touvron et al. [ [33], CaiT-S24 Touvron et al. [ [34], Swin-V1 Liu et al. [ [20], Swin-V2 Liu et al. [ [21], MaxViT Tu et al. [ [35], and ViT-L/16 pretrained with MAE. We additionally evaluate pretrained models including DINOv3 Siméoni et al. [ [27], EVA-02 Fang et al. [ [7], and Endo-FM Wang et al. [ [37].
Dataset
Figure 4 shows representative samples from the Kvasir-Capsule dataset.

Figure 4. Representative samples from the Kvasir-Capsule dataset.
CV2024 label mapping
For external evaluation, we additionally used CV2024 Handa et al. [ [8] capsule endoscopy dataset which contains 10 classes. Kvasir-Capsule and CV2024 share eight semantically corresponding categories: Angiectasia/Angioectasia, Blood(Kvasir-Capsule Blood-fresh)/ Bleeding, Erosion, Erythematous/Erythema, Foreign Bodies/Foreign Body, Lymphangiectasia, Normal, and Ulcer. The CV2024 labels are mapped to their corresponding Kvasir-Capsule class indices before evaluation. The two CV2024 classes, Polyp and Worms, are excluded from the cross-dataset evaluation because they are not part of our 11-class Kvasir-Capsule classification setup. Polyp was excluded from the Kvasir-Capsule training task, while Worms has no corresponding Kvasir-Capsule class. Removing these two CV2024 categories excludes 38 frames in total.
Data Augmentation
Since the dataset is highly imbalanced we implemented various data augmentation techniques, as increasing them using few geometric operations is essential. These operations enhanced the diversity of the datasets. We applied random horizontal flip, random vertical flip, random rotation by , and color jitter with brightness 0.2 and contrast 0.2. The input images are resized to .
Training Configuration
All model architectures were implemented using the PyTorch framework. The input images were resized to pixels, and the models were trained with a batch size of 16 using the AdamW optimizer. An initial learning rate of and a weight decay of were employed to optimize the training process. The learning rate was dynamically adjusted using the CosineAnnealingLR scheduler throughout training.
Additional Source-Video Diversity Analysis
Statistical Analysis of Source-Video Diversity
To assess whether the improvement observed with broader source-video coverage is consistent across architectures, we perform a paired one-sided Wilcoxon signed-rank test on the model-level MCC values. We focus on the and conditions because both contain exactly 2,010 training frames, making this the cleanest comparison of increased source-video coverage without an accompanying increase in the total training-set size. Each of the 19 evaluated architectures constitutes one paired observation. Table 9 represents the architecture wise mcc differences between and , whereas Table 7 and Table 8 represents complete source video diversity results under a per class cap of 200 training frames.
| Model | # Videos | MCC | Macro Recall | Macro F1 | Accuracy |
| ResNet50 | 1 | 0.076 ± 0.053 | 0.165 ± 0.038 | 0.082 ± 0.038 | 0.187 ± 0.033 |
| ResNet50 | 2 | 0.131 ± 0.111 | 0.161 ± 0.054 | 0.131 ± 0.053 | 0.275 ± 0.136 |
| ResNet50 | 4 | 0.195 ± 0.035 | 0.156 ± 0.016 | 0.149 ± 0.012 | 0.387 ± 0.038 |
| ResNet50 | 8 | 0.221 ± 0.049 | 0.189 ± 0.031 | 0.158 ± 0.024 | 0.432 ± 0.064 |
| EfficientNetV2-S | 1 | 0.076 ± 0.046 | 0.188 ± 0.015 | 0.099 ± 0.021 | 0.159 ± 0.059 |
| EfficientNetV2-S | 2 | 0.145 ± 0.060 | 0.192 ± 0.022 | 0.140 ± 0.033 | 0.283 ± 0.105 |
| EfficientNetV2-S | 4 | 0.194 ± 0.049 | 0.184 ± 0.029 | 0.152 ± 0.016 | 0.412 ± 0.054 |
| EfficientNetV2-S | 8 | 0.239 ± 0.030 | 0.240 ± 0.007 | 0.189 ± 0.014 | 0.470 ± 0.042 |
| ConvNeXtV2 | 1 | 0.171 ± 0.039 | 0.261 ± 0.014 | 0.160 ± 0.023 | 0.335 ± 0.069 |
| ConvNeXtV2 | 2 | 0.201 ± 0.059 | 0.233 ± 0.014 | 0.189 ± 0.018 | 0.362 ± 0.160 |
| ConvNeXtV2 | 4 | 0.261 ± 0.031 | 0.254 ± 0.043 | 0.202 ± 0.015 | 0.477 ± 0.037 |
| ConvNeXtV2 | 8 | 0.276 ± 0.059 | 0.250 ± 0.033 | 0.217 ± 0.046 | 0.509 ± 0.105 |
| MobileNetV3-L | 1 | 0.084 ± 0.053 | 0.203 ± 0.029 | 0.116 ± 0.028 | 0.231 ± 0.053 |
| MobileNetV3-L | 2 | 0.175 ± 0.079 | 0.192 ± 0.055 | 0.150 ± 0.036 | 0.341 ± 0.140 |
| MobileNetV3-L | 4 | 0.195 ± 0.060 | 0.161 ± 0.016 | 0.153 ± 0.014 | 0.406 ± 0.073 |
| MobileNetV3-L | 8 | 0.282 ± 0.059 | 0.216 ± 0.016 | 0.195 ± 0.018 | 0.525 ± 0.079 |
| DenseNet-121 | 1 | 0.107 ± 0.059 | 0.239 ± 0.042 | 0.122 ± 0.051 | 0.199 ± 0.055 |
| DenseNet-121 | 2 | 0.192 ± 0.069 | 0.232 ± 0.025 | 0.183 ± 0.035 | 0.301 ± 0.140 |
| DenseNet-121 | 4 | 0.200 ± 0.079 | 0.207 ± 0.042 | 0.178 ± 0.038 | 0.377 ± 0.074 |
| DenseNet-121 | 8 | 0.244 ± 0.053 | 0.218 ± 0.022 | 0.190 ± 0.024 | 0.468 ± 0.073 |
| RegNetY-16GF | 1 | 0.129 ± 0.044 | 0.261 ± 0.050 | 0.144 ± 0.027 | 0.236 ± 0.038 |
| RegNetY-16GF | 2 | 0.196 ± 0.062 | 0.221 ± 0.013 | 0.158 ± 0.026 | 0.352 ± 0.169 |
| RegNetY-16GF | 4 | 0.192 ± 0.063 | 0.208 ± 0.052 | 0.168 ± 0.036 | 0.417 ± 0.036 |
| RegNetY-16GF | 8 | 0.250 ± 0.023 | 0.266 ± 0.039 | 0.179 ± 0.016 | 0.501 ± 0.033 |
| EfficientNet-B7 | 1 | 0.141 ± 0.044 | 0.211 ± 0.016 | 0.128 ± 0.020 | 0.305 ± 0.013 |
| EfficientNet-B7 | 2 | 0.192 ± 0.034 | 0.227 ± 0.019 | 0.169 ± 0.013 | 0.355 ± 0.086 |
| EfficientNet-B7 | 4 | 0.196 ± 0.055 | 0.232 ± 0.027 | 0.168 ± 0.014 | 0.414 ± 0.067 |
| EfficientNet-B7 | 8 | 0.276 ± 0.069 | 0.256 ± 0.027 | 0.212 ± 0.028 | 0.494 ± 0.077 |
| ConvNeXt-Tiny | 1 | 0.185 ± 0.041 | 0.263 ± 0.012 | 0.154 ± 0.026 | 0.363 ± 0.047 |
| ConvNeXt-Tiny | 2 | 0.192 ± 0.048 | 0.247 ± 0.023 | 0.181 ± 0.024 | 0.344 ± 0.076 |
| ConvNeXt-Tiny | 4 | 0.249 ± 0.067 | 0.203 ± 0.028 | 0.181 ± 0.015 | 0.456 ± 0.100 |
| ConvNeXt-Tiny | 8 | 0.284 ± 0.099 | 0.226 ± 0.046 | 0.205 ± 0.034 | 0.508 ± 0.122 |
| ViT-B/16 | 1 | 0.142 ± 0.071 | 0.225 ± 0.068 | 0.128 ± 0.022 | 0.303 ± 0.063 |
| ViT-B/16 | 2 | 0.195 ± 0.079 | 0.229 ± 0.055 | 0.184 ± 0.044 | 0.324 ± 0.150 |
| ViT-B/16 | 4 | 0.256 ± 0.034 | 0.209 ± 0.036 | 0.187 ± 0.010 | 0.449 ± 0.013 |
| ViT-B/16 | 8 | 0.297 ± 0.070 | 0.279 ± 0.055 | 0.234 ± 0.042 | 0.540 ± 0.041 |
| DeiT | 1 | 0.150 ± 0.041 | 0.239 ± 0.030 | 0.135 ± 0.026 | 0.339 ± 0.120 |
| DeiT | 2 | 0.210 ± 0.049 | 0.220 ± 0.004 | 0.178 ± 0.021 | 0.356 ± 0.107 |
| DeiT | 4 | 0.252 ± 0.007 | 0.235 ± 0.012 | 0.196 ± 0.017 | 0.494 ± 0.045 |
| DeiT | 8 | 0.251 ± 0.030 | 0.313 ± 0.039 | 0.228 ± 0.029 | 0.485 ± 0.054 |
| SwinV2 | 1 | 0.134 ± 0.040 | 0.243 ± 0.010 | 0.132 ± 0.015 | 0.210 ± 0.047 |
| SwinV2 | 2 | 0.278 ± 0.099 | 0.242 ± 0.021 | 0.203 ± 0.055 | 0.464 ± 0.174 |
| SwinV2 | 4 | 0.287 ± 0.082 | 0.248 ± 0.041 | 0.223 ± 0.027 | 0.535 ± 0.085 |
| SwinV2 | 8 | 0.285 ± 0.054 | 0.242 ± 0.027 | 0.226 ± 0.035 | 0.578 ± 0.057 |
| ViT-L/16 (MAE) | 1 | 0.090 ± 0.039 | 0.147 ± 0.016 | 0.082 ± 0.016 | 0.277 ± 0.121 |
| ViT-L/16 (MAE) | 2 | 0.125 ± 0.066 | 0.188 ± 0.021 | 0.082 ± 0.024 | 0.271 ± 0.108 |
| ViT-L/16 (MAE) | 4 | 0.121 ± 0.051 | 0.166 ± 0.02 | 0.100 ± 0.016 | 0.214 ± 0.075 |
| ViT-L/16 (MAE) | 8 | 0.141 ± 0.049 | 0.182 ± 0.037 | 0.096 ± 0.021 | 0.206 ± 0.080 |
Table 7. Complete source-video diversity results under a per-class cap of 200 training frames (Part I). Results are reported as mean ± standard deviation over three random seeds. Bold values indicate the best result for each metric within each architecture across the four source-video settings.
Table 8: Complete source-video diversity results under a per-class cap of 200 training frames (Part II). Results are reported as mean standard deviation over three random seeds. Bold values indicate the best result for each metric within each architecture across the four source-video settings.
| Model | # Videos | MCC | Macro Recall | Macro F1 | Accuracy |
| DMSNet | 1 | 0.112 0.056 | 0.199 0.011 | 0.123 0.018 | 0.310 0.073 |
| DMSNet | 2 | 0.167 0.074 | 0.217 0.057 | 0.158 0.032 | 0.337 0.153 |
| DMSNet | 4 | 0.201 0.077 | 0.229 0.039 | 0.171 0.022 | 0.392 0.099 |
| DMSNet | 8 | 0.290 0.063 | 0.241 0.01 | 0.196 0.019 | 0.564 0.049 |
| MaxViT | 1 | 0.163 0.120 | 0.249 0.028 | 0.155 0.053 | 0.331 0.167 |
| MaxViT | 2 | 0.179 0.078 | 0.227 0.052 | 0.161 0.031 | 0.341 0.147 |
| MaxViT | 4 | 0.245 0.071 | 0.256 0.003 | 0.198 0.018 | 0.458 0.104 |
| MaxViT | 8 | 0.311 0.051 | 0.280 0.047 | 0.236 0.024 | 0.550 0.062 |
| DINOv3 | 1 | 0.067 0.054 | 0.165 0.055 | 0.083 0.036 | 0.184 0.040 |
| DINOv3 | 2 | 0.050 0.031 | 0.146 0.013 | 0.071 0.020 | 0.163 0.080 |
| DINOv3 | 4 | 0.107 0.041 | 0.169 0.017 | 0.098 0.023 | 0.222 0.061 |
| DINOv3 | 8 | 0.172 0.027 | 0.216 0.013 | 0.129 0.014 | 0.301 0.046 |
| EVA-02 | 1 | 0.174 0.038 | 0.269 0.054 | 0.166 0.015 | 0.340 0.065 |
| EVA-02 | 2 | 0.226 0.037 | 0.228 0.023 | 0.183 0.025 | 0.437 0.100 |
| EVA-02 | 4 | 0.233 0.022 | 0.198 0.045 | 0.179 0.028 | 0.482 0.026 |
| EVA-02 | 8 | 0.259 0.067 | 0.234 0.035 | 0.202 0.029 | 0.475 0.129 |
| Endo-FM | 1 | 0.067 0.051 | 0.159 0.057 | 0.089 0.019 | 0.203 0.021 |
| Endo-FM | 2 | 0.152 0.057 | 0.157 0.038 | 0.139 0.024 | 0.333 0.090 |
| Endo-FM | 4 | 0.140 0.055 | 0.140 0.024 | 0.137 0.012 | 0.304 0.068 |
| Endo-FM | 8 | 0.193 0.045 | 0.149 0.012 | 0.155 0.015 | 0.392 0.051 |
| CaiT-S24 | 1 | 0.205 0.068 | 0.227 0.034 | 0.148 0.024 | 0.396 0.072 |
| CaiT-S24 | 2 | 0.220 0.060 | 0.229 0.035 | 0.202 0.056 | 0.430 0.110 |
| CaiT-S24 | 4 | 0.220 0.102 | 0.218 0.058 | 0.189 0.051 | 0.445 0.080 |
| CaiT-S24 | 8 | 0.349 0.039 | 0.263 0.021 | 0.228 0.008 | 0.604 0.024 |
| SwinV1 | 1 | 0.121 0.099 | 0.268 0.008 | 0.139 0.038 | 0.275 0.094 |
| SwinV1 | 2 | 0.200 0.093 | 0.232 0.051 | 0.181 0.032 | 0.422 0.091 |
| SwinV1 | 4 | 0.271 0.032 | 0.214 0.017 | 0.195 0.007 | 0.556 0.106 |
| SwinV1 | 8 | 0.307 0.019 | 0.292 0.018 | 0.238 0.011 | 0.558 0.035 |
Table 8.
Table 9: Architecture-wise MCC differences between and . Both conditions contain 2,010 training frames. Positive values indicate higher mean MCC with broader source-video coverage.
| Architecture | MCC () | MCC () | MCC |
| DMSNet | 0.290 | 0.201 | +0.089 |
| MaxViT | 0.245 | 0.311 | +0.066 |
| DINOv3 | 0.107 | 0.172 | +0.065 |
| ResNet50 | 0.195 | 0.221 | +0.026 |
| EfficientNetV2-S | 0.194 | 0.239 | +0.045 |
| ConvNeXtV2 | 0.261 | 0.276 | +0.015 |
| ViT-B/16 | 0.256 | 0.297 | +0.041 |
| DeiT | 0.252 | 0.251 | 0.001 |
| SwinV2 | 0.287 | 0.285 | 0.002 |
| EVA-02 | 0.233 | 0.259 | +0.026 |
| Endo-FM | 0.140 | 0.193 | +0.053 |
| MobileNetV3-L | 0.195 | 0.282 | +0.087 |
| DenseNet121 | 0.200 | 0.244 | +0.044 |
| RegNetY-16GF | 0.192 | 0.250 | +0.058 |
| EfficientNet-B7 | 0.196 | 0.276 | +0.080 |
| ConvNeXt-Tiny | 0.249 | 0.284 | +0.035 |
| CaiT-S24 | 0.220 | 0.349 | +0.129 |
| SwinV1 | 0.271 | 0.307 | +0.036 |
| ViT-L/16 (MAE) | 0.121 | 0.141 | +0.02 |
Table 9.
References
- [1]Abu Asaduzzaman, Christian C Thompson, and Md J Uddin. Machine learning approaches for skin neoplasm diagnosis. bioRxiv, pages 2024–05, 2024.DOI
- [2]Nicole Bussola, Alessia Marcolini, Valerio Maggio, Giuseppe Jurman, and Cesare Furlanello. Ai slipping on titles: data leakage in digital pathology. In International Conference on Pattern Recognition, pages 167–182. Springer, 2021.arxiv.org/abs/1909.06539
- [3]Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Arechiga, and Tengyu Ma. Learning imbalanced datasets with label-distribution-aware margin loss. Advances in neural information processing systems, 32, 2019.arxiv.org/abs/1906.07413
- [4]Nitesh V Chawla, Kevin W Bowyer, Lawrence O Hall, and W Philip Kegelmeyer. Smote: synthetic minority over-sampling technique. Journal of artificial intelligence research, 2002.DOI
- [5]Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge Belongie. Class-balanced loss based on effective number of samples. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 9268–9277, 2019.arxiv.org/abs/1901.05555
- [6]Alexey Dosovitsky, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mustafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
- [7]Yuxin Fang, Quan Sun, Xinggang Wang, Tiejun Huang, Xinlong Wang, and Yue Cao. Eva-02: A visual representation for neon genesis. Image and Vision Computing, 149:105171, 2024.DOI
- [8]Palak Handa, Amirreza Mahbod, Florian Schwarz hans, Ramona Woitek, Nidhi Goel, Manas Dhir, Deepti Chhabra, Shreshta Jha, Pallavi Sharma, Vijay Thakur, et al. Capsule vision 2024 challenge: Multi-class abnormality classification for video capsule endoscopy. arXiv preprint arXiv:2408.04940, 2024.arxiv.org/abs/2408.04940
- [9]Dan Hanson and Debesh Jha. Benchmarking the domain gap: Model selection instability under domain shift in video capsule endoscopy. arXiv preprint arXiv:2607.22736, 2026.
- [10]Haibo He, Yang Bai, Edwardo A Garcia, and Shutao Li. Adasyn: Adaptive synthetic sampling approach for imbalanced learning. In 2008 IEEE international joint conference on neural networks (IEEE world congress on computational intelligence), pages 1322–1328. Ieee, 2008.DOI
- [11]Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Spatial pyramid pooling in deep convolutional networks for visual recognition. In European conference on computer vision, pages 346–361. Springer, 2014.
- [12]Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.arxiv.org/abs/1512.03385
- [13]Andrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, et al. Searching for mobilenetsv3. In Proceedings of the IEEE/CVF international conference on computer vision, pages 1314–1324, 2019.
- [14]Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7132–7141, 2018.
- [15]Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In 2017 IEEE conference on computer vision and pattern recognition (CVPR), pages 2261–2269. Ieee, 2017.arxiv.org/abs/1608.06993
- [16]Bingyi Kang, Saining Xie, Marcus Rohrbach, Zhicheng Yan, Albert Gordo, Jiashi Feng, and Yannis Kalantidis. Decoupling representation and classifier for long-tailed recognition. arXiv preprint arXiv:1910.09217, 2019.arxiv.org/abs/1910.09217
- [17]Bartosz Krawczyk, Łukasz Jelęń, Adam Krzyżak, and Thomas Fevens. Oversampling methods for classification of imbalanced breast cancer malignancy data. In International Conference on Computer Vision and Graphics, pages 483–490. Springer, 2012.DOI
- [18]Tsung-Yi Lin, Piotr Dollár, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2117–2125, 2017a.arxiv.org/abs/1612.03144
- [19]Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollár. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pages 2980–2988, 2017b.
- [20]Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF international conference on computer vision, pages 10012–10022, 2021.arxiv.org/abs/2103.14030
- [21]Ze Liu, Han Hu, Yutong Lin, Zhuang Liu, Zhenda Xie, Yixuan Wei, Jia Ning, Yue Cao, Zheng Zhang, Li Dong, et al. Swin transformer v2: Scaling up capacity and resolution. In 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 11999–12009. IEEE, 2022a.arxiv.org/abs/2111.09883
- [22]Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, and Saining Xie. A convnet for the 2020s. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 11976–11986, 2022b.
- [23]Han Lu, Siyu Sun, Yichen Xie, Liqing Zhang, Xiaokang Yang, and Junchi Yan. Rethinking classifier re-training in long-tailed recognition: A simple logits retargeting approach. arXiv preprint arXiv:2403.00250, 2024.arxiv.org/abs/2403.00250
- [24]Prabhanantha Kumar Muruganantham and Senthil Murugan Balakrishnan. Uncertainty-driven active learning in a deep semi-supervised framework for wce image classification. Results in Engineering, 27:106174, 2025.DOI
- [25]Yassine Oukdach, Zakaria Kerkaou, Mohamed El Ansari, Lahcen Koutti, Ahmed Fouad El Ouafdi, and Thomas De Lange. Vitca-net: a framework for disease detection in video capsule endoscopy images using a vision transformer and convolutional neural network with a specific attention mechanism. Multimedia Tools and Applications, 83(23):63635–63654, 2024.DOI
- [26]Ilija Radosavovic, Raj Prateek Kosaraju, Ross Girshick, Kaiming He, and Piotr Dollár. Designing network design spaces. arXiv preprint arXiv:2003.13678, 2020.arxiv.org/abs/2003.13678
- [27]Oriane Siméoni, Huy V. Vo, Maximilian Seitzer, Federico Baldassarre, Maxime Oquab, Cijo Jose, Vasil Khalidov, Marc Szafraniec, Seungeun Yi, Michaël Ramamonjisoa, et al. Dinov3. arXiv preprint arXiv:2508.10104, 2025.arxiv.org/abs/2508.10104
- [28]Pia H. Smedsrud, Vajira Thambawita, Steven A. Hicks, et al. Kvasir-capsule, a video capsule endoscopy dataset. Scientific Data, 8(1):142, 2021.DOI
- [29]Abhishek Srivastava, Nikhil Kumar Tomar, Ulas Bagci, and Debesh Jha. Video capsule endoscopy classification using focal modulation guided convolutional neural network. In 2022 IEEE 35th International Symposium on Computer-Based Medical Systems (CBMS), pages 323–328. IEEE, 2022.arxiv.org/abs/2206.08298
- [30]Iulian Emil Tampu, Anders Eklund, and Neda Haj-Hosseini. Inflation of test accuracy due to data leakage in deep learning-based classification of oct images. Scientific Data, 9(1):580, 2022.DOI
- [31]Mingxing Tan and Quoc Le. Efficientnetv2: Smaller models and faster training. In International conference on machine learning, pages 10096–10106. PMLR, 2021.arxiv.org/abs/2104.00298
- [32]Mingxing Tan and Quoc V. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning (ICML), pages 6105–6114, 2019.arxiv.org/abs/1905.11946
- [33]Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In International conference on machine learning, pages 10347–10357. PMLR, 2021a.
- [34]Hugo Touvron, Matthieu Cord, Alexandre Sablayrolles, Gabriel Synnaeve, and Hervé Jégou. Going deeper with image transformers. In 2021 IEEE/CVF international conference on computer vision (ICCV), pages 32–42. IEEE, 2021b.arxiv.org/abs/2103.17239
- [35]Zhengzhong Tu, Hossein Talebi, Han Zhang, Feng Yang, Peyman Milanfar, Alan Bovik, and Yinxiao Li. Maxvit: Multi-axis vision transformer. In European conference on computer vision, pages 459–479. Springer, 2022.arxiv.org/abs/2204.01697
- [36]Dara Varam, Rohan Mitra, Meriam Mkadmi, Radi Aman Riyaz, D iaa Addeen Abuhani, Salam Dhou, and Ayman Alzaatre h. Wireless capsule endoscopy image classification: an explainable ai approach. IEEE Access, 11:105262–105280, 2023.DOI
- [37]Zhao Wang, Chang Liu, Shaoting Zhang, and Qi Dou. Foundation model for endoscopy video analysis via large-scale self-supervised pre-train. In International conference on medical image computing and computer-assisted intervention, pages 101–111. Springer, 2023.arxiv.org/abs/2306.16741
- [38]Sanghyun Woo, Jongchan Park, Joon-Young Lee, and In So Kweon. Cbam: Convolutional block attention module. In Proceedings of the European conference on computer vision (ECCV), pages 3–19, 2018.arxiv.org/abs/1807.06521
- [39]Sanghyun Woo, Shoubhik Debnath, Ronghang Hu, Xinlei Chen, Zhuang Liu, In So Kweon, and Saining Xie. Convnext v2: Co-designing and scaling convnets with masked autoencoders. In 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 16133–16142. Ieee, 2023.arxiv.org/abs/2301.00808
- [40]Fan Zhang, Wei Qin, Weijieying Ren, Lei Wang, Zetong Chen, and Richang Hong. Gradient-aware logit adjustment loss for long-tailed classifier. In ICASSP 2024-2024 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 3190–3194. IEEE, 2024.arxiv.org/abs/2403.09036
- [41]Hengshuang Zhao, Jianping Shi, Xiaoj uan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2881–2890, 2017.
- [42]Xizhou Zhu, Han Hu, Stephen Lin, and Jifeng Dai. Deformable convnets v2: More deformable, better results. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 9308–9316, 2019.arxiv.org/abs/1811.11168
AI tools statement
No AI-use declaration is available for this version in Valency.
The available record does not establish whether AI systems or models contributed to this work.