-
[Image to Image translation] 얼렁뚱땅 Continuous and Diverse Image to Image Translation via Signed Attribute Vectors 리뷰얼렁뚱땅 논문리뷰 2022. 5. 13. 15:43
Introduction
- Image to Image Translation
- 한 도메인의 어떤 그림을 이용하여서 다른 도메인의 그림으로 변환해주는 기술
- 하지만 현재 Continuous하게 이미지를 translation 시키는 것은 한계임
- 왜 연속적으로 가능해야하는데?
- Image morphing 같은 곳에 application이 가능함
- 두 도메인간의 translation 과정 속에서 중간에 어떠한 결과물이 나오는지 더 나은 이해를 위해 좋음
- 기존 연구들의 문제점은?
- 현재 존재하는 I2I의 경우, 연속적인 translation이 불가능함
- 그리고 특정 분야의 Attribute를 딱 잡아서 I2I를 수행함 대표적으로 Style 변환
- 이러한 변환은 사실 intra-domain에서의 interpolation을 이용해 도메인 변화 과정을 볼 수 있지만, 이것은 intra-domain에서만 가능함. 왜냐하면, 서로 다른 domain 간에는 attribute가 완벽 분리되어 있기 때문임
- DLOW model[10]은 Continious Translation을 하였지만, 이러한 방법은 Deterministic Trnaslation으로 입력 이미지와 domain label이 들어왔을 때, 정해진 Path에 의해서만 생성함(특정 도메인으로 이해함)
- 본 연구에서 Focusing 하고자 하는 것은?
- Continous Image to Image Translation
- 다양한 도메인이 가능함(multi-domain)에 따라, 다양한 Translation Path가 존재할 수 있도록 하기
- 뭐가 챌린지냐?
- 기존 연구들은 Domain 별로 Attribute space를 따로 했는데 이것을 어떻게 합치지?
- 중간에 있는 것들은 GT가 없는데 어떻게하지?
- 우리가 뭘 제안하냐
- Signed attrubute vectors(SAVs) 기반으로 novel I2I 제안
- 이미지를 content와 attribute representation으로 뽑아서 분리 시킴
- inter-domain(서로다른 도메인에서 가능하게) 하기 위해서, 모든 도메인들의 attribute들이 통합된 attribute space를 소개함
- 우리는 각 attribute dimension은 가우시안 분포로부터 오는 독립적이고 균일하게 분포된 랜덤 변수로써 랜덤변수로 간주해서 Sample을 추출함
- 그러고, 부호 연산을 통해, 한 도메인이 positive면 다른 도메인은 nagative이게 만듦 --> SAVs
- 제안된 SAVs와 Content Representation은 Generator에 입력되고, Generator는 domain 이미지에 상응하도록 synthesize 함
- 게다가, SAVs 분포를 attribute encoder embedding과 같이 정렬하기 위해 Maximum mean discrepancy(MMD) 제약조건을 사용함 --> Encoding attribute에서 나오는 것이 해당 도메인의 데이터 셋에서 도출된 분포가 맞나 확인하는 것임
- 우리의 Contribution
- 연속적으로 이미지 변환이 어떻게 되는지를 볼 수 있음
- 여러 도메인에 걸쳐서 이미지 변환이 가능함
- 다양한 도메인을 하는데 성능까지 좋음
Related Works
Image to Image Translation
- 기존 Pix2Pix, Cycle GAN 등(이제는 좀 오래된 I2I 알고리즘)들은 one-to-one 변환만 가능하였음
- 최근에는 one-to-many를 수행하기 위해, multi-modal, multi-domain 등의 시도를 하고 있음
- 하지만, 기존 연구들은 연속적으로 중간 결과까지 도출하는 것은 한계까 존재함
- 최근 연구들은 중간 결과를 도출할 수 있도록 연속적으로 한 연구도 존재함
- DLOW[10], [25] 같은 연구들이 있지만 Cycle GAN 기반으로 하여, 한가지에 대한 연속적인 예측이 가능함
- 즉 다양한 도메인에 적용하기에는 한계가 있다는 것임
- Multi modal 방법으로 Image를 도메인이 바뀌어도 바뀌면 안되는 부분, 도메인이 바뀌면서 바뀌어야하는 부분의 Feature를 분리해서 보는 연구들도 존재하였음
- 하지만, 도메인이 바뀌면서 바뀌어야 하는 부분에 대한 Feature가 따로 있기 때문에, 한 도메인 사이에서만 translation이 가능했다는 한계가 존재함
- Interpolation을 하는 방법중 다른 방법은 진짜 명시적으로 Latent space를 Interpolation해서 할 수도 있지만, 이 역시 기존 연구들에서 연속적으로 변환되지 않음
- StarGAN-v2의 경우 여러 도메인이 통합된 것을 수행할 수 있도록 Style Encoder를 설계하였지만, Multiple Embedding braches로 여전히 도메인간의 Attribute들을 분리함
- 따라서, Interpolation으로 스무스한 중간결과가 나오지 못함
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Image Morphing
- Style GAN이나 Style GAN-2가 Image morphing에 효과적임이 증명됨
- 따라서, 최근 연구들은 Pretrained된 GAN모델(Style GAN)을 적용하는 연구가 존재함
Proposed Method
- 아래 그림과 같이 Encoder를 Content를 위한것과 Attribute를 위한 것 따로 씀
- Content는 도메인이 바뀜에도 불구하고, 바뀌면 안되는 고유한 입력 데이터에 대한 정보를 의미함
- Ea는 여러 도메인 변환이 가능하도록 통합된 Attribute vector를 도출 가능한 Encoder임
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. - 아래 식이 다양한 도메인에 대한 Attribute도 담고 있는 z임
- N개의 도메인이 있고, 각 d개의 Attribute가 있더면 z의 차원은 d*N차원임
- 이것을 sign operation을 통해 domain information을 부여 가능 함
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Signed Attribute Vector
- 만약 A라는 도메인 이미지가 들어갔을 때, A 도메인 정보를 강조하고 싶기 때문에 A 도메인에 해당하는 Attribute는 양수로, 그게 아닐 경우에는 음수로 표현함
- 즉 Ea는 본인의 도메인은 + , 아니면 - 로 될 수 있도록 학습을 진행하는 방향
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. - Generator는 어떠한 noise로부터 이미지를 생성하는 역할을 함. 앞서 말한 noise는 만약 Target Domain(y^)으로 만들고 싶다 라고 하면 Signed Attribute vector는 아래 함래 식에 의해, 본인 Domain에 해당하는 것을 양수로 아닌건 음수로 바꿔주는 것을 의미함
- 근데 여기서 signed을 거쳐서 나온 z는 실제 이미지 분포에서 나오도록 만들어주기 위해서 MMD Loss를 사용함
- MMD는 Data sample이 동일한 probability distribution에서 추출된 것이 맞는지 보는 것임
- 이걸 하는 이유는 Attribute Encoder에 쑝하고 들어가면 나오는 attribute representation이 sign 처리 한 것처럼 바로 쫙 나오기를 바라기 때문에 하는 것임
- 그리고 아래 Train 과정을 보면, Source Image에서 추출한 Contents representation과 Target Image에서 추출해서 Sign 과정까지 거치고 나서 Generator의 인풋으로 함께 합쳐서 들어감
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. - Discriminator를 사용하여 이게 진짜 해당 도메인에 대한 이미지인가를 판별함
- 여기서 c는 Source Image 에서 추출한 Content representation을 의미함
- z는 reference image가 있을 시에는 Attribute Encoder를 통과하고 나온 것을 의미하고 zs는 noise로부터 나와서 sign attribute vector를 수행하였을 때를 의미함
- 그리고 Style Loss도 사용함
- 여기서 보는 Gram 은 https://mostar39.tistory.com/29?category=911641 여기에 컨트롤 에프누르고 Style reconstruction loss 치면 나옴
- 간단하게만 설명하자면, 스타일에 대한 특징은 각 픽셀간의 상관관계의 특징으로부터 나온다.. 라는 것을 적용한 것임
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. - Inference는 아래 처럼 진행됨
- attribute representation은 reference 이미지로 부터 나오냐 아니면, 뭐 새로운 얘에서 나오냐 ? 이렇게 두가지 경우가 존재함
- 그리고 Source Image로부터 추출된 content representation를 이용하고, attribute representation은 Source Image에서 추출된 것이랑 Target의 Attribute representation이랑 interpolation해서 넣음 베타에 따라 저렇게 됨
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Improving Quality by Sign-Symmetrical Attribute Vector
- 중간의 결과를 어떻게 도출하냐! 라는 것을 해결하기 위한 곳임
- 실제 중간에 대한 정답 데이터가 없기때문에, 챌린지임
- Domain을 바꿀 때 어떻게 바꿔야 하는지에 대해 궤적을 학습하기 위해서 하는 것임
- zs는 Source 이미지에서 추출한 Attribute representation인데, zsym을 만들기 위해서 target y^ 에 해당하는 Attribute를 양수로, 나머지는 음수로 바꾸는 것을 수행함
- 그리고 이를 Discriminator를 이용하여 특정 도메인에 더 리얼한 표적이 되도록 함(?)
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. - zs와 zsym의 사이의 궤적은 도메인 사이에 이동하는 궤적임
- Train 할 때 이러한 방법으로 연속적인 변환궤적을 형성함
- 그리고 베타를 이용하여, 이렇게 해서 중간값을 도출 가능함
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. - 근데 이게 진짜 그 중간에 있는 것인지를 보기 위해서 Interpolation loss를 사용함
- 베타가 0.5보다 작으면 아직 Source domain 쪽에 있는 것이기 때문에 정말 Source domain에 있는지 Discriminator를 이용하고, 0.5보다 크면, Target domain 쪽으로 가있어서 Target domain인지를 Discriminaotr로 확인
- 0.5일때는 딱 중간을 의미로 Source domain, Target domain 둘다 고려
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Other Loss objectives
content adversarial loss
- content와 attribute representation을 더 분리하기 위해 사용하는 것임
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Cycle-consistency loss
- 도메인에 대한 정보가 바뀌더라도, 이미지가 가지는 고유한 특징인 Content는 변하면 안됨
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. self-reconstruction loss
- 한 이미지 x에 대해서, content와 attribute encoder로 representation을 뽑고, 그걸 Generator의 입력으로 사용하였을 때 진짜 x이미지가 나오는지 확인
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Latent regression loss
- 얘는 위에랑 비슷한데 애는 image의 consistency를 보는 것이 아니라 다시 Latent space로 보내서 Latent space들의 consistency를 확인
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Mode Seeking loss
- mode collapse 현상을 없애고 이미지의 다양성을 증가시키기 위해서 하는 것임
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Total loss
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Implementation Details
- 사용한 Dataset
- Style translation : Yosemite(summer -> winter), Photo2Artwork(Photo, Monet, Van gogh, ukiyo-e)
- Shape-variation translation : CelebA-HQ(Human), AFHQ(Animal)
- Network Architecture
https://link.springer.com/article/10.1007/s11263-021-01557-6/tables/4
Experiments
- Case 1 : Reference 이미지를 사용하여, Reference이미지봐 비슷하게 바뀌는 것이 목표(모양과 느낌)
- Case 2 : 개체의 모양과 질감을 변형하는데 목표임
Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. Mao, Q., Tseng, H. Y., Lee, H. Y., Huang, J. B., Ma, S., & Yang, M. H. (2022). Continuous and diverse image-to-image translation via signed attribute vectors. International Journal of Computer Vision, 1-33. '얼렁뚱땅 논문리뷰' 카테고리의 다른 글