Finding a few seconds of bleeding or ulceration in a capsule endoscopy video works like this: a swallowed camera records the gut for hours, and the abnormal frames make up a tiny fraction of the stream. The most recent strong system for this task, VISTA, uses two large frozen image and video encoders and places a five-head neural ensemble on top of them, trained with imbalance-aware losses on only 80 videos. It then applies a hand-written decoder that enforces anatomy: the capsule moves one way, from mouth to colon. VISTA's own ablation shows that this decoder alone lifts validation [email protected] from 0.3002 to 0.4730. That gain is larger than anything the paper attributes to the neural heads. A separate line of clinical work finds that heavily regularized linear models trained on small cohorts travel better to new hospitals than deep models do.
This note proposes to test, directly, whether the right design for small-data rare-event video detection is a linear scorer for each frame, paired with a structured temporal decoder that is trained jointly with it, rather than a nonlinear ensemble with heuristic cleanup afterward. Stated in two sentences: put almost no capacity in the per-frame classifier and put the domain knowledge into the decoder over time. We predict that this matches the nonlinear ensemble on in-distribution data and degrades less when the recording site or device changes.
Core Claim
The claim has two parts. The first is that once encoder features are frozen and temporal structure is enforced, a nonlinear frame head adds little or nothing over a regularized, cost-weighted linear head, even under extreme imbalance. The second is that the nonlinear head does real harm under acquisition shift.
The first part is motivated by VISTA's decoder ablation and by EEG-Bench, which found that linear discriminant analysis (0.813 accuracy) beat EEG foundation models on a low-data diagnostic task. The second part is motivated by the liver-transplant study Predicting Long-Term Allograft Survival. There, a six-variable linear Cox score trailed DeepHit in-distribution (concordance 0.819 vs. 0.828) but beat it on an external Canadian cohort (0.847 vs. 0.749). The stroke radiomics study non-contrast CT radiomics for hemorrhagic transformation points the same way: LASSO logistic regression reached a validation AUC of 0.957 and outperformed XGBoost.
Those studies concern tabular or static-image data. Whether the same pattern holds over frozen video embeddings with temporal decoding is untested, and it is not obvious that it should hold. Frozen foundation features may already be nonlinear enough that the head's capacity is irrelevant either way.
The Model
Each frame $t$ of a video gets a frozen feature vector $x_t$, the concatenation of the spatial and short-clip temporal embeddings VISTA uses. Each frame also gets a label $y_t$ that pairs an anatomical region with a finding: normal, or one of the pathology classes. A labelling of the whole video is scored as
$$ S(y; x) = \sum_t w_{y_t}^\top x_t + \sum_t \psi(y_{t-1}, y_t), $$
where $w_k$ is a linear weight vector for label $k$, and $\psi$ is a transition score. $\psi$ is set to $-\infty$ for anatomically impossible moves, such as going from colon back to stomach. It is learned for allowed moves, such as entering or leaving a lesion.
The best labelling under $S$ is found exactly by dynamic programming (the Viterbi algorithm), so the anatomical prior becomes a hard constraint during both training and inference rather than a filter applied afterward. The weights are trained with a structured hinge loss. In this loss, the margin a wrong labelling must be beaten by grows with a cost, $\Delta(y, \hat y)$, which charges missed pathology frames far more than false alarms. Concretely, the cost uses inverse-prevalence weights in the spirit of the cost-sensitive loss from Deep Cost-sensitive Learning for Wheat Frost Detection. An elastic-net penalty on $w$ provides the regularization, following the elastic-net derivation of the liver score.
The model has a few thousand parameters per class, fits in minutes on a CPU once features are cached, and can be inspected weight by weight.
Research Program
The program asks one question: where does performance come from, and where does it break? To answer it, we hold the frozen encoders fixed across all conditions and vary two factors independently.
The first factor is head capacity. Its levels are a linear head, a two-layer network, and VISTA-style five-head ensembles trained with focal and asymmetric losses. The second factor is how temporal structure enters. Its levels are none, VISTA's post-hoc anatomy-aware decoding, and the jointly trained constrained decoder above.
Crossing these factors gives nine cells. Every cell is evaluated twice: once in-distribution, using grouped cross-validation over Galar videos, and once under acquisition shift.
Defining the shift is the weakest part of the available data, and we state it plainly. The Galar hidden test set is three NaviCam examinations, which is too few to support a conclusion about shift on its own. We therefore build shift splits in two ways. If Galar metadata identify device or center, we split by device or center. We also transfer frame-level heads trained on Galar features to the multi-source Capsule Vision 2024 data, whose test set of 4,385 frames comes from a separate institution (AIIMS), and to Kvasir-Capsule. Both transfers are restricted to the pathology classes the label sets share. The frame-level transfers test only the head, not the decoder, and we report them as such.
A second analysis looks at which features the head relies on. For the linear model, we can read off which embedding dimensions carry the weight and check whether those dimensions differ between sources. That check is a direct probe of the "spurious site signal" mechanism the clinical literature proposes.
Baselines
The naive reference is a frozen-feature linear head trained with plain cross-entropy and no temporal decoding, thresholded per class. It shows how much of the gap the cost weighting and structure close. The wheat-frost paper's unweighted SVM, at 95.0% accuracy but 16.7% recall, is the cautionary example of what this reference can look like under imbalance.
The strongest existing method is VISTA. Its reported numbers are a test [email protected] of 0.3530 and an [email protected] of 0.3235 on the Galar hidden test set, plus the validation pair of 0.4730 with its anatomy decoder and 0.3002 without it. We will reimplement its head ensemble and decoder over identical cached features. All arms get the same folds and the same hyperparameter search budget, measured in trials, chosen on inner validation folds. The search budget is the fair resource to match; raw compute is not, because the linear model is far cheaper. We report its gap to VISTA's published numbers so readers can judge the reimplementation. Beating VISTA means matching its in-distribution [email protected] within fold-level confidence intervals while losing significantly less under the shift splits. A pure in-distribution win is not required for the claim.
The key ablation is the linear head plus VISTA's post-hoc decoder, with no joint training. It isolates whether joint structured training matters beyond simply removing capacity from the head.
Finally, a parameter-efficient fine-tuning baseline, following Learning to Adapt DINOv2 for Capsule Endoscopy, adapts the encoder with low-rank adapters (LoRA). That paper reports 97.75% accuracy on Kvasir-Capsule. Accuracy is close to uninformative on a dataset where one class has over 34,000 images and another has 12, so we will compare on balanced accuracy and temporal mAP instead.
Why not just…?
Why not just use a linear probe with VISTA's post-hoc decoder? This is the most serious threat, and it may work as well as the proposal. If it matches the jointly trained decoder, the method contribution collapses, but the central finding survives: head capacity is not where performance comes from, and simple heads are safer under shift. We will report that outcome as the result. The jointly trained decoder should matter mainly at the strict [email protected] boundary threshold, because post-hoc filtering cannot move a boundary that the frame scores placed badly. The ablation cell measures exactly this.
Why not just fine-tune the encoder with LoRA? Adapting the encoder gives the model more room to absorb site-specific texture, which is precisely the failure the liver and radiomics studies describe. The Kvasir-Capsule results show only that adaptation helps in-distribution. The from-scratch transformer in Transformer-Based Disease Identification reached 79.15% on the same data, so that comparison says nothing about transfer. The shift splits settle the question. If LoRA plus the structured decoder transfers as well as the frozen linear head, frozen features are not the essential ingredient, and we would say so.
Why not just filter normal frames with a one-class model first, as DC-Prophet does? The two-stage design in DC-Prophet worked on tabular server metrics, where its first stage missed only 11 of nearly 9,000 failures. In video, normal mucosa changes appearance from organ to organ. A single "normal" boundary would therefore flag region transitions as anomalies, whereas the structured decoder models those transitions explicitly. We include a one-class filter feeding the linear head as an extra arm to check this argument.
Why not just oversample the rare frames? The wheat-frost study found that loss reweighting beat GAN-based synthesis. The maximum-profit mining work similarly found that direct cost-based splitting outperformed resampling-based MetaCost. We add one SMOTE-in-feature-space arm only to confirm that this pattern holds over embeddings.
Decisive Checks
The primary metrics are temporal mAP at 0.5 and 0.95 overlap on Galar folds, along with false alarms per hour at fixed recall, because alarm fatigue is the operational cost in this setting. On the frame-level transfer sets, we report the Capsule Vision combined score of mean AUC plus balanced accuracy. That paper reports 0.6072 for the top submission and 0.3597 for a ResNet50V2 baseline.
The claim is confirmed if three things hold. Across the capacity axis, in-distribution differences fall within fold noise once structure is present. The shift gap, meaning the drop from in-distribution to shifted performance, grows with head capacity. And the linear weights that dominate within one source lose weight or flip sign in the other, which would point to site signal.
The claim is refuted if the five-head ensemble keeps a significant lead both in-distribution and under shift. In that case, frozen features plus imbalance demand nonlinearity, and the clinical "simpler is safer" pattern does not extend to video.
References
- VISTA: Validation-Guided Integration of Spatial and Temporal Foundation Models with Anatomical Decoding for Rare-Pathology VCE Event Detection
- EEG-Bench: A Benchmark for EEG Foundation Models in Clinical Applications
- Predicting Long-Term Allograft Survival in Liver Transplant Recipients
- Constructing machine learning models based on non-contrast CT radiomics to predict hemorrhagic transformation after stoke: a two-center study
- Deep Cost-sensitive Learning for Wheat Frost Detection
- Capsule Vision 2024 Challenge: Multi-Class Abnormality Classification for Video Capsule Endoscopy
- Learning to Adapt Foundation Model DINOv2 for Capsule Endoscopy Diagnosis
- Transformer-Based Disease Identification for Small-Scale Imbalanced Capsule Endoscopy Dataset
- DC-Prophet: Predicting Catastrophic Machine Failures in DataCenters
- Maximum profit mining and its application in software development