Manuscript Offprint

arXiv:2609.08879

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 Peng

Mengmeng Ma¹⁵, Yunxiang Peng²⁵, Tang Li²⁵, Lu Lin³, Binsheng Zhao³, Oguz Akin³, and Xi Peng¹⁵

¹ University of Virginia, Charlottesville, VA, USA

² University of Delaware, Newark, DE, USA

³ Memorial Sloan Kettering Cancer Center, New York City, NY, USA {wkb9cb,naq5rd}@virginia.edu

Abstract. Cancer segmentation models can fail silently, generating plausible but incorrect masks that risk missed findings or unnecessary biopsies. A critical question arises: Do AI models “know” when they are wrong, and if so, can we use the signal to predict their own failures? Humans do have a “Feeling of Error” (FOE): a spontaneous sense of unease that flags a potential error during thinking. We investigate whether cancer segmentation models exhibit an analogous internal signal. Unlike output-level cues (e.g., prediction confidence or uncertainty), which offer no insight into why a failure occurs and suffer from a sensitivity-quality tradeoff where high detection sensitivity could degrade overall segmentation quality. We instead propose to capture the model’s FOE from its inner workings. Using mechanistic interpretability tools, specifically Sparse Autoencoders, we decompose internal neural activations into a dictionary of human-interpretable concepts and show that failure cases exhibit a distinct latent signature: fewer active concepts with lower activation magnitudes compared to successful segmentation. By training a classifier on these concept activations, we achieve accurate failure detection along with explanations for the model’s mistakes. Experiments on prostate, pancreatic, and brain cancer segmentation demonstrate that our approach outperforms output-based methods in failure detection while preserving segmentation quality. Code is available at https://github.com/deep-real/CancerSegFailure.

1 Introduction

The promise of AI in clinical oncology is often undermined by silent failure. Even high-performing models can generate anatomically plausible yet incorrect masks that risk missed findings or unnecessary biopsies [23, 29]. Although clinicians remain the last line of defense, manually verifying numerous AI-generated masks under heavy workloads imposes a significant cognitive burden [44]. This raises a critical question: Do AI models “know” when they are wrong? If so, can we use this signal to predict the silent failures? Interestingly, humans do, through what psychologist called “Feeling of Error” (FOE) [18,69]: a spontaneous sensation of cognitive uneasiness arising from conflict detection during thinking, effectively

M. Ma et al.

acting as an internal signal to flag potential error. We ask whether state-of-the-art ViT-based segmentation models [14, 47, 72] exhibit an analogous FOE-like signal. Identifying such signal would turn segmentation from a black-box output into an auditable decision process. By tracing and examining the corresponding FOE signals, we can automatically flag high-risk cases for inspection or provide the justifications clinicians need to trust, refine, or override AI predictions.

A straightforward way to approximate a model's Feeling of Error is through output-level cues [26, 64], such as prediction confidence or uncertainty estimates (Fig. 1). However, this approach faces two fundamental limitations. First, these signals are rarely actionable. They may warn that a mask is risky but offer no insight into why a failure occurs. Second, correcting flagged failure using output-level cues faces a sensitivity-quality tradeoff: Increasing detection sensitivity catches more failures but also flags borderline, clinically acceptable cases, and unnecessary "corrections" can degrade overall segmentation quality. In our

Figure

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), decomposing internal representations into interpretable concepts that enable failure detection, interpretation, and correction.

experiments, a 20-point gain in failure-detection F1-score via these proxies comes at the cost of a 8–10 point drop in segmentation DSC. This suggests that a model's feeling of error is likely encoded not in what it outputs, but in how it thinks (i.e., its decision-making process).

To peek under the hood of the model's decision-making, we employ mechanistic interpretability tools [6, 55, 62], specifically Sparse Autoencoders (SAEs) [15, 28, 65]. These tools decompose high-dimensional neural activations into a dictionary of human-interpretable "concepts." Our analysis show that ViT-based cancer segmentation models learn concepts that align with established clinical terms (Fig. 1). Crucially, we observe a distinct latent signature in failure cases: Incorrect segmentations activate fewer internal concepts with lower activation magnitudes compared to successful ones (Fig. 2, Left). The model, in some sense, "knows" it is wrong, even when its outputs say otherwise. This internal concept activation is the machine FOE we can leverage. Translating this signal for reliable failure detection raises two challenges. First, where does the signal live? Failures are not monolithic and may not localize to a single layer. A missed tumor might reflect an early-layer visual processing error [16, 40], while misclassifying benign tissue as malignant suggests a deep-layer semantic confusion [56]. Second, how should the signal be modeled? Failures may depend on interactions among concepts (and their spatial arrangement), where individually plausible cues become problematic only under certain co-activation patterns.

Figure

Fig. 2: Distributions of SAE concept activations for success and failure cases on PI-CAI. Left: Number of active concepts (activation value > 0) and Mean concept activation value. On average, success cases have more active concepts with stronger activation values than failure cases. Both metrics show statistically significant separation (p-value < 1e-5, Cohen's d > 1.8), indicating that concept activation patterns distinguish correct from incorrect segmentation. Right: Example success (top) and failure (bottom) cases showing predicted masks and activation patterns for four key concepts. The bar charts display concept activation strengths for each case. Shared concepts #968 (“peripheral zone”) and #204 (“transition zone”) activate in both success and failure cases, reflecting anatomical context. However, tumor-specific concept #469 (“tumor”) shows strong activation only in the success case but minimal in the failure case. These patterns suggest that the model encodes a “feeling of error” in its internal concept activations.

To tackle the challenges, we propose a two-stage framework. First, we build hierarchical “failure representations” by extracting concepts from early, middle, and deep layers. This gives us a comprehensive “vocabulary” for describing failures from low-level visual issues to high-level diagnostic confusions. Second, to enable both accurate failure detection and interpretation, we apply a lightweight classifier on these internal concepts. This classifier can learn complex interaction patterns (e.g., “hyperintense + irregular texture + weak boundaries = likely failure”) while remaining interpretable: each concept’s importance score shows exactly how a concept contributes to the failure prediction.

Our contributions: (1) We move beyond output logits to show that a model’s internal concept representations can not only detect but also explain segmentation failures in clinically meaningful terms. (2) We design a method that extracts failure-predictive concepts across network layers and pinpoints their diagnostic patterns using interpretable classifiers. (3) Empirical verification on prostate and pancreatic cancer shows that our approach achieves superior failure detection performance while providing intuitive explanations and maintaining high segmentation quality.

References (73)