# DDM<sup>2</sup>: Self-Supervised Diffusion MRI Denoising with Generative Diffusion Models, ICLR 2023
Paper: https://arxiv.org/pdf/2302.03018.pdf
![framework](./assets/framework.png)
![result](./assets/gslider_0.gif)
## Dependencies
Please clone our environment using the following command:
```
conda env create -f environment.yml
conda activate ddm2
```
## Usage
### Data
For fair evaluations, we used the data provided in the [DIPY](https://dipy.org/) library. One can easily access their provided data (e.g. Sherbrooke and Stanford HARDI) by using their official loading script:
```python3
hardi_fname, hardi_bval_fname, hardi_bvec_fname = get_fnames('stanford_hardi')
data, affine = load_nifti(hardi_fname)
```
### Configs
Different experiments are controlled by configuration files, which are in ```config/```.
We have provided default training configurations for reproducing our experiments. Users are required to **change the path vairables** to their own directory/data before running any experiments. *More detailed guidances are provided as inline comments in the config files.*
### Train
The training of DDM<sup>2</sup> contains three sequential stages. For each stage, a corresponding config file (or an update of the original config file) need to be passed as a coommand line arg.
1. To train our Stage I:
```python3 train_noise_model.py -p train -c config/hardi_150.json```
or alternatively, modify ```run_stage1.sh``` and run:
```./run_stage1.sh```
2. After Stage I training completed, the path to the checkpoint of the noise model need to be specific at 'resume_state' of the 'noise_model' section in corresponding config file. Additionally, a file path (.txt) needs to be specified at 'initial_stage_file' in the 'noise_model' section. This file will be recorded with the matched states in Stage II.
3. To process our Stage II:
```python3 match_state.py -p train -c config/hardi_150.json```
or alternatively, modify ```run_stage2.sh``` and run:
```./run_stage2.sh```
4. After Stage II finished, the state file (a '.txt' file, generated in the previous step) needs to be specified at **'stage2_file'** variable in the last line of each config file. This step is neccesary for the following steps and inference.
5. To train our Stage III:
```python3 train_diff_model.py -p train -c config/hardi_150.json```
or alternatively, modify ```run_stage3.sh``` and run:
```./run_stage3.sh```
6. Validation results along with checkpoints will be saved in the ```/experiments``` folder.
### Inference (Denoise)
One can use the previously trained Stage III model to denoise a MRI dataset through:
```python denoise.py -c config/hardi.json```
or alternatively, modify ```denoise.sh``` and run:
```./denoise.sh```
The ```--save``` flag can be used to save the denoised reusults into a single '.nii.gz' file:
```python denoise.py -c config/hardi.json --save```
### Quantitative Metrics Calulation
With the denoised Stanford HARDI dataset, please follow the instructions in ```quantitative_metrics.ipynb``` to calculate SNR and CNR scores.
*This notebook is derived from this [DIPY script](https://dipy.org/documentation/1.1.0./examples_built/snr_in_cc/). Please respect their license of usage.*
## Citation
If you find this repo useful in your work or research, please cite:
```
@inproceedings{xiangddm,
title={DDM $\^{} 2$: Self-Supervised Diffusion MRI Denoising with Generative Diffusion Models},
author={Xiang, Tiange and Yurt, Mahmut and Syed, Ali B and Setsompop, Kawin and Chaudhari, Akshay},
booktitle={The Eleventh International Conference on Learning Representations}
}
```
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
本项目致力于基于深度扩散模型的自监督弥散MRI去噪,旨在提高医学影像在疾病诊断中的应用。项目利用深度扩散模型对弥散MRI影像进行去噪,以获得更清晰的图像。 在数据集方面,我们使用了公开的弥散MRI影像数据集,如ISBI、HCP等,并进行了预处理,包括图像增强、分割和特征提取等。在环境搭建方面,我们使用Python编程语言,基于TensorFlow、PyTorch等深度学习框架进行开发。为了提高计算效率,我们还使用了GPU加速计算。此外,我们还采用了Docker容器技术,确保实验结果的可重复性。 项目完成后,将实现对弥散MRI影像的自监督去噪,提高医学影像的清晰度和可用性,为相关疾病的诊断和治疗提供有力支持。同时,项目成果也可应用于其他医学图像分析领域。
资源推荐
资源详情
资源评论
收起资源包目录
基于深度扩散模型的自监督弥散 MRI 去噪内含数据集和环境搭建教程.zip (82个子文件)
run_stage3.sh 200B
quantitative_metrics.ipynb 48KB
sample.sh 42B
run_stage1.sh 62B
metrics.py 8KB
assets
gslider_0.gif 4.14MB
framework.png 708KB
run_stage2.sh 194B
data
__init__.py 1KB
mri_dataset.py 7KB
util.py 3KB
prepare_data.py 7KB
__pycache__
MRI_dataset5.cpython-38.pyc 4KB
MRI_dataset7.cpython-36.pyc 5KB
dicom_dataset.cpython-38.pyc 4KB
LRHR_dataset.cpython-36.pyc 3KB
MRI_dataset4.cpython-38.pyc 4KB
util.cpython-38.pyc 3KB
singleshell_dataset.cpython-38.pyc 4KB
MRI_dataset3.cpython-38.pyc 6KB
MRI_dataset2.cpython-38.pyc 6KB
MRI_dataset7.cpython-38.pyc 4KB
__init__.cpython-36.pyc 2KB
MRI_dataset6.cpython-38.pyc 4KB
MRI_dataset2.cpython-36.pyc 5KB
MRI_dataset.cpython-36.pyc 5KB
chest_dataset.cpython-38.pyc 3KB
__init__.cpython-38.pyc 2KB
denoise.sh 50B
denoise.py 4KB
sample.py 3KB
core
metrics.py 4KB
logger.py 4KB
__pycache__
metrics.cpython-38.pyc 3KB
logger.cpython-38.pyc 4KB
metrics.cpython-36.pyc 3KB
logger.cpython-36.pyc 4KB
environment.yml 2KB
train_noise_model.py 4KB
model
__init__.py 350B
noise_model.py 5KB
networks.py 5KB
model.py 9KB
model_stage1.py 5KB
base_model.py 1KB
mri_modules
diffusion.py 15KB
utils.py 4KB
simple_unet.py 3KB
noise_model.py 983B
unet.py 10KB
__pycache__
gaussianMixtureNoiseModel.cpython-38.pyc 13KB
mask.cpython-38.pyc 3KB
train_noise_model.cpython-38.pyc 3KB
unet.cpython-36.pyc 10KB
diffusion_image.cpython-38.pyc 10KB
gmm.cpython-38.pyc 16KB
partialconv2d.cpython-36.pyc 2KB
utils.cpython-38.pyc 5KB
unet.cpython-38.pyc 9KB
diffusion_image.cpython-36.pyc 8KB
simple_unet.cpython-38.pyc 2KB
punet.cpython-36.pyc 10KB
diffusion.cpython-36.pyc 8KB
punet.cpython-38.pyc 10KB
partialconv2d.cpython-38.pyc 2KB
__pycache__
model.cpython-38.pyc 5KB
noise_model_image.cpython-38.pyc 4KB
perceptual_loss.cpython-38.pyc 2KB
model.cpython-36.pyc 5KB
base_model.cpython-38.pyc 2KB
__init__.cpython-36.pyc 683B
networks.cpython-36.pyc 3KB
model_image.cpython-38.pyc 6KB
networks.cpython-38.pyc 3KB
base_model.cpython-36.pyc 2KB
__init__.cpython-38.pyc 685B
match_state.py 5KB
train_diff_model.py 6KB
test.py 4KB
README.md 4KB
config
s3sh.json 4KB
hardi_150.json 4KB
共 82 条
- 1
资源评论
小码蚁.
- 粉丝: 2525
- 资源: 4090
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Java的在线教育平台设计源码
- 升降压斩波电路电路图,buck-boost电路图
- Python 程序语言设计模式思路-结构型模式:组合模式:将对象组合成树形结构
- 毕业设计基于python矩阵分解的推荐算法研究源码+详细文档+全部数据资料 高分项目.zip
- 基于网络的入侵检测系统源码+数据集+详细文档(高分毕业设计).zip
- 微信小程序源码 旅行故事分享 - 面包旅行App界面设计与文本展示资源下载
- 微信小程序源码 创意互动游戏 - 你画我猜App下载
- 摸底考试_学生版20230305.py
- 课程设计基于FPGA数字钟课程设计源码+课设报告(95分以上).zip
- 基于Java的企业家申报系统设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功