Abstract
Face anonymization via face swapping often struggles to balance identity protection with visual naturalness. Traditional face recognition models, optimized for binary identity verification, fail to capture the continuous spectrum of human-perceived facial similarity. We present PerFace, a metric learning framework fine-tuned on human-annotated data to bridge this gap. By aligning machine metrics with human perception, PerFace enables superior candidate selection for face replacement, ensuring anonymized results are both perceptually distinct from the original and naturally plausible.
Introduction: The "Goldilocks" Problem in Anonymization
Face swapping replaces a target's identity with a source's features while preserving attributes like pose and expression. However, current systems face a significant challenge: if the source face is too similar to the target, anonymity is compromised; if it is too dissimilar (e.g., mismatched age or gender), the result appears uncanny or "unnatural."
Standard face recognition models (e.g., ArcFace) are designed for identity verification—a binary "same or different" task. These models struggle to quantify nuanced similarity between different individuals. Furthermore, they are trained on natural images, leading to a "domain gap" when applied to face-swapped images, which often contain subtle blending artifacts and mixed facial contours.
Methodology
PerFace addresses these issues by fine-tuning a feature extractor to mimic human perception through three core components:
- Metric Learning with Triplet Loss: Using a pretrained ArcFace backbone, the model is fine-tuned using a triplet loss function. Given a reference image ($C$) and two comparison images ($A$ and $B$), the model learns to minimize the distance to the image humans judged as "more similar" while maximizing the distance to the "less similar" one.
- Human-in-the-Loop Annotation: To establish ground-truth perceptual similarity, 18 participants performed pairwise comparisons on thousands of triplets, capturing subjective human judgment rather than simple identity labels.
- Two-Step Anonymization Framework:
- Group Selection: Candidates are first filtered to match the target's coarse attributes (gender and age) to maintain naturalness.
- Anonymization: Within this filtered group, PerFace identifies the candidate with the lowest perceptual similarity to the target to maximize privacy.
Datasets
The primary contribution is the SimCelebA dataset, consisting of 6,400 triplet annotations derived from CelebAMask-HQ. It includes 80 target images and 240 source images processed via the SimSwap algorithm. The model was initially pre-trained on the MS1MV3 dataset.
Key Insights and Results
- Identity vs. Similarity: PerFace treats similarity as a continuous spectrum. By training specifically on face-swapped data, the model learns to ignore "distractions" like shared hairstyles and focus on the internal features that define perceptual identity.
- Superior Accuracy: PerFace achieved a similarity prediction accuracy of 91.7%, significantly outperforming ArcFace (70.1%), VGG Face (75.0%), and FaceNet (71.5%).
- Attribute Sensitivity: The model showed marked improvement in capturing holistic representations, particularly in classifying complex attribute intersections (e.g., "Young + Male"). Interestingly, human annotators—and subsequently the model—prioritized gender consistency over age when determining similarity.
- Data Quality: Training on a high-consistency subset (where all annotators agreed) yielded better results than using the full, noisier dataset, proving that clean perceptual labels are vital for metric learning.
Conclusion and Future Work
PerFace demonstrates that aligning machine metrics with human perception significantly enhances the quality of face anonymization. While the current model is limited by the demographic of its 18-person annotation group, future work aims to expand the dataset to include more diverse perspectives. Automating the attribute annotation pipeline while maintaining PerFace's high accuracy remains a primary goal for future iterations.
Summary updated