bnm6900030 / swintormer

34 stars 2 forks source link

Image Deblurring based on Diffusion Models

The code and pre-trained models of the paper "Image Deblurring based on Diffusion Models" will be released in this repository.


Abstract: This article introduces a sliding window model for defocus deblurring that achieves the best performance to date with extremely low memory usage. Named Swintormer, the method utilizes a diffusion model to generate latent prior features that assist in restoring more detailed images. It also extends the sliding window strategy to specialized Transformer blocks for efficient inference. Additionally, we have further optimized Multiply-Accumulate operations (Macs). Compared to the currently top-performing GRL method, our Swintormer model drastically reduces computational complexity from 140.35 GMACs to 8.02 GMacs, while also improving the Signal-to-Noise Ratio (SNR) for defocus deblurring from 27.04 dB to 27.07 dB. This new method allows for the processing of higher resolution images on devices with limited memory, significantly expanding potential application scenarios. The article concludes with an ablation study that provides an in-depth analysis of the impact of each network module on final performance. The source code and model will be available at the following website: https://github.com/bnm6900030/swintormer.


Installation

# Clone the github repo and go to the default directory 'swintormer'.
git clone https://github.com/bnm6900030/swintormer.git
cd swintormer
pip install -r requirements.txt

Training

python basicsr/train.py -opt /home/lab/code1/IR/options/train/swintormer/train_swintormer.yml

Testing

python basicsr/test.py

Generate feature

python generate_feature.py

Visual Results

Part visual results are available below. More visual results will come soon.

Acknowledgements

This code is built on BasicSR and Restormer.

Citations

If this work is helpful for your research, please consider citing the following BibTeX entry.

@misc{chen2024efficient,
      title={Efficient Image Deblurring Networks based on Diffusion Models}, 
      author={Kang Chen and Yuanjie Liu},
      year={2024},
      eprint={2401.05907},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

Contact

If you have any question, please contact chenkang@cau.edu.cn