Margin-Consistent Deep Subtyping of Invasive Lung Adenocarcinoma via Perturbation Fidelity in Whole-Slide Image Analysis
Authors: Meghdad Sabouri Rad, Junze, Huang, Mohammad Mehdi Hosseini, Rakesh Choudhary, Saverio J. Carello, Ola El-Zammar, Michel R. Nasr, Bardia Rodd
Organizations: Vincent · Department of Pathology, SUNY Upstate Medical University, Syracuse, NY, 13210, USA. · Columbia University, New York, NY, 10027, USA.
Whole-slide image classification for invasive lung adenocarcinoma subtyping remains vulnerable to real-world imaging perturbations that undermine model reliability at the decision boundary. We propose a margin consistency framework evaluated on 203,226 patches from 143 whole-slide images spanning five adenocarcinoma subtypes in the BMIRDS-LUAD dataset. By combining attention-weighted patch aggregation with margin-aware training, our approach achieves robust feature-logit space alignment measured by Kendall correlations of 0.88 during training and 0.64 during validation. Contrastive regularization, while effective at improving class separation, tends to over-cluster features and suppress fine-grained morphological variation; to counteract this, we introduce Perturbation Fidelity (PF) scoring, which imposes structured perturbations through Bayesian-optimized parameters. Vision Transformer-Large achieves 95.20 +/- 4.65% accuracy, representing a 40% error reduction from the 92.00 +/- 5.36% baseline, while ResNet101 with an attention mechanism reaches 95.89 +/- 5.37% from 91.73 +/- 9.23%, a 50% error reduction. All five subtypes exceed an area under the receiver operating characteristic curve (AUC) of 0.99. On the WSSS4LUAD external benchmark, ResNet50 with an attention mechanism attains 80.1% accuracy, demonstrating cross-institutional generalizability despite approximately 15-20% domain-shift-related degradation and identifying opportunities for future adaptation research.
Figures & tables
Figure 1: Proposed attention-based robust histopathology subtyping framework integrating cross-entropy and contrastive learning with margin consistency. Whole-slide images (WSIs) are divided into fixed-size patches and normalized before passing through a patch encoder and an attention-based feature extractor hψa(x) . The resulting feature representation z is used for both classification via a linear classifier fθa(x)=w⊤z+b and representation learning via supervised contrastive loss. Cross-entropy loss LCE , contrastive loss LCON , and Perturbation Fidelity loss LPF are combined as total loss LT . Margin consistency is computed using logit differences and feature margins to guide robust decision boundaries. This multitask learning scheme enhances feature discriminability, maintains high-margin consistency, and improves robustness against subtyping brittleness.
Model
LCE
LCE+LCON
LCE+LCON+LPF
ResNet50+Attn
90.63 ± 9.36
92.54 ± 6.90**
94.80 ± 6.12 ***
[87.3, 93.9]
[89.8, 95.3]
[91.8, 97.8]
ViT-L
92.00 ± 5.36
93.78 ± 4.98*
95.20 ± 4.65 ***
[89.1, 94.9]
[91.2, 96.4]
[92.6, 97.8]
ResNet101+Attn
91.73 ± 9.23
93.18 ± 4.51**
95.89 ± 5.37 ***
[88.4, 95.0]
[90.5, 95.9]
[93.3, 98.5]
Table 1: Ablation analysis on BMIRDS-LUAD dataset with statistical significance. Values represent accuracy (%) ± standard deviation. Statistical significance assessed via McNemar’s test comparing each configuration against CE-only baseline: * p<0.05 , ** p<0.01 , *** p<0.001 . 95% bootstrap confidence intervals shown in brackets.
Method
Accuracy (%)
95% CI
p -value
DeepSlide Wei et al. (2019) †
90.4
[87.1, 93.7]
< 0.001***
Independent ResNet101 †
79.5
[75.2, 83.8]
< 0.001***
Unsupervised Sheikh et al. (2022) †
94.6
[91.8, 97.4]
0.042*
Proposed (Ours)
95.89
[93.3, 98.5]
—
† Re-implemented and evaluated on our dataset using identical protocols.
Table 2: Comparison of classification accuracy on the BMIRDS-LUAD dataset. All baseline methods were re-implemented and evaluated on our dataset using identical preprocessing, train/validation splits, and evaluation protocols to ensure fair comparison. Statistical significance assessed via McNemar’s test comparing each method against our proposed approach.
Architecture
Accuracy (%)
95% CI
Δ vs Internal
Domain Shift
ResNet50+Attn
80.1 ± 11.5
[74.2, 86.0]
− 14.7%
Moderate
ResNet101+Attn
78.7 ± 8.3
[73.9, 83.5]
− 17.2%
Moderate
ViT-L
73.1 ± 10.1
[67.4, 78.8]
− 22.1%
Substantial
Table 3: Cross-dataset validation results on WSSS4LUAD benchmark demonstrating generalizability. Models trained on BMIRDS-LUAD and evaluated on WSSS4LUAD without fine-tuning. Performance degradation quantified relative to internal validation.
Figure 2: Domain shift analysis for external validation on WSSS4LUAD. (a) Per-subtype accuracy comparison. (b) Domain shift sources. (c) External confusion matrix. (d) Error sources by subtype.
Architecture
Baseline (%)
Our Method (%)
Improv. (%)
ResNet50+Attn
90.63±9.36
94.80±6.12
+4.17
ViT-L
92.00±5.36
95.20±4.65
+3.20
ResNet101+Attn
91.73±9.23
95.89±5.37
+4.16
Table 4: Statistical significance analysis of accuracy improvements with experimental results.
Comparison
McNemar’s χ2
p -value
Cohen’s d
Effect Size
CE vs. CE+CON+PF (Full Method)
ResNet50+Attn
14.23
< 0.001***
0.53
Medium
ViT-L
11.87
< 0.001***
0.64
Medium
ResNet101+Attn
16.42
< 0.001***
0.55
Medium
CE+CON vs. CE+CON+PF (PF Contribution)
ResNet50+Attn
5.12
0.024*
0.31
Small
Table 5: Statistical significance of accuracy improvements using McNemar’s test for paired classifier comparison. McNemar’s test is the appropriate statistical test for comparing classifiers evaluated on the same dataset, as it accounts for the paired nature of predictions and focuses on discordant cases Dietterich (1998) . Effect sizes quantified using Cohen’s d .
Subtype
Sensitivity
Specificity
PPV
NPV
AUC
Fisher’s p
Solid
0.988
0.992
0.981
0.995
0.9996
< 0.001***
Lepidic
0.964
0.997
0.986
0.992
0.9983
< 0.001***
Acinar
0.989
0.988
0.982
0.993
0.9988
< 0.001***
Papillary
0.979
0.996
0.989
0.993
0.9998
< 0.001***
Note: Micropapillary merged with Papillary due to limited samples ( n<10 ).
Table 6: Per-subtype discrimination performance for ResNet101 with attention mechanism with full loss ( LCE+LCON+LPF ). Statistical significance assessed using Fisher’s exact test comparing classification performance between baseline (CE-only) and proposed method.
Architecture
Baseline CI
Our Method CI
Var. Red.
Levene’s p
ResNet50+Attn
[87.3, 93.9]
[91.8, 97.8]
57.2%
0.003**
ViT-L
[89.1, 94.9]
[92.6, 97.8]
24.7%
0.041*
ResNet101+Attn
[88.4, 95.0]
[93.3, 98.5]
66.2%
< 0.001***
Table 7: Bootstrap confidence intervals (95%, 1,000 iterations) and variance reduction analysis. Variance reduction calculated as (σbaseline2−σours2)/σbaseline2×100% . Statistical significance of variance reduction assessed via Levene’s test.
Figure 3: Bootstrap confidence intervals (95%) demonstrating accuracy improvements and enhanced model stability across architectures. Our method (green) shows consistently higher accuracy with reduced variance compared to baseline (red).
Lung adenocarcinoma (LUAD) grading depends on accurately identifying growth patterns, which are indicators of prognosis and can influence treatment decisions. Common deep learning approaches to determine the predominant pattern rely on patch-level classification or segmentation, requiring extensive annotations. This study proposes an attention-based multiple instance learning (ABMIL) framework to predict the predominant LUAD growth pattern at the whole slide level to reduce annotation burden. Our approach integrates pretrained pathology foundation models as patch encoders, used either frozen or fine-tuned on annotated patches, to extract discriminative features that are aggregated through attention mechanisms. Experiments show that fine-tuned encoders improve performance, with Prov-GigaPath achieving the highest agreement (\k{appa} = 0.699) under ABMIL. Compared to simple patch-aggregation baselines, ABMIL yields more robust predictions by leveraging slide-level supervision and spatial attention. Future work will extend this framework to estimate the full distribution of growth patterns and validate performance on external cohorts.
Laura Valeria Perez-Herrera, M. J. Garcia-Gonzalez, Karen Lopez-Linares
* Vicomtech Foundation, Basque Research and Technology Alliance (BRTA) · ± eHealth Group, Bioengineering Area, Biogipuzkoa Health Research Institute
Gastric adenocarcinoma (GA) is a leading cause of cancer-related mortality worldwide, and accurate histopathological subtype classification from whole-slide images (WSIs) is essential for effective treatment planning. While multimodal approaches that integrate pathology report text with WSIs can improve classification, existing methods often depend on computationally expensive transformer architectures and large language models. We propose a multimodal knowledge distillation (MKD) framework that combines a pretrained WSI image encoder and a clinical text encoder using Low-Rank Multimodal Fusion (LMF) to efficiently model cross-modal interactions during training. Each WSI is represented as a bag of patches paired with a slide-level diagnostic caption. The teacher model learns fused image-text representations for subtype classification, while the student model distills this knowledge to enable accurate image-only inference. We evaluate our method on the PatchGastric benchmark dataset and achieve at least 3.35% higher mean accuracy than state-of-the-art approaches, without relying on transformer-based fusion, multi-task learning, or large language models. The source code is available at https://github.com/helomelo1/MKD-LMF.
Spatial mapping of lung adenocarcinoma (LUAD) growth patterns across whole slide images (WSIs) requires resolving architectural context at the region level, yet existing methods operate at the individual tile level and produce generic morphological clusters rather than clinically defined pattern maps. We propose a weakly supervised Bag-of-Visual-Words (BoVW) pipeline that learns a visual vocabulary from frozen foundation model embeddings extracted from a small set of annotated regions of interest (ROIs). Pattern prototypes are constructed as mean BoVW histograms of same-label ROIs and used for nearest-prototype classification of sliding-window regions under Jensen--Shannon divergence. The resulting predictions are projected onto the WSI tile grid to produce interpretable spatial pattern maps. We evaluate the method on 87 CPTAC-LUAD patients using three foundation model encoders and multiple vocabulary sizes on two clinically motivated tasks. For tumour/healthy classification, the best configuration achieves a balanced accuracy of 0.974 with H-Optimus-1, approaching the 0.987 obtained by a supervised SVM trained on mean-pooled WSI embeddings. For binary histologic grade classification, the BoVW pipeline achieves higher balanced accuracy than the supervised baseline for all encoders, suggesting that ROI-level pattern decomposition preserves grade-relevant heterogeneity that is attenuated by global mean pooling.
Darya Ardan, Valentin Oreiller, Henning Müller
Department of Computer Science, University of Geneva, Geneva, Switzerland · Informatics Institute, University of Applied Sciences Western Switzerland (HES-SO Valais), Sierre, Switzerland · Radiology Service, Medical Faculty, University of Geneva, Geneva, Switzerland