Medical AI Encodes a "Feeling of Error": Verifying Cancer Segmentation via Internal Concepts

Mengmeng Ma, Yunxiang Peng, Tang Li, Lu Lin, Binsheng Zhao, Oguz Akin, Xi PengarXiv 2026

TL;DR

Medical AI models for cancer segmentation often "fail silently," producing plausible but incorrect results. This paper demonstrates that these models possess an internal "Feeling of Error" (FOE) encoded in their hidden layers, which can be extracted using Sparse Autoencoders to detect and explain failures more effectively than standard uncertainty metrics.

What Problem Does This Paper Address?

In clinical oncology, AI segmentation models are powerful but risky. A model might generate a mask that looks anatomically correct to a casual observer but actually misses a tumor or misidentifies benign tissue as malignant. These are known as silent failures.

Current methods to catch these errors usually rely on "output-level cues," such as prediction confidence or entropy. However, these metrics have two major flaws:

  1. Lack of Interpretability: They tell you a mask is "risky" but not why.
  2. The Sensitivity-Quality Tradeoff: If you set a high threshold to catch every possible failure, you end up flagging (and potentially "correcting") many successful segmentations, which actually degrades the overall quality of the AI's work.

The authors ask: Do AI models "know" internally when they are making a mistake? And can we use that internal signal to build a better safety net?

Methods

The researchers turned to mechanistic interpretability, specifically using Sparse Autoencoders (SAEs).

Standard neural network activations are "polysemantic"—a single neuron might fire for many different unrelated features, making it hard to read. SAEs decompose these complex activations into a large dictionary of sparse, "monosemantic" concepts. In this paper, these concepts often align with clinical terms like "tumor," "peripheral zone," or "gland margin."

Fig. 1: Two sources for capturing a model’s Feeling of Error (FOE). Output-level cues (left) are limited to uninterpretable logit statistics, offering no insight into failure causes. We instead extract the model’s FOE from its inner workings (right), decompos- ing internal representations into interpretable concepts that enable failure detection, inter- pretation, and correction.

The authors' framework follows a two-stage process:

  1. Hierarchical Extraction: They train SAEs on multiple layers (early, middle, and deep) of a Vision Transformer (ViT) backbone (specifically MedSAM). This captures everything from low-level visual artifacts to high-level semantic confusion.
  2. Failure Diagnosis: They concatenate these concept activations into a "failure representation" and train a lightweight classifier (XGBoost) to predict whether the segmentation is a success or a failure.

Because the classifier works on interpretable concepts, it can explain its reasoning (e.g., "Failure predicted because of weak 'tumor' concept activation combined with strong 'gland margin' activation").

Datasets

The study evaluated the approach across three major cancer types:

  • Prostate Cancer: PI-CAI (1,500 mp-MRI scans) and Prostate158 (used for zero-shot testing).
  • Pancreatic Cancer: PanTS (700 CT scans).
  • Brain Tumor: MSD-Brain (484 MRI scans, discussed in the supplementary material).

Key Insights and Ideas

  • The Latent Signature of Failure: The most striking finding is that success and failure look fundamentally different inside the model. Successful segmentations activate a high number of internal concepts with strong magnitudes. Failure cases, even when the output mask looks "confident," show significantly fewer active concepts and much weaker activation strengths.
  • Semantic Grounding: By checking spatial overlaps and consulting with board-certified radiologists, the authors confirmed that the unsupervised concepts discovered by the SAEs actually correspond to real anatomical structures.
  • Layer-wise Specialization: Not all layers are equal. Deep layers are generally better at predicting success (identifying the presence of a tumor), while middle layers are often more sensitive to the specific patterns that lead to failures.
Fig. 3: Predictive power of SAE concepts across layers for segmentation failures. We directly use each concept’s activation score and the ground-truth failure labels to com- pute the AUROC for each concept. Each bar shows AUROC improvement over random chance (∆random = AUROC−0.5) for the top 5 most discriminative concepts per layer. Blue bars indicate concepts predictive of success cases (success-predictive), while red bars indicate concepts predictive of failure cases (failure-predictive). Deep layers exhibit stronger predictive power overall, middle layers show more failure-predictive concepts, and early layers have weaker discriminative ability.
  • Failure Correction: Because the system operates at the "patch" level, it doesn't just flag a whole image as a failure. It can identify specific false-positive patches and remove them, effectively "cleaning up" the AI's output and improving the final Dice Similarity Coefficient (DSC).

Key Results

  • Breaking the Tradeoff: Unlike baseline methods (like Entropy or Max Probability), the proposed method improved failure detection (F1-score) without sacrificing segmentation quality (DSC). On the Prostate dataset, it achieved a +8.7 gain in DSC and a +6.2 gain in F1 compared to the best baseline Pareto front.
  • Zero-Shot Generalization: When a detector trained on the PI-CAI dataset was tested on the completely unseen Prostate158 dataset, standard baselines collapsed to near-random performance (AUROC ~50-53%). The concept-based detector maintained a robust 73.6% AUROC, proving that internal "feelings of error" are more generalizable than output probabilities.
  • Efficiency: The system is lightweight. Adding the failure detection pipeline only increases per-image latency by about 3.7% during routine use.

Limitations and Future Work

While the results are promising, the authors note a few areas for growth:

  • Correlation vs. Causation: The current method identifies concepts that co-occur with failure. While they performed some causal interventions (amplifying concepts to see how the mask changed), more work is needed to map the exact mechanistic pathways of error.
  • Universal SAEs: Currently, a separate SAE is trained for each cancer type. A "universal" SAE that understands general anatomical primitives across all organs would be a significant step forward.
  • Granular Failure Modes: The current system uses a binary "success/failure" label. Future versions could distinguish between different types of errors, such as boundary inaccuracies versus total misses, to give clinicians even more actionable feedback.

Summary updated

BibTeX
@misc{ma2026medical,
  author = {Mengmeng Ma and Yunxiang Peng and Tang Li and Lu Lin and Binsheng Zhao and Oguz Akin and Xi Peng},
  title = {{Medical AI Encodes a "Feeling of Error": Verifying Cancer Segmentation via Internal Concepts}},
  year = {2026},
  eprint = {2609.08879},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.08879},
}
Figure