Controllable Localized Face Anonymization Via Diffusion Inpainting

Ali Salar, Qing Liu, Guoying ZhaoarXiv 2025 · DOI

Introduction

As facial recognition technology becomes ubiquitous, protecting privacy in image datasets has become a legal and ethical imperative, particularly for compliance with regulations like GDPR. However, traditional anonymization techniques—such as blurring or pixelation—often render images useless for downstream tasks like AI training or medical research. Existing AI-based solutions frequently suffer from a trade-off between control and quality, often altering backgrounds, hairstyles, or essential facial expressions. This paper introduces a novel framework for controllable and localized face anonymization that maintains high data utility while ensuring robust privacy.

Methodology

The proposed framework leverages Latent Diffusion Models (LDMs), specifically Stable Diffusion, to perform identity replacement through a three-pronged, training-free approach.

Masked Inpainting and Localized Control

The system utilizes a face-parsing model to generate precise masks. By restricting the diffusion process to "identity-carrying" regions, the framework ensures that non-essential elements—such as hair, clothing, and background—remain identical to the original image. This allows for "surgical" anonymization, where specific features (e.g., the mouth or nose) can be modified while others (e.g., the eyes for medical diagnosis) are preserved.

Figure 1: Examples of identity replacement and localized attribute control. The green outlines indicate specific regions targeted for guidance or preservation.

Adaptive Attribute-Guidance

To maintain the target image's expression and pose, the authors introduce an Adaptive Attribute-Guidance module. This module employs a guidance loss ($L_{att}$) that compares the features of the evolving latent image to a synthesized target image using the FaRL face-representation model.

Temporal Weighting

A key innovation is the use of temporal weighting for the guidance signal. The guidance is most intense during the initial, high-noise stages of the diffusion process to establish the global facial structure. As the denoising progresses, the weight tapers off, allowing the LDM to generate fine-grained, realistic details without over-constraining the output.

Experimental Results

The method was evaluated on the CelebA-HQ and FFHQ datasets, using identities from the "This Person Does Not Exist" database as targets.

Privacy and Utility

The framework achieved a Re-Identification (Re-ID) rate of 0.015 on CelebA-HQ, significantly outperforming state-of-the-art (SOTA) competitors like FALCO (0.045). This indicates that facial recognition systems are effectively neutralized. In terms of image quality, the model achieved a Fréchet Inception Distance (FID) of 23.193, the best among compared methods, suggesting superior realism.

Efficiency

By optimizing the denoising process to 45 steps, the system achieves a generation time of approximately 10 seconds per image. This is a substantial improvement over previous diffusion-based methods like FAMS, which require roughly 30 seconds.

Conclusion and Future Work

This research demonstrates that localized diffusion inpainting can provide a powerful balance between privacy and clinical utility. While the current reliance on physical target images and the 10-second processing time present areas for improvement, the "training-free" nature of the module makes it highly adaptable for diverse anonymization needs. Future work will focus on integrating text-based controls and further reducing computational overhead for real-time applications.

Summary updated

BibTeX
@misc{salar2025controllable,
  author = {Ali Salar and Qing Liu and Guoying Zhao},
  title = {{Controllable Localized Face Anonymization Via Diffusion Inpainting}},
  year = {2025},
  eprint = {2509.14866},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.14866},
}
Figure