AUFormer: Vision Transformers Are Parameter-Efficient Facial Action Unit Detectors

Kaishen Yuan, Zitong Yu, Xin Liu, Weicheng Xie, Huanjing Yue, Jingyu Yang

Introduction

Facial Action Unit (AU) detection is a cornerstone of affective computing, identifying the fundamental muscle movements that compose facial expressions. However, the field faces a significant challenge: AU datasets are typically small and expensive to annotate, while modern deep learning models are increasingly massive. Fully fine-tuning these models often leads to severe overfitting. Furthermore, AU detection requires a nuanced balance of capturing local, multi-scale muscle deformations and global spatial correlations between different facial regions.

The AUFormer Architecture

To address these challenges, the authors propose AUFormer, a parameter-efficient framework that leverages a frozen Vision Transformer (ViT) backbone. Instead of retraining the entire network, AUFormer inserts lightweight, specialized modules called Mixture-of-Knowledge Experts (MoKE).

Overview of the AUFormer architecture, showing the integration of MoKE groups within frozen Transformer blocks and the collaboration mechanism.

Mixture-of-Knowledge Expert (MoKE)

Unlike standard adapters, each AU is assigned its own MoKE. This allows for fine-grained, AU-specific feature extraction. Each MoKE consists of two primary operators:

  • Multi-Receptive Field (MRF): Utilizes dilated convolutions to capture muscle movements across various scales.
  • Context-Aware (CA): Employs a Hadamard-product-based mechanism to model the spatial correlations between different facial regions, acknowledging that AUs rarely occur in isolation.

Collaboration Mechanism

These experts do not operate in silos. Within each Transformer layer, the AU-specific features are aggregated and injected back into the main ViT stream. This collaborative approach allows the frozen backbone to adapt to facial dynamics while preserving its general visual knowledge.

Loss Function Design: MDWA-Loss

AU detection is often plagued by noisy labels and class imbalance. To mitigate this, the authors introduced the Margin-truncated Difficulty-aware Weighted Asymmetric Loss (MDWA-Loss). This function focuses on activated AUs to combat imbalance and adaptively weights samples based on their difficulty. Crucially, it includes a "truncation margin" ($m$) that identifies and ignores likely mislabeled samples—cases where the model is highly confident but the label disagrees—preventing the model from learning from annotation errors.

Experimental Evaluation

AUFormer was evaluated on three major benchmarks: BP4D (macro-expressions), DISFA (intensity-based labels), and CASME II (micro-expressions).

Performance comparison of AUFormer against other state-of-the-art methods in terms of F1-score, FLOPs, and learnable parameters.

The results demonstrate that AUFormer achieves state-of-the-art performance while being significantly more efficient. On the challenging CASME II dataset, it achieved a 4% improvement over previous methods. Perhaps most impressively, in a stress test using only 0.1% of the BP4D training data (fewer than 100 samples), AUFormer maintained high F1-scores, whereas traditional models' performance collapsed.

Conclusion

AUFormer demonstrates that parameter-efficient transfer learning (PETL) is exceptionally well-suited for AU detection. By freezing the backbone and training only ~2% of the parameters, the model avoids overfitting on small datasets while capturing complex facial dynamics through its MoKE mechanism. Future work may explore more dynamic collaboration strategies between experts to further refine personalized AU feature extraction.

Summary updated

BibTeX
@inproceedings{yuan2024auformer,
  author = {Kaishen Yuan and Zitong Yu and Xin Liu and Weicheng Xie and Huanjing Yue and Jingyu Yang},
  title = {{AUFormer: Vision Transformers Are Parameter-Efficient Facial Action Unit Detectors}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72973-7\_25},
}
Figure