Back to paper library
Paper notesarXiv 2015CVPR 2016

3DDFA

Profiling

Original paper

Face Alignment Across Large Poses: A 3D Solution

Paper authors

Xiangyu Zhu · Zhen Lei · Xiaoming Liu · Hailin Shi · Stan Z. Li

Publication
CVPR 2016Conference
First submitted to arXiv
arXiv:1511.07212
Cite this paper · BibTeX

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

@misc{faceanalysis3ddfa2015,
  title = {{Face Alignment Across Large Poses: A 3D Solution}},
  author = {Xiangyu Zhu and Zhen Lei and Xiaoming Liu and Hailin Shi and Stan Z. Li},
  year = {2015},
  eprint = {1511.07212},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1511.07212}
}
On this page

Take a photo of someone with their head turned 70° and ask an annotator to mark 68 landmarks by the 300-W rules.

The 68-point layout puts 17 points on the jaw contour, 10 on the eyebrows, 9 on the nose, 12 on the eyes and 20 on the mouth. On a frontal face every point is visible; at 70°, the jaw contour, eye corner and mouth corner on the far side have all gone behind the cheek. The annotator is left with two options, marking the points on the visible silhouette or imagining where they are behind the cheek. The first makes the same numbered point refer to different anatomical spots at different poses, and nobody can guess the second accurately.

The datasets of the time each picked one option. 300-W mostly contains faces within ±45° of yaw, so the problem is avoided; AFLW has faces turned up to 90°, but labels at most 21 visible points per face and simply skips the invisible ones. As a result, there was no large-pose dataset you could use to train a 68-point model.

Xiangyu Zhu, Stan Z. Li and colleagues at the Institute of Automation, Chinese Academy of Sciences (one of the authors is from Michigan State University) asked the question differently. Rather than make the model guess where the invisible points are, have it estimate a 3D face and project the whole face back onto the image. Points that are hidden still exist on the 3D model, and after projection they naturally have positions.

This route has three hurdles. How do you represent a 3D face with a set of numbers? How does a CNN correct those numbers step by step? And with no large-pose annotated data, what do you train on?

Defining the Problem

68-point models break on profiles

Traditional landmark methods carry an implicit assumption that every point can be found from the appearance around it. Cascaded regression is built on this assumption. It starts from a mean face shape, extracts features around each current point, regresses a correction to the shape, and closes in level by level. SDM, ESR and LBF all belong to this family.

Profiles break this assumption in two places. The first is modeling. Half the face is self-occluded, and those points have no image data to extract features from. At medium poses, landmark marching can patch this up by letting contour points slide along the silhouette; at large poses, even the silhouette is no longer on the original jawline. The second is fitting. From frontal to profile, the face's appearance changes so drastically that a single linear cascaded regressor struggles to cover all of it.

The existing large-pose solution was the multi-view framework. Each view gets its own point layout and model, as in TSPM and CDM, and at test time every view is tried and the highest score wins. The cost is computation that multiplies with the number of views.

3D models are too slow, and labels too few

The other route is the 3D morphable model (3DMM). It represents a face as a mean 3D face plus a linear combination of a few sets of principal components, and in principle can be posed any way you like. But traditional 3DMM fitting goes by analysis-by-synthesis, rendering, comparing and adjusting parameters over and over, and takes around a minute per image. The faster regression-based fitting goes back to regressing the parameters from features at landmark positions, and when points are hidden there's nothing to extract there either.

Finally there's data. Large-pose faces have no good initial shape, so annotators have to start from scratch, and hidden points can only be guessed. AFW, LFPW, HELEN and IBUG are all medium-pose datasets.

Solving the Problem

One face, 234 numbers

3DDFA uses a 3DMM, equations (1) and (2) in the paper:

S=Sˉ+Aid αid+Aexp αexpV(p)=f⋅Pr⋅R⋅S+t2d\begin{aligned} S &= \bar S + A_{id}\,\alpha_{id} + A_{exp}\,\alpha_{exp}\\ V(p) &= f\cdot Pr\cdot R\cdot S + t_{2d} \end{aligned}

SS is a 3D face, which is to say a long list of vertex coordinates. Sˉ\bar S is the mean face. AidA_{id} holds the principal components of identity, taken from the Basel Face Model (BFM) and computed from 3D scans with neutral expressions; AexpA_{exp} holds the principal components of expression, taken from FaceWarehouse and computed from the offsets between expression scans and neutral scans. αid\alpha_{id} and αexp\alpha_{exp} are the corresponding coefficients.

The second line is a weak perspective projection. RR is the rotation matrix built from the three angles pitch, yaw and roll, Pr=(100010)Pr=\begin{pmatrix}1&0&0\\0&1&0\end{pmatrix} simply drops the zz coordinate, ff is the scale and t2dt_{2d} the translation. Weak perspective means the whole face shares one scale factor, without nearer parts appearing larger and farther parts smaller.

All the parameters together, p=[f, pitch, yaw, roll, t2d, αid, αexp]p=[f,\ pitch,\ yaw,\ roll,\ t_{2d},\ \alpha_{id},\ \alpha_{exp}], come to 234 dimensions: 6 pose parameters, 199 identity coefficients and 29 expression coefficients. These 234 numbers are what the network has to regress.

Follow a single vertex through and you can see how invisible points get their positions. With the center of the head as the origin, xx pointing right and zz pointing toward the camera, take a vertex near the left corner of the jaw, a=(−60, y, 0)a=(-60,\ y,\ 0), in millimeters (the numbers are this note's example). Following the supplementary material, a rotation by yaw ψ\psi alone gives

x′=xcos⁡ψ−zsin⁡ψz′=xsin⁡ψ+zcos⁡ψ\begin{aligned} x' &= x\cos\psi - z\sin\psi\\ z' &= x\sin\psi + z\cos\psi \end{aligned}

At ψ=60∘\psi=60^\circ, x′=−60×0.5=−30x'=-60\times0.5=-30 and z′=−60×0.866=−52z'=-60\times0.866=-52. PrPr drops z′z', and the point projects to x′=−30x'=-30, roughly the middle of the cheek. Its z′z' is −52-52, much farther from the camera than the cheek surface at the same position, so it's hidden. Multiply by ff and add t2dt_{2d}, and you have its pixel coordinates in the image.

The 68 landmarks are just 68 fixed-index vertices on the 3D model. Visible or not, they all have projected positions, and the same index always points to the same anatomical spot. That settles exactly the annotator's dilemma from the beginning. As for which points are visible, compare their z′z'.

The cascade: each level fixes a little

Getting all 234 parameters right in one shot is hard, so 3DDFA keeps the cascade approach, equation (3) in the paper:

Δpk=Netk(I, PNCC(pk)),pk+1=pk+Δpk\begin{aligned} \Delta p^k &= Net^k\big(I,\ \mathrm{PNCC}(p^k)\big),\\ p^{k+1} &= p^k+\Delta p^k \end{aligned}

The level-kk network NetkNet^k looks at two things, the input image II and a feature map called PNCC drawn from the current parameters pkp^k, and outputs a parameter correction Δpk\Delta p^k. Every level is a network with the same structure, trained separately. Three levels run at test time.

The problem is the second input. A CNN takes images, so how do you tell it "the 3D face estimated so far" in the form of an image?

PNCC: painting the current 3D face as a color image

The authors first set three conditions for this input.

  1. Feedback: the input has to depend on the previous level's output, or the cascade can't chain together.
  2. Convergence: the input has to reflect how good the current fit is, so that when the estimate is right the network outputs a correction close to zero.
  3. Convolvable: convolution on this map has to mean something.

The first step is NCC (Normalized Coordinate Code), equation (4) in the paper. Each vertex of the mean face Sˉ\bar S is normalized to 0 to 1 separately along the xx, yy and zz axes:

NCCd=Sˉd−min⁡(Sˉd)max⁡(Sˉd)−min⁡(Sˉd),d=x,y,z\begin{aligned} \mathrm{NCC}_d&=\frac{\bar S_d-\min(\bar S_d)}{\max(\bar S_d)-\min(\bar S_d)},\\ d&=x,y,z \end{aligned}

Every vertex thus gets a unique triple of numbers, which can be used directly as an RGB color. The nose tip sits right in the middle left to right, so its xx component is about 0.5; it's the point of the face nearest the camera, so its zz component is 1 and its blue is the most saturated. The leftmost contour points have an xx component close to 0, so their red is the faintest. The whole mean face is painted in one continuous color gradient.

The second step is PNCC, equation (5) in the paper:

PNCC=Z-Buffer(V3d(p), NCC)V3d(p)=f⋅R⋅S+[t2d, 0]T\begin{aligned} \mathrm{PNCC}&=\text{Z-Buffer}\big(V_{3d}(p),\ \mathrm{NCC}\big)\\ V_{3d}(p)&=f\cdot R\cdot S+[t_{2d},\,0]^T \end{aligned}

Pose the 3D face with the current parameters pp, use NCC as its colors, and render it into an image with a Z-buffer. A Z-buffer keeps only the surface nearest the camera at each pixel, so hidden vertices simply don't appear in the picture.

Every pixel of PNCC answers the same question. Which vertex of the mean face does the current estimate think this spot corresponds to? The color is the answer. If the estimate is accurate, the nose-tip blue sits right on top of the real nose tip in the image; if it's off, the two are misaligned. The CNN looks at the image and PNCC stacked together and learns how to bring the two layers into line.

The three conditions line up one by one. PNCC is drawn from the previous level's output pp, which satisfies feedback; it marks where the visible vertices fall on the image plane, so the cascade converges once they're aligned; and NCC is smooth over the face, so a convolution is a linear combination of the vertex codes in a small region, which satisfies convolvability.

Original Figure 2: at the top left is a colored PNCC, a profile-shaped face painted in a gradient from pink, purple and blue to orange-yellow, with an arrow labeled p^k above it; below it is a photo of a young man's face. The two are stacked into a 100×100×6 input. Next come Convolution 4x4 plus Max-pooling 2x2 giving 49×49×16, the same again giving 23×23×32, Local 3x3 plus Max-pooling giving 11×11×48, and Local 3x3 giving 9×9×64, followed by two Fully Connect layers of 256 and 234 dimensions that output Δp^k.
Original Figure 2, Zhu et al., from PDF page 4, arXiv license, scholarly quotation.

This figure draws the whole network for one level. Let's follow the sizes from the left.

The input is a 100×100100\times100 image plus a PNCC of the same size, 6 channels in all. The first 4×44\times4 convolution uses no padding, 100−3=97100-3=97, and 2×22\times2 pooling (rounding up) gives 49×49×1649\times49\times16. The second layer is the same, 49−3=4649-3=46, and after pooling 23×23×3223\times23\times32.

The last two layers are labeled Local in the figure. They are locally connected layers, 3×33\times3 like a convolution, except that the weights aren't shared across space; every position has its own set of filters. The authors' reason is to extract "position-sensitive" features. 23−2=2123-2=21, and after pooling 11×11×4811\times11\times48; 11−2=911-2=9, giving 9×9×649\times9\times64. Two fully connected layers finish it off, 256 dimensions and then the 234-dimensional correction.

The cost of not sharing weights can be worked out. The first Local layer has a 3×3×32×483\times3\times32\times48 set of weights at each of 21×2121\times21 positions, about 6.1 million in total; the second Local layer has about 2.24 million. The whole network has about 9.7 million weights, and the two Local layers account for 8.3 million of them (estimated from the sizes in Figure 2, excluding biases). Putting them on the two smallest feature maps is what keeps the parameter count in check.

As for speed, one level takes 25.24 milliseconds, of which rendering PNCC takes 17.49 milliseconds (on a 3.40 GHz CPU) and the CNN itself only 7.75 milliseconds (on a GTX TITAN Black). Three levels come to about 76 milliseconds. The authors also mention that moving the Z-buffer to the GPU could cut this a lot.

234 parameters, each of different importance

The network outputs parameters, so how should the loss be written? Let the error between the predicted parameters and the ground truth be e=(p0+Δp)−pge=(p^0+\Delta p)-p^g, where p0p^0 is this level's starting point and pgp^g the ground truth. Before training, each parameter dimension is z-score normalized, because the dimensions' value ranges differ enormously.

The most direct choice is the parameter distance cost (PDC), equation (6) in the paper:

Epdc=∥e∥2E_{pdc}=\|e\|^2

Its problem is that it treats every dimension the same. For the same error of 0.5 standard deviations, getting yaw wrong turns the whole face askew, while getting the 150th identity coefficient wrong changes the face shape only a tiny bit. PDC penalizes the two equally.

The second choice is the vertex distance cost (VDC), equation (7) in the paper, which compares the reconstructed faces directly:

Evdc=∥V(pg+e)−V(pg)∥2E_{vdc}=\|V(p^g+e)-V(p^g)\|^2

It accounts for each parameter's real effect, but brings a different problem. The authors observe that VDC has pathological curvature, with the curvature along the pose directions far higher than along the principal-component coefficients.

Put numbers on it. Suppose a one-unit change in yaw moves the vertices 40 times as much as a one-unit change in some identity coefficient (this note's assumption). VDC is the squared displacement, so the curvature along yaw is 402=160040^2=1600 times that along the identity coefficient. The learning rate for gradient descent has to be small enough that the yaw direction doesn't oscillate back and forth, which means the identity direction only creeps forward a little each step, and the optimization bounces from side to side in a long, narrow valley, the zig-zag. Second-order optimization can fix this, but it's expensive and hard to put on a GPU.

The authors' answer is the weighted parameter distance cost (WPDC), equation (8) in the paper:

Ewpdc=eTWe=∑iwi ei2E_{wpdc}=e^T W e=\sum_i w_i\,e_i^2

The weights W=diag(w1,…,wn)W=\mathrm{diag}(w_1,\dots,w_n) are defined as

wi=∥V(pd(i))−V(pg)∥∑j∥V(pd(j))−V(pg)∥w_i=\frac{\|V(p^d(i))-V(p^g)\|}{\sum_j\|V(p^d(j))-V(p^g)\|}

pd(i)p^d(i) is a set of parameters where "only dimension ii is wrong," with dimension ii taking the predicted value and every other dimension taking the ground truth. ∥V(pd(i))−V(pg)∥\|V(p^d(i))-V(p^g)\| therefore measures how far the whole face moves when the ii-th parameter alone is guessed wrong.

For a linear parameter like identity, this term can be expanded directly. All other parameters are ground truth, so ff and RR are ground truth too:

V(pd(i))−V(pg)=f⋅Pr⋅R⋅A:,i  eiV(p^d(i))-V(p^g)=f\cdot Pr\cdot R\cdot A_{:,i}\;e_i

The norm is ∣ei∣|e_i| times ∥f⋅Pr⋅R⋅A:,i∥\|f\cdot Pr\cdot R\cdot A_{:,i}\|, that is, "how wrong this parameter is" times "how sensitive the face is to this parameter." The weight looks at both at once. When computing gradients, WW is treated as a constant and not backpropagated through.

Run the same assumption through. At first, yaw and that identity coefficient are both off by 0.5, so the displacements are 0.5×40=200.5\times40=20 and 0.5×1=0.50.5\times1=0.5, and the weights are 20/20.5≈0.97620/20.5\approx0.976 and 0.0240.024. The gradients 2wiei2w_ie_i are 0.976 and 0.024, a factor of 40 apart, so the network attends almost only to yaw. Once yaw has been corrected down to 0.05, its displacement becomes 2, the weights become 2/2.5=0.82/2.5=0.8 and 0.20.2, and the gradients become 0.080.08 and 0.20.2, so the identity coefficient now gets the larger gradient.

This is the behavior the paper describes. Training first concentrates on parameters with large displacements, such as scale, rotation and translation; once they get close to the ground truth their weights shrink, and the network turns to the secondary parameters while keeping the first group accurate enough. Put the same errors into VDC and the gradients differ by a factor of 1600 when both are off by 0.5, and still by 160 when yaw is down to 0.05; WPDC starts at a factor of 40, which shrinks as yaw gets more accurate and even flips. It also doesn't need the derivative of V(⋅)V(\cdot).

Original Figure 8: a line chart with cascade levels 0 to 5 on the horizontal axis and normalized mean error from 0 to 0.3 on the vertical axis. All three lines start at about 0.29. Blue PDC drops to about 0.1 at level 1 and then stays at about 0.086; green VDC drops to about 0.06 at level 1 and then stays at about 0.047; red WPDC is about 0.065 at level 1, falls below VDC from level 2 on, and ends at about 0.035.
Original Figure 8, Zhu et al., from PDF page 7, arXiv license, scholarly quotation.

The test errors of the three losses are plotted together, with every network trained to convergence. PDC stalls at about 0.086 after level 1, which the paper describes as converging to an unsatisfying result. VDC is actually lowest at level 1 (about 0.06), then gets stuck at about 0.047; the authors' explanation is that the pathological curvature lets it attend to only a few parameters. WPDC is slightly higher at level 1, overtakes from level 2 on, and ends at about 0.035 (values read approximately off the plot).

A trap in training the cascade: initialization regeneration

Training a cascade has a trap. The level-0 network has a lot of parameters and easily overfits the training set. Run it on the training samples and the outputs have almost no error, so the training data handed to level 1 consists entirely of samples with near-zero error. Level 1 learns to fix tiny errors, yet at test time it faces the large errors level 0 leaves on faces it has never seen.

The authors observe that the pattern of fitting errors depends heavily on the face's pose. Errors on profiles mostly come from underestimating yaw; errors on faces with open mouths mostly come from expression parameters stuck at a closed mouth. So they first set aside two folds of data as validation sets, and for each training sample find validation samples with a similar "face posture" (equation (9), the ground-truth 2D landmarks with scale and translation removed). The level-kk starting point is regenerated with equation (10) in the paper:

pk=pg−(pvg−pvk)p^k=p^g-\big(p^g_{v}-p^k_{v}\big)

vv is a randomly drawn similar validation sample, and pvg−pvkp^g_v-p^k_v is the error the level-kk network actually left on it. Apply that error unchanged to the training sample's ground truth, and you get a realistic starting point. For example, if a training sample is turned 75°, and the similar validation sample drawn for it still underestimates yaw by 12° at level 2, then that training sample's level-2 starting point is its ground-truth yaw minus 12°. Validation samples are never used for training.

The effect is in Section 6.2 of the paper. 300W-LP is split into 97,967 training and 24,483 test images (with no overlapping identities). Without regeneration, both training and test errors stop falling after level 2, with the test error stuck at about 0.046; with regeneration, the training error is pulled back up at the start of every level, and the test error keeps falling all the way to about 0.033 at level 5. Weighing speed, three levels are used in the end.

No profile data? Turn the faces yourself

The last hurdle is data. The authors take face frontalization, which was popular at the time, and run it in reverse, calling it face profiling: starting from medium-pose photos, estimate the depth and turn the face sideways in 3D.

The first step turns the whole image into a 3D object. The face region is fitted with a 3DMM using MFF (Multi-Features Framework), with the ground-truth landmarks as hard constraints throughout, so the fit almost always converges, and the few failures are adjusted by hand. For the region outside the face, following the same group's earlier frontalization method, a ring of anchor points is marked around the face and their depths are estimated, and then the whole image is triangulated into a mesh.

Original Figure 5: the top row has four 3D mesh views, the same face triangulated into a mesh, the face region a fine dark-red mesh and the background outside the face cut into large triangles, colored from yellow-green to blue by depth; from left to right are the original yaw, plus 20°, plus 30° and plus 40°. The bottom row has the corresponding images, a waving woman gradually turning toward profile, with a black blank area appearing along the right edge.
Original Figure 5, Zhu et al., from PDF page 5, arXiv license, scholarly quotation.

The second step is rotation. The top row is the mesh with depth; the bottom row is the image drawn back in 2D after the turn, going from the original angle up to plus 40°. The region outside the face has to turn along with it, or the hair and background would break off out of nowhere.

Turning toward the side has one advantage. In frontalization, the half of the face that was hidden comes into view and has to be filled in somehow, and a bad fill leaves large artifacts; turning toward the side only makes the hidden region bigger, so no invisible pixels have to be conjured up.

Each photo's yaw is increased in steps of 5°, up to 90°. The labels are completely free, because the 3DMM parameters have already been fitted; each turned face comes with its 68 points in 2D and 3D, and even all 234 parameters.

Doing this on the 300-W photos produces 61,225 synthetic images (IBUG 1,786, AFW 5,207, LFPW 16,556, HELEN 37,676), or 122,450 after horizontal flipping, named 300W-LP (300W across Large Poses).

The supplementary material spells out one more detail. Turning only ever increases yaw, so the synthesized distribution flips around to many profiles and few frontal faces, and the more a face is turned, the worse the synthesis quality. So each sample is repeated ⌈5×0.8Δyaw/5∘⌉\lceil 5\times0.8^{\Delta yaw/5^\circ}\rceil times according to its rotation Δyaw\Delta yaw. The original image is repeated 5 times, one turned by 20° gets ⌈2.05⌉=3\lceil 2.05\rceil=3 copies, and anything turned 40° or more is used once.

Refining when you only need landmarks

The 3DMM's vertices are constrained by the principal components, so the shape can only vary along 199 identity directions and 29 expression directions. If all you need in the end is 68 sparse points, loosening this constraint can bring the error down a bit more. Starting from 3DDFA's results, the authors extract HOG features at each landmark and train a linear regressor for refinement; any 2D method can be attached as well, and the experiments report the version followed by SDM.

Discussion

The exams and the rulers

The experiments use three exams, each with its own ruler, so sort them out before reading the numbers.

AFLW has 21,080 in-the-wild faces, with yaw from −90° to 90°. Each face has up to 21 visible points labeled (6 each on the eyebrows and eyes, 3 on the nose, 3 on the mouth, and 1 each on the two ears and the chin). All of AFLW is used for testing, split by absolute yaw into three groups, 0°–30°, 30°–60° and 60°–90°, with 11,596, 5,457 and 4,027 images. Initialization uses the detection boxes provided with AFLW.

AFLW2000-3D is an evaluation set the authors built themselves, taking the first 2,000 images of AFLW and fitting ground-truth 3D faces and 68 points, with both visible and invisible points evaluated. The three groups have 1,306, 462 and 232 images, initialized with the box around the 68 ground-truth points. The construction is described in the supplementary material. A coarse alignment comes first from SDMs trained separately for each yaw range, then a 3DMM is fitted with MFF, constrained by AFLW's original 21 visible points; for failed fits, the necessary points (mostly on the upper and lower lips) are additionally labeled and the fit is rerun.

300-W is the standard exam for medium poses. Training uses the LFPW and HELEN training sets plus all of AFW, 3,148 images in total; testing is split into three groups, with common being the LFPW and HELEN test sets (554 images), challenging the 135 IBUG images, and full the two combined, 689 images.

The ruler is always NME (normalized mean error), which averages the distance between each point's prediction and ground truth and divides it by a length that stands for the face's size. The choice of denominator makes a big difference. Suppose the mean error is 3 pixels and the face box is 100 pixels on a side; the NME is 3%. If the inter-pupil distance on the same frontal face is 40 pixels, the NME becomes 7.5%. Turn the face to 70°, and the distance between the two pupils in the image shrinks to about 40×cos⁡70∘≈1440\times\cos70^\circ\approx14 pixels, so the same 3-pixel error works out to 22% (the numbers are this note's example). That's why AFLW and AFLW2000-3D use the box size, while 300-W sticks with the conventional inter-pupil distance.

The "mean" in Table 1 needs care too. It's the average of the three groups' own averages, so the 4,027 profiles count as much as the 11,596 near-frontal faces; "Std" is the standard deviation of those three group averages, which the authors use to measure how stable a method is across poses.

Evaluating only visible points can fool you

Original Figure 6: two pairs of AFLW profile faces. The left pair shows the left profile of a blonde woman; the first image draws only the 21 visible points, all near the eyebrows, eyes, nose and mouth, labeled NME=4.34; the second draws all 68 points, with the points of the far-side eye and mouth drifting off the face and the jaw contour off course, labeled NME=8.15. The right pair shows a girl with face paint, NME=3.75 with 21 points and NME=11.63 with 68 points, the far-side points scattered outside the cheek.
Original Figure 6, Zhu et al., from PDF page 6, arXiv license, scholarly quotation.

This figure shows why AFLW2000-3D had to be built separately. For the same fitting results, looking only at the 21 visible points gives NMEs of 4.34 and 3.75, which look great; draw all 68 points and the far-side eye and mouth corners float off the face, and the NMEs become 8.15 and 11.63. The authors call this "fake good alignment." If only visible points are evaluated, the model loses no points wherever it puts the invisible half of the face.

Main results: the further the turn, the wider the gap

Two line charts stacked vertically, with three groups of absolute yaw on the horizontal axis, 0°–30°, 30°–60° and 60°–90°, and NME (%) from 0 to 18 on the vertical axis. The four lines are gray dashed SDM (trained on 300W), blue SDM (trained on 300W-LP), orange 3DDFA, and green dotted 3DDFA + SDM refinement. The top chart, AFLW, evaluates only the 21 visible points; at 0°–30° all four lines are between 4.7 and 5.0, and at 60°–90° they reach 16.13, 9.34, 6.74 and 6.38. The bottom chart, AFLW2000-3D, evaluates all 68 points; at 0°–30° all are between 3.4 and 3.8, and at 60°–90° they reach 17.48, 9.76, 7.93 and 7.17.
Drawn for this note from Table 1 of the paper.

Every 2D method was trained twice, once on the original 300-W and once on 300W-LP, so this figure answers two questions at once.

First, the gray and blue lines. Both are SDM; they differ only in training data. After switching to 300W-LP, the 60°–90° group drops from 16.13 to 9.34. The paper reports the improvement for the three 2D methods in this group as 44.06% for RCPR, 40.36% for ESR and 42.10% for SDM. These models were all trained on synthetic data and tested on real photos, and the authors take this as evidence of how realistic face profiling is.

Next, the orange line. 3DDFA is the flattest of the four, going from 5.00 to 6.74, while SDM, even with 300W-LP, climbs from 4.75 to 9.34. Put the two ends side by side and 3DDFA's advantage is entirely at large poses. In the 0°–30° group it actually loses to both SDMs (5.00 against 4.67 and 4.75). This matches what the refinement section said. The principal-component constraint keeps the shape from wandering at large poses, at the price of limited detail on near-frontal faces; once SDM refinement loosens the constraint, the green line is lowest in every group except AFLW's 0°–30°, where its 4.75 is still slightly above the 4.67 of SDM trained on 300W.

The bottom chart switches to evaluating all 68 points and initializes with ground-truth boxes, conditions that ought to be more favorable, yet every line's error in the 60°–90° group goes up (3DDFA from 6.74 to 7.93, SDM (300W) from 16.13 to 17.48). This is exactly the point of the previous section; evaluating only visible points hides the mistakes at large poses.

The full numbers are below, with "mean" and "Std" being the three-group average and its standard deviation described above:

Method (data)AFLW meanStd2000 meanStd
RCPR (300W)11.947.8312.219.43
RCPR (LP)7.853.247.804.74
ESR (300W)12.077.3311.728.04
ESR (LP)8.243.297.994.19
SDM (300W)9.196.109.377.23
SDM (LP)6.552.456.123.21
3DDFA (LP)5.600.995.422.21
3DDFA+SDM (LP)5.320.924.941.97

Compiled from Table 1 of the paper, NME (%); LP is 300W-LP, and "2000" is AFLW2000-3D.

Medium poses: 300-W

MethodCommonChallengingFull
ESR5.2817.007.58
SDM5.5715.407.50
LBF4.9511.986.32
CFSS4.739.985.76
3DDFA6.1510.597.01
3DDFA+SDM5.539.566.31

Compiled from Table 2 of the paper, NME (%), normalized by the inter-pupil distance.

The paper says 3DDFA is "competitive" on the common subset and the best of its time on the challenging subset. The second half holds for 3DDFA+SDM, whose 9.56 is below CFSS's 9.98; 3DDFA alone gets 10.59. The first half deserves some skepticism, since 3DDFA's 6.15 on common is worse than 2012's ESR (5.28) (competitive is doing some heavy lifting here). On the overall full set, the best is still CFSS.

These results agree with AFLW. What the 3D model buys is stability at large poses; precision on near-frontal faces has to be won back by the 2D refinement afterwards.

A year later, someone else does the measuring

AFLW2000-3D's ground truth was fitted with a 3DMM, the same kind of model 3DDFA itself uses. The 2017 FAN paper re-annotated these 2,000 images with a different pipeline and found that the two sets of annotations differ most on large-pose and occluded faces, with the worst images reaching an NME of 7%–8%; its authors attribute the error mainly to the original semi-automatic annotation. On FAN's re-annotated data, 3DDFA trained on the same 300W-LP falls clearly behind 3D-FAN. FAN's annotations also come from networks of its own lineage, so both sides have a stake; the details are in that note.

Official code, the extended version, and community implementations

The official MATLAB code, the face profiling code, 300W-LP and AFLW2000-3D are all still listed on the project page of CASIA's Center for Biometrics and Security Research (CBSR).

The 2017 TPAMI extension (arXiv 1804.01005) adds a Pose Adaptive Feature alongside PNCC, turns the network into two streams, and replaces the loss with an optimized version, OWPDC.

The community mostly uses cleardusk/3DDFA by Jianzhu Guo of the same lab, which the README describes as an improved PyTorch version of the TPAMI paper. Open it up and it's very different from the paper. The backbone is MobileNet-V1, the input is 120×120120\times120, and the parameters are cut to 62 dimensions (a 12-dimensional 3×43\times4 pose matrix, 40 identity coefficients and 10 expression coefficients), regressed directly from the cropped face, with no PNCC and no cascade.

In November 2018 someone asked about this in issue #26, and the repo's author replied the same day that the experimental conclusions of this project aren't fully consistent with the original paper. PNCC and the pose adaptive convolution (PAC) that the TPAMI version uses to extract the Pose Adaptive Feature were both implemented, but under this repo's setup the two-stream cascade structure brought no improvement at all; the data augmentation is about the same as in the original paper, "But it matters." Another thread, issue #54 (March 2019), also asked why PNCC isn't used, and the answer was "So it is called the improved version. Because only single inputs can get promising results." PNCC, which the paper spends the most space designing, has been reduced to a visualization you can output in the same lab's PyTorch version, and the cascade is gone altogether.

The ranking of the loss functions does hold up, though. The README lists four pretrained models whose NMEs on AFLW and AFLW2000-3D are, in order, PDC 6.956/5.644, VDC 6.717/5.030 and WPDC 6.348/4.759, with the best being training with WPDC first and then fine-tuning with VDC, at 5.401/4.252. Its WPDC implementation also matches the derivation above, with the weight being the absolute parameter error times the length of the corresponding basis, times a hard-coded constant 0.00057339936. The one difference is that it divides by the maximum at the end, where the paper divides by the sum.

This repo also preserves an easily overlooked detail of AFLW2000-3D. The evaluation code has two sets of 68-point annotations (the original and a re-annotated version) and two pose groupings, 1,312/383/305 images by fitted pose and 1,306/462/232 by AFLW's labels (the same as the paper), with the former used by default. In October 2022, someone asked in issue #139 of the follow-up project 3DDFA_V2 which annotations and which pose grouping the 3DDFA_V2 paper's reported numbers actually used, and it still has no reply.

After 3DDFA, 300W-LP and AFLW2000-3D found uses far beyond landmarks. Hopenet, a 2017 head pose estimation method, regresses the three angles straight from the image, training on 300W-LP and testing on AFLW2000 and BIWI; many later head pose papers kept this "train on 300W-LP, test on AFLW2000" setup.

Conclusion

In AFLW's 60°–90° yaw group, 3DDFA's NME is 6.74, against 9.34 for SDM trained on the same 300W-LP. The gap comes from replacing landmark regression with regression of 3DMM parameters, so that invisible points get their positions by projecting the 3D model. PNCC lets the CNN see the current estimate, WPDC allocates gradients according to each parameter's effect on the whole face, and face profiling synthesizes over 60,000 large-pose training images from 300-W. On near-frontal faces, it needs SDM refinement attached to catch up with 2D methods.

Before comparing AFLW2000-3D numbers with someone else's table, find out whether they used the original or the re-annotated labels, whether the pose groups are 1,306/462/232 or 1,312/383/305, and whether the "mean" is the average of three group averages or a per-image average. If any one of them doesn't match, a ranking decided by a few tenths may not stand.

The same lab's PyTorch version dropped PNCC and the cascade, and the best row in its README trains with WPDC first and fine-tunes with VDC; VDC, the loss the paper faulted for its pathological curvature, ends up doing the finishing.