When Liebig's Barrel Meets Facial Landmark Detection: A Practical Model

Haibo Jin, Jinpeng Li, Shengcai Liao, Ling ShaoarXiv 2021

Abstract

BarrelNet is a practical facial landmark detector that balances accuracy, efficiency, and robustness by applying "Liebig’s Law of the Minimum"—ensuring no single technical bottleneck limits the model's real-world utility. By introducing two lightweight modules, DQInit and QAMem, the researchers achieved state-of-the-art results on the challenging WFLW dataset while maintaining high-speed performance (50+ FPS).

Introduction: The "Short Stave" Problem

In facial landmark detection, researchers often fall into the trap of over-optimizing for a single metric, such as raw accuracy on a specific benchmark, while neglecting practical constraints like inference speed, ease of training, or structural robustness.

The authors invoke Liebig’s Law of the Minimum, which states that a barrel’s capacity is limited by its shortest stave. In this context, if a model is incredibly accurate but too slow for a phone, or fast but fails whenever a user wears sunglasses, it has a "short stave" that makes it impractical. BarrelNet seeks to build a "well-rounded barrel" by creating a model that is simultaneously accurate, robust, efficient, generalizable, and easy to train end-to-end.

Methods: The BarrelNet Architecture

BarrelNet moves away from traditional, computationally expensive heatmap-based methods toward a Transformer-based coordinate regression approach. The architecture utilizes a standard CNN backbone (e.g., ResNet) but replaces complex detection heads with a single, highly efficient Transformer decoder layer.

The BarrelNet architecture featuring the CNN backbone, Memory module, DQInit, and the Transformer Decoder with QAMem.

To maintain high accuracy without the computational overhead of deep Transformers, two novel modules were introduced:

Dynamic Query Initialization (DQInit)

Standard Transformers often initialize landmark "queries" as zeros or learned constants. DQInit instead generates a coarse estimate derived from input features via global average pooling. This data-driven "head start" allows the model to achieve high precision with just one decoder layer instead of the typical six, significantly boosting inference speed.

Query-Aware Memory (QAMem)

When using low-resolution feature maps to save computation, multiple landmarks may fall into the same grid cell, making them difficult to distinguish. QAMem addresses this by providing each query with its own unique "memory values" using 1x1 group convolutions. This enables the extraction of distinct, high-precision information even from low-resolution data.

Comparison of memory strategies: (a) Shared low-res memory, (b) Shared high-res memory, and (c) the proposed Separate Memories (QAMem) with low-resolution.

Experimental Results

The model was evaluated on three major industry-standard benchmarks: 300W, COFW (focusing on occlusion), and WFLW (featuring extreme poses and expressions).

  • State-of-the-Art Performance: BarrelNet-101 achieved a new SOTA on the WFLW dataset with a Normalized Mean Error (NME) of 4.20.
  • Real-Time Efficiency: BarrelNet-18 runs at 137 FPS on a GPU and nearly 29 FPS on a CPU. Compared to a baseline Transformer, it is 88.5% faster on GPU with no loss in accuracy.
  • Robustness and Generalization: When trained on 300W and tested on the occluded COFW-68 dataset, BarrelNet outperformed most existing ResNet-based models, demonstrating its ability to maintain structural integrity under occlusion.

Key Insights

  • Encoders Might Be Overkill: The authors found that adding a Transformer encoder actually harmed performance. While encoders help object detectors find boundaries, they introduce spatial noise that interferes with the pinpoint localization required for landmarks.
  • Global Context for Robustness: Because the Transformer uses self-attention, every landmark "knows" the position of others. If a feature like the mouth is occluded, the model uses the relative positions of the eyes and nose to infer the mouth's location.

Limitations and Future Work

Despite its efficiency, BarrelNet requires longer training times to converge compared to pure CNN models. Additionally, the DQInit and QAMem modules increase the model's parameter count by approximately 13.4 million, which impacts the disk footprint. Future research will focus on "sparse attention" mechanisms to accelerate training and model compression for even lighter mobile deployment.

Summary updated

Abstract

In recent years, significant progress has been made in the research of facial landmark detection. However, few prior works have thoroughly discussed about models for practical applications. Instead, they often focus on improving a couple of issues at a time while ignoring the others. To bridge this gap, we aim to explore a practical model that is accurate, robust, efficient, generalizable, and end-to-end trainable at the same time. To this end, we first propose a baseline model equipped with one transformer decoder as detection head. In order to achieve a better accuracy, we further propose two lightweight modules, namely dynamic query initialization (DQInit) and query-aware memory (QAMem). Specifically, DQInit dynamically initializes the queries of decoder from the inputs, enabling the model to achieve as good accuracy as the ones with multiple decoder layers. QAMem is designed to enhance the discriminative ability of queries on low-resolution feature maps by assigning separate memory values to each query rather than a shared one. With the help of QAMem, our model removes the dependence on high-resolution feature maps and is still able to obtain superior accuracy. Extensive experiments and analysis on three popular benchmarks show the effectiveness and practical advantages of the proposed model. Notably, our model achieves new state of the art on WFLW as well as competitive results on 300W and COFW, while still running at 50+ FPS.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
300W · full setBarrelNet-101 (ResNet-101 backbone)NME3.09Facial Landmark Detection · split: test · backbone=ResNet-101 · subset=full set
Source quote
L188: We compare our models with state-of-the-art methods on three benchmarks, and the results are summrized in Table~\ref{tab:results}. From the table, we can see that BarrelNet consistently outperforms our baseline model on all the datasets with different sizes of backbone, which indicates the effectiveness of DQInit and QAMem. On 300W full set, BarrelNet-101 achieves 3.09, a very competitive result to the best existing ones (i.e., 3.07 from AWing and 3.04 from DAG). It is worth noting that AWing and DAG use stacked hourglass netwrok and HRNet as backbones respectively, both of which produce high-resolution maps for predictions, while BarrelNet only uses low-resolution feature maps which is more computationally efficient. On 300W challenging set, BarrelNet-101 obtains the second best result (4.60), which indicates its generalization capability on difficult and uncommon samples. Similarly, BarrelNet obtains the second best result (3.10) on COFW, indicating its robustness on heavy occlusions. In terms of WFLW, BarrelNet-101 achieves 4.20 NME, which is the new state of the art. The superior performance on WFLW is a solid proof for a practical model since the data distribution of WFLW is the closest to that of in-the-wild images among the three benchmarks.
300W · challenging setBarrelNet-101 (ResNet-101 backbone)NME4.60Facial Landmark Detection · split: test · backbone=ResNet-101 · subset=challenging
Source quote
L188: We compare our models with state-of-the-art methods on three benchmarks, and the results are summrized in Table~\ref{tab:results}. From the table, we can see that BarrelNet consistently outperforms our baseline model on all the datasets with different sizes of backbone, which indicates the effectiveness of DQInit and QAMem. On 300W full set, BarrelNet-101 achieves 3.09, a very competitive result to the best existing ones (i.e., 3.07 from AWing and 3.04 from DAG). It is worth noting that AWing and DAG use stacked hourglass netwrok and HRNet as backbones respectively, both of which produce high-resolution maps for predictions, while BarrelNet only uses low-resolution feature maps which is more computationally efficient. On 300W challenging set, BarrelNet-101 obtains the second best result (4.60), which indicates its generalization capability on difficult and uncommon samples. Similarly, BarrelNet obtains the second best result (3.10) on COFW, indicating its robustness on heavy occlusions. In terms of WFLW, BarrelNet-101 achieves 4.20 NME, which is the new state of the art. The superior performance on WFLW is a solid proof for a practical model since the data distribution of WFLW is the closest to that of in-the-wild images among the three benchmarks.
COFWBarrelNet-101 (ResNet-101 backbone)NME3.10Facial Landmark Detection · split: test · backbone=ResNet-101 · annotation=original 29 landmarks
Source quote
L188: We compare our models with state-of-the-art methods on three benchmarks, and the results are summrized in Table~\ref{tab:results}. From the table, we can see that BarrelNet consistently outperforms our baseline model on all the datasets with different sizes of backbone, which indicates the effectiveness of DQInit and QAMem. On 300W full set, BarrelNet-101 achieves 3.09, a very competitive result to the best existing ones (i.e., 3.07 from AWing and 3.04 from DAG). It is worth noting that AWing and DAG use stacked hourglass netwrok and HRNet as backbones respectively, both of which produce high-resolution maps for predictions, while BarrelNet only uses low-resolution feature maps which is more computationally efficient. On 300W challenging set, BarrelNet-101 obtains the second best result (4.60), which indicates its generalization capability on difficult and uncommon samples. Similarly, BarrelNet obtains the second best result (3.10) on COFW, indicating its robustness on heavy occlusions. In terms of WFLW, BarrelNet-101 achieves 4.20 NME, which is the new state of the art. The superior performance on WFLW is a solid proof for a practical model since the data distribution of WFLW is the closest to that of in-the-wild images among the three benchmarks.
WFLWBarrelNet-101 (ResNet-101 backbone)NME4.20Facial Landmark Detection · split: test · backbone=ResNet-101
Source quote
L188: We compare our models with state-of-the-art methods on three benchmarks, and the results are summrized in Table~\ref{tab:results}. From the table, we can see that BarrelNet consistently outperforms our baseline model on all the datasets with different sizes of backbone, which indicates the effectiveness of DQInit and QAMem. On 300W full set, BarrelNet-101 achieves 3.09, a very competitive result to the best existing ones (i.e., 3.07 from AWing and 3.04 from DAG). It is worth noting that AWing and DAG use stacked hourglass netwrok and HRNet as backbones respectively, both of which produce high-resolution maps for predictions, while BarrelNet only uses low-resolution feature maps which is more computationally efficient. On 300W challenging set, BarrelNet-101 obtains the second best result (4.60), which indicates its generalization capability on difficult and uncommon samples. Similarly, BarrelNet obtains the second best result (3.10) on COFW, indicating its robustness on heavy occlusions. In terms of WFLW, BarrelNet-101 achieves 4.20 NME, which is the new state of the art. The superior performance on WFLW is a solid proof for a practical model since the data distribution of WFLW is the closest to that of in-the-wild images among the three benchmarks.
BibTeX
@misc{jin2021when,
  author = {Haibo Jin and Jinpeng Li and Shengcai Liao and Ling Shao},
  title = {{When Liebig's Barrel Meets Facial Landmark Detection: A Practical Model}},
  year = {2021},
  eprint = {2105.13150},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2105.13150},
}
Figure