Bengal-HP_RU: A Dataset of Bengal People For Head Pose Estimation


1 Introduction↩︎

Accurate head pose estimation depends critically on the availability of large-scale, diverse, and representative training data. While several head pose datasets exist in the literature [1][4], they predominantly feature subjects of Western or East Asian origin, with little to no representation of South Asian populations, particularly Bengali individuals. Facial geometry, skin tone distribution, and cultural appearance attributes (such as attire and accessories) vary across ethnic groups, and models trained on non-representative datasets often generalise poorly to underrepresented demographics. To address this gap, we introduce Bengal-HP_RU, a large-scale head pose dataset curated specifically to capture the demographic and contextual diversity of Bengali individuals. Bengal-HP_RU is, to the best of our knowledge, the first publicly available head pose dataset centred on Bengali subjects. It offers in-the-wild image conditions, rich diversity in age, gender, occlusion patterns, and illumination, making it a valuable resource for training and evaluating robust head pose estimation models in real-world scenarios. Figure 1 illustrates the complete dataset creation pipeline of Bengal-HP_RU, from face detection in the acquired image through to manual correction of the final label.

Figure 1: Overview of the Bengal-HP_RU dataset creation pipeline: face detection and cropping, masking of extra faces, 3D face mesh generation, 6-point pose estimation via solvePnP, and final manual label correction.

2 Image Acquisition↩︎

All images in Bengal-HP_RU were collected from Wikimedia Commons, a repository of freely licensed media content. We conducted targeted searches using Bengali-relevant keywords and categories and retrieved a total of 3,591 images depicting individuals of Bengali origin in unconstrained, in-the-wild settings. For each collected image, we also retrieved associated metadata, including the original filename, title, image URL, Wikimedia page link, uploader information, upload and original capture dates, image description, artist attribution, licensing details, and categorical tags. The in-the-wild nature of the source ensures that the dataset reflects realistic imaging conditions, encompassing natural variation in pose, background clutter, partial occlusion, and ambient lighting, conditions that are frequently encountered in practical deployment scenarios but often underrepresented in laboratory-collected datasets.

3 Image Processing↩︎

Following image acquisition, each image was passed through an automated processing pipeline to isolate individual face crops suitable for head pose annotation. Face detection was performed using the YOLOv8-Face medium model [5], which provides accurate bounding box predictions across a wide range of face sizes, orientations, and occlusion levels. Detected faces were then cropped with a standardised margin. To prevent label ambiguity and training noise, images containing multiple detected faces were masked such that non-target faces were excluded from the visible region. This ensured that each processed sample corresponded to a single, unambiguous subject.

4 Train/Test Split↩︎

To prevent data contamination between the training and evaluation subsets, the dataset was partitioned based on the Wikimedia Commons uploader identifier. Since individual uploaders often contribute multiple images of the same subject or from the same event, a subject-aware or session-aware split based on uploader identity ensures that images originating from the same source do not appear in both the training and test sets simultaneously. The split was performed using a greedy algorithm that first sorts uploaders by their total image count in descending order, then assigns uploaders to the training set until the 80% image target is reached, with all remaining uploaders assigned to the test set. This approach offers two complementary advantages over a naive random split: it prevents images of the same subject or event from leaking across the train/test boundary, and by concentrating high-volume uploaders in training, it reserves a broad spread of unseen uploaders for evaluation, better reflecting generalisation to new, previously unencountered sources. The resulting split comprises 2,876 training source images and 715 test source images, yielding 10,494 and 2,400 cropped head images respectively, totalling 12,894 head images across 296 unique uploaders, as summarised in Table 1.

Table 1: Train/test split statistics of the Bengal-HP_RU dataset.
Train Test Total
Uploaders 21 275 296
Source Images 2,876 715 3,591
Head Images 10,494 2,400 12,894

5 Head Pose Label Generation↩︎

We generated head pose labels through a two-stage annotation process combining automated geometric estimation with manual correction. Each image was first processed through a pipeline to extract face landmarks and compute pitch, yaw, and roll angles. These automatically derived angles were then used as a reference during a manual review stage, where every image was inspected and labeled individually.

Stage 1: Automated Pose Estimation↩︎

We built an automated pipeline using MediaPipe and OpenCV to process each image and estimate the head pose from facial geometry. The pipeline runs sequentially through landmark detection, key point extraction, 3D pose solving, and angle computation before saving the results per image.

  • Step 1: Detecting Face Landmarks

    First, we load each image using OpenCV. We then use MediaPipe’s [6] FaceMesh model on the image and generate 478 normalized landmarks. These landmarks are then converted into real pixel coordinates by multiplying \(x\) by the image width and \(y\) by the image height, with the \(z\) depth also scaled by width.

  • Step 2: Picking Six Key Facial Points for Pose Estimation

    From the 478 landmarks, six specific anatomical points are extracted to be used in the pose estimation step. These points are: the nose tip, chin, left eye corner, right eye corner, left mouth corner, and right mouth corner. These six points serve as the 2D image points that anchor the geometry calculation in the next step.

  • Step 3: Running solvePnP

    We define a canonical 3D face model as a fixed set of idealized 3D coordinates for the same 6 facial landmarks, representing an average human face in 3D space. We also construct a camera matrix assuming a simple pinhole camera, with the focal length approximated as the image width and the principal point placed at the image center. We then apply OpenCV’s solvePnP to solve the pnp problem, i.e., given the 6 known 3D model points and their corresponding 2D pixel locations, it estimates the rotation and translation that best explain the observed face configuration. The output is a rotation vector and a translation vector.

  • Step 4: Converting to Euler Angles

    We convert the rotation vector from solvePnP into a \(3 \times 3\) rotation matrix using cv2.Rodrigues, which is then decomposed into pitch, yaw, and roll using OpenCV’s RQDecomp3x3. We normalize all angles to the range \([-180^\circ, 180^\circ]\) and apply a correction for flipped solutions, a known ambiguity in solvePnP, by mirroring pitch or roll back to their stable equivalent when either exceeds \(\pm 90^\circ\). The face mesh (478 landmarks), 68 most informative landmarks, selected from the full set of 478, are saved alongside the face bounding box and the computed Euler angles in a per-image .npz file for use in downstream tasks.

Stage 2: Manual Label Correction↩︎

Since solvePnP relies on an idealized 3D face model and a rough camera approximation, the automatically computed angles can be unreliable on borderline or unusual head orientations. To address this, we developed a custom head pose annotation tool (Figure 2) that displayed each image alongside its automatically computed angles and allowed annotators to adjust the label manually. The 68 facial landmarks overlaid on each image played a key role during this process. They provided a precise visual reference of the face geometry, making it easier to judge the true head orientation even in ambiguous or extreme poses. The entire reannotation was carried out by a single annotator to ensure consistency across the dataset. Additionally, images that were flagged during the automated stage for having no detected face, false detections, or visibly poor quality were reviewed and excluded from the dataset entirely to ensure annotation reliability.

Figure 2: Our custom head pose annotation tool. For each image, the tool overlays the 68 facial landmarks and a 3D pose axis (red, green, and blue arrows) on the detected face, along with the computed pitch (P), yaw (Y), and roll (R) values. Annotators could adjust the angles using the sliders at the bottom and save, reset, or exclude each image individually.

6 Dataset Characteristics↩︎

The resulting Bengal-HP_RU dataset comprises a total of 12,894 labelled head images annotated with continuous yaw, pitch, and roll values. The dataset exhibits substantial diversity along several axes, including subject age, gender, image resolution, background and lighting conditions, and degree of facial occlusion. Representative samples illustrating this diversity are shown in Figure 3.

Figure 3: Representative samples from the Bengal-HP_RU dataset demonstrating the diversity in subject demographics, backgrounds, image quality, occlusion patterns, and illumination conditions.

7 Dataset Structure↩︎

The dataset is organised into two subsets, train and test, each containing a directory of cropped head images and a corresponding directory of per-image .npz files. The .npz files store the 68 facial landmarks, face bounding box, and computed Euler angles for each image. The metadata of the source images for each subset is provided in train.csv and test.csv, respectively. The full directory structure is as follows:

Bengal-HP_RU/
|-- train.csv
|-- test.csv
|-- demo.py                  # Example script for loading NPZ annotations 
|                               and visualizing them on an image
|-- train/
|   |-- images_train/        # 10,494 cropped head images
|   `-- npz_train/           # 10,494 per-image .npz files
`-- test/
    |-- images_test/         # 2,400 cropped head images
    `-- npz_test/            # 2,400 per-image .npz files

8 Limitations↩︎

The Bengal-HP_RU dataset has several limitations worth noting. The facial landmarks stored in the .npz files are generated automatically by MediaPipe and are not manually corrected, and may therefore be inaccurate in challenging poses or occlusion conditions. Finally, manual annotation was performed by a single annotator, which, while ensuring label consistency, introduces the risk of individual bias in the final pose labels.

9 Ethical Considerations and Data Integrity↩︎

All images in Bengal-HP_RU were sourced exclusively from Wikimedia Commons and are covered by free and open licences permitting reuse. No images were collected through direct subject recruitment, and no personally identifiable information beyond what is publicly available on Wikimedia Commons is retained or distributed. The dataset is intended solely for non-commercial computer vision research.

10 Dataset Availability↩︎

The Bengal-HP_RU dataset is publicly available on Mendeley Data at https://doi.org/10.17632/xbw9kr37jb.2.

References↩︎

[1]
G. Fanelli, M. Dantone, J. Gall, A. Fossati, and L. Van Gool, “Random forests for real time 3D face analysis,” International Journal of Computer Vision, vol. 101, no. 3, p. 437?458, Aug. 2012, doi: 10.1007/s11263-012-0549-0.
[2]
X. Zhu, Z. Lei, X. Liu, H. Shi, and S. Z. Li, “Face alignment across large poses: A 3D solution,” Jun. 2016, p. 146?155, doi: 10.1109/cvpr.2016.23 , booktitle = {IEEE Conference on Computer Vision and Pattern Recognition (CVPR)}.
[3]
G.-S. Hsu, W.-F. Huang, and M. H. Yap, “Edge-embedded multi-dropout framework for real-time face alignment,” IEEE Access, vol. 8, pp. 6032–6044, 2020, doi: 10.1109/ACCESS.2019.2960325.
[4]
T. Martyniuk, O. Kupyn, Y. Kurlyak, I. Krashenyi, J. Matas, and book Sharmanska Viktoriia, “2022 IEEE/CVF conference on computer vision and pattern recognition (CVPR) , title=DAD-3DHeads: A Large-scale Dense, Accurate and Diverse Dataset for 3D Head Alignment from a Single Image,” 2022, pp. 20910–20920, doi: 10.1109/CVPR52688.2022.02027.
[5]
Yusepp, “YOLOv8-face.” 2023 , howpublished = {\url{https://github.com/Yusepp/YOLOv8-Face}}, note = {GitHub repository}.
[6]
C. Lugaresi et al., “MediaPipe: A framework for building perception pipelines.” arXiv, 2019, doi: 10.48550/ARXIV.1906.08172.