Facial expression and attributes recognition based on multi-task learning of lightweight neural networks

Andrey V. Savchenko · DOI

Abstract

In this paper, the multi-task learning of lightweight convolutional neural networks is studied for face identification and classification of facial attributes (age, gender, ethnicity) trained on cropped faces without margins. The necessity to fine-tune these networks to predict facial expressions is highlighted. Several models are presented based on MobileNet, EfficientNet and RexNet architectures. It was experimentally demonstrated that they lead to near state-of-the-art results in age, gender and race recognition on the UTKFace dataset and emotion classification on the AffectNet dataset. Moreover, it is shown that the usage of the trained models as feature extractors of facial regions in video frames leads to 4.5% higher accuracy than the previously known state-of-the-art single models for the AFEW and the VGAF datasets from the EmotiW challenges. The models and source code are publicly available at https://github.com/HSE-asavchenko/face-emotion-recognition.

Introduction

While deep convolutional neural networks (CNNs) have revolutionized facial analytics, top-performing models are often massive ensembles that are computationally expensive, making them impractical for real-time use on mobile or edge devices. Existing multi-task learning (MTL) attempts—which aim to predict age, gender, and emotion simultaneously—often suffer from high complexity, requiring difficult loss functions and numerous hyperparameters. Furthermore, a fundamental tension exists between face identification (which seeks to ignore expressions) and emotion recognition (which focuses on them). This paper proposes a streamlined training pipeline for lightweight neural networks to perform multi-task facial analysis without sacrificing accuracy for speed.

Methodology

The proposed approach utilizes lightweight backbones such as MobileNet-v1, EfficientNet-B0/B2, and RexNet-150. The training strategy is defined by two key innovations: precise cropping and sequential multi-task training.

Precise Cropping

Unlike traditional methods that use center-cropped images or wide margins, this study advocates for using MTCNN (Multi-task Cascaded Convolutional Networks) to produce tight crops of the face without margins. Removing background noise ensures that extracted features are more meaningful for facial analytics.

Comparison of face cropping with margins (a, c) and without margins (b, d).

Sequential Multi-Task Training

The training follows a three-phase sequential strategy to manage the conflict between identity and expression features:

  1. Phase 1: Pre-train the backbone on the VGGFace2 dataset for face identification.
  2. Phase 2: Add separate fully connected "heads" for age, gender, and ethnicity, training them while the backbone is partially frozen.
  3. Phase 3: Fine-tune the entire network for emotion recognition. Since face identification features are designed to be expression-invariant, the whole network must be adapted to capture emotional nuances.
Multi-task learning architecture for facial analysis.

For video datasets (AFEW, VGAF), the CNN acts as a feature extractor for every frame. These frame-level features are aggregated using simple statistical functions (mean, max, min, and standard deviation) to create a single descriptor for the video clip, which is then classified using a standard SVM or Random Forest.

Experimental Results

The study leveraged several benchmarks, including VGGFace2, UTKFace, and AffectNet. Key findings include:

  • Efficiency: The MobileNet-v1 based model is remarkably small (3.2 MB) yet achieves competitive results.
  • Static Emotion: On the AffectNet dataset (8 classes), the EfficientNet-B2 model achieved 62.42% accuracy, outperforming larger models like PSR (VGG-16).
  • Video Emotion: The approach achieved 59.27% accuracy on the AFEW dataset, 4.5% higher than previous state-of-the-art single models.
  • Group Emotion: On the VGAF dataset, the EfficientNet-B2 model reached 69.84% accuracy, setting a new benchmark for single-model performance.

Conclusion

This research demonstrates that lightweight CNNs, when trained with precise cropping and sequential multi-task learning, can achieve near state-of-the-art performance in facial attribute and emotion recognition. While simple statistical aggregation of frame features proved sufficient for video tasks, future work may explore Graph Convolutional Networks (GCNs) or Transformers to better model temporal dynamics and relationships between faces in a frame.

Summary updated

BibTeX
@inproceedings{savchenko2021facial,
  author = {Andrey V. Savchenko},
  title = {{Facial expression and attributes recognition based on multi-task learning of lightweight neural networks}},
  booktitle = {SISY},
  year = {2021},
  doi = {10.1109/sisy52375.2021.9582508},
}
Figure