Back to paper library

LAB

A Sense of Boundaries

Original paper

Look at Boundary: A Boundary-Aware Face Alignment Algorithm

Paper authors

Wayne Wu · Chen Qian · Shuo Yang · Quan Wang · Yici Cai · Qiang Zhou

Publication
CVPR 2018Conference
First submitted to arXiv
arXiv:1805.10483
Cite this paper · BibTeX

The citation identifies the linked source version. It cites the original paper and its authors.

@misc{faceanalysislab2018,
  title = {{Look at Boundary: A Boundary-Aware Face Alignment Algorithm}},
  author = {Wayne Wu and Chen Qian and Shuo Yang and Quan Wang and Yici Cai and Qiang Zhou},
  year = {2018},
  eprint = {1805.10483},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1805.10483}
}
On this page

Try placing 17 points along the jawline of a face. The two mouth corners and the two outer eye corners are easy to find, and the tip of the chin is probably fine too; the dozen or so remaining points on the contour can only be spread roughly evenly along that line. Switch to another annotator, or turn the face 30 degrees, and point 5 slides along the contour to somewhere else.

Every dataset also spreads them its own way. 300-W puts 17 points on the contour, while WFLW, the dataset this paper built, puts 33; COFW has only 29 points for the whole face, and the common AFLW protocol uses just 19. Nobody can say exactly where the points go, and there's no agreement on how many there should be; the contour line itself, though, is hardly in dispute.

LAB's idea starts right here, with the lines first and the points second. The authors split the face into 13 boundary lines, first estimate a heatmap for each line, then have a landmark regressor look at those lines and output coordinates. First author Wayne Wu was a student at Tsinghua University at the time, and the work was done during an internship at SenseTime Research. The paper also released the WFLW dataset, 98 points on 10,000 faces; for the next several years, most facial landmark papers had to report results on WFLW.

Defining the Problem

Input, output and two approaches

In this paper, face alignment simply means landmark detection. The input is a face cropped by its face box and resized to 256×256256\times256, and the output is the coordinates of LL points, for example the 68 points of 300-W: 17 on the contour, 5 on each eyebrow, 9 on the nose, 6 on each eye and 20 on the mouth.

Deep methods at the time took one of two approaches. Coordinate regression ends the CNN with fully connected layers that output 2L2L numbers directly; it's simple and needs no post-processing. Heatmap regression outputs a small image for each point (say 64×6464\times64); the training target is an image with a Gaussian peak at the correct position, and at inference the location of the maximum is taken as the coordinate. The paper observes that heatmap regression is usually more accurate than coordinate regression; the best method at the time (JMFA) was a stacked hourglass network that outputs heatmaps.

LAB uses both. The boundaries are estimated as heatmaps, but the landmarks come out in the end as coordinates regressed by fully connected layers; we'll see later why it's wired this way.

Measuring the error

The standard metric is the normalized mean error (NME). Average the Euclidean distance between each predicted point and its annotation, then divide by a length dd that stands for the size of the face:

NME=1L∑l=1L∥s^l−sl∥2d\text{NME}=\frac{1}{L}\sum_{l=1}^{L}\frac{\|\hat s_l-s_l\|_2}{d}

The trouble is that there are several ways to choose dd. 300-W and WFLW commonly use the distance between the two outer eye corners (inter-ocular); older papers use the distance between the two pupils (inter-pupil), and since the 68 points include no pupils, the mean of the 6 points around each eye stands in for the pupil; AFLW has many profile faces where the eye distance is unstable, so it uses the size of the face box instead.

A diagram drawn for this note showing the two eyes of the WFLW mean face shape. Blue lines join each eye's 8 points into an eye outline, with the outer eye corners at the two ends marked as hollow blue circles, and a blue bracket below marks the inter-ocular distance d (points 60 to 72). In the middle of each eye an orange hollow circle stands for the pupil, and a shorter orange bracket above marks the inter-pupil distance, about 0.70 d (points 96 to 97). Text below the figure says the median inter-ocular distance on the WFLW test set is 56.6 pixels, about 1.43 times the inter-pupil distance, which is about 39.6 pixels; the same 2-pixel error comes to 3.53% divided by 56.6 and 5.05% divided by 39.6.
Drawn for this note, computed from the WFLW test-set annotations.

How far apart are the two denominators for the same face? Computed on WFLW's 2,500 test faces, the inter-ocular distance averages 1.43 times the inter-pupil distance. So the same 2-pixel error comes to 3.53% with inter-ocular normalization and 5.05% with inter-pupil. Same model, different denominator, and the numbers differ by forty percent; this is exactly where LAB's own 300-W table later trips up.

Overall performance is read from the cumulative error distribution (CED) curve. The horizontal axis is an NME threshold and the vertical axis is the fraction of images whose error doesn't exceed it; the earlier the curve shoots up, the better. Take the area under the curve up to a threshold of 0.1 and divide by 0.1, and you get the AUC, between 0 and 1. Intuitively, if every image's error were exactly 4.7%, the CED would be a single step at 0.047 and the AUC would be (10−4.7)/10=0.53(10-4.7)/10=0.53. The failure rate (FR) is the fraction of images with NME above 10%.

On 300-W, the training set has 3,148 images. The test Fullset has 689, split into the easier common subset (554) and the challenging subset (135), mostly large poses and exaggerated expressions; there's also a 600-image test set, the private test set of the original 300-W competition.

Points are vague, and heatmaps blur

The authors point out three problems.

The first is ambiguous definitions. Corner points such as eye corners and mouth corners are clearly defined, but points on the contour or in the middle of an eyebrow are hard to keep at the same semantic position under large poses and occlusion.

The second is incompatible annotation schemes. Datasets differ in point count (19, 29, 68, 194 points), which makes them hard to combine for training, and a model trained on one dataset does poorly on a new in-the-wild test set.

The third is occlusion. Under heavy occlusion, heatmap methods often output heatmaps that are a mess of noise or sprout several peaks.

The three problems have one thing in common. A point is a weak definition, yet nearly all of these points sit on some clear boundary, such as the upper eyelid, the nose bridge or the bottom edge of the lower lip. If you find that line first, won't the points be easier to find?

Solving the Problem

13 lines

Start with how the ground truth is made. Given a face II and its LL annotated points S={sl}S=\{s_l\}, the points belonging to the same boundary are picked out into a subset SiS_i, for example the 5 points of the upper eyelid. The authors use K=13K=13 boundaries: the outer contour, the left and right eyebrows, the nose bridge, the lower edge of the nose, four eyelids (upper and lower for each eye), the top and bottom edges of the upper lip, and the top and bottom edges of the lower lip.

Each boundary becomes a heatmap in four steps.

  1. Interpolate SiS_i into a dense line.
  2. Draw it as a binary image BiB_i, with pixels on the line set to 1 and everything else 0. The author added in issue #3 that the line is 1 pixel wide.
  3. Apply a distance transform to BiB_i to get Di(x,y)D_i(x,y), the shortest distance from each pixel to the line.
  4. Turn distances into heatmap values with a Gaussian, zeroing everything beyond 3σ3\sigma (Eq. (1) of the paper):
Mi(x,y)={exp⁡ ⁣(−Di(x,y)22σ2),Di(x,y)<3σ0,otherwise\begin{aligned} &M_i(x,y)=\\ &\quad\begin{cases} \exp\!\left(-\dfrac{D_i(x,y)^2}{2\sigma^2}\right), & D_i(x,y)<3\sigma\\ 0, & \text{otherwise} \end{cases} \end{aligned}

The heatmap is a quarter of the input on each side, so a 256×256256\times256 face corresponds to a 64×6464\times64 heatmap. The supplementary material gives σ=1\sigma=1. Plug in a few distances: pixels on the line are 1, one cell off the line is e−0.5=0.61e^{-0.5}=0.61, two cells e−2=0.14e^{-2}=0.14, and from 3 cells out it's 0 (0.011 without the cutoff). So on the heatmap each boundary is a band about 5 cells wide, bright in the middle and dark at the edges.

A two-panel figure drawn for this note. The left panel shows the mean face shape of the WFLW test set on a 64×64 grid, with 98 black dots joined into 13 colored polylines: the outer contour in blue (33 points), the left and right eyebrows in orange, the nose bridge and lower nose edge in green, the four eyelids in purple, and the top and bottom edges of the upper and lower lips in four shades of orange-brown; in the middle of each eye is a hollow circle, a pupil point that lies on no boundary. The right panel is the 64×64 boundary heatmap computed from Eq. (1), the maximum over the 13 maps, shaded from white to dark blue for 0 to 1: a blue line drawing made of eyebrows, eyes, nose, lips and jaw contour, each line about 5 cells wide. Below the figure are the legend for the 13 boundaries and the color bar.
Drawn for this note from Eq. (1) of the paper and the mean face shape of the WFLW test-set annotations; each boundary joins its points with a polyline.

The blue line drawing on the right is what the network has to learn to draw. The left panel also shows a detail in passing. Of WFLW's 98 points, 96 lie on these 13 lines, and the remaining two pupil points belong to no boundary.

This representation doesn't depend on the number of points. Whether it's 300-W's 68 points or WFLW's 98, as long as the points are dense enough, they interpolate into the same 13 lines; that's the basis of the cross-dataset experiments later on.

If the boundaries were perfect

Before looking at how the estimator works, look at one of the authors' upper-bound experiments. If the boundary heatmaps were completely correct, how accurate could the landmarks get?

The setup feeds the ground-truth boundary heatmaps straight into the regressor (the paper calls this Oracle). On 300-W's 600-image test set, the best method at the time, JMFA, has an AUC of 0.5485 and a failure rate of 1.00%; LAB given the ground-truth boundaries scores 0.7626 and 0.

The authors run the same upper-bound comparison with other kinds of "structural information," on 300-W challenging:

Ground truth fed to the regressorNME (%)
None (res-18 baseline)7.12
Facial-part Gaussians5.25
Face parsing map4.16
Boundary heatmaps3.28

Compiled from Table 5 of the paper.

Part Gaussians (one blob per facial feature) are too coarse. In face parsing (cutting the face into non-overlapping regions), every region has to be closed, but there's no clear closed edge between the nose and the cheek to begin with. Boundary lines don't have to close: the nose bridge is one line and the lower edge of the nose is another. They're the most flexible to express, and they have the highest ceiling.

This table only shows that boundaries are worth learning. In practice the boundaries have to be estimated by the network, and the better they're estimated, the more accurate the landmarks; the ablations show this again and again.

The full architecture

Original Figure 2: the framework has three parts. (a) The Boundary Heatmap Estimator at the top: a face goes through convolution, residual units and downsampling into stacked hourglass networks Stack 1 to Stack n, each hourglass followed by a red message passing layer (MPL), and the output is colored boundary heatmaps overlaid on the face. (b) The Boundary-Aware Landmarks Regressor at the bottom: inside the dashed Input Image Fusion box, the original image is multiplied element-wise with the upsampled boundary heatmaps and concatenated, then goes through convolution, downsampling and residual units; three dark-blue FMF (Feature Map Fusion) blocks in the middle each receive a copy of the boundary heatmaps, and fully connected layers finally output the landmark coordinates, drawn as red dots on the face. (c) The Boundary Effectiveness Discriminator at the upper right: the estimated and ground-truth boundary heatmaps go into a funnel-shaped network that outputs a Real/Fake vector. The legend is at the lower right.
Original Figure 2, Wu et al., from PDF page 3, arXiv license, scholarly quotation.

LAB is made of three networks.

  • (a) Boundary heatmap estimator: a stacked hourglass network that takes a face and outputs 13 boundary heatmaps.
  • (b) Boundary-aware landmark regressor: res-18 plus fully connected layers, which takes the face and the boundary heatmaps and outputs LL coordinates.
  • (c) Boundary effectiveness discriminator: judges whether an estimated boundary heatmap is good enough, and improves (a) in turn through adversarial training.

How the regressor takes in the 13 maps

The regressor's baseline is a four-stage res-18 followed by two fully connected layers of 256 units each, outputting 2L2L numbers. Boundary information is fused in at four places: once at the input image and once after each of the first three stages, which are the Input Image Fusion and the three FMFs in (b) of the figure.

Input fusion uses the boundary heatmaps to "mask" the original image (Eq. (2) of the paper):

H=I⊕(M1⊗I)⊕⋯⊕(MK⊗I)H=I\oplus(M_1\otimes I)\oplus\cdots\oplus(M_K\otimes I)

⊗\otimes is element-wise multiplication and ⊕\oplus is concatenation along the channel dimension. The 64×6464\times64 heatmaps are first upscaled to 256×256256\times256, and the ii-th copy, Mi⊗IM_i\otimes I, keeps only the texture near the ii-th boundary, with the background and the textureless cheeks squashed to 0. The original image is also concatenated at the front, so useful information away from the boundaries isn't thrown away altogether. In the officially released WFLW model, for example, the input is a single-channel grayscale face, which becomes 1+13=141+13=14 channels after fusion.

Feature fusion happens in the middle of the network. Suppose a stage outputs a feature map FF of size N×32×32N\times32\times32 (Eq. (3) of the paper):

H=F⊕(F⊗T(M⊕F))H=F\oplus\big(F\otimes T(M\oplus F)\big)
Original Figure 4: a flowchart of Feature Map Fusion. The Boundary Heatmaps (136464) at the upper left go through Down Sampling to become M (133232), which is concatenated with the Input Feature Maps F (N3232) at the lower left into (N+13)3232 and fed into a gray hourglass-shaped subnetwork T, then through a Sigmoid to get N3232; this result and F go through an Element-wise Dot Product to give N3232, which is finally concatenated with F again, outputting the (N+N)3232 Refined Feature Maps H.
Original Figure 4, Wu et al., from PDF page 4, arXiv license, scholarly quotation.

Follow the sizes in the figure.

  1. The 13 boundary heatmaps of 64×6464\times64 are first downsampled to 13×32×3213\times32\times32 to line up with FF.
  2. MM and FF are concatenated into (N+13)×32×32(N+13)\times32\times32.
  3. This goes into a small hourglass network TT. TT's job is to "translate" the 13 channels of boundary information into NN channels, since there are always just 13 boundary maps while the feature map has NN channels. An hourglass is chosen so it can see large-scale structure, and a final sigmoid squashes the output to [0,1][0,1], giving an N×32×32N\times32\times32 attention mask.
  4. The mask is multiplied element-wise with FF: features near the boundaries are kept and everything else is suppressed.
  5. The result is concatenated with the original FF again, giving a 2N×32×322N\times32\times32 output.

The regressor's loss is simply the squared error of the coordinates, ∥S^−S∥22\|\hat S-S\|_2^2. The regressor has no heatmap output of its own; all of its "heatmaps" come from the estimator.

The estimator: stacked hourglasses and message passing

The boundary heatmaps are estimated by a stacked hourglass network, with an MSE loss attached to the output of every hourglass (stack):

LG=12N∑n=1N∑i=1K∥M^i−Mi∥22L_G=\frac{1}{2N}\sum_{n=1}^{N}\sum_{i=1}^{K}\big\|\hat M_i-M_i\big\|_2^2

Here NN is the number of samples in a batch, unrelated to the channel count NN of the feature maps earlier. The main experiments use 4 stacks; the ablations use only 2 to save time.

With this alone, the heatmaps turn into a mess under heavy occlusion. The authors borrow message passing from human pose estimation, so that the visible boundaries can help the invisible ones. The supplementary material spells out how.

  1. At the end of each stack, a 1×11\times1 convolution first gives a 256-channel feature hth^t.
  2. Each boundary then gets its own 16-channel branch, Ait=f(ht∗wai)A_i^t=f(h^t*w_{a_i}), where ff is a nonlinearity. 13 boundaries means 13 branches.
  3. Messages pass between the branches along a tree. For example, the left eyebrow (boundary 6) in the 2nd stack receives a message from the left upper eyelid (boundary 2) in the same stack, and another from the left eyebrow in the 1st stack:
A6′2=f(A62+A2′2∗wa2,a6+A6′1∗wa6,a6)A'^{2}_{6}=f\big(A^{2}_{6}+A'^{2}_{2}*w_{a_2,a_6}+A'^{1}_{6}*w_{a_6,a_6}\big)

Passing within a stack is called intra-level, and passing from one stack to the next is inter-level. When bangs cover the eyebrows, the position of the eyelids can still hint at roughly where the eyebrows are.

  1. The same tree is traversed again in the opposite direction to get Bi′tB'^t_i; the two are concatenated, and a 1×11\times1 convolution outputs the ii-th boundary heatmap.

The authors stress that this step is only feasible with boundaries. The number of message-passing branches equals the number of nodes, so 13 boundaries means 13 branches; with 68 points, let alone 194, parameters and computation would balloon beyond practicality.

The discriminator: let the landmarks keep score

MSE has another old problem. Where things are uncertain, the solution that minimizes squared error averages all the possibilities, so the heatmap blurs. The super-resolution literature observed this long ago.

The usual fix is to add a GAN and have a discriminator tell "real heatmaps" from "heatmaps drawn by the network." The authors argue that here a heatmap's quality has a very concrete criterion: whether it helps the regressor put the points in the right place. So when the discriminator learns, a heatmap drawn by the network isn't automatically labeled fake; that depends on whether the landmarks derived from it are accurate (Eq. (4) of the paper):

dfake(M^,S^)={0,Pr⁡s∈S^(Dist(s)<θ)<δ1,otherwise\begin{aligned} &d_{\text{fake}}(\hat M,\hat S)=\\ &\quad\begin{cases} 0, & \Pr_{s\in\hat S}\big(\text{Dist}(s)<\theta\big)<\delta\\ 1, & \text{otherwise} \end{cases} \end{aligned}

S^\hat S is the set of landmarks the regressor computes from this estimated heatmap, and Dist\text{Dist} is the distance map of the ground-truth boundaries, recording how far each position is from the true boundary. The supplementary material gives θ=1.5\theta=1.5 and δ=0.8\delta=0.8.

Work it through on a 68-point face. δ=0.8\delta=0.8 means at least 0.8×68=54.40.8\times68=54.4, that is 55, predicted points must land within 1.5 pixels of the true boundary for the heatmap to count as "effective," with dfake=1d_{\text{fake}}=1; if only 50 points land near the lines, dfake=0d_{\text{fake}}=0.

The loss of the discriminator DD (Eq. (5) of the paper):

LD=−(E[log⁡D(M)]+E[log⁡(1−∣D(G(I))−dfake∣)])\begin{aligned} &\mathcal L_D=-\Big(\mathbb E\big[\log D(M)\big]\\ &\quad+\mathbb E\big[\log\big(1-|D(G(I))-d_{\text{fake}}|\big)\big]\Big) \end{aligned}

The first term asks DD to judge the ground truth MM as 1. The second asks DD to output dfaked_{\text{fake}} for heatmaps drawn by the estimator GG, that is, 1 when dfake=1d_{\text{fake}}=1 and 0 when dfake=0d_{\text{fake}}=0. The estimator, for its part, minimizes the adversarial loss (Eq. (6) of the paper):

LA=E[log⁡(1−D(G(I)))]\mathcal L_A=\mathbb E\big[\log\big(1-D(G(I))\big)\big]

In other words, it wants DD to say 1 for its own heatmaps. To fool the discriminator, the estimator has to draw heatmaps that put 55 points on the lines.

The three networks are trained in alternation (Algorithm 1 of the paper), with each round doing four things in order.

  1. The estimator GG minimizes ∥M^−M∥22+LA\|\hat M-M\|_2^2+\mathcal L_A.
  2. The discriminator DD minimizes the first term of LD\mathcal L_D with ground-truth heatmaps.
  3. The discriminator DD minimizes the second term of LD\mathcal L_D with estimated heatmaps.
  4. The regressor RR takes II and the estimated heatmap M^\hat M and minimizes ∥S^−S∥22\|\hat S-S\|_2^2.

The loop runs until landmark accuracy on the validation set stops improving. The supplementary material's settings are SGD, batch 8, 2,000 epochs of training, learning rate 2×10−52\times10^{-5} divided by 5 at epochs 1,000 and 1,500, weight decay 0.0005 and momentum 0.9. Data augmentation is translation by ±30 pixels, rotation by ±20°, scaling by ±15% and horizontal flipping. The discriminator, like the regressor, is res-18 plus two fully connected layers. Everything is trained with Caffe on 4 Titan X GPUs.

One estimator, several annotation schemes

Because boundaries don't depend on the point count, there's a by-product. The boundary estimator can be trained on 300-W and then supply boundaries to a regressor for COFW (29 points) or AFLW (19 points). The regressor only has to learn its own set of point definitions, while the boundaries carry over from what was learned on 300-W. This is another advantage of having the regressor output coordinates through fully connected layers; switching to another annotation scheme only means changing the output size of the last layer, 58 numbers for 29 points and 38 for 19. The authors call this cross-dataset face alignment; the discussion shows both its effect and the dispute around it.

WFLW

Last comes the paper's other contribution. WFLW (Wider Facial Landmarks in-the-wild) takes its images from the face detection dataset WIDER FACE: 10,000 faces in total, 7,500 for training and 2,500 for testing, each hand-annotated with 98 points. Counting from the official annotation files, the 10,000 faces come from 6,551 images; a single group photo may have several annotated faces.

98 points are much denser than 68. The outer contour has 33 points, the eyebrows are annotated along their lower edge as well as the upper one (9 points each), each eye has 8 points, and there are two extra pupil points. Besides the points, each face carries 6 attribute labels: large pose, exaggerated expression, extreme illumination, make-up, occlusion and blur. The test set is split by attribute into six subsets:

SubsetFaces
Large pose326
Expression314
Illumination698
Make-up206
Occlusion736
Blur773

Computed for this note from the official WFLW test annotations.

The six subsets add up to more than 2,500 because a face can be both large-pose and occluded. The authors' intent is to evaluate factors such as pose, occlusion and expression on one dataset in one go, without switching between datasets with different evaluation rules. WFLW normalizes by the distance between the outer eye corners (points 60 and 72), with a 10% failure threshold, and the AUC is also computed up to 0.1.

Discussion

300-W: two normalizations

Start with the 300-W Fullset. This table comes in two halves: the top half uses inter-pupil normalization and the bottom half inter-ocular, and numbers from the two halves can't be compared directly.

MethodCommonChallengingFullset
Inter-pupil
MDM4.8310.145.88
RAR4.128.354.94
DVLN3.947.624.66
TSR4.367.564.99
LAB3.426.984.12
LAB+Oracle2.574.722.99
Inter-ocular
PCD-CNN3.677.624.44
SAN3.346.603.98
LAB2.985.193.49
LAB+Oracle1.853.282.13

Compiled from Table 1 of the paper, in %, selected methods only.

Taken half by half, LAB comes first in both. On 300-W's 600-image test set, LAB's AUC is 0.5885 with a 0.83% failure rate, also beating JMFA's 0.5485 and 1.00%.

But put the two normalizations of LAB side by side and something's off. As computed earlier, switching to inter-pupil should multiply the numbers by about 1.4. LAB's inter-ocular Challenging score is 5.19, so the inter-pupil figure should be around 7.3, yet the table says 6.98; the Fullset's 3.49 should correspond to about 4.9, and the table says 4.12.

The community did the math quickly. In September 2018, someone reported in issue #15 that their own model got 3.30 inter-ocular but 4.30 inter-pupil, and suspected they had computed the inter-pupil distance wrong; another commenter estimated the inter-pupil distance at about 0.71 times the inter-ocular distance. In October, Roberto Valle, a PhD student working on face alignment, laid out in issue #20 the numbers of SHN and DAN under both normalizations, and pointed out that the same model couldn't possibly score both 6.98 inter-pupil and 5.19 inter-ocular on Challenging.

The author replied in November 2018 that the original version had left out some details: the inconsistency came from the two normalizations using hourglasses with different numbers of stacks, and the updated table was in the PDF on the project page. That updated version (PDF created on October 31, 2018) splits LAB into two rows:

ModelNorm.Com.Chal.Full
LAB 4-stackInter-ocular2.985.193.49
LAB 4-stackInter-pupil4.207.414.92
LAB 8-stackInter-ocular2.434.852.93
LAB 8-stackInter-pupil3.426.984.12

Compiled from Table 1 of the updated version on the authors' project page (Wayback archive).

In the original version, the inter-pupil row was the 8-hourglass model and the inter-ocular row was the 4-hourglass model, while the text said "The estimator is stacked four times if not specially indicated." After the update, the ratio between the two normalizations of the same 4-stack model is 4.92/3.49=1.414.92/3.49=1.41, matching the community's estimate.

Measured by inter-pupil distance, that same 4-stack model's Fullset 4.92 trails DVLN's 4.66 in the table, and its Common 4.20 trails 3.94 as well (beaten by its own predecessor); DVLN is the previous year's work by LAB's first author and Shuo Yang. The Challenging score of 7.41 still beats the other methods (TSR 7.56, DVLN 7.62).

In the reply the author said "We will upload it to Arxiv later". In January 2021 someone left a reminder in the same thread, "I think you have forgotten to update the Arxiv version of the paper"; arXiv still has only v1, and the CVF open-access version also has the original table. The comparison tables of later papers (LUVLi, for example) cite the 4-stack 3.49. The 8-stack 2.93 is lower than Adaptive Wing's 3.07 a year later, yet there's no public code or model to verify it.

WFLW: an exam for those who came after

WFLW is a new dataset, so the only methods compared in the table are ESR, SDM, CFSS and DVLN. In the table below, the DVLN and LAB columns are NME, and the last two columns are LAB's failure rate and AUC:

SubsetDVLNLABLAB FRLAB AUC
All6.085.277.560.5323
Large pose11.5410.2428.830.2345
Expression6.785.516.370.4951
Illumination5.735.236.730.5433
Make-up5.985.157.770.5394
Occlusion7.336.7913.720.4490
Blur6.886.3210.740.4630

Compiled from Table 3 of the paper, inter-ocular normalization, NME and FR in %.

Overall NME drops from DVLN's 6.08 to 5.27. Large pose is still the hardest cell: LAB fails on 28.83% of the 326 large-pose faces, more than a quarter, against DVLN's 46.93%. The occlusion subset's 13.72% failure rate is also clearly higher than those of expression, illumination and make-up. The authors' own conclusion is that WFLW leaves plenty of room for improvement.

This exam has been retaken many times since. A year later, Adaptive Wing pushed NME on the full WFLW test set down to 4.36, and the year after that LUVLi got 4.37; the 2023 STAR Loss paper states flatly that "WFLW is currently the most used dataset in facial landmark detection."

Cross-dataset: COFW and AFLW

In this set of experiments, LAB's boundary estimator is trained on 300-W, and only the regressor uses the target dataset's annotations. The control, "LAB w/o boundary," is a res-18 regressor with the same structure but no boundaries. In the table, the two COFW columns are the 29-point NME and failure rate, and the two AFLW columns are NME on the full set and on the frontal subset.

MethodCOFWFRAFLWFrontal
Previous best6.034.142.171.81
LAB, no boundary5.582.761.851.62
LAB3.920.391.251.14

Compiled from Table 4 of the paper, in %. "Previous best" is the best result other than LAB in each column of the table (RAR and DAC-CSR for COFW, TSR and DAC-OSR for AFLW).

With boundaries, the error on COFW-29, AFLW-Full and AFLW-Frontal drops by 29%, 32% and 29% in relative terms. Every COFW test face is occluded to some degree, and the failure rate drops from 2.76% to 0.39%, leaving just two failures out of 507.

Two things to keep in mind when reading this table. First, the baseline without boundaries already beats the previous best, 1.85 against 2.17 on AFLW-Full. Second, LAB with boundaries uses 300-W's training data on top. Roberto Valle raised this in issue #20 as well, arguing that it makes the numbers incomparable with the literature; the author replied that the table was there to evaluate cross-dataset auxiliary training, not to compare. The LAB row in the table is set in bold as the best all the same.

On COFW-68 (the COFW test set re-annotated with 68 points), LAB trained on 300-W's training images gets 4.62% NME and a 2.17% failure rate; CFSS, also trained on images from the 300-W family, gets 6.28% and 9.07%.

Ablations: better lines, better points

The ablations are done mainly on 300-W challenging, with the estimator stacking only 2 hourglasses.

The more fusion layers, the better. Fusing at a single layer brings NME from the baseline's 7.12 down to 6.56; fusing at two, three and four layers gives 6.32, 6.19 and 6.13 in turn.

The fusion method was compared too. Replacing the hourglass subnetwork TT in feature fusion with consecutive convolutions gives an NME of 6.24; keeping the hourglass but withholding the boundary heatmaps only gets down to 6.95. The latter shows that the drop in error comes mainly from the boundary information, not from the parameters of an extra hourglass.

Next come the estimator's three components, added one at a time on top of the res-18 baseline:

SettingNME (%)FR (%)
res-18 baseline7.1210.37
+ Hourglass boundaries6.137.41
+ Message passing5.825.93
+ Adversarial learning5.593.70

Values read from Figure 8(a) of the paper, 300-W challenging.

Original Figure 5: on the far left, a face wearing a Captain America mask; the three images to its right are boundary heatmaps overlaid on the face, labeled Baseline Hourglass, Baseline + Message Passing and Baseline + Message Passing + Adversarial Learning in turn. The baseline hourglass heatmap has patches of blurry noise around the mask edges and the chin; with message passing, the eyebrows and the jaw contour become continuous; with adversarial learning added as well, the lines are the thinnest and most concentrated.
Original Figure 5, Wu et al., from PDF page 4, arXiv license, scholarly quotation.

This figure matches the last three rows of the table. The mask covers the forehead, the area around the eyes and the nose bridge, and the contours drawn by the baseline hourglass are broken, with blobs of noise around them; add message passing and the lines join up; add adversarial learning on top and the lines get thinner and more concentrated.

The authors also measured the error of the heatmaps themselves: for the three settings it is 0.85, 0.76 and 0.63 in turn, while the landmark error falls in step from 6.13 and 5.82 to 5.59. In the abstract, the authors asked how boundary estimation relates to landmark localization; these numbers answer that the better the heatmap is drawn, the more accurately the points are placed.

The adversarial step has one more control. With a conventional real/fake discriminator instead, the failure rate on 300-W challenging is 5.19%; the version that uses landmarks to decide dfaked_{\text{fake}} gets 3.70%.

Message passing helps most on WFLW's occlusion subset, where the authors say mean error drops by more than 11% relative (from 17.66 to 15.64). The absolute numbers of this WFLW ablation, though, are about three times those of the WFLW main table: the final model scores 17.19 on the expression subset here and 5.51 in the main table. The paper doesn't describe the setup of this experiment, so it's only good for reading relative changes.

Speed, code and reproduction

The paper's conclusion says the algorithm takes 60 milliseconds per image on a TITAN X.

The official code, wywu/LAB, is a modified Caffe that provides two WFLW models: WFLW_final, used in the paper, and WFLW_wo_mp, which drops message passing and is easier to read. In issue #25 (November 2018), a user timed them with Caffe's built-in timing tool: on a GTX TITAN X, one forward pass takes 178 milliseconds for WFLW_final and 61 milliseconds for WFLW_wo_mp; on CPU, 4.5 seconds and 0.8 seconds respectively. In these measurements, the one close to 60 milliseconds is the version without message passing; the paper doesn't say which model its 60 milliseconds refers to, and it's unclear whether the two TITAN X cards are the same generation. STAR Loss's verdict on LAB is along the same lines: "practical but computationally expensive."

The training code was never released. The README says that "For company security considerations" the training scripts can't be made public, and adds that with the released model definitions plus the data augmentation and hyperparameters described in the paper, reproducing it shouldn't be hard. The README's to-do list still has support for three datasets, AFLW, COFW and 300-W; the repo was last updated in October 2019.

The first hurdle in reproducing it is how to draw the boundaries. For the interpolation step, the paper writes a single word, "interpolated." Issue #22 (November 2018) asked which interpolation was used, reporting that lines drawn with scipy's interpolation weren't good enough; issue #39 and issue #47 ask the same thing, and none of them got a reply from a maintainer. Issue #37 asked how the ground-truth heatmaps were made, and the author's reply was "Please refer to the paper." (the paper only says interpolated)

The community's PyTorch reproductions also got stuck on 300-W. In issue #2 of FunkyKoki/Look_At_Boundary_PyTorch (April 2019), a user reported reaching only about 5.1 inter-pupil on 300-W; the author, FunkyKoki, replied that 300-W wasn't great, while WFLW came close to the original numbers. Another reproduction, Look_At_Boundary_PyTorch, says in its README that its best 300-W Fullset inter-pupil result is 5.78. That's far from the original table's 4.12, and a good deal closer to the updated 4-stack model's 4.92.

Using WFLW itself has a few pitfalls too.

  • No license stated. Neither the project page nor the repo gives license terms for the dataset; issue #56 (March 2022) asked whether it could be used commercially and got no reply. The images themselves come from WIDER FACE.
  • 98 points don't convert back to 68. In issue #17, someone asked whether 300-W's 68 points are a subset of the 98. The author replied that the two sets have no clear correspondence; they had tried picking 68 of WFLW's 98 points to train on and testing on 300-W, and it performed poorly because the point definitions differ.
  • A few annotations are wrong. Someone reported a test face whose two inner-lip points are labeled at the same position (issue #41), and another report found training images with points outside the face box (issue #55); neither got a reply.

Conclusion

LAB first estimates 13 boundary heatmaps with stacked hourglasses, message passing and a discriminator that keeps score with landmarks, then fuses the boundaries into a res-18 regressor at the input and after three stages. Given the ground-truth boundaries, the AUC on 300-W test is 0.76; LAB estimating its own boundaries gets 0.59, and JMFA, the best at the time, 0.55. In the ablations, the more accurately the boundaries are drawn, the more accurate the points; across datasets, the failure rate on COFW drops from 2.76% to 0.39%. The price is three networks trained in alternation for two thousand epochs, plus a 300-W table that was corrected only on the project page and never made it to arXiv.

When you compare against LAB or any 300-W number from around 2018, first check whether the denominator is inter-ocular or inter-pupil; the two differ by about 1.4×. For LAB's own numbers, also check how many hourglasses were stacked. To use WFLW, compute the inter-ocular distance from the official points 60 and 72, with a 10% failure threshold. If your product needs 68 points, don't just pick points out of the 98 to make up the count; the author tried it, and the results on 300-W were poor.

Lines are easier to define than points; that's the premise of the whole LAB paper. As for how to connect the points into lines, at least five threads in the issue tracker are asking.