In differential diagnosis (DDx), a clinician explains a diagnosis by the few findings that separate it from the alternatives. Medical image classifiers cannot yet explain themselves this way. Existing explanations are either faithful but spread over hundreds of concepts, or compact but leave part of each decision unexplained. We present DDxBasis, which explains a classifier on a frozen foundation encoder as a differential diagnosis in three steps. First, a concept bottleneck reads all patch tokens at every encoder layer using gated, second-order slot attention. A concept basis then regroups the concepts into two-pole axes, each a differential between groups of diagnoses. Finally, we read a differential diagnosis from each axis through the typical presentation of its poles, the pertinent findings of the case, and counterfactual edits of borderline cases. Across five medical datasets, DDxBasis is the most accurate frozen-encoder model and close to the best published domain-specific results. Because every concept adds its own evidence, its reproducible concept basis splits each decision exactly, at no cost in accuracy. Without ordered stage or concept labels, the axes recover cell lineages and rare subtypes, agree with dermatologists' structure annotations, and expose planted and real shortcuts.
Figures & tables
Figure 2: Overview of DDxBasis on a PBC band neutrophil. Gated slots on every layer detect concepts ( Sec. 3.2 ), a two-pole basis regroups them into axes whose evidence sums exactly to the logits ( Sec. 3.3 ), and each axis is read via (a) pole atlases with VLM names, (b) its margin map, position, and margin, and (c) counterfactual edits toward the alternative ( Sec. 3.4 ). frozen; trained; new.
Method
Skin
PBC
OBM
BMC
Chest
(i) Frozen readout
Linear probe, last layer
71.1 ± 0.2
96.6 ± 0.1
62.5 ± 0.3
59.4 ± 0.2
75.2 ± 0.0
Linear probe, 12-layer vote §
76.8 ± 0.1
98.3 ± 0.0
69.8 ± 0.3
69.8 ± 0.3
76.8 ± 0.3
Attentive probe [ 31 ] (ICML’24)
76.4 ± 0.4
98.3 ± 0.1
68.5 ± 0.6
70.1 ± 1.1
79.2 ± 0.2
Head2Toe [ 33 ] (ICML’22)
75.2 ± 0.5
97.6 ± 0.3
72.7 ± 0.3
65.5 ± 0.7
77.4 ± 0.4
(ii) Prototype / compact head
Table 1: Classification accuracy on five medical tasks. Mean test balanced accuracy over 3 seeds (macro AUROC for chest), ± s.d. over seeds. Best in bold, second underlined. Shaded rows read several layers. \lx@sectionsign Softmax averaged over 12 per-layer CLS ∥ mean probes. ‡ Multi-label adaptation for chest (Supp. Sec. S5.2).
(a) Within a layer (skin)
Mean acc. ↑
Att. coverage ↑ (overlap ↓ )
Slot similarity ↓
Shared errors ↓
Seed agreement ↑
Probe heads (CLS ∥ mean)
67.1
1.00 (–)
–
0.43
–
MQA ( n=12 )
73.8
0.26 (0.58)
0.50
0.39
0.01
Slot attention (SA, n=12 )
74.5
1.00 (0.22)
0.45
0.39
0.48
SA + covariance
76.4
0.99 ( 0.17 )
0.59
0.40
0.66
+ gates (ours)
75.0
0.99 ( 0.16 )
0.48
0.37
0.60
(b) Merging across depth
Skin
PBC
OBM
BMC
Chest
Table 2: Ablations. (a) Per-layer pooling on skin, mean accuracy over the 12 layers. (b) Merging across depth, where feature fusion shows the best of six cross-layer readouts per task. (c) The final concept basis per task (validation). Metrics in Sec. 4 , best in bold, second underlined, full versions in Supp. Tables S7, S6, and S5.
Figure 3: Structural comparison of concept bases. Ours vs. the best of five families on six properties (skin, 0–1, outward is better). Definitions and all methods in Supp. Sec. S8.
Figure 4: Maturation axes learned on PBC (left) and BMC (right) without ordered stage labels. Each axis orders cells from immature (+) to mature ( − ) (Spearman ρ=0.87 and 0.81 ). Shown per dataset: pole atlases with pole maps, stage densities along the axis, one real cell sample per stage ( real ), and counterfactual edits along the maturation axis ( simulated ).
band-shaped nucleus (0.69); prominent nucleoli (0.65); abundant cytoplasm (0.64); pale gray cytoplasm (0.63); large cell (0.62); hairy cytoplasmic projections (0.62); indented kidney-shaped nucleus (0.61); fine azurophilic granules (0.60); Auer rods (0.59); high nucleus to cytoplasm ratio (0.56); deeply basophilic blue cytoplasm (0.55); fine open chromatin (0.55); perinuclear halo (0.55); small cell (0.54); segmented multilobed nucleus (0.54); mature cell (0.51); round nucleus (0.50); cytoplasmic vacuoles (0.49); bare nucleus without cytoplasm (0.47); pink cytoplasm (0.46); cell debris (0.46); eccentric nucleus (0.45); immature blast cell (0.41); agranular cytoplasm (0.39); condensed clumped chromatin (0.38); scant cytoplasm (0.34)
Chest
MedSigLIP
perihilar haziness (0.86); blunting of the costophrenic angle (0.81); basal opacity with a meniscus sign (0.81); hyperinflated lungs with flattened diaphragms (0.78); airspace consolidation (0.77); enlarged cardiac silhouette (0.74); visible pleural line without lung markings (0.74); clear lungs (0.73); lung opacity (0.72)
patchy infiltrates (0.64)
Table S1. Term lists and admissible terms. The attribute terms scored by each naming VLM, split into admissible terms and the others, highest first.
Axis
Differential (− ↔ +)
− pole names
+ pole names
Skin E0
MEL, AKIEC ↔ NV, VASC
▸ pigment network; ▸ dots and globules
pigment network; ▸ red-blue lacunae
Skin E1
MEL, NV ↔ BKL, AKIEC
pigment network ; red-blue lacunae
▸ comedo-like openings
Skin E2
VASC, DF ↔ NV, MEL
ulceration; ▸ red-blue lacunae
pigment network ; ▸ pigment network; ▸ dots and globules
Skin E3
AKIEC, BCC ↔ BKL, MEL
▸ ulceration; ▸ blue-gray ovoid nests
comedo-like openings
Skin E4
DF ↔ AKIEC
ulceration
comedo-like openings; pigment network
Skin E5
BCC, VASC ↔ AKIEC, DF
▸ red-blue lacunae
pigment network
Table S2. Differential and pole names of each axis. Consensus of three seeds. Kept VLM terms come first (axis descriptors in bold), then boundary cues (▸), and a pole with neither lists its held-out measurements. The last six rows read the chest basis on PA films only (main Fig. 1).
Figure S1 (part 1 of 2). Caption on the next page.
Figure S1. Axis atlases of the four public datasets: (a) skin, (b) PBC, (c) BMC, and (d) chest. Each row is one axis. Each pole shows its two most typical validation images with the pole map (green), its two strongest names (◆ axis descriptor, ▸ verified cue), and the classes its evidence favors (consensus of three seeds). The center gives the axis name (Table S4 , with its ⚑ mark) above the validation densities of up to eight classes along the axis. Names come from MONET on skin and MedSigLIP elsewhere, and every image is correctly classified.
Dataset, model
Axis, pole
Name
Reference
Verdict
Skin, MONET
E0 +
pigment network
Task 2 masks: mask contrast −0.09 (toward −)
wrong sign
Skin, MONET
E1 −
pigment network
Task 2 masks: mask contrast −0.37 (toward −)
agrees
Skin, MONET
E2 +
pigment network
Task 2 masks: mask contrast +0.12 (toward +)
agrees
Skin, MONET
E4 +
pigment network
Task 2 masks: mask contrast +0.08 (toward +)
agrees
Skin, MONET
E5 +
pigment network
Task 2 masks: mask contrast +0.40 (toward +)
agrees
PBC, MedSigLIP
E0 −
indented kidney-shaped nucleus
stage order within NEU, IG
agrees
Table S3. Names checked against annotations. Consensus of three seeds. The reference is the ISIC 2018 Task 2 masks on skin and the maturation stages on PBC.
boundary VASC vs AKIEC: red-blue lacunae −2.35; VASC vs DF −1.77; lesion size +0.93 s.d.
Table S4. Axis labels. Consensus of three seeds, named by the precedence rule of Sec. S2 . ⚑ marks an acquisition or context variable. Measurements are within-class pole contrasts on validation images (s.d.), boundary cues are contrasts between two classes, and ρ is the Spearman correlation of class medians. The last six rows use PA films only (main Fig. 1 and Sec. 5.4).
Family
Method
Encoder
Trained parts
Schedule
Learning rate
Code
Frozen readout
Linear probe (last layer), attentive probe
DINOv3-B, frozen
head only
30 epochs
grid, chosen on validation
ours, a standard head trained side by side with the others under the same protocol as our concept bottleneck
Linear probe, 12-layer vote
DINOv3-B, frozen
one linear head per layer
30 epochs
grid, chosen on validation
ours, one linear head per layer, no reference code needed
Head2Toe
DINOv3-B, frozen
group-lasso feature selection + linear head
10 epochs selection + 30 epochs head
1e-4; sparsity, fraction and weight decay chosen on validation
PyTorch port, as the official code is JAX for other backbones
Cross-layer fusion (main Table 2b)
ScalarMix, VFusion, ALF, concatenated CLS and CLS‖mean heads
DINOv3-B, frozen
head only
30 epochs
grid, chosen on validation
ours, from the papers (no released VFusion code, ScalarMix exists only for NLP), under the same protocol as our concept bottleneck
Prototype / compact head
PNP
DINOv3-B, frozen
part prototypes + head
official, stage 2 ≈ 540k images
official
port of the official code
PIP-Net
DINOv3-B, frozen
prototypes + head
official medical schedule, ≈ 2k + 10k updates
official
port of the official code
Table S5a. Training settings of the Table 1 baselines. Checkpoints are chosen on validation. Hyperparameters are tuned on validation where the table says so, and otherwise follow the official settings.
Arm
Mean acc. ↑
Att. coverage ↑ (overlap ↓ )
Slot similarity ↓
Shared errors ↓
Seed agreement ↑
Skin
Probe heads (CLS‖mean)
67.1
1.00 (—)
—
0.43
—
MQA (n = 12)
73.8
0.26 (0.58)
0.50
0.39
0.01
Slot attention (SA, n = 12)
74.5
1.00 (0.22)
0.45
0.39
0.48
SA + covariance
76.4
0.99 ( 0.17 )
0.59
0.40
0.66
+ gates (ours)
75.0
0.99 ( 0.16 )
0.48
0.37
0.60
Table S5. Main Table 2a on all five datasets. Best per dataset in bold, second underlined.
Readout across depth
Skin
PBC
OBM
BMC
Chest
Best single layer
80.0 ± 0.2
99.0 ± 0.1
73.3 ± 0.3
74.7 ± 0.4
80.2 ± 0.2
Feature fusion: Head2Toe (main Table 1)
75.2 ± 0.5 (79.6)
97.6 ± 0.3 (98.4)
72.7 ± 0.3 (63.2)
65.5 ± 0.7 (69.1)
77.4 ± 0.4 (79.7)
Feature fusion: ScalarMix
73.7 ± 0.8 (78.6)
97.5 ± 0.2 (97.7)
69.8 ± 0.1 (61.7)
64.3 ± 0.2 (64.5)
75.4 ± 0.0 (77.2)
Feature fusion: VFusion
70.8 ± 0.4 (72.0)
98.4 ± 0.1 (98.8)
70.6 ± 0.4 (64.7)
65.1 ± 0.4 (71.1)
68.4 ± 0.3 (71.6)
Feature fusion: ALF
72.0 ± 0.5 (76.4)
96.5 ± 0.1 (96.4)
63.1 ± 0.1 (58.8)
58.4 ± 0.3 (59.9)
73.0 ± 0.1 (75.5)
Feature fusion: single head on the concatenated CLS
69.2 ± 1.0 (71.9)
98.3 ± 0.1 (99.2)
71.3 ± 0.3 (64.8)
68.7 ± 0.4 (66.4)
73.9 ± 0.0 (75.3)
Table S6. Every readout across depth (full main Table 2b). Test, mean ± s.d. over 3 seeds, with the best score per dataset in bold and the second best underlined. The feature-fusion rows fuse the encoder features of all layers, give the validation score in brackets, and italicize the readout that main Table 2b reports on each dataset, chosen on validation.
Figure S2. The best single layer lies mid-depth, and summing the evidence of all layers climbs above every one of them. Test score of each layer’s head alone (blue, with a ring on the peak layer) and of the logit sum of layers 1 to k (orange), against the best frozen probe or layer fusion of main Table 1 (dashed) and the best frozen-encoder baseline of any family in main Table 1 (dash-dot).
Dataset
Effective axes ↑
Axes per decision ↓ (concepts)
Seed match ↑ (median)
Stability ↑ (concepts)
Decisions on 1 / 2 / 3 / ≥ 4 axes (%)
Most used axis, margin share (%)
Axes leading ≥ 5% of decisions
Distinct class leaders (classes)
Least needed axis, in 80% set (%)
Skin
5.42/6
2.0 (26.0)
0.89 (0.96)
0.82 (0.72)
6.9 / 69.5 / 22.8 / 0.8
30.6
5
5 (5)
11.6
PBC
3.95/4
1.7 (21.3)
0.99 (0.99)
0.96 (0.86)
40.7 / 23.0 / 34.6 / 1.6
33.4
4
4 (8)
23.1
OBM
3.88/4
1.0 (20.3)
0.98 (0.98)
0.78 (0.60)
78.6 / 19.8 / 1.6 / 0.0
35.0
4
4 (5)
6.3
BMC
5.62/6
2.7 (27.3)
0.85 (0.90)
0.97 (0.92)
7.5 / 40.3 / 41.7 / 10.5
32.4
3
3.7 (17)
16.5
Chest
5.61/6
1.0 (15.3)
0.88 (0.95)
0.93 (0.81)
75.3 / 15.3 / 9.0 / 0.4
32.8
4
5 (10)
6.2
Table S7. The basis on all five datasets (full main Table 2c).
Readout
Skin
PBC
OBM
BMC
Chest
DINOv3-B/16 (main paper)
Linear probe
71.1 ± 0.2
96.6 ± 0.1
62.5 ± 0.3
59.4 ± 0.2
75.2 ± 0.0
Best layer
80.0 ± 0.2
99.0 ± 0.1
73.3 ± 0.3
74.7 ± 0.4
80.2 ± 0.2
Logit sum
86.1 ± 0.2
99.4 ± 0.0
78.6 ± 0.3
80.6 ± 0.3
81.3 ± 0.0
DINOv2-B/14
Linear probe
69.8 ± 0.4
96.8 ± 0.2
58.4 ± 1.4
62.1 ± 0.4
75.2 ± 0.2
Table S8. The logit sum with other frozen backbones. Linear probe reads the last layer, Best layer is the single layer chosen on validation, and Logit sum is main Eq. (3). Test, mean ± s.d. over 3 seeds. The last row repeats the domain-specific SOTA ranges of main Table 1, each under its own protocol (Sec. S5.2 ).
Family
Method
Exactness ↑
Balance ↑
Completeness ↑
Distinctness ↑
Coherence ↑
Reproducibility ↑
Factor rotation
Varimax
1.00
0.54
0.98
0.67
0.93
0.47
Promax
1.00
0.56
0.98
0.61
0.96
0.29
ICA
1.00
0.55
0.98
0.54
0.99
0.47
Sparse PCA
1.00
0.59
0.99
0.55
0.97
0.48
PCA †
1.00
0.53
0.98
0.65
0.94
0.68
Correlation clustering
k -means (ACE)
1.00
0.59
0.97
0.43
0.98
0.73
Table S9. All 19 condensations of main Fig. 3. † Shown in main Fig. 3, the method of each family with the highest lowest score. Our basis is set in bold.
Variant
Balance ↑
Distinctness ↑
Coherence ↑
Reproducibility ↑ (median)
Full recipe (main Fig. 3)
0.80
0.91
0.78
0.83 (0.95)
Without balance band
0.46
0.87
0.92
0.60 (0.96)
Without volume
0.79
0.39
0.99
0.93 (0.98)
Without coherent poles
0.80
0.97
0.29
0.86 (0.94)
Without consensus
0.77
0.92
0.78
0.19 (0.84)
Table S10. Ablation of the basis terms (main Sec. 5.2). Skin, scored as in main Fig. 3. Removing a term mainly breaks the property it protects, on the diagonal. Reproducibility is the worst-matched axis, with the median in brackets.
Dataset, split (images)
Recon. LPIPS
Reader: maturation
Random control
Selectivity
PBC, test (96)
0.0003
0.36 (0.30–0.43)
≤ 0.07
4.1–7.5 †
BMC, val. (68)
0.0011
0.26 (0.18–0.35)
≤ 0.04
7.4–14.3 ‡
Table S11. Counterfactual edits move the requested axis and keep the cell. Reader: maturation is the ConvNeXt reader’s change per requested s.d. (95% CI), Random control is the same reader under an edit of the same size in a random direction, and Selectivity is the edited axis’s shift per requested s.d. over the mean absolute shift of the other axes (range over axes).
Abnormal vs parent
n, rare vs. common
Separate labels
Merged parent labels
Hairy cell vs lymphocyte
409 vs. 26,242
0.86 ± 0.02
0.81 ± 0.01
Immature vs mature lymphocyte
65 vs. 26,242
0.98 ± 0.00
0.89 ± 0.02
Faggot cell vs promyelocyte
47 vs. 11,994
0.91 ± 0.03
0.92 ± 0.01
Table S12. Abnormal cells against their parent class on a training-selected axis (AUROC, mean ± s.d. over three seeds). Bold marks the higher of the two AUROCs.
Structure
Diagnosis alone
Six axis positions alone
Gain
Pigment network
0.61
0.78 ± 0.01
+0.17
Globules
0.51
0.64 ± 0.01
+0.13
Streaks
0.55
0.68 ± 0.05
+0.13
Negative network
0.69
0.78 ± 0.01
+0.09
Milia-like cysts
0.54
0.55 ± 0.00
+0.01
Mean
0.58
0.69 ± 0.01
+0.11
Table S3a. The six skin axis positions predict the dermatologists’ structures better than the diagnosis. Held-out AUROC on the Task 2 test lesions, mean ± s.d. over three seeds.
Dataset
None
1 axis
1 concept
24 concepts
Concepts matching 1 axis
Skin
82.3
94.8
85.1
96.9
12
PBC
99.2
99.7
99.3
99.8
24
OBM
75.3
83.2
78.0
83.8
24
BMC
83.9
93.2
85.6
96.1
12
Table S13. One corrected axis does the work of 12 to 24 corrected concepts. Validation balanced accuracy, mean of 3 seeds, worst parts corrected first. The last column is the fewest corrected concepts that reach the accuracy of one corrected axis.
Training marker
Strong dot
Weak dot
Dot share on one pole
0.83
0.74
Aligned → reversed
−25.1
−11.5
Axis removal, reversed
+19.9
+5.2
Axis removal, unmarked
+1.6
+1.2
Best other-axis removal
−1.2
−0.6
Table S14. A planted dot lands on one axis at both strengths and is removed with it. Skin, test, mean over 3 seeds. Rows 2–5 are changes in balanced accuracy (points). One model per dot, the strong dot on 90% of melanomas and 5% of other lesions, the weak dot on 80% and 10%. Reversed moves the dot onto the other classes. A dot-free model scores 84.6 aligned and 84.9 reversed.
Axis (variable)
Var. AUROC
AUROC with / against
Gap (95% CI)
Verdict
Chest E0, E2 (view)
0.85 / 0.86
0.881 / 0.656
0.225 (0.210–0.242)
relied on
Chest E4 (rotation)
0.79
0.821 / 0.775
0.046 (0.030–0.062)
small *
BMC E2 (crowding)
0.74
0.984 / 0.977
0.007 (0.004–0.010)
negligible
Skin E0 (excision)
0.86
0.983 / 0.963
0.020 (0.003–0.037)
small
Table S15. Acquisition audit. Test, mean over 3 seeds, gap CI from the bootstrap of the text. Var. AUROC is how well the position separates the groups. * Not via the film corners.
Effective differential diagnosis depends on well structured and unambiguous patient case descriptions, since incomplete or ambiguous clinical information readily leads to diagnostic errors and inconsistent reasoning. Large Language Models (LLMs) have recently shown promising capabilities in medical question answering and clinical reasoning; however, even when achieving competitive performance on medical benchmarks, they often rely on pattern recognition learned from training data rather than grounded clinical evidence, and can generate plausible yet unsupported diagnostic conclusions. Their reasoning remains largely opaque, making it difficult for clinicians to assess the evidence and rationale behind a given recommendation. To address this gap, we propose an ontology-guided, multiagent differential diagnosis framework that replicates the iterative reasoning process of physicians. The framework grounds diagnostic inference in a structured, expert-curated medical knowledge base, enabling interpretation of symptoms, clinical findings, or disease relationships, while decomposing diagnosis into explicit, auditable reasoning steps. This ontology-based grounding constrains inference to evidence-backed associations, reducing hallucination and improving diagnostic transparency, traceability, and consistency. The system then identifies the most discriminative missing symptoms and generates targeted follow-up questions to reduce uncertainty through a process that mirrors to clinical inquiry. Together, these components improve the reliability, explainability, and diagnostic accuracy of AI-assisted differential diagnosis. The source code is publicly available.
Deep learning models have achieved strong performance in medical image analysis, but their internal decision processes remain difficult to interpret. Concept Bottleneck Models (CBMs) partially address this limitation by structuring predictions through human-interpretable clinical concepts. However, existing CBMs typically overlook the contextual dependencies among concepts. To address these issues, we propose an end-to-end interpretable framework DCG-Net that integrates multimodal alignment with structured concept reasoning. DCG-Net introduces a Dual Cross-Attention module that replaces cosine similarity matching with bidirectional attention between visual tokens and canonicalized textual concept-value prototypes, enabling spatially localized evidence attribution. To capture the relational structure inherent to clinical concepts, we develop a Parametric Concept Graph initialized with Positive Pointwise Mutual Information priors and refined through sparsity-controlled message passing. This formulation models inter-concept dependencies in a manner consistent with clinical domain knowledge. Experiments on white blood cell morphology and skin lesion diagnosis demonstrate that DCG-Net achieves state-of-the-art classification performance while producing clinically interpretable diagnostic explanations.
Getamesay Dagnaw, Xuefei Yin, Muhammad Hassan Maqsood +2
School of Information and Communication Technology, Griffith University, QLD, Australia
Disease classification from patient-reported symptom descriptions is usually approached with lightweight discriminative models or with autoregressive large language models (LLMs), which understand language broadly but generate text token by token and require output parsing. We study decision foundation models, which score a closed set of candidate labels in a single forward pass without generating text. We adapt Clef-Flash, a 9-billion parameter decision model built on a Qwen3.5 backbone, to the 24-class Symptom2Disease benchmark using 4-bit quantized low-rank adaptation (QLoRA) on a stratified split of 960 training and 240 test cases. The fine-tuned model reaches 95.42% accuracy (95% CI 91.98-97.42%) and a macro F1 of 0.9551, up from 65.00% for the unadapted weights (62.92% through the remote API). However, TF-IDF linear SVM and logistic regression baselines trained on the same split reach 98.75% (95% CI 96.39-99.57%) with sub-millisecond CPU inference, so on this benchmark the fine-tuned model offers no accuracy advantage over a well-tuned linear classifier. A Leave-One-Symptom-Out clause-ablation analysis of four illustrative narratives shows predictions depending on distinguishing clauses: in a psoriasis example, removing the clause describing silvery scales lowers the predicted probability from above 99.99% to 0.12% and shifts the prediction to impetigo, while removing other clauses changes it by less than 0.001 percentage points. Decision architectures deliver structured, single-pass predictions from large language backbones, but short, lexically distinctive benchmarks such as Symptom2Disease cannot show an advantage over simple baselines; validation on longer, real clinical text and clinician review are needed.
S. M. Mahbub Uddin Ahmed
Department of Computer Science and Engineering, United International University