Stand on the shoulders of giants

[paper review] GDP: Generative Diffusion Prior for Unified Image Restoration and Enhancement 본문

Paper reviews

[paper review] GDP: Generative Diffusion Prior for Unified Image Restoration and Enhancement

finallyupper 2024. 8. 25. 15:04

해당 논문은 다음과 같은 사실에서 contribution을 가진다.

 

1) unconditionial DDPM pre-trained on ImageNet을 활용

2) Randomly initialized된 Degradation parameter들을 optimize

3) Hierarchical guidance and patch-based methods

4) 매 스텝마다 temporary output을 예측

5) single/multiple linear inverse task들을 다룰 수 있음

Preliminary

DDPMs

Forward Process

Backward Process

xt에서 x0 tilde를 구하면 이들을 기반으로 평균과 분산을 구해 다음 값인 x_{t-1}을 예측하는 방향으로 프로세스가 진행된다.

 

Generative Diffusion Prior

Degraded Image가 capture되는 방식

y = D(x)

x : original natural image

D : degradation model

주로 prior에 담긴 x에 대한 정보를 활용해서 y와 가장 적합하는 x를 x의 space에서 찾게 된다.

이때 prior로 GAN을 사용하는 것에 대해 제한된 applicaitons로 한계를 느끼고 diffusion model들을 사용하게 되었는데, 이때 DDPM의 reverse denoising process에서 degraded image y로 conditioning하는 방식을 이용하게 된다.

 

L : image distance metric

Z : normalization factor

s : scaling factor (guidance의 magnitude를 control)

Q : optional quality enhance- ment loss to enhance the flexibility of GDP

⇒ 즉 해당 과정은 p_{\theta}(x_{t-1}|x_t)에서 ∇xt log p (y | xt) 만큼 평균을 shift한 것으로 생각해볼 수 있다.

(그런데 이후 복원된 이미지에 guidance와 variance를 더하는 방식에 문제가 있음을 발견했다)

 

PROOF

 

p_theta를 이차 미분할 경우 ||Σ|| → 0가 됨을 확인할 수 있다. 따라서 p_phi와 p_theta를 비교했을때 p_phi가 Σ−1과 비교했을때 상대적으로 낮은 곡률을 보이기 때문에 p_phi에 대해 Taylor expansion을 적용해 앞 term만 남기도록 근사할 수 있게 된다.

 

 

1) Single Image Guidance

SR, inpainting, colorizaiton, deblurring, enlighting task들이 이에 해당됨.

The Influence of Variance Σ on the Guidance

이전까지 coniditional diffusion model들에서는 mean shift를 위해 sampling과정에서 Σ를 이용했는데, 해당 논문에서는 생성되는 이미지의 퀄리티에 Σ가 부정적인 영향을 미칠 수 있음을 보였다.

따라서 본 연구에서는 denoising process에서 variance를 제거하고, fixed guidance scale s를 활용해서 process를 control하고자 한다.

Guidance on x_t

 

  • GDP-x_t : x_t가 guidance로 condition되어있으나 Σ는 없는 모델
    • 그런데 이러한 방식은 noisy한 이미지 x_t와 noise가 없거나 distribution이 다른 일반적인 corrupted image인 y간의 MSE를 계산하게 될경우 결국 noise 차이로 인해 비슷한 이미지임에도 불구하고 다른 이미지로 책정해버릴 수 있기 때문에 만족스럽지 못한 퀄리티의 이미지를 생성할 수 있다.

 

Guidance on \tilde{x_0}​

위에서 언급한 한계를 극복하고자 DDPM에서 xt에서 \tilde{x_0}를 예측하고 이 둘을 가지고 x_{t-1}을 계산하는 과정에서 \tilde{x_0} 에 guidance를 추가해 DDPM의 generation process를 control하는 방법을 제안하게 되었다.

 

Known Degradation

Image deblurring, super-resolution

  • LR image는 HR image에 Gaussian kernel k를 적용한 다음 scale factor s로 downsampling해서 생성함.

Image inpainting

  • binary mask m과 original image x를 Hadamard’s product해서 생성

Image Colorization

degradation transform ψ 를 활용해서 gray-scale image로 생성

 

Unknown Degradation

ex. HDR recovery

본 논문에서는 복잡한 degradation들을 단순하지만 효과적인 degradation model로 simulate하고자 한다. 그 근거로는 corrupted images와 해당하는 high-quality image의 pair은 동일한 size만 갖고 있다면 f, M으로 모델링이 가능하다는 것이다.

f : light factor, scalar

M : light mask, x와 같은 차원을 갖는 vector (degradation model의 unknown parameters)

 

2)  Extended version

Multi-images Guidance

본 논문에서는 여러장의 이미지들을 guidance로 활용해 HDR image를 복원하는 HDR-GDP를 제안하낟. (총 3장의 guidance image으로, short/medium/log exposures)

이 또한 y=fx+M으로 모델링이 가능하고, blind parameters가 3쌍 필요하다.

 

Restore Any-size Image

어느 resolution의 image도 복원할 수 있는 모델을 구축하고자 patch-based method를 사용했다.

 

Loss function

1) Reconstruction Loss

MSE, SSIM(Structural Similarity Index Measure), Perceptual loss, etc.

2) Quality enhancement Loss

(1) Exposure Control Loss

  • U : 겹치지 않는8x8 local regions
  • R : 복원된 이미지에서 평균 intensity 값
  • E : RGB color space에서 gray level로 설정됨 (밝기 조정에 사용)

(2) Color Constancy Loss

  • Y^m : 복원된 이미지의 m channel의 평균 intensity 값
  • (m, n) : a pair of channels

(3) Illumination Smoothness Loss

 

Experiments

 

 

Ablation study

GDP-x_t와 GDP-x_0 모두 Σ가 없을때가 있을때보다 우수한 성능을 보였음을 확인할 수 있었다.

 

Conclusion

해당 논문에서는 통합된 image restoration을 가능케하는 Generative Diffusion Prior를 제안하여 linear inverse, non-linear, blind problems에 대응할 수 있도록 하였다.

Appendix

Limitations

  1. guidance step을 매 time step마다 적용하기 때문에 sampling time이 길어져 inference time이 느려진다.
  2. sample의 distribution에 따라 guidance scale s를 조정해야한다.