A Multi-resolution Approach to Expression Recognition in the Wild

Fabio Valerio Massoli, Donato Cafarelli, Giuseppe Amato, Fabrizio FalchiarXiv 2021

Abstract

Facial expressions play a fundamental role in human communication, revealing emotional status beyond spoken language. Comprehending human affect through visual patterns is essential for human-machine interaction, making Facial Expression Recognition (FER) a task of significant scientific and industrial interest. In this work, we propose a multi-resolution approach to FER, grounded in the observation that faces are often acquired at varying resolutions in real-world scenarios. We utilize a ResNet-like architecture with Squeeze-and-Excitation blocks, trained on the Affect-in-the-Wild 2 dataset. By explicitly considering resolution variability during training, we achieve over 90% accuracy on the seven expressions comprised in the dataset validation set.

Introduction

Recognizing facial expressions "in the wild" presents a significant challenge for modern computer vision. Unlike controlled laboratory environments, real-world images are highly heterogeneous, originating from different cameras, distances, and crop sizes. This results in varying image resolutions, which typically causes a dramatic performance drop in deep learning models not explicitly trained for such diversity.

This paper addresses the need for resolution-invariant features. We propose a training methodology that forces the model to learn robust facial patterns across a wide spectrum of resolutions, ensuring reliable emotion classification regardless of input quality.

Methodology

Our approach utilizes a ResNet-50 backbone enhanced with Squeeze-and-Excitation (SE) blocks. These blocks allow the network to perform dynamic channel-wise feature recalibration, focusing on the most informative facial features. The model is initialized with weights pre-trained on the VGGFace2 dataset to leverage a strong foundational understanding of human facial structures.

Multi-resolution Training

The core of our method is a "double random extraction" training procedure. Instead of fixed-size inputs, we randomly scale image resolutions between 8 and 256 pixels during training. This acts as a powerful regularizer, forcing the network to identify high-level facial landmarks even when fine-grained textures are lost due to pixelation.

To further improve generalization, we apply data augmentations including random cropping and grayscale conversion. Crucially, to handle the natural class imbalance found in emotional data, we employ a balanced cross-entropy loss function, ensuring that rare expressions receive adequate attention during the learning process.

Dataset and Experimental Setup

We evaluate our approach using the Affect-in-the-Wild 2 (Aff-Wild2) dataset, which contains approximately 2.6 million frames from 539 YouTube videos. The dataset is annotated for seven expressions: Neutral, Anger, Disgust, Fear, Happiness, Sadness, and Surprise.

As shown in the distribution table below, the dataset is heavily skewed toward "Neutral" expressions, which account for over 60% of the training data, while classes like "Fear" and "Disgust" represent less than 2%.

Distribution of expressions in the Aff-Wild2 training and validation sets.

Due to the unavailability of the official test set labels, all model selection and performance reporting were conducted using the official validation set.

Results and Discussion

The proposed multi-resolution model achieved exceptional results on the Aff-Wild2 validation set, with an overall accuracy of 97.0% and a macro-average F1 score of 0.964.

One of the most significant findings is the model's stability across imbalanced classes. Despite the scarcity of certain emotions in the training set, the balanced loss and resolution-invariant training allowed the model to achieve high F1 scores across the board. For instance, the rarest class ("Fear") achieved an F1 score of 0.971, nearly matching the performance of the most common class ("Neutral") at 0.978.

F1 scores per expression category on the validation set, demonstrating robust performance across imbalanced classes.

These results suggest that randomized resolution downsampling is a highly effective and computationally simple alternative to more complex training paradigms like curriculum learning or teacher-student frameworks.

Conclusion

We have demonstrated that a multi-resolution training approach significantly enhances the robustness of FER models for real-world applications. By forcing the network to learn from both high and low-resolution inputs, we achieved state-of-the-art performance on the Aff-Wild2 validation set. Future work will involve benchmarking this approach against the official challenge test server to further validate its efficacy in a blind evaluation setting.

Summary updated

BibTeX
@misc{massoli2021multi,
  author = {Fabio Valerio Massoli and Donato Cafarelli and Giuseppe Amato and Fabrizio Falchi},
  title = {{A Multi-resolution Approach to Expression Recognition in the Wild}},
  year = {2021},
  eprint = {2103.05723},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.05723},
}
Figure