CAFE-GAN: Arbitrary Face Attribute Editing with Complementary Attention Feature

Jeong-gi Kwak, David K. Han, Hanseok KoECCV 2020

Abstract

Facial attribute editing aims to modify specific features of a face while preserving identity and unrelated details. Current Generative Adversarial Networks (GANs) often introduce unintended artifacts or global changes due to a lack of precise spatial awareness, particularly when adding features that are not initially present. We propose CAFE-GAN, which utilizes a Complementary Attention Feature to identify both existing and absent attributes. This approach enables highly localized editing and achieves state-of-the-art performance on the CelebA dataset, significantly improving attribute classification accuracy and visual fidelity.

Introduction

Generative Adversarial Networks (GANs) have revolutionized image-to-image translation, enabling tasks like changing hair color or adding facial hair. However, models such as StarGAN and AttGAN frequently produce "unintended changes," such as skin tone shifts or background blurring, when performing localized edits. This is often because standard attention mechanisms can only attend to features already visible in the source image. When a model is tasked with adding a new feature (e.g., glasses to a face without them), it lacks a spatial anchor, leading to imprecise, global modifications.

Methodology

The CAFE-GAN architecture introduces three primary components to solve the spatial localization problem:

Complementary Attention Branch (CAB)

While a standard Attention Branch (AB) highlights existing features, the CAB is trained to identify "complementary attributes"—those absent in the input. For instance, if the target is to add glasses, the CAB learns to highlight the ocular region as the causative area for the missing feature.

Complementary Attention Feature (CAFE)

By integrating the outputs of both the standard and complementary branches, the discriminator constructs a comprehensive spatial map of all potential attributes. This map informs the generator about where features should be added or modified, regardless of their initial presence.

The CAFE-GAN architecture, highlighting the Generator (G) and the Discriminator (D) with its Attention and Complementary Attention branches.

Complementary Feature Matching (CFM) Loss

To enforce spatial consistency, the CFM loss constrains the generator. It ensures that if an attribute is not designated for change, its corresponding attention map remains identical between the source and edited images. Conversely, for changing attributes, it forces the generator to map new features precisely into the regions identified by the CAB.

Experimental Setup

The model was evaluated using the CelebA dataset, consisting of over 200,000 celebrity images annotated with 40 binary attributes. Images were preprocessed by cropping to 170x170 and resizing to 128x128. The architecture utilizes an encoder-decoder generator with skip connections, guided by the enhanced discriminator.

Results and Discussion

CAFE-GAN demonstrates superior performance over previous state-of-the-art models like AttGAN and STGAN in both quantitative and qualitative evaluations.

Quantitative Performance

Using a pre-trained classifier to verify edit success, CAFE-GAN achieved an average accuracy of 85.64%, outperforming AttGAN (63.72%) and STGAN (81.54%). Notably, for the challenging "Bald" attribute, CAFE-GAN reached 79.03% accuracy, nearly 20% higher than competing models.

Qualitative Quality

Visual results indicate that CAFE-GAN preserves identity and background details more effectively than its predecessors. By focusing on localized regions, it avoids the "blurry face" artifacts common in older GAN architectures.

Qualitative result of face attribute editing using CAFE-GAN, demonstrating precise hair color modification while maintaining facial identity.

Conclusion

CAFE-GAN introduces a novel paradigm for facial attribute editing by "attending to the invisible." By teaching the discriminator to recognize where features are absent, the model provides the generator with the necessary spatial anchors for precise, localized additions. While challenges remain in scaling to higher resolutions and handling very small spatial attributes like mustaches, CAFE-GAN represents a significant step forward in controllable and high-fidelity image synthesis.

Summary updated

BibTeX
@inproceedings{kwak2020cafe,
  author = {Jeong-gi Kwak and David K. Han and Hanseok Ko},
  title = {{CAFE-GAN: Arbitrary Face Attribute Editing with Complementary Attention Feature}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58568-6\_31},
}
Figure