SinDiffusion: Learning a Diffusion Model from a Single Natural Image
We present SinDiffusion, leveraging denoising diffusion models to capture internal distribution of patches from a single natural image. SinDiffusion significantly improves the quality and diversity of generated samples compared with existing GAN-based appr
arxiv.org
1. Introduction
SinGAN: Multiple models at progressive growing scales
- generate unsatisfactory images
- accumulate small detail erros
Single-image Diffusion Model (SinDiffusion) for learning from a single natural image.
- DDPM based
- A single diffusion-based model trained on a single scale is well-suited for this task.
- Diffusion model은 multiple-step generation이지만 accumulated errors의 문제는 없음(노이즈 취급하면 됨)
- Diffusion model의 receptive field를 제한한 것
- 네트워크 구조는 전체 이미지를 덮을 수 있는 큰 receptive field를 갖고 있기 때문에 모델은 train image를 memorize하는 경향이 있기 때문에 train image와 정확히 같은 이미지를 생성함.
- 전체 이미지를 기억하는 것보다 patch statistics를 학습하기 위해 저자들은 patch-wise denoising network를 사용
- SinDiffusion reduces the downsampling times and the number of resblocks in the original denoising network structure.
SinGAN의 application은 “spatially aligned” condition이 주어진 application으로 제한됨. 반면 SinDiffusion은 샘플링 절차를 설계해 더 다양한 application을 사용할 수 있음.
SinDiffusion은 unconditional training을 통해 data distribution의 gradient를 예측해서 학습함. SinDiffusion은 Data distribution에 맞고, condition에 대응하는 이미지를 생성할 수 있음.
- Contributions
- novel diffusion based frameworks for capturing the internal statistics of patches from a single natural image
- Single-scale training & new network with patch-level receptive fields
- text-guided image generation, image outpainting, etc
- demonstrate the effectiveness and wide applicability of our framework
2. Related Work
2.1 DDPM
- Palette
- DDRM
- ILVR
- DDIBs & EGSDE
2.2. Single Image generation
Single image generation aims to generate diverse results by learning the internal patch distribution from a single image.
3. Method
저자들은 Diffusion network의 patch-level receptive field가 internal patch distribution과 새로운 denoising network structure를 design하는데 중요한 역할을 한다는 것을 찾음.
3.1. Revisiting SinGAN
SinGAN이 하나의 이미지로부터 다양한 이미지를 만드는 방법은 image pyramid를 만들고 점진적으로 생성된 이미지의 resolution을 높이는 것임. 각 scale $n$에서 이전 scale $\tilde x_{n+1}$이 upsampled 되어서 input noise map $z_n$과 함께 PatchGAN에 들어가서 scale $n$에서 이미지를 생성함.
근데 GAN의 경우에는 error부분이 resolution이 올라갈수록 더 커지는 현상이 나오기 때문에 Diffusion을 사용하게 됨.
SinGAN과 다르게 SinDiffusion은 single scae에 대해 single denoising network를 통해 multiple-step generation process를 거침.
3.2 SinDiffusion
저자들은 receptive field가 internal patch statistics를 학습하는데 중요하며, diffusion network의 patch-level receptive field가 single image generation에 중요하고 효과적이라는 것을 가정했음.
저자들은 다른 receptive fields(유사한 capabilities)와 4개 네트워크 구조를 만들고 single natural image에 대해 학습함.
위 그림이 다른 receptive fileds에 따른 결과를 보여줌. receptive fields가 작을수록 다양한 이미지를 만들어내지만 원본 이미지의 형태를 보존하지 못하는 것을 확인함. 따라서 적절한 receptive field는 patch statistics를 포착하는데 매우 중요함.
Patch-wise denoising network 구조
차이점
1. 저자들은 upsample, downsample operation을 줄여서 네트워크의 depth를 줄임. denoising network에서 사용된 attention layer는 제거되었음. 이를 통해 SinDiffusion은 임의의 resolution 생성에 적용할 수 있는 fully-convolutional network로 만듬
2. 각 resolution의 time-embedd resblocks을 줄여서 SinDiffusion의 receptive field를 제한시킴.
loss는 original denoising loss를 사용하여 학습시킴
SinDiffusion은 training image $x$를 reconstruct하도록 학습되었음
학습된 후에는 SinDiffusion은 iterative하게 다양한 이미지를 생성할 수 있음.
4. Experiments
4.1 Setup
Datasets
various natural images on online
Places50
Implementation Details
AdamW optimizer
exponential moving average (EMA) with 0.9999 decay
Evaluation metrics
- single-image Frechet Inception Distance (SIFID) metric
- the deviation between the distribution of patch-wise features from the generated images and the real images
- LPIPS metrics → evaluate generative diversity
4.2 Qualitative Evaluation
먼저 각 학습 이미지에 대해 먼저 동일한 가로/세로 비율을 만들어줌. 그 다음 여러 방향에 대한 새로운 생성 이미지를 만들어냄. 그 결과 학습 이미지와 비슷한 패턴을 가진 새로운 이미지를 만들어서 붙여줌.
학습 이미지는 486 x 741 resolution
- enhanced version: larger receptive fields & network capability
- 4 downsample layers and an additional time-embedded resblock on each scale
- 486 x 2048 resolution 이미지를 생성함.
4.3 Comparison with previous methods
SinGAN [36], ExSinGAN [46], ConSin-GAN [11] and GPNN [9]
이 외에도 20명 불러서 어떤게 더 나은지 물어봄.
4.4 Image Manipulation
Text-guided image generation
CLIP. & pre-trained diffusion model
Image Outpainting
학습 이미지의 patch의 internal distribution을 SinDiffusion이 학습함. 원본 이미지 $x^a$를 주어진 영역을 대체하면서 새로운 이미지를 만들어냄. $m^a$는 outpainting 된 이미지, $x_\theta(z_t)$는 iterative latent, $x_{t-1}^a$는 timestep $t-1$에서의 이미지의 noise 버전을 의미함.
5. Conclusion
receptive field가 중요함.
particular, we find that the receptive field plays an important role in diverse image generation and design a patch-wise denoising network for producing realistic and diverse images.
task: text-guided image generation, and image outpainting
SIFID and LPIPS metrics SOTA & better quantitative quality