Back to paper library
Paper notesCVPR 2014

DeepFace

Face Forward

Original paper

DeepFace: Closing the Gap to Human-Level Performance in Face Verification

Paper authors

Yaniv Taigman · Ming Yang · Marc'Aurelio Ranzato · Lior Wolf

Publication
CVPR 2014Conference
Cite this paper · BibTeX

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

@inproceedings{facerecognitiondeepface2014,
  title = {{DeepFace: Closing the Gap to Human-Level Performance in Face Verification}},
  author = {Yaniv Taigman and Ming Yang and Marc'Aurelio Ranzato and Lior Wolf},
  year = {2014},
  booktitle = {CVPR},
  url = {https://openaccess.thecvf.com/content_cvpr_2014/html/Taigman_DeepFace_Closing_the_2014_CVPR_paper.html}
}
On this page

97.35 versus 97.53.

The first is DeepFace's best score on LFW; the second is what humans scored on the same exam, a gap of 0.18 percentage points. The "Closing the Gap to Human-Level Performance" in the paper's title refers to exactly these two numbers.

LFW (Labeled Faces in the Wild) was the most widely used face verification benchmark of its day. Face verification is a 1:1 problem: given two faces, decide whether they belong to the same person. LFW collected 13,233 photos of 5,749 celebrities from the web and arranged them into 6,000 pairs, half of them the same person and half not. The 6,000 pairs are split into 10 folds; each round uses 9 folds to pick a threshold and tests on the remaining one, and the accuracy is averaged over 10 rounds.

The human 97.53% was measured by Kumar et al. in 2009, who had Amazon Mechanical Turk workers take the same exam, and the workers saw only images cropped down to the face. In the same set of experiments, people shown the full original images (hair, clothes and background included) reached 99.20%. The official LFW page also warns that these experiments did not control for whether the workers already knew the celebrities in the photos, so the human numbers may be on the high side. "Close to human," then, means close to humans under a very specific set of conditions.

DeepFace comes from Facebook AI Research; the last author, Lior Wolf, is from Tel Aviv University. Before it, most methods near the top of the LFW leaderboard relied on hand-crafted features: they extracted local descriptors tens of thousands of dimensions long from the face and handed them to carefully designed metric learning. DeepFace keeps the metric as simple as possible and puts its effort into a 3D alignment pipeline that turns faces to the front, plus a deep network with more than a hundred million parameters trained on 4.4 million Facebook photos.

Defining the Problem

Detect, align, represent, classify

The paper opens by splitting face recognition into four stages. Detection finds where the face is; alignment moves the face into a fixed position and pose; representation turns the face into a vector; classification then uses that vector to determine the identity, or whether two faces are the same person. DeepFace redoes the middle two.

Start with representation. The leading systems of the time all used hand-designed descriptors, for example LBP (local binary pattern) histograms extracted at many positions on the face and concatenated into vectors of more than ten thousand dimensions. The strongest of them, TL Joint Bayesian, scored 96.33% on LFW. It first learned a Joint Bayesian model on a separate dataset of 99,773 images of 2,995 people, then used transfer learning to adapt it to the LFW distribution.

The authors wanted to show that the features themselves were good enough, so they deliberately did not combine them with hand-crafted features and kept the metric very simple; the simplest version is just the inner product of two vectors.

2D alignment cannot turn a profile

Now alignment. For a network to learn anything from "the eyes are here, the mouth is there," the same facial part has to land at roughly the same pixel position every time. The common approach then was 2D alignment, for example LFW-a, the 2D-aligned version of LFW. It finds the eyes, nose and mouth and moves them to fixed positions with a similarity transform (scaling, rotation, translation).

A similarity transform can only move things within the image plane. In a face turned 30 degrees, the half nearer the camera looks wider and the other half is squashed; no amount of scaling or rotating will turn it back into a frontal face. The paper calls this out-of-plane rotation, rotation that leaves the image plane.

Research on handling pose with 3D models had been around for a long time, but it had never been stable on unconstrained (in the wild) photos; in the paper's words, "3D models have fallen out of favor in recent years." The authors' position is that a face is a 3D object to begin with, and done correctly, 3D is the right way to go.

That leaves two questions. With only one photo and no depth information, how do you make 3D alignment stable enough? And once the face is aligned, how should the network architecture exploit the fact that "every part sits in a fixed position"?

Solving the Problem

The alignment pipeline at a glance

The paper's Figure 1, eight small panels in two rows. (a) A photo of a male celebrity, with the detected face in a red box and 6 blue initial fiducial points on the face; (b) the crop after 2D alignment; (c) 67 fiducial points on the crop with a green Delaunay triangulation; (d) a gray-black generic 3D face shape; (e) the triangulation of the 3D shape, where darker triangles are less visible to the camera; (f) the 67 points of the 3D model projected back onto the crop; (g) the frontalized face; (h) another view generated from the 3D model, with the face turned to the left.
Original Figure 1, Taigman et al., from PDF page 2 of the CVPR 2014 open-access version, scholarly quotation.

The alignment runs from (a) to (g) in three steps. (a) to (b) is 2D alignment; (c) to (f) places an average 3D face onto the photo; (g) is the final frontalized face. (h) is a new view generated from the 3D model, which the paper does not use.

Step 1: 2D alignment with 6 points

The fiducial point detector is a plain one, with LBP histograms as descriptors and a support vector regressor (SVR) trained to predict the point coordinates directly. It first finds 6 points inside the detection box, located at the centers of the two eyes, the tip of the nose and around the mouth.

These 6 points are used to fit a similarity transform T2di=(si,Ri,ti)T^i_{2d}=(s_i,R_i,t_i) that moves each point xsourcejx^j_{\mathrm{source}} (j=1,…,6j=1,\dots,6) to its corresponding fixed anchor:

xanchorj=si [Ri ∣ ti]  xsourcejx^{j}_{\mathrm{anchor}}=s_i\,[R_i\,|\,t_i]\;x^{j}_{\mathrm{source}}

sis_i is the scaling, RiR_i the rotation and tit_i the translation. A similarity transform has only 4 degrees of freedom (one scale, one angle, two translations); the 6 points give 12 equations, solved by least squares.

After the transform, the fiducial detector runs again on the new image and the transform is fitted again, until the points no longer move noticeably; finally the transforms from every round are composed:

T2d=T2d1∗⋯∗T2dkT_{2d}=T^1_{2d}*\cdots*T^k_{2d}

The reason for iterating is that the detector is less accurate on tilted faces to begin with; straighten the face a bit first and the points come out more accurate. The result is the 2D-aligned crop of Figure 1 (b), about as good as LFW-a.

Step 2: placing the average face on the photo

On the 2D crop, a second SVR finds 67 points, denoted x2dx_{2d}, which is Figure 1 (c).

For the 3D part, the authors do not reconstruct a face shape for each person. They use a single generic 3D shape, the average face of all 3D scans in the USF Human-ID database. On this average face they manually placed 67 anchor points, in one-to-one correspondence with the 67 points detected in 2D.

Next comes finding a camera, which says how the average face should be posed and projected so that it lands on those 67 points in the photo. The paper uses an affine camera PP, a 2×4 matrix that projects a 3D point (X,Y,Z)(X,Y,Z) to a 2D point (x,y)(x,y):

x=p11X+p12Y+p13Z+p14y=p21X+p22Y+p23Z+p24\begin{aligned} x&=p_{11}X+p_{12}Y+p_{13}Z+p_{14}\\ y&=p_{21}X+p_{22}Y+p_{23}Z+p_{24} \end{aligned}

The 8 unknowns are arranged into a vector P⃗\vec P. Each pair of corresponding points gives two equations, so 67 points give 134; stacked together they read x2d=X3dP⃗x_{2d}=X_{3d}\vec P, where X3dX_{3d} is a 134×8 matrix. There are far more equations than unknowns, so they cannot all hold exactly; the best one can do is make the residual r=x2d−X3dP⃗r=x_{2d}-X_{3d}\vec P as small as possible.

Rather than minimizing ∥r∥2\|r\|^2 directly, the authors use generalized least squares:

loss(P⃗)=r⊤Σ−1r\mathrm{loss}(\vec P)=r^\top\Sigma^{-1}r

Σ\Sigma is a 134×134 covariance matrix, estimated in advance, describing how large each fiducial point's detection error is and how the errors correlate. The paper's reasoning is that points on the facial contour are noisier, because their positions in the photo depend strongly on the depth and angle of the face relative to the camera.

A diagonal-only example shows what Σ−1\Sigma^{-1} does. Suppose the error standard deviation is 1 pixel for an eye-corner point and 2 pixels for a jawline point; the variances are 1 and 4, and the inverted weights are 1 and 1/4. If both points are off by 2 pixels, the eye corner contributes 22×1=42^2\times1=4 to the loss and the contour point only 22×14=12^2\times\tfrac14=1. The fit gives priority to lining up the reliable points.

In practice, Σ\Sigma is Cholesky-factored as Σ=LL⊤\Sigma=LL^\top, which gives r⊤Σ−1r=∥L−1r∥2r^\top\Sigma^{-1}r=\|L^{-1}r\|^2. Multiply both sides of the equations by L−1L^{-1} and the problem turns back into ordinary least squares.

Step 3: add the residual back, then warp piece by piece

The affine camera does not model full perspective projection, nor non-rigid deformations such as expressions, so the fitted PP is only an approximation and the residual rr is not zero.

Instead of throwing this residual away, the authors add rr back to the x and y components of the 67 3D reference points, giving new target points x~3d\tilde x_{3d}. Part of the residual is the person's own face shape: eyes a little farther apart, a chin a little longer. Warping every photo straight into the shape of the average face would bend everyone into the same face shape, and the paper says that would lose important discriminative factors. Adding the residual back frontalizes the face while keeping the ways this person differs from the average face.

The last step is piecewise affine warping. The 67 points are Delaunay-triangulated, cutting the face into triangles; each triangle in the photo (with vertices x2dx_{2d}) gets its own affine transform that moves it to the corresponding triangle in the frontal position (with vertices x~3d\tilde x_{3d}). Triangles invisible to the camera PP, the dark ones in Figure 1 (e), are filled in by blending with their symmetric counterparts on the other side of the face.

The output is a 152×152 RGB frontal face, Figure 1 (g).

Network: convolution first, then local connections

The paper's Figure 2, a diagram of the DeepFace architecture. At the far left is a photo of a female celebrity with a triangulation of fiducial points drawn on the face, labeled Calista_Flockhart_0002.jpg and Detection & Localization; next comes the frontalized 152×152×3 RGB input, with a gray 3D face shape beside it; further right are the feature maps output by each layer in turn: C1 32x11x11x3@142x142, M2 32x3x3x32@71x71, C3 16x9x9x32@63x63, L4 16x9x9x16@55x55, L5 16x7x7x16@25x25, L6 16x5x5x16@21x21, followed by F7 4096d labeled REPRESENTATION, and at the far right F8 4030d in a dashed box, labeled SFC labels.
Original Figure 2, Taigman et al., from PDF page 4 of the CVPR 2014 open-access version, scholarly quotation.

The annotation under each layer, for example C1's "32x11x11x3@142x142," means 32 filters of size 11×11×3 with an output size of 142×142. Follow one frontalized face through the network:

LayerOperationOutput
C132 conv filters, 11×11×3142×142×32
M23×3 max pooling, stride 271×71×32
C316 conv filters, 9×9×3263×63×16
L49×9 locally connected55×55×16
L57×7 locally connected, stride 225×25×16
L65×5 locally connected21×21×16
F7Fully connected4,096
F8Fully connected + softmax4,030

Compiled from Figure 2 and Section 3 of the paper; the stride of L5 is inferred from the size going from 55 to 25.

The first three layers (C1, M2, C3) extract low-level features such as edges and textures. Max pooling makes the network insensitive to small shifts, which helps when alignment is imperfect; but stack too many pooling layers and the precise positions of fine structures such as eye corners and mouth corners are lost too, so DeepFace pools only once, after the first convolution. The authors regard these three layers as a "front-end adaptive pre-processing stage" that merely expands the input into a set of simple local features.

L4 to L6, the locally connected layers, are what sets this paper apart. Like convolution, they apply a bank of filters to a small patch of the input at each position; the difference is that convolution shares the same filters across all positions, while a locally connected layer gives every position its own set.

Why not share? Convolution assumes that image statistics are stationary across space: an edge detector that is useful in the upper left is just as useful in the lower right. Once faces are aligned, that assumption no longer holds. The paper's example is the region between the eyes and the eyebrows, which looks very different from the region between the nose and the mouth and is far more discriminative. Since each position always corresponds to a particular part of the face, let each position learn its own filters. Another reason is that each output unit of L6 sees a large 74×74×3 patch of the input, and on aligned faces, patches that large share almost no statistical regularities with one another.

F7 and F8 are fully connected layers that can relate features far apart on the face, for example the position and shape of the eyes with the position and shape of the mouth. F8 feeds a softmax that classifies the 4,030 identities in SFC. After training, F8 is discarded, and F7's 4,096-dimensional output is the representation of the face.

How many parameters a locally connected layer has

Take L4. Its input is C3's 63×63×16, and L4's filter bank at one position is 16 filters of 9×9×16, so the number of weights is:

16×9×9×16=20,73616\times9\times9\times16=20{,}736

If L4 were a convolution, the whole layer would have just these 20,736 weights. A locally connected layer, though, has 55×55=3,02555\times55=3{,}025 output positions, each with its own set:

3,025×20,736=62,726,4003{,}025\times20{,}736=62{,}726{,}400

That is more than 62 million weights in a single layer.

The compute is the same either way. Shared or not, every output position needs 20,736 multiply-adds; sharing only means those 3,025 positions read the same copy of the weights. This is what the paper means when it says locally connected layers do not affect the computational burden of feature extraction, only the number of parameters to be trained. Seen the other way, each weight of a locally connected layer is used only once per image, so its parameter count exactly equals its multiply-adds per image, and the same goes for fully connected layers.

Going through every layer this way with the sizes in Figure 2:

A horizontal bar chart comparing the parameter count and the multiply-adds per image of DeepFace's seven learnable layers, in millions. C1 conv: 11.6K parameters, 234.2M multiply-adds; C3 conv: 41.5K parameters, 164.6M multiply-adds; L4 local: 62.7M for both; L5 local: 7.8M for both; L6 local: 2.8M for both; F7 FC: 28.9M for both; F8 FC: 16.5M for both. The subtitle gives totals of about 119M parameters and about 518M multiply-adds, with C1+C3 taking 77% of the multiply-adds and only 0.04% of the parameters.
Drawn for this note, computed from the layer sizes in Figure 2 of the paper.

C1 and C3 together hold just over 50,000 weights, yet make up 77% of all multiply-adds, because their filters are reused at tens of thousands of positions. L4 to F8 are the opposite, holding nearly all the parameters while taking only a little over a fifth of the compute. The paper says "more than 120 million parameters, where more than 95% come from the local and fully connected layers"; counting only the weights from Figure 2, this note gets about 119 million, 99.9% of them in these layers, the same order of magnitude.

That many parameters need data to hold them up. The paper says plainly that only because they had a very large labeled dataset could they afford three large locally connected layers; the ablations later show what happens with less data.

Sparsity and normalization

Every convolutional, locally connected and fully connected layer except the last is followed by a ReLU, max⁡(0,x)\max(0,x). All negative values become zero, and the authors observe that on average 75% of the components of the top-layer features are exactly 0. Dropout, the regularizer, is applied only to F7; the authors say the training set is large enough that they saw no significant overfitting.

Once F7's output G(I)G(I) is in hand, two normalization steps follow. First, each component is divided by its maximum over the whole training set:

Gˉ(I)i=G(I)imax⁡(Gi,ϵ),ϵ=0.05\bar G(I)_i=\frac{G(I)_i}{\max(G_i,\epsilon)},\quad\epsilon=0.05

ϵ\epsilon prevents division by a tiny number. ReLU outputs are non-negative, so after the division every component lies between 0 and 1. Then comes L2 normalization, which makes the vector's length 1:

f(I)=Gˉ(I)∥Gˉ(I)∥2f(I)=\frac{\bar G(I)}{\|\bar G(I)\|_2}

The authors say this reduces sensitivity to changes in illumination. Imagine the brightness of the whole image doubled: if the network had no biases, the output of every layer of a ReLU network would also double exactly, and L2 normalization would then divide that factor out. The paper itself adds that DeepFace uses ReLUs and has biases, so it is not fully invariant to intensity scaling; only without biases would it be perfectly equivariant.

Training data: SFC

SFC (Social Face Classification) consists of Facebook's own photos: 4.4 million labeled faces of 4,030 people, 800 to 1,200 per person. For each person, the most recent 5% by timestamp are held out as a test set, simulating recognizing someone as they look now from older photos. Identities were labeled by hand, with an error rate of about 3%. The authors matched names to confirm that none of the SFC people appear in LFW or YTF.

Compared with LFW, these are a different kind of photo. LFW's celebrity photos mostly come from professional photographers; SFC is social photos uploaded by users, with much more variation in image quality, lighting and expression.

Training uses SGD with momentum 0.9 and a batch size of 128. The learning rate is 0.01 for every layer, divided by 10 by hand whenever the validation error stops decreasing, ending at 0.0001. Weights are initialized from a Gaussian with standard deviation 0.01, and biases are set to 0.5. Training runs for about 15 epochs on a GPU and takes 3 days.

SFC is not public, and Facebook released neither code nor weights.

Three ways to compare two faces

With the representation learned, how should two faces be compared at verification time? The authors prefer methods that do not need training on LFW. Their reason is that LFW has certain biases: about 75% of the people are male, and most are celebrities photographed by professionals; tuning a metric on a small target dataset hurts its generalization to other datasets. So the default similarity is simply the inner product of two normalized features, with no training at all.

The authors also tried two supervised metrics.

Weighted χ². Normalized DeepFace features look somewhat like LBP histograms: both are non-negative, very sparse and valued between 0 and 1. So they borrow the weighted χ² similarity commonly used for histograms:

χ2(f1,f2)=∑iwi (f1[i]−f2[i])2f1[i]+f2[i]\chi^2(f_1,f_2)=\sum_i w_i\,\frac{(f_1[i]-f_2[i])^2}{f_1[i]+f_2[i]}

Two small 4-dimensional vectors show what the denominator does. Let f1=(0.6,0,0.2,0.1)f_1=(0.6,0,0.2,0.1) and f2=(0.4,0,0.2,0.3)f_2=(0.4,0,0.2,0.3); dimensions one and four both differ by 0.2. Dimension one gives 0.22/1.0=0.040.2^2/1.0=0.04, dimension four gives 0.22/0.4=0.10.2^2/0.4=0.1. The same absolute difference counts more when it falls on dimensions with small values; the second dimension, zero in both, contributes nothing, so sparse features are compared only on the dimensions that respond. The weights wiw_i are learned by a linear SVM whose input is the vector of per-dimension terms (f1[i]−f2[i])2/(f1[i]+f2[i])(f_1[i]-f_2[i])^2/(f_1[i]+f_2[i]).

Siamese network. The recognition network (minus its top layer) is duplicated; each face goes through one copy, the element-wise absolute difference of the two features is taken, and a fully connected layer maps it to a single logistic unit that outputs same person or different people. The two copies share weights, so the parameter count is about the same as the original network while the compute doubles. To avoid overfitting on the verification task, only the top two layers are trained. The distance it induces is d(f1,f2)=∑iαi∣f1[i]−f2[i]∣d(f_1,f_2)=\sum_i\alpha_i|f_1[i]-f_2[i]|, where the αi\alpha_i are trainable parameters.

Discussion

LFW's three protocols

LFW divides its protocols by "how much of LFW's own labeling you may use," and the protocols have to match before numbers are compared:

  • restricted: only the "same / different" pair labels in each training fold may be used; the 9 training folds hold 5,400 pairs in total.
  • unrestricted: the identity information of the training-fold photos may be used to form more pairs.
  • unsupervised: no training on LFW at all.

DeepFace's feature network is always trained on SFC; the three protocols differ mainly in how much LFW data the final metric uses. Only the unrestricted Siamese is further fine-tuned on LFW.

How much alignment and learning each contribute

The authors first separate the two components:

SettingLFW
Center of detection box, no alignment87.9%
2D alignment only94.3%
3D frontalization + LBP and SVM91.4%
3D frontalization + DeepFace inner product95.92%

Compiled from Table 2 and Section 5.3 of the paper; the last row is the unsupervised setting.

Without alignment, a center crop of the detection box cuts part of the face out of the frame, giving only 87.9%. 2D alignment lifts that to 94.3%, and 3D frontalization adds another 1.6 percentage points. Conversely, frontalization alone with the network replaced by plain LBP plus an SVM still reaches 91.4%, which the authors call good for such a simple classifier. Only with both does it reach 95.92%.

This 95.92% is the unsupervised result, with nothing trained on LFW, and it is 0.41 percentage points behind the best method of the time, which used supervised transfer learning (96.33%).

Ablations on SFC: data size and depth

The data-size and depth experiments are run on SFC and measure the classification error on the SFC test set, that is, guessing which training-set person each person's most recent 5% of photos belongs to:

NetworkChangeError
DF-1.5K1,500 people, 1.5M images7.00%
DF-3.3K3,000 people, 3.3M images7.22%
DF-4.4KEverything, 4.4M images8.74%
DF-50%Same people, half the images10.9%
DF-20%Same people, 20% of images15.1%
DF-10%Same people, 10% of images20.7%
DF-sub1C3 removed11.2%
DF-sub2L4, L5 removed12.6%
DF-sub3C3, L4, L5 removed13.5%

Compiled from Table 1 and Section 5.2 of the paper.

The first three rows add people. More classes make classification harder, and the error rises from 7.0% to 8.7%; nearly tripling the number of people adds only 1.7 percentage points of error, from which the authors conclude that the network's capacity can handle this scale.

The middle three rows fix the number of people and give each fewer photos. With only 10% left, the error jumps to 20.7%, which the authors attribute to overfitting on the smaller training set. Put the other way, performance is still not saturated at 4.4 million images, so the authors expect larger datasets to help further.

The last three rows cut depth. DF-sub3, left with only 4 trainable layers, stops at 13.5% error after a few epochs and goes no further. With enough data, depth is necessary.

Building up to 97.35%

Back to LFW. DeepFace-single's scores (a single network on 3D-aligned RGB input) under the three protocols, and the final ensemble, were stacked up step by step:

  1. Unsupervised: inner product of the normalized features, 95.92%.
  2. Restricted: a kernel SVM trained on χ² distance vectors, using only the 5,400 labeled pairs per fold, 97.00%.
  3. Restricted ensemble: two more networks are trained, one on grayscale images plus gradient magnitude and orientation, one on 2D-aligned (not frontalized) RGB; a nonlinear SVM combines the distances of the three networks, 97.15%.
  4. Unrestricted ensemble: fine-tuning the Siamese on LFW training pairs overfits badly. LFW's training pairs are all formed from about 9,000 photos and overlap heavily, nowhere near enough to support over a hundred million parameters. Following the SFC procedure, the authors collected a separate dataset of 100,000 new identities with only 30 photos each, trained the Siamese on it first, then ran 2 epochs on LFW's unrestricted training folds and added it to the ensemble, 97.25%.
  5. Four more networks: four more DeepFace-single networks trained from scratch, differing only in their random seeds, 97.35%.

That final 97.35% is an ensemble of eight networks, uses the unrestricted protocol and draws on an extra dataset of 100,000 people. A single network in the unsupervised setting scores 95.92%.

Side by side:

MethodProtocolLFW
High-dim LBPrestricted95.17%
TL Joint Bayesianrestricted96.33%
DeepFace-singleunsupervised95.92%
DeepFace-singlerestricted97.00%
DeepFace ensemblerestricted97.15%
DeepFace ensembleunrestricted97.35%
Human (face only)—97.53%

Compiled from Table 3 of the paper.

The error rate drops from TL Joint Bayesian's 3.67% to 2.65%, a relative reduction of 27.8%; that is where the abstract's "more than 27%" comes from.

That number has a small backstory. When the paper first went up on Facebook's research site in March 2014, the abstract said 97.25% and an error reduction of "more than 25%," and Forbes used 97.25% in its headline at the time. By the official CVPR version in June, step 5's four networks that differ only in random seed had been added, and the numbers became 97.35% and "more than 27%." (Four random seeds bought 0.1 percentage points.)

The paper's Figure 3, ROC curves on LFW. The horizontal axis is the false positive rate, 0 to 0.50; the vertical axis is the true positive rate, 0.90 to 1.00. Seven curves from top to bottom: black Human cropped (97.5%), red DeepFace-ensemble (97.35%), blue DeepFace-single (97.00%), teal TL Joint Baysian (96.33%), magenta High-dimensional LBP (95.17%), olive Tom-vs-Pete + Attribute (93.30%), dark blue combined Joint Baysian (92.42%). Up to a horizontal value of about 0.07 the black line lies above the red one; after that the red line overtakes the black.
Original Figure 3, Taigman et al., from PDF page 5 of the CVPR 2014 open-access version, scholarly quotation.

The horizontal axis of an ROC curve is the false acceptance rate (the share of different-person pairs judged to be the same person), and the vertical axis is the true acceptance rate (the share of same-person pairs recognized as such). Loosen the threshold and both rise together; the closer a curve hugs the upper left corner, the better. Note that the vertical axis only shows 0.90 and above.

The red DeepFace ensemble and the black human curve stay close most of the way. Look closely, and up to a false acceptance rate of about 0.07, the black line is on top; only past that stretch does the red line overtake it. Real applications mostly demand very low false acceptance rates, and in that stretch humans are still ahead.

YouTube Faces

YTF (YouTube Faces) is set up much like LFW, except that it compares two video clips: 3,425 clips of 1,595 people, arranged into 5,000 pairs in 10 folds. YouTube frames often have motion blur and the people are farther from the camera, so the image quality is worse than LFW's photos.

DeepFace uses DeepFace-single as is. For training, one frame is taken from each clip of a pair to form 50 frame pairs, labeled same or different according to the video labels, and a weighted χ² is learned; at test time, 100 random frame pairs are taken from the two clips and the learned similarities are averaged.

MethodAccuracyAUCEER
MBGS+SVM-78.986.921.2
STFRD+PMML79.588.619.9
VSOF+OSS79.789.420.0
DeepFace-single91.496.38.6

Compiled from Table 4 of the paper, in %.

The previous best had an error rate of 20.3%; DeepFace has 8.6%, less than half. The authors also mention that the YTF site later published about 100 mislabeled video pairs, and after correcting them DeepFace-single scores 92.5%.

Speed

The authors wrote their own CPU feed-forward code, making use of SIMD instructions and the cache. On a single-core 2.2 GHz Intel CPU, extracting features from raw pixels takes 0.18 seconds and alignment about 0.05 seconds; including image decoding, face detection and the final classification, the whole pipeline takes 0.33 seconds per image.

Set against the multiply-adds computed earlier, about 500 million per image up to F7, 0.18 seconds works out to roughly 2.8 billion multiply-adds per second, 80% of them in the front-end C1 and C3.

A year later

"Close to human" did not last long. DeepID, at the same CVPR, scored 97.45% on LFW; DeepID2, later that same year, scored 99.15%. In 2015 Google's FaceNet reached 99.63%, using 100 to 200 million photos and doing no 2D or 3D alignment at all beyond cropping the face tightly.

The later mainstream landed between the two. During detection, five points are found along the way (the two eyes, the nose tip and the two mouth corners), a similarity transform aligns the face to 112×112 or 112×96, and it goes straight into the network; DeepFace's 3D frontalization with 67 points and an average face never became the standard pipeline. Neither did locally connected layers. Two years later, the Center Loss paper's network still kept three local convolution layers, with weights shared within 4×4, 2×2 and 1×1 regions respectively, the last amounting to no sharing at all; by the time its official code was released, the network had been swapped for a residual network.

How the community read it

The paper showed up on Hacker News in March 2014 (thread), and most of the comments were about privacy. Some read SFC as a requirement for using the system, thinking it needed over a thousand labeled photos of every person and could only recognize four thousand people. Other comments quickly pointed out that SFC's 4,030 people were only used to learn the representation; not one of the people in LFW is in the training set, so verification always faces unseen faces. That is exactly the paper's core setup, in which the network learns how to look at faces from one group of people and then uses the F7 vectors to compare another group.

People who want to try it out often end up at the deepface package on PyPI (serengil/deepface, over twenty thousand stars on GitHub). It is a face recognition and attribute analysis framework that wraps many models, including VGG-Face, FaceNet and ArcFace, with VGG-Face as the default. The model in it named DeepFace has weights from swghosh/DeepFace, a reproduction trained from scratch on the public VGGFace2 (8,631 people) following the paper's architecture; its preprocessing is only a 2D alignment with dlib's five points, without 3D frontalization. Keras after TensorFlow 2.12 removed LocallyConnected2D, and since March 2024 the package has restricted this model to loading only on TensorFlow 2.12 or lower.

In the repo's benchmark (compiled in 2024), the package author tested every model on LFW with their own pipeline. This DeepFace model's best result across all combinations of detector and distance is 69.0%; on the same table, Facenet512 tops out at 98.4% and ArcFace at 96.6%. The benchmark uses the first 1,000 pairs of the LFW test subset provided by scikit-learn, not the standard 10-fold protocol. (97.35% in the paper, 69.0% from pip install deepface; in between lie 3D frontalization, 4.4 million SFC photos, seven ensemble partners and a different exam.)

As for Facebook itself, on November 2, 2021, Meta announced it was shutting down the face recognition system on Facebook, deleting the face recognition templates of more than a billion people and turning off automatic recognition in photos and videos as well. The official announcement does not mention DeepFace; according to Vice's report, Facebook told The New York Times that it was not getting rid of DeepFace, the software that powers the system.

Conclusion

DeepFace frontalizes every photo with 67 points and an average face, then trains a 4,096-dimensional representation on 4.4 million social photos with three locally connected layers that share no weights. A single network already scores 95.92% in the unsupervised setting, an eight-network ensemble reaches 97.35%, and the error on YTF is cut by more than half; the ablations on SFC also spell out how much data size and depth each matter.

When reading "close to human" results like these, first check the conditions under which humans were measured (97.53% looking only at the face, or 99.20% looking at the original image), then which protocol was used and whether the result comes from a single model or an ensemble. If you actually want to compare faces with the deepface package, switch to the ArcFace or Facenet512 it provides; the one called DeepFace is good only for getting a feel for a 2014 architecture.

LFW was later pushed past 99.8%, and everyone moved on to harder test sets; those 4.4 million SFC photos have never been made public.