UniLearn: Enhancing Dynamic Facial Expression Recognition through Unified Pre-Training and Fine-Tuning on Images and Videos

Yin Chen, Jia Li, Yu Zhang, Zhenzhen Hu, Shiguang Shan, Meng Wang, Richang HongarXiv 2024 · OpenReview

Abstract

Dynamic facial expression recognition (DFER) is essential for understanding human emotions and behavior. However, conventional DFER methods, which primarily use dynamic facial data, often underutilize static expression images and their labels, limiting their performance and robustness. To overcome this, we introduce UniLearn, a novel unified learning paradigm that integrates static facial expression recognition (SFER) data to enhance DFER task. UniLearn employs a dual-modal self-supervised pre-training method, leveraging both facial expression images and videos to enhance a ViT model's spatiotemporal representation capability. Then, the pre-trained model is fine-tuned on both static and dynamic expression datasets using a joint fine-tuning strategy. To prevent negative transfer during joint fine-tuning, we introduce an innovative Mixture of Adapter Experts (MoAE) module that enables task-specific knowledge acquisition and effectively integrates information from both static and dynamic expression data. Extensive experiments demonstrate UniLearn's effectiveness in leveraging complementary information from static and dynamic facial data, leading to more accurate and robust DFER. UniLearn consistently achieves state-of-the-art performance on FERV39K, MAFW, and DFEW benchmarks, with weighted average recall (WAR) of 53.65%, 58.44%, and 76.68%, respectively.

Introduction

Recognizing emotions in video (DFER) is fundamentally richer than recognizing them in static images (SFER) because it captures the temporal evolution of an expression. However, DFER models are often hampered by data scarcity; high-quality, "in-the-wild" video datasets are significantly smaller and less diverse than their static counterparts.

While it is intuitive to use static data to help train dynamic models, simply combining them often leads to negative transfer—where the differences between the two data types (e.g., lack of temporal cues in images vs. motion blur in videos) cause the model to perform worse on one or both tasks. We propose Static-for-Dynamic (S4D), a unified framework that treats static images as "critical snapshots" of dynamic sequences while maintaining architectural safeguards to ensure both modalities complement rather than conflict with each other.

Methodology: The S4D Framework

The S4D framework operates in two main stages to bridge the gap between static and dynamic facial data:

  1. Dual-Modal Self-Supervised Pre-training: We utilize a Vision Transformer (ViT) backbone with a Masked Autoencoder (MAE) strategy. The model is trained on both images and videos simultaneously, treating images as single-frame videos. Aggressive masking (90% for images, 95% for videos) forces the model to learn robust spatiotemporal representations efficiently.
  2. Joint Fine-Tuning with Mixture of Adapter Experts (MoAE): To solve the negative transfer problem, we introduce the MoAE module. In the deeper layers of the ViT, the standard Feed-Forward Network (FFN) learns task-agnostic knowledge. In parallel, the MoAE module uses a gating mechanism to route data through task-specific "adapters," allowing the model to capture shared emotional semantics while specializing its feature extraction for the unique demands of static vs. dynamic data.
The S4D framework architecture, featuring dual-modal pre-training and the Mixture of Adapter Experts (MoAE) module for joint fine-tuning.

Experimental Results

S4D achieved new state-of-the-art (SOTA) results across all major DFER benchmarks, including FERV39K, MAFW, and DFEW. The framework consistently outperforms baseline models and existing specialized DFER architectures.

Comparison of S4D with state-of-the-art methods on DFEW, FERV39k, and MAFW datasets.

Key Insights

  • Focus on Minority Classes: One of the most significant findings was how SFER data helps the model recognize subtle or rare emotions. Compared to the VideoMAE baseline, S4D showed a massive 9.66% improvement in accuracy for the "disgust" category, proving that static data provides fine-grained facial details that dynamic-only models often miss.
  • Expert Specialization: Through visualization, we found that the model naturally develops a "shared mid-level expert" for both tasks while using highly distinct routing paths in other layers, successfully balancing shared emotional knowledge with task-specific nuances.
  • Data Balancing: Achieving SOTA performance requires a careful balance of static data during joint fine-tuning to prevent the model's optimization trajectory from becoming biased.

Conclusion

The S4D framework demonstrates that unified learning from static and dynamic data is a powerful approach for advancing facial expression recognition. By employing dual-modal pre-training and the MoAE module, we can effectively leverage the abundance of static data to boost dynamic performance without suffering from negative transfer. Future work will focus on developing more parameter-efficient architectures and exploring universal models for a wider range of affective tasks.

Summary updated

Abstract

Dynamic facial expression recognition (DFER) is essential for understanding human emotions and behavior. However, conventional DFER methods, which primarily use dynamic facial data, often underutilize static expression images and their labels, limiting their performance and robustness. To overcome this, we introduce UniLearn, a novel unified learning paradigm that integrates static facial expression recognition (SFER) data to enhance DFER task. UniLearn employs a dual-modal self-supervised pre-training method, leveraging both facial expression images and videos to enhance a ViT model's spatiotemporal representation capability. Then, the pre-trained model is fine-tuned on both static and dynamic expression datasets using a joint fine-tuning strategy. To prevent negative transfer during joint fine-tuning, we introduce an innovative Mixture of Adapter Experts (MoAE) module that enables task-specific knowledge acquisition and effectively integrates information from both static and dynamic expression data. Extensive experiments demonstrate UniLearn's effectiveness in leveraging complementary information from static and dynamic facial data, leading to more accurate and robust DFER. UniLearn consistently achieves state-of-the-art performance on FERV39K, MAFW, and DFEW benchmarks, with weighted average recall (WAR) of 53.65\%, 58.44\%, and 76.68\%, respectively. The source code and model weights will be publicly available at \url{https://github.com/MSA-LMC/UniLearn}.
BibTeX
@misc{chen2024unilearn,
  author = {Yin Chen and Jia Li and Yu Zhang and Zhenzhen Hu and Shiguang Shan and Meng Wang and Richang Hong},
  title = {{UniLearn: Enhancing Dynamic Facial Expression Recognition through Unified Pre-Training and Fine-Tuning on Images and Videos}},
  year = {2024},
  eprint = {2409.06154},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.06154},
}
Figure