Learning based Facial Image Compression with semantic fidelity metric

Zhibo Chen, Tianyu He

Abstract

This paper presents a Learning-based Facial Image Compression (LFIC) framework designed to optimize for "semantic fidelity"—the preservation of features essential for machine-driven face recognition—rather than traditional pixel-level accuracy. By integrating a Regionally Adaptive Pooling (RAP) module and a hybrid loss function incorporating GAN-based adversarial loss and FaceNet-derived semantic loss, the proposed system achieves significant bitrate reductions. Experimental results on the CelebA dataset demonstrate over 70% bitrate savings compared to JPEG2000 while maintaining superior face verification performance at low bitrates.

Introduction

Traditional image compression standards, such as JPEG and WebP, are primarily optimized for human perception, focusing on pixel fidelity (minimizing Mean Squared Error) or perceptual quality. However, in modern applications like automated surveillance and mobile authentication, the primary consumer of image data is often an AI algorithm. Standard codecs frequently discard fine-grained facial details to save space, which can lead to failures in face recognition systems even when the image appears acceptable to a human viewer. This research addresses this discrepancy by proposing a system that prioritizes Semantic Fidelity, ensuring compressed images retain the specific features necessary for accurate machine identification.

Methods

The proposed LFIC (Learning-based Facial Image Compression) framework introduces an end-to-end trainable pipeline that replaces traditional hand-crafted steps with differentiable components. This allows for simultaneous optimization of the encoder, quantizer, and decoder via gradient descent.

The LFIC framework architecture showing compression, decompression, and metric transformation flows.

A central innovation is the Regionally Adaptive Pooling (RAP) module. Unlike uniform compression, RAP utilizes variable block sizes guided by gradient feedback from the semantic metric. It identifies critical regions for recognition—such as the eyes, nose, and mouth—and allocates a higher bit budget to these areas compared to less informative regions like hair or backgrounds.

The model is trained using a hybrid semantic fidelity metric consisting of three parts:

  1. Pixel Loss ($L_1$): Maintains basic structural consistency.
  2. Adversarial Loss (GAN): Employs a discriminator to ensure the decoder produces sharp, realistic facial features.
  3. Semantic Loss: Utilizes a pre-trained FaceNet model to compare feature embeddings between original and compressed images, penalizing deviations that would lead to misidentification.

Key Insights

Gradients as a Heatmap

A significant finding in this work is the visualization of gradient feedback during optimization. When the system is tuned for semantic fidelity, the gradients naturally "light up" around key facial landmarks. This confirms that the model autonomously learns to prioritize the features most essential for identity verification.

Visualization of gradient feedback highlighting critical facial landmarks for semantic fidelity.

Semantic vs. Pixel Accuracy

The research highlights a fundamental mismatch between traditional metrics and AI needs. Results indicate that images with lower Peak Signal-to-Noise Ratio (PSNR)—traditionally viewed as lower quality—can actually yield significantly higher face verification accuracy if the semantic features are preserved. Furthermore, the use of a GAN discriminator as a metric helps maintain high-frequency details that traditional MSE-based metrics often ignore.

Results

The LFIC framework was evaluated using the aligned CelebA dataset, with testing conducted on 14,871 images to assess face verification accuracy. The system significantly outperformed both traditional and neural codecs:

  • Bitrate Savings: To achieve equivalent face verification accuracy, LFIC saved 71.41% bitrate compared to JPEG2000, 48.28% compared to WebP, and 52.67% compared to previous state-of-the-art neural codecs.
  • Qualitative Performance: At extremely low bitrates (e.g., 0.1 BPP), where traditional codecs produce unrecognizable blocky artifacts, LFIC maintains clear and distinguishable facial structures.

Conclusion

While LFIC demonstrates superior bitrate efficiency for facial recognition tasks, challenges remain regarding computational complexity, as the current implementation is approximately 13 times slower than WebP. Future work will focus on optimizing prediction and entropy coding modules, as well as extending this "semantic-first" compression approach to other domains such as medical imaging and general object detection.

Summary updated

BibTeX
@article{chen2019learning,
  author = {Zhibo Chen and Tianyu He},
  title = {{Learning based Facial Image Compression with semantic fidelity metric}},
  journal = {Neurocomputing},
  year = {2019},
  doi = {10.1016/j.neucom.2019.01.086},
}
Figure