Fine-Grained Head Pose Estimation Without Keypoints
- Publication
- CVPR Workshops 2018Workshop
- First submitted to arXiv
- arXiv:1710.00925
Cite this paper · BibTeX
The citation identifies the linked source version. It cites the original paper and its authors.
@misc{faceanalysishopenet2017,
title = {{Fine-Grained Head Pose Estimation Without Keypoints}},
author = {Nataniel Ruiz and Eunji Chong and James M. Rehg},
year = {2017},
eprint = {1710.00925},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1710.00925}
}
Even with every landmark exactly right, the head angles can still come out wrong. The AFLW2000 photos come with ground-truth positions for 68 2D landmarks; pick 12 of them, hand them to OpenCV's solvePnP together with what the paper calls the ground-truth 3D mean face, and the three angles it solves for are still off by 8.65° on average.
Give the same photos to a ResNet-50 that looks only at pixels and has never learned a single landmark, and the average error is 6.16°.
That ResNet-50 is Hopenet, by Nataniel Ruiz, Eunji Chong and James M. Rehg of the Georgia Institute of Technology (Georgia Tech). The paper's title states its claim, that head pose can be estimated without going through keypoints. Each of the three angles is cut into 66 bins and classified, and the expected value of the class probabilities brings back a continuous angle. The code and pretrained weights are public at deep-head-pose, and nearly every head-pose paper since has it in its comparison tables.
Defining the Problem
Three Angles
Head pose estimation answers how far the head in the frame is rotated relative to the camera. A head is a rigid body, its rotation has three degrees of freedom, and the most common way to write it down is as three Euler angles.

- yaw (turning left and right): rotation about the vertical axis, turning the head to look to either side. Facing the camera is 0°, and a full profile is ±90°.
- pitch (nodding up and down): rotation about the line through both ears, raising and lowering the head.
- roll (tilting): rotation about the axis running from the back of the head out through the nose tip, tipping the head toward one shoulder.
The unit is degrees, and which direction counts as positive varies a little from dataset to dataset. The three angles have to be applied in a fixed order; change the order and the same three numbers describe a different pose. This paper simply uses the angles the datasets provide; the trouble with ordering and gimbal lock wasn't tackled head-on until 6DRepNet, four years later.
Mean Absolute Error
Scoring uses MAE (mean absolute error), computed separately for each angle:
is the prediction for image and the annotation, both in degrees. If the yaw errors on three images are 2°, 5° and 11°, the yaw MAE is 6°. Pitch and roll each get one the same way, and averaging the three gives the MAE in the rightmost column of the paper's tables.
Is 6° good or bad? Murphy-Chutorian and Trivedi's 2009 survey of head pose estimation treats a mean error below 5° as the threshold for "accurate." This paper gets 6.16° on AFLW2000 and 4.90° on BIWI, right around that line.
Two Ways to Test
Most later head-pose papers compare under two protocols. This paper uses the first and also runs one version of the second.
The first is train on 300W-LP, test on AFLW2000 and BIWI, with no fine-tuning of any kind on the test sets.
- 300W-LP is synthetic. 3DDFA fitted a 3D face model to the 300-W photos, then turned the faces to all kinds of large angles and re-rendered them, giving 61,225 images, 122,450 with horizontal flips. The authors consider the pose labels of synthetic data accurate, since the 3D model and pose of every image are known; yaw covers roughly ±90°.
- AFLW2000 is the first 2,000 in-the-wild photos of AFLW, relabeled with 68 3D landmarks and poses, likewise by fitting a 3D model. Hopenet's output range is ±99° (the next section shows why), so the 31 images with any of the three angles outside that range are removed, leaving 1,969. Most later papers filter by the same range.
- BIWI recorded 20 people turning their heads in a lab with a Kinect, about fifteen thousand frames, with yaw around ±75°, pitch ±60° and roll ±50°. The annotations were tracked by fitting a 3D head model to the depth point cloud, and depth-based methods often use it as a benchmark. This paper uses only single color frames, with no depth and no neighboring frames.
The second is BIWI only, training on part of the videos and testing on the rest, for example 70% versus 30%.
The Long Way Around Through Landmarks
At the time, finding out how far a head had turned meant taking the long way around. First find landmarks on the face, then assume a 3D mean face, guess a set of camera intrinsics, and finally solve the correspondence between the 2D and 3D points (the PnP problem) to get the rotation. Landmark detection was improving fast thanks to deep learning, and the authors wanted to know whether the other links in this chain were holding it back.
On AFLW2000, the authors start from ideal conditions and break one link at a time. The 2D points are ground truth, the 3D mean face is also the dataset's ground truth, the camera is assumed to have no distortion, and OpenCV's SolvePnP (Levenberg–Marquardt iteration) does the solving.
- Number of points. Under ideal conditions, all 68 points give a mean error of about 9.3°; using only 12 points actually brings it down to 8.65°. The authors' explanation is that the more points there are, the more easily deformations unrelated to pose, such as expression, get in the way.
- Noise. Add random jitter of up to 10 pixels to the ground-truth points. With only 12 points, the mean error rises from about 8.7° to about 10.6°; with 68 points it barely moves. When the points are accurate, fewer is better; when they're noisy, more is steadier. But with a real detector, you don't know in advance how accurate the points are.
- Face model. The 2D points are still ground truth; only the 3D mean face is stretched taller, squashed, widened or narrowed. The results are in the figure below.

The left chart changes the height, the right one the width, and the yellow bars are the average of the three angles. The 0 in the middle is the original face model, averaging about 8.7°; changing it by 40% in either direction raises the average to between 10.5° and 12.9°. Individual angles change even more: make the face model 40% narrower and yaw jumps from about 6° to about 17.6°. Everyone's face has different proportions, so a mean face model is a little off for everybody.
- Detector landmarks instead. With Dlib's 68-point model, the mean error is about 15.8°; with FAN, the best at the time, it's about 9.5° with 68 points and about 9.1° with 12.
Put the four experiments together, and even with perfectly correct landmarks, solving PnP with a mean face only gets to 8.65°, and pitch is especially bad, still 11.8° with 12 ground-truth points.
The other route is to have a convolutional network read the angles straight from the image. The authors mention Patacchiola et al.'s shallow network and Chang et al.'s FacePoseNet, which regress pose directly, and multi-task networks such as KEPLER and Hyperface that output pose along the way. The authors point out that all previous work predicting head pose with convolutional networks regressed the three Euler angles directly with a mean squared error (MSE) loss, and that this approach does not achieve the best results on large-scale synthetic data like 300W-LP.
So how should the loss be designed?
Solving the Problem
Architecture

The backbone is an ImageNet-pretrained ResNet-50. A cropped head image is resized to and passed through ResNet-50 and global average pooling, leaving a 2,048-dimensional feature. Three parallel fully connected layers follow, one each for yaw, pitch and roll, each . The three heads share all the convolutional layers before them.
Each head's 66 outputs correspond to 66 angle bins. We'll follow a head at yaw 60° the whole way through.
66 Bins
The main text of the paper says only that the angles are binned within the ±99° range; in issue #1, the author added that there are 66 bins of 3° each, so the minimum and maximum angles the model can predict are −99° and +99°. , exactly the span from −99 to 99.
The official code uses np.digitize to turn a continuous angle into a bin index:
bins = np.array(range(-99, 102, 3)) # 67 edges: -99, -96, ..., 99
binned_pose = np.digitize([yaw, pitch, roll], bins) - 1 # bin index 0..65
Bin covers . A yaw of 60° falls in bin 53, which is . This index is the classification label, and cross-entropy asks the network to concentrate its probability on bin 53.
From Probabilities Back to an Angle
With classification alone, the answer is no finer than 3°. Hopenet takes the expected value over the softmax probabilities to turn the classification output back into a continuous angle. With the softmax probability of bin , the predicted angle is
First take the expected bin index, then convert it back to an angle with .

Suppose the network outputs the probabilities in the figure for this head's yaw. Bin 53 gets 0.55, its neighbors 52 and 54 get 0.20 each, bin 51 gets 0.05, and the other 62 bins are all 0.
As an angle, that's , 0.3° off the ground truth. Shift the probability a little either way and the expected value moves with it, so the resolution is no longer limited by the 3° bin width.
What Each Loss Takes Care Of
The loss for each angle is cross-entropy plus a weighted MSE:
is the cross-entropy, with the bin index as the label ; the MSE compares the expected value computed above with the continuous annotated angle. The cross-entropy weight is fixed at 1, and the regression weight is tried from 0 to 4 in the ablation. Yaw, pitch and roll each have one such loss, and all three are backpropagated together.
Why do the two terms need to coexist? Compare two outputs.
- First: bins 52 and 54 get 0.5 each, and bin 53 gets 0. The expected value is and the MSE is 0, yet the cross-entropy is , infinite, because the correct bin gets no probability at all.
- Second: the one in the figure, with 0.55 on bin 53. The cross-entropy is ; the expectation is 59.7°, a squared error of 0.09.
Cross-entropy looks only at how much probability the correct bin gets and ignores how the rest is spread; MSE looks only at the weighted center and ignores the shape of the distribution. As the authors put it, classification uses the very stable softmax and cross-entropy, so the network first reliably learns which neighborhood the pose is in; with one cross-entropy per angle, three signals are backpropagated through the network. The fine detail is left to the expectation and the regression term.
In the official training code, this is the following few lines (excerpted from train_hopenet.py, rewritten in Python 3, with comments added for this note):
idx_tensor = torch.arange(66, dtype=torch.float32).cuda(gpu) # bin indices 0..65
yaw, pitch, roll = model(images) # three [B, 66] logit tensors
loss_yaw = criterion(yaw, label_yaw) # cross-entropy against the bin index
yaw_predicted = torch.sum(softmax(yaw) * idx_tensor, 1) * 3 - 99 # expectation -> degrees
loss_yaw += alpha * reg_criterion(yaw_predicted, label_yaw_cont) # MSE against the raw angle
Pitch and roll are exactly the same. At test time there is no loss; only the expectation line remains.
Training Setup
The training setup in the paper is 25 epochs on 300W-LP, Adam, learning rate (, , ), with inputs normalized by the ImageNet mean and standard deviation. The two main released models use and .
Details the paper leaves out and only the code shows:
- Cropping. For 300W-LP, the bounding box of the 68 landmarks is taken and then randomly enlarged, with an enlargement factor drawn between 0.2 and 0.4: the top is extended by times the box height, each side by times the box width, and the bottom by times the box height. The top gets extra room so the forehead and hair are included. The image is then resized to 240 and randomly cropped to .
- Augmentation. Horizontal flips with probability one half, negating yaw and roll at the same time; blur with probability 5%. 300W-LP already contains flipped images, and issue #60 pointed out that the random flip is redundant; the author replied in agreement.
- Freezing. The first convolution layer and its BatchNorm have a learning rate of 0, the BatchNorm layers in the residual blocks are switched to eval mode so their statistics aren't updated, and the three fully connected layers get 5 times the backbone's learning rate.
- Test boxes. AFLW2000 is cropped using the dataset's landmarks; for BIWI, a Faster R-CNN face detector trained on WIDER FACE (packaged by the authors in Docker as Dockerface) is run first, and the crop is then loosely enlarged to keep the whole head.
Low Resolution
A head captured by a surveillance camera or a car's exterior camera may be only a few dozen pixels wide. The authors' hunch is that landmarks need detail and can't be found once the resolution drops, while pose needs only the overall shape of the head and is less bothered by blur.
The augmentation randomly shrinks images during training and scales them back up to the original size with nearest neighbor, forcing the network to get used to blurry heads. The authors trained three versions, with downsampling factors of 10× applied at random, a random integer from 1× to 10×, and a random pick from 1×, 6×, 11×, 16× and 21×.
Discussion
AFLW2000
All MAEs in the table are in degrees; the Yaw, Pitch and Roll columns are the MAE of each angle, and the last column is the average of the three. The α in the two Hopenet rows is the weight of the regression term.
| Method | Yaw | Pitch | Roll | MAE |
|---|---|---|---|---|
| Hopenet α=2 | 6.47 | 6.56 | 5.44 | 6.16 |
| Hopenet α=1 | 6.92 | 6.64 | 5.67 | 6.41 |
| 3DDFA | 5.40 | 8.53 | 8.25 | 7.39 |
| FAN (12 pts) | 6.36 | 12.28 | 8.71 | 9.12 |
| Dlib (68 pts) | 23.15 | 13.63 | 10.55 | 15.78 |
| GT points | 5.92 | 11.76 | 8.27 | 8.65 |
Compiled from Table 1 of the paper, rounded to two decimal places. "GT points" means solving PnP from the dataset's ground-truth 2D landmarks.
Hopenet α=2's average of 6.16° is the lowest in the table, 2.5° below the 8.65° from ground-truth landmarks. Almost all of the gap is in pitch and roll. In the yaw column, 3DDFA's 5.40° is actually the best, and even the ground-truth landmarks' 5.92° beats Hopenet; but every other method's pitch is above 8.5°, while Hopenet's is 6.56°.
One more condition to keep in mind. 300W-LP and AFLW2000 both come from the 3DDFA paper, and both have poses fitted with the same 3D face model, so the training and test sets agree on what "frontal" means. BIWI's annotations come from a depth camera and don't share that advantage, as we'll see again later.
BIWI
| Method | Yaw | Pitch | Roll | MAE |
|---|---|---|---|---|
| Hopenet α=2 | 5.17 | 6.98 | 3.39 | 5.18 |
| Hopenet α=1 | 4.81 | 6.61 | 3.27 | 4.90 |
| Hopenet* | 5.79 | 11.73 | 8.19 | 8.57 |
| KEPLER* | 8.08 | 17.28 | 16.20 | 13.85 |
| 3DMM + depth | 2.50 | 1.50 | 2.20 | 2.07 |
| FAN (12 pts) | 8.53 | 7.48 | 7.63 | 7.88 |
| Dlib (68 pts) | 16.76 | 13.80 | 6.19 | 12.25 |
| 3DDFA | 36.18 | 12.25 | 8.78 | 19.07 |
Compiled from Table 2 of the paper. The two rows marked * were trained on AFLW, the other Hopenet rows on 300W-LP; "3DMM + depth" is Yu et al.'s RGB-D method.
On BIWI it's the other way around: α=1 does better, at 4.90°. Against the 2.07° of the method that uses depth, there's still a long way to go; the authors describe it as "starting to close the gap." Pitch lags the most, 6.61° versus 1.50°, which the authors attribute to too few extreme-pitch examples in 300W-LP. 3DDFA is off by 36.2° in yaw on BIWI, and the paper doesn't analyze why.
Hopenet itself, trained on AFLW instead, scores 8.57° on BIWI, 3.7° worse than the 300W-LP version. 300W-LP is synthetic, but it's large and covers a wide range of angles, and it actually generalizes better than AFLW's real photos.
Trained on BIWI itself instead (averaged over three 70/30 video splits, weight decay 0.04), Hopenet's three angles are 3.29°, 3.39° and 3.00°, summing to 9.68°; Gu et al. (VGG regression, single-frame version) get 10.97° under the same conditions. For this table the paper reports the sum of the three angles, not the average.
AFLW and AFW
The older protocol trains and tests on AFLW. Hopenet's three angles are 6.26°, 5.89° and 3.82°, averaging 5.32°; KEPLER's are 6.45°, 5.85° and 8.75°, averaging 7.02°. Yaw and roll are both lower than KEPLER's, while pitch, at 5.89°, is a bit higher than KEPLER's 5.85°. The paper doesn't say how AFLW was split into training and test sets.
AFW has only rough yaw annotations for 468 faces; by convention, outputs are quantized to the nearest multiple of 15° and the share with an error within 15° is reported. Hopenet gets 96.15%, All-In-One 99.1% and Hyperface 97.7%. The authors say that at the 15° threshold this dataset is saturated and methods achieve over 95%; of the nine methods the paper compares, four clear 95%, All-In-One, Hyperface, the discrete version of KEPLER and Hopenet, while the rest range from 36.8% to 89.4%.
Ablation: How Big Should α Be?
| Setting | Yaw | Pitch | Roll | MAE |
|---|---|---|---|---|
| Regression only | 13.11 | 6.73 | 5.80 | 8.55 |
| α=0 | 11.63 | 7.12 | 5.97 | 8.24 |
| α=0.01 | 11.41 | 6.85 | 5.84 | 8.03 |
| α=0.1 | 10.27 | 6.87 | 5.42 | 7.52 |
| α=1 | 6.92 | 6.64 | 5.67 | 6.41 |
| α=2 | 6.47 | 6.56 | 5.44 | 6.16 |
| α=4 | 7.09 | 6.87 | 5.62 | 6.53 |
Compiled from Table 5 of the paper, ResNet-50, AFLW2000. "Regression only" is a ResNet-50 trained with MSE directly on the three angles; the rest use the multi-loss, with α the weight of the regression term. α=0 amounts to training with cross-entropy alone, still taking the expectation at test time.
- Both terms are needed. MSE alone gives 8.55°, cross-entropy alone 8.24°, and the two combined, at α=2, 6.16°. The authors say it works best when the two terms are of roughly the same magnitude.
- Almost all of the improvement is in yaw. From α=0 to 2, yaw drops from 11.63° to 6.47°; pitch only from 7.12° to 6.56°, and roll from 5.97° to 5.44°. 300W-LP's range of angles opens up mainly along yaw, and that's where the largest error is too.
- The backbone matters a lot. With the same multi-loss on AlexNet, the mean error for all four α values is between 13.7° and 16.3°, and yaw is above 24° every time.
Later, in issue #37 (September 2018), the author was asked why the combined loss works better. The answer was that the paper doesn't try to explain why; the author only hypothesized that training is more stable with the combined loss and that the lower test error may come from some sort of regularization, since these datasets are easy to overfit.
Low Resolution

The AFLW2000 images are first shrunk by 1×, 5×, 10× and 15× with nearest neighbor and then scaled back up; at 15× the head is only 20 to 30 pixels wide.
The green FAN line holds fairly steady up to 10×, then suddenly shoots to 47.5° at 15×: the landmarks can no longer be found. Hopenet without augmentation (dark blue) also deteriorates the whole way, reaching about 24.7° at 15×, worse than Dlib. The three versions with downsampling augmentation (red, yellow, purple) are all still between 10.6° and 12° at 15×.
The figure also shows the price. At original resolution (x1), the unaugmented version is about 6.4°, while the augmented versions land between 7.2° and 9.3°. For the pretrained model the README labels "robust to image quality," a user in issue #41 measured an average of 7.33° on AFLW2000, nearly 1° higher than α=1's 6.41°. The README itself says plainly that the first two models are "for validating paper results" and suggests the robust one for real data.
Code and Reproduction
The repo released three models trained on 300W-LP (α=1, α=2, robust α=1), along with the training and test code. Going through the issues turns up a few things.
The list of 1,969 images. The very first issue (December 1, 2017) was that the AFLW2000 numbers didn't match. The author replied that the 31 images beyond ±99° have to be filtered out first and that the list was available by email. Once the person who asked got the list, the numbers matched.
The defaults aren't the paper's settings. train_hopenet.py defaults to 5 epochs, a learning rate of and α=0.001, while the paper uses 25 epochs, and α=1 or 2. When issue #54 (February 2019) asked about α, the author said the released models used 1 or 2; a year later issue #93 asked again, and the author replied, "That's the default. Change to whatever you want."
Retraining is jumpy. In issue #10 (January 2018), someone trained with the paper's settings and saw the yaw loss stuck around 3,000; on March 1, 2018, the author replied that a bug that made training unstable with newer PyTorch versions had been fixed. In issue #64 (April 2019), someone's best retraining reached only yaw 8.80°, pitch 6.77° and roll 5.81°; the author said it was the same code that's online and suggested watching the validation loss and stopping early at its lowest point. The paper says a fixed 25 epochs, with no early stopping. Issue #131, from March 2024, posted the training loss at epoch 25, with pitch jumping between 7 and 56, and asked when to save a checkpoint; it got no reply.
The AFW figure. The AFW results were tested with a model trained on AFLW, so testing the 300W-LP models naturally doesn't match. In issue #9, the author said at the end of December 2017 that the AFW test code was coming "soon"; in January 2018, "Give me another week and it'll be up!"; in February, "in the coming weeks"; and in April, once more, about the test code and the AFLW-trained model, "I will make an effort to release the AFW testing code and the pre-trained model soon" (perpetually soon). The repo's code was last modified on February 27, 2018, and the README was edited as late as October 2019; neither of the two ever showed up.
Two more small things. The paper's third low-resolution version picks from 1×, 6×, 11×, 16× and 21×, but the code's 1 + np.random.randint(0,4) * 5 only ever picks 1, 6, 11 and 16. How tight the box is also affects the output: in issue #65, someone found that the same face gives clearly different angles with a tight box and with a loose one. The training crop leaves an extra at the top, so when you switch detectors, enlarge the box in those proportions.
BIWI Pitch: A Later Explanation
The paper attributes the lagging pitch on BIWI to 300W-LP's shortage of extreme-pitch examples.
In 2024, a paper by Cobo, Valle, Buenaposada and Baumela pointed out something else. BIWI's annotations come from fitting a head model to the Kinect's depth with ICP, while 300W-LP was labeled by 3DDFA, so the two sets of annotations already disagree on "frontal" by a fixed rotation. Train on 300W-LP and test on BIWI, and part of the error is this fixed offset, which has nothing to do with how accurate the model is. They estimated this fixed rotation from the predictions and annotations of the whole test set, removed it and recomputed. Hopenet's yaw, pitch and roll went from 4.81°, 6.61° and 3.27° to 4.53°, 3.08° and 2.83°, and the average from 4.89° down to 3.48°.
Pitch alone dropped by more than half. Keep in mind that this alignment uses the test set's own annotations and estimates a single rotation shared by the whole dataset; it suits comparing methods, but it can't be taken directly as the error you'd see in deployment.
What Came After
Hopenet's "bin classification plus expected-value regression" was later picked up by several papers. WHENet in 2020 kept the overall framework, switched to EfficientNet-B0 and extended yaw to the full 360°. L2CS-Net in 2022 moved the same trick over to the pitch and yaw of gaze.
6DRepNet, four years later, took a different road. It argues that binning throws away information and that Euler angles themselves misbehave near yaw ±90°, so it regresses 6 numbers directly and reconstructs a rotation matrix from them.
Conclusion
Hopenet showed that estimating the three angles directly from a face image, without landmarks, can be more accurate than "find the points, then solve PnP." It cuts each angle into 66 bins and, on top of classification, regresses the expected value of the probabilities. Trained on 300W-LP and tested on AFLW2000, its mean error is 6.16°, lower than the 8.65° from solving PnP with ground-truth landmarks; remove either the cross-entropy or the regression term, and the error goes back above 8°.
Its limits are just as clear. The output stops at ±99°, so it has no answer for a head facing away from the camera. When retraining, use the paper's 25 epochs and α; the defaults in the code are a different set.
Looking back now, 6DRepNet later replaced Hopenet's Euler angles with a 6D representation, yet the bins-plus-expected-value trick has been carried forward ever since, and L2CS-Net even took it over to gaze estimation.