Home

Awesome

<div align="center"> <p align="center"> <img src="figs/logo.png" width="240px"> </p> </div>

Binarized Diffusion Model for Image Super-Resolution

Zheng Chen, Haotong Qin, Yong Guo, Xiongfei Su, Xin Yuan, Linghe Kong, and Yulun Zhang, "Binarized Diffusion Model for Image Super-Resolution", NeurIPS, 2024

[poject] [arXiv] [supplementary material] [visual results] [pretrained models]

🔥🔥🔥 News


Abstract: Advanced diffusion models (DMs) perform impressively in image super-resolution (SR), but the high memory and computational costs hinder their deployment. Binarization, an ultra-compression algorithm, offers the potential for effectively accelerating DMs. Nonetheless, due to the model structure and the multi-step iterative attribute of DMs, existing binarization methods result in significant performance degradation. In this paper, we introduce a novel binarized diffusion model, BI-DiffSR, for image SR. First, for the model structure, we design a UNet architecture optimized for binarization. We propose the consistent-pixel-downsample (CP-Down) and consistent-pixel-upsample (CP-Up) to maintain dimension consistent and facilitate the full-precision information transfer. Meanwhile, we design the channel-shuffle-fusion (CS-Fusion) to enhance feature fusion in skip connection. Second, for the activation difference across timestep, we design the timestep-aware redistribution (TaR) and activation function (TaA). The TaR and TaA dynamically adjust the distribution of activations based on different timesteps, improving the flexibility and representation alability of the binarized module. Comprehensive experiments demonstrate that our BI-DiffSR outperforms existing binarization methods.


HRLRSR3 (FP)BBCUBI-DiffSR (ours)
<img src="figs/compare/ComS_img_023_HR_x4.png" height=80><img src="figs/compare/ComS_img_023_Bicubic_x4.png" height=80><img src="figs/compare/ComS_img_023_SR3_x4.png" height=80><img src="figs/compare/ComS_img_023_BBCU_x4.png" height=80><img src="figs/compare/ComS_img_023_BI-DiffSR_x4.png" height=80>
<img src="figs/compare/ComS_img_033_HR_x4.png" height=80><img src="figs/compare/ComS_img_033_Bicubic_x4.png" height=80><img src="figs/compare/ComS_img_033_SR3_x4.png" height=80><img src="figs/compare/ComS_img_033_BBCU_x4.png" height=80><img src="figs/compare/ComS_img_033_BI-DiffSR_x4.png" height=80>

TODO

Dependencies

# Clone the github repo and go to the default directory 'BI-DiffSR'.
git clone https://github.com/zhengchen1999/BI-DiffSR.git
conda create -n bi_diffsr python=3.9
conda activate bi_diffsr
pip install -r requirements.txt -f https://download.pytorch.org/whl/torch_stable.html
git clone https://github.com/huggingface/diffusers.git
cd diffusers
pip install -e ".[torch]"

Contents

  1. Datasets
  2. Models
  3. Training
  4. Testing
  5. Results
  6. Citation
  7. Acknowledgements

<a name="datasets"></a> Datasets

Used training and testing sets can be downloaded as follows:

Training SetTesting SetVisual Results
DIV2K (800 training images, 100 validation images) + Flickr2K (2650 images) [complete training dataset DF2K: Google Drive / Baidu Disk]Set5 + Set14 + BSD100 + Urban100 + Manga109 [complete testing dataset: Google Drive / Baidu Disk]Google Drive / Baidu Disk

Download training and testing datasets and put them into the corresponding folders of datasets/.

<a name="models"></a> Models

MethodParams (M)FLOPs (G)PSNR (dB)LPIPSModel ZooVisual Results
BI-DiffSR4.5836.6724.110.1823Google DriveGoogle Drive

The performance is reported on Urban100 (×4). Output size of FLOPs is 3×256×256.

<a name="training"></a> Training

<a name="testing"></a> Testing

<a name="results"></a> Results

We achieve state-of-the-art performance. Detailed results can be found in the paper.

<details> <summary>Quantitative Comparisons (click to expand)</summary> <p align="center"> <img width="900" src="figs/T1.png"> </p> </details> <details> <summary>Visual Comparisons (click to expand)</summary> <p align="center"> <img width="900" src="figs/F1.png"> </p> <p align="center"> <img width="900" src="figs/F2-1.png"> <img width="900" src="figs/F2-2.png"> </p> <p align="center"> <img width="900" src="figs/F3-1.png"> <img width="900" src="figs/F3-2.png"> </p> </details>

<a name="citation"></a> Citation

If you find the code helpful in your research or work, please cite the following paper(s).

@inproceedings{chen2024binarized,
    title={Binarized Diffusion Model for Image Super-Resolution},
    author={Chen, Zheng and Qin, Haotong and Guo, Yong and Su, Xiongfei and Yuan, Xin and Kong, Linghe and Zhang, Yulun},
    booktitle={NeurIPS},
    year={2024}
}

<a name="acknowledgements"></a> Acknowledgements

This code is built on BasicSR, Image-Super-Resolution-via-Iterative-Refinement.