Skip to content

Menu

WorksComputer Science

Rethinking Evaluation for Video Capsule Endoscopy: Validation Protocol, Source-Video Diversity, and Cross-Dataset Shift

Download PDFView on arXiv

Ask your agent about this work

Your agent reads this work through Valency, with its citations and similar works. Paste this at the start of a chat.

Use the Valency MCP. Work: W_5g4f27s4. Fetch it with get_paper_by_id, then find its nearest works with find_similar_papers and tell me what it adds.

Works with any MCP client. Not connected yet? Connect your agent

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 ±\pm 0.020 on complete test set and 0.456 ±\pm 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:

  1. 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

  1. 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.

  1. 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.

  1. 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 x∈R3×224×224x \in\mathbb{R}^{3 \times224 \times224}, features are extracted from four stages of increasing depth:

{F(1),F(2),F(3),F(4)}=B(x),(1)\left\{\mathbf{F}^{(1)}, \mathbf{F}^{(2)}, \mathbf{F}^{(3)}, \mathbf{F}^{(4)}\right\} = \mathcal{B}(x), \tag*{(1)}

where B(⋅)\mathcal{B}(\cdot) 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.

Overall architecture of the proposed DMSNet framework

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 1×11 \times1 convolution–BatchNorm-SiLU block. The projected features are then aligned through bilinear interpolation to the spatial resolution of the second selected backbone feature map:

P(i)=Resize⁡H2,W2(ConvBNAct⁡1×1(F(i))),i=1,…,4,(2)\mathbf{P}^{(i)} = \operatorname{Resize}_{H_2,W_2}\left(\operatorname{ConvBNAct}_{1 \times1}\left(\mathbf{F}^{(i)}\right)\right), \qquad i = 1,\ldots,4, \tag*{(2)}

where H2H_2 and W2W_2 denote the spatial dimensions of F(2)\mathbf{F}^{(2)}.

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:

si=wiTGAP⁡(P(i))+bi,(3)s_i = \mathbf{w}_i^{\mathsf{T}} \operatorname{GAP}\left(\mathbf{P}^{(i)}\right) + b_i, \tag*{(3)}

where sis_i represents the importance score of the ii-th scale. The scores are normalized using a softmax function:

βi=exp⁡(si)∑j=14exp⁡(sj),(4)\beta_i = \frac{\exp(s_i)}{\sum_{j=1}^{4}\exp(s_j)}, \tag*{(4)}

where βi\beta_i denotes the normalized contribution of the ii-th feature scale. The aligned representations are then aggregated through weighted summation:

Fw=∑i=14βiP(i).(5)\mathbf{F}_w = \sum_{i=1}^{4} \beta_i \mathbf{P}^{(i)}. \tag*{(5)}

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 Fw\mathbf{F}_w, and the resulting spatial descriptors are concatenated and processed using a 7×77 \times7 convolution followed by a sigmoid activation:

As=σ(Conv⁡7×7([Avg⁡c(Fw)∥Max⁡c(Fw)])),(6)\mathbf{A}_s = \sigma\left(\operatorname{Conv}_{7 \times7}\left([\operatorname{Avg}_c(\mathbf{F}_w)\mathbin{\|}\operatorname{Max}_c(\mathbf{F}_w)]\right)\right), \tag*{(6)}

where Avg⁡c\operatorname{Avg}_c and Max⁡c\operatorname{Max}_c denote channel-wise average and maximum pooling, respectively. The spatially attended representation is computed as

Fa=Fw⊙As.(7)\mathbf{F}_a = \mathbf{F}_w \odot\mathbf{A}_s. \tag*{(7)}

Finally, the attended features are processed using two successive 3×33 \times3 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:

Ffus=SiLU⁡(Fw+R(Fa)),(8)\mathbf{F}_{fus} = \operatorname{SiLU}\left(\mathbf{F}_{w} + \mathcal{R}(\mathbf{F}_{a})\right), \tag*{(8)}

where R(⋅)\mathcal{R}(\cdot) 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:

Fdef(p)=∑k=1KwkFfus(p+pk+Δpk),(9)\mathbf{F}_{def}(\mathbf{p}) = \sum_{k=1}^{K} w_k \mathbf{F}_{fus}\left(\mathbf{p} + \mathbf{p}_k + \Delta\mathbf{p}_k\right), \tag*{(9)}

where pk\mathbf{p}_k denotes the regular sampling location and Δpk\Delta\mathbf{p}_k is a learned offset. The deformable representation is combined with the original fused features through a residual connection,

Fr=Ffus+Fdef.(10)\mathbf{F}_{r} = \mathbf{F}_{fus} + \mathbf{F}_{def}. \tag*{(10)}

Edge-Guided Attention

To incorporate explicit boundary information, the input image is converted to grayscale and processed using Sobel operators. The resulting edge magnitude E=Gx2+Gy2E = \sqrt{G_x^2 + G_y^2} is passed through a lightweight convolutional branch to generate a spatial attention map:

A=σ(ψ(E)),Fatt=Fr+Fr⊙A,(11)A = \sigma\left(\psi(E)\right), \qquad\mathbf{F}_{att} = \mathbf{F}_{r} + \mathbf{F}_{r} \odot A, \tag*{(11)}

where ψ(⋅)\psi(\cdot) denotes the convolutional attention branch, σ(⋅)\sigma(\cdot) is the sigmoid function, and ⊙\odot 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):

z=[GAP⁡(Fatt)∥GMP⁡(Fatt)].(12)\mathbf{z} = [\operatorname{GAP}(\mathbf{F}_{att}) \mathbin{\|} \operatorname{GMP}(\mathbf{F}_{att})]. \tag*{(12)}

A two-layer gating network then produces a feature-selection mask,

g=σ(W2δ(W1z+b1)+b2),zsel=g⊙z,(13)\mathbf{g} = \sigma\left(W_2\delta(W_1\mathbf{z} + \mathbf{b}_1) + \mathbf{b}_2\right), \qquad\mathbf{z}_{sel} = \mathbf{g} \odot\mathbf{z}, \tag*{(13)}

where δ(⋅)\delta(\cdot) denotes the SiLU activation. The gated representation is passed to a linear classifier to produce logits for the K=11K = 11 classes:

o=Wczsel+bc.(14)\mathbf{o} = W_c\mathbf{z}_{sel} + \mathbf{b}_c. \tag*{(14)}

The network is optimized using focal loss together with mean gate-activation sparsity penalty,

L=LFocal+λLSparse,LSparse=1d∑j=1dgj,(15)\mathcal{L} = \mathcal{L}_{\mathrm{Focal}} + \lambda\mathcal{L}_{\mathrm{Sparse}}, \qquad\mathcal{L}_{\mathrm{Sparse}} = \frac{1}{d}\sum_{j=1}^{d} g_j, \tag*{(15)}

where gjg_j denotes the jj-th sigmoid gate activation and dd is the number of gated feature dimensions. We set λ=10−3\lambda= 10^{-3} 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 224×224224 \times224 inputs and are trained with AdamW (batch size 16, learning rate 10−410^{-4}, weight decay 10−410^{-4}) 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 γ=2\gamma= 2. All experiments are repeated using three random seeds (41, 42, and 43), and results are reported as mean ±\pm 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.

Class distribution and label availability across Kvasir-Capsule partitions

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 k∈{1,2,4,8}k \in\{1, 2, 4, 8\}. 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 k=1,2,4,k = 1, 2, 4, and 88, respectively. Thus, lower-kk comparisons vary in both frame count and source-video coverage, whereas k=4k = 4 versus k=8k = 8 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.

ModelParams (M)Trainable (M)GFLOPsThroughputLatency (ms/img)
ResNet5023.5323.538.261000/s1.000
MobileNetV3-L4.224.220.432642/s0.378
DenseNet-1216.976.975.67851/s1.176
RegNetY-16GF80.6080.6031.82265/s3.781
EfficientNetV2-S20.1920.195.42897/s1.115
ConvNeXtV287.7087.7030.71234/s4.278
ConvNeXt-Tiny27.8327.838.91797/s1.254
ViT-B/1685.8185.8133.70310/s3.229
MaxViT118.71118.7146.69134/s7.461
ViT-L/16 (MAE)303.310.01119.2992/s10.819
DeiT85.8285.8233.70304/s3.288
CaiT-S2446.5446.5417.27312/s3.202
SwinV186.7586.7530.34249/s4.010
SwinV248.9348.9317.68352/s2.844
DINOv385.650.0134.37278/s3.599
Endo-FM121.270.0147.61201/s4.986
EVA-0285.7785.7743.89191/s5.239
DMSNet22.0122.017.561565/s1.770

Table 1. Computational efficiency comparison at 224×224224 \times224 input resolution. Computational cost is estimated using THOP and reported as GFLOPs with the convention 11 MAC = 22 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

ModelRandom Validation SplitSource-Video-Disjoint Validation Split
MCCRecallF1Acc.MCCRecallF1Acc.
ResNet500.347 ± 0.0210.266 ± 0.0220.241 ± 0.0080.690 ± 0.0120.302 ± 0.0200.199 ± 0.0050.184 ± 0.0000.690 ± 0.002
MobileNetV3-L0.386 ± 0.0220.258 ± 0.0110.251 ± 0.0040.711 ± 0.0040.369 ± 0.0310.246 ± 0.0230.226 ± 0.0200.700 ± 0.011
DenseNet-1210.375 ± 0.0130.253 ± 0.0120.233 ± 0.0040.694 ± 0.0110.367 ± 0.0140.255 ± 0.0110.232 ± 0.0110.698 ± 0.005
RegNetY-16GF0.369 ± 0.0180.289 ± 0.0120.278 ± 0.0020.700 ± 0.0100.367 ± 0.0570.272 ± 0.0230.247 ± 0.0300.691 ± 0.027
EfficientNetV2-S0.398 ± 0.0280.278 ± 0.0080.278 ± 0.0100.720 ± 0.0110.388 ± 0.0160.266 ± 0.0200.265 ± 0.0300.720 ± 0.007
EfficientNet-B70.397 ± 0.0270.296 ± 0.0320.272 ± 0.0350.713 ± 0.0240.426 ± 0.0490.308 ± 0.0290.285 ± 0.0340.720 ± 0.026
ConvNeXtV20.335 ± 0.0160.240 ± 0.0250.223 ± 0.0100.694 ± 0.0080.319 ± 0.0220.225 ± 0.0140.235 ± 0.0200.713 ± 0.006
ConvNeXt-Tiny0.396 ± 0.0180.280 ± 0.0220.279 ± 0.0200.721 ± 0.0070.390 ± 0.0290.266 ± 0.0270.286 ± 0.0360.729 ± 0.013
ViT-B/160.327 ± 0.0270.255 ± 0.0240.245 ± 0.0170.698 ± 0.0030.283 ± 0.0250.237 ± 0.0360.219 ± 0.0430.676 ± 0.015
MaxViT0.398 ± 0.0240.278 ± 0.0100.288 ± 0.0130.728 ± 0.0050.452 ± 0.0260.312 ± 0.0140.307 ± 0.0160.730 ± 0.023
ViT-L/16 (MAE)0.150 ± 0.0040.113 ± 0.0020.113 ± 0.0030.686 ± 0.0000.174 ± 0.0060.119 ± 0.0010.118 ± 0.0000.695 ± 0.002
DeiT0.347 ± 0.0190.235 ± 0.0170.240 ± 0.0190.709 ± 0.0100.301 ± 0.0120.224 ± 0.0090.223 ± 0.0130.695 ± 0.020
CaiT-S240.374 ± 0.0110.269 ± 0.0370.276 ± 0.0300.724 ± 0.0060.377 ± 0.0340.250 ± 0.0310.262 ± 0.0360.728 ± 0.011
SwinV10.417 ± 0.0190.273 ± 0.0410.269 ± 0.0290.732 ± 0.0050.365 ± 0.0460.245 ± 0.0320.256 ± 0.0310.717 ± 0.013
SwinV20.378 ± 0.0360.235 ± 0.0040.255 ± 0.0090.726 ± 0.0090.372 ± 0.0410.245 ± 0.0300.248 ± 0.0320.718 ± 0.012
DINOv30.407 ± 0.0020.229 ± 0.0020.235 ± 0.0020.736 ± 0.0010.307 ± 0.0470.160 ± 0.0350.165 ± 0.0310.712 ± 0.005
Endo-FM0.303 ± 0.0070.192 ± 0.0050.198 ± 0.0030.697 ± 0.0010.295 ± 0.0210.178 ± 0.0150.180 ± 0.0130.700 ± 0.001
EVA-020.315 ± 0.0080.203 ± 0.0130.199 ± 0.0100.698 ± 0.0030.313 ± 0.0190.283 ± 0.0600.239 ± 0.0490.689 ± 0.017
DMSNet0.442 ± 0.0200.321 ± 0.0160.325 ± 0.0150.740 ± 0.0070.426 ± 0.0500.299 ± 0.0240.290 ± 0.0260.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.

ModelRandom Validation SplitSource-Video-Disjoint Validation Split
MCCRecallF1Acc.MCCRecallF1Acc.
ResNet500.369 ± 0.0330.266 ± 0.0340.231 ± 0.0190.723 ± 0.0160.334 ± 0.0260.197 ± 0.0040.170 ± 0.0030.729 ± 0.004
MobileNetV3-L0.417 ± 0.0210.223 ± 0.0050.202 ± 0.0080.744 ± 0.0090.386 ± 0.0300.215 ± 0.0170.186 ± 0.0150.731 ± 0.010
DenseNet-1210.403 ± 0.0170.228 ± 0.0090.199 ± 0.0120.723 ± 0.0140.385 ± 0.0120.226 ± 0.0100.200 ± 0.0100.733 ± 0.004
RegNetY-16GF0.378 ± 0.0090.257 ± 0.0180.232 ± 0.0090.727 ± 0.0090.374 ± 0.0510.227 ± 0.0130.202 ± 0.0190.718 ± 0.026
EfficientNetV2-S0.419 ± 0.0420.273 ± 0.0250.263 ± 0.0310.752 ± 0.0130.397 ± 0.0320.235 ± 0.0160.219 ± 0.0260.749 ± 0.012
EfficientNet-B70.404 ± 0.0180.277 ± 0.0300.237 ± 0.0230.740 ± 0.0220.434 ± 0.0410.262 ± 0.0230.233 ± 0.0230.749 ± 0.024
ConvNeXtV20.361 ± 0.0140.221 ± 0.0220.202 ± 0.0170.732 ± 0.0100.330 ± 0.0140.210 ± 0.0170.204 ± 0.0280.748 ± 0.008
ConvNeXt-Tiny0.422 ± 0.0260.275 ± 0.0340.256 ± 0.0290.754 ± 0.0080.385 ± 0.0110.237 ± 0.0230.223 ± 0.0310.751 ± 0.009
ViT-B/160.342 ± 0.0470.261 ± 0.0300.238 ± 0.0270.733 ± 0.0100.282 ± 0.0100.214 ± 0.0270.189 ± 0.0320.702 ± 0.013
MaxViT0.423 ± 0.0290.272 ± 0.0080.262 ± 0.0110.763 ± 0.0060.456 ± 0.0240.268 ± 0.0080.253 ± 0.0080.755 ± 0.019
ViT-L/16 (MAE)0.174 ± 0.0060.118 ± 0.0030.119 ± 0.0040.727 ± 0.0000.197 ± 0.0070.127 ± 0.0020.125 ± 0.0000.735 ± 0.002
DeiT0.365 ± 0.0280.247 ± 0.0160.236 ± 0.0270.742 ± 0.0150.322 ± 0.0200.220 ± 0.0100.214 ± 0.0340.732 ± 0.024
CaiT-S240.396 ± 0.0020.273 ± 0.0260.264 ± 0.0290.758 ± 0.0060.406 ± 0.0330.236 ± 0.0310.236 ± 0.0340.767 ± 0.005
SwinV10.461 ± 0.0290.289 ± 0.0240.280 ± 0.0330.772 ± 0.0100.372 ± 0.0510.207 ± 0.0220.195 ± 0.0160.748 ± 0.011
SwinV20.403 ± 0.0560.253 ± 0.0370.256 ± 0.0440.761 ± 0.0140.406 ± 0.0530.257 ± 0.0330.241 ± 0.0420.756 ± 0.017
DINOv30.487 ± 0.0050.246 ± 0.0030.246 ± 0.0040.789 ± 0.0010.378 ± 0.0550.174 ± 0.0330.175 ± 0.0290.761 ± 0.008
Endo-FM0.348 ± 0.0100.218 ± 0.0110.214 ± 0.0070.736 ± 0.0010.334 ± 0.0220.196 ± 0.0150.187 ± 0.0090.737 ± 0.001
EVA-020.337 ± 0.0050.218 ± 0.0200.197 ± 0.0120.735 ± 0.0050.346 ± 0.0190.278 ± 0.0450.240 ± 0.0480.732 ± 0.017
DMSNet0.456 ± 0.0370.289 ± 0.0290.272 ± 0.0330.768 ± 0.0130.454 ± 0.0510.275 ± 0.0160.256 ± 0.0260.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 k=4k = 4 and k=8k = 8 settings provide the cleanest comparison because both contain 2,010 frames. Increasing source-video coverage from k=4k = 4 to k=8k = 8 improves MCC for 17 of 19 architectures. MaxViT improves from 0.245 ± 0.071 to 0.311 ± 0.051,

Modelk=1k = 1k=2k = 2k=4k = 4k=8k = 8
DMSNet0.112±0.0560.112 \pm0.0560.167±0.0740.167 \pm0.0740.201±0.0740.201 \pm0.0740.290±0.0630.290 \pm0.063
MaxViT0.163±0.1200.163 \pm0.1200.179±0.0780.179 \pm0.0780.245±0.0710.245 \pm0.0710.311±0.0510.311 \pm0.051
ConvNeXtV20.171±0.0390.171 \pm0.0390.201±0.0590.201 \pm0.0590.261±0.0310.261 \pm0.0310.276±0.0590.276 \pm0.059
ViT-B/160.142±0.0710.142 \pm0.0710.195±0.0790.195 \pm0.0790.256±0.0340.256 \pm0.0340.297±0.0700.297 \pm0.070
DINOv30.067±0.0540.067 \pm0.0540.050±0.0310.050 \pm0.0310.107±0.0410.107 \pm0.0410.172±0.0270.172 \pm0.027

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 ±\pm standard deviation over three random seeds.

ViT-B/16 from 0.256±0.0340.256 \pm0.034 to 0.297±0.0700.297 \pm0.070, and DMSNet from 0.201±0.0410.201 \pm0.041 to 0.290±0.0630.290 \pm0.063. 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 0.207±0.0030.207 \pm0.003. ConvNeXt-Tiny achieves the highest MCC, followed by MaxViT (0.195±0.0240.195 \pm0.024), ConvNeXtV2 (0.191±0.0380.191 \pm0.038), and DINOv3 (0.167±0.0120.167 \pm0.012). DMSNet obtains an MCC of 0.137±0.0230.137 \pm0.023, a macro recall of 0.207±0.0050.207 \pm0.005, and a macro F1-score of 0.173±0.0160.173 \pm0.016, indicating limited transfer to the external dataset.

ModelMCCMacro RecallMacro F1Accuracy
ResNet500.133±0.0250.133 \pm0.0250.189±0.0180.189 \pm0.0180.161±0.0290.161 \pm0.0290.570±0.0460.570 \pm0.046
MobileNetV3-L0.1115±0.05670.1115 \pm0.05670.1759±0.03200.1759 \pm0.03200.1631±0.03140.1631 \pm0.03140.5654±0.01290.5654 \pm0.0129
DenseNet-1210.1768±0.01650.1768 \pm0.01650.2100±0.01550.2100 \pm0.01550.1866±0.01720.1866 \pm0.01720.6172±0.04240.6172 \pm0.0424
RegNetY-16GF0.1209±0.04090.1209 \pm0.04090.1745±0.02130.1745 \pm0.02130.1482±0.02420.1482 \pm0.02420.5707±0.05700.5707 \pm0.0570
EfficientNetV2-S0.1332±0.05070.1332 \pm0.05070.1886±0.02950.1886 \pm0.02950.1623±0.02530.1623 \pm0.02530.6042±0.11960.6042 \pm0.1196
EfficientNet-B70.1601±0.02040.1601 \pm0.02040.2078±0.01060.2078 \pm0.01060.1931±0.00390.1931 \pm0.00390.5729±0.02730.5729 \pm0.0273
ConvNeXtV20.1908±0.03810.1908 \pm0.03810.2133±0.01110.2133 \pm0.01110.1911±0.01010.1911 \pm0.01010.6388±0.07760.6388 \pm0.0776
ConvNeXt-Tiny0.2072±0.00260.2072 \pm0.00260.2185±0.01640.2185 \pm0.01640.1919±0.01380.1919 \pm0.01380.6506±0.07770.6506 \pm0.0777
ViT-B/160.0981±0.04620.0981 \pm0.04620.1708±0.02020.1708 \pm0.02020.1674±0.02120.1674 \pm0.02120.5706±0.02440.5706 \pm0.0244
MaxViT0.1946±0.02400.1946 \pm0.02400.2021±0.01300.2021 \pm0.01300.1937±0.00910.1937 \pm0.00910.5919±0.09620.5919 \pm0.0962
ViT-L/16 (MAE)0.0804±0.00770.0804 \pm0.00770.1506±0.00450.1506 \pm0.00450.1457±0.00350.1457 \pm0.00350.7279±0.00290.7279 \pm0.0029
DeiT0.1526±0.02860.1526 \pm0.02860.1756±0.01260.1756 \pm0.01260.1742±0.02000.1742 \pm0.02000.6666±0.04310.6666 \pm0.0431
CaiT-S240.1895±0.03840.1895 \pm0.03840.2119±0.02630.2119 \pm0.02630.2006±0.01330.2006 \pm0.01330.6552±0.04190.6552 \pm0.0419
SwinV10.1687±0.03220.1687 \pm0.03220.2018±0.01700.2018 \pm0.01700.1961±0.01580.1961 \pm0.01580.6319±0.06630.6319 \pm0.0663
SwinV20.1221±0.01680.1221 \pm0.01680.1905±0.00830.1905 \pm0.00830.1741±0.00530.1741 \pm0.00530.5638±0.03950.5638 \pm0.0395
DINOv30.1672±0.01240.1672 \pm0.01240.1919±0.00610.1919 \pm0.00610.1861±0.00490.1861 \pm0.00490.7151±0.01490.7151 \pm0.0149
Endo-FM0.079±0.0010.079 \pm0.0010.157±0.0070.157 \pm0.0070.141±0.0090.141 \pm0.0090.719±0.0180.719 \pm0.018
EVA-020.0808±0.01020.0808 \pm0.01020.1704±0.01930.1704 \pm0.01930.1399±0.01660.1399 \pm0.01660.5687±0.09800.5687 \pm0.0980
DMSNet0.1367±0.02260.1367 \pm0.02260.2066±0.00490.2066 \pm0.00490.1727±0.01560.1727 \pm0.01560.5789±0.05070.5789 \pm0.0507

Table 4. Cross-dataset evaluation on the CV2024 dataset Handa et al. [ [8]. Results are reported as mean ±\pm 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 0.442±0.0250.442 \pm0.025, and removing any of its components reduces mean MCC. The largest reduction is observed when deformable lesion refinement (DLR) is removed, decreasing MCC to 0.4010.401, followed by sparse feature selection (SFS) at 0.4080.408, edge-guided attention (EGA) at 0.4100.410, and adaptive feature fusion (AFF) at 0.4370.437. 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.

ConfigurationMCCMacro RecallMacro F1Accuracy
Full DMSNet0.442±0.0250.442 \pm0.0250.321±0.0200.321 \pm0.0200.324±0.0190.324 \pm0.0190.740±0.0090.740 \pm0.009
w/o DLR0.401±0.0390.401 \pm0.0390.273±0.0050.273 \pm0.0050.269±0.0170.269 \pm0.0170.728±0.0130.728 \pm0.013
w/o AFF0.437±0.0150.437 \pm0.0150.297±0.0190.297 \pm0.0190.305±0.0330.305 \pm0.0330.739±0.0120.739 \pm0.012
w/o SFS0.408±0.0400.408 \pm0.0400.277±0.0370.277 \pm0.0370.286±0.0400.286 \pm0.0400.735±0.0080.735 \pm0.008
w/o EGA0.410±0.0190.410 \pm0.0190.273±0.0230.273 \pm0.0230.291±0.0170.291 \pm0.0170.740±0.0010.740 \pm0.001

Table 6. Component-wise ablation of DMSNet. Results are reported as mean ±\pm 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.

Confusion matrix for DMSNet

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-kk diversity conditions also differ in frame count, making the fixed-size k=4k = 4 versus k=8k = 8 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 0.442±0.0200.442 \pm0.020 under random frame-level validation, whereas MaxViT achieves the highest MCC of 0.452±0.0260.452 \pm0.026 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 0.207±0.0030.207 \pm0.003, while DMSNet obtains 0.137±0.0230.137 \pm0.023. 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.

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 15∘15^\circ, and color jitter with brightness 0.2 and contrast 0.2. The input images are resized to 224×224224 \times224.

Training Configuration

All model architectures were implemented using the PyTorch framework. The input images were resized to (224×224)(224 \times224) pixels, and the models were trained with a batch size of 16 using the AdamW optimizer. An initial learning rate of (1×10−4)(1 \times10^{-4}) and a weight decay of (1×10−4)(1 \times10^{-4}) 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 k=4k = 4 and k=8k = 8 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 k=4k = 4 and k=8k = 8, whereas Table 7 and Table 8 represents complete source video diversity results under a per class cap of 200 training frames.

Model# VideosMCCMacro RecallMacro F1Accuracy
ResNet5010.076 ± 0.0530.165 ± 0.0380.082 ± 0.0380.187 ± 0.033
ResNet5020.131 ± 0.1110.161 ± 0.0540.131 ± 0.0530.275 ± 0.136
ResNet5040.195 ± 0.0350.156 ± 0.0160.149 ± 0.0120.387 ± 0.038
ResNet5080.221 ± 0.0490.189 ± 0.0310.158 ± 0.0240.432 ± 0.064
EfficientNetV2-S10.076 ± 0.0460.188 ± 0.0150.099 ± 0.0210.159 ± 0.059
EfficientNetV2-S20.145 ± 0.0600.192 ± 0.0220.140 ± 0.0330.283 ± 0.105
EfficientNetV2-S40.194 ± 0.0490.184 ± 0.0290.152 ± 0.0160.412 ± 0.054
EfficientNetV2-S80.239 ± 0.0300.240 ± 0.0070.189 ± 0.0140.470 ± 0.042
ConvNeXtV210.171 ± 0.0390.261 ± 0.0140.160 ± 0.0230.335 ± 0.069
ConvNeXtV220.201 ± 0.0590.233 ± 0.0140.189 ± 0.0180.362 ± 0.160
ConvNeXtV240.261 ± 0.0310.254 ± 0.0430.202 ± 0.0150.477 ± 0.037
ConvNeXtV280.276 ± 0.0590.250 ± 0.0330.217 ± 0.0460.509 ± 0.105
MobileNetV3-L10.084 ± 0.0530.203 ± 0.0290.116 ± 0.0280.231 ± 0.053
MobileNetV3-L20.175 ± 0.0790.192 ± 0.0550.150 ± 0.0360.341 ± 0.140
MobileNetV3-L40.195 ± 0.0600.161 ± 0.0160.153 ± 0.0140.406 ± 0.073
MobileNetV3-L80.282 ± 0.0590.216 ± 0.0160.195 ± 0.0180.525 ± 0.079
DenseNet-12110.107 ± 0.0590.239 ± 0.0420.122 ± 0.0510.199 ± 0.055
DenseNet-12120.192 ± 0.0690.232 ± 0.0250.183 ± 0.0350.301 ± 0.140
DenseNet-12140.200 ± 0.0790.207 ± 0.0420.178 ± 0.0380.377 ± 0.074
DenseNet-12180.244 ± 0.0530.218 ± 0.0220.190 ± 0.0240.468 ± 0.073
RegNetY-16GF10.129 ± 0.0440.261 ± 0.0500.144 ± 0.0270.236 ± 0.038
RegNetY-16GF20.196 ± 0.0620.221 ± 0.0130.158 ± 0.0260.352 ± 0.169
RegNetY-16GF40.192 ± 0.0630.208 ± 0.0520.168 ± 0.0360.417 ± 0.036
RegNetY-16GF80.250 ± 0.0230.266 ± 0.0390.179 ± 0.0160.501 ± 0.033
EfficientNet-B710.141 ± 0.0440.211 ± 0.0160.128 ± 0.0200.305 ± 0.013
EfficientNet-B720.192 ± 0.0340.227 ± 0.0190.169 ± 0.0130.355 ± 0.086
EfficientNet-B740.196 ± 0.0550.232 ± 0.0270.168 ± 0.0140.414 ± 0.067
EfficientNet-B780.276 ± 0.0690.256 ± 0.0270.212 ± 0.0280.494 ± 0.077
ConvNeXt-Tiny10.185 ± 0.0410.263 ± 0.0120.154 ± 0.0260.363 ± 0.047
ConvNeXt-Tiny20.192 ± 0.0480.247 ± 0.0230.181 ± 0.0240.344 ± 0.076
ConvNeXt-Tiny40.249 ± 0.0670.203 ± 0.0280.181 ± 0.0150.456 ± 0.100
ConvNeXt-Tiny80.284 ± 0.0990.226 ± 0.0460.205 ± 0.0340.508 ± 0.122
ViT-B/1610.142 ± 0.0710.225 ± 0.0680.128 ± 0.0220.303 ± 0.063
ViT-B/1620.195 ± 0.0790.229 ± 0.0550.184 ± 0.0440.324 ± 0.150
ViT-B/1640.256 ± 0.0340.209 ± 0.0360.187 ± 0.0100.449 ± 0.013
ViT-B/1680.297 ± 0.0700.279 ± 0.0550.234 ± 0.0420.540 ± 0.041
DeiT10.150 ± 0.0410.239 ± 0.0300.135 ± 0.0260.339 ± 0.120
DeiT20.210 ± 0.0490.220 ± 0.0040.178 ± 0.0210.356 ± 0.107
DeiT40.252 ± 0.0070.235 ± 0.0120.196 ± 0.0170.494 ± 0.045
DeiT80.251 ± 0.0300.313 ± 0.0390.228 ± 0.0290.485 ± 0.054
SwinV210.134 ± 0.0400.243 ± 0.0100.132 ± 0.0150.210 ± 0.047
SwinV220.278 ± 0.0990.242 ± 0.0210.203 ± 0.0550.464 ± 0.174
SwinV240.287 ± 0.0820.248 ± 0.0410.223 ± 0.0270.535 ± 0.085
SwinV280.285 ± 0.0540.242 ± 0.0270.226 ± 0.0350.578 ± 0.057
ViT-L/16 (MAE)10.090 ± 0.0390.147 ± 0.0160.082 ± 0.0160.277 ± 0.121
ViT-L/16 (MAE)20.125 ± 0.0660.188 ± 0.0210.082 ± 0.0240.271 ± 0.108
ViT-L/16 (MAE)40.121 ± 0.0510.166 ± 0.020.100 ± 0.0160.214 ± 0.075
ViT-L/16 (MAE)80.141 ± 0.0490.182 ± 0.0370.096 ± 0.0210.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 ±\pm 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# VideosMCCMacro RecallMacro F1Accuracy
DMSNet10.112 ±\pm 0.0560.199 ±\pm 0.0110.123 ±\pm 0.0180.310 ±\pm 0.073
DMSNet20.167 ±\pm 0.0740.217 ±\pm 0.0570.158 ±\pm 0.0320.337 ±\pm 0.153
DMSNet40.201 ±\pm 0.0770.229 ±\pm 0.0390.171 ±\pm 0.0220.392 ±\pm 0.099
DMSNet80.290 ±\pm 0.0630.241 ±\pm 0.010.196 ±\pm 0.0190.564 ±\pm 0.049
MaxViT10.163 ±\pm 0.1200.249 ±\pm 0.0280.155 ±\pm 0.0530.331 ±\pm 0.167
MaxViT20.179 ±\pm 0.0780.227 ±\pm 0.0520.161 ±\pm 0.0310.341 ±\pm 0.147
MaxViT40.245 ±\pm 0.0710.256 ±\pm 0.0030.198 ±\pm 0.0180.458 ±\pm 0.104
MaxViT80.311 ±\pm 0.0510.280 ±\pm 0.0470.236 ±\pm 0.0240.550 ±\pm 0.062
DINOv310.067 ±\pm 0.0540.165 ±\pm 0.0550.083 ±\pm 0.0360.184 ±\pm 0.040
DINOv320.050 ±\pm 0.0310.146 ±\pm 0.0130.071 ±\pm 0.0200.163 ±\pm 0.080
DINOv340.107 ±\pm 0.0410.169 ±\pm 0.0170.098 ±\pm 0.0230.222 ±\pm 0.061
DINOv380.172 ±\pm 0.0270.216 ±\pm 0.0130.129 ±\pm 0.0140.301 ±\pm 0.046
EVA-0210.174 ±\pm 0.0380.269 ±\pm 0.0540.166 ±\pm 0.0150.340 ±\pm 0.065
EVA-0220.226 ±\pm 0.0370.228 ±\pm 0.0230.183 ±\pm 0.0250.437 ±\pm 0.100
EVA-0240.233 ±\pm 0.0220.198 ±\pm 0.0450.179 ±\pm 0.0280.482 ±\pm 0.026
EVA-0280.259 ±\pm 0.0670.234 ±\pm 0.0350.202 ±\pm 0.0290.475 ±\pm 0.129
Endo-FM10.067 ±\pm 0.0510.159 ±\pm 0.0570.089 ±\pm 0.0190.203 ±\pm 0.021
Endo-FM20.152 ±\pm 0.0570.157 ±\pm 0.0380.139 ±\pm 0.0240.333 ±\pm 0.090
Endo-FM40.140 ±\pm 0.0550.140 ±\pm 0.0240.137 ±\pm 0.0120.304 ±\pm 0.068
Endo-FM80.193 ±\pm 0.0450.149 ±\pm 0.0120.155 ±\pm 0.0150.392 ±\pm 0.051
CaiT-S2410.205 ±\pm 0.0680.227 ±\pm 0.0340.148 ±\pm 0.0240.396 ±\pm 0.072
CaiT-S2420.220 ±\pm 0.0600.229 ±\pm 0.0350.202 ±\pm 0.0560.430 ±\pm 0.110
CaiT-S2440.220 ±\pm 0.1020.218 ±\pm 0.0580.189 ±\pm 0.0510.445 ±\pm 0.080
CaiT-S2480.349 ±\pm 0.0390.263 ±\pm 0.0210.228 ±\pm 0.0080.604 ±\pm 0.024
SwinV110.121 ±\pm 0.0990.268 ±\pm 0.0080.139 ±\pm 0.0380.275 ±\pm 0.094
SwinV120.200 ±\pm 0.0930.232 ±\pm 0.0510.181 ±\pm 0.0320.422 ±\pm 0.091
SwinV140.271 ±\pm 0.0320.214 ±\pm 0.0170.195 ±\pm 0.0070.556 ±\pm 0.106
SwinV180.307 ±\pm 0.0190.292 ±\pm 0.0180.238 ±\pm 0.0110.558 ±\pm 0.035

Table 8.

Table 9: Architecture-wise MCC differences between k=4k = 4 and k=8k = 8. Both conditions contain 2,010 training frames. Positive values indicate higher mean MCC with broader source-video coverage.

ArchitectureMCC (k=4k = 4)MCC (k=8k = 8)Δ\Delta MCC
DMSNet0.2900.201+0.089
MaxViT0.2450.311+0.066
DINOv30.1070.172+0.065
ResNet500.1950.221+0.026
EfficientNetV2-S0.1940.239+0.045
ConvNeXtV20.2610.276+0.015
ViT-B/160.2560.297+0.041
DeiT0.2520.251−-0.001
SwinV20.2870.285−-0.002
EVA-020.2330.259+0.026
Endo-FM0.1400.193+0.053
MobileNetV3-L0.1950.282+0.087
DenseNet1210.2000.244+0.044
RegNetY-16GF0.1920.250+0.058
EfficientNet-B70.1960.276+0.080
ConvNeXt-Tiny0.2490.284+0.035
CaiT-S240.2200.349+0.129
SwinV10.2710.307+0.036
ViT-L/16 (MAE)0.1210.141+0.02

Table 9.

References

  1. [1]Abu Asaduzzaman, Christian C Thompson, and Md J Uddin. Machine learning approaches for skin neoplasm diagnosis. bioRxiv, pages 2024–05, 2024.DOI
  2. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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.

How AI tools are recorded

Paper details

Cite this paper

Publication

Published
Version
Latest

Data & code

No code, data or supplementary files were declared for this version.

Pick where to look, or just type