Skip to content
MiliLabPublic

About

[Neural Networks 2027] Official PyTorch implementation of "Echo-DM: Ultrasound Marker Removal via Conditional Latent Diffusion and Region-Aware Fusion".

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Echo-DM

Ultrasound Marker Removal via Conditional Latent Diffusion and Region-Aware Fusion

Zhiwei Wang1,*, Tao Huang1,*, Wentao Jiang1, Muyi Li2, Jianxin Liu2, Jian Chen2,†, Jie Zou3, Yong Luo1, Bo Du1, Jing Zhang1,†

1School of Computer Science, Wuhan University, China
2The Central Hospital of Wuhan, China
3School of Computer Science, Hubei University of Technology, China

* Equal contribution
† Corresponding authors

arXiv Paper Hugging Face Model Hugging Face Dataset

Updates · Overview · Models & Data · Installation · Quick Start · Citation

📰 Updates

  • 2026-11-16: Released the inference code, Echo-DM-V (Efficient) model checkpoints, and Echo-PAIR validation and test data.
  • 2026-10-09: Echo-DM was accepted by Neural Networks.

🔍 Overview

Echo-DM removes artificial markers from ultrasound images without requiring an external marker mask at inference. It combines conditional latent diffusion for global restoration with region-aware fusion to preserve unaffected anatomical content and refine local details.

Echo-DM framework: paired ultrasound data, conditional latent diffusion and region-aware fusion

Figure 2 from the paper: overview of the Echo-DM framework.

  • Mask-free inference: provide a marked ultrasound image directly.
  • Restoration and preservation: conditional diffusion generates restored content; region-aware fusion combines it with intact image regions.

📊 Quantitative Results

Table 1: main quantitative comparison on the Echo-PAIR test split, reported as mean and standard deviation over five inference runs

Table 1 from the paper: main quantitative comparison on the Echo-PAIR test split.

Table 4: quality-efficiency comparison of Echo-DM-V Efficient, Default, High-Quality, and Echo-DM-R

Table 4 from the paper: quality-efficiency comparison of Echo-DM variants.

🖼️ Qualitative Results

Paper comparison of marked inputs, clean references, Echo-DM-V, Echo-DM-R, DiT and SD v1.5

Figure 3 from the paper. This comparison includes Echo-DM-V, Echo-DM-R and baseline methods; it is not a new benchmark of the released Efficient checkpoint.

🤗 Models & Data

Download the model checkpoints from Echo-DM and the validation/test data from Echo-PAIR on Hugging Face.

Model DiT input size VAE compression Sampling steps Fusion Config Weights
Echo-DM-V (Efficient) 512 × 512 8× 50 2× resolution RAF JSON Hugging Face

The checkpoint bundle includes the conditional DiT, the adapted 8× VAE and RAF, totaling approximately 859 MB. File sizes and SHA-256 checksums are recorded in the weight manifest.

Echo-PAIR split Paired images Included content Download
Validation 100 Clean / marked images, GT / predicted marker masks Hugging Face
Test 300 Clean / marked images, GT / predicted marker masks Hugging Face

The released evaluation data totals approximately 347 MB. Only marked images are used during inference; clean images and masks support evaluation. The training collection is not included in this release.

Dataset layout
data/Echo-PAIR/
├── validation/
│   ├── clean/
│   ├── marked/
│   ├── mask/
│   └── pred_mask/
├── test/
│   ├── clean/
│   ├── marked/
│   ├── mask/
│   └── pred_mask/
├── Val_100.json
└── Test_300.json

The JSON lists identify disjoint sets of image stems. mask/ contains GT marker masks; pred_mask/ contains predicted marker masks.

See data notes for the released evaluation data.

🛠️ Installation

git clone https://github.com/MiliLab/Echo-DM.git
cd Echo-DM

conda create -n echo-dm python=3.10 -y
conda activate echo-dm

python -m pip install torch==2.8.0 torchvision==0.23.0 \
  --index-url https://download.pytorch.org/whl/cu128
python -m pip install numpy==2.2.6 Pillow==11.3.0 opencv-python==4.12.0.88 \
  timm==1.0.19 diffusers==0.37.0 transformers==5.0.0 \
  safetensors==0.6.2 einops==0.8.2 tqdm==4.67.1
python -m pip install -e . --no-deps --no-build-isolation

The dependency versions above match the preparation environment. CUDA inference requires a compatible NVIDIA GPU and driver. This package exposes the echo_dm module; use a separate environment if the full Echo-DM package is already installed.

🚀 Quick Start

1. Prepare the checkpoints

Download the checkpoint bundle from Hugging Face and place the files in the following layout:

weights/
├── vae/8x/
│   ├── config.json
│   └── diffusion_pytorch_model.safetensors
├── v-efficient/
│   ├── dit.pt
│   └── raf.pt
└── manifest.json

2. Restore a marked image

python -m echo_dm.inference \
  --input /path/to/marked_image.png \
  --output outputs/example --seed 42

The command defaults to v-efficient and CUDA. It saves the restored image to outputs/example/predictions/ and records settings and inputs in outputs/example/inference.json.

3. Run on the evaluation splits

Download the evaluation data from Hugging Face into data/Echo-PAIR/:

# Validation images
python -m echo_dm.inference \
  --input data/Echo-PAIR/validation/marked \
  --output outputs/validation --seed 42

# Test images
python -m echo_dm.inference \
  --input data/Echo-PAIR/test/marked \
  --output outputs/test --seed 42

These commands generate restoration images; the subset does not include metric-evaluation scripts.

Option Purpose
--input A marked image or a flat image directory
--output Directory for predictions and inference metadata
--weights-root Optional alternative checkpoint directory
--subset Optional JSON list of filenames or stems
--device Defaults to cuda; cpu is also supported
--seed Random seed; defaults to 42

Predictions are lossless PNGs with the original image dimensions. Nonempty prediction directories, duplicate stems and missing requested images raise errors. Model loading uses local files with downloads disabled. A fixed seed does not guarantee bitwise equality across different GPU models or different input sequences.

📚 Citation

If you use Echo-DM or the released evaluation data in your research, please cite:

@article{wang2026echodm,
  title   = {Echo-DM: Ultrasound Marker Removal via Conditional Latent Diffusion and Region-Aware Fusion},
  author  = {Wang, Zhiwei and Huang, Tao and Jiang, Wentao and Li, Muyi and Liu, Jianxin and Chen, Jian and Zou, Jie and Luo, Yong and Du, Bo and Zhang, Jing},
  journal = {arXiv preprint arXiv:2606.09378},
  year    = {2026},
  doi     = {10.48550/arXiv.2606.09378},
  url     = {https://arxiv.org/abs/2606.09378}
}

The publisher-hosted article is available on ScienceDirect.

🙏 Acknowledgements

We thank the authors and maintainers of:

  • DiT, for the diffusion-transformer backbone and diffusion implementation.
  • Diffusers, for the AutoencoderKL implementation used to load and run the VAE.
  • SD VAE, for the pretrained VAE initialization.

📄 License

Original Echo-DM code is licensed under the Apache License 2.0. Third-party code retains its original licenses; DiT-derived code is covered by CC BY-NC 4.0. See NOTICE for attribution and scope.

About

[Neural Networks 2027] Official PyTorch implementation of "Echo-DM: Ultrasound Marker Removal via Conditional Latent Diffusion and Region-Aware Fusion".

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages