Pathologists diagnose diseases by first locating suspicious tissue and then examining it at higher magnification, whereas self-supervised vision transformers (ViTs) allocate the same spatial resolution to every image region despite diagnostic evidence being sparse and spanning multiple biological scales. Recent pathology foundation models have substantially improved representation quality by scaling training data and model capacity, but largely retain uniform tokenization. We instead investigate whether pathology representations can be improved by learning where to allocate spatial resolution during self-supervised learning. To this end, we propose CRAFT (Coarse-to-fine Region-Adaptive Feature Tokenization), a DINO-based framework that learns image-dependent mixed-scale representations by using self-supervised attention to selectively refine informative regions while preserving coarse context, together with a symmetric cross-scale regularization objective that encourages complementary coarse and fine representations. Across CAMELYON16, TCGA-Lung subtype classification, and TCGA-LUAD survival prediction, CRAFT consistently outperforms comparable-scale self-supervised methods while requiring lower inference computation. Despite using only a compact 22M parameter backbone trained on comparatively small pathology datasets, CRAFT remains competitive with, and often surpasses, substantially larger pathology foundation models.
Figures & tables
Figure 1: (a) Class attention maps guide mixed-scale tokenization by refining salient regions while keeping others coarse. (b) Tumor recall via linear probing on CAMELYON16 after SSL pretraining at two token sizes (16 vs 32).
Figure 2: (a) Mixed-scale tokenization (green, Ours ) is inserted into both DINO branches before the ViT; the rest is standard DINO, with gradients through the student only. Coarse and refined predictions Pcs , Prs are aligned by LKL-sym (Eq. 5 ). (b) Coarse-to-fine pipeline: Stage 1 encodes coarse tokens and selects key regions by class attention; Stage 2 re-splits and fuses them ( ⊕ ).
Method
Encoder
Pretrain
DS
AB
Trans
Max
Avg
#P
GMACs
Reproduced under our 5-seed MIL protocol
UNI † [ 10 ]
ViT-L/16
DINOv2
96.06 ± 1.85
90.04 ± 2.62
97.26 ± 0.74
97.10 ± 1.19
95.12
307M
59.70
Virchow † [ 47 ]
ViT-H/14
DINOv2
95.00 ± 1.74
93.95 ± 2.60
94.90 ± 1.68
93.59 ± 0.63
94.36
632M
161.99
CONCH † [ 34 ]
ViT-B/16
iBOT+CoCa
92.47 ± 0.98
92.34 ± 0.89
95.77 ± 1.16
90.49 ± 0.33
92.77
86M
16.87
H0-mini † [ 18 ]
ViT-B/14
DINOv2
98.23 ± 0.81
97.58 ± 0.34
97.87 ± 0.37
99.22 ± 0.00
98.23
86M
22.31
CTransPath † [ 50 ]
Swin-T
SRCL
85.62 ± 2.34
88.08 ± 1.95
96.31 ± 0.56
90.45 ± 2.22
90.12
28M
4.51
Table 1: WSI classification AUC (%) on CAMELYON16 (mean ± std over 5 runs). Among reproduced rows, best bold , second underlined ; † external pretraining; Avg = mean over DS/AB/Trans/Max MILs.
Method
Encoder
Pretraining
Mean AUC
#P
Frozen public Encoder trained on Massive Data
Massive Data
UNI [ 10 ]
ViT-L/16
DINOv2, Mass-100K
96.81
307M
Virchow [ 47 ]
ViT-H/14
DINOv2, MSK-1.5M
96.67
632M
H0-mini ¶ [ 18 ]
ViT-B/14
DINOv2 distill, TCGA
97.79
86M
CTransPath ¶ [ 50 ]
Swin-T
SRCL, TCGA+PAIP
92.81
28M
RetCCL ¶
ResNet-50
TCGA+PAIP (CCL)
85.61
23.5M
Table 2: WSI subtype classification on TCGA-Lung (LUAD vs. LUSC), AUC (%) on the fixed 256-slide test set, averaged over four MIL aggregators. Each aggregator value is the mean over five model-selection folds. Top: public encoders trained on massive data; bottom: low-data 22M encoders. Best bold , second underlined among 22M encoders. \lx@paragraphsign pretraining overlaps our TCGA test split, so AUC may be inflated.
Figure 3: Survival prediction on TCGA-LUAD (selected encoders). Bars show mean ± std across 5 folds; color encodes compute (GMACs).
Table 6
Figure 4: (a) Mixed-scale tokenization on CAMELYON16 patches: key regions are refined to fine tokens while background and stroma stay coarse. (b) Self-attention maps for selected heads, comparing DINO (fine) with CRAFT under selective and coarse inference; input shown left.
Encoder
Arch. (dim)
KRAS
EGFR
TP53
STK11
Macro
Virchow
ViT-H/14 (2560)
54.3 ±5.9
54.0 ±4.3
60.6 ±5.8
49.7 ±11.0
54.65
H0-mini
ViT-B/14 (1536)
56.4 ±5.1
54.6 ±7.6
69.4 ±6.2
64.1 ±6.7
61.13
UNI
ViT-L/16 (1024)
56.3 ±4.7
55.6 ±3.7
63.7 ±5.1
55.2 ±5.4
57.71
CRAFT-mixed
ViT-S/16 (384)
57.8 ±4.5
56.8 ±6.0
65.5 ±3.4
61.3 ±8.9
60.35
Table 5: Driver-gene mutation prediction on TCGA-LUAD. Weakly-supervised ROC-AUC (%), DSMIL [ 31 ] aggregation; encoder is the only variable. Mean ± std over 5 patient-level, label-stratified folds; Macro = mean over genes. Bold and Underlined show the first and second best methods per column.
Method
Encoder
Pretraining
DS
AB
Trans
Max
Avg
#P
Frozen public Encoder trained on Massive Data
Massive Data
UNI [ 10 ]
ViT-L/16
DINOv2, Mass-100K
97.82 ±0.49
95.47 ±1.87
98.10 ±1.15
95.83 ±0.34
96.81
307M
Virchow [ 47 ]
ViT-H/14
DINOv2, MSK-1.5M
97.53 ±0.21
95.37 ±1.12
97.80 ±1.37
95.96 ±0.28
96.67
632M
CTransPath ¶ [ 50 ]
Swin-T
SRCL, TCGA+PAIP
93.80 ±0.28
91.21 ±2.20
96.88±0.99
89.34 ±0.46
92.81
28M
RetCCL ¶
ResNet-50
TCGA+PAIP (CCL)
87.80±1.26
83.57±1.38
95.14±1.97
75.92±2.11
85.61
23.5M
H0-mini ¶ [ 18 ]
ViT-B/14
DINOv2 distill, TCGA
98.35 ±0.19
96.90 ±1.10
98.18 ±0.90
97.71 ±0.24
97.79
86M
Table 6: Per-aggregator WSI subtype classification on TCGA-NSCLC (LUAD vs. LUSC), AUC (%). DS/AB/Trans/Max = DSMIL, ABMIL, TransMIL, Max-pooling; Avg = mean of the four. Among 22M encoders ( Low Data ), best bold , second underlined . \lx@paragraphsign TCGA overlap may inflate AUC.
Model
Encoder
C-index
GMACs
DINO-HistoPretrain † [ 55 ]
ViT-B/16
56.9 ±5.5
17.6
GigaPath † [ 53 ]
ViT-G/14
56.2±0.52
228.1
UNI † [ 10 ]
ViT-L/16
57.1±9.1
61.55
H0-mini † [ 18 ]
ViT-B/14
56.5±2.43
23.5
HIPT † [ 9 ]
Hier. ViT
53.8±4.0
4.6
CTransPath † [ 50 ]
Swin-T
51.2±5.0
4.5
Table 7: Survival prediction (C-index) on TCGA-LUAD. † External pretraining. All methods use CLAMSurvival [ 55 ] ; C-indices except Ours are quoted from [ 55 ] . GMACs: single 224×224 forward pass (ResNet-50/ViT-B/Swin-T from literature; HIPT dominated by its cell-level ViT-S/16, ≈ 4.6).
Coarse–fine
Val.
Test (mixed-scale [CLS] )
Label-free
λ (KL sym )
cls_sim
KL ( ×10−3 )
Bal. Acc.
Bal. Acc.
Macro-F1
Eff. rank ↑
Part. ratio ↑
0.5 (default)
0.993
0.16
98.81
90.97
90.46
13.3
6.7
2.0
0.975
0.35
98.09
89.64
89.55
10.4
5.5
5.0
0.824
54.3
89.47
77.87
77.32
6.1
3.6
Table 8: λ -sensitivity on NCT-CRC-HE-100K (mixed-scale [CLS] ; single run per row). Row shading marks the regime: safe → caution → over-regularized collapse . cls_sim/KL are model-level (final epoch). ∗ Operating point selected on validation Bal. Acc.
Figure 5: λ -sensitivity of CRAFT (ViT-S/16; single run per λ ) on NCT-CRC-HE-100K / CRC-VAL-HE-7K.
Linear Probing
MIL
ID
Model
TS
MF
LKL-asym
LKL-sym
ACC
Prec
Recall
Avg AUC
Avg Recall
Max
GMACs
O1
CRAFT
16
✓
✓
×
98.16
92.3
80.7
96.74
96.74
97.67 ± 0.48
5.76
C1
CRAFT
16
×
✓
×
97.97
94.2
75.6
95.59
94.80
95.66 ± 1.18
5.76
MF effect (mixed, 16/32 )
O2
CRAFT
16/32
✓
✓
×
97.80
93.8
73.2
95.65
94.19
95.66 ± 2.76
4.01
C2
CRAFT
16/32
×
✓
×
97.73
92.9
73.0
92.76
91.02
94.37 ± 0.63
4.01
Table 9: Component ablation of CRAFT. Each block removes one component from a CRAFT operating point (full → ablated); Δ is the change on the key metric of that block. LP Recall is tumor recall.
Figure 6: Self-attention maps from the six final-layer teacher heads for three tissue regions (input on the left). Top row of each pair: selective grid; bottom row: coarse grid. Brighter is higher attention.
Figure 7: Visualization of adaptive mixed-scale tokenization applied to histopathology patches. High-attention regions, typically rich in cellular structures, are refined into fine-grained tokens, while background and less informative stromal areas remain at a coarse resolution. This hierarchical tokenization strategy preserves diagnostically relevant morphological features while optimizing computational efficiency.
Figure 8: Teacher–student selection agreement. Top: teacher branch; bottom: student branch. Left: global CLS attention. Center: selected tokens overlaid on the input. Right: CLS attention. Both branches attend to and select the same regions, showing the two-branch design preserves a consistent token selection.
Figure 9: Mixed-scale tokenization vs. tumor annotations on CAMELYON16. Each pair (a–d): CRAFT tokenization grid (left) and pathologist annotation of tumor outlined in blue (right). Finer tokens follow dense/high-contrast morphology, not the annotated tumor extent.