This repository contains the official PyTorch implementation of HADESR-GAN, a parameter-efficient hybrid-attention generative adversarial network for medical image super-resolution, as presented in the paper "HADESR-GAN: A Lightweight Hybrid Attention-based GAN for Medical Image Super-Resolution." which is already submitted to Nature Scientific Reports
High-resolution (HR) medical imaging is vital for accurate diagnosis, yet its deployment is often constrained by hardware limitations, radiation exposure, and real-time processing demands.
We introduce HADESR-GAN, a parameter-efficient hybrid-attention generative adversarial network for medical image super-resolution.
The generator integrates the Residual Whole Map Attention (RWMAN) backbone of MedSRGAN with a lightweight Hybrid Attention Separable Block (HASB) based on depthwise-separable convolutions and attention fusion.
Transformer-inspired global context modeling further enhances textural consistency.
This model achieves high performance with approximately 85% fewer parameters than its baseline, MedSRGAN.
- Lightweight Architecture: Achieves state-of-the-art results with only ~1.6 million parameters.
- Hybrid Attention Mechanism: Integrates a Hybrid Attention Separable Block (HASB) with a Residual Whole Map Attention (RWMAN) backbone.
- High Performance: Achieves excellent PSNR and SSIM scores across multiple medical imaging datasets.
- GAN-based Training: Produces perceptually realistic high-resolution images.
- Modular and Configurable: The code is organized for easy modification and experimentation.
The HADESR-GAN consists of a Generator and a Discriminator, trained in an adversarial setup.
The generator combines Short Residual Connections (SRC) with the novel Hybrid Attention Separable Blocks (HASB), significantly reducing the number of layers compared to the original MedSRGAN.
The discriminator is a deep CNN with a dual-path design for multi-scale analysis, enabling it to effectively distinguish between real and super-resolved images.

HADESR-GAN was evaluated on three medical imaging datasets:
| Dataset | Domain | PSNR (dB) | SSIM |
|---|---|---|---|
| Chest CT (LIDC-IDRI) | CT | 34.32 | 0.90 |
| Echocardiography (Tehran Heart Center) | Echo | 32.04 | 0.92 |
| Dermoscopy (ISIC) | Skin | 37.18 | 0.94 |
HARNSRGAN/
│
├── dataset/
│ ├── train/
│ └── val/
│
├── models/
│ ├── discriminator.py
│ └── generator.py
│
├── losses/
│ ├── discriminator_loss.py
│ └── generator_loss.py
│
├── trainer/
│ └── trainer.py
│
├── utils/
│ ├── dataset.py
│ ├── early_stopping.py
│ └── visualize.py
│
├── config.py
├── main.py
├── requirements.txt
└── README.md
- Python 3.8+
- PyTorch
- Other dependencies listed in
requirements.txt
Clone the repository:
git clone https://github.com/parsakhavarinejad/HADESR-GAN.git
cd HADESR-GANInstall dependencies:
pip install -r requirements.txt
🚀 Training
Prepare your dataset: Place training images in dataset/train/ and validation images in dataset/val/.
Configure training parameters: Modify config.py as needed.
Run the training script:
python main.py
🧾 Citation
If you find this work useful for your research, please cite our paper when it is published.




