Vision Transformer Equipped with Neural Resizer on Facial Expression Recognition Task

Hyeonbin Hwang, Soyeon Kim, Wei-Jin Park, Jiho Seo, Kyungtae Ko, Hyeon Yeo · DOI

Abstract

Facial Expression Recognition (FER) in "in-the-wild" scenarios remains a significant challenge due to low-resolution imagery, inconsistent lighting, and label ambiguity. While Vision Transformers (ViTs) have demonstrated superior performance in various computer vision tasks, their rigid input resolution requirements often necessitate deterministic resizing methods that discard critical fine-grained details. This paper explores a novel framework that integrates a Neural Resizer (NR) and a specialized Focal-Prior Distribution Label Smoothing (F-PDLS) loss function to enhance ViT performance on FER benchmarks. By replacing standard bilinear interpolation with a learnable resizing module, the proposed approach preserves discriminative facial features, achieving state-of-the-art results on the FERPlus and RAF-DB datasets.

1. Introduction

Facial Expression Recognition (FER) is a pivotal component of human-computer interaction, yet its application in real-world, uncontrolled environments is hindered by several factors. Surveillance footage and mobile captures often suffer from low resolution, which obscures the subtle muscular movements—such as the slight narrowing of eyes or the tension in the lips—that distinguish complex emotions.

Vision Transformers (ViTs) have emerged as powerful alternatives to Convolutional Neural Networks (CNNs) due to their ability to capture long-range dependencies. However, ViTs typically require fixed-size inputs (e.g., 224x224 pixels). The standard practice of using bilinear interpolation to upscale low-resolution facial images to meet these requirements often results in blurred features and significant information loss. This study addresses these limitations by proposing a data-driven resizing mechanism and a robust loss function tailored for noisy, imbalanced FER datasets.

2. Methodology

2.1 The Neural Resizer (NR)

The core innovation of this framework is the Neural Resizer, which replaces deterministic interpolation with a two-stage, learnable process designed to retain high-frequency information.

  1. Super-Resolution (SR) Block: The process begins by passing the low-resolution input through a pre-trained super-resolution module (specifically using the DIC architecture). This stage aims to "recover" or hallucinate missing high-frequency details that are essential for emotion classification.
  2. Trainable Downsizer: Following the SR stage, a learnable CNN-based downsizer shrinks the image back to the specific input dimensions required by the Transformer backbone. Unlike standard downsampling, this module is trained end-to-end with the classifier, allowing the model to learn which specific features (e.g., edges around the mouth or eyes) should be prioritized and preserved.

2.2 Focal-Prior Distribution Label Smoothing (F-PDLS)

To address the inherent subjectivity and class imbalance found in FER datasets, the researchers introduced the F-PDLS loss function. This module combines two strategies:

  • Prior Distribution Label Smoothing (PDLS): Instead of using "one-hot" labels, PDLS utilizes the distribution of human annotator votes as a soft target. This better represents the ambiguity of human emotions where an image might be perceived as both "neutral" and "sad" by different observers.
  • Focal Component: Inspired by Focal Loss, this component applies a weighting mechanism that emphasizes "hard" examples and minority classes. This prevents the model from being biased toward frequent, easily classified emotions like "happiness."

3. Experimental Setup

The framework was evaluated using two prominent "in-the-wild" datasets:

  • FERPlus: An extension of the original FER2013 dataset, containing 28,709 training images (48x48 pixels) re-labeled by 10 annotators across 8 emotion categories.
  • RAF-DB: A large-scale database containing nearly 30,000 facial images with basic and compound expressions, annotated by 40 independent observers.

Various Transformer backbones were tested, including ViT, DeiT, ConViT, XCiT, and the Swin-Transformer.

4. Results and Discussion

4.1 Performance Metrics

The integration of the Neural Resizer and F-PDLS loss yielded consistent improvements across all tested architectures. The Swin-Base backbone, in particular, achieved state-of-the-art performance:

  • FERPlus: 89.50% accuracy.
  • RAF-DB: 88.57% accuracy.

4.2 Ablation Studies

Ablation experiments confirmed the individual contributions of each component. Replacing standard bilinear interpolation with the Neural Resizer alone improved accuracy by 0.59%. When combined with a Spatial Transformer Network (STN), the improvement rose to 0.81%. Furthermore, the F-PDLS loss provided an additional 0.63% gain, demonstrating that the Neural Resizer provides the high-quality features necessary for the loss function to effectively distinguish between difficult classes.

4.3 Qualitative Insights

Qualitative analysis suggests that the Neural Resizer acts as a "learnable magnifier." While the global structure of the face remains consistent with standard resizing, the edges of discriminant features—such as the lines around the eyes and mouth—are more conspicuously accented. This synergy is particularly effective with Swin-Transformers, which process features at multiple scales and can leverage these preserved fine-grained details more efficiently than global ViTs.

5. Conclusion

This research demonstrates that the method of image resizing is a critical bottleneck in applying Vision Transformers to low-resolution FER tasks. By employing a Neural Resizer and the F-PDLS loss function, the proposed framework effectively mitigates information loss and label noise.

Despite these gains, the approach introduces additional computational overhead due to the Super-Resolution and trainable downsizer modules. Future work will focus on optimizing these components for real-time deployment on edge devices and reducing the dependency on specific pre-trained SR models. Nevertheless, the study provides a robust new recipe for emotion AI in challenging, real-world scenarios.

Summary updated

BibTeX
@inproceedings{hwang2022vision,
  author = {Hyeonbin Hwang and Soyeon Kim and Wei-Jin Park and Jiho Seo and Kyungtae Ko and Hyeon Yeo},
  title = {{Vision Transformer Equipped with Neural Resizer on Facial Expression Recognition Task}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2022},
  url = {https://openreview.net/forum?id=fubNNfikBHA},
}
Figure