This repository contains the official PyTorch implementation for our paper:
MOC: Meta-Optimized Classifier for Few-Shot Whole Slide Image Classification (MICCAI 2025)
-
WSI Preprocessing: This repository does not include scripts for Whole Slide Image (WSI) preprocessing. Please follow the official CLAM pipeline to extract WSI features.
- Note: Subtypes of the same cancer should be merged into a single folder. For example, place preprocessed
luad
andlusc
features into the same folder namednsclc/merge_features_conch
. - We primarily use
h5_files
as they preserve the coordinate information of the patches. - The default data storage path can be modified in
main_moc.py
at lines205
and266
.
- Note: Subtypes of the same cancer should be merged into a single folder. For example, place preprocessed
-
Example Data Directory Structure:
data/ ├── nsclc/ │ └── merge_features_conch/ │ ├── h5_files/ │ └── pt_files/ └── rcc/ └── ...
-
Dataset Information: Dataset definitions and split information have been placed in the
dataset_csv/
andsplits/
directories, respectively.
- Download the CONCH model checkpoint from Hugging Face.
- The default path for the checkpoint is
models/conch_checkpoint.bin
. This path can be changed inmain_moc.py
at line135
.
Modify the CUDA device ID and dataset name in the scripts/moc_train.sh
script, then run:
bash scripts/moc_train.sh
Modify the relevant configurations in the scripts/moc_eval.sh
script, then run:
bash scripts/moc_eval.sh
If you use this code or our method in your research, please cite our paper:
@article{xiang2025moc,
title={MOC: Meta-Optimized Classifier for Few-Shot Whole Slide Image Classification},
author={Xiang, Tianqi and Li, Yi and Zhang, Qixiang and Li, Xiaomeng},
journal={arXiv preprint arXiv:2508.09967},
year={2025}
}