This is the official implementation of [SHAPE: Structure-aware Hierarchical Unsupervised Domain Adaptation with Plausibility Evaluation for Medical Image Segmentation] at CVPR-2026.
Run the following command to install the required packages:
conda create --name new_env --file environment.txtYou can download the dinov3 pre-trained models from here.
Please organise the dataset according to the following structure,where the npz file stores the images and their corresponding segmentation labels with the key name {image, label}:
data/
└── data_name/
├── train/
│ ├── 00001.npz
│ └── ...
├── val/
│ ├── 00010.npz
│ └── ...
└── test/
├── 00020.npz
└── ...
Now you can start to train the model:
python train.py --mode <CT/MR/...> --gpu <gpu id> --stage <sup/unsup> --dino_size <b/s> --checkpoint_name <exp_name> --use_hfm --use_pseudo_labels --use_selector --use_refinement
For MMWHS dataset with CT labeled:
python train.py --mode CT --gpu <gpu id> --stage <sup/unsup> --dino_size <b/s> --checkpoint_name <exp_name> --use_hfm --use_pseudo_labels --use_selector --use_refinement
For MMWHS dataset with MR labeled:
python train.py --mode MR --gpu <gpu id> --stage <sup/unsup> --dino_size <b/s> --checkpoint_name <exp_name> --use_hfm --use_pseudo_labels --use_selector --use_refinement
For abdominal dataset with CT labeled:
python train.py --mode ABCT --gpu <gpu id> --stage <sup/unsup> --dino_size <b/s> --checkpoint_name <exp_name> --use_hfm --use_pseudo_labels --use_selector --use_refinement
For abdominal dataset with MR labeled:
python train.py --mode ABMR --gpu <gpu id> --stage <sup/unsup> --dino_size <b/s> --checkpoint_name <exp_name> --use_hfm --use_pseudo_labels --use_selector --use_refinement
The project is based on dinov3. We thank the authors for their open-sourced code and encourage users to cite their works when applicable.
If the code is helpful for your research, please consider citing:
@inproceedings{zhou2026shape,
author={Linkuan Zhou, Yinghao Xia, Yufei Shen, Xiangyu Li, Wenjie Du, Cong Cong, Leyi Wei, Ran Su, Qiangguo Jin},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
title={SHAPE: Structure-aware Hierarchical Unsupervised Domain Adaptation with Plausibility Evaluation for Medical Image Segmentation},
year={2026},
pages={1-11}
}
Global Collaboration: We're on a mission to biomedical research, aiming for artificial intelligence and its applications to biomedical image and bioinformation analysis, promoting the development of the medical community. Collaborate with us to increase competitiveness.
Questions: General questions, please contact 'zlinkw@mail.nwpu.edu.cn'
