Back to paper library
Paper notesarXiv 2020CVPR 2020

LUVLi

Believe It or Not

Original paper

LUVLi Face Alignment: Estimating Landmarks' Location, Uncertainty, and Visibility Likelihood

Paper authors

Abhinav Kumar · Tim K. Marks · Wenxuan Mou …

Show all 9 authors

Abhinav Kumar · Tim K. Marks · Wenxuan Mou · Ye Wang · Michael Jones · Anoop Cherian · Toshiaki Koike-Akino · Xiaoming Liu · Chen Feng

Publication
CVPR 2020Conference
First submitted to arXiv
arXiv:2004.02980
Cite this paper · BibTeX

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

@misc{faceanalysisluvli2020,
  title = {{LUVLi Face Alignment: Estimating Landmarks' Location, Uncertainty, and Visibility Likelihood}},
  author = {Abhinav Kumar and Tim K. Marks and Wenxuan Mou and Ye Wang and Michael Jones and Anoop Cherian and Toshiaki Koike-Akino and Xiaoming Liu and Chen Feng},
  year = {2020},
  eprint = {2004.02980},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.02980}
}
On this page

A camera inside the car points at the driver, and the system relies on facial landmarks to tell whether the eyes have closed or the head has turned away, and even to estimate heart rate from subtle changes in skin color. The driver lifts a hand to rub their eyes, and the hand covers half the face. The landmark model outputs 68 points all the same; in its output, the points under the hand look exactly like the ones that are in plain view, and the downstream system can't tell which points to trust.

This paper comes from authors at Mitsubishi Electric Research Laboratories (MERL), the University of Utah, the University of Manchester, Michigan State University and New York University, with Abhinav Kumar, Tim K. Marks and Wenxuan Mou as co-first authors. The authors have the model answer two more questions for each point. First, how uncertain is this point's position, expressed as a 2D ellipse; second, can this point be seen at all. The three things, Location, Uncertainty and Visibility, go into a single Likelihood loss, hence the name LUVLi.

The paper also released MERL-RAV, which re-annotates over nineteen thousand faces from AFLW with 68 points, marking every point as visible, blocked by something else, or hidden by the face itself because the head is turned.

Defining the Problem

The annotations themselves are noisy

Uncertainty generally comes in two kinds. Epistemic uncertainty comes from gaps in the model's knowledge and goes down with more data. Aleatoric uncertainty comes from noise in the observations themselves, such as sensor noise or annotation noise.

Annotation noise in landmarks is easy to picture. For a mouth corner covered by a hand or an eye corner in backlight, the annotator can only guess; with another annotator, or the same annotator labeling it again, the point won't land in the same place. This variation also changes from image to image and point to point, and it's larger for occluded points and badly lit faces. This aleatoric uncertainty is what LUVLi sets out to estimate.

The trouble is that each image has only one set of annotations, with no "distribution over three annotators" to learn from directly. The authors' approach is to assume a parametric distribution, say a 2D Gaussian centered at the predicted position, have the network output the distribution's parameters for each point, and then make the likelihood of the annotated position under that distribution as large as possible. Draw the distribution too small and any deviation in the annotation gets punished hard; draw it too large and the likelihood itself shrinks. The network can only settle on a reasonable size somewhere in between.

Heatmaps can't give the answer

The most accurate methods of the time were all heatmap methods, such as stacked hourglass networks and DU-Net. The network outputs a 64×6464\times64 heatmap for each point, the training target is a symmetric Gaussian of fixed size placed at the annotated position, and the fit uses MSE.

Such heatmaps look like probability distributions, but the authors point out two problems.

First, the heatmap's shape is learned from a fixed Gaussian, and the target is equally wide for every point and every face. Take its width as the uncertainty, and what you're really measuring is a setting of the training target.

Second, quantization error. At inference, the location of the heatmap's maximum (argmax) is taken, which can only land on grid points. A 256×256256\times256 input corresponds to a 64×6464\times64 heatmap, so one cell is 4 pixels; the usual remedy is to shift a quarter cell toward the second-highest neighbor.

Points you can't see

The third problem is visibility. Occluded points come in two kinds. External occlusion is when hair, a hat, a hand or a microphone gets in the way, and the annotator can usually still guess where the point is. Self-occlusion is when the head turns into profile and the far cheek is hidden by the nose and the face itself, and the annotator really can't guess it well.

Existing datasets each handle self-occlusion their own way.

  • WFLW doesn't mark which points are self-occluded and labels them on the visible edge of the face.
  • 300W-LP is synthesized by rotating 300-W faces into various poses with a 3D face model, and self-occluded points are projected straight onto the visible side, as if the face were transparent.
  • Menpo 2D uses 68 points for frontal faces and a separate set of 39 points for profiles, and the two sets don't correspond.
  • AFLW marks self-occlusion but has only 21 points and doesn't mark external occlusion; COFW is the opposite, marking only external occlusion.

For a model to learn that "this point can't be seen," you first need data with both kinds of occlusion clearly labeled.

Other approaches of the same period

Uncertainty estimation for landmarks was still rare at the time. KDN, from the same period, takes a nonparametric route, convolving the heatmap with a fixed symmetric Gaussian kernel and treating it as kernel density estimation; another work on human pose skips heatmaps and directly regresses a Gaussian's mean and precision matrix. UGLLI, published the year before by the same group of authors at an ICCV workshop, uses only a Gaussian distribution and has no visibility.

So can you keep the localization accuracy of heatmap methods while giving every point a trustworthy uncertainty ellipse and a probability of being visible?

Solving the Problem

The full architecture

Original Figure 2: across the top is a chain of U-nets (drawn as hourglasses) taking a woman's face photo as input. From the middle bottleneck of each U-net come two small blocks, VEN and CEN, and its output end feeds a heatmap block; the three merge into a red LUVLi loss. Below, one of them is enlarged: v̂ij goes straight down; Lij becomes Σij through LijLijᵀ; Hij becomes μij = (μijx, μijy)ᵀ through the Mean Estimator. A small Predictions panel at the lower right shows several blue ellipses centered at μij and a green annotated point pj, next to a face covered in yellow dots and blue ellipses. At the very bottom is the loss Lij = −(1 − vj) ln(1 − v̂ij) − vj ln(v̂ij) − vj ln(P(pj | μij, Σij)).
Original Figure 2, Kumar et al., from PDF page 3, arXiv license, scholarly quotation.

The backbone is DU-Net, 8 U-nets chained together, each outputting NpN_p heatmaps of 64×6464\times64 (NpN_p is the number of points, 68 for 300-W). The input is a 256×256256\times256 face. LUVLi adds three components to each U-net.

  • Mean estimator: computes the point's position μij\mu_{ij} (the ii-th U-net, the jj-th point) from the heatmap.
  • Cholesky estimator network (CEN): computes the 2×22\times2 covariance Σij\Sigma_{ij} from the bottleneck in the middle of the U-net.
  • Visibility estimator network (VEN): computes the probability of being visible, v^ij\hat v_{ij}, from the same bottleneck.

The bottleneck is 128×4×4128\times4\times4, flattened to 2,048 dimensions. CEN and VEN are each just one fully connected layer, with the same weights shared across all 8 U-nets, so the model barely grows.

The position is computed from the heatmap, but uncertainty and visibility are regressed directly from the bottleneck. The authors tried it both ways and concluded that the heatmap gives the more accurate position but a poor uncertainty estimate; the discussion shows why.

Position: a weighted average of the heatmap

Position first. LUVLi doesn't take the argmax; it takes the spatial mean of the heatmap instead (Eq. (16) in the appendix):

μij=∑x,yσ(Hij(x,y)) [x, y]T∑x,yσ(Hij(x,y))\mu_{ij}=\frac{\sum_{x,y}\sigma\big(H_{ij}(x,y)\big)\,[x,\ y]^T}{\sum_{x,y}\sigma\big(H_{ij}(x,y)\big)}

Hij(x,y)H_{ij}(x,y) is the heatmap's value at (x,y)(x,y), and σ\sigma is a preprocessing function. The authors compared three choices of σ\sigma, ReLU (zeroing out negatives), softmax, and softmax with a temperature, and went with ReLU.

Let's work it out on one corner of a heatmap.

A diagram drawn for this note: the 5×5 cells from x = 29 to 33 and y = 18 to 22 of a 64×64 heatmap. Seven cells near the center are positive and shaded in blue: (31,20) is 0.90, (32,20) to its right is 0.50, (31,19) and (32,19) above are 0.20 and 0.10, (31,21) and (32,21) below are 0.30 and 0.20, and (30,20) to the left is 0.10; the other cells are 0 or negative and shaded gray. Three markers sit on the grid: a black square at the very center of cell (31,20), the argmax; a purple diamond slightly below and to the right of it, the 0.25 shift to the larger side, at (31.25, 20.25); and an orange dot just right of the square and a touch lower, the ReLU spatial mean, at (31.30, 20.09). The note below the figure says the blue cells sum to 2.3, x = 72 ÷ 2.3 = 31.30 and y = 46.2 ÷ 2.3 = 20.09.
Drawn for this note from Eq. (16) and the quarter-pixel shift of Section A1 in the paper's appendix; the heatmap values are illustrative.

The largest value in this corner is the 0.90 at (31,20)(31,20), and argmax stops at this cell. The quarter-pixel remedy looks at the left and right neighbors (0.10 against 0.50) and shifts 0.25 to the right, then at the neighbors above and below (0.20 against 0.30) and shifts 0.25 down, giving (31.25,20.25)(31.25, 20.25).

The ReLU spatial mean uses every positive value. The seven blue cells sum to 2.3, and in the x direction

μx=30×0.1+31×1.4+32×0.82.3=722.3=31.30\begin{aligned} \mu_x&=\frac{30\times0.1+31\times1.4+32\times0.8}{2.3}\\ &=\frac{72}{2.3}=31.30 \end{aligned}

Here 1.4 is the sum of the three positive values in column x=31x=31 (0.2+0.9+0.30.2+0.9+0.3), and 0.8 is the sum of column x=32x=32. The y direction gives 20.09 the same way. The 0.50 on the right is much larger than the 0.10 on the left, so the mean leans 0.3 cells to the right; the cells above and below are about equal, so the mean stays almost in the middle. Back on the 256×256256\times256 input, 0.3 cells is 1.2 pixels. This computation is differentiable, comes with sub-pixel precision built in, and needs no extra shift at inference.

Why not softmax? Softmax turns every cell into a positive weight. A 64×6464\times64 heatmap has 4,096 cells, mostly background close to 0, and after softmax each one gets a weight of about e0=1e^0=1. With the heatmap above, the 25 cells around the peak take only 0.7% of the total weight, and the mean gets pulled to around the very center of the heatmap, (31.5,31.5)(31.5, 31.5). Add a temperature τ\tau, dividing the heatmap by 0.02 before the softmax, and the 0.90 cell's weight is e20e^{20} times that of the 0.50 cell, so the result falls right back to the argmax, (31,20)(31, 20). A temperature softmax can be tuned anywhere between these two extremes, at the price of one more parameter to tune.

Uncertainty: an ellipse in three numbers

A 2D covariance matrix Σ\Sigma is a symmetric, positive-definite 2×22\times2 matrix with three degrees of freedom. Having the network output three numbers is easy; the hard part is guaranteeing that the matrix they form is always positive definite.

The authors use the Cholesky decomposition. Any positive-definite matrix can be written as a lower-triangular matrix times its transpose:

L=[a0bc],Σ=LLT=[a2ababb2+c2]\begin{aligned} L&=\begin{bmatrix}a&0\\b&c\end{bmatrix},\\[6pt] \Sigma&=LL^T=\begin{bmatrix}a^2&ab\\ab&b^2+c^2\end{bmatrix} \end{aligned}

∣Σ∣=a2c2|\Sigma|=a^2c^2. As long as aa and cc are both greater than 0, Σ\Sigma is guaranteed to be positive definite. CEN outputs three numbers (a,b,c)(a, b, c) for each point, 204 numbers for 68 points; aa and cc first go through an ELU and then have a constant added. The official code writes ELU(x)+1\text{ELU}(x)+1, which is 1 at x=0x=0 and about 0.05 at x=−3x=-3, getting closer to 0 the more negative xx gets but never reaching it.

An example. Suppose the network outputs a=2a=2, b=0b=0, c=0.5c=0.5 for some contour point, giving Σ=diag(4,0.25)\Sigma=\text{diag}(4, 0.25). That's an ellipse with a standard deviation of 2 horizontally and 0.5 vertically (in heatmap pixels). When bb isn't 0, the ellipse rotates by some angle; since the matrix isn't restricted to be diagonal, the ellipse's orientation can be learned too.

Visibility

VEN is also a single fully connected layer, taking the same 2,048-dimensional bottleneck as input and outputting NpN_p numbers, which a sigmoid turns into v^ij∈(0,1)\hat v_{ij}\in(0,1), with 1 meaning visible.

The LUVLi loss

Now put the three things into one probabilistic model. For the jj-th point, the annotation has two parts, visibility vj∈{0,1}v_j\in\{0,1\} and position pjp_j. A point that can't be seen (vj=0v_j=0) has no position, written pj=∅p_j=\emptyset. A variable that's partly discrete and partly continuous like this is called a mixed random variable.

The model's predicted distribution splits along the same structure (Eqs. (1)–(4) of the paper):

q(v,z)=qv(v) qz(z∣v)qv(1)=v^ij,qv(0)=1−v^ijqz(z∣v=1)=P(z∣μij,Σij)\begin{aligned} q(v,z)&=q_v(v)\,q_z(z\mid v)\\ q_v(1)&=\hat v_{ij},\quad q_v(0)=1-\hat v_{ij}\\ q_z(z\mid v=1)&=\mathcal P(z\mid\mu_{ij},\Sigma_{ij}) \end{aligned}

First decide whether the point can be seen; if it can, its position follows a distribution P\mathcal P centered at μij\mu_{ij} with covariance Σij\Sigma_{ij}. The loss is the negative log-likelihood of the annotation under this distribution (Eq. (5) of the paper):

Lij=−ln⁡q(vj,pj)=−(1−vj)ln⁡(1−v^ij)−vjln⁡v^ij−vjln⁡P(pj∣μij,Σij)\begin{aligned} \mathcal L_{ij}&=-\ln q(v_j,p_j)\\ &=-(1-v_j)\ln(1-\hat v_{ij})-v_j\ln\hat v_{ij}\\ &\quad-v_j\ln\mathcal P(p_j\mid\mu_{ij},\Sigma_{ij}) \end{aligned}

The first two terms are the binary cross-entropy for visibility. For a visible point (vj=1v_j=1), if the model says v^=0.9\hat v=0.9, the loss is −ln⁡0.9=0.11-\ln0.9=0.11; for a point that can't be seen (vj=0v_j=0), if the model still says 0.9, the loss is −ln⁡0.1=2.30-\ln0.1=2.30. The last term counts only for visible points, and it's the regression loss for position.

Minimizing this loss is maximum likelihood estimation. The paper also writes out its relation to the KL divergence (Eqs. (6)–(9)). Taking the expectation over the data distribution, the negative log-likelihood equals "the KL divergence from the true distribution to the predicted one" plus the entropy of the true distribution; the entropy doesn't depend on the model, so minimizing the loss means pulling the predicted distribution toward the distribution of the annotations, for visibility and for position separately.

Gaussian or Laplace

P\mathcal P has to be some specific distribution. Start with the 2D Gaussian (Eqs. (10) and (11) of the paper). Plugged into the last term of Eq. (5), after dropping constants, two terms remain, T1+T2T_1+T_2:

T1=12log⁡∣Σij∣T2=12(pj−μij)TΣij−1(pj−μij)\begin{aligned} T_1&=\tfrac12\log|\Sigma_{ij}|\\ T_2&=\tfrac12(p_j-\mu_{ij})^T\Sigma_{ij}^{-1}(p_j-\mu_{ij}) \end{aligned}

T2T_2 is the squared Mahalanobis distance, which measures the error using the shape of Σ\Sigma. T1T_1 is a regularizer; without it, the network would just blow Σ\Sigma up to infinity and drive T2T_2 to 0.

In one dimension, the Laplace distribution has a density proportional to e−∣x∣/be^{-|x|/b}; its peak is sharper than a Gaussian's and its tails are heavier, so errors far from the center still have a fair amount of probability. The 2D version (Eq. (12) of the paper) has the density

P(z∣μ,Σ)=exp⁡ ⁣(−3(z−μ)TΣ−1(z−μ))2π3∣Σ∣\begin{aligned} &P(z\mid\mu,\Sigma)\\ &\quad=\frac{\exp\!\Big(-\sqrt{3(z-\mu)^T\Sigma^{-1}(z-\mu)}\Big)}{\frac{2\pi}{3}\sqrt{|\Sigma|}} \end{aligned}

The 3 is there so that Σ\Sigma is exactly this distribution's covariance. Plugging it in gives (Eq. (13) of the paper)

T1=12log⁡∣Σij∣T2=3 (pj−μij)TΣij−1(pj−μij)\begin{aligned} T_1&=\tfrac12\log|\Sigma_{ij}|\\ T_2&=\sqrt{3\,(p_j-\mu_{ij})^T\Sigma_{ij}^{-1}(p_j-\mu_{ij})} \end{aligned}

The two share the same T1T_1; their T2T_2 is the squared Mahalanobis distance in one case and the Mahalanobis distance itself in the other. If Σ\Sigma is fixed to the identity and all points are visible, the Gaussian version reduces to the squared ℓ2 distance, that is, MSE on the coordinates, and the Laplace version reduces to the ℓ2 distance.

Take the contour point from before, with Σ=diag(4,0.25)\Sigma=\text{diag}(4, 0.25), and compute two errors that are both 2 heatmap pixels long.

A diagram drawn for this note: a stretch of gray cheek contour runs horizontally through the predicted position μ. A solid blue ellipse centered at μ, with a horizontal semi-axis of 2 and a vertical semi-axis of 0.5, is stretched along the contour; a dashed gray circle is the unit circle of radius 1. An orange arrow goes right from μ to point A (2, 0), landing exactly on the blue ellipse; a green arrow goes up from μ to point B (0, 2), far outside the ellipse. Text on the right reads Σ = diag(4, 0.25), SD 2 along the contour and 0.5 across; A: (2, 0), Mahalanobis distance 1; B: (0, 2), Mahalanobis distance 4; Laplace T₂ = √3 × Mahalanobis distance, so A gets 1.73 and B gets 6.93; if Σ = I, A and B both get 3.46. A note at the lower left says |Σ| = 1, so T₁ is 0 for both Σ.
Drawn for this note, computed from equations (11) and (13) of the paper.

A is off by 2 cells along the contour, d=(2,0)d=(2,0); B is off by 2 cells perpendicular to the contour, d=(0,2)d=(0,2). Σ−1=diag(1/4,4)\Sigma^{-1}=\text{diag}(1/4, 4), so

dATΣ−1dA=4×14=1dBTΣ−1dB=4×4=16\begin{aligned} d_A^T\Sigma^{-1}d_A&=4\times\tfrac14=1\\ d_B^T\Sigma^{-1}d_B&=4\times4=16 \end{aligned}

The Mahalanobis distances are 1 and 4. The Laplace T2T_2 is 3×1=1.73\sqrt3\times1=1.73 and 3×4=6.93\sqrt3\times4=6.93, and the Gaussian T2T_2 is 0.50.5 and 88. For the same 2-cell error, going off perpendicular to the contour costs 4 times as much as going off along it (16 times under the Gaussian). If Σ\Sigma were the identity, A and B would both have a Laplace T2T_2 of 23=3.462\sqrt3=3.46, and the direction wouldn't register at all.

That's exactly how contour points behave. Along the contour the position is inherently hard to pin down, while perpendicular to it everything is clear; a model that learns a long, thin ellipse goes easy on errors along the contour and is strict about errors perpendicular to it.

How big Σ\Sigma should be is settled by a tug-of-war between T1T_1 and T2T_2. Suppose Σ=s2I\Sigma=s^2I is a circle and the error has length rr. The Laplace loss is 2ln⁡s+3 r/s2\ln s+\sqrt3\,r/s; differentiate with respect to ss and set it to 0:

2s−3 rs2=0⇒s∗=32r\frac{2}{s}-\frac{\sqrt3\,r}{s^2}=0\quad\Rightarrow\quad s^\ast=\frac{\sqrt3}{2}r

For an error of 2 cells, the best ss is about 1.73 cells; the same derivation for the Gaussian gives s∗=r/2≈1.41s^\ast=r/\sqrt2\approx1.41 cells. If, for this kind of face and this kind of point, the network's predictions are often far off, it learns a large ss; if they're often accurate, it learns a small ss. Each image has only one annotation, yet what the network learns is the statistical size of the error in similar situations.

The two distributions also differ in their gradients with respect to position. With Σ=s2I\Sigma=s^2I, the gradient of the Gaussian T2T_2 with respect to μ\mu has length r/s2r/s^2, pushing harder the larger the error; the Laplace gradient has a fixed length of 3/s\sqrt3/s regardless of the error's size, so a single mislabeled outlier can't drag the whole model off. The authors went with the Laplace in the end, and the ablations back that choice.

Total loss and training

Each U-net computes a loss averaged over all points, and the 8 U-nets are summed with weights (Eq. (14) of the paper):

L=∑i=1KλiLi,Li=1Np∑j=1NpLij\mathcal L=\sum_{i=1}^{K}\lambda_i\mathcal L_i,\qquad \mathcal L_i=\frac{1}{N_p}\sum_{j=1}^{N_p}\mathcal L_{ij}

K=8K=8, and all λi=1\lambda_i=1. At test time, only the last U-net's position and covariance are used.

Training has two stages. First, the original DU-Net is trained with proxy Gaussian heatmaps and MSE (or the DU-Net authors' pretrained model is loaded directly); then the loss is switched to LUVLi for 50 epochs of fine-tuning, the first 20 at a learning rate of 10−410^{-4} and the last 30 at 2×10−52\times10^{-5}. The optimizer is RMSprop, with batch 24. Data augmentation is scaling, rotation by ±50°, color jitter and random occlusion; 300-W Split 1 follows DU-Net's settings, with rotation by ±30° and no occlusion. Each face is cropped to 256×256256\times256 using the detection box the dataset provides.

At inference, one face takes 17 milliseconds on a 12 GB GTX Titan-X.

MERL-RAV

Last comes the dataset. MERL-RAV (MERL Reannotation of AFLW with Visibility) re-annotates 19,314 faces in AFLW with the 68-point scheme of 300-W, sorting every point into one of three classes.

  • Unoccluded: visible, with its position labeled.
  • Externally occluded: blocked by hair, a hat, a hand, a microphone or goggles, with its estimated position labeled.
  • Self-occluded: hidden by the face itself, with no position labeled.

In the model, unoccluded and externally occluded points both count as visible (vj=1v_j=1), and only self-occluded points count as invisible (vj=0v_j=0). The authors' reasoning is that annotators guess externally occluded points fairly accurately but self-occluded points very poorly, so self-occluded points simply get no position.

AFLW's head poses span a yaw of ±120° and a pitch of ±90°. The authors sort the faces into five classes by yaw and split training and testing 4:1:

PoseTrainTest
Frontal8,7782,195
Half-profile (L+R)2,401601
Profile (L+R)4,2701,069
Total15,4493,865

Compiled from Table 2 of the paper, with left and right sides combined.

Unlike Menpo, which separates frontal and profile faces with a single cut, MERL-RAV runs continuously from frontal to profile: the further the head turns, the more points are labeled self-occluded. The annotation files encode the class in the sign of the coordinates: unoccluded is (x,y)(x,y), externally occluded is written as (−x,−y)(-x,-y), and self-occluded is (−1,−1)(-1,-1). The dataset releases only annotations; the images have to be requested separately from AFLW's maintainers (Graz University of Technology) and matched up with the official scripts.

Discussion

Localization first

First, the metrics. NME is the mean error of the points divided by a normalizing length. LUVLi follows each dataset's own convention: 300-W Split 1 and WFLW use the distance between the two outer eye corners; 300-W Split 2, Menpo and COFW-68 use the geometric mean of the face box's width and height, w⋅h\sqrt{w\cdot h} (written NME_box). The other two metrics come from the CED curve, whose horizontal axis is an NME threshold and vertical axis the fraction of images with error no larger than it; the AUC is the area under this curve from 0 to the threshold, divided by the threshold, between 0 and 1, computed up to 7% in the NME_box tables and up to 10% on WFLW. The failure rate (FR) is the fraction of images with NME above the threshold. The box is much larger than the inter-ocular distance, so NME_box numbers look much smaller, and the two can't be mixed.

300-W has two splits. Split 1 uses 3,148 images for training and 689 for testing, divided into common, challenge and full; Split 2 uses 3,837 for training and 600 for testing.

Split 1, inter-ocular normalization:

MethodCommonChallengeFull
LAB2.985.193.49
DU-Net2.975.533.47
HR-Net2.875.153.32
HG-HSLE2.855.033.28
AWing2.724.523.07
LUVLi2.765.163.23

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

LUVLi is second on Common and Full but only fourth on Challenge, where AWing is the best. This LUVLi was fine-tuned from DU-Net's public pretrained model, and against DU-Net's 3.47 in the same table, Full drops to 3.23.

Split 2 uses NME_box and adds cross-dataset tests on Menpo's 6,679 near-frontal faces and COFW-68's 507 test faces. Methods marked with an asterisk were first pretrained on 300W-LP-2D:

Method300-WMenpoCOFW-68
2D-FAN*2.322.162.95
KDN*2.212.012.73
LUVLi2.242.182.75
LUVLi*2.102.042.57

Compiled from Table 4 of the paper, NME_box, in %.

With pretraining, LUVLi* is best in five of the six cells (three datasets, NME and AUC); its only loss is Menpo's NME, 2.04 against KDN*'s 2.01. COFW-68 consists entirely of faces occluded by objects, and LUVLi*'s 2.57 is 0.16 below KDN*'s 2.73, with AUC rising from 60.1 to 63.4.

AFLW-19 (20,000 training and 4,386 test images, normalized by the box diagonal): LUVLi scores 1.39 against 1.57 for the previous best, HR-Net; on the frontal subset, 1.19 against 1.46.

WFLW, inter-ocular normalization, with both AUC and failure rate at a 10% threshold:

MethodNME (%)AUCFR (%)
LAB5.270.5327.56
Wing5.110.5546.00
DeCaFa4.620.5634.84
AVS4.390.5914.08
AWing4.360.5722.84
LUVLi4.370.5773.12

Compiled from Table 7 of the paper.

Second on all three. NME is just 0.01 behind AWing, and the failure rate 0.28 percentage points behind; on the 326 large-pose faces, LUVLi scores 7.56 and AWing 7.38. The authors stress that the other methods give only positions, while LUVLi gives uncertainty along with them.

MERL-RAV: against the same DU-Net backbone, NME_box drops from 1.99 to 1.61. Broken down by pose, there's an oddity: profile faces score 1.25, lower than frontal faces at 1.74. The cause is the denominator. NME averages over 68 points, and self-occluded points have no error to compute yet still count toward the number of points; profile faces have more self-occluded points, so their mean error gets diluted. With the appendix's NME_vis, which divides only by the number of visible points, profile faces come to 2.03, higher than frontal faces at 1.75, which is what intuition says.

How accurate is the uncertainty

Each image has only one annotation, so checking whether the predicted ellipses are accurate means looking at many points together. The authors' first method is binning.

Original Figure 4: three scatter plots. (a) The horizontal axis is the predicted Σxx (×10⁻⁴) and the vertical axis the mean squared residual Σxx (×10⁻⁴); the points line up along the diagonal, with a correlation coefficient of 0.99. (b) The same for Σyy, with a correlation of 0.98 and a few points more scattered at the upper right. (c) Σxy, with points on both the positive and negative sides lining up almost in a straight line, correlation 0.99.
Original Figure 4, Kumar et al., from PDF page 7, arXiv license, scholarly quotation.

Take (a) as an example. All points of all images in the 300-W Split 2 test set are sorted by their predicted x-direction variance Σxx\Sigma_{xx} and grouped into bins of 734 points. Each bin yields two numbers: on the horizontal axis, the average predicted Σxx\Sigma_{xx} of those 734 points, and on the vertical axis, the average of their actual squared errors in the x direction. If the predictions are accurate, the points should fall on the diagonal. The correlation coefficients of the three plots are 0.99, 0.98 and 0.99.

The authors themselves add one more line. With the points per bin cut from 734 to 36, the correlation coefficients drop to 0.84, 0.80 and 0.72. Averaged over hundreds of points it's very accurate; a single point's ellipse still has room to improve.

The second method is "whitening." If the model says annotation pjp_j follows a Laplace distribution centered at μ\mu with covariance Σ\Sigma, then multiply the error by Σ−1/2\Sigma^{-1/2} (Eq. (18) in the appendix):

pj′=ΣKj−1/2 (pj−μKj)p'_j=\Sigma_{Kj}^{-1/2}\,(p_j-\mu_{Kj})

pj′p'_j should then follow a standard 2D Laplace distribution, independent of the point's predicted position and ellipse. With the contour point from before, Σ−1/2=diag(0.5,2)\Sigma^{-1/2}=\text{diag}(0.5, 2), so A, off by 2 cells along the contour, becomes (1,0)(1, 0), and B, off by 2 cells perpendicular to it, becomes (0,4)(0, 4). Once each point has been "rounded out" by its own ellipse, all the test points can go on one plot and be compared against a single standard curve.

Original appendix Figure 7: a large cloud of orange points concentrated around the origin, mostly within ±3, with a few scattered out to ±9. Printed at the upper left is D_KL(Normal, Obtained) = 55.82. Above and to the right are marginal distribution plots, where the orange fill is the histogram of the actual points and the black line is the curve of the standard distribution; in both, the orange peak is a little lower than the black line and slightly wider on both sides.
Original appendix Figure 7, Kumar et al., from PDF page 13, arXiv license, scholarly quotation.

The authors call it an "excellent match" and print a KL divergence of 55.82 on the plot. The paper gives this number no reference point, such as the value for a Gaussian version of the model or for other methods, so 55.82 on its own is hard to judge. The marginals show the actual peak a bit lower than the standard Laplace and the sides slightly wider; read that way, the ellipses the model draws are, on the whole, slightly too small.

The third check is the most convincing. The 300-W dataset paper once had three annotators label the same set of Multi-PIE frontal faces (80 people) and drew, for each point, the covariance ellipse of the three annotations. The authors averaged the ellipses LUVLi predicts on 812 Multi-PIE frontal faces and set them side by side.

Original appendix Figure 8: two face line drawings side by side, with all 68 points drawn as small blue ellipses. The left one shows the variation among three annotators, the right one the average uncertainty predicted by LUVLi. The ellipses around the eyes, nose and mouth are small; those on the chin and cheek contour are clearly elongated, with their long axes running along the contour, and the two drawings look very much alike.
Original appendix Figure 8, Kumar et al., from PDF page 14, arXiv license, scholarly quotation.

People on the left, the model on the right. The ellipses at the eyes, nose and mouth are small; those on the contour are all elongated, and they run along the contour. The model only ever saw one annotation per face, yet the shape of the uncertainty it learned closely resembles the actual disagreement among three annotators. The earlier example, lenient along the contour and strict perpendicular to it, is in this figure the shape of every contour point.

Why not compute it from the heatmap

If the heatmap already looks like a distribution, why not take its shape as Σ\Sigma directly? The authors say they tried several ways, and none matched regressing it directly with CEN. The reason is that the heatmap is too coarse. The authors collected, for every point in 300-W Split 2, the standard deviation along the narrowest direction of the predicted ellipse; the distribution peaks at about 0.4 heatmap pixels, and most points are under 1 pixel. A distribution narrower than a grid cell can't be drawn on a 64×6464\times64 grid.

Occluded points get bigger ellipses

The COFW-68 test set marks which points are occluded by objects. LUVLi never used this information in training; at test time the two kinds of points are tallied separately, using ∣Σ∣1/2|\Sigma|^{1/2} as the size of a point's uncertainty:

MethodPointsNME∣Σ∣1/2\lvert\Sigma\rvert^{1/2}
KDNUnoccluded2.341.63
KDNExt. occluded4.0311.62
LUVLiUnoccluded2.159.31
LUVLiExt. occluded4.0032.49

Compiled from Table 5 of the paper, NME as NME_box (%).

For occluded points, LUVLi's uncertainty is 3.5 times that of unoccluded points, and the error is indeed nearly twice as large. KDN's ratio is 7.1; the two methods define and scale ∣Σ∣|\Sigma| differently, so each can only be compared between its own occluded and unoccluded points.

MERL-RAV shows the same trend. ∣Σ∣1/2|\Sigma|^{1/2} is 9.28 for unoccluded points and 34.41 for externally occluded ones, with NME_box of 1.60 and 3.53 respectively. As for visibility, the average v^\hat v of self-occluded points is 0.13, and with a 0.5 threshold, 88% are judged correctly; for unoccluded and externally occluded points the average v^\hat v is 0.98 in both cases, with 99% judged correctly.

The appendix has one more useful result. Sort the test data by predicted uncertainty from low to high and keep only the more certain half, and the average NME is about 1.26; counting everything, it's 2.10. Points with high uncertainty really do have larger errors, and a downstream system can use that to decide which points not to trust.

Ablations

All ablations use the setting of pretraining on 300W-LP-2D and fine-tuning on 300-W Split 2; the best model scores 2.10 on 300-W and 2.04 on Menpo (NME_box).

  • How position is computed matters most. Regressing coordinates directly from the bottleneck gives an NME of 4.32, doubling the error; swapping ReLU for softmax gives 2.37; a temperature softmax gives 2.10, tied with ReLU but with one more temperature to tune.
  • The loss matters less. Going back to MSE gives 2.25; swapping the Laplace for a Gaussian gives 2.13. The negative log-likelihood on the test set is 0.51 for the Laplace and 0.66 for the Gaussian, so the Laplace explains the annotations better.
  • The visibility term does almost nothing on 300-W; with it removed, NME is still 2.10. 300-W has no profile faces and every point is visible, so there's nothing for visibility to learn.
  • Supervising only the last U-net makes NME worse, at 2.32.
  • Initialization: starting directly from a 300-W heatmap model without 300W-LP-2D pretraining gives 2.24, and training entirely from scratch gives 2.32.
  • Cutting the 8 U-nets down to 4 gives an NME of 2.14, with inference about twice as fast.

Compiled from Table 10 of the paper and Table 11 of the paper's appendix.

Code, data and what came after

The release of LUVLi's code took a long way around. In September 2020, Abhinav Kumar replied in MERL-RAV's issue #1 that the code was still waiting for MERL's approval. On January 4, 2021, Abhinav Kumar put the code on their own GitHub, and that same day, in that same thread, a reply appeared asking for it to be taken down, because MERL could only release it from its own website. Three weeks later (January 25), Abhinav Kumar explained in another thread (issue #2) that MERL had written to say that rehosting violated MERL's policy, and that the files had been deleted. From then on, getting the code meant filling in a form on MERL's website to download it. In June 2024, the code finally went up at merlresearch/LUVLi, under the AGPL-3.0 license.

Getting the code still leaves a few hurdles.

  • Python 2.7. The DU-Net backbone is implemented in Python 2.7, and so is LUVLi; in 2022 someone asked whether there was a Python 3 version, and the answer was no.
  • Your own photos take a detour. The official scripts were written for evaluating each dataset. To run your own photos, you first prepare face boxes, make a fake .pts annotation file for each image with the box's two corners as the first two points, and edit the config to generate a JSON, and only then can they go into the model (issue #3, April 2022). In July 2024, someone asked in issue #1 of merlresearch/LUVLi for complete inference code and support for newer PyTorch versions, and got no reply.
  • Only one model can say "can't see it." Models trained on 300-W, WFLW and AFLW-19 treat every point as visible, so their visibility output means nothing; only the model trained on MERL-RAV judges self-occlusion. The user in that same issue started out with the wrong model, a WFLW model with the same file name.
  • How invisible points enter the loss. The official training code doesn't take the vj=0v_j=0 points out of the position loss; instead it multiplies both their annotated and predicted coordinates by 10−510^{-5}, so their error goes to 0. The T1T_1 term is still computed as usual, so the Σ\Sigma of self-occluded points gets pushed down to its minimum. The paper doesn't report the uncertainty of self-occluded points either.

The paper uses safety-critical applications like driver monitoring as its motivation; the official 2024 release still requires setting up a Python 2.7 environment first, and Python 2.7 reached end of life in January 2020.

Three years later, STAR Loss also started from "contour points are hard to pin down along the boundary," but took the very road LUVLi had tried and found not accurate enough: estimating the covariance directly from the heatmap. STAR uses it to find each point's principal directions for decomposing the error, not as calibrated uncertainty. The STAR paper ran one comparison: in STAR's own setting, replacing its loss with the Mahalanobis distance gives a WFLW NME of 4.32, against STAR's 4.17.

Conclusion

On WFLW, LUVLi's NME is just 0.01 behind AWing, and what it hands over on top is an uncertainty ellipse and a visibility for every point. The three things are written as one mixed random variable and trained in one go with a negative log-likelihood; position is the spatial mean of the ReLU heatmap, uncertainty is regressed directly as Cholesky coefficients, and visibility comes from a single sigmoid layer. It's the best in the table on 300-W Split 2 and AFLW-19, and second on Split 1's Common and Full; after binning, the predicted ellipses correlate with the actual errors at 0.98 and above, and their shapes at the contour points match the disagreement among human annotators. Calibration for individual points isn't quite there yet: with only 36 points per bin, the correlation drops to between 0.72 and 0.84.

If you want to use it in a product, first be clear about which output you need. If it's only uncertainty, models trained on any dataset provide it, and the size of the ellipse can decide which points to hold off on trusting; if you need visibility, the only option is the model trained on MERL-RAV, because the other datasets have no self-occlusion annotations at all. If you rewrite the loss yourself, remember to add a small constant to the determinant, or the moment a prediction is spot on, log⁡∣Σ∣\log|\Sigma| heads straight for negative infinity.

LUVLi has the model report how unsure it is about each point; and for the self-occluded points, the ones annotators are least sure about, MERL-RAV simply doesn't label a position.