An All-In-One Convolutional Neural Network for Face Analysis

Rajeev Ranjan, Swami Sankaranarayanan, Carlos Domingo Castillo, Rama Chellappa

TL;DR

This paper introduces an "all-in-one" deep convolutional neural network (CNN) that simultaneously handles seven distinct face analysis tasks: detection, landmark localization, pose estimation, gender recognition, smile detection, age estimation, and face verification/recognition. By leveraging a multi-task learning (MTL) framework, the network shares lower-layer representations across tasks, significantly boosting both computational efficiency and individual task accuracy through cross-domain regularization.

What Problem Does This Paper Address?

Traditional face analysis systems operate like an assembly line: first detect the face, then align it, and finally pass it to separate modules for age, gender, or identity recognition. This modular approach suffers from two major flaws:

  1. Error Accumulation: If the face detector or alignment module makes a slight mistake, that error propagates downstream, degrading the performance of subsequent tasks like face recognition.
  2. Inefficiency: Running separate deep networks for each task is computationally expensive and memory-intensive, making deployment on resource-constrained systems impractical.

While many facial attributes are highly correlated (e.g., alignment directly aids recognition), existing methods rarely exploit these synergies. This paper tackles the challenge of building a unified, end-to-end network that performs all these tasks simultaneously without sacrificing accuracy.

Methods

The authors design a single backbone CNN based on a pre-trained face identification network. They split the seven tasks into two primary categories based on the type of facial features they require:

  • Subject-Independent Tasks (Detection, Landmarks, Pose, Smile): These tasks rely heavily on local, low-level geometric features. To capture this, the network fuses feature maps from the 1st, 3rd, and 5th convolutional layers into a shared, generic representation before branching into task-specific fully connected layers.
  • Subject-Dependent Tasks (Age, Gender, Identity): These tasks require global, holistic facial features. They are branched out later in the network, specifically from the 6th convolutional layer.

The complete architecture is trained end-to-end using a multi-task learning (MTL) loss function, which is a weighted sum of individual task losses (softmax for classification, Euclidean for regression).

The proposed multi-task CNN architecture showing shared layers and task-specific branches.

A key methodological innovation is the Age Estimation Loss. Standard regression uses Euclidean loss, but gradients vanish when the network's prediction is far from the true age. To fix this, the authors introduce a loss function that dynamically transitions from a robust Euclidean loss early in training to a fine-grained Gaussian loss as predictions improve.

Comparison of Euclidean and Gaussian loss functions used for age estimation.

During inference, the system uses a two-stage pipeline: it first generates region proposals to detect faces and estimate poses, then aligns the faces and passes them through the network a second time to extract attributes and identity descriptors.

Datasets

To train a network on so many diverse tasks, the authors employ domain-based regularization, training simultaneously across multiple specialized datasets rather than relying on a single heavily annotated dataset:

  • CASIA-WebFace: 490,356 samples (Identification, Gender)
  • CelebA: 182,637 samples (Smile, Gender)
  • MORPH / IMDB+WIKI / Adience: Over 290,000 combined samples (Age, Gender)
  • AFLW: 20,342 samples (Detection, Pose, Fiducials)

Evaluation is performed on standard unconstrained benchmarks including AFW, PASCAL faces, FDDB (for detection/alignment), Chalearn LAP2015, FG-NET (for age), and IJB-A (for face verification).

Key Insights and Ideas

  • The Power of Face-Recognition Initialization: Initializing the network with weights from a model pre-trained on face identification provides a massive advantage. The filters already retain highly discriminative, fine-grained facial information, which accelerates and stabilizes training for completely different tasks like age or smile detection.
  • MTL as a Regularizer: Training on multiple tasks simultaneously forces the shared lower layers to find a parameter space that satisfies all domains. This drastically reduces overfitting, acting as a built-in regularization mechanism.
  • Mutual Benefit: Instead of tasks competing for network capacity, they assist each other. For instance, optimizing for facial landmarks inherently provides better structural awareness, which directly improves face verification performance.

Key Results

The "All-In-One" network achieves state-of-the-art or highly competitive results across the board:

  • Face Alignment: On the AFLW dataset, the proposed method reduced the Normalized Mean Error (NME) by over 30% compared to the previous best multi-task baseline (HyperFace).
  • Face Verification: On the challenging IJB-A dataset, the model achieved a True Accept Rate (TAR) of 0.823 at a False Accept Rate (FAR) of 0.001, outperforming the single-task baseline network.
  • Age Estimation: The model achieved an average error of just 2.00 years on the FG-NET database, significantly outperforming prior methods.

Limitations and Future Work

  • Coarse Localization: While the network is highly robust on profile and unconstrained faces, it lacks pixel-accurate precision for "easy" (frontal, well-lit) faces compared to specialized, iterative cascade regression methods.
  • Small Face Detection: The face detection performance drops on very small faces because the initial region proposal mechanism (Selective Search) occasionally fails to capture them.
  • Inference Speed: Processing an image takes roughly 3.5 seconds on a high-end GPU. The primary bottleneck is the region proposal generation, meaning future work must focus on integrating a faster, native region proposal network (like Faster R-CNN) to achieve true real-time performance.

Summary updated

BibTeX
@inproceedings{ranjan2017all,
  author = {Rajeev Ranjan and Swami Sankaranarayanan and Carlos Domingo Castillo and Rama Chellappa},
  title = {{An All-In-One Convolutional Neural Network for Face Analysis}},
  booktitle = {FG},
  year = {2017},
  doi = {10.1109/fg.2017.137},
}
Figure