Home

Awesome

<h1 align="center">High-Frequency Space Diffusion Model for Accelerated MRI</h1> <p align="center"> <a href="https://arxiv.org/pdf/2208.05481.pdf"><img src="https://img.shields.io/badge/arXiv-2208.05481-b31b1b.svg" alt="Paper"></a> <!-- <a href=""><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Colab"></a> --> <a href="https://ieeexplore.ieee.org/document/10385176/"> <img alt="License" src="https://img.shields.io/static/v1?label=Pub&message=TMI%2724&color=blue"> </a> </p>

Official code for the paper "High-Frequency Space Diffusion Model for Accelerated MRI", published in TMI 2024.

by Chentao Cao*, Zhuo-Xu Cui*, Yue Wang*, Shaonan Liu, Taijin Chen, Hairong Zheng, Dong Liang, and Yanjie Zhu<sup>+</sup>(*denotes equal contribution, <sup>+</sup>denotes corresponding author).

Illustration

Abstract

Diffusion models with continuous stochastic differential equations (SDEs) can serve as a deep generative prior to solving the inverse problem in magnetic resonance (MR) reconstruction. However, low-frequency regions of k-space data are typically fully sampled in fast MR imaging, while existing diffusion models are performed throughout the entire image or k-space, inevitably introducing uncertainty in the reconstruction of low-frequency regions. Additionally, existing diffusion models often demand substantial iterations to converge, resulting in time-consuming reconstructions. To address these challenges, we propose a novel SDE tailored specifically for MR reconstruction with the diffusion process in high-frequency space (referred to as HFS-SDE). This approach ensures determinism in the fully sampled low-frequency regions and accelerates the sampling procedure of reverse diffusion. Experiments conducted on the publicly available fastMRI dataset demonstrate that the proposed HFS-SDE method outperforms traditional parallel imaging methods, supervised deep learning, and existing diffusion models in terms of reconstruction accuracy and stability. The fast convergence properties are also confirmed through theoretical and experimental validation.

Adv

Checkout our

Setup

The following will introduce environment setup, data preparation, usage instructions, experiment weights, and a quick start guide. In the quick start guide, we provide experiment weights and synthetic data for easy model validation without the need for lengthy data downloads. Additionally, the quick start guide will offer guidance on parameter settings for generating high-quality reconstruction samples.

Dependencies

Run the following to install a subset of necessary python packages for our code.

conda env create -f environment.yml

Data Preparation

Phantom dataset

To facilitate a quick start, we provide sample data located at data/photom.

fastMRI dataset

Download

For the training dataset, we used 973 individuals from the fastMRI multi-coil knee dataset. A total of 28904 T1- and T2-weighted images were finally involved in the training dataset. We selected two datasets for testing. One was the knee data from 3 individuals(file1000976.h5, file1001064.h5, and file1001077.h5) selected randomly from knee_multicoil_val (approximately 93.8 GB) dataset, and the other one was the brain data from 1 individual(file_brain_AXT2_200_2000019.h5).

These datasets can be downloaded here.

Preprocess

In the image domain, crop the data to 320x320 and perform sensitivity estimation using the BART toolbox. The Auto-Calibration Signal(ACS) region is set to 24x24.

Sensitivity Estimation Workflow

Please ensure that you have the necessary libraries and tools, including BART, installed and configured to perform these operations on your data.

Data Slice Saving

Since fastmri dataset is too large, we save its index as a pkl file for quick loading.

Mask Preparation

Usage

Train and evaluate our models through main.py.

main.py:
  --config: Training configuration.
    (default: 'None')
  --mode: <train|sample>: Running mode: train or sample
  --workdir: Working directory

Pretrained checkpoints

All checkpoints are provided here.

Quick Start Guide

Training

We provided the training script train_fastMRI.sh , just as Usage provided.

Navigate to the default configuration file located at configs\default_fastMRI_configs.py.

To make changes to the configuration file, configs\hfssde\ddpm_continuous.py, follow these steps and adjust the following parameters:

ParameterMeaningExample Value
training.mask_typeType of data undersampling masklow_frequency (if 1D-sample),center(if 2D-sample)
training.accAcceleration factor for undersampling4 or every positive value
training.acsAuto-Calibration Signal (ACS) region size24 or every positive value

Please update these parameters in the configuration file according to your requirements.

Note: Make sure that the relative mask exists. check your mask dir, the mask name rule is followed next:

training.mask_type + _length + training.acs + .mat

Run the next code to train your model.

bash train_fastMRI.sh hfssde

Sampling

We prepare to apply our model and use phantom data referred to below to reconstruct a high-quality image.

Note: Please make sure that you download the checkpoint or you have trained a model.

ParameterMeaningExample Value
sampling.snrAdjust SNR: Higher values mean more noise, lower values mean more undersampling artifactsbetween 0 and 1
sampling.mseControl the overall error of the predictor, where a larger value increases the weight of the score.non-negative value
sampling.corrector_mseControl the overall error of the corrector, where a larger value gives more weight to the score.non-negative value
sampling.NSet the sampling steps to a lower value to accelerate the sampling process.positive integer
sampling.accelerated_samplingEnable accelerated sampling to improve speed. Set to 'true' for faster sampling.'true' or 'false'
bash test_fastMRI.sh hfssde

Tuning Guidelines:

Training

Sampling

These guidelines will help you fine-tune the parameters effectively.

References

If you find the code useful for your research, please consider citing

@article{cao2024hfs,
  author={Cao, Chentao and Cui, Zhuo-Xu and Wang, Yue and Liu, Shaonan and Chen, Taijin and Zheng, Hairong and Liang, Dong and Zhu, Yanjie},
  journal={IEEE Transactions on Medical Imaging}, 
  title={High-Frequency Space Diffusion Model for Accelerated MRI}, 
  year={2024},
  volume={43},
  number={5},
  pages={1853-1865},
  doi={10.1109/TMI.2024.3351702}}

Our implementation is based on Score-based SDE by Dr. Yang Song. And we also borrowed some code from csgm-mri-langevin. Thanks for their great works!

Questions

If you have any problem, please contact chentaocao1224@gmail.com