ABSTRACT
We propose a novel method for unsupervised image-to-image translation, which incorporates a new attention module and a new learnable normalization function in an end-to-end manner. The attention module guides our model to focus on more important regions distinguishing between source and target domains based on the attention map obtained by the auxiliary classifier. Unlike previous attention-based method which cannot handle the geometric changes between domains, our model can translate both images requiring holistic changes and images requiring large shape changes. Moreover, our new AdaLIN (Adaptive Layer-Instance Normalization) function helps our attention-guided model to flexibly control the amount of change in shape and texture by learned parameters depending on datasets. Experimental results show the superiority of the proposed method compared to the existing state-of-the-art models with a fixed network architecture and hyper-parameters. Our code and datasets are available at https://github.com/taki0112/UGATIT or https://github.com/znxlwm/UGATITpytorch
개요
우리는 새로운주의 모듈과 학습 가능한 새로운 정규화 기능을 종단 간 방식으로 통합하는 비지도 이미지 대 이미지 변환을위한 새로운 방법을 제안합니다. 주의 모듈은 보조 분류기에서 얻은주의지도를 기반으로 소스 및 대상 도메인을 구별하는 더 중요한 영역에 초점을 맞추도록 모델을 안내합니다. 도메인 간의 기하학적 변화를 처리 할 수없는 기존의주의 기반 방법과 달리 우리 모델은 전체적인 변화가 필요한 이미지와 큰 모양 변화가 필요한 이미지를 모두 번역 할 수 있습니다. 또한, 새로운 AdaLIN (Adaptive Layer-Instance Normalization) 기능은주의 기반 모델이 데이터 세트에 따라 학습 된 매개 변수에 의해 모양과 질감의 변화량을 유연하게 제어 할 수 있도록 도와줍니다. 실험 결과는 고정 네트워크 아키텍처와 하이퍼 파라미터를 사용하는 기존의 최첨단 모델과 비교하여 제안 된 방법의 우월성을 보여줍니다. 우리의 코드와 데이터 세트는 https://github.com/taki0112/UGATIT 또는 https://github.com/znxlwm/UGATITpytorch에서 사용할 수 있습니다.
ugatit 은 unsupervised image-to-image translation을 위한 모델 기존 최첨단 방법과 비교하여 우월한 성능을 보여줌
어텐션 모듈이 source와 target이미지에서의 더 중요한 부분에 초점을 맞출 수 있도록 함.large shape changes, holistic changes 가 뭐지?AdaLIN이 모양과 질감의 변화를 유연하게 제어할 수 있도록함.
large shape 에 대해서는, 기존의 GAN 을 이용한 image translation의 경우 소스와 타겟 이미지의 차이가 크면 안됐다고 합니다. 그래서 인풋 이미지를 클리핑하거나 줄이는 방식을 사용했다고 해요. Ugatit은 그런 단점을 완화한 것 같습니다
INTRODUCTION
Image-to-image translation aims to learn a function that maps images within two different domains.
This topic has gained a lot of attention from researchers in the fields of machine learning and com-
puter vision because of its wide range of applications including image inpainting (Pathak et al.
(2014); Iizuka et al. (2017)), super resolution (Dong et al. (2016); Kim et al. (2016)), colorization
(Zhang et al. (2016; 2017)) and style transfer (Gatys et al. (2016); Huang & Belongie (2017)). When
paired samples are given, the mapping model can be trained in a supervised manner using a con-
ditional generative model (Isola et al. (2017); Li et al. (2017a); Wang et al. (2018)) or a simple
regression model (Larsson et al. (2016); Long et al. (2015); Zhang et al. (2016)). In unsupervised
settings where no paired data is available, multiple works (Anoosheh et al. (2018); Choi et al. (2018);
Huang et al. (2018); Kim et al. (2017); Liu et al. (2017); Royer et al. (2017); Taigman et al. (2017);
Yi et al. (2017); Zhu et al. (2017)) successfully have translated images using shared latent space (Liu
et al. (2017)) and cycle consistency assumptions (Kim et al. (2017); Zhu et al. (2017)). These works
have been further developed to handle the multi-modality of the task (Huang et al. (2018)).
소개
이미지 대 이미지 번역은 두 개의 다른 도메인 내에서 이미지를 매핑하는 기능을 학습하는 것을 목표로합니다.
이 주제는 이미지 인 페인팅 (Pathak et al. (2014), Iizuka et al. (2017)), 초 고해상도 (2017)를 포함한 광범위한 응용 분야로 인해 머신 러닝 및 컴퓨터 비전 분야의 연구자들로부터 많은 주목을 받았습니다. Dong et al. (2016); Kim et al. (2016)), 채색 (Zhang et al. (2016; 2017)) 및 스타일 전달 (Gatys et al. (2016); Huang & Belongie (2017)). 언제
짝을 이룬 샘플이 주어지면, 매핑 모델은 조건부 생성 모델 (Isola et al. (2017); Li et al. (2017a); Wang et al. (2018)) 또는 단순 회귀 모델을 사용하여 감독 방식으로 훈련 될 수 있습니다.. (Larsson et al. (2016); Long et al. (2015); Zhang et al. (2016)). 짝을 이룬 데이터가없는 비지도 환경에서는 여러 작품 (Anoosheh et al. (2018); Choi et al. (2018);
Huang et al. (2018); Kim et al. (2017); Liu et al. (2017); Royer et al. (2017); Taigman et al. (2017);
Yi et al. (2017); Zhu et al. (2017)) 공유 잠재 공간 (Liu et al. (2017))과주기 일관성 가정 (Kim et al. (2017); Zhu et al. (2017))을 사용하여 이미지를 성공적으로 번역했습니다. 이러한 작업은 작업의 다중 양식을 처리하기 위해 추가로 개발되었습니다 (Huang et al. (2018)).
Despite these advances, previous methods show performance differences depending on the amount of change in both shape and texture between domains. For example, they are successful for the style transfer tasks mapping local texture (e.g., photo2vangogh and photo2portrait) but are typically unsuccessful for image translation tasks with larger shape change (e.g., selfie2anime and cat2dog) in wild images. Therefore, the pre-processing steps such as image cropping and alignment are often required to avoid these problems by limiting the complexity of the data distributions (Huang et al. (2018); Liu et al. (2017)). In addition, existing methods such as DRIT (Lee et al. (2018)) cannot acquire the desired results for both image translation preserving the shape (e.g., horse2zebra) and image translation changing the shape (e.g., cat2dog) with the fixed network architecture and hyper-parameters. The network structure or hyper-parameter setting needs to be adjusted for the specific dataset.
이러한 발전에도 불구하고 이전 방법은 도메인 간 모양과 질감의 변화량에 따라 성능 차이를 보여줍니다. 예를 들어 로컬 텍스처를 매핑하는 스타일 전송 작업 (예 : photo2vangogh 및 photo2portrait)에는 성공하지만 일반적으로 야생 이미지에서 모양이 더 큰 이미지 변환 작업 (예 : selfie2anime 및 cat2dog)에는 성공하지 못합니다. 따라서 데이터 분포의 복잡성을 제한하여 이러한 문제를 피하기 위해 이미지 자르기 및 정렬과 같은 전처리 단계가 종종 필요합니다. (Huang et al. (2018); Liu et al. (2017)). 또한, DRIT (Lee et al. (2018))와 같은 기존 방법은 고정 된 네트워크 아키텍처로 형태를 보존하는 이미지 번역 (예 : horse2zebra)과 형태를 변경하는 이미지 번역 (예 : cat2dog) 모두 원하는 결과를 얻을 수 없습니다. 및 하이퍼 매개 변수. 네트워크 구조 또는 하이퍼 파라미터 설정은 특정 데이터 세트에 맞게 조정해야합니다.
In this work, we propose a novel method for unsupervised image-to-image translation, which in-corporates a new attention module and a new learnable normalization function in an end-to-end manner. Our model guides the translation to focus on more important regions and ignore minor regions by distinguishing between source and target domains based on the attention map obtained by the auxiliary classifier. These attention maps are embedded into the generator and discriminator to focus on semantically important areas, thus facilitating the shape transformation. While the attention map in the generator induces the focus on areas that specifically distinguish between the two domains, the attention map in the discriminator helps fine-tuning by focusing on the difference between real image and fake image in target domain. In addition to the attentional mechanism, we have found that the choice of the normalization function has a significant impact on the quality ofthe transformed results for various datasets with different amounts of change in shape and texture.Inspired by Batch-Instance Normalization(BIN) (Nam & Kim (2018)), we propose Adaptive Layer-Instance Normalization (AdaLIN), whose parameters are learned from datasets during training timeby adaptively selecting a proper ratio between Instance normalization (IN) and Layer Normaliza-tion (LN). The AdaLIN function helps our attention-guided model to flexibly control the amount ofchange in shape and texture. As a result, our model, without modifying the model architecture or the hyper-parameters, can perform image translation tasks not only requiring holistic changes but also requiring large shape changes. In the experiments, we show the superiority of the proposed method compared to the existing state-of-the-art models on not only style transfer but also object transfiguration. The main contribution of the proposed work can be summarized as follows:
이 작업에서 우리는 새로운주의 모듈과 새로운 학습 가능한 정규화 기능을 종단 간 방식으로 통합하는 비지도 이미지 대 이미지 변환을위한 새로운 방법을 제안합니다. 우리의 모델은 번역을 안내하여 더 중요한 영역에 초점을 맞추고 보조 분류기에서 얻은주의지도를 기반으로 소스 및 대상 도메인을 구분하여 작은 영역을 무시합니다. 이러한 어텐션 맵은 생성기 및 판별기에 포함되어 의미 상 중요한 영역에 집중하여 모양 변환을 촉진합니다. 생성기의 어텐션 맵은 두 도메인을 구체적으로 구별하는 영역에 초점을 맞추지 만, 판별 기의 어텐션 맵은 대상 도메인에서 실제 이미지와 가짜 이미지의 차이에 초점을 맞춰 미세 조정을 도와줍니다. 주의 메커니즘 외에도, 우리는 정규화 함수의 선택이 모양과 질감의 변화량이 다른 다양한 데이터 세트에 대한 변환 된 결과의 품질에 상당한 영향을 미친다는 것을 발견했습니다 .Inspired by Batch-Instance Normalization (BIN) ( Nam & Kim (2018))은 인스턴스 정규화 (IN)와 계층 정규화 (LN) 사이의 적절한 비율을 적응 적으로 선택하여 학습 시간 동안 데이터 세트에서 매개 변수를 학습하는 적응 형 계층 인스턴스 정규화 (AdaLIN)를 제안합니다. AdaLIN 기능은 주의 유도 모델이 모양과 질감의 변화량을 유연하게 제어 할 수 있도록 도와줍니다. 결과적으로 모델 아키텍처 나 하이퍼 파라미터를 수정하지 않고도 우리의 모델은 전체적인 변경뿐만 아니라 큰 모양 변경도 요구하는 이미지 변환 작업을 수행 할 수 있습니다. 실험에서 우리는 스타일 전달뿐만 아니라 객체 변형에서도 기존의 최첨단 모델에 비해 제안 된 방법의 우월성을 보여 주었다. 제안 된 작업의 주요 기여는 다음과 같이 요약 할 수 있습니다.
• We propose a novel method for unsupervised image-to-image translation with a new atten-tion module and a new normalization function, AdaLIN.
• Our attention module helps the model to know where to transform intensively by distin-
guishing between source and target domains based on the attention map obtained by the
auxiliary classifier.
• AdaLIN function helps our attention-guided model to flexibly control the amount of change
in shape and texture without modifying the model architecture or the hyper-parameters.
• 새로운주의 모듈과 새로운 정규화 함수 인 AdaLIN을 사용하여 감독되지 않은 이미지 대 이미지 변환을위한 새로운 방법을 제안합니다.
• 어텐션 모듈은 보조 분류기에서 얻은 어텐션 맵을 기반으로 소스 및 대상 도메인을 구분하여 모델이 집중적으로 변환 할 위치를 알 수 있도록 도와줍니다.
• AdaLIN 기능은주의 유도 모델이 모델 아키텍처 또는 하이퍼 매개 변수를 수정하지 않고도 모양과 질감의 변화량을 유연하게 제어 할 수 있도록 도와줍니다.
"새로운 어텐션 모듈과" "새로운 학습가능한 정규화 함수"
auxiliary classifier란 무엇인가? --> 수렴성을 개선시킨 딥러닝 네트워크
Auxiliary Classifiers are type of architectural component that seek to improve the convergence of very deep networks. They are classifier heads we attach to layers before the end of the network. The motivation is to push useful gradients to the lower layers to make them immediately useful and improve the convergence during training by combatting the vanishing gradient problem. They are notably used in the Inception family of convolutional neural networks.
facilitating the shape transformation.
2개의 판별기와 2개의 생성기
판별기의 어텐션 모듈이 생성기로 하여금 "중요한 부분"(실제 이미지처럼 보이는데 중요한) 에 주목하여 생성하게 끔한다.
생성기의 어텐션 모듈이 판별기로 하여금 다른 도메인과 구별되는 영역에 집중할 수 있도록 한다.
동현님 말씀
large shape changes, holistic changes 가 뭐지?
large shape 에 대해서는, 기존의 GAN 을 이용한 image translation의 경우 소스와 타겟 이미지의 차이가 크면 안됐다고 합니다. 그래서 인풋 이미지를 클리핑하거나 줄이는 방식을 사용했다고 해요. Ugatit은 그런 단점을 완화한 것 같습니다
adalin 이 이 장점에 기여하는 것 같은데 어떻게 그게 되는지는 논문을 읽어보는 중입니다!
그럼 이미지 shape이 달라도 잘 학습한다는 건가요? --> 네
Holistic changes 에도 강하다는게... 정확하진 않을 수 있지만 타겟과 소스 이미지가 전체적으로 (holistically) 많이 달라도 잘 변환할 수 있다는 뜻이 아닐까 추측해봅니다!
Instance Normalization 의 경우 국소적 통계를 구하다보니 원본 컨텐츠가 너무 많이 남는반면, layer norm 은 global stats 를 보다보니 원본 컨텐츠 정보를 많이 유실 --> 이 둘을 learnable parameters로 조정 --> attention map 을 활용하여 소스의 어디가 중요하고 어디가 아닌지 --> 원본 컨텐츠를 적당히 유지하면서도 style 을 적용해야할 부분은 확실히!
Generator: Input 을 downsampling --> Res block 에 통과시켜서 encoding --> encoded feature maps 을 FC에 태우고, attention map 을 만들어 어느 부분이 중요하고 아닌지 판단 --> 얘를 Decoder로 통과시키는데, 이때 residual blocks equipped with AdaLIN 에 태움 --> 이 과정에서 embedding 된 값들의 평균과 분산을 스타일 이미지에 맞게 shift (IN과 LN의 비율은 학습됨) --> upsampling 시켜서 스타일 변형된 이미지를 생성동혀
Discriminator: 거의 비슷한 방식. 이미지를 다운 샘플링하여 엔코딩시키고 여기서 또 attention을 구함. 이때, 진짜 target image 와 generated image 의 차이가 어디가 큰지 집중하는 듯? --> 이걸 Classifier 에 넣는데, 얘 또한 생성된 이미지가 진짜 target 이미지인지 generated image를 구별하는 것 같슴다!