This is the repository for MFHS : Mutual Consistency Learning-based foundation model integrates Hypergraph Computation for Semi-supervised Medical Image Segmentation.
Abstract: In this paper, we propose MFHS, a novel semi-supervised framework that synergizes a vision foundation model with hypergraph learning to address these challenges.Our framework leverages a pre-trained SAM2 encoder to extract robust hierarchical features, which are then refined by a hypergraph neural network that explicitly models many-to-many high-order relationships among anatomical structures. For semi-supervised training, we employ a multi-decoder architecture to generate high-quality pseudo-labels through a cross-consistency mechanism, further enhanced by an adversarial learning module.
Tested on Ubuntu and Models were trained on a Nvidia RTX 3090.
- Creat a environment
conda create -n MFHSand activate itconda activate MFHSconda create -n MFHS
conda activate MFHS
git clone https://github.com/Zhai-Mao/MFHSgit clone https://github.com/Zhai-Mao/MFHS
- Enter the MFHS folder
cd MFHSand runpip install -e.cd MFHSpip install -e.
- Then install the packages
pip install -r requirements.txtpip install -r requirements.txt
First Download the dataset ACDC from SSL4MS. Here, we need to place the list file of ACDC in the specified folder.
├── MFHS/
├── ACDC/
├── data/
│ ├── slices/
│ │ ├── train_slices.list
│ │ ├── val.list
│ │ ├── patient001_frame01_slice_1.h5
│ │ ├── patient001_frame01_slice_2.h5
│ │ └── ...
│ ├── test.list
│ ├── patient001_frame01.h5
│ ├── patient001_frame02.h5
└── ...Then download the SAM2 pre-trained checkpoints named sam2_hiera_large to obtain the corresponding checkpoint files.
├── MFHS/
├── sam2_hiera_large.pt
├── sam2_hiera_small.pt
└── sam2_hiera_tiny.ptTraining a model based on sam2 large.
python train2d_L.py --model="SAM2UNetL" --hiera_path="sam2_hiera_large.pt" --labeled_num=3Training a model based on sam2 small.
python train2d_L.py --model="SAM2UNetS" --hiera_path="sam2_hiera_small.pt" --labeled_num=3Training a model based on sam2 tiny.
python train2d_L.py --model="SAM2UNetT" --hiera_path="sam2_hiera_tiny.pt" --labeled_num=3Testing a model based on sam2 large.
python test.py --model="SAM2UNetL" --labeled_num=3Testing a model based on sam2 small.
python test.py --model="SAM2UNetS" --labeled_num=3Testing a model based on sam2 tiny.
python test.py --model="SAM2UNetT" --labeled_num=3We are very grateful to the contributors of the following open-source projects and other referenced content.
@article{LIU2025112721,
title = {MFHS: Mutual Consistency Learning-Based Foundation Model Integrates Hypergraph for Semi-Supervised Medical Image Segmentation},
journal = {Pattern Recognition},
pages = {112721},
year = {2025},
issn = {0031-3203},
doi = {https://doi.org/10.1016/j.patcog.2025.112721},
url = {https://www.sciencedirect.com/science/article/pii/S0031320325013846},
author = {Xuejun Liu and Zhaichao Tang and Yonghao Wu and Ruixiang Zhai and Xuanhe Dong and Zikang Du and Shujun Cao},
keywords = {Medical Image Segmentation, Semi-Supervised Learning, Vision Foundation Models, Hypergraph Learning, Pseudo-Labeling, Adversarial Learning}
}17370487061@163.com