Skip to main content
QUICK REVIEW

[论文解读] DiM: Diffusion Mamba for Efficient High-Resolution Image Synthesis

Yao Teng, Yue Wu|arXiv (Cornell University)|May 23, 2024
Medical Image Segmentation TechniquesComputer Science被引用 3
一句话总结

该论文提出了一种基于Mamba的新型骨干网络Diffusion Mamba(DiM),用于高效生成高分辨率图像,通过利用状态空间模型(State Space Models)克服了Transformer模型的二次方复杂度问题。通过引入多方向扫描、可学习的填充标记(padding tokens)以及局部特征增强机制,DiM在显著降低FLOPs的同时,实现了SOTA级别的FID得分(在ImageNet 512×512上为2.40),并支持无需微调的1536×1536分辨率直接上采样生成。

ABSTRACT

Diffusion models have achieved great success in image generation, with the backbone evolving from U-Net to Vision Transformers. However, the computational cost of Transformers is quadratic to the number of tokens, leading to significant challenges when dealing with high-resolution images. In this work, we propose Diffusion Mamba (DiM), which combines the efficiency of Mamba, a sequence model based on State Space Models (SSM), with the expressive power of diffusion models for efficient high-resolution image synthesis. To address the challenge that Mamba cannot generalize to 2D signals, we make several architecture designs including multi-directional scans, learnable padding tokens at the end of each row and column, and lightweight local feature enhancement. Our DiM architecture achieves inference-time efficiency for high-resolution images. In addition, to further improve training efficiency for high-resolution image generation with DiM, we investigate "weak-to-strong" training strategy that pretrains DiM on low-resolution images ($256 imes 256$) and then finetune it on high-resolution images ($512 imes 512$). We further explore training-free upsampling strategies to enable the model to generate higher-resolution images (e.g., $1024 imes 1024$ and $1536 imes 1536$) without further fine-tuning. Experiments demonstrate the effectiveness and efficiency of our DiM. The code of our work is available here: {\url{https://github.com/tyshiwo1/DiM-DiffusionMamba/}}.

研究动机与目标

  • 解决基于Transformer的扩散模型在高分辨率图像生成中计算成本过高的问题。
  • 将Mamba——一种线性复杂度的序列建模模型——适配于二维图像数据,该模型原本专为一维序列建模设计。
  • 通过提出一种“弱到强”微调策略,提升高分辨率图像生成的训练效率。
  • 通过无训练上采样技术,实现在微调分辨率之外的高分辨率图像生成。

提出的方法

  • 通过采用多方向扫描(行主序、列主序及反向扫描)将Mamba适配于二维图像标记,以提供全局感受野。
  • 在空间相邻但序列上不连续的标记之间(例如,某行末尾与下一行开头)引入可学习的填充标记,以保持空间连续性。
  • 在输入和输出头处集成轻量级的3×3深度可分离卷积层,以增强局部特征的一致性。
  • 在浅层与深层之间引入长距离跳跃连接,以改善扩散去噪过程中的像素级重建质量。
  • 实施“弱到强”训练策略:先在256×256图像上预训练,再在512×512图像上微调,以降低训练成本。
  • 探索无训练上采样:在512×512图像上微调后,利用模型的泛化能力,直接在1024×1024和1536×1536分辨率上生成图像,无需进一步调优。
Figure 1 : The images generated by our model trained on ImageNet. The resolutions are $1024\times 1024$ , $512\times 512$ and $256\times 256$ . The classifier-free guidance weight is set to 4.0.
Figure 1 : The images generated by our model trained on ImageNet. The resolutions are $1024\times 1024$ , $512\times 512$ and $256\times 256$ . The classifier-free guidance weight is set to 4.0.

实验结果

研究问题

  • RQ1Mamba作为一种线性复杂度的序列模型,能否在高分辨率图像生成的扩散模型中有效替代Transformer?
  • RQ2如何将Mamba的一维因果建模机制适配,以在图像标记中保持二维空间结构?
  • RQ3“弱到强”微调策略是否能显著降低高分辨率扩散模型的训练成本?
  • RQ4DiM能否在无需额外微调的情况下,通过无训练上采样技术生成1024×1024和1536×1536分辨率的图像?
  • RQ5哪些架构组件(如多扫描、填充标记、局部卷积)对性能与稳定性最为关键?

主要发现

  • DiM-Huge在仅使用3.19亿个训练样本的情况下,于ImageNet 512×512上实现了2.40的FID得分,与U-ViT性能相当,但数据量减少了37%。
  • 在仅1500万个512×512图像(U-ViT数据量的3%)下,DiM-Huge实现了3.94的FID-50K,展现出极高的数据效率。
  • 多方向扫描策略(四个方向)表现最佳,相比单方向扫描,FID降低了1.48分。
  • 消融实验表明,多个扫描方向对性能贡献最大,其次为长距离跳跃连接和填充标记。
  • DiM可直接从一个在512×512上微调的模型,通过无训练上采样生成视觉上合理的1024×1024和1536×1536图像,无需进一步微调。
  • DiM-Small在CIFAR-10上实现了2.92的FID得分,优于其他参数量相近的模型,证实了其在大规模场景下的强大性能。
Figure 2 : Overview. The inputs of our framework is a noisy image/latent, with a timestep and a class condition. The noisy inputs are transformed into patch-wise features, processed by a depth-wise convolution, and appended with time, class, and padding tokens. The features are flattened and scanned
Figure 2 : Overview. The inputs of our framework is a noisy image/latent, with a timestep and a class condition. The noisy inputs are transformed into patch-wise features, processed by a depth-wise convolution, and appended with time, class, and padding tokens. The features are flattened and scanned

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。