Enhancing Lung Cancer Subtype Classification Using Histopathology Foundation Models in Weakly-Supervised and Unsupervised Learning Frameworks
The Indian Pathology Dataset for Lung Cancer (IPD-LUNG) is a curated histopathology dataset comprising 311 high-resolution hematoxylin and eosin (H&E) whole slide images (WSIs) of non-small cell lung cancer from an Indian cohort. The study evaluates two complementary computational pathology pipelines for lung cancer subtyping:
- A weakly supervised multiple instance learning (MIL) framework.
- A label-free phenotype discovery pipeline followed by supervised slide-level classification.
On IPD-LUNG, the best weakly supervised MIL configuration, DSMIL with CONCH features, achieved 0.916 accuracy and 0.912 AUC. The best phenotype-composition configuration, Leiden cluster-count representations with CONCH features followed by an MLP classifier, achieved 0.8677 accuracy and 0.9033 AUC. Cross-dataset evaluation with TCGA-NSCLC demonstrates strong generalization across population and acquisition differences.
IPD-LUNG/
|-- ABMIL/ # CLAM-based ABMIL reproduction notes
|-- DSMIL/ # DSMIL pipeline, coordinate tracking, HistAuGAN integration
|-- DTFD/ # DTFD-MIL pipeline with CLAM-style preprocessing
|-- Leiden/ # Leiden phenotype discovery and cluster-count evaluation
|-- PANTHER/ # PANTHER reproduction notes and split-conversion helper
|-- figures/ # Figures used in the README
`-- README.md
IPD-LUNG contains 311 H&E-stained WSIs from 309 lung cancer patients:
- 207 lung adenocarcinoma (LUAD) slides.
- 104 lung squamous cell carcinoma (LUSC) slides.
- TIFF-format WSIs scanned at 40x magnification.
- Patient metadata include age, sex, anatomical site/location, and available IHC markers for a subset of patients.
The IPD-LUNG dataset generated in this study is made publicly available through open data repository for healthcare datasets (https://india-data.org/dataset-details/875502dc-3684-41e9-8cfd-d8758e1a141d). Users are required to create an account on the repository. Upon registration, they are granted immediate access to the dataset without any further approval. The released dataset includes digitized whole-slide images, slide-level LUAD/LUSC labels, and the accompanying de-identified clinical metadata described in the manuscript.
The external TCGA-NSCLC LUAD/LUSC dataset used for cross-dataset experiments is publicly available through The Cancer Genome Atlas.
This work benchmarks four patch encoders with three MIL aggregators:
- Encoders: CONCH, UNI, ViT-Base DINOv2, and ResNet-50.
- Aggregators: ABMIL, DSMIL, and DTFD.
ABMIL was run through the official CLAM repository using --model_type mil.
See ABMIL/README.md. DTFD and DSMIL are documented in
DTFD/README.md and DSMIL/README.md.
HistAuGAN was evaluated as a stain-normalization step before CONCH + DSMIL
feature extraction. The DSMIL feature extraction script supports this through
--stain_norm HistAuGAN and --histaugan_weights. See
DSMIL/README.md.
HistAuGAN weights used for the experiment can be downloaded from:
https://drive.google.com/file/d/1uObebkPgx_q6cZznGaUps-RfoSrUhNnD/view?usp=sharing
The manuscript compares:
- PANTHER prototype-based unsupervised slide representation learning using the official Mahmood Lab PANTHER repository. See PANTHER/README.md.
- The Leiden cluster-count representation implemented in Leiden/README.md.
Both methods use CLAM-compatible patch features and the same patient-stratified folds for fair comparison.
All metrics are mean ± standard deviation over 10 repeated patient-stratified folds unless otherwise stated.
| Aggregator | Feature Extractor | Accuracy | AUC | Precision | Recall | F1-Score |
|---|---|---|---|---|---|---|
| ABMIL | CONCH | 0.858 ± 0.056 | 0.897 ± 0.042 | 0.871 ± 0.046 | 0.858 ± 0.056 | 0.856 ± 0.054 |
| ABMIL | UNI | 0.890 ± 0.033 | 0.951 ± 0.037 | 0.897 ± 0.032 | 0.890 ± 0.033 | 0.891 ± 0.032 |
| ABMIL | ViT-B (DINOv2) | 0.739 ± 0.087 | 0.763 ± 0.101 | 0.733 ± 0.129 | 0.739 ± 0.087 | 0.717 ± 0.110 |
| ABMIL | ResNet-50 | 0.758 ± 0.056 | 0.795 ± 0.073 | 0.744 ± 0.110 | 0.758 ± 0.056 | 0.738 ± 0.079 |
| DTFD | CONCH | 0.894 ± 0.050 | 0.953 ± 0.038 | 0.871 ± 0.120 | 0.810 ± 0.094 | 0.832 ± 0.077 |
| DTFD | UNI | 0.897 ± 0.034 | 0.953 ± 0.034 | 0.889 ± 0.101 | 0.800 ± 0.118 | 0.831 ± 0.063 |
| DTFD | ViT-B (DINOv2) | 0.755 ± 0.070 | 0.783 ± 0.091 | 0.656 ± 0.158 | 0.640 ± 0.162 | 0.626 ± 0.091 |
| DTFD | ResNet-50 | 0.658 ± 0.115 | 0.683 ± 0.105 | 0.518 ± 0.117 | 0.680 ± 0.194 | 0.561 ± 0.100 |
| DSMIL | CONCH | 0.916 ± 0.043 | 0.912 ± 0.073 | 0.904 ± 0.044 | 0.906 ± 0.042 | 0.905 ± 0.043 |
| DSMIL | UNI | 0.894 ± 0.047 | 0.895 ± 0.078 | 0.906 ± 0.044 | 0.893 ± 0.048 | 0.893 ± 0.048 |
| DSMIL | ViT-B (DINOv2) | 0.781 ± 0.095 | 0.779 ± 0.084 | 0.820 ± 0.069 | 0.780 ± 0.085 | 0.755 ± 0.116 |
| DSMIL | ResNet-50 | 0.784 ± 0.080 | 0.781 ± 0.106 | 0.811 ± 0.071 | 0.784 ± 0.080 | 0.784 ± 0.081 |
For the CONCH + DSMIL pipeline, the non-normalized run achieved 0.916 ± 0.044 accuracy and 0.912 ± 0.073 AUC. The HistAuGAN-normalized run achieved 0.906 ± 0.047 accuracy and 0.905 ± 0.065 AUC. Precision was slightly higher after normalization, 0.917 ± 0.041 versus 0.904 ± 0.045, but recall and F1-score were comparable or lower. This work concludes that HistAuGAN did not provide a measurable benefit for LUAD/LUSC classification in this setting.
| Method | Encoder | Accuracy | AUC | Precision | Recall | F1-Score |
|---|---|---|---|---|---|---|
| PANTHER | CONCH | 0.816 ± 0.095 | 0.908 ± 0.069 | 0.818 ± 0.092 | 0.816 ± 0.095 | 0.813 ± 0.094 |
| PANTHER | UNI | 0.822 ± 0.058 | 0.905 ± 0.048 | 0.824 ± 0.058 | 0.822 ± 0.058 | 0.821 ± 0.058 |
| Leiden Cluster-Count | CONCH | 0.867 ± 0.030 | 0.903 ± 0.043 | 0.872 ± 0.030 | 0.867 ± 0.030 | 0.863 ± 0.035 |
| Leiden Cluster-Count | UNI | 0.816 ± 0.054 | 0.823 ± 0.049 | 0.816 ± 0.061 | 0.816 ± 0.054 | 0.812 ± 0.055 |
| Method | Train Set | Test Set | Accuracy | AUC | Precision | Recall | F1-Score |
|---|---|---|---|---|---|---|---|
| MIL | IPD-LUNG | IPD-LUNG | 0.916 ± 0.043 | 0.912 ± 0.073 | 0.904 ± 0.044 | 0.906 ± 0.042 | 0.905 ± 0.043 |
| MIL | IPD-LUNG | TCGA-NSCLC | 0.878 ± 0.031 | 0.944 ± 0.021 | 0.884 ± 0.030 | 0.879 ± 0.029 | 0.878 ± 0.031 |
| MIL | TCGA-NSCLC | TCGA-NSCLC | 0.932 ± 0.023 | 0.972 ± 0.017 | 0.936 ± 0.017 | 0.931 ± 0.030 | 0.932 ± 0.025 |
| MIL | TCGA-NSCLC | IPD-LUNG | 0.877 ± 0.018 | 0.931 ± 0.007 | 0.885 ± 0.011 | 0.877 ± 0.019 | 0.879 ± 0.017 |
| Phenotype Composition + MLP | IPD-LUNG | IPD-LUNG | 0.867 ± 0.030 | 0.903 ± 0.043 | 0.872 ± 0.030 | 0.867 ± 0.030 | 0.863 ± 0.035 |
| Phenotype Composition + MLP | IPD-LUNG | TCGA-NSCLC | 0.803 ± 0.037 | 0.915 ± 0.012 | 0.815 ± 0.029 | 0.803 ± 0.037 | 0.800 ± 0.039 |
| Phenotype Composition + MLP | TCGA-NSCLC | TCGA-NSCLC | 0.891 ± 0.026 | 0.961 ± 0.030 | 0.897 ± 0.026 | 0.891 ± 0.026 | 0.891 ± 0.026 |
| Phenotype Composition + MLP | TCGA-NSCLC | IPD-LUNG | 0.839 ± 0.026 | 0.908 ± 0.020 | 0.847 ± 0.025 | 0.839 ± 0.026 | 0.841 ± 0.025 |
Each pipeline has its own setup and reproduction notes:
- ABMIL: CLAM installation, patching, feature extraction,
split generation, and
--model_type miltraining. - DTFD: DTFD-MIL pipeline using CLAM-style preprocessing.
- DSMIL: DSMIL training, heatmaps, and HistAuGAN-normalized feature extraction.
- Leiden: Leiden clustering, cluster-count slide representations, MLP classification, and SHAP/phenotype visualization.
- PANTHER: Official PANTHER setup and split conversion for reproducing the PANTHER benchmark.
This repository contains the IPD-LUNG-specific preprocessing, feature extraction, MIL training notes, Leiden phenotype discovery code, visualization utilities, and evaluation documentation. Some manuscript components intentionally rely on external upstream repositories:
- CLAM for WSI patching, feature extraction, and ABMIL: https://github.com/mahmoodlab/CLAM
- PANTHER for prototype-based aggregation: https://github.com/mahmoodlab/PANTHER
- Proteus-pytorch for DINOv2 encoder training: https://github.com/BeSpontaneous/Proteus-pytorch
If you use this code or the IPD-LUNG dataset, please cite the manuscript. The final citation will be added after publication.
@inproceedings{ilse2018attention,
title={Attention-based Deep Multiple Instance Learning},
author={Ilse, Maximilian and Tomczak, Jakub and Welling, Max},
booktitle={International Conference on Machine Learning},
year={2018}
}
@article{lu2021data,
title={Data-efficient and weakly supervised computational pathology on whole-slide images},
author={Lu, Ming Y. and Williamson, Drew F. K. and Chen, Tiffany Y. and Chen, Richard J. and Barbieri, Matteo and Mahmood, Faisal},
journal={Nature Biomedical Engineering},
volume={5},
number={6},
pages={555--570},
year={2021}
}
@inproceedings{li2021dual,
title={Dual-stream multiple instance learning network for whole slide image classification with self-supervised contrastive learning},
author={Li, Bin and Li, Yin and Eliceiri, Kevin W.},
booktitle={CVPR},
pages={14318--14328},
year={2021}
}
@inproceedings{zhang2022dtfd,
title={DTFD-MIL: Double-tier feature distillation multiple instance learning for histopathology whole slide image classification},
author={Zhang, Hongrun and Meng, Yanda and Zhao, Yitian and Qiao, Yihong and Yang, Xiaoyun and Coupland, Sarah E. and Zheng, Yalin},
booktitle={CVPR},
pages={18802--18812},
year={2022}
}
@inproceedings{song2024morphological,
title={Morphological Prototyping for Unsupervised Slide Representation Learning in Computational Pathology},
author={Song, Andrew H. and Chen, Richard J. and Ding, Tong and Williamson, Drew F. K. and Jaume, Guillaume and Mahmood, Faisal},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
year={2024}
}@article{lu2024visual,
title={A visual-language foundation model for computational pathology},
author={Lu, Ming Y. and Chen, Bowen and Williamson, Drew F. K. and Chen, Richard J. and Liang, Ivy and Ding, Tong and Jaume, Guillaume and Odintsov, Igor and Le, Long Phi and Gerber, Georg and Mahmood, Faisal},
journal={Nature Medicine},
year={2024}
}
@article{chen2024uni,
title={Towards a general-purpose foundation model for pathology},
author={Chen, Richard J. and Ding, Tong and Lu, Ming Y. and Williamson, Drew F. K. and Jaume, Guillaume and Chen, Bowen and Zhang, Andrew and Shao, Daniel and Song, Andrew H. and Shaban, Muhammad and Mahmood, Faisal},
journal={Nature Medicine},
year={2024}
}We acknowledge IHub-Data, IIIT Hyderabad (H1-002) for financial assistance. We also thank Mahmood Lab for CONCH, UNI, CLAM, and PANTHER, and the original DSMIL and DTFD authors for their foundational implementations.
This code is made available for non-commercial academic purposes. Please refer to individual component licenses for upstream code and external repositories.
For questions about the code or dataset:
- Email: karan.p@research.iiit.ac.in
- Dataset contact: vinod.pk@iiit.ac.in
- Issues: please use the GitHub issue tracker


