Vision Transformer for Action Units Detection

Tu Vu, Van Thong Huynh, Soo-Hyung KimarXiv 2023 · DOI

Abstract

Facial Action Unit (AU) detection provides a high-resolution analysis of human emotion by identifying specific muscle movements. However, detecting these units in real-world, "in-the-wild" video sequences is computationally demanding and technically challenging due to environmental variability. This paper introduces a streamlined hybrid architecture that integrates the spatial efficiency of Convolutional Neural Networks (CNNs) with the temporal reasoning capabilities of Video Vision Transformers (ViViT). By utilizing a RegNet backbone as a feature extractor instead of standard patch embeddings, the proposed model achieves a 14% performance increase over the ABAW 2023 baseline, demonstrating a robust balance between accuracy and computational feasibility.

Introduction

Facial Action Unit (AU) detection represents the frontier of affective computing, moving beyond categorical emotion labels (e.g., "happy" or "sad") to identify the underlying muscle activations defined by the Facial Action Coding System (FACS). Detecting units such as a brow lowerer (AU4) or a cheek raiser (AU6) allows for a more nuanced understanding of human behavior.

Despite its potential, AU detection faces significant hurdles. "In-the-wild" datasets, such as those provided by the Affective Behavior Analysis in-the-wild (ABAW) competition, feature complex lighting, occlusions, and varying head poses. Furthermore, while Vision Transformers (ViTs) excel at capturing long-range dependencies, their high computational cost often makes them inaccessible for processing high-resolution video frames without massive hardware resources.

Methodology

The proposed architecture leverages a hybrid approach to optimize both spatial and temporal feature extraction.

Spatial Feature Extraction (RegNet)

Instead of the standard Transformer approach of dividing raw video into patches, the model employs RegNetY as a spatial specialist. RegNet acts as a lightweight embedding module, processing individual frames to extract high-level spatial features. This significantly reduces input dimensionality before the data enters the Transformer layers.

Temporal Modeling (ViViT)

To capture the dynamics of facial expressions over time, the model uses a Video Vision Transformer (ViViT) with a Factorized Encoder variant. This module processes sequences of 256 frames, allowing the network to understand the temporal flow of muscle movements. To further reduce complexity, the researchers found they could remove the first four layers of the ViViT model and retain only the last eight, maintaining performance while speeding up inference.

Proposed hybrid architecture combining RegNet for spatial features and ViViT for temporal modeling.

Optimization and Training

The model utilizes transfer learning, starting with a RegNet backbone pre-trained on ImageNet. To preserve general feature extraction while adapting to facial data, the first block is frozen while the subsequent three blocks are fine-tuned. Training is further optimized using Focal Loss, which helps the network focus on "hard" examples—crucial for AU detection where some muscle movements are much rarer than others.

Dataset

The model was evaluated using the ABAW 2023 (Affective Behavior Analysis in-the-wild) competition dataset, which consists of 541 videos and approximately 2.7 million frames. The dataset includes 438 diverse subjects and provides labels for 12 specific Action Units (AU1, AU2, AU4, AU6, AU7, AU10, AU12, AU15, AU23, AU24, AU25, and AU26).

Results

The hybrid CNN-ViT model demonstrated significant improvements over existing benchmarks. It achieved a macro F1 score of 0.5398 on the validation set, representing a 14% improvement over the ABAW 2023 challenge baseline. As shown in the performance comparison, these results are competitive with the top-performing systems from previous iterations of the competition, despite the model's streamlined design.

Comparison of the proposed method against the ABAW baseline and top-performing models from previous years.

Discussion and Future Work

The success of this hybrid approach highlights the value of using CNNs as "smart" embeddings for Transformers in video tasks. By compressing spatial information early, the model retains critical facial details while reducing the memory footprint. Additionally, the use of temporal context via ViViT allows the system to distinguish between fleeting micro-expressions and sustained movements.

However, limitations remain. The current model uses a fixed 256-frame sequence length, which may not be ideal for expressions of varying durations. Future research could explore adaptive sequence lengths or explicit modeling of AU correlations. Furthermore, while RegNet improves efficiency, the quadratic complexity of self-attention in Transformers remains a challenge for extremely long video sequences, suggesting a potential role for Linear Transformers or state-space models in future iterations.

Summary updated

BibTeX
@misc{vu2023vision,
  author = {Tu Vu and Van Thong Huynh and Soo-Hyung Kim},
  title = {{Vision Transformer for Action Units Detection}},
  year = {2023},
  eprint = {2303.09917},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.09917},
}
Figure