Optimized Learned Image Compression for Facial Expression Recognition

Xiumei Li, Marc Windsheimer, Misha Sadeghi, Björn M. Eskofier, André Kaup2025

Introduction

Facial Expression Recognition (FER) is a critical component in modern human-computer interaction, with applications ranging from healthcare monitoring to social robotics. However, deploying FER systems in real-world scenarios often involves transmitting or storing large volumes of visual data, necessitating efficient image compression.

Traditional compression standards (e.g., JPEG) and modern neural codecs are primarily designed to optimize for human visual perception, focusing on pixel-level fidelity. This focus often results in the loss of subtle semantic features—such as micro-expressions or specific muscular tensions—that are essential for accurate emotion classification. This paper presents an end-to-end framework that bridges this gap by jointly optimizing for both compression efficiency and task-specific accuracy, creating a "task-aware" compression model.

Methodology

The authors propose an end-to-end architecture consisting of two integrated components: a compression module and a recognition module.

1. Compression Module

Based on the "Mean Scale Hyperprior" model, this module utilizes an autoencoder to map images into a latent representation. A secondary "hyper-network" estimates the distribution of these latents to improve entropy coding efficiency, ensuring the resulting file size remains minimal.

2. FER Module

The recognition task is handled by a lightweight ResNet-18 backbone, pre-trained on the LibreFace dataset. This module performs classification directly on the reconstructed images produced by the compression encoder.

3. Joint Loss Function

The core innovation of this framework is the Joint Loss Function, which balances three competing objectives:

$$L_{total} = \alpha \cdot L_{rate} + \beta \cdot L_{distortion} + \gamma \cdot L_{CE}$$

  • $L_{rate}$: Minimizes the bitrate (file size).
  • $L_{distortion}$: Maintains visual reconstruction quality using Mean Squared Error (MSE).
  • $L_{CE}$: The cross-entropy loss from the FER task, which forces the encoder to preserve features critical for correct classification.

Experimental Setup

The framework was evaluated using the AffectNet dataset, one of the largest benchmarks for facial expression analysis. The study utilized 287,651 images for training and 3,999 for testing, with all images resized to 224x224 for model processing.

The researchers compared two primary training strategies:

  1. Compression-Only Fine-tuning: The FER model remains fixed while only the compression codec is optimized.
  2. Joint Optimization: Both the codec and the FER classifier are updated simultaneously, allowing the models to mutually adapt to one another's representations.

Key Insights and Results

The results demonstrate a significant advantage for the jointly optimized approach. Using Bjontegaard Delta (BD) metrics relative to a baseline neural codec (mbt2018-mean), the researchers achieved:

  • BD-Rate Improvement of -89.12%: The model can achieve the same accuracy as the baseline while using approximately 89% less data.
  • BD-Accuracy Gain of 4.04%: An average increase in recognition accuracy across various bitrates.

The "Feature Enhancement" Effect

A notable finding is that at specific bitrates, the classification accuracy on compressed images actually exceeded that of the original, uncompressed images. This suggests that the joint optimization process encourages the encoder to act as a semantic filter, emphasizing relevant facial regions (like the eyes and mouth) while suppressing non-essential noise. This task-aware bit allocation makes the system exceptionally robust at very low bitrates (~0.1 bits per pixel), where traditional methods typically fail.

Conclusion and Future Work

By integrating task-specific objectives into the compression pipeline, this research demonstrates that it is possible to achieve massive reductions in data requirements without sacrificing machine perception performance.

While the current model focuses on static images, the authors suggest that future work should investigate temporal/video-based compression to leverage movement patterns in facial expressions. Additionally, exploring adaptive loss functions—where the weights for bitrate and accuracy are adjusted dynamically—and more complex architectures like Vision Transformers could further enhance the framework's efficiency.

Summary updated

BibTeX
@misc{li2025optimized,
  author = {Xiumei Li and Marc Windsheimer and Misha Sadeghi and Björn M. Eskofier and André Kaup},
  title = {{Optimized Learned Image Compression for Facial Expression Recognition}},
  year = {2025},
  eprint = {2509.17262},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.17262},
}
Figure