{'fraction_non_alphanumeric': 0.04044398657405869, 'fraction_numerical': 0.01957395899106045, 'mean_word_length': 4.769171779141105, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
DigiFace-1M: 1 Million Digital Face Images for Face Recognition

State-of-the-art face recognition models show impressive accuracy, achieving over 99.8% on Labeled Faces in the Wild (LFW) dataset. Such models are trained on large-scale datasets that contain millions of real human face images collected from the internet. Web-crawled face images are severely biased (in terms of race, lighting, make-up, etc) and often contain label noise. More importantly, the face images are collected without explicit consent, raising ethical concerns. To avoid such problems, we introduce a large-scale synthetic dataset for face recognition, obtained by rendering digital faces using a computer graphics pipeline. We first demonstrate that aggressive data augmentation can significantly reduce the synthetic-to-real domain gap. Having full control over the rendering pipeline, we also study how each attribute (e.g., variation in facial pose, accessories and textures) affects the accuracy. Compared to SynFace, a recent method trained on GAN-generated synthetic faces, we reduce the error rate on LFW by 52.5% (accuracy from 91.93% to 96.17%). By fine-tuning the network on a smaller number of real face images that could reasonably be obtained with consent, we achieve accuracy that is comparable to the methods trained on millions of real face images.


Introduction
Learning-based face recognition models [29,23,33,35,8,15,24,18] use Deep Neural Networks (DNNs) to encode the given face image into an embedding vector of fixed di-mension (e.g., 512). These embeddings can then be used for various tasks, such as face identification (who is this person) and verification (are they the same person). To learn diverse, discriminative embeddings, the training dataset should contain a large number of unique identities. To learn robust embeddings, i.e., which are not sensitive to the changes in pose, expression, accessories, camera and lighting, the dataset should also contain a sufficient number of images per identity with these variations.
Publicly available face recognition datasets satisfy both. MS1MV2 [8] contains 5.8M images of 85K identities (approx. 68 images per ID). Recently released Web-Face260M [43] contains 260M images of 4M identities (approx. 65 images per ID). While such datasets have driven recent advances in face recognition models, there are several problems associated with them.
(1) Ethical issues. Large-scale face recognition datasets are often criticized for ethical issues including privacy violation and the lack of informed consent. For example, datasets like [39,12,8,43] are obtained by crawling web images of celebrities without consent. To increase the number of identities, some datasets exploited the term "celebrities" to include anyone with online presence. Datasets like [17,26] collected face images of the general public (including children) from Flickr [3]. Projects like MegaPixels [4] are exposing the ethical problems of such web-crawled face recognition datasets. Following severe criticism, public access to several datasets has been removed [2].
(2) Label noise. Web images collected by searching the names of celebrities often contain label errors. For example, the Labeled Faces in the Wild (LFW) dataset [14] contains several known errors including: (1) mislabeled images; (2) distinct persons with the same name labeled as the same per- (3) Data bias. Face recognition models are generally trained and tested on celebrity faces, many of which are taken with strong lighting and make-up. Celebrity faces also have imbalanced racial distribution (e.g., 84.5% of the faces in CASIA-WebFace [39] are Caucasian faces [34]), leading to poor recognition accuracy for the under-represented racial groups [34].
In order to circumvent all these issues that affect the existing real face datasets, we introduce a new large-scale face recognition dataset consisting only of photo-realistic digital face images rendered using a computer graphics pipeline and make this dataset available to the community. Specifically, we build upon the face generation pipeline introduced by Wood et al. [36], tailoring the amount of variability for each attribute (e.g., pose and accessories) for our recognition task, and generate 1.22M images with 110K unique identities. Each identity is generated by randomizing the facial geometry and texture as well as the hair style. The generated face is then rendered with different poses, expressions, hair color, hair thickness and density, accessories (including clothes, make-ups, glasses, and head/face wear), cameras and environments, to encourage the network to learn a robust embedding. Figure 1 shows examples of synthetic face images in this new dataset. We generated 1.22M images, but in practice the number of identities and images you can generate with synthetics pipeline is only limited by the cost of generating and storing these images.
Digital synthetic faces can solve the aforementioned problems associated with the real face datasets. Firstly, the generated faces are free of label noise. Secondly, the bias in lighting, make-up and skin color can be reduced as we have full control over those attributes. Most importantly, the face generation pipeline does not rely on any privacy-sensitive data obtained without consent. This is a critical difference from the GAN-generated synthetic faces; face GANs rely (either directly or indirectly) on large-scale real face datasets to train some components of their pipeline, leaving unresolved ethical problems. For ex-ample, a recent method called SynFace [28] was trained on synthetic faces generated using DiscoFaceGAN [9]. While the generated face images are free of label noise, millions of real face images were used for training DiscoFaceGAN. The GANs may also inherit any bias that exists in the real face images used to train them. For our dataset, only 511 face scans, obtained with consent, were used to build a parametric model of face geometry and texture library [36]. From this limited source data, we can generate infinite number of identities, making our approach easily scalable.
Our contributions can be summarized as below: • We release a new large-scale synthetic dataset for face recognition that is free from privacy violations and lack of consent. To the best of our knowledge, our dataset, containing 1.22M images of 110K identities, is the largest public synthetic dataset for face recognition.
• We demonstrate how the proposed synthetic dataset can be used in conjunction with a small number of real face images to substantially improve the accuracy. This simulates a scenario where a small number of curated (i.e., no label noise and reduced bias) real face images are collected with consent. By fine-tuning our network with only 120K real face images (i.e., 2% of the commonly-used MS1MV2 dataset [8]), we achieve 99.33% accuracy on LFW and 93.61% on average across the five benchmarks, which is comparable to the methods trained on millions of real face images.
• Having full control over the rendering pipeline, we perform extensive experiments to study how each attribute (e.g., variation in facial pose, accessories and textures) affects the face recognition accuracy.

Related Work
Face recognition datasets with real face images. Major tech companies can utilize private data to train their face recognition models. Google used 100M-200M images of 8M identities to train FaceNet [29], and Facebook used 500M images of 10M identities [31]. It is challenging to construct datasets of comparable size using face images that are publicly available. Public datasets generally rely on celebrity images [14,39,12,43] or web images that are posted with Creative Commons license [17,26]. As discussed in section 1, such datasets have ethical issues and suffer from label noise and data bias. Synthetic faces generated using deep generative models.
Deep generative models such as GANs [11] can produce photo-realistic images and have been used to generate synthetic data to train face recognition [32,28]. While traditional generators (e.g., [16]) generate a face image from a single latent vector that changes both the identity and its appearance, DiscoFaceGAN [9] learned disentangled latent representations for identity, pose, expression and illumination. SynFace [28] used DiscoFaceGAN to generate a synthetic dataset for face recognition, consisting of 10K identities and 500K images. SynFace achieved 91.93% accuracy on LFW dataset [14], and by mixing the synthetic dataset with 2K real identities (20 images each), the accuracy was pushed up to 97.23%. However, their performance is poor for large-pose-variation datasets (e.g., 75.03% on CFP-FP [30] and 70.43% on CPLFW [41]). This is mainly because it is challenging to train a 2D GAN to produce images that preserve 3D geometric consistency [10]. Synthetic faces generated using 3D parametric models. Classical 3D parametric face models such as morphable models [5] explicitly model the identity independently from other parameters which makes them well suited for generating face recognition datasets. However, previous results obtained with this kind of synthetic images have shown limited performance [20,19] unless combined with a large number of real images. This can be due to the lack of realism and variability in the models that have been used to generate the faces. Wood et al. [36] introduced a pipeline for generating and rendering diverse and photo-realistic 3D face models. A generative face model, learned from the 3D scans of 511 individuals, is used to generate a random 3D face. The face is then combined with artist-created assets (e.g., texture, hair, accessories) and is rendered under a random environment (simulated with HDRIs -high dynamic range images). The rendered synthetic face images (and the corresponding autogenerated ground truth annotations) were used to learn various face analysis tasks such as face parsing [36], landmark localization [36,37] and face reconstruction [37], demonstrating state-of-the-art performance. In this paper, we aim to demonstrate that such photo-realistic rendered synthetic faces can be used to tackle face recognition.
Accessory #1 Accessory #2 Accessory #3 Accessory #4 Figure 2. Each row shows the same identity rendered with different accessory setups. Accessories include clothes, glasses, makeup (e.g., eyeshadow and eyeliner), face-wear and head-wear. The color, density and thickness of facial and head hair are also randomized. The hair style is modified only when the sampled accessory conflicts with the original hair style.

Color Density Thickness
Randomize Color Density Thickness + Style Figure 3. Randomizing the hair style makes the problem unnecessarily difficult (see the bottom row), as most people maintain similar hair styles. Therefore, we only randomize the color, density and thickness of the hair as shown in the top row (the hair is also randomly flipped horizontally).

Digital Faces for Face Recognition
This section explains how the proposed dataset is generated. We first explain how digital faces are controlled, rendered and aligned to create the dataset (subsection 3.1). After providing the dataset statistics (subsection 3.2), we introduce the data augmentation details which help in minimizing the synthetic-to-real domain-gap (subsection 3.3).

Face Rendering
We build upon the face generation and rendering pipeline introduced by Wood et al. [36]. In this section, we explain the modifications we made to the original pipeline to create a large-scale dataset for face recognition.
We define identity as a unique combination of facial geometry, texture (albedo and displacement), eye color and hair style. For each identity, we render a number of im- ages where all other parameters are varied to encourage the network to learn robust embeddings. While hair style can change for an individual, most people maintain similar hair style (for both facial and head hair) which makes hair style an important cue for the person's identity. Consequently, for the same identity, we randomize only the color, density and thickness of the hair (see Figure 3 for examples), and the hair style is only changed when the added head-wear is not compatible with the original hair style to avoid intersection (e.g., third image of top row in Figure 2). For sampling facial geometry, texture and eye color we follow [36].
For a given identity, we sample different accessories including clothing, make-up, glasses, face-wear (e.g., face masks) and head-wear (e.g., hats). After selecting the clothing randomly from the digital wardrobe, other accessories are added with probability p = {0.15, 0.15, 0.01, 0.15} respectively. We also add hands and secondary faces with a small probability (p = 0.01) to simulate the case when (1) the face is occluded by hands and when (2) there are multiple faces in the image. Figure 2 shows examples of the sampled identities rendered with different sets of accessories.
For each accessory setup, we vary the pose, expression, camera and environment (lighting and background) to render multiple images. The camera is rotated around the face, both horizontally and vertically. Horizontal angle is sampled from a truncated zero-mean normal distribution with support θ hori ∈ [−90 • , 90 • ]. The variance is set such that the probability density p(θ hori = 90 • ) equals This allows us to render a wide range of poses while making sure that frontal views are rendered more often. Lastly, the face is randomly translated within the viewing frustum to add additional perspective distortion. For pose, expression, and environment sampling, we follow [36]. Figure 4 shows the impact of varying the pose, expression, environment and camera for the same identity and accessory setup. Face alignment. The input to the face embedding network should be an aligned crop around the face. Instead of de-

Rendered Image
Landmarks Aligned Image Rendered Image Landmarks Aligned Image Figure 5. For synthetic faces, it is trivial to extract the locations of ground-truth facial landmarks (e.g., eyes, nose-tip and mouth corners) and align the crop around the face. This enables robust face alignment, even when some of the landmarks are not visible.
tecting facial landmarks using pre-trained DNNs (such as MTCNN [40] and RetinaFace [7]), we align the faces using the ground truth landmarks (see Figure 5), which enable robust alignment even when some landmarks are not visible.
Limitations. The face generation pipeline [36] we build upon has a number of limitations resulting in domain-gap to real face images. Particularly relevant to face recognition is that we cannot generate the same person at different ages. While we simulate aging to some extent by randomizing the color, density and thickness of the hair (as hair typically becomes grayer, sparser and thinner during aging), more work should be done to faithfully simulate aging. Lack of coverage (e.g., no jewelry and tattoos) may also mean that the distribution of the synthetic data does not match reality.

Dataset Statistics
The proposed dataset consists of two parts. The first part contains 720K images with 10K identities. For each identity, 4 different sets of accessories are sampled and 18 images are rendered for each set (i.e., 72 images-peridentity). Since many views of the same face are available, the network can learn embedding that is robust to the changes in accessories, camera, pose, expression, and environment. The second part contains 500K images with 100K identities. For each identity, only one set of accessories is sampled and only 5 images are rendered. This part was added to substantially increase the total number of identities with small rendering cost. Ensuring sufficient number of identities is important since the network should learn to distinguish between similar-looking faces of different identities. We show in the experiments that mixing the two parts leads to better accuracy than using one of them (Table 3).

Data Augmentation
The quality of in-the-wild face images can vary significantly. Certain parts of the face may be occluded, and the images are subject to distortion and noise that are specific to each camera. As our synthetic faces are rendered with controlled quality using a perfect pinhole camera, aggressive data augmentation is needed to reduce the synthetic-to-real domain-gap. We first apply random horizontal flipping and cropping, following [18]. Then, we apply two sets of augmentations -appearance and warping. Figure 6 shows train-  Figure 6. Synthetic face images at different stages of data augmentation. Aggressive augmentation helps to simulate effects such as motion blur and distortion common in real-world images and thus improve the robustness of DNNs trained on synthetic images.
ing images with these augmentations. Note that we apply the data augmentation on-the-fly during training, i.e., each epoch sees different random augmentations. For each type of augmentation, we indicate its probability p to be applied on a sample image. Appearance augmentation. We apply random Gaussian blur (p = 0.05) and Gaussian noise (p = 0.035). By applying the Gaussian blur along a random direction using an anisotropic covariance, we also simulate motion blur (p = 0.05). Brightness, contrast, hue and saturation are randomized with p = {0.15, 0.3, 0.1, 0.1}. Images are converted into grayscale with p = 0.01. Lastly, the image quality is randomized by downsampling-and-upsampling (p = 0.01) and JPEG compression (p = 0.05). Warping augmentation. Warping is performed by randomly shifting the four corners of the image. Firstly, the aspect ratio is randomized with p = 0.1. Then, all images undergo random scaling, rotation and shift. Lastly, the four corners are shifted differently for additional distortion.

Experimental Setup
Implementation details. Synthetic faces are rendered using Cycles renderer [1], with 256 samples per pixel. The rendering of the full dataset took approximately 10 days, using 300 NVIDIA M60 GPUs. The images are rendered at 256×256 resolution, and the aligned crop around the face is resized into 112×112. We use ResNet-50 [13] backbone for the experiments in subsection 5.1, 5.2 and 5.3. For comparison against the state-of-the-art methods in subsection 5.4, we use their encoder architecture to ensure fair comparison. For all experiments, the networks are implemented with Py-Torch [27] and are trained for 40 epochs using SGD. The batch size is set to 256 and the networks are trained on four NVIDIA P100 GPUs. We follow the learning rate scheduling of [28], and use the training loss from [18]. Note that all networks are trained from scratch (not pre-trained on, e.g., ImageNet [6]), to make sure that no real images are used. Evaluation protocol. Following state-of-the-art methods [15,21,24,22,18], we report the face verification accuracy on five benchmark datasets -LFW [14], CFP-FP [30], CPLFW [41], AgeDB [25] and CALFW [42]. LFW contains 6,000 pairs of in-the-wild face images. CFP-FP and CPLFW have larger pose variation (CFP-FP specifically compares frontal views to profile views). AgeDB and CALFW have larger age variation.

Experiments
We run a series of experiments to demonstrate the usefulness of the proposed dataset. Subsection 5.1 compares different data augmentations. In subsection 5.2, we train the network on various different subsets of the full dataset to understand how each attribute sampling in rendering affects the accuracy. In subsection 5.3, we show that our synthetic faces can be used in conjunction with a small number of real faces to substantially improve the accuracy. Lastly, we provide comparison against the state-of-the-art methods in subsection 5.4.

Data Augmentation
In subsection 3.3, we introduced appearance and warping augmentations. As shown in Table 1, both lead to significant improvement across all datasets. We also compare against the augmentation used by AdaFace [18], which includes horizontal flipping, cropping and mild color augmentation. For our synthetic face images which are free of imperfection, more aggressive data augmentation is needed to reduce the domain-gap. Notice that the warping augmentation improves the performance especially for the largepose-variation datasets (CFP-FP and CPLFW).

Dataset Composition
Having full control over the rendering pipeline, we can create a dataset with desired statistics to study how each attribute affects the face recognition accuracy. The results are provided in Table 2. Accessory sampling. For 10K synthetic identities, we sampled 4 accessory setups and rendered 18 images for each setup (i.e., 720K images in total). These 18 images have variations in pose, expression, camera, and environment (see Figure 4). From this, we can create a subset of 180K images by selecting 18 images per ID with fixed accessory. Similarly, we can select 18 images randomly so that images with different accessories are used during training. When randomizing the accessories, we also randomized the color, thickness and density of the hair to simulate aging (Figure 3). As a result, the accuracy is improved especially for the large-age-variation datasets (AgeDB and CALFW). For CFP-FP and CPLFW, which has smaller age gap (i.e.,  Table 2, increasing the variation in horizontal and vertical angles improved the accuracy especially for the large-posevariation datasets (CFP-FP and CPLFW). For AgeDB and CALFW, which consists mainly of frontal faces, the accuracy was similar. Texture sampling. While we can create infinite number of unique facial geometries, the texture is sampled from a li-brary built from 208 scans of real human faces (obtained with consent). Since we generated 110K identities in total, many of them share the same texture. To see how the number of textures affects the accuracy, we created a dataset of 1200 identities with N textures, by generating 1200/N identities for each texture. As shown in Row 6-9 of Table 2, increasing the number of textures did not lead to a meaningful improvement in the accuracy. This is contrary to the intuition that small number of textures and lack of texture generative model are limitations of synthetic data for face recognition. We believe that the appearance variability is a combination of geometry, texture, hair, accessories, environment and image quality. In Figure 7, we show that (1) the texture library already covers diverse skin color and age, (2) an arbitrary number of unique identities can be generated with the same texture, and (3) skin appearance is greatly affected by the environment. Also, the image quality for face recognition task is in general limited due to low resolution and data augmentation. Thus, the contribution of texture variation is likely less important than that of geometry and environment. Balance between # IDs and # images/ID. Ensuring large number of IDs is important for learning diverse discriminative embedding. On the other hand, large number of images per ID (referred to as images/ID) is needed for learning robust embedding (that is not affected by the changes in pose, accessories, expressions, camera and environment). Mixing the two datasets with different number of images/ID can be considered as an efficient way of getting the best of both. This also simulates the long-tailed distribution of real face datasets (i.e., most identities have small number of images).
The result in Table 3 shows that mixing the two datasets leads to better accuracy than using one of them.   Table 3. Number of IDs and number of images/ID should both be high to learn diverse and robust embedding. Mixing two datasets with large/small number of images/ID can be an efficient way of satisfying both. The overall accuracy becomes higher than relying on one of the two datasets.

Mixing with Real Faces
The main problems associated with large-scale real face datasets are ethical issues, label noise and data bias. In this study, we assume a scenario where a small number of real face images are collected with consent. For small number of images, it would also be possible to remove (or reduce) the label noise and data bias.
For synthetic data, we used 10K identities with 72 images per identity. For real face images, we varied the number of identities from 200 to 2000, with 20 images sampled for each identity (the identities and images were sampled randomly from CASIA-WebFace [39]).
We first tried training only on the synthetic data. Secondly, we tried training only on the real data. Then, we explored two different strategies for using both real and synthetic images: (1) dataset mixing and (2) pre-training on synthetic data and fine-tuning on the real data. For finetuning, we reduced the learning rate by 1/10 for the prediction head, and 1/100 for the encoder to avoid catastrophic forgetting. The results are provided in Figure 8.
When the network is trained only on a small number of real face images, the accuracy is worse than the network trained only on our synthetic dataset. Both dataset mixing and pre-training can lead to significantly higher accuracy, especially for the large-pose-variation datasets (CFP-FP and CPLFW). Compared to dataset mixing, pre-training on synthetics followed by fine-tuning on real images led to better accuracy. This can be due to the imbalance between the number of images (we use 720K synthetic images, and a lot fewer real images).

Comparison to the State-of-the-Art
Comparison to SynFace. SynFace [28] is the current state-of-the-art for face recognition model trained on synthetic faces. They used DiscoFaceGAN [9] to generate 500K synthetic faces (10K identities & 50 images/ID). To ensure a fair comparison, we trained the same encoder (LResNet50E-IR) with same number of images. We also trained using our full dataset (1.22M images). The results are provided in Row 1-3 of Table 4. In the second scenario, we additionally used 40K real face images from CASIA-WebFace [39]. While SynFace mixed their synthetic dataset with the real faces, we instead adopted the two-stage method of pre-training and fine-tuning as discussed in subsection 5.3. The results are provided in Row 4-6 of Table 4. For both scenarios, we significantly outperform SynFace across all datasets. This suggests that our rendered synthetic faces are better than GAN-generated faces for learning face recognition. While GANs like [9] can generate realistic face images, the data they generate is not ideal for face recognition, due to following reasons: (1) Identity change. While [9] is encouraged to preserve the identity when changing other latent variables, there is no guarantee that the identity will be preserved during data generation. (2) Geometric inconsistency. As pointed out by [10], the images generated  Table 5. Comparison to the state-of-the-art methods trained on real face images (MS1MV2 [8]). We use the same backbone (ResNet100) for fair comparison. By only using 120K real face images (2% of MS1MV2 [8]), we achieve accuracy that is comparable to the methods trained on millions of real face images. Since we do not model aging explicitly, our accuracy is worse for large-age-variation datasets (AgeDB and CALFW). Avg † shows average of LFW, CFP-FP and CPLFW, and on these, we outperform [35] and are similar to [23].
by [9] for same identity and different poses lack 3D consistency.
[9] cannot randomize accessories. (4) Unresolved ethical concerns. Training the GAN model itself requires large-scale real face dataset. For example, 70K images are used to train [9]. To learn to preserve identity, they also used a perceptual loss based on [38], which is trained on 3M real face images. In Row 2 and 3 of Table 4, we increase our synthetics dataset size from 500K to 1.22M, and achieve better accuracy. This indicates that the accuracy may not have converged yet and could be improved further by generating more synthetic data. Comparison to methods trained on real faces. Lastly, we compare the accuracy against the methods that are trained on real face images. In Table 5, we provide the accuracy of six methods that use ResNet100 as the embedding network and MS1MV2 [8] as the training data. We trained the same architecture on our synthetic dataset (Row 1). We also tried fine-tuning the network on a small number of real face images (Row 2). When trained only with the proposed synthetic dataset, the network can achieve 96.17% on LFW. For LFW, CFP-FP and CPLFW (excluding the highage-variation datasets), the average accuracy is 89.40%. By fine-tuning the network on just 120K images (2.0% of MS1MV2), the accuracy becomes comparable to the methods trained on MS1MV2 (e.g., average accuracy on LFW, CFP-FP and CPLFW becomes higher than that of SV-AM-Softmax [35]).
The performance of our method on AgeDB [25] and CALFW [42] has a significantly larger gap than for the other datasets evaluated. This is expected given the lack of aging simulation in our synthetic data. We suspect that other causes of domain-gap, as described at the end of subsection 3.1, are the primary reason for the remaining performance gap for other evaluation datasets. Reducing this domain-gap remains an area of ongoing work for our synthetic data and is likely to result in improved performance for all downstream tasks, including face recognition. We leave this as future work.

Conclusion
In this paper, we introduced a new large-scale synthetic dataset for face recognition by rendering digital faces using a graphics pipeline. We ran extensive experiments to study how data augmentation and various other attributes affect the accuracy. We demonstrated that our synthetic faces are significantly better than the GAN-generated faces for learning face recognition. With a small number of real face images, we achieve accuracy that is comparable to the methods trained on millions of web-crawled face images. We hope this dataset would be a meaningful step towards developing socially responsible face recognition models that do not depend on privacy-sensitive data obtained without consent.