Official PyTorch implementation of EDA (CVPR 2026):
Elucidating the Design Space of Arbitrary-Noise-Based Diffusion Models
Xingyu Qiu, Mengying Yang, Xinghua Ma, Dong Liang, Fanding Li, Gongning Luo, Wei Wang, Kuanquan Wang, Shuo Li
Links: arXiv:2507.18534 · GitHub
EDA elucidates a unified design space for diffusion models with arbitrary structured noise instead of pixel-wise Gaussian noise. We validate the framework on three image restoration tasks — MRI bias field correction (global smooth noise), CT metal artifact reduction (global sharp noise), and natural image shadow removal (local boundary-aware noise). With only 5 deterministic sampling steps, EDA achieves competitive results against specialized methods across medical and natural domains.
All three tasks share the forward process s(t) = 1, σ(t) = √(1 − ᾱ_t) and 5-step deterministic Euler sampling (η = 0 at inference). Task-specific basis noise and training settings follow EDA Case 1 or Case 2 as defined in the paper.
BFC (BC/) |
MAR (MAR/) |
SR (shadow/) |
|
|---|---|---|---|
| Task | MRI bias field correction | CT metal artifact reduction | Natural image shadow removal |
| EDA Case | Case 1 — fixed basis H₃,₅ | Case 2 — h = X_ma − x₀ | Case 2 — h = X_S − x₀ |
| η (training) | 0 | 10 | 10 |
| Input size | 256 × 256, grayscale | 416 × 416, grayscale | 320 × 320 × 3 |
| Backbone | DDIM UNet | DDIM UNet | ShadowFormer |
| Dataset | HCP | SynDeepLesion | ISTD |
| Sampling | 5 steps | 5 steps | 5 steps |
For loss functions, data preprocessing, and hyperparameter details, see the README in each task directory.
.
├── README.md ← you are here
├── BC/ Task 1: MRI Bias Field Correction (BFC)
├── MAR/ Task 2: CT Metal Artifact Reduction (MAR)
└── shadow/ Task 3: Natural Image Shadow Removal (SR)
| Directory | Description | Details |
|---|---|---|
BC/ |
Diffuses structured low-frequency basis noise (Legendre + trigonometric) to remove MRI bias fields | BC/README.md |
MAR/ |
Diffuses sample-dependent metal streak basis noise with a metal-aware weighted loss | MAR/README.md |
shadow/ |
Extends ShadowFormer with EDA Case 2 diffusion and mask conditioning | shadow/README.md |
Each task follows the dependency stack of its baseline codebase. Install Python, PyTorch, and other packages according to the corresponding repository:
| Task | Baseline | GitHub |
|---|---|---|
BFC (BC/) |
DDIM | ermongroup/ddim |
MAR (MAR/) |
DDIM | ermongroup/ddim |
SR (shadow/) |
ShadowFormer | GuoLanqing/ShadowFormer |
See each task README for details. shadow/requirements.txt is provided as a local reference aligned with ShadowFormer.
Task 1 — BFC (details)
cd BC
# Train
python main.py --config mydataset.yml --doc bfc --ni
# Sample (5-step, paper default)
python main.py --config mydataset.yml --exp exp --doc bfc --sample --sequence --timesteps 5 --eta 0 --ni --input_dir ./data/HCP/test/LQTask 2 — MAR (details)
cd MAR
# Train
python main.py --config mydataset.yml --exp exp --doc mar_eda --ni
# Sample (5-step)
python main.py --config mydataset.yml --exp exp --doc mar_eda --sample --sequence --timesteps 5 --niTask 3 — SR (details)
cd shadow
# Train
python train_df.py --train_dir ./ISTD_Dataset/train --val_dir ./ISTD_Dataset/test
# Sample / evaluate (5-step)
python test_df.py --input_dir ./ISTD_Dataset/test --weights ./log/ShadowFormer_istd/models/model_best.pth --times 5 --save_images --cal_metrics- BC and MAR are built on the Denoising Diffusion Implicit Models (DDIM) codebase. We thank Jiaming Song, Chenlin Meng, and Stefano Ermon for releasing their implementation.
- shadow extends the ShadowFormer (AAAI 2023) codebase. We thank the ShadowFormer authors for their open-source release.
If you use this code, please cite EDA and the corresponding baseline works:
@inproceedings{qiu2026eda,
title={Elucidating the Design Space of Arbitrary-Noise-Based Diffusion Models},
author={Qiu, Xingyu and Yang, Mengying and Ma, Xinghua and Liang, Dong and Li, Fanding and Luo, Gongning and Wang, Wei and Wang, Kuanquan and Li, Shuo},
booktitle={CVPR},
year={2026}
}
@article{song2020denoising,
title={Denoising Diffusion Implicit Models},
author={Song, Jiaming and Meng, Chenlin and Ermon, Stefano},
journal={arXiv:2010.02502},
year={2020}
}
@article{guo2023shadowformer,
title={ShadowFormer: Global Context Helps Image Shadow Removal},
author={Guo, Lan and Huang, Song and Liu, Dong and Cheng, Hao and Wen, Bihan},
journal={AAAI},
year={2023}
}This repository retains the MIT License from the original DDIM codebase. Please also respect the licenses and terms of the HCP, SynDeepLesion, and ISTD datasets when using the data.
EDA(CVPR 2026)官方 PyTorch 实现:
Elucidating the Design Space of Arbitrary-Noise-Based Diffusion Models(阐明任意噪声扩散模型的设计空间)
链接: arXiv:2507.18534 · GitHub
EDA 提出了一个支持任意结构化噪声(而非逐像素高斯噪声)的统一扩散模型设计空间。我们在三个图像恢复任务上验证了该框架——MRI 偏场校正(全局平滑噪声)、CT 金属伪影去除(全局尖锐噪声)和自然图像阴影去除(局部边界感知噪声)。仅需 5 步确定性采样,EDA 即可在医学与自然图像领域取得与专用方法相当的竞争力结果。
三个任务共享前向过程 s(t) = 1、σ(t) = √(1 − ᾱ_t) 以及 5 步确定性 Euler 采样(推理时 η = 0)。各任务的基函数噪声与训练设置分别对应论文中的 EDA Case 1 或 Case 2。
BFC(BC/) |
MAR(MAR/) |
SR(shadow/) |
|
|---|---|---|---|
| 任务 | MRI 偏场校正 | CT 金属伪影去除 | 自然图像阴影去除 |
| EDA Case | Case 1 — 固定基 H₃,₅ | Case 2 — h = X_ma − x₀ | Case 2 — h = X_S − x₀ |
| η(训练) | 0 | 10 | 10 |
| 输入尺寸 | 256 × 256,灰度 | 416 × 416,灰度 | 320 × 320 × 3 |
| 骨干网络 | DDIM UNet | DDIM UNet | ShadowFormer |
| 数据集 | HCP | SynDeepLesion | ISTD |
| 采样步数 | 5 步 | 5 步 | 5 步 |
损失函数、数据预处理及超参数细节请参阅各任务目录下的 README。
.
├── README.md ← 当前文件
├── BC/ 任务 1:MRI 偏场校正(BFC)
├── MAR/ 任务 2:CT 金属伪影去除(MAR)
└── shadow/ 任务 3:自然图像阴影去除(SR)
| 目录 | 说明 | 详细文档 |
|---|---|---|
BC/ |
扩散结构化低频基函数噪声(Legendre + 三角函数),去除 MRI 偏场 | BC/README.md |
MAR/ |
扩散样本相关的金属条纹基函数噪声,采用金属感知加权损失 | MAR/README.md |
shadow/ |
在 ShadowFormer 基础上扩展 EDA Case 2 扩散与 mask 条件 | shadow/README.md |
各任务的 Python / PyTorch 及其他依赖包 以对应基线代码库为准,请参照下列 GitHub 仓库进行环境配置:
| 任务 | 基线 | GitHub |
|---|---|---|
BFC(BC/) |
DDIM | ermongroup/ddim |
MAR(MAR/) |
DDIM | ermongroup/ddim |
SR(shadow/) |
ShadowFormer | GuoLanqing/ShadowFormer |
详见各任务 README。shadow/requirements.txt 为与 ShadowFormer 对齐的本地参考列表。
任务 1 — BFC(详细说明)
cd BC
# 训练
python main.py --config mydataset.yml --doc bfc --ni
# 推理(5 步,论文默认)
python main.py --config mydataset.yml --exp exp --doc bfc --sample --sequence --timesteps 5 --eta 0 --ni --input_dir ./data/HCP/test/LQ任务 2 — MAR(详细说明)
cd MAR
# 训练
python main.py --config mydataset.yml --exp exp --doc mar_eda --ni
# 推理(5 步)
python main.py --config mydataset.yml --exp exp --doc mar_eda --sample --sequence --timesteps 5 --ni任务 3 — SR(详细说明)
cd shadow
# 训练
python train_df.py --train_dir ./ISTD_Dataset/train --val_dir ./ISTD_Dataset/test
# 推理 / 评估(5 步)
python test_df.py --input_dir ./ISTD_Dataset/test --weights ./log/ShadowFormer_istd/models/model_best.pth --times 5 --save_images --cal_metrics- BC 与 MAR 基于 Denoising Diffusion Implicit Models (DDIM) 代码库构建。感谢 Jiaming Song、Chenlin Meng 和 Stefano Ermon 的开源贡献。
- shadow 扩展自 ShadowFormer (AAAI 2023) 代码库。感谢 ShadowFormer 作者的开源工作。
如使用本代码,请引用 EDA 及相应基线工作:
@inproceedings{qiu2026eda,
title={Elucidating the Design Space of Arbitrary-Noise-Based Diffusion Models},
author={Qiu, Xingyu and Yang, Mengying and Ma, Xinghua and Liang, Dong and Li, Fanding and Luo, Gongning and Wang, Wei and Wang, Kuanquan and Li, Shuo},
booktitle={CVPR},
year={2026}
}
@article{song2020denoising,
title={Denoising Diffusion Implicit Models},
author={Song, Jiaming and Meng, Chenlin and Ermon, Stefano},
journal={arXiv:2010.02502},
year={2020}
}
@article{guo2023shadowformer,
title={ShadowFormer: Global Context Helps Image Shadow Removal},
author={Guo, Lan and Huang, Song and Liu, Dong and Cheng, Hao and Wen, Bihan},
journal={AAAI},
year={2023}
}本仓库沿用 DDIM 原始代码库的 MIT License。使用数据时请同时遵守 HCP、SynDeepLesion 和 ISTD 数据集的许可与使用条款。