Task-adaptive Q-Face

Haomiao Sun, Mingjie He, Shiguang Shan, Hu Han, Xilin ChenarXiv 2024 · DOI

TL;DR

Q-Face is a unified, multi-task framework that performs diverse face analysis tasks—from expression recognition to age estimation—using a single model. By employing a "query-driven" decoder and multi-stage feature fusion, it adaptively extracts the specific local or global features required for each task, effectively resolving the performance trade-offs that usually plague multi-task learning.

What Problem Does This Paper Address?

When humans look at a face, we perceive identity, emotion, age, and gender in a single glance. In contrast, computer vision has traditionally treated these as separate problems. While multi-task learning (MTL) aims to bridge this gap, it faces a major hurdle: task interference.

Different facial tasks require conflicting information. For example, head pose estimation needs features that track the orientation of the skull, while expression recognition needs features that are invariant to pose. Standard MTL models often use a shared encoder with separate "heads," but they usually force all tasks to share the same global feature vector. This "one-size-fits-all" approach leads to feature dilution and sub-optimal performance across the board.

Comparison of task-specific, previous multi-task, and the proposed task-adaptive Q-Face architectures.

Methods

The authors introduce Q-Face, which consists of three main components designed to handle task-specific requirements within a shared framework:

  1. General Face Encoder: The backbone is a Vision Transformer (ViT-B/16). Crucially, instead of standard ImageNet pre-training, the model is pre-trained on 17 million face images using Masked Image Modeling (MIM). This allows the encoder to learn rich structural and textural contexts specific to human faces.
  2. Multi-stage Feature Fusion (MFF): Rather than relying solely on the final layer, Q-Face extracts features from multiple depths (the 4th, 8th, and 12th layers). They introduce Stage Embeddings (SE)—learnable vectors added to the features—which act as tags to inform the decoder of the feature's depth and abstraction level.
  3. Query-driven Decoder (QD): Each task (e.g., "Smile," "Age," "Yaw") is represented by a learnable query vector. These queries perform cross-attention with the fused multi-stage features. Essentially, each task query "selects" the specific features it needs from the various layers and spatial regions of the image.
Detailed architecture of the General Face Analysis Model and the Task-adaptive Decoder.

Key Insights and Ideas

  • Depth Matters: Different tasks have different "favorite" layers. Expression recognition and age estimation rely more on deeper features for global consistency, while Action Unit detection and attribute analysis prefer shallower features for local textures.
  • Queries as Conflict Resolvers: By allowing each task to select its own features via attention, the model avoids forcing a compromise between conflicting objectives. For instance, a "Smile" query can focus on the mouth in shallow layers, while a "Pose" query analyzes the whole head in deep layers.
  • Synergy over Competition: Unlike traditional models where adding tasks often degrades performance, Q-Face demonstrates that tasks can be complementary. Learning about identity or gender can provide useful context for inferring emotion.

Key Results

Q-Face achieved state-of-the-art (SOTA) or competitive results across five diverse public benchmarks (RAF-DB, CelebA, EmotioNet, AgeDB, and BIWI) simultaneously:

  • Expression (RAF-DB): Achieved 92.86% accuracy, outperforming specialized SOTA models like POSTER++ and ARBEx.
  • Attributes (CelebA): Reached 91.56% accuracy, beating other multi-task transformers like SwinFace.
  • Efficiency: Using a unified backbone is significantly more efficient than running five separate specialized models.
  • Ablation Success: Multi-stage Feature Fusion proved critical; removing it caused performance drops across almost all tasks, particularly for fine-grained tasks like Action Unit (AU) detection.

Limitations and Future Work

The primary limitation is the open-set problem. Q-Face is currently designed for a fixed set of tasks defined during training and cannot easily adapt to new facial analysis tasks without retraining. Future work may involve integrating Large Language Models (LLMs) to use natural language task descriptions, potentially enabling "zero-shot" face analysis for unseen categories.

Summary updated

BibTeX
@misc{sun2024task,
  author = {Haomiao Sun and Mingjie He and Shiguang Shan and Hu Han and Xilin Chen},
  title = {{Task-adaptive Q-Face}},
  year = {2024},
  eprint = {2405.09059},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.09059},
}
Figure