TL;DR
This paper introduces an unsupervised image-to-image translation method leveraging self-attention networks to better capture geometric changes and details, outperforming existing methods in quality and accuracy.
Contribution
It is the first to verify and utilize self-attention networks for unsupervised image translation, enhancing geometric and detail preservation.
Findings
Outperforms state-of-the-art methods in qualitative assessments
Achieves higher quantitative scores in image translation tasks
Effectively captures complex geometric and structural changes
Abstract
Unsupervised image translation aims to learn the transformation from a source domain to another target domain given unpaired training data. Several state-of-the-art works have yielded impressive results in the GANs-based unsupervised image-to-image translation. It fails to capture strong geometric or structural changes between domains, or it produces unsatisfactory result for complex scenes, compared to local texture mapping tasks such as style transfer. Recently, SAGAN (Han Zhang, 2018) showed that the self-attention network produces better results than the convolution-based GAN. However, the effectiveness of the self-attention network in unsupervised image-to-image translation tasks have not been verified. In this paper, we propose an unsupervised image-to-image translation with self-attention networks, in which long range dependency helps to not only capture strong geometric change…
| Dataset | CycleGAN | DRIT | UNIT | MUNIT | Ours |
|---|---|---|---|---|---|
| cat2dog | 133.21 | 148.87 | 101.41 | 122.04 | 96.34 |
| face2cat | 274.61 | 117.05 | 85.78 | 104.09 | 79.95 |
| face2dog | 279.74 | 108.29 | 82.12 | 133.96 | 90.70 |
| cat2face | 454.99 | 242.78 | 359.62 | 269.44 | 208.33 |
| dog2face | 366.33 | 229.21 | 229.06 | 228.06 | 217.58 |
| portrait | 233.34 | 282.29 | 263.28 | 269.56 | 256.04 |
| edges2shoes | 269.18 | 273.93 | 250.99 | 274.11 | 238.57 |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
MethodsGAN Hinge Loss · Dogecoin Customer Service Number +1-833-534-1729 · Six Ways To Communicate To Someone At Expedia Via Phone And Email's. · 1x1 Convolution · Softmax · Spectral Normalization · ((Reservation@Faqs))How do I cancel a reservation on Expedia? · Adam · Convolution · Batch Normalization
Unsupervised Image-to-Image Translation with Self-Attention Networks
Taewon Kang
Sejong Academy of Science and Arts
Sejong, Korea
Kwang Hee Lee
Boeing Korea Engineering and
Technology Center (BKETC)
Seoul, Korea
- indicates corresponding author
Abstract
Unsupervised image translation aims to learn the transformation from a source domain to a target domain given unpaired training data. Several state-of-the-art works have yielded impressive results in the GANs-based unsupervised image-to-image translation. It fails to capture strong geometric changes between domains, or it produces unsatisfactory results for complex scenes, compared to local texture mapping tasks such as style transfer. Recently, SAGAN [35] showed that the self-attention network produces better results than the convolution-based GAN. However, the effectiveness of the self-attention network in unsupervised image-to-image translation tasks have not been verified. In this paper, we propose an unsupervised image-to-image translation with self-attention networks, in which long range dependency helps to not only capture strong geometric change but also generate details using cues from all feature locations. In experiments, we qualitatively and quantitatively show superiority of the proposed method compared to existing state-of-the-art unsupervised image-to-image translation task. The source code and our results are online: https://github.com/itsss/img2img_sa and http://itsc.kr/2019/01/24/2019_img2img_sa
Index Terms:
Generative Adversarial Networks, Image-to-Image Translation, Self-Attention Networks
I Introduction
In computer vision and graphics there are many image-to-image translation tasks, including inpainting [26, 17], super resolution [10, 19], colorization [36, 37], style transfer [11, 15, 25] and so on. This cross-domain image-to-image translation topic has become a major concern of researchers.
In many cases, given a paired dataset, it is possible to solve the problem with conditional image translation [18, 30, 22]. However, it is difficult and expensive to obtain the paired samples. In addition, there are cases where supervision is not possible.
The goal of the unsupervised image translation is to learn the transformation from a source domain to a target domain given unpaired training data. Recent works have yielded impressive results in the GANs-based unsupervised image-to-image translation [34, 38, 20, 29, 23, 27, 8, 16, 1]. It can be largely classified into two types. The first is the style transfer task. This problem is to change low-level information such as color or texture while maintaining high-level information such as content or geometric structure. Style transfer and conditional GANs-based methods have yielded excellent results in this research area.
The second is the object transfiguration task. Unlike the style transfer task, this focuses on changing high-level information while keeping the low-level information. CycleGAN [38], the most representative unsupervised image translation method, failed to change the high-level semantic meaning due to the network structure specialized for style transfer.
To solve the unsupervised image-to-image translation problem, UNIT [23] made a shared-latent space assumption. It assumes a pair of corresponding images in different domains can be mapped to a same latent code in a shared-latent space. MUNIT [16] proposed a multimodal unsupervised image-to-image translation framework.
To achieve many-to-many cross domain mapping, it mitigates a fully shared latent space assumption in UNIT by decomposing a shared-latent space across domains and each domain-specific part for the style code. UNIT and MUNIT experimentally showed impressive animal image translation from a cropped dataset centered on the head. When the training image dataset is spatially unnormalized, it makes the problem more difficult because the absence of correspondences between the shared semantic parts.
In our experiments, we show that these methods often fail in various image-to-image translation applications with strong geometric change. Recently, SAGAN [35] showed that the self-attention module is complementary to convolutions and helps with modeling long range, multi-level dependencies across image regions. Despite the success of the self-attention module in non-conditional GANs, the effectiveness of the self-attention module for unsupervised image-to-image translation has not been validated.
In this paper, we propose a unpaired image-to-image translation model with self-attention networks which allows long range dependency modeling for image translation task with strong geometry change. In experiments, we show superiority of the proposed method compared to existing state-of-the-art unsupervised image-to-image translation tasks.
The source code and our results are online:
https://github.com/itsss/img2img_sa and http://itsc.kr/2019/01/24/2019_img2img_sa.
II Self-Attention GANs
SAGAN [35] showed that the self-attention module is complementary to convolutions and it helps with long range modeling, multi-level dependencies across image regions. Attention mechanisms have become a important part of models that must capture global dependencies [7, 24, 2, 32, 33, 13].
Self attention networks adapt a non-local block [31] to introduce the self-attention to the GAN networks, can enable both the generator and discriminator to efficiently model relationships between widely separated spatial regions. The non-local mechanisms also have become a important part of image generation [4, 9, 5, 6, 12, 3].
In the self attention module (Figure 1.), image features from the previous hidden layer are firstly transformed into two feature spaces and to calculate the attention.
[TABLE]
where , and indicates the extent to which the model attends to the location when synthesizing the region. Then the output of the attention layer is , where,
[TABLE]
In the above formulation, , and are the learned weights parameters, which are implemented as convolutions.
III Methods
III-A Unpaired Image-to-Image Translation with Self Attention Networks
We propose an unsupervised image-to-image translation model with self-attention networks that allows long range dependency modeling for image translation tasks with strong geometry change. Combined with self-attention, the generator can translate images in which fine details at every position are carefully coordinated with fine details in distant portions of the image. Furthermore, the discriminator can also more accurately enforce complicated geometric constraints on the global image structure.
In this paper, our network architecture is devised by combining several self-attention blocks into the generator and discriminator of the Multimodal Unsupervised Image-to-Image Translation [16](MUNIT) model.
To explore the effect of the proposed self-attention mechanism, we built several SAGAN blocks by adding the self-attention mechanism to different stages of the generator and discriminator. For the generator, the self-attention layers are placed before the downsampling layer in the encoder and before the upsampling layer in the decoder, respectively. For the discriminator, it is added before the downsampling layer. Figure 2. shows architecture of our autoencoder model with self-attention networks.
III-B Loss Function
The full objective of our model comprises a bidirectional reconstruction loss function and an adversarial loss function. Same as in [16], our model consists of an encoder and a decoder for each domain. The latent code of each autoencoder is divided into a content code and a style code , where = = . Image-to-image translation can be performed by exchanging encoder-decoder pairs.
Bidirectional Reconstruction Loss Bidirectional reconstruction loss includes image reconstruction loss and latent reconstruction loss. The image reconstruction loss formula is as follows:
[TABLE]
We should be able to reconstruct an image sampled from the data distribution after encoding and decoding.
The latent reconstruction loss formula is as follows:
[TABLE]
Given a latent code (content an style) from the latent distribution, we should be able to reconstruct it after decoding and encoding.
Adversarial Loss The adversarial loss formula is as follows:
[TABLE]
To match the distribution between the translated and target domain, we employ the adversarial loss.
Full objective The total loss formula is as follows:
[TABLE]
IV Experimental Results
In this section, we compared the performance of our model against various unsupervised image-to-image translation models (CycleGAN [38], DRIT [21], UNIT [23], MUNIT [16]). In order to evaluate visual quality of translated images, we performed a user study.
IV-A Implementation Details
We used the MUNIT default setting for experiments. We used the Adam optimizer with , . Initial learning rate of 0.0001 and the learning rate is decreased by half every 100,000 iterations. We used a batch size of 1 and set the loss weights to , , . We trained our networks on four TITAN X accelerators. We trained it over 1,000,000 epochs for around 5 days.
IV-B Datasets
We used cat2dog, face2dog, face2cat, portrait and edges2shoes for test our network.
cat2dog: This datasets are used in DRIT [21]. This dataset contains cat(871) and dog(1,364).
face2dog: This dataset contains faces (CelebA dataset, 202,599) and dog(cat2dog dataset, 1,364).
face2cat: This dataset contains faces (CelebA dataset, 202,599) and cat(cat2dog dataset, 871).
portrait: This datasets are used in DRIT [21]. This dataset contains portrait(1,814) and face photo(6,452).
edge2shoes: This dataset are used in MUNIT [16]. This dataset contains edges(50,025) and shoes(50,025).
IV-C Comparision with Previous Works
cat2dog In the process of changing the image of a cat(domain A) to a dog(domain B) image(Figure 3.), CycleGAN is unable to generate a dog image, since it only takes the color from the image. In the case of DRIT, there is a problem that the image is broken, and it is hard to see it as a dog image reflecting the shape and direction of a cat and dog.
face2cat and face2dog In the process of translating the human face image(domain A) to cat and dog(domain B), CycleGAN and DRIT could not obtain the desired results. Most translated results were distorted. In the case of UNIT and MUNIT, there was a tendency to leave the shape of human face or be distorted in the translated image (See Figure 4. and Figure 5.).
cat2face and dog2face we also experimented for the translations from cats and dogs to human faces. In this experiments, the proposed method showed much better results than the previous works (See Figure 6. and Figure 7.).
portrait Even at the stage of changing the portrait (domain A) shown in Figure 8. to a face(domain B), CycleGAN has not been able to convert portrait photos to face at all. In the case of DRIT, conversion is not performed by generating irrelevant images. In the case of UNIT and MUNIT, there is a problem that the image is distorted although it reflects the shape.
edges2shoes In the process of translating from the edges image(domain A) to a shoes(domain B) image, our model generated more realistic results keeping the pose and style of A domain than the results from other models (See Figure 9).
IV-D Ablation Study
In this section, the other experiments are conducted to evaluate the effectiveness of the self-attention(SA) networks in our unsupervised image-to-image translation model. In Figure 10. self attention unsupervised image-to-image translation models ”SA on downsampling layer (DS-layer)”, ”SA on upsampling layer (US-layer)” and ”SA on DS-layers 3 / US-layers 3” are compared with a our ”SA on DS-layer / US-layer” model.
In case of ”SA on DS-layer”, ”SA on US-layer” and ”SA on DS-layers 3 / US-layers 3”, we could not obtained the well-translated results. However, ”SA on DS-layer / US-layer” model generated more realistic images than other methods. Based on this experiments, we applied ”SA on DS-layer / US-layer” to our model.
IV-E User Study
For the qualitative evaluation, we also conducted a user study on 80 participants. The results of this study are summarized as follows. First, 192 images were selected randomly in the questionnaires, and the questionnaires were used to select the best image that reflects the pose of input Image and the appearance of target domain well. Figure 11. shows that our method yields quantitatively much more superior results than the existing GAN models.
IV-F Quantitative Evaluation Analysis
We used Fréchet Inception Distance (FID) [14] to measure the distance between the data distributions of the source and target domains using the features extracted by the inception networks [28]. The lower FID score indicates that the data distribution of two domains are similar. Table I. shows the results of the FID score analysis, and we can see that our model translated more similar images than other image-to-image translation methods.
V Conclusions
In this paper, we proposed a method about unsupervised image-to-image translation with self-attention networks, in which long range dependency helps to not only capture strong geometric change but also generate details using cues from all feature locations. In experiments, we showed superiority of the proposed method compared to existing state-of-the-art unsupervised image-to-image translation methods.
V-A Acknowledgements
We would like to thank our sponsors, especially, Sejong Academy of Science and Arts(SASA) in Korea. We also thanks to Artificial Intelligence Research Institute(AIRI) in Korea. This research was funded by the Korea Foundation for the Advancement of Science & Creativity(KOFAC) Science High School Student R&E support program.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Asha Anoosheh, Eirikur Agustsson, Radu Timofte, and Luc Van Gool. Combogan: Unrestrained scalability for image domain translation. ar Xiv preprint ar Xiv:1712.06909 , 2017.
- 2[2] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. ar Xiv preprint ar Xiv:1409.0473 , 2014.
- 3[3] Connelly Barnes, Eli Shechtman, Adam Finkelstein, and Dan B Goldman. Patchmatch: A randomized correspondence algorithm for structural image editing. In ACM Transactions on Graphics (To G) , volume 28, page 24. ACM, 2009.
- 4[4] Antoni Buades, Bartomeu Coll, and J-M Morel. A non-local algorithm for image denoising. In 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’05) , volume 2, pages 60–65. IEEE, 2005.
- 5[5] Harold Christopher Burger, Christian J Schuler, and Stefan Harmeling. Image denoising with multi-layer perceptrons, part 1: comparison with existing algorithms and with bounds. ar Xiv preprint ar Xiv:1211.1544 , 2012.
- 6[6] Harold Christopher Burger, Christian J Schuler, and Stefan Harmeling. Image denoising with multi-layer perceptrons, part 2: training trade-offs and analysis of their mechanisms. ar Xiv preprint ar Xiv:1211.1552 , 2012.
- 7[7] Jianpeng Cheng, Li Dong, and Mirella Lapata. Long short-term memory-networks for machine reading. ar Xiv preprint ar Xiv:1601.06733 , 2016.
- 8[8] Yunjey Choi, Minje Choi, Munyoung Kim, Jung-Woo Ha, Sunghun Kim, and Jaegul Choo. Stargan: Unified generative adversarial networks for multi-domain image-to-image translation. ar Xiv preprint ar Xiv:1711.09020 , 2017.
