Towards Harmonized Regional Style Transfer and Manipulation for Facial Images

Cong Wang, Fan Tang, Yong Zhang, Weiming Dong, Tieru Wu

Abstract

Regional facial editing—the process of modifying specific features like the nose or hair—often results in visual inconsistencies known as the "Frankenstein effect." This paper presents a novel framework for Harmonized Regional Style Transfer and Manipulation (R-ST&M). By employing a multi-scale encoder and a Multi-Region Style Attention (MRSA) module, the proposed method ensures that transferred features are stylistically consistent with the target face's environment. Experimental results on CelebAMask-HQ and FFHQ datasets demonstrate state-of-the-art performance in both image quality and stylistic harmony.

Introduction

While Generative Adversarial Networks (GANs) have achieved remarkable success in high-fidelity face synthesis, regional editing remains a significant challenge. Existing methods often fail to maintain style consistency when a feature from a reference image is transferred to a target face. For example, a nose transferred from a reference with different lighting or skin tone often appears as an abrupt, unharmonized patch. This "harmony gap" is the primary focus of this work, which aims to ensure that edited regions adapt seamlessly to their new context.

Methodology

The proposed architecture consists of three main components designed to preserve detail and ensure regional harmony.

Multi-scale Encoder and Synthesis

Standard encoders often lose fine-grained textures during the compression process. To combat this, the framework utilizes a multi-scale encoder that fuses feature maps from multiple layers. This approach preserves both low-level textures necessary for realistic reconstruction and high-level semantics required for style manipulation. These features are then processed through a series of SEAN blocks and upsampling layers to reconstruct the final image.

Overview of the proposed framework, illustrating the multi-scale encoder and the integration of the MRSA module within the synthesis network.

Multi-Region Style Attention (MRSA)

The MRSA module is the core innovation of this framework. Rather than simply pasting a regional style, MRSA computes correlations between different semantic regions (e.g., the relationship between skin and nose). By applying an attention mechanism to semantic style vectors, the module "calibrates" the reference style to blend naturally with the target's context. This vector-level attention is more computationally efficient than pixel-wise attention while effectively capturing environmental context.

Detailed architecture of the Multi-Region Style Attention (MRSA) module, showing the Query (Q), Key (K), and Value (V) mapping of style vectors.

Regional Style Mapping (RSM)

For multi-modal synthesis where users generate random styles, the authors introduce Regional Style Mapping. This component uses sub-networks to group related facial regions, ensuring that generated styles for features like hair and skin remain internally consistent.

Experiments and Results

The model was trained on the CelebAMask-HQ (30,000 images) and FFHQ (70,000 images) datasets. Robustness was further tested on the LaPa dataset, which contains significant variations in pose and expression.

Quantitative Evaluation

The framework achieved a Fréchet Inception Distance (FID) of 15.26 on CelebAMask-HQ, significantly outperforming previous state-of-the-art models like SEAN (17.12). Additionally, the authors introduced a Harmony Score (HS)—a metric based on a trained classifier—to quantify the naturalness of blended images. The proposed model consistently achieved the highest HS across all test scenarios.

Qualitative and User Study

Visual comparisons show that the model successfully adapts color and lighting during transfer, eliminating visible seams. In a blind user study, the proposed method was preferred 44.45% of the time, nearly doubling the preference rate of the next best competitor, SEAN (29.07%).

Discussion and Limitations

Despite its success, the model occasionally experiences "semantic leakage." For instance, style codes influenced by male facial data might inadvertently introduce facial hair when editing a female face. This suggests that while the model excels at appearance relations, it sometimes prioritizes them over strict semantic constraints. Future work will focus on improving disentanglement to ensure style codes are strictly tied to their intended semantic regions.

Summary updated

BibTeX
@article{wang2023towards,
  author = {Cong Wang and Fan Tang and Yong Zhang and Weiming Dong and Tieru Wu},
  title = {{Towards Harmonized Regional Style Transfer and Manipulation for Facial Images}},
  journal = {Comput. Vis. Media},
  year = {2023},
  doi = {10.1007/s41095-022-0284-6},
}
Figure