Wing Loss for Robust Facial Landmark Localisation with Convolutional Neural Networks

Zhen-Hua Feng, Josef Kittler, Muhammad Awais, Patrik Huber, Xiaojun Wu

TL;DR

This paper introduces "Wing Loss," a novel loss function for Convolutional Neural Networks (CNNs) that specifically targets improving facial landmark localization accuracy by focusing on small to medium errors. Combined with a pose-based data balancing strategy and a two-stage network architecture, their approach achieves state-of-the-art results on challenging datasets.

What Problem Does This Paper Address?

Accurately locating facial landmarks (like the corners of the eyes, tip of the nose, etc.) is crucial for many computer vision tasks, including facial recognition, emotion analysis, and 3D reconstruction. While deep learning, particularly CNNs, has significantly advanced this field, existing methods often struggle with "unconstrained" faces – those with variations in pose, expression, illumination, and occlusion. A key challenge in training these CNNs is the choice of loss function, which dictates how the network learns from errors. Traditional loss functions like L2 (mean squared error) are sensitive to outliers, while L1 and smooth L1, though better, still have limitations. Furthermore, datasets often suffer from an imbalance of poses, with fewer examples of extreme head rotations, leading to poorer performance on these challenging cases.

Methods

The paper's core contributions are:

  • Wing Loss Function: This novel loss function is designed to be more sensitive to small and medium-sized errors, which are critical for precise landmark localization. It's a piecewise function that behaves like a modified logarithm for errors within a certain range (-w, w) and transitions to a linear function for larger errors. This amplification of smaller errors helps the network learn finer details.
  • Pose-Based Data Balancing (PDB): To address the issue of under-represented extreme poses in training data, the authors propose PDB. This strategy involves identifying samples with less common poses, duplicating them, and augmenting them with various transformations (rotation, translation) to create a more balanced dataset.
  • Two-Stage Framework: For enhanced accuracy, the authors introduce a two-stage CNN architecture. The first stage performs a rough localization, handling challenges like in-plane rotations and inaccurate bounding boxes. The second stage then refines these initial predictions with a higher resolution input, leading to more precise landmark placement.

Datasets

The paper uses the following datasets for training and evaluation:

  • AFLW (Annotated Facial Landmarks in the Wild): A challenging dataset with a wide range of pose variations, used extensively for evaluation. The AFLW-Full protocol is utilized.
  • 300W (300 Faces in the Wild): A benchmark dataset comprising images from multiple sources (LFPW, HELEN, AFW, XM2VTS), used for further validation.

Key Insights and Ideas

  • Small Errors Matter Most: The analysis of common loss functions (L1, L2, smooth L1) reveals that for accurate facial landmark localization, the network needs to pay more attention to small and medium-sized errors, not just large ones. This insight directly motivates the design of Wing Loss.
  • Data Imbalance is a Major Hurdle: The significant improvement seen with the Pose-Based Data Balancing strategy highlights how crucial it is to have a representative distribution of poses in the training data for robust performance.
  • Cascading for Precision: The two-stage framework demonstrates that a coarse-to-fine approach, where an initial rough localization is followed by a more refined prediction, is highly effective for improving accuracy.
  • Wing Loss Generalizability: The paper shows that Wing Loss not only improves performance with their custom CNN architectures but also benefits larger, pre-trained networks like ResNet-50, suggesting its broad applicability.

Key Results

  • Wing Loss Superiority: On the AFLW dataset, the proposed Wing Loss function achieved an average normalized error of 1.88 × 10⁻², outperforming L2, L1, and smooth L1 loss functions by a significant margin. This represents a 6% improvement over the best previous result and a 13% improvement over state-of-the-art methods at the time.
  • PDB Boost: The Pose-Based Data Balancing strategy further improved accuracy, reducing the average normalized error to 1.83 × 10⁻² on AFLW when combined with the two-stage framework and Wing Loss.
  • Two-Stage Framework Effectiveness: The two-stage CNN architecture (CNN-6/7) consistently improved accuracy across all loss functions, achieving a normalized error of 1.71 × 10⁻² with Wing Loss and PDB on AFLW.
  • 300W Performance: The proposed approach also achieved state-of-the-art results on the 300W dataset, reducing the error by almost 20% compared to previous best results.
  • Speed vs. Accuracy: The authors' custom CNN-6/7 network is significantly faster (up to 170 fps on GPU) than larger models like ResNet-50, offering a good trade-off between accuracy and real-time performance.

Limitations and Future Work

  • Computational Cost of Larger Networks: While ResNet-50 with Wing Loss showed improved accuracy, it came at the cost of significantly slower training and inference times. The authors acknowledge this trade-off.
  • Extended Use of Wing Loss: The paper suggests that Wing Loss is relevant to other regression-based computer vision tasks using CNNs and expresses interest in exploring these extended uses in future work.
  • Further Optimization: While the paper presents a robust framework, there's always room for further optimization in network architecture, data augmentation, and hyperparameter tuning.

Summary updated

BibTeX
@inproceedings{feng2018wing,
  author = {Zhen-Hua Feng and Josef Kittler and Muhammad Awais and Patrik Huber and Xiaojun Wu},
  title = {{Wing Loss for Robust Facial Landmark Localisation with Convolutional Neural Networks}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  doi = {10.1109/cvpr.2018.00238},
}
Figure