Skip to content

zdipath/CARE

Repository files navigation

CARE

A Molecular-Guided Foundation Model with Adaptive Region Modeling for Whole Slide Image Analysis

a arXiv arXiv

🔥 Update

  • [2026.06.22] CARE has been integrated into Trident. Now, CARE can be used through Trident.
  • [2026.04.09] Our paper was selected as a CVPR 2026 Highlight presentation.
  • [2026.03.11] The model weight was released in Hugging Face.
  • [2026.02.21] Our paper was accepted by CVPR 2026.

Data Preprocessing

We follow the CLAM WSI preprocessing pipeline. CARE builds a feature grid from CONCH v1.5 patch features using patch coordinates. We store both the extracted features and their corresponding coordinates in a single .npy file. The saving format is as follows:

features_list = []
indexs_list = []
inst_labels_list = []
# Get patch feature
features = features.cpu().numpy().astype(np.float32)
features_list.append(features)
indexs_list += coords
inst_labels_list += inst_labels
asset_dict = {
    "feature": features_list,
    "index": indexs_list,
    "inst_label": inst_labels_list,
}
np.save(output_path, asset_dict)

The data can be loaded with the following format:

fea = np.load("./data/MUT/conch_v1_5/19579_0_1024.npy", allow_pickle=True)

features = fea[()]["feature"]
cor = fea[()]["index"]
# Parse patch coordinates from the index strings
coords = np.array(
    [filename.split("_")[:2] for filename in cor],
    dtype=int,
)
# Convert features and coordinates to tensors
patch_embedding = torch.from_numpy(features).unsqueeze(0).to(device)
coords = torch.from_numpy(coords).unsqueeze(0).to(device)

More specifically, if you use the CLAM .h5 file format, please follow the usage instructions on Hugging Face.

CARE WSI Feature Extraction

We provide an example of how to extract WSI features using CARE in the file care_wsi_encoder_api.py. The pretrained CARE weight is released on Hugging Face.

Linear Probing Evaluation

We provide code for linear probing with two classifiers, KNN and logistic_regression, in train_wsi_model.py.

For the logistic regression setting, you can run:

python -u train_wsi_model.py \
  --gpu 1 \
  --task t1_gene \
  --dataset MUT \
  --experiment_target BAP1 \
  --model_name CARE \
  --model_type logistic_regression \
  --num_region 8 \
  --data_root_dir ./data \

For the KNN setting, you can run:

python -u train_wsi_model.py \
  --gpu 1 \
  --task t1_gene \
  --dataset MUT \
  --experiment_target BAP1 \
  --model_name CARE \
  --model_type KNN \
  --num_region 8 \
  --data_root_dir ./data \

Note: Before running the linear probing evaluation, please first extract CONCH v1.5 patch features using the CLAM codebase, and save the features together with their coordinates in .npy format.

Result

Bold indicates the best result, * indicates the second-best result, and all reported results are obtained with logistic regression.

Model EBRAINS
30 classes
Combine-Lung
subtype 2 classes
Cross-LUNG-fine
3 classes
MUT-BAP1
2 classes
EBRAINS-IDH
2 classes
CCRCC
OS
ACC F1 ACC AUC ACC F1 ACC AUC ACC AUC C-index
Mean-pool 65.8 71.4 88.1 95.4 63.6 73.7 61.0 84.8 87.8 94.2 48.4
CHIEF 60.6 68.4 87.6 95.6 65.7 74.2* 57.2 85.9 88.9 95.6 53.2
PRISM 59.5 65.8 86.2 95.2 58.3 68.0 57.5 86.5 88.7 94.9 38.0
GigaPath 64.7 71.6 88.4 95.6 54.2 62.2 61.4* 86.6 88.2 94.7 55.8
TANGLE 64.5 71.2 86.3 94.7 60.3 70.1 63.6 86.8 89.0 95.2 46.6
FEATHER 68.2 73.1 85.5 94.1 56.2 68.5 54.7 84.3 88.5 95.9 56.6*
TITAN 74.8 78.8 89.2 96.6* 63.8 74.2* 59.8 86.0 91.4* 96.7 40.5
CARE 74.0* 78.7* 89.0* 96.8 65.5* 74.4 61.4* 88.9 91.5 96.6* 63.0

Citation

If you find our work useful in your research, please consider citing CARE and CONCH v1.5:

@inproceedings{zhang2026care,
  title={CARE: A Molecular-Guided Foundation Model with Adaptive Region Modeling for Whole Slide Image Analysis},
  author={Zhang, Di and Gong, Zhangpeng and Pang, Xiaobo and Liu, Jiashuai and Lu, Junbo and Cui, Hao and Ge, Jiusong and Zeng, Zhi and Yi, Kai and Li, Yinghua and others},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={21078--21088},
  year={2026}
}
@article{lu2024visual,
  title={A visual-language foundation model for computational pathology},
  author={Lu, Ming Y and Chen, Bowen and Williamson, Drew FK and Chen, Richard J and Liang, Ivy and Ding, Tong and Jaume, Guillaume and Odintsov, Igor and Le, Long Phi and Gerber, Georg and others},
  journal={Nature medicine},
  volume={30},
  number={3},
  pages={863--874},
  year={2024},
  publisher={Nature Publishing Group US New York}
}

About

A Molecular-Guided Foundation Model with Adaptive Region Modeling for Whole Slide Image Analysis

Topics

Resources

License

Stars

11 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages