NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Not Just Compete, But Collaborate: Local Image-to-Image Translation via Cooperative Mask Prediction

Daejin Kim, Mohammad Azam Khan, Jaegul ChooOpenReview 2021

Abstract

Facial attribute editing aims to manipulate specific image attributes while preserving irrelevant details. While Generative Adversarial Networks (GANs) have shown promise, existing methods for unpaired datasets often fail to preserve attribute-irrelevant regions due to the lack of ground truth. This paper introduces the CAM-consistency loss, a novel objective that leverages Grad-CAM outputs from the discriminator to guide the generator. By identifying which local regions should change, the generator and discriminator collaborate to improve translation quality. Experiments on StarGAN, AttGAN, and STGAN demonstrate the effectiveness of this approach in preserving image details and improving overall realism.

Introduction: The Challenge of Unpaired Translation

Facial attribute editing, such as changing hair color or adding eyeglasses, is a core task in Image-to-Image (I2I) translation. However, working with unpaired data—where no direct "before and after" images exist—presents a significant challenge: how to ensure the model only edits the intended feature without altering the background or other facial characteristics.

Existing models often suffer from "attribute-irrelevant" changes. For example, a request for "blond hair" might inadvertently change the subject's skin tone or the background color. While cycle-consistency loss helps ensure an image can be translated back to its original state, it does not explicitly protect specific pixels during the initial translation. Previous solutions often required complex sub-modules or manual masks, which are difficult to scale and integrate into existing architectures.

Methodology: CAM-Consistency Loss

The core innovation of this work is the CAM-consistency loss. This plug-and-play objective function utilizes Grad-CAM (Gradient-weighted Class Activation Mapping), typically a post-hoc diagnostic tool, as an active part of the training process.

Comparison of standard cycle-consistency (b) and the proposed CAM-consistency (c) framework.

The process works in three main steps:

  1. Mask Generation: The discriminator, acting as an auxiliary classifier, identifies regions relevant to the target attribute (e.g., the hair region for "Blond hair").
  2. Collaboration: This spatial information is converted into a "Grad-CAM mask."
  3. Consistency Enforcement: The generator is penalized if it modifies pixels outside this mask.

By turning the discriminator into a guide, the relationship shifts from pure competition to strategic collaboration. The discriminator effectively tells the generator: "I am focusing on these specific pixels to classify the attribute; you may edit these, but leave the rest untouched."

Experimental Results and Insights

The researchers evaluated the CAM-consistency loss using the CelebA dataset, focusing on 13 attributes with high visual impact. The loss was integrated into three baseline models: StarGAN, AttGAN, and STGAN.

Visual comparison between standard AttGAN and CAM-consistent AttGAN, showing improved localization of edits and background preservation.

Key Findings:

  • Improved Fidelity: Quantitative metrics showed consistent gains. AttGAN’s FID (Fréchet Inception Distance) improved from 14.27 to 13.27, indicating more realistic results.
  • Superior Preservation: PSNR (Peak Signal-to-Noise Ratio) increased significantly, confirming that attribute-irrelevant regions (like backgrounds) remained stable.
  • User Preference: In human evaluations, the CAM-consistent results were overwhelmingly preferred. For the "Pale skin" attribute in AttGAN, users chose the proposed method 83.3% of the time.
  • Architecture Agnostic: As a loss function, it can be added to existing architectures without modifying their internal structure or adding new layers.

Conclusion and Future Work

The CAM-consistency loss successfully transforms the discriminator's internal attention into a training signal for the generator. While highly effective for local attributes like hair or accessories, the method faces challenges with "global" attributes like age or gender, which affect larger, less localized regions of the face. Additionally, the authors noted that the loss must be applied to both the generator and the discriminator to be effective. Future research may focus on refining mask generation for these complex, overlapping features.

Summary updated

BibTeX
@misc{kim2021not,
  author = {Daejin Kim and Mohammad Azam Khan and Jaegul Choo},
  title = {{Not Just Compete, But Collaborate: Local Image-to-Image Translation via Cooperative Mask Prediction}},
  year = {2021},
  url = {https://openreview.net/forum?id=hhBzqwD8OxC},
  howpublished = {OpenReview},
}
Figure