Abstract
Unsupervised image-to-image translation aims to map images between domains without paired training data. While existing frameworks like CycleGAN have achieved significant success, they often introduce unwanted artifacts in non-target regions, failing to preserve the background and static features of the source image. We propose the Attention-Guided Generative Adversarial Network (AGGAN), which embeds attention modules into both the generator and discriminator. This allows the model to selectively modify only relevant semantic regions while keeping the rest of the image unchanged. AGGAN learns these attention masks end-to-end without requiring manual annotations or pre-trained models. Experimental results on facial expression datasets demonstrate that AGGAN significantly outperforms state-of-the-art baselines in both image quality and identity preservation.
Introduction
Unsupervised image-to-image translation—mapping an image from one domain (e.g., "neutral face") to another (e.g., "happy face") without paired examples—is a cornerstone of modern computer vision. While frameworks like CycleGAN have made huge strides, they suffer from a common flaw: they often change parts of the image that should remain static. When a GAN tries to turn a frown into a smile, it frequently introduces artifacts in the background, changes the color of the subject's hair, or blurs the clothing. This happens because standard generators lack a mechanism to distinguish between the "discriminative" semantic parts (the mouth and eyes) and the "unwanted" parts (everything else). Previous attempts to fix this relied on expensive extra data, like manual object masks, or complex multi-stage pipelines. AGGAN aims to solve this "focus" problem end-to-end using only raw, unpaired images.
Methodology
AGGAN introduces two primary innovations to the standard GAN architecture to enable selective image modification:
Attention-Guided Generator
Instead of regressing a full target image directly, the generator produces two distinct outputs: an attention mask ($M$) and a content mask ($R$). The final output image is a fusion of the original input ($x$) and the new content, governed by the attention mask:
$$G = R * M + x * (1 - M)$$
This forces the generator to "choose" which pixels to change. High intensity in the attention mask indicates that the model is focusing on that area (e.g., the mouth), while low intensity keeps the original pixels from the input.
Attention-Guided Discriminator
Standard discriminators evaluate the entire image to distinguish real from fake. AGGAN’s discriminator takes the attention mask as an additional input, forcing it to focus its critique specifically on the regions the generator modified. This creates a more effective adversarial feedback loop for fine-grained details.
Loss Functions
The model is trained using a combination of four loss functions:
- Adversarial Loss: Ensures the generated parts appear realistic.
- Cycle-Consistency Loss: Ensures the translation is reversible, maintaining structural integrity.
- Pixel Loss: Minimizes unnecessary changes between input and output.
- Attention Loss (Total Variation Regularization): Prevents attention masks from becoming too noisy or saturating the entire image.
Experiments and Datasets
The model was evaluated on four public facial expression datasets in an unpaired setting:
- CelebA: Large-scale celebrity faces used for neutral-to-smile translation.
- RaFD (Radboud Faces Database): Contains 8 different facial expressions.
- AR Face: Includes expressions like smile, anger, and fear.
- Bu3dfe: A 3D facial expression dataset.
Results and Discussion
AGGAN consistently outperformed state-of-the-art baselines, including CycleGAN, StarGAN, and DualGAN, across qualitative and quantitative measures.
Qualitative Performance
Qualitative results show that while other models often change background colors or blur hair, AGGAN’s backgrounds remain pixel-perfect matches to the source. The architecture effectively disentangles the "what" (content mask) from the "where" (attention mask), leading to much higher identity preservation.
Quantitative Evaluation
- Human Evaluation (AMT): In perceptual studies, participants preferred AGGAN-generated images by a wide margin. For example, on the Bu3dfe dataset, AGGAN received an AMT score of 32.9, compared to CycleGAN’s 25.4.
- Image Quality: AGGAN achieved the highest Peak Signal-to-Noise Ratio (PSNR) and lowest Mean Squared Error (MSE) across all tested datasets, indicating sharper images and better preservation of the source image's integrity.
Conclusion
AGGAN demonstrates that embedding attention mechanisms directly into the GAN architecture allows for high-quality, selective image-to-image translation without the need for manual annotations. By treating the discriminator as a specialist in edited regions, the model achieves superior identity preservation and background stability. Future work may explore the application of this method to large-scale structural changes and video-to-video translation.
Summary updated