RepositoryPythonDEGermany
xmindflow

xmindflow/DAEFormer

[MICCAI 2023] DAE-Former: Dual Attention-guided Efficient Transformer for Medical Image Segmentation

128stars
15forks
12issues
3views

DAE-Former: Dual Attention-guided Efficient Transformer for Medical Image Segmentation - MICCAI 2023 PRIME Workshop

Transformers have recently gained attention in the computer vision domain due to their ability to model long-range dependencies. However, the self-attention mechanism, which is the core part of the Transformer model, usually suffers from quadratic computational complexity with respect to the number of tokens. Many architectures attempt to reduce model complexity by limiting the self-attention mechanism to local regions or by redesigning the tokenization process. In this paper, we propose DAE-Former, a novel method that seeks to provide an alternative perspective by efficiently designing the self-attention mechanism. More specifically, we reformulate the self-attention mechanism to capture both spatial and channel relations across the whole feature dimension while staying computationally efficient. Furthermore, we redesign the skip connection path by including the cross-attention module to ensure the feature reusability and enhance the localization power. Our method outperforms state-of-the-art methods on multi-organ cardiac and skin lesion segmentation datasets, without pre-training weights.

Proposed Model

Updates

  • July 25, 2023, 2022: Accepted in MICCAI 2023 PRIME Workshop! 🥳
  • December 29, 2022: Initial release with arXiv.

Citation

@inproceedings{azad2023dae,
  title={Dae-former: Dual attention-guided efficient transformer for medical image segmentation},
  author={Azad, Reza and Arimond, Ren{\'e} and Aghdam, Ehsan Khodapanah and Kazerouni, Amirhossein and Merhof, Dorit},
  booktitle={International Workshop on PRedictive Intelligence In MEdicine},
  pages={83--95},
  year={2023},
  organization={Springer}
}

How to use

The script train.py contains all the necessary steps for training the network. A list and dataloader for the Synapse dataset are also included. To load a network, use the --module argument when running the train script (--module <directory>.<module_name>.<class_name>, e.g. --module networks.DAEFormer.DAEFormer)

Model weights

You can download the learned weights of the DAEFormer in the following table.

TaskDatasetLearned weights
Multi organ segmentationSynapseDAE-Former

Training and Testing

  1. Download the Synapse dataset from here.

  2. Run the following code to install the Requirements.

    pip install -r requirements.txt

  3. Run the below code to train the DAEFormer on the synapse dataset.

    python train.py --root_path ./data/Synapse/train_npz --test_path ./data/Synapse/test_vol_h5 --batch_size 20 --eval_interval 20 --max_epochs 400 --module networks.DAEFormer.DAEFormer
    

    --root_path [Train data path]

    --test_path [Test data path]

    --eval_interval [Evaluation epoch]

    --module [Module name, including path (can also train your own models)]

  4. Run the below code to test the DAEFormer on the synapse dataset.

    python test.py --volume_path ./data/Synapse/ --output_dir './model_out'
    

    --volume_path [Root dir of the test data]

    --output_dir [Directory of your learned weights]

Results

Performance comparision on Synapse Multi-Organ Segmentation dataset.

results

Query

All implementation done by Rene Arimond. For any query please contact us for more information.

rene.arimond@lfb.rwth-aachen.de

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
huggingface/transformers

🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.

169.5k
Dec 1, 2026
RepositoryPython
labmlai/annotated_deep_learning_paper_implementations

🧑‍🏫 60+ Implementations/tutorials of deep learning papers with side-by-side notes 📝; including transformers (original, xl, switch, feedback, vit, ...), optimizers (adam, adabelief, sophia, ...), gans(cyclegan, stylegan2, ...), 🎮 reinforcement learning (ppo, dqn), capsnet, distillation, ... 🧠

67.8k
Nov 2, 2026
RepositoryPython
labmlai/annotated_deep_learning_paper_implementations

🧑‍🏫 60+ Implementations/tutorials of deep learning papers with side-by-side notes 📝; including transformers (original, xl, switch, feedback, vit, ...), optimizers (adam, adabelief, sophia, ...), gans(cyclegan, stylegan2, ...), 🎮 reinforcement learning (ppo, dqn), capsnet, distillation, ... 🧠

67.8k
Nov 2, 2026
RepositoryPython
Comfy-Org/ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

149.6k
Dec 2, 2026
RepositoryJupyter Notebook
rasbt/LLMs-from-scratch

Implement a ChatGPT-like LLM in PyTorch from scratch, step by step

109.4k
Nov 26, 2026
Modelsentence-similarity
sentence-transformers/all-MiniLM-L6-v2

all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...

♥0
157.6M
Jun 1, 2026
RepositoryPython
vllm-project/vllm

A high-throughput and memory-efficient inference and serving engine for LLMs

98.0k
Dec 2, 2026
RepositoryPython
AUTOMATIC1111/stable-diffusion-webui

Stable Diffusion web UI

165.4k
Mar 2, 2026
RepositoryC++
tensorflow/tensorflow

An Open Source Machine Learning Framework for Everyone

201.9k
Dec 1, 2026