# PASS: De novo assembler for short peptide sequences

René L. Warren
Genome Sciences Centre, BC Cancer
Vancouver, BC, V5Z 4S6, Canada
<EMAIL_ADDRESS>

###### Abstract

The ability to characterize proteins at sequence-level resolution is vital to
biological research. Currently, the leading method for protein sequencing is
by liquid chromatography mass spectrometry (LC-MS) whereas proteins are
reduced to their constituent peptides by enzymatic digest and subsequently
analyzed on an LC-MS instrument. The short peptide sequences that result from
this analysis are used to characterize the original protein content of the
sample. Here we present PASS, a de novo assembler for short peptide sequences
that can be used to reconstruct large portions of protein targets, a step that
can facilitate downstream sample characterization efforts. We show how, with
adequate peptide sequence coverage and little-to-no additional sequence
processing, PASS reconstructs protein sequences into relatively large
($\geq$100 amino acid) contigs having high (93.1 - 99.1%) sequence identity to
reference antibody light and heavy chain proteins.

Availability: PASS is released under the GNU General Public License Version 3
(GPLv3) and is publicly available from https://github.com/warrenlr/PASS.

_K_ eywords Proteome $\cdot$ Peptide Sequencing $\cdot$ Mass Spectrometry
$\cdot$ De Novo Protein Sequence Assembly

##  1 Introduction

In the past two decades, we have witnessed the rapid progress and growth in
the development and world-wide adoption of DNA/RNA sequencing technologies[1].
The rise of each new commercial technology, often accompanied with massive
sequence throughput and orders of magnitude lower per-base cost, has created
opportunities for bioinformatics tool development, to help assemble, analyze
and characterize millions of nucleic acid sequences with various length
profiles and error modalities. In contrast, advances in peptide sequencing
have not followed the same trajectory[2], and peptide sequencing by liquid
chromatography mass spectrometry (LC-MS) is still the leading and most robust
technology for protein identification and characterization. As part of the LC-
MS protocol, proteins are enzymatically digested to their peptide components,
and analyzed by LC-MS, resulting in short ($\leq$50 residues) peptide
sequences that are used to determine the original protein components of the
sample using proprietary software.

In the early days of the next-generation sequencing revolution, when the
nucleic acid sequences produced by the Solexa/Illumina Ltd instrument were
still very short ($\leq$25 bp), we developed SSAKE, a de novo genome assembler
for short sequencing reads capable of complete and near-complete viral (30
kbp) and bacterial (5 Mbp) genome assembly [3]. SSAKE cycles through short
sequence reads stored in a hash table and progressively searches through a
prefix tree for extension candidates. The short read assembler has since been
adapted to recognize the amino acid alphabet and the new utility, the Protein
Assembler with Short Sequences (PASS), was developed to reconstruct de novo
underlying protein sequences like the ones analyzed by mass spectrometry,
solely from short ($\geq$6 residues) and relatively low-coverage peptide
sequences.

Here, we describe the PASS algorithm and present initial benchmarks on an
experimental high-coverage antibody mass spectrometry peptide sequence data.
PASS is available from https://github.com/warrenlr/PASS and provided with the
hope that it is useful to the proteomics and scientific community at large.

##  2 Methods

### Algorithm

A. Sequence Overlap

Short peptide sequences of length l in a single multi-FASTA input file -f are
read in memory, populating a hash table keyed by unique sequence with pairing
values representing the number of sequence occurrence in the input sequence
set. The normalized peptide sequences are sorted by decreasing abundance
(number of times the sequence is repeated) to reflect coverage and minimize
extension of sequences containing sequencing errors. Peptide sequences with
erroneous residues are more likely to be unique in the entire input data set
when compared to their error-free counterparts. Sequence assembly is initiated
by generating the longest COOH-most word (k-mer) from the unassembled peptide
sequence u that is shorter than the sequence length l. Every possible COOH-
terminal most k-mers will be generated from u and used in turn for the search
until the word length is smaller than a user-defined minimum, m. Meanwhile,
all perfectly overlapping sequences will be collected in an array and be
further considered for COOH-termini extension once the k-mer search is
complete. At the same time, a hash table c will store every amino acid residue
along with a coverage count for every position of the overhang (or stretches
of amino acids hanging off the seed sequence u).

Once the search completes, a consensus sequence is derived from the hash table
c, taking the most represented amino acid at each position of the overhang. To
be considered for the consensus, each amino acid has to be covered by user-
defined -o (set to 2 by default). If there is a tie (two amino acids at a
specific position having the same coverage count), the prominent amino acid is
below a user-defined ratio r, the coverage -o is too low or the end of the
overhang is reached, the consensus extension terminates and the consensus
overhang joined to the seed sequence/contig. All overlapping sequences are
searched against the newly formed contig sequence and, if found, are removed
from the hash table and prefix tree. If they are not part of the consensus,
they will be used to seed/extend other contigs, if applicable. If no
overlapping peptide sequences match the newly formed contig, the extension is
terminated from that end and PASS resumes with a new seed sequence. That
prevents infinite looping through low-complexity amino acid sequences. In the
former case, the extension resumes using the new [l-m] space to search for
joining k-mers.

The process of progressively cycling through longer to shorter COOH-most k-mer
is repeated after every sequence extension until nothing else can be done on
that sequence end. Since only left-most searches are possible with a prefix
tree, when all possibilities have been exhausted for the COOH-terminal
extension, the complementary strand of the contiguous sequence generated is
used to extend the contig on the NH2-end. The prefix tree is used to limit the
search space by segregating peptide sequences and their reverse counterparts
(if applicable) by their first 5 amino acid at the NH2-termini.

There are three ways to control the sequence assembly stringency in PASS. 1)
Disallow sequence/contig extension if the coverage is too low (-o). Higher -o
values lead to shorter contig lengths, but minimizes sequence misassemblies.
2) Adjust the minimum overlap -m allowed between the seed/contig and short
sequences. Higher m values lead to more accurate contigs at the cost of
decreased contiguity. 3) Set the minimum amino acid ratio -r to higher values.

B. Using a seed sequence

If the -s option is set and points to a valid FASTA file, the protein
sequences comprised in that file will populate the hash table and be used
exclusively as seeds to nucleate contig extensions (they will not be utilized
to build the prefix tree). In that scheme, every unique seed will be used in
turn to nucleate an extension, using short sequences found in the tree
(specified in -f). This feature might be useful if you already have
characterized sequences and wish to increase their length, using short peptide
sequences. Since short sequences are not used as seeds when -s is set, they
will not cluster to one another without a seed sequence file. Also, to speed
up the assembly, no embedded sequences (i.e. those aligning to the seed in
their entirety) are considered. Only peptide sequences that contribute to
extending a seed sequence are noted. When -s is set, the output .contigs file
lists all extended seeds, even if it is by a single amino acid. The .singlets
output file will only list seeds that could not be extended. Unassembled
microsequences will not be captured in the output files.

C. De novo assembly with a seed sequence

The -i option instructs PASS to use target sequences for the sole purpose of
recruiting peptide sequences. If set (-i 1), the target sequences will recruit
peptide sequences for independent, de novo assemblies. This has the advantage
of allowing the user to provide, as a target, a large reference sequence (-s)
without a priori knowledge of variant amino acids. PASS does not constrain the
k-mer length derived from a target sequence for interrogating candidate
sequences. User-defined target word length values are passed to the algorithm
using the -j option. Using larger -j values should help speed up the search
when using long peptide sequences, since it will restrict the sequence space
accordingly. Note: whereas specificity, speed and RAM memory usage may
increase with -j, it may yield more sparse/fragmented assemblies. Systematic
experimentation with various -j values are therefore warranted.

### Data

The antibody peptide sequence LC-MS/MS data analyzed herein was downloaded
from https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4999880/bin/srep31730-s2.zip
and was released as a benchmark dataset for evaluating the ALPS system[4]. For
testing the ability of PASS to assemble peptide sequences de novo, we
generated a FASTA file for the two antibody data sets, each including a heavy
chain and a light chain, and considered short peptide sequences listed in the
file peptides_db.csv exclusively. The human antibody light and heavy chain
input files comprised 11,855 and 13,189 peptide sequences, respectively,
ranging in size from (minimum length) 6 amino acids to (maximum length) 46 and
43 amino acids, respectively. The WIgG1 antibody light and heavy chain input
files comprised 9,211 and 8,072 peptide sequences, respectively, ranging in
size from (minimum length) 4 amino acids to (maximum length) 65 and 50 amino
acids, in this order. We used a more limited dataset than that used in the
ALPS study[4], to highlight the general utility of PASS, and not its
performance in assembling complete antibody sequences, which cannot be
compared fairly to a multi-input pipeline with additional post-assembly
sequence alignments steps designed to merge output sequence contigs.

### Runs

We ran PASS on the four antibody peptide sequence datasets stated above
(version 0.3 with parameters -m 4 -w 10 -o 1 -r 0.51 -t 2) and evaluated
resulting output contigs $\geq$100 amino acids in length and with a protein
sequence identity $\geq$90% compared to their respective, intended reference
sequences.

Antibody ID | Length (aa) | # of peptides | fold-coverage Identity (%) Coverage (%) Human light chain (216aa) contig1 | size115 | read4237 | cov642.17 96.3 48.6 Human heavy chain (446aa) contig2 | size351 | read4855 | cov207.75 97.4 76.0 WIgG1 light chain (219aa) contig1 | size116 | read774 | cov108.74 99.1 100.0 contig2 | size120 | read637 | cov85.15 98.2 - WIgG1 heavy chain (441aa) contig1 | size323 | read1250 | cov67.18 99.1 90.7 contig2 | size102 | read409 | cov56.29 93.1 -

Table 1: De novo peptide assembly of antibody sequences with PASS. Only
sequence contigs longer than 100 amino acids are reported.

##  3 Results

We assembled an external LC-MS/MS peptide sequence dataset corresponding to
antibody light and heavy chains, with PASS. Output contigs 100 amino acids and
larger are compiled (Table 1). We observed an appreciable assembled contig
length (351 and 323 amino acids for the human and WIgG1 heavy chains,
respectively), and a high sequence identity (93.1 - 99.1%) that approaches
what was reported using ALPS, a multi-step assembly approach to reconstruct
protein sequences from LC-MS data[4]. Of note, the high fold-coverage of the
human light and heavy chain contigs (642 and 207x) and, surprisingly, a lower
sequence identity and overall coverage of the reference is observed from those
contigs, when compared to the longest ones obtained with the sparser WIgG1
datasets (Table 1). All four assemblies ran fast on a single CPU (Elapsed wall
clock time human heavy chain [m:ss] 0:00.64), typically in less than 1 sec on
an Intel(R) Xeon(R) CPU E7-8867 v3 @ 2.50GHz system, and used approximately
20MB of RAM per assembly.

##  4 Discussion and Conclusions

PASS is a proteomics application for de novo assembly of thousands to millions
of very short (6 aa) to longer (100 aa) peptide sequences, and beyond. It is
derived from the SSAKE genome assembler [3], an easy-to-use, robust, reliable
and tractable assembly algorithm for very short sequence reads, such as those
generated by Illumina Ltd. Algorithms of SSAKE are the core of many genomics
applications and their design continues to inspire new-generation assemblers
and analysis pipelines [5] [6]. Here, we showed how PASS can be used to
quickly assemble, de novo, thousands of short antibody peptide sequences into
sizeable and accurate sequence contigs that can be used for the downstream
characterization of a protein target. We expect PASS to have broad
applications in proteomics research.

## References

  * [1] van Dijk, E. L. et al. (2018). The Third Revolution in Sequencing Technology. Trends in genetics : TIG, 34(9), 666–681. doi: 10.1016/j.tig.2018.05.008
  * [2] Floyd, B. M., Marcotte, E. M. (2022). Protein Sequencing, One Molecule at a Time. Annual review of biophysics, 51, 181–200. doi: 10.1146/annurev-biophys-102121-103615
  * [3] Warren, R. L. et al. (2007). Assembling millions of short DNA sequences using SSAKE. Bioinformatics, 23(4), 500–501; doi: 10.1093/bioinformatics/btl629
  * [4] Tran, N. H. et al. (2016) Complete De Novo Assembly of Monoclonal Antibody Sequences. Sci. Rep. 6, 31730; doi: 10.1038/srep31730
  * [5] Jayasundara, D. et al. (2015). ViQuaS: an improved reconstruction pipeline for viral quasispecies spectra generated by next-generation sequencing. Bioinformatics, 31(6), 886–896. doi: 10.1093/bioinformatics/btu754
  * [6] Chong, Z. et al. (2017). novoBreak: local assembly for breakpoint detection in cancer genomes. Nature methods, 14(1), 65–67; doi: 10.1038/nmeth.4084


# Are Face Detection Models Biased?

Surbhi Mittal1, Kartik Thakral1, Puspita Majumdar1,2, Mayank Vatsa1 and Richa
Singh1
1IIT Jodhpur, India, 2IIIT Delhi, India

###### Abstract

The presence of bias in deep models leads to unfair outcomes for certain
demographic subgroups. Research in bias focuses primarily on facial
recognition and attribute prediction with scarce emphasis on face detection.
Existing studies consider face detection as binary classification into ‘face’
and ‘non-face’ classes. In this work, we investigate possible bias in the
domain of face detection through facial region localization which is currently
unexplored. Since facial region localization is an essential task for all face
recognition pipelines, it is imperative to analyze the presence of such bias
in popular deep models. Most existing face detection datasets lack suitable
annotation for such analysis. Therefore, we web-curate the Fair Face
Localization with Attributes (F2LA) dataset and manually annotate more than 10
attributes per face, including facial localization information. Utilizing the
extensive annotations from F2LA, an experimental setup is designed to study
the performance of four pre-trained face detectors. We observe (i) a high
disparity in detection accuracies across gender and skin-tone, and (ii)
interplay of confounding factors beyond demography. The F2LA data and
associated annotations can be accessed at http://iab-
rubric.org/index.php/F2LA.

††publicationid: pubid: 979-8-3503-4544-5/23/$31.00 ©2023 IEEE

##  I Introduction

With deep learning models/algorithms becoming the norm of the modern AI
systems, it has become essential to evaluate these algorithms (and systems)
thoroughly to minimize any adverse impact on the society. The incorporation of
bias in the algorithms is one primary issue that has been highlighted in the
literature [8, 22]. Research has shown that the performance of deep learning
algorithms vary for people with different attributes such as gender and skin-
tone subgroups under a variety of settings [2, 17]. For instance, it has
recently been observed that the automatic face-cropping algorithm of Twitter
favors young and lighter-skinned people over others [23]. With increasing
instances of these issues, it is of paramount importance to include fairness
as one of the metrics for evaluation of these algorithms.

Fairness of facial analysis algorithms is being studied in the literature for
the last few years [15, 20, 21, 22]. Most of the research efforts have been
concentrated towards establishing awareness towards bias in face recognition
systems and a number of datasets have been proposed for the same [10, 24].
However, limited research work has studied the impact of face detection which
forms an important part of the recognition pipeline and failure in which can
lead to incorrect decisions (Fig. 1). To the best of our knowledge, none of
the existing studies on bias in face detection focus on bounding box
localization. As the first contribution of this work, we analyze different
facial detectors to understand if they exhibit any biased behavior.

Figure 1: Face detection models failing to detect faces.

The presence of bias in deep models has been attributed to non-demographic
factors (such as variation in pose, illumination, and image quality), as well
as more complex, demographic factors such as race, gender, and skin tone [11].
To study biased behavior, datasets with extensive annotations corresponding to
different attributes are required which are lacking in existing databases. To
facilitate the study of bias for this research, the second contribution is
that we have collected images from the web and curated the Fair Face
Localization with Attributes (F2LA) dataset, with annotation of ten attributes
per face along with bounding box localization. Using the F2LA database, we
perform a detailed analysis on four face detectors and observe that different
confounding factors play an important role in decision making.

Figure 2: Sample images of the proposed F2LA dataset with diversity in gender,
skin-tone, age, illumination, occlusion and background.

##  II Related Work

Facial analysis models have shown superlative performance over the last few
years [4, 6, 7, 14, 28]. However, biased predictions have been reported in
various facial analysis tasks such as face detection, attribute prediction,
and face recognition. The seminal paper by Buolamwini et al. [5] showed the
biased behavior of commercial gender classifiers against darker-skinned
females. Over the years, multiple studies have been performed in facial
recognition and attribute prediction [16, 22]. However, demographic bias in
face detection has received significantly less attention. Datasets containing
extensive annotations for demographic subgroups as well as non-demographic
attributes are required for studying bias. However, popular benchmark
databases for face detection including AFW [30], PASCAL face [26], FDDB [9],
and WIDER FACE [27] datasets do not contain annotations pertaining to both
demographic and non-demographic factors. An existing database for evaluation
of bias in faces includes the PPB (Public Parliaments Benchmark) dataset
[5]111The PPB dataset was requested but was under legal review.. While PPB
contains face images of individuals from three African countries and three
European countries, the dataset contains samples in constrained settings with
only one face per image.

Further, limited approaches to mitigate such bias have been proposed. Amini et
al. [3] proposed a novel algorithm for mitigating hidden bias in face
detection algorithms. The proposed algorithm uses a variational autoencoder to
learn the latent structure and the learned latent distributions re-weight the
importance of certain data points during training. However, the face detection
problem in the paper is formulated as a binary classification problem where
each image contained one face. Modern face detection models provide bounding
box annotations corresponding to the faces in a given image along with a
confidence score for each detected face. The proposed F2LA dataset is an
evaluation set containing 1200 images with bounding box localization as well
annotations for 10 attributes corresponding to each face for fairness
analysis.

##  III Experimental Design

In order to quantify bias in face detection, we require a dataset with
annotations for bounding box localization as well as for attributes such as
demographic subgroups. The proposed Fair Face Localization with Attributes
(F2LA) dataset is employed for studying the behavior of face detectors. This
section describes the F2LA dataset and details of the experimental protocol
designed for analysis.

###  III-A F2LA Dataset

We web-curate the F2LA dataset containing images of people in unconstrained
settings. Facial localization information for 1774 faces in 1200 images is
manually annotated along with annotations for 10 attributes per face. These
attributes include information pertaining to gender, skin tone, apparent age,
facial orientation, blur, illumination, color properties, facial hair,
occlusion and background information. These attributes assist in evaluating
bias present in existing models across various factors, and provide insights
into the fairness of face detection algorithms. The F2LA data and associated
annotations can be accessed at http://iab-rubric.org/index.php/F2LA.

Data Collection and Properties: The images are collected by crawling the
internet for face images with CC-BY licenses. Variation across multiple
attributes is ensured during collection. Samples of the dataset are shown in
Fig. 2. Besides localizing each face with a bounding box, several other
attributes have been annotated. The details of the attributes and their
corresponding classes have been specified in Table I. The unsure class for
attributes gender and apparent age depict uncertainty on the annotator’s end.
For skin-tone annotation, the Fitzpatrick scale is used with class names very
fair, fair, medium, olive, brown, black. Further, unsure is used to capture
skin type in grayscale images. The background attribute is used to specify the
background information for a given face. Classes include- plain/crowded, in-
focus/out-of-focus. For attributes facial hair, occlusion and background,
multiple classes can hold true depending on the face image. The annotators are
between 21-30 years of age with experience in face recognition research.

TABLE I: Annotated attributes and their corresponding classes for the faces in the F2LA dataset used for study. The Multi-class column specifies whether a given face can belong to multiple classes for a given attribute. Attribute | Classes | Multi-class
---|---|---
Gender | male, female, unsure | ✗
Skin-tone |  | very fair, fair, medium, olive,
---
brown, black, unsure
✗
Apparent Age | child, young, middle, old, unsure | ✗
Blur | partial, heavy, no blur | ✗
Illumination | dim, bright, normal | ✗
| Facial
---
Orientation
frontal, semi-frontal, profile | ✗
Facial Hair |  | mustache, goatee, beard,
---
no facial hair
✓
Occlusion |  | eyes, forehead, mouth, nose,
---
chin, cheek(s), facial boundary
✓
Background |  | plain, crowded, in-focus,
---
out-of-focus
✓
| Color
---
Properties
grayscale, RGB | ✗

Data Annotation: Each image is annotated in a two-step fashion as shown in
Fig. 4. In the first step, all the faces from an image are cropped and
annotated for a set of attributes described in Table I. The first step in the
annotation process is face region localization. We used the freely available
annotation tool, LabelImg [1] for this purpose. For the next step, we designed
a user interface (UI) to facilitate the annotation of images.

Dataset Protocol: The dataset consists of a total of 1200 images encompassing
1774 faces. The dataset is divided into train and test sets containing 1000
and 200 images with 1486 and 288 faces, respectively. Since the dataset
contains ten annotations per face, we attempt to ensure as little skew as
possible across the sensitive attributes (gender, skin-tone, age) in the test
set. The distribution of faces across these attributes in the test set are
shown in Fig. 3.

###  III-B Experimental Protocol

We evaluate and estimate the performance and fairness of existing face
detectors through two experiments. In the first experiment, the pre-trained
models of existing face detectors are utilized. Since face detection models
are often used as a part of pre-processing in many applications, the
evaluation of pre-trained models aids in the estimation of possibly overlooked
bias. This experiment is performed with four pre-trained face detectors,
namely, MTCNN [28], BlazeFace [4], DSFD [12], and RetinaFace [6]. To further
explore the prevalence of bias, we perform the second experiment in which we
apply a transfer learning approach. This experiment is performed to estimate
performance improvement of existing face detectors on the proposed dataset.
For this experiment, we employ the popular MTCNN model [28], selected due to
its lightweight architecture, suitable for finetuning with 1000 images.

###  III-C Details of Pre-trained Models

Four pre-trained face detectors have been used for face detection. While MTCNN
uses separate region-proposal and face localization networks, BlazeFace and
RetinaFace employ the Single Shot Detector (SSD) design of training one-stage
face detection frameworks end-to-end [13].

MTCNN [28]:  The MTCNN model is one of the earliest and most popular face
detectors. It consists of three light-weight models namely P-Net, R-Net and
O-Net used for region proposal refinement, bounding box localization and
landmark localization, respectively.

BlazeFace [4]:  The BlazeFace model is designed by Google to be a lightweight
model suitable for GPU inference in mobiles. Its wide applicability makes it
an essential candidate for evaluation. The pre-trained model used in this work
is made available by Google’s MediaPipe.

RetinaFace [6]: The RetinaFace detector used extra supervision through facial
landmarks and employed self-supervised learning in addition to traditional
bounding box regression. It is among the most widely implemented single-stage
face detection technique.

DSFD [12]:  The DSFD detector utilizes a Feature Enhance Module in addition to
the single-shot detection of SSD models. It is among the best performing face
detection models on several benchmark databases.

Figure 3: Distribution of faces across (a) gender, (b) skin-tone, and (c) apparent age attributes on the test set. Figure 4: Tools used for (a) marking face regions with LabelImg, and (b) annotating attributes using created UI. Figure 5: Bar graph summarizing the performance of models across (a) age and (b) skin tone. The top row corresponds to $t$=0.6 and bottom row to $t$=0.7. TABLE II: Detection accuracy (%) across gender subgroups at different IoU thresholds $t$ using pre-trained models. $t$ | Gender | MTCNN | BlazeFace | DSFD | RetinaFace
---|---|---|---|---|---
0.5 | Female | 85.47 | 70.94 | 99.15 | 90.60
Male | 72.78 | 62.13 | 93.49 | 85.80
Avg. Acc. | 79.13 | 66.54 | 96.32 | 88.20
Disparity | 6.34 | 4.40 | 2.83 | 2.40
0.6 | Female | 70.94 | 52.99 | 95.73 | 86.32
Male | 56.21 | 44.38 | 88.76 | 79.88
Avg. Acc. | 63.58 | 48.69 | 92.25 | 83.10
Disparity | 7.37 | 4.31 | 3.49 | 3.22

###  III-D Evaluation Metrics

For evaluating the performance of the detectors, we calculate the detection
accuracy. The detection accuracy for a set is computed as the ratio of
correctly detected faces and the total number of faces in the set. A face is
considered to be detected correctly if the predicted bounding box localization
overlaps with the ground-truth annotation. This overlap is calculated using
the IoU (Intersection over Union) metric. The results are evaluated at
multiple IoU thresholds $t$= 0.5, 0.6, and 0.7. To estimate the disparity in
performance across subgroups, we calculate standard deviation of the detection
accuracies across the different classes. A high performance gap of the model
across different classes will result in a high disparity value for that
attribute, indicating higher bias in the model prediction.

Implementation Details: For the pre-trained models, we use an MTCNN model pre-
trained on the WIDERFACE dataset. A PyTorch/MXnet implementation of the paper
is used. For BlazeFace, a PyTorch version of the model is used. The pre-
trained weights for the frontal camera model are used in this paper for
evaluation. For inferencing the DSFD detector, we employ an optimized version
of the detector implemented in PyTorch. This model is pre-trained on the
WIDERFACE dataset. Lastly, the RetinaFace detector used in this work is built
with a ResNet50 backbone and also pre-trained on the WIDERFACE dataset. For
the fine-tuning experiments, the MTCNN model is used. MTCNN contains the
region-proposal refinement network P-Net and the bounding box localization
network R-Net. We use the pre-trained P-Net and fine-tune the R-Net. Besides
fine-tuning on the entire training set, we also fine-tune the network on three
subsets of the train set which are balanced across the gender, skin-tone and
apparent age attributes, respectively. All parameters except those of the last
fully-connected layer of the R-Net are frozen and the model is trained for 20
epochs on the train set. The Adam optimizer is used with an initial learning
rate of 0.001. All the experiments are performed on a workstation with Intel
Xeon processor, having 128 GB RAM and an NVIDIA RTX-3090 GPU with 24 GB
memory.

##  IV Experimental Results and Analysis

To estimate the bias present in different face detection models, we study
their performance on gender, skin-tone and apparent age attributes present in
the F2LA dataset. We further analyze some of the factors impacting the
performance of the pre-trained detectors.

TABLE III: Detection accuracies(%) and disparity observed with the MTCNN across gender subgroups at IoU threshold $t$=0.6. Columns Complete and Balanced denote performance after fine-tuning the model with complete and gender-balanced training (sub)set, respectively.  Gender | Pre-trained | Complete | Balanced
---|---|---|---
Female | 70.94 | 94.87 | 94.87
Male | 56.21 | 77.51 | 78.11
Avg. Acc. | 63.58 | 86.19 | 86.49
Disparity | 7.36 | 8.68 | 8.38
Figure 6: Some of the samples missed by (a) BlazeFace, (b) MTCNN, and (c)
RetinaFace face detectors.

###  IV-A Performance of Deep Models

The pre-trained face detection models are evaluated across different
demographic subgroups on the F2LA dataset. For gender subgroups, the
performance of the four pre-trained models has been provided in Table II. At
IoU threshold $t$=0.5, a wide gap exists between the detection accuracy for
Male and Female. We observe a disparity of nearly 6.34% and 2.40% across
gender subgroups in MTCNN and RetinaFace, respectively. Similar observations
can be made for disparity at $t$=0.7. At $t$=0.6, a disparity of 8.44%, 5.85%,
and 6.99% is observed across different skin tones for MTCNN, Blazeface and
RetinaFace detectors, respectively. This can be observed from Fig. 5 which
showcases the difference in performance of pre-trained models across different
age and skin-tone subgroups. Throughout all the experiments, a disparity in
performance across the subgroups is observed consistently. While different
models favor/disfavor different subgroups, the detection accuracy for the male
subgroup is consistently low across different models.

TABLE IV: Disparities(%) observed in detection accuracies at different IoU thresholds t after fine-tuning the MTCNN model. $t$ | 0.5 | 0.6
---|---|---
Attribute | Age | Skin-tone | Gender | Age | Skin-tone | Gender
Disparity | 5.10 | 4.36 | 5.85 | 3.72 | 6.54 | 8.68

A major boost in performance ($>$20%) is observed after fine-tuning the model
with F2LA’s complete training set as shown in Table III. However, the
disparity in performance across gender persists. Further, from Table IV, we
observe that these disparities exist for other demographic subgroups such as
skin-tone and age as well. On fine-tuning using an age-balanced split, we
observe that the disparity reduces from 6.13% to 3.16% at $t$=0.7. Similarly,
across the skin-tone subgroups, we observe a significant reduction in
disparity from 8.44% to 5.60% with a skin-balanced fine-tuning of the network.
While balanced training reduces the disparity in certain cases, a large gap in
performance across subgroups still persists.

TABLE V: Detection accuracies (%) and their disparity observed across confounding factors such as Facial Orientation and Illumination at IoU threshold $t$=0.6.  Orientation | MTCNN | BlazeFace | DSFD | RetinaFace
---|---|---|---|---
Frontal | 65.85 | 53.66 | 92.68 | 81.71
Profile | 36.00 | 20.00 | 80.00 | 76.00
Semi-frontal | 61.62 | 44.44 | 92.93 | 85.86
Disparity | 13.19 | 14.20 | 6.04 | 4.04
Illumination | MTCNN | BlazeFace | DSFD | RetinaFace
Bright | 57.14 | 50.00 | 92.86 | 92.86
DIm | 44.00 | 32.00 | 92.00 | 92.00
Normal | 63.86 | 49.00 | 91.57 | 81.12
Disparity | 8.25 | 8.26 | 0.54 | 5.34
Figure 7: Distribution in the training set of WIDERFACE dataset across the
attributes- (a) pose, (b) occlusion, (c) illumination, and (d) blur. Figure 8:
Bounding boxes (a) in ground-truth, and (b) predicted by RetinaFace.

###  IV-B Analysis

In this section, we study the impact of different factors on the performance
of the face detection models. Fig. 6 presents some of the samples missed by
the BlazeFace, MTCNN and RetinaFace models.

Role of Demography: We observe that some detection models perform poorly over
certain demographic subgroups (Refer Table II and Figure 5). For example, the
MTCNN model performs poorly on individuals belonging to old and male subgroup
(Fig. 6(b)). Similar observations have been made for the BlazeFace model (Fig.
6(a)).

Role of Other Confounding Factors:  While analyzing results from the pre-
trained models, we observe that the MTCNN and BlazeFace models fail to detect
faces on grayscale images. Some samples are shown in Fig. 6(a) and (b).
Further, the BlazeFace model fails to detect small faces in an image.
Conversely, the RetinaFace model fails to generalize on large faces (Fig.
6(c)). Further, factors such as illumination and occlusion may play an
important role in face detection. We observe disparate performance of the pre-
trained models across the facial orientation and illumination attributes in
Table V. Faces present with high illumination and frontal orientation are
easily detected compared to those which are dimly illuminated and have profile
view.

Distribution of the WIDERFACE dataset:  The bias in performance of models is
impacted by the data it is trained on. Since the MTCNN, DSFD, and RetinaFace
are trained on the same dataset- the WIDER FACE dataset [27], studying the
distribution of the dataset offers insight into the performance of the models.
The WIDER FACE dataset contains 32,203 images with 393,703 faces with a
40%/10%/50% split for training, validation, and testing. It is a widely
popular large-scale dataset containing images under 62 different event
categories taken from the WIDER dataset [25]. Each face contains annotations
for the following attributes- pose (typical, atypical), occlusion (none,
partial, heavy), illumination (normal, extreme), and blur (clear, normal blur,
heavy blur). The distribution of the images in the training set are shown in
Fig. 7. It is evident from the distribution that the train dataset is skewed
towards Typical poses and Normal illumination. The results in Table V showcase
higher performance of models for faces with these attributes in the F2LA
dataset222The Typical pose and Normal illumination attributes correspond to
the Frontal facial orientation and Normal illumination attributes in F2LA..
Therefore, we can safely deduce that a skew in training data translates into
model performance. Further, the interplay between such confounding factors may
play a role in the overall fairness of models.

Validity of the IoU metric:  On manual inspection of the faces detected by the
DSFD and RetinaFace models, it is discovered that these models provided good
detection results. So, why do we observe a disparity in Table II? We observe
that while ground-truth annotations are done loosely, the predicted bounding
boxes are tight (Fig. 8). This leads to a reduction in overlap leading to low
performance at threshold $t$=0.5. The threshold $t$ selected for determining
ideal overlap can lead to false negatives especially in cases where the area
of interest is small, and has been shown to destabilize the performance [18].
The limitations of the box IoU metric have been discussed in the literature
where a lack of spatial information (compared to a mask IoU) leads to
incorrect predictions [18]. Since the image presented in Fig. 8 contains faces
of the male subgroup and the bounding box area is small, the overall
performance for males in the test set is severely affected in this context.

##  V Discussion and Future Work

In this research, we attempt to understand when and why face detection
algorithms fail. By studying the impact of different factors on existing face
detection algorithms, we also strive to ascertain whether face detection
models are biased. The observations are as following:

  * •

While we experimentally detect disparate performance, we observe that the
interplay of various factors plays an important role. It is imperative to
analyze the performance of models in a holistic manner and not draw
conclusions solely based on demographic annotation.

  * •

Role of confounding factors such as scale of face, color properties,
illumination and pose may be misattributed to gender or other kinds of bias.
While evaluating bias, role of non-demographic factors should be evaluated.

  * •

We also note the limitations of the Intersection over Union metric for
assessing face detection performance, and advise careful perusal of loosely
versus tightly cropped faces in the data. Several variations of IoU focusing
on efficient training have been proposed in recent years [19, 29], however, a
greater emphasis on IoU as an evaluation metric is also required.

In the future, more effort is required to study face detection bias in a
localization setting. We believe that the web-curated F2LA dataset collected
across ten attributes for this study can help to broaden the scope for
exploring issues in face detection pertaining to various confounding factors,
including demography.

##  VI Acknowledgements

S. Mittal is partially supported by the UGC-Net JRF Fellowship and IBM
Fellowship. K. Thakral is partly supported by the PMRF Fellowship. M. Vatsa is
partially supported through the Swarnajayanti Fellowship.

## References

  * [1] Tlabelimg. git code (2015).  https://github.com/tzutalin/labelImg, 2021.  Online; accessed 17 September 2021.
  * [2] ACLU.  Amazon’s face recognition falsely matched 28 members of congress with mugshots.  https://tinyurl.com/2p87j4wu, 2018.  Online; accessed 17 Feb 2022.
  * [3] A. Amini, A. P. Soleimany, W. Schwarting, S. N. Bhatia, and D. Rus.  Uncovering and mitigating algorithmic bias through learned latent structure.  In AAAI/ACM Conference on AI, Ethics, and Society, pages 289–295, 2019.
  * [4] V. Bazarevsky, Y. Kartynnik, A. Vakunov, K. Raveendran, and M. Grundmann.  Blazeface: Sub-millisecond neural face detection on mobile gpus.  arXiv preprint arXiv:1907.05047, 2019.
  * [5] J. Buolamwini and T. Gebru.  Gender shades: Intersectional accuracy disparities in commercial gender classification.  In Conference on fairness, accountability and transparency, pages 77–91. PMLR, 2018.
  * [6] J. Deng, J. Guo, E. Ververas, I. Kotsia, and S. Zafeiriou.  Retinaface: Single-shot multi-level face localisation in the wild.  In IEEE/CVF conference on Computer Vision and Pattern Recognition, pages 5203–5212, 2020.
  * [7] J. Deng, J. Guo, J. Yang, N. Xue, I. Kotsia, and S. Zafeiriou.  Arcface: Additive angular margin loss for deep face recognition.  IEEE Transactions on Pattern Analysis and Machine Intelligence, 44(10):5962–5979, 2022.
  * [8] P. Drozdowski, C. Rathgeb, A. Dantcheva, N. Damer, and C. Busch.  Demographic bias in biometrics: A survey on an emerging challenge.  IEEE Transactions on Technology and Society, 1(2):89–103, 2020\.
  * [9] V. Jain and E. Learned-Miller.  Fddb: A benchmark for face detection in unconstrained settings.  Technical report, UMass Amherst technical report, 2010.
  * [10] K. Karkkainen and J. Joo.  Fairface: Face attribute dataset for balanced race, gender, and age for bias measurement and mitigation.  In IEEE/CVF Winter Conference on Applications of Computer Vision, pages 1548–1558, 2021.
  * [11] A. Kortylewski, B. Egger, A. Schneider, T. Gerig, A. Morel-Forster, and T. Vetter.  Analyzing and reducing the damage of dataset bias to face recognition with synthetic data.  In IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 0–0, 2019.
  * [12] J. Li, Y. Wang, C. Wang, Y. Tai, J. Qian, J. Yang, C. Wang, J. Li, and F. Huang.  Dsfd: dual shot face detector.  In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5060–5069, 2019.
  * [13] W. Liu, D. Anguelov, D. Erhan, C. Szegedy, S. Reed, C.-Y. Fu, and A. C. Berg.  Ssd: Single shot multibox detector.  In European Conference on Computer Vision, pages 21–37. Springer, 2016.
  * [14] A. Majumdar, R. Singh, and M. Vatsa.  Face verification via class sparsity based supervised encoding.  IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(6):1273–1280, 2017.
  * [15] P. Majumdar, S. Mittal, R. Singh, and M. Vatsa.  Unravelling the effect of image distortions for biased prediction of pre-trained face recognition models.  In IEEE/CVF International Conference on Computer Vision Workshops, pages 3786–3795. IEEE, 2021.
  * [16] P. Majumdar, R. Singh, and M. Vatsa.  Attention aware debiasing for unbiased model prediction.  In IEEE/CVF International Conference on Computer Vision, pages 4133–4141, 2021.
  * [17] ProPublica.  Machine bias.  https://www.propublica.org/article/machine-bias-risk-assessments-in-criminal-sentencing, 2016\.  Online; accessed 17 Feb 2022.
  * [18] A. Reinke, M. Eisenmann, M. D. Tizabi, C. H. Sudre, T. Rädsch, M. Antonelli, T. Arbel, S. Bakas, M. J. Cardoso, V. Cheplygina, et al.  Common limitations of image processing metrics: A picture story.  arXiv preprint arXiv:2104.05642, 2021.
  * [19] H. Rezatofighi, N. Tsoi, J. Gwak, A. Sadeghian, I. Reid, and S. Savarese.  Generalized intersection over union: A metric and a loss for bounding box regression.  In IEEE/CVF conference on computer vision and pattern recognition, pages 658–666, 2019.
  * [20] J. P. Robinson, G. Livitz, Y. Henon, C. Qin, Y. Fu, and S. Timoner.  Face recognition: too bias, or not too bias?  In IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 0–1, 2020.
  * [21] R. Singh, A. Agarwal, M. Singh, S. Nagpal, and M. Vatsa.  On the robustness of face recognition algorithms against attacks and bias.  AAAI Conference on Artificial Intelligence, 34(09):13583–13589, 2020.
  * [22] R. Singh, P. Majumdar, S. Mittal, and M. Vatsa.  Anatomizing bias in facial analysis.  In AAAI Conference on Artificial Intelligence, volume 36, pages 12351–12358, 2022.
  * [23] J. Vincent.  Twitter’s photo-cropping algorithm prefers young, beautiful, and light-skinned faces.  https://tinyurl.com/xse4xmds, 2021.  Online; accessed 27 August 2021.
  * [24] M. Wang, W. Deng, J. Hu, X. Tao, and Y. Huang.  Racial faces in the wild: Reducing racial bias by information maximization adaptation network.  In IEEE/CVF International Conference on Computer Vision, pages 692–702, 2019.
  * [25] Y. Xiong, K. Zhu, D. Lin, and X. Tang.  Recognize complex events from static images by fusing deep channels.  In IEEE Conference on Computer Vision and Pattern Recognition, pages 1600–1609, 2015.
  * [26] J. Yan, X. Zhang, Z. Lei, and S. Z. Li.  Face detection by structural models.  Image and Vision Computing, 32(10):790–799, 2014.
  * [27] S. Yang, P. Luo, C.-C. Loy, and X. Tang.  Wider face: A face detection benchmark.  In IEEE conference on computer vision and pattern recognition, pages 5525–5533, 2016.
  * [28] K. Zhang, Z. Zhang, Z. Li, and Y. Qiao.  Joint face detection and alignment using multitask cascaded convolutional networks.  IEEE Signal Processing Letters, 23(10):1499–1503, 2016.
  * [29] Z. Zheng, P. Wang, W. Liu, J. Li, R. Ye, and D. Ren.  Distance-iou loss: Faster and better learning for bounding box regression.  In AAAI conference on artificial intelligence, volume 34, pages 12993–13000, 2020.
  * [30] X. Zhu and D. Ramanan.  Face detection, pose estimation, and landmark localization in the wild.  In IEEE Conference on Computer Vision and Pattern Recognition, pages 2879–2886. IEEE, 2012.