Full text
Nuno Miguel Azevedo Pereira Real-Time Multi-Network Deep Learning Facial Recognition for Service Robots Tese de Mestrado Mestrado Integrado em Engenharia Eletrónica Industrial e Computadores Trabalho efetuado sob a orientação do Professor Doutor António Fernando Macedo Ribeiro Julho de 2021
ii DIREITOS DE AUTOR E CONDIÇÕES DE UTILIZAÇÃO DO TRABALHO POR TERCEIROS Este é um trabalho académico que pode ser utilizado por terceiros desde que respeitadas as regras e boas práticas internacionalmente aceites, no que concerne aos direitos de autor e direitos conexos. Assim, o presente trabalho pode ser utilizado nos termos previstos na licença abaixo indicada. Caso o utilizador necessite de permissão para poder fazer um uso do trabalho em condições não previstas no licenciamento indicado, deverá contactar o autor, através do RepositóriUM da Universidade do Minho. Atribuição CC BY https://creativecommons.org/licenses/by/4.0
iii ACKNOWLEDGMENTS This Dissertation represents the culmination of my academic education, filled with the best and moments of my life. Nevertheless, it is important to acknowledge the people that made this road possible and enjoyable. Thank you to my parents Alberto and Lurdes, for the love and for never cease to believe in me even when I was failing. For always supporting me and care to all my needs, making this graduation possible. To my sister Célia, for showing support and companionship. To the rest of my family, for constant support and understanding over the years. A special thank you to my cousin Joana Martins for the helpful review and corrections. Thank you to all my friends whom I had the pleasure spent the last years with and helped me through the master’s degree. I will fondly remember the times passed in university for the rest of my life. A special thanks to my supervisor, Professor Fernando Ribeiro, for the guidance, support and constant availability during the dissertation, as well as letting me work the laboratory. A big thanks to my friend Tiago Ribeiro, for always being available to help at the making of this dissertation.
iv DECLARAÇÃO DE INTEGRIDADE Declaro ter atuado com integridade na elaboração do presente trabalho académico e confirmo que não recorri à prática de plágio nem a qualquer forma de utilização indevida ou falsificação de informações ou resultados em nenhuma das etapas conducente à sua elaboração. Mais declaro que conheço e que respeitei o Código de Conduta Ética da Universidade do Minho.
v RESUMO Avanços recentes em robôs de serviço genéricos permitiram a sua utilização inovadora em vários meios ambientes, como residências domésticas, hospitais ou centros de saúde. O projeto CHARMIE (Collaborative Home / Healthcare Assistant Robot da Minho Industrial Electronics) é um robô antropomórfico que realiza tarefas em configurações não convencionais usando algoritmos de aprendizagem de máquina, que permitem ao robô tomar decisões racionais com base nas variáveis do meio ambiente que o rodeia. Com a intenção de criar uma melhor interação entre o robô e seus operários, esta dissertação apresenta um sistema de Deep Learning para reconhecimento facial de várias instâncias. Ao identificar a pessoa com a qual está a interagir, o robô adapta-se para realizar as suas ações pré-definidas atendendo às necessidades dela. O sistema é composto por várias redes neuronais de modo a compor os três módulos constituintes. Uma rede convolucional em cascata de várias instâncias procura zonas faciais, como olhos, nariz ou boca, prevendo as coordenadas que permitem isolar as caras detetadas, detetando todos os rostos exibidos ao usar uma câmara. A rede neuronal Inception-ResNet foi treinada num dataset extenso apropriado, funcionando como extrator de características faciais. Isso gera os vetores característicos de pessoas que serão usados como input para um classificador SVM, um modelo de aprendizagem máquina que irá prever a qual das identidades esses vetores correspondem. Essa implementação de princípio a fim dos três módulos permitiu a deteção e reconhecimento facial para ser usado como um método de identificação de usuários em tempo real. O método resultante foi implementado no robô de serviços CHARMIE. Essas tarefas foram realizadas com alunos e professores do Laboratório de Automação e Robótica (LAR) da Universidade do Minho. Para isso, foi usado um conjunto de imagens obtidas a partir de vídeos individuais dessas pessoas, invertendo ou rodando algumas dessas imagens aleatoriamente de modo a criar um sistema mais robusto Palavras-Chave Deep Learning, Deteção facial, Multi-Rede, Reconhecimento Facial, Robôs de serviço
vi ABSTRACT Recent advances in generic service robots have shown their introduction in various novel environments such as domestic and healthcare facilities. The CHARMIE (Collaborative Home/Healthcare Assistant Robot by Minho Industrial Electronics) project is an anthropomorphic robot that performs generic service tasks in non-standardized environment settings using machine learning algorithms, which allow the robot to make rational decisions based directly on the surrounding environment. In order to ensure an enhanced interaction between the robot and its specified users, this dissertation presents a real-time multi-stage deep learning pipeline for facial recognition algorithm. By detecting which of the pre-trained users the robot is interacting with, it can adapt its actions to best fit the user's needs. The multi-network system is composed of three modules. A multi-stage cascaded convolutional network searches for facial landmarks, such as eyes, nose, or mouth, predicting its bounding box coordinates, detecting all the faces showcased in the camera frame. An Inception-ResNet deep convolutional network was trained on a large dataset for facial feature extraction, comparing different hyperparameter settings and fine-tuning. That generates the feature vectors and provides an amplified network for facial recognition and an SVM classifier to categorize each of the faces recognized to the correct user. The combination of the three modules allowed an end-to-end facial detection and recognition that can be used as a real-time user-based identification method. The resulting method was furthermore implemented on the general service robot CHARMIE. Those tasks were carried out on students and teachers from the Laboratory of Automation and Robotics (LAR) of Minho University. For that, a dataset containing those people was built using images fetch from individual videos, with random frames being rotated or flipped to create a more robust system. Keywords Deep Learning, Facial Recognition, Face Detection, Multi-Network, Service Robots,
vii TABLE OF CONTENTS Acknowledgments ................................................................................................................................ ii Resumo............................................................................................................................................... v Abstract.............................................................................................................................................. vi List of Figures ...................................................................................................................................... x List of Tables ..................................................................................................................................... xv Acronyms ......................................................................................................................................... xvi 1. Introduction .............................................................................................................................. 19 1.1 General Motivation ............................................................................................................ 19 1.2 Objectives of the Dissertation ............................................................................................. 20 1.3 Scientific Contributions ...................................................................................................... 21 1.4 Structure of the Dissertation .............................................................................................. 23 2. Literature Review ...................................................................................................................... 25 2.1 Introduction and basic definitions to Neural Networks ........................................................ 25 2.2 Deep Learning ................................................................................................................... 28 2.2.1 Deep Neural Networks ............................................................................................... 28 2.2.2 Convolutional Neural Networks .................................................................................. 29 2.3 Training of Neural Networks .............................................................................................. 34 2.3.1 Supervised Learning .................................................................................................. 34 2.3.2 Unsupervised Learning .............................................................................................. 35 2.4 Convolutional Network Architectures .................................................................................. 36 2.5 Face Detection and Facial Recognition ............................................................................... 50 2.6 Related Work ..................................................................................................................... 52 3. Methods and Methodologies ...................................................................................................... 59 3.1 System Tools and Specifications ........................................................................................ 59 3.2 Model Framework ............................................................................................................. 61 3.3 Face Detection .................................................................................................................. 63 3.3.1 Image Pyramid .......................................................................................................... 63 3.3.2 Stage Cascaded Network and Non maximum suppression .......................................... 64 3.3.3 MTCNN Training Methodology .................................................................................... 67
viii 3.3.4 Implementation ......................................................................................................... 68 3.4 Datasets ........................................................................................................................... 70 3.4.1 LAR dataset ............................................................................................................... 70 3.4.2 Image Transformations .............................................................................................. 72 3.5 Inception-ResNet Network .................................................................................................. 73 3.5.1 Approached Concepts ................................................................................................ 73 3.5.2 Network Architecture ................................................................................................. 74 3.5.3 Pipeline Implementation ............................................................................................ 77 3.6 Training Methodology ........................................................................................................ 78 3.6.1 Hyperparameter Settings ........................................................................................... 78 3.6.2 Image manipulation ................................................................................................... 79 3.6.3 Learning Methodology ................................................................................................ 80 3.6.4 Saving the Model ....................................................................................................... 80 3.7 Classifier ........................................................................................................................... 81 3.8 Data Visualization .............................................................................................................. 83 3.8.1 Computational graph ................................................................................................. 83 3.8.2 Plots .......................................................................................................................... 84 3.8.3 Embedding Projector ................................................................................................. 84 3.8.4 Principal Component Analysis .................................................................................... 85 3.8.5 t-SNE ......................................................................................................................... 86 4. Results ..................................................................................................................................... 89 4.1 MTCNN ............................................................................................................................. 89 4.1.1 Implementation Results ............................................................................................. 89 4.1.2 Tests on Images and videos ....................................................................................... 90 4.1.3 Camara tests ............................................................................................................. 97 4.1.4 LAR dataset ............................................................................................................... 98 4.1.5 Face Detection Conclusion ....................................................................................... 100 4.2 Inception ResNet Training ................................................................................................ 101 4.2.1 CASIA-Webface dataset ............................................................................................ 102
ix 4.2.2 Custom Dataset ....................................................................................................... 106 4.2.3 Inception-ResNet Conclusions .................................................................................. 108 4.3 SVM Classifier ................................................................................................................. 109 4.3.1 Train ....................................................................................................................... 110 4.3.2 SVM Results ............................................................................................................ 111 4.3.3 SVM Conclusions ..................................................................................................... 115 4.4 Embedding Projector ....................................................................................................... 115 4.4.1 PCA Analysis ........................................................................................................... 116 4.4.2 t-SNE Analysis ......................................................................................................... 117 4.5 Real-Time Results ............................................................................................................ 119 4.5.1 Real time Conclusions ............................................................................................. 123 5. CONCLUSIONS ........................................................................................................................... 125 5.1 Further Work ................................................................................................................... 126 References ..................................................................................................................................... 128 Annex I – Stem of Inception - ResNet architecture versions 1 and 2 ................................................. 134 Annex II – TensorBoard Training Graph ........................................................................................... 135 Annex III – Confusion Matrix ........................................................................................................... 136
xvi ACRONYMS 2D - Two-Dimensional 3D - Three-Dimensional AI - Artificial Intelligence ANN - Artificial Neural Network API - Application Programming Interface CHARMIE - Collaborative Home/Healthcare Assistant Robot by Minho Industrial Electronics CNN - Convolutional Neural Network CPU - Central Processing Unit CUDA - Compute Unified Device Architecture DEI - Industrial Electronical Department of Minho University DNN - Deep Neural Network FIFO - First In First Out GPU - Graphics Processing Unit HOG - Histograms of Oriented Gradients HRC - Human–robot collaboration ILSVRC - ImageNet Large Scale Visual Recognition Competition LAR - Laboratory of Automation and Robotics LFW - Labeled Faces in the Wild LPP - Locality Preserving Projections ML - Machine Learning MLP - Multilayer Perceptron NMS - Non-Maximum Suppression NN - Neural Network O - Net-Output-Network PCA - Principal Component Analysis P-Net - Proposal-Network ReLU - Rectified Linear Unit R-Net - Refinement-Network RoI - Region of interest SVM - Support Vector Machine t-SNE - T-Distributed Stochastic Neighbor Embedding
xvii TSV - Tab-separated values file
xviii
19 1. INTRODUCTION Visual perception and the information one collects from it is an essential ability in human behavior. The analysis of the information gathered allows humans to make structured decisions, with its interpretation being based on cognitive processes and previous knowledgeable interactions. Thus, endowing robotic systems with the sense of vision to implement cognitive systems is quite a desirable yet challenging process. The concept of Robot Vision refers to the ability of a robot to understand the environment in which it is located and use that information to perform tasks through artificial vision algorithms (Kragic & Vincze, 2009). That was enabled by extensively researches and breakthroughs in detection and recognition tasks, with Deep Learning fields of study having a determinant role. Those benchmarked classification tasks involving various cases of detection as well as identification. Hence, being able to perceive the surrounding variables branched the focus into various relevant techniques of visual recognition by robots (Khaligh-Razavi, 2014). That culminates in machines capable of accurately evaluate and interact with a broad range of scenarios by observing different environments and recognizing valuable data. State-of-the-art service robots provide aid in various novel environments, such as domestic and healthcare facilities, by performing generic service tasks based directly on the surrounding environment. This dissertation focused on providing a more collaborative and cooperative communication tool between the robot and its operators/patients/users. 1.1 General Motivation Collaborative robots are designed to perform tasks with people in a shared work environment. It’s mainly applied in the Industrial field, where its precision and repeatability are desirable factors, as well as the faster and more efficient manufacturing processes, while guaranteeing a safe interaction (Villani, Pini, Leali, & Secchi, 2018). Additionally, the flexibility and shift demand of new products or procedures provided these robots the advantage over fully automated ones, with the former being quickly performed with the guidance of a user. Service robots are a type of machines that help in day-to-day tasks in different environments such as household, offices, or healthcare (Bauer, Wollherr, & Buss, 2008). The aim is to lower the staff workload by performing menial, dull tasks, but also to help solve complex chores with its users. They differ from the industrialized robots due to its form and function, having a more autonomous internal
20 control system, being mobile, and interacting with humans with a wide range of ways. These types of robots are used in a high spectrum of purposes, with recent advances uplifting their use in various novel environments, including domestic or healthcare facilities (Holland et al., 2021). Their introduction was possible due to technological improvements on manufacturing of cameras, sensors, and other robotic control tools such as speech recognition, as well as rapid advancements on Artificial Intelligence (AI), enabled by the availability of extensive big data analysis. A desirable feature is the ability of service robots to recognize people in its surroundings, providing a more natural Human–robot collaboration, by detecting which of the users is interacting with, it can adapt its actions to best fit the user's needs. This thesis approaches this challenge using artificial vision and AI methods, namely deep supervised learning using multi-Convolutional Neural Networks (CNN) (Lecun, Bottou, Bengio, & Ha, 1998). 1.2 Objectives of the Dissertation The main objective of this dissertation was the implementation of a real-time face detection and facial recognition system implemented on CHARMIE, recognizing a set of pre-determined people with confidence or being able to learn new identities previously unknown. This model was then tested on said members of the LAR of Minho University. For that, the following tasks were performed: • Study of several NN architectures regarding state-of-the-art face detection and facial recognition, with different learning approaches used; • Definition and installation of the necessary tools for the development of the model, including the most suitable programing language; • Implementation of the defined NN used for face detection and recognition; • Selection of the most suitable dataset and creation of a custom dataset containing students and teachers associated to the LAR; • Training of the CNNs with the referenced datasets; • Testing of the NNs and selection of the best parameters; The aim is that the system can detect all the faces presented in a camera frame regardless of the position where it appears and different angles of the head. The system must then draw bounding boxes over the proposals, and predict the name of the shown person. That way, the robot can understand who it is interacting with and can act accordingly.
21 1.3 Scientific Contributions This dissertation theme and work was implemented on a larger project named CHARMIE, developed by the LAR of Minho University of DEI. CHARMIE is an anthropomorphic robot that performs generic service tasks in non-standardized environment settings. Its conceptual shape (Figure 1) is designed in a way that its users can be more prone to interact with it by making it human-like. Additionally, its shape and dimensions make it more practical and easier to introduce CHARMIE into an environment designed for human work. Figure 1 - Conceptual sketch of the anthropomorphic robot CHARMIE. The system’s design (Figure 2) is composed of Head, Robot Arms, Lifting Mechanism and Torso and a motion platform, allowing it to move dynamically in any direction (Gonçalves et al., 2019). A primary prototype was previously built (Figure 3) with additional parts of the project being under development at the time this dissertation is being written. CHARMIE’s goals are to provide aid in several chores in household and healthcare environments, from nursing homes to hospital facilities and including domestic homes. For that, the ability of understanding its surroundings and make rational decisions based on the information gathered is needed. To endow the robot with that ability, the LAR has been implementing different types of machine learning (ML) algorithms. For Autonomous Driving, such methods involve non-linear Navigation, Mapping, and Obstacle Detection and Avoidance. To provide communication tools with its users, the implemented processes include Person Detection and Recognition, and Speech and Gesture Recognition. For the
22 identification of certain items and being able to interact with them, such as pick-and-place and object delivery tasks, Object Detection and Recognition was also applied. Figure 2 - Developed anthropomorphic design. In order to benchmark new technologies developed for CHARMIE, service and assistive robotics competitions (Basiri, Piazza, Matteucci, & Lima, 2019) provide a common framework for a high-rigor benchmark of smart and autonomous systems. RoboCup@Home is regarded as a top competition in the field of domestic service and assistive robotics (Holz & Iocchi, 2013; Iocchi, Holz, Ruiz-Del-Solar, Sugiura, & Van Der Zant, 2015), where they must perform a set of pre-determined tests to aid in day-to- day realistic non-standardized home environment setting. Earlier versions of CHARMIE have already participated in RoboCup@Home, and the most recent version is focusing on introducing itself to the competition with qualification material in the next years.
23 Figure 3 - Primary prototype assembled. 1.4 Structure of the Dissertation This document is divided into 6 chapters: Introduction, Literature Review, Methodologies, Results, Conclusions, and Future Work. On the Introduction chapter, a brief description of the work is presented, as well as the motivation as to why it was produced, outlining the objectives necessary to accomplish the result and the scientific contribution of it. Throughout the Literature Review chapter, the study of the state-of-the-art is presented. First, the study of NN is presented, from the earlier and basic concepts to the more complex architectures used nowadays. After that, methods used for human face detection and recognition are introduced, demonstrating how the introduction of AI improved the accuracy of those fields, describing notorious works and algorithms. The Methodologies chapter describes the implementation of the end-to-end framework, starting by describing the software tools used. Then, the schematic structure of the work is displayed, with every part being analyzed with the methods implemented and the respective theoretical fundaments that corroborate them.
24 Then, the Results chapter compares the different variations and outcomes obtained regarding the previous chapter’s algorithms. Those include the detection of human faces in photos and videos, as well as in real time processing, the acquisition and pre-processing of individual images of members of LAR (to create a dataset necessary to train the NNs), and the results of the training of the NN using different data visualization tools. Finally, all those parts are connected, displaying the result of the dissertation. Also, a discussion regarding the obtained results is always presented after every module of the framework. The Conclusions chapter presents the outcomes of the work done and its analysis regarding the outline objectives of the dissertation, with the Further Work chapter evaluating improvements that can be made.
25 2. LITERATURE REVIEW In this chapter an overview of the state of the art is presented, from basic concepts to the more complex architectures used nowadays. After that, methods used for human face detection and recognition are presented and compared, demonstrating how the introduction of AI improved the accuracy of those fields, describing notorious works and algorithms. 2.1 Introduction and basic definitions to Neural Networks ML refers to an Artificial Intelligence field of study that promotes the ability of machines to make decisions autonomously, i.e., without being programed explicitly for that purpose. This is done by the development of algorithms based on mathematical and statistical approaches, where the system learns by being exposed to data, the same way as humans. A popular branch of this field, and the foundation of deep learning algorithms, is Neural Networks (NNs) (Nielsen, 2018). Simply put, NNs are ML models inspired by the way the human brain works, where the model maps the input data into desirable outputs. For example, for classification purposes, such as the topic of this dissertation, it tries to predict the correct output pair of the data provided into these models by pattern recognition. The first NN as an electrical circuit was proposed in 1943 by Warren McCulloch, and a learning algorithm was proposed by Donald Hebb six years later (Capaldi, 1992). This introduced the concept of perceptron (or node), which consists on a basic unit of the neuronal network that simulates a neuron (Figure 4). Despite its simplicity, the perceptron is a binary classifier that can learn and solve complex problems. Figure 4 - Perceptron module.
32 Figure 11 - Stride of 2 on a 7 X 7 input volume. The output of the Convolutional layer can be calculated through equation (3): 𝑂=(𝑊−𝐾)+2𝑃 𝑆+1 (3) where O represents the output size, W the input dimension (height x width x depth), K the filter dimension, S the stride and P the zero-padding quantity. Zero-padding the process implies applying a combination of pixels of value 0 around the input, as represented in Figure 12. With this, the output spatial reduction will be smaller, while no important input information is lost, and more convolutions can be applied to be able to remove more features . Figure 12 - Zero-pathing technique. Pooling Layers are applied to perform a down sample of the input, when the dimensionality of the layers needs to decrease, further reducing the computational complexity by lowering the parameters.
33 These layers are used when a set of specific features are extracted through the activation maps of previous convolutional layers, and their exact spatial location is no longer important to their position relative to the other features. With this, the layers will be drastically reduced, resulting in fewer parameters, thus lowering computational resources. The most common Pooling methods are Max and Average Pooling, as seen in Figure 13 and Figure 14 respectively. Figure 13 - Max Pooling on an 8 X 8 activation map with stride of 4. Figure 14 - Average Pooling technique on an 8 X 8 activation map with stride of 4. Through a filter and a stride, Max Pooling method checks the highest pixel value, eliminating the rest. The final output is then left with the larger value of each sub-region, not changing the features of the image, but considerably decreasing its spatial value. Average Pooling calculates the mean value between the nodes. Fully Connected Layers will be used at the end of the network after the desired features have been extracted through convolutions and pooling. The output of those layers is a one-dimensional array. It
34 represents the inputs of the network with reduced dimension. Like DNNs, all these layer’s neurons are interconnected to all the previous layer’s neurons, with its size being manually determined. A Convolutional network can have various Fully-connected layers, reducing the dimensional size without the need of creating more activations nor searching for more features in the spatial dimension of the images, to avoid create overfitting. 2.3 Training of Neural Networks For the neural network to be able to classify the input of data sent, it needs to be able to recognize and identify patterns in it and understand their meaning. This is achieved through learning and training methods, perform a classification validation with precision tests. For that, a training set is necessary, with inputs of data of a desired subject grouped into batches and fed into the network. Typically, training a network is divided into training cycles, called epoch, with a batch of data being fed into the network by a feed forward manner, where the model then tries to predict what this data means. The learning process modifies the weights of the connections between the perceptrons, initially random, so that it can achieve expected results. The measurements of the errors in the performance of the model are estimated by the cost/loss function. Having a small cost function is the objective of the model, so that it has minimal losses and maximum precision. The weight values are updated with Backpropagation. Rumelhart et al . (Rumelhart, Hinton, & Williams, 1986) first used Backpropagation on neural algorithms by repeatedly adjusting the weights of the connections in the network so as to minimize the difference between the actual output vector of the net and the desired output vector. In CNNs, the algorithm updates the kernel values that extract the features. The weights are updated via an optimization process, where the gradients are calculated into a gradient descent method (Bottou, 2010). That way, by back forwarding onto the network from the output layer into the input layer, the model finds the minimum values gradients in the direction needed to reduce errors. Then, the weights are optimized in the opposite way of calculated gradients. The training method can be divided into two major approaches: supervised and unsupervised learning. Supervised Learning focuses more on classification and regression problems, whereas Unsupervised Learning focus on Clustering issues or dimension. These two approaches are explained below. 2.3.1 Supervised Learning Supervised Learning is a training method where the dataset used for training is labeled, i.e., every point of data is paired with an individual predefined ground truth, namely the output class desirable of that
35 data. That way, the training algorithm can assess if it got the correct answer. This method focuses on learning through the training process to correctly predict new instances of data without the attached label, intending to enable the model with the capacity of generalizing the problem outside of previously seen examples. For that, it needs to map the data with a function to recognize output features to categorize them by correctly predicting its samples. For classification problems, the final output are discrete labels, like fruits, animals, and people. Those can be binary classifiers for True or False problems like detection, or multiclass classifiers, such as the MNIST dataset previously discussed (Lecun, Cortes, & C.J.C., 1998). MNIST dataset is a 0 to 9 handwritten digits dataset, used in various classification learning problems as an introductory exercise. Nowadays, various databases for image classification are available, which is instrumental for computer vision and deep learning research improvements. ImageNet project (Russakovsky et al., n.d.) offers a large visual database designed for visual object recognition software research, with more than 14 million images hand-annotated indicating what topics are considered as pictures in more than 20000 categories. This project also hosts a yearly software competition since 2010 called the ImageNet Large Scale Visual Recognition Challenge. This competition evaluates algorithms for object detection and image classification at large scale, allowing researchers to compare progress in detection across a wider variety of objects, and was crucial to various benchmarking progresses over the last years. Regression is a process of predicting a continuous value by finding the correlation between dependent and independent variables. These techniques are used to predict, for instance, pricings and market trends. 2.3.2 Unsupervised Learning Contrary to the previous approach, unsupervised learning systems use untagged data, discovering the patterns and information without assistance. This allows users to perform more complex tasks, although its unpredictability can be a drawback, resulting in a more expensive training process, when compared to supervised learning. The main category of this method is Clustering. It analyses the structural components of the data and segregates them by similarity. Entities in each cluster are more similar to each other than to entities of different clusters. For that, the training algorithm needs to understand how the data is structured. Then, considering the data located in an n-dimensional space, intra-variance between samples needs to be minimal while having maximum inter-variance between different classes.
36 Another powerful method used is dimension reduction of data. Input variables are referred as dimensionality. As an example, feeding the network with an array of 10 positions means the input is a 10-dimension input. As such, using an image as input can result in a hundred or thousand dimensions. By reducing its complexity, while retaining the meaningful properties of the original data, it is represented with fewer dimension, and the model tends to consequently be less sparse and not overfit. This technique is also used for visualization purposes by reducing the data into a 2D or 3D Euclidean space. The PCA (Jollife & Cadima, 2016) technique performs a linear projection by calculating the Principal Components, new variables that are linear combination of the original data, and creating new uncorrelated variables that successively maximize variance. Additionally, the t-SNE (Van Der Maaten & Hinton, 2008a) is a non-linear method based on Stochastic Neighbor embedding that computes K- dimensional data into a lower dimensional mapping by performing several region based transformations. 2.4 Convolutional Network Architectures This section provides an overview of some CNN structures that were important for the development for the field with different benchmarking records in recognition tasks, as well as recognizing the improvements those methods and ideas had in architecture designing. The first notorious architecture of a CNN was conceived by Lecun et al . (Lecun, Bottou, et al., 1998) who named it Lenet-5, and was a pioneer of this type of networks. It was used to test written handwritten digits for zip codes at post offices, now known as the MNIST dataset (Lecun, Cortes, et al., 1998). Being the first structural architecture for these types of networks, Lenet-5 introduced the concept of convolutional networks, incorporating the spatial mapping in an image, where it extracted the features present through designated filters. The architecture was designed of several layers, namely: 1. Input layer at the beginning of the network – considered as initial image; 2. Convolutional Layer - created from the convolutions of the initial input, where 5x5 filters with stride of 1 were applied; 3. Average Pooling Layer – created by subsampling with a 2x2 filter with stride of 2, reducing the spatial size of the initial image; 4. Fully-connected Layer – sorts the data received from the network, predicting the input.
37 Although the method proved to be efficient, being acknowledged by its innovation at the time, its expensive computational cost required the model to be trained for 2 to 3 days until it could predict accordingly a simple dataset. Combined with lack of training data for real life problems, this approach proved unsustainable for better purposes than recognizing simple features in small images. With better performance CPUs and GPUs, multi-core parallel processing architecture allows the computer to perform expensive computational calculations, which shortened the time spent by a lot. Additionally, it led to a significant increase in labeled datasets publicly available, resulting in a big breakthrough in this field of study. Alex Krizhevsky et al . (Krizhevsky, Sutskever, & Hinton, 2017) proposed the AlexNet architecture in 2012 to participate in the ILSVRC competition (Russakovsky et al., n.d.). Hinton et al . (Hinton, Srivastava, Krizhevsky, Sutskever, & Salakhutdinov, 2012) states that small datasets with deeper network tend to overfit the model, the state where the framework adapts and performs well to the training data, ‘memorizing’ its details, but struggles to generalize outside of it. AlexNet presented three techniques for that problem: 1) use of Data augmentation, 2) making the data more diverse, and 3) using the concept of Dropout. That way, this method prevents complex coadaptations on the training data by temporarily removing a percentage of random weights pixels in the hidden layers, along with all its incoming and outgoing connections. The AlexNet architecture is similar to Lenet-5, but has a larger number of layers, therefore more complex or, with the correct neural network nomenclature, deeper. Having a simple layout compared to more modern architectures, AlexNet architecture design was composed by 5 convoluted layers, max-pooling layers, dropout layers, and 3 fully-connected layers, with the non-dropout variation having only one fully-connected layer, using 60 million parameters. The major difference in architecture features was the introduction of overlapping on the pooling layers. With s being the space between the pooling grid and z x z the center of the pooling grid location, the authors set s < z , reducing the top-1 and top-5 error rates by 0.4% in comparison to the s = z counterpart with equivalent output dimension. It was also observed that overlapping pooling was less prone to overfit. For training dataset, the network used the ImageNet data for the ILSVRC challenge, a subset of a larger dataset (15 million images with a total of 22,000 categories), containing 1000 subjects, with over 1.2 million training images, 50000 validation images and 150000 testing images. For this, ReLU was used as activation function to prevent saturation, achieving 25% error rate on CIFAR dataset (Krizhevsky & Hinton, 2009), which is six times faster in relation to the tanh activation function previously used, as well as SoftMax function as classifier. The training was also done using 2 parallel GPUs, given that, at the time, processing 1.2 million images was not conceivable with only one. This architecture was
38 revolutionary in the area of deep learning. The top-5 error was reduced from 26.2% from the previous years to 15.3%, in the 5 classes where the model predicted the worst solution. ( “ImageNet Large Scale Visual Recognition Competition 2012 (ILSVRC2012).” [Online]. Available:imagenet.org/challenges/LSVRC/2012/ , n.d.) That demonstrated that CNNs obtain better performance in image recognition tasks than previous studied algorithms, making this the paradigm for this field of study. Introduced by Simonyan & Zisserman et al. (Simonyan & Zisserman, 2014), VGG-Net explored the concept of depth on CNNs in order to increase the model’s accuracy in image recognition settings. With various configurations proposed, highlighting the 16 and 19-layers layout, represented in Table 1, the convolution filter was modified to a 3 x 3 design with a stride of 1 in order to reduce the millions of parameters used. To compensate the reduction of parameters while maintaining the performance, the framework stacked 2 convolutional layers in a row. For instance, using 2 layers with a 3 X 3 filter results in 2 X 3 X 3 = 18 parameters, which has the same receptive field to one convolutional layer with a 5 X 5 filter with 1 X 5 X 5 = 25 parameters, decreasing substantially the number of parameters by 28%. Even with a significant decrease, those models were still very computational heavy. The trade-off in a better performance network was the use of about 3 times the parameters used in comparison to the AlexNet counterpart. VGG-Net participated in the ILSVRC in 2014 on the same dataset as AlexNet, where it obtained a top-5 error-rate of only 7.3%, placing 2nd in classification and 1st in location ( ImageNet Large Scale Visual Recognition Competition 2014 (ILSVRC2014).” [Online]. Available:imagenet.org/challenges/LSVRC/2014/ , n.d.). This reinforced the notion that the deeper and easier CNNs, understand representations in images, the more accurate the results will be.
39 Table 1 - VGG-Net 2 best performance architecture configurations. VggNet Convolution configuration 16 weight layers 19 weight layers Input (224 X 224 RBG image) Conv3-64 Conv3-64 Conv3-64 Conv3-64 Max Pool Conv3-128 Conv3-128 Conv3-128 Conv3-128 Max Pool Conv3-256 Conv3-256 Conv3-256 Conv3-256 Conv3-256 Conv3-256 Conv3-256 Max Pool Conv3-512 Conv3-512 Conv3-512 Conv3-512 Conv3-512 Conv3-512 Conv3-512 Max Pool Conv3-512 Conv3-512 Conv3-512 Conv3-512 Conv3-512 Conv3-512 Conv3-512 Max Pool FC- 4096 FC- 4096 FC- 4096 SoftMax
40 Also in 2014, Szegedy et al . (Szegedy et al., 2015) introduced the GoogleNet, also known as Inception architecture. Szegedy highlighted that, at the time, the most straight forward way of improving the performance of the networks was increasing the depth of the framework. Although practical, two major drawbacks could not be ignored: increasing cost of the model, which required more computational resources for the training and fine tuning, and the increase in parameters to calculate, making it more prone to overfit with smaller/low quality datasets produced. As stated, CNNs had a standard layout structure of stacking processing layers, varying in number and size. The authors theorized that a network architecture that made use of extra sparsity at filter level could be the next step to lessen the computation behind the network learning process. Thus, the Inception module was presented, with its configuration using convolution and pooling operations in a parallel way, concatenating them into the next level layer of the network, as seen in Figure 15. Figure 15 - Example of a ‘naïve’ Inception Module schematic performing 3 convolutions and max pooling with different spatial size filters. Hence, the model has different size kernels finding various features at the same time, and increasing the width of the network, the number of units at each level. The main problem with these modules is that even modest number of 5 X 5 convolutions can be prohibitively expensive on top of the large number of filters already used, leading to a blow up of parameters. To tackle that problem, Szegedy incorporated 1 X 1 convolutional layers, also known as ‘Bottleneck Layers’, firstly introduced in Network in Network by Lin et al . (M. Lin, Chen, & Yan, 2014). This simpler convolutional layer aims to reduce the dimension of its inputs. As an example, seen in
41 Figure 16, convoluting a 1 X 1 X 44 filter on a 24 X 32 x 190 input reduces the output depth of the output to only 44 channels without compromising the height and width. Those are used before the more complex convolutions, resulting in a less computational output compared to the ‘naïve’ first implementation, as well as increasing the non-linearity of its outputs, since the convolutions included ReLU functions which do not affect dimensions and avoid losing feature representation. The final Inception module can be visualized on Figure 17. Figure 16 - Dimension Reduction using 1 X 1 convolutional layer.
48 inputs, instead of learning unreferenced functions. Those were easier to optimize, gaining accuracy with considerably increased depth. The vanishing gradient problem (Glorot & Bengio, 2010) refers to the saturation of the accuracy of the network when adding more layers, degrading rapidly. (Glorot & Bengio, 2010) verified that a 20-layer plain network got lower training error and test error than 56-layer plain network. That experimentation refuted the premise that the same network has better accuracy the deeper it gets. Such degradation was not associated to overfitting, but to backpropagation issues, computed from the back of the network to the front. When training a deep model, the weight of each layer receives an update proportional to the partial derivative of the error function but in some cases, the gradients disappear when vanishingly small multipliers are computed. This effectively prevents the weight from changing its value, proving that not all systems are similarly easy to optimize by stacking more layers. The proposed solution for the degradation problem was the introduction of a deep residual learning framework, presented below in Figure 21. . Figure 21 - Residual Block of ResNet model. By attaching skip/shortcut connections and performing identity mapping, the input 𝑥 was added to the output after a few weight layers. Formally, denoting the output as 𝐻(𝑥), the new the underlying
49 mapping summed with the identity was 𝐻(𝑥)= 𝐹(𝑥)+𝑥. That meant weight layers fitted a residual mapping of 𝐹(𝑥)=𝐻(𝑥)−𝑥, being easier to optimize residual mappings than to optimize the original, unreferenced mappings. Identity shortcut connections did not add any extra parameter nor computational complexity. With that, He et al. (K. He, Zhang, Ren, & Sun, 2016) proved, on the ImageNet dataset, that: • Extremely deep residual nets with skip connections were easier to optimize in comparison with its plain network counterparts (that simply stack layers), with the former exhibiting higher training error when the depth increases. • Deep residual nets could easily enjoy accuracy gains from greatly increased depth, producing results substantially better than previous networks. Four main architectures were proposed with different depths: ResNet-34, ResNet-50, ResNet-101 and ResNet-152, with 34, 50, 101 and 102 being the number of layers used in the architecture, respectively. The baseline models were stacked 3 X 3 convolutions, inspired by VGG-Net (Simonyan & Zisserman, 2014), using shortcut connections every 2 pairs, as seen in Figure 22.(a). The deeper models replaced those 2-layer building blocks with a 3 layer bottleneck block, with the same premise use in Inception architectures (Szegedy et al., 2015), in order to lower the number of parameters, and reducing the complexity whilst deepening the layout, as seen in Figure 22.(b).
50 Figure 22 - Residual building blocks schematic used on ResNet architectures (a) Residual building blocks used on ResNet--34; (b) Bottleneck building block used on ResNet-50/101/152. As notable results, a plain 34-layer and 18-layer networks were trained on the ImageNet dataset, the same way as ResNet architectures with the same number of layers. The top-1 error on ImageNet validation dataset is presented in Table 4. Table 4 - Top-1 error % on ImageNet validation comparison between plain and ResNet architectures. Plain Network ResNet Network 18-Layer error % 27.94 27.88 34-Layer error % 28.54 25.03 The error percentage was higher on deeper networks on plain layouts, presenting the gradient descent problem. With ResNet networks, the error decreased, solving the problem with shortcut connections. Compared with the state-of-the-art at the time, ResNet won ILSVRC in 2015 ( ImageNet Large Scale Visual Recognition Competition 2015 (ILSVRC2015).” [Online]. Available: imagenet.org/challenges/LSVRC/2015/ , n.d.), with some results Table 5. This architecture was a breakthrough to deep learning algorithms, proving that residual blocks optimized the deeper network training in comparison to plain counterparts, where better performances could be achieved with the same number of parameters with only skipping connections between some layers. Table 5 - Results of ResNet Architectures. 2.5 Face Detection and Facial Recognition Face detection and facial recognition are active computer vision fields of study researched for over twenty years. Being a powerful biometric for a user’s identity authentication, its widely use covers many different areas such as law enforcement (Kalal, Mikolajczyk, & Matas, 2010), airport and boarder VGG-16 GoogleNet ResNet-34 ResNet-50 ResNet-101 ResNet-152 top-1 error % on ImageNet validation 28.07% - 24.19% 22.85% 21.75% 21.43% top-5 error % on ImageNet validation 9.33% 9.15% 7.40% 6.71% 6.05% 5.71% top-1 error % on single model ImageNet validation 8.43% 7.89% 5.60% 5.25% 4.60% 4.49% top-5 error % on single model ImageNet validation 24.4% 21.99% 21.53% 20.74% 19.87% 19.38%
51 control or marketing (Masi, Wu, Hassner, & Natarajan, 2019). As many computers vision problems, the research paradigm shifted with the blow up of Deep Learning. Convolutional Neural Networks and the availability of extensive training datasets in unconstrained capture conditions allowed for quicker and more robust systems regarding previously implemented methods. Face detection can be regarded as an object-class detection problem, where its algorithms check for facial landmarks in order to identify faces in images or videos, isolating the proposals via bounding boxes. This method is the cornerstone for several facial applications and analysis, such as facial recognition, being the initial step to modern vision-based human/robot interactions. According to Zafeiriou et al . (Zafeiriou, Zhang, & Zhang, 2015), the first efforts were mainly based on hand-crafted features extracted from images of upright frontal faces, fed into classifiers to detect likely face regions. The first landmark was the Viola & James framework (Viola & Jones, 2001) in 2001, providing a realtime facial detector using Haar Cascade classifiers to detect promising face-like regions, fed into an Adaboost learning algorithm to select critical features from a very large set of potential options. This method explored cascade chain to reject false face regions. The work had high accuracy with great detection speed, with its principles still being used into new algorithms. This led to the widespread adoption of such scale-invariant face detection frameworks. Another popular approached was the use of regional statistics like histograms. Histograms of Oriented Gradients (HOG) (Dalal & Triggs, 2005) reviewed existing edge and gradient based descriptors, with the classification being performed with an SVM classifier, significantly outperforming existing features sets for human detection at the time. However, those methods proved to still be limited on multiple variations of faces like scale, pose or illumination. Facial recognition is a multi-label classification problem, focusing on the analysis of faces in order to predict a specific identity. A survey (M. Wang & Deng, 2021) highlighted three big milestones before Deep learning techniques, presented in Figure 23. Figure 23 - Milestone of face representation for facial recognition.
52 These holistic approaches derive from dimensional reduction algorithms as baseline. These dominated the face recognition community in the 1990’s and 2000’s through certain distribution assumption, such as linear subspace, manifold, or sparse representation. They were popularized by the Eigenface method (Turk & Pentland, 1991), where eigenvectors were calculated using principal components analysis (PCA) and then compared to known individuals. This framework proved to be efficient but has low accuracy with different scales of images, orientation invariance of the head, and lighting variation problems. Fisher Discriminant Analysis (Belhumeur, Hespanha, & Kriegman, 1997) performed better on illumination variance and expression in a linear subspace approach, while Laplacianfaces (X. He, Yan, Hu, Niyogi, & Zhang, 2005) used locality preserving projections (LPP), providing lower error rates. However, these methods are still very prone to misclassification when dealing with age and pose variation, as well as facial changes. In 2000’s, facial recognition converged to local feature-based filtering methods such spatial pooling or histograms. With these methods, Gabor-Fisher classifiers (C. Liu & Wechsler, 2002) and local binary patterns (Ahonen, Hadid, & Pietikäinen, 2006) techniques and its extensions achieved robust performances through some invariant properties of local filtering. Although handcrafted features were an important breakthrough, they suffered from a lack of distinctiveness and compactness. In the early 2010s, facial recognition used shadow networks with learning-based local descriptors (Low, n.d.) (Chan et al., n.d.), where local filters are learned for better distinctiveness, and the subject’s faces are compacted into encoders. With good results, these shallow techniques still had limitations regarding robustness and complex non-linear facial variations. In general, non-deep learning methods used one or two processing layers in order to recognize human faces, focusing on filtering responses, histograms, or local-based distributions. Those methods almost only focused on one aspect of unconstrained facial changes, like lighting, pose, expression, while not approaching these integrally. Researchers studied intensively to improved said results, only to improve the accuracy slowly. Hence, that technical insufficiency made facial recognition frameworks unstable, with its real-world systems having untrustworthy performances with various false positives. 2.6 Related Work Deep Learning based facial detection and recognition pipelines reached state-of-the-art performances compared to traditional methods, having more processing layers which incorporated previous filtering techniques. A key contribution was the assembly of large datasets of annotated unconstrained face data in order to train said algorithms.
53 CNNs have been successfully applied for face detection and location. The main benchmarks for this field of study are the Wider Face (Yang, Luo, Loy, & Tang, 2016), with 32.203 images and 393.703 labeled faces with a high degree of variability in scale, pose and occlusion, resulting in a very challenging dataset. For each event class, it randomly selected 40%, 10%, 50% data as training, validation and testing sets, accordingly. Other benchmarks include FDDB dataset, PASCAL Face (Yan, Zhang, Lei, & Li, n.d.), MALF, UFDD (Nada, Sindagi, Zhang, & Patel, n.d.) or VGGFace2 (Cao, Shen, Xie, Parkhi, & Zisserman, 2018). According to Minaee et al . (Minaee, Luo, Lin, & Bowyer, 2021), the four main techniques used for facial detection were: 1. Cascade-CNN based models; 2. R-CNN based models; 3. Single shot detector models; 4. Feature Pyramid Detector based models. Cascade-CNN based models grouped several architectures into one, where the output of the previous convolutional model is the input of the next. Those proved to be powerful multi-tasking frameworks, accurately performing facial regression as well as keypoint estimation, and managing to align the detected face proposals. Li et al . (Li, Lin, Shen, Brandt, & Hua, n.d.) proposed a 12-layer cascaded operating at different resolutions, quickly rejecting background regions on the early low-resolution stages, and having calibration methods after every detection phase. In the same order, Zhang et al . (K. Zhang, Zhang, Li, & Qiao, 2016) proposed a 3-phase cascaded architecture for joint face detection and alignment trained on the WIDER FACE dataset (Yang et al., 2016), where that training data presented large amounts of significant pose variation, lighting or expression. Region proposal-based CNN algorithms used a two-step approach. First identified regions where objects are expected. Then, these algorithms used region proposal networks, extracting regions of interest in order to propose bounding box coordinates for a desired class. By being very successful for object detection, those algorithms were adapted to face detection by several works. Chen et. al . (Chen, Hua, Wen, & Sun, n.d.) used a multi-task Region proposal network, where it predicted the candidate faces along with its facial landmarks. Those regions were then normalized and fed into a Region-CNN where it validated if the regions are valid faces or not. Wang et al . (Y. Wang, Ji, Zhou, Wang, & Li, 2017) presented a ResNet convolutional network with as feature extractor, resulting in a batch of the RoI. Those were then further fed into two sibling positions sensitive RoI pooling layer to produce class score
54 maps and bounding box prediction map. That way with multi-scale training maps to a certain location of the output score maps. Single shot detection models proposed bounding boxes over different aspect ratios and scales, generating scores accordingly to the certainty of the presence of a face. Additionally, the network combined predictions from multiple feature maps with different resolutions to naturally handle samples of various sizes, instead of rescaling the original image like the cascaded approaches. That way, single shot detects faces in a single stage directly. Najibi et al. (Najibi, Samangouei, Chellappa, & Davis, n.d.) achieved state of the art results by using a scale-invariant design in a single forward pass. Feature Pyramid Network Based models (T.-Y. Lin et al., n.d.) combined semantically weak features with meaningly strong features based on skip-connections. Zhang et al . (J. Zhang et al., n.d.) proposed a feature agglomeration network, where inherent multi-scale features were exploited by aggregating semantic features maps with different scales to augment lower-level feature maps via a hierarchical agglomeration manner. Deng et al . (Deng et al., n.d.) introduced RetinaFace, which performed a pixelwise face localization on various scales in a single-stage. This algorithm took advantage of joint extrasupervised and self-supervised multi-task learning. The authors manually annotated five facial landmarks on WIDER FACE dataset, observing significant improvement in hard face detection. It achieved state of the art performance in several benchmarks. Facial recognition, being a multi-class classification, benefited greatly from deep learning techniques, having typical CNN architectures as structural baseline. Wang and Deng (M. Wang & Deng, 2021) categorized various novel frameworks by their lost functions, being grouped by Euclidean-distance- based loss, angular/cosine-margin-based loss and SoftMax Loss and its variations. SoftMax Loss is a logistic function used for probability distribution. In multi-class classifications, SoftMax computes the probability vector of all the output classes. DeepFace (Taigman, Yang, Ranzato, & Wolf, 2014) represented the first breakthrough in facial recognition using neural networks, where it achieved state-of-the-art accuracy (97.35%) on LFW benchmark (Huang et al., 2008) in 2014. Using the SoftMax loss function and the AlexNet (Krizhevsky et al., 2017) model trained using four million facial images, approaching human performance (97.53%). After this breakthrough, various proposals achieved state- of-the-art performances regarding classification. However, SoftMax had the drawback that intravariations could prevail over inter-variations, making the loss function insufficient for generalization of the facial recognition pipeline.
55 Euclidean-distance-based loss method maps facial features extracted from images into embedding arrays into a Euclidean space, that maximized the inter-variance (different classes/between group) distance and minimized the intra-variance (same class/within group). Contrastive loss simultaneously compressed the Euclidean distance of image pairs of the same individual, while enlarging the distance between different identity pairs. DeepID2 (Sun, Wang, & Tang, 2015) combined the SoftMax algorithm for classification with contrastive loss for verification, reaching 99.15% accuracy on the LFW benchmark. Later, DeepID2+ (Sun, Chen, Wang, & Tang, 2014) added supervision to early stages of the CNN, as well as increasing the dimension of hidden representations. DeepID3 (Sun, Liang, Wang, & Tang, 2015) introduced the VggNet and GoogleNet architectures into the previous algorithms. Although powerful, the contrastive loss problems reside on the margin parameter used on the positive and negative pairs being difficult to choose in order to optimize accuracy. The main ideas were the Contrastive loss and the Triplet loss, providing great performances in facial classification functions. Triplet loss algorithm used face triplets, anchor, positive sample, and negative sample. Anchor and positive sample are the same class identities whereas the negative sample is a different class sample. The formula tried to minimize the relative distance between the anchor and the positive while maximizing the anchor/negative distance. This concept was introduced by FaceNet (Schroff, Kalenichenko, & Philbin, 2015), which directly optimized the embedding itself, rather than using an intermediate bottleneck. Using the Inception architecture, Szegedy et al . (Szegedy et al., 2015) provided the capability to concatenate different filter sizes in the same processing layer. VGGface (Parkhi, Vedaldi, & Zisserman, 2015) built a large-scale dataset, training a VGG network pipeline and finetunning it via triplet loss. Triplet loss approaches can be difficult to optimize given the training instability induced by the selection of triplets, making it hard to choose effective samples for various classes. In other Euclidean loss metrics proposed, Center loss (Wen, Zhang, Li, & Qiao, n.d.) proposed a centerinvariant loss, calculating the ‘centers’ of each class, penalizing the distance between the features and their corresponding class centers. By reducing that distance of each data sample, it compresses the inter-variance. Combining it with a SoftMax loss, Center loss prevents embeddings from collapsing. Range loss (X. Zhang, Fang, Wen, Li, & Qiao, 2017) minimized the greatest ranges of harmonic means in one class and, maximizing the shortest inter-class distance within one batch. Angular/Cosine-margin based loss studied angular similarity of discriminative face features, generating angular/cosine separability between the learned characteristics. Compared to the Euclidean-distance based loss, this method added constraints in a hypersphere manifold, represented in Figure 24.
56 Figure 24 - Hypersphere manifold design. L-SoftMax (W. Liu, Wen, Yu, & Yang, 2016) combined the SoftMax function with a large angular margin in a multiplicative manner. Based on that work, A-SoftMax normalized the extracted feature vectors with a L2. normalizer, where faces are represented into a hypersphere space manifold, learning by angular margin. ArcFace (Deng, Guo, Xue, & Zafeiriou, 2018) and CosineFace (Feng Wang, Cheng, Liu, & Liu, 2018) overcame the optimization problems by presenting additive angular/cosine margins. Those were easier to implement without the need of complex hyperparameters and can be converged without SoftMax. Angular/Cosine-margin based loss approaches tend to achieve better performance, although, according to Wang (Fei Wang, n.d.), these loss approaches are very vulnerable to noisy or unclean datasets. The biggest prerequisite for an effective deep learning face recognition pipeline is a sufficiently large dataset. Early works of facial recognition trained with private datasets. Naming a few, Facebook’s DeepFace (Taigman et al., 2014) trained on 4 million images of 4000 people. Google’s FaceNet (Schroff et al., 2015) trained on 200 million images of 3 million classes. DeepID methods trained on 200.000 images of 10.000 people. Hence, performance results could not be replied given the lack of data necessary. Nowadays, public datasets were created, mainly by public institutions. CASIA-Webface (Yi, Lei, Liao, & Li, n.d.) provided the first public training dataset, containing 500.000 images of 10.000 celebrities collected online. Recently, larger datasets were created and made available publicly, such as the MS-Celeb-1M (Guo, Zhang, Hu, He, & Gao, n.d.), VGGface2 (Cao, Shen, Xie, Parkhi, & Zisserman, n.d.) or Megaface (Kemelmacher-Shlizerman, Seitz, Miller, & Brossard, n.d.).Table 6 presents some of the most used datasets to achieve a robust facial recognition.
57 Table 6 - Facial Recognition datasets used for training Datasets Publish Time Images Subjects CASIA WebFace 2014 494.414 10.575 Facebook (private) 2014 4.4 million 40.000 CelebFaces+ (private) 2014 202,599 10.177 Google (private) 2015 >500 million >10 million VGGface 2015 2.6 million 2.622 VGGface2 2017 3.31 million 9.131 MegaFaces 2016 4.7 million 672.057 MS-Celeb-1M 2018 4 million 80.000 In order to compare the state-of-the-art facial recognition methods, Wang and Deng (M. Wang & Deng, 2021) compared the performance accuracy results on the LFW benchmark (Huang et al., 2008), which is presented in Table 7:
64 Figure 28 - Image pyramid. This technique, widely embedded into cascaded frameworks, resized the original images using a scaled factor. That way the network’s kernels could find different size faces in one sitting in the same image without the need to apply different spatial sizes. 3.3.2 Stage Cascaded Network and Non maximum suppression The first network is known as P-Net, presented in Figure 29. Being a Shallow framework, it generates many candidates of where the face is, calibrated with their bounding box regression vectors.
65 Figure 29 - Proposal Network architecture schematic. After those proposals were found, the NMS algorithm was applied to merge highly overlapped candidates. This technique is used when various proposals of the same object, in this context a face, exist, choosing the candidate with the best prospect, filtering the rest. The score of the candidates is calculated by the IoU metric, used to quantify the percent overlap between two bounding box predictions. IoU can be determined by Equation (4): 𝐼𝑜𝑈= 𝐴𝑟𝑒𝑎 𝑜𝑓 𝑂𝑣𝑒𝑟𝑙𝑎𝑝 𝐴𝑟𝑒𝑎 𝑜𝑓 𝑈𝑛𝑖𝑜𝑛 (4) Where 𝐴𝑟𝑒𝑎 𝑜𝑓 𝑂𝑣𝑒𝑟𝑙𝑎𝑝 is given by the Intersection (Figure 30.(a)) between two proposals and the 𝐴𝑟𝑒𝑎 𝑜𝑓 𝑈𝑛𝑖𝑜𝑛 is set by the Union (Figure 30.(b)) of the two. Figure 31 compares performance and with different IoU settings between 2 proposals.
66 Figure 30 – Intersection (a) and Union (b) between two bounding boxes. Figure 31 - IoU performance comparison. NMS sets a threshold and calculates the IoU between the picked proposal with the best confidence and the rest of the proposals of the same candidate. If the IoU is higher than the threshold, meaning a big overlap between the two, that candidate is filtered. That way, a lot of saturated suggestions get merged to the previously chosen best candidate. The R-Net (Figure 32) analyses the proposals given by the first CNN and filters false positives. Being more complex, while using a fully connected layer in the end of the model, it rejected many proposals given. Like the first stage, it calibrates the proposals with NMS merging and bounding box regression. Figure 32 - Refinement Network architecture schematic. The final network is the O-Net (Figure 33), which creates the final bounding box output of the detected face's image and 5 facial landmarks. This framework produced 3 outputs: binary Face classification, 4 element Bounding Box Regression vector and 10-element Facial Landmark Localization vector.
67 Figure 33 - Output-network architecture schematic. 3.3.3 MTCNN Training Methodology The training was conducted on the WIDER FACE (Yang et al., 2016) dataset. Face classification problem uses cross-entropy loss to check if the predicted proposal is indeed a face, given by Equation (5): 𝐿𝑖𝑑𝑒𝑡 =(𝑦𝑖𝑑𝑒𝑡log(𝜌𝑖)+(1−𝑦𝑖𝑑𝑒𝑡)(1−log(𝜌𝑖))) (5) where 𝜌𝑖 is the probability generated by the network that indicates a sample being a face. The notation 𝑦𝑖𝑑𝑒𝑡denotes the ground-truth label. Bounding box regression vectors and NMS, the offset is predicted, and the ground truth employed with Euclidean loss, seen in Equation (6): 𝐿𝑖𝑏𝑜𝑥 =‖𝑦𝑖𝑏𝑜𝑥−𝑦𝑖𝑏𝑜𝑥‖2 2 (6) Where 𝑦𝑖𝑏𝑜𝑥 is the target obtained from the network and 𝑦𝑖𝑏𝑜𝑥 the ground truth coordinate. Like the bounding box regression, facial landmark detection is a regression problem where Euclidean loss is minimized by Equation (7):
68 𝐿𝑖𝑙𝑎𝑛𝑑𝑚𝑎𝑟𝑘 =‖𝑦𝑖𝑙𝑎𝑛𝑑𝑚𝑎𝑟𝑘−𝑦𝑖𝑙𝑎𝑛𝑑𝑚𝑎𝑟𝑘‖2 2 (7) For this dissertation, only the Bounding Box regression output was considered. The trained weights and biases of this model were obtained via Transfer Learning. This is a ML method allowed pre-trained models to be reused, skipping the training part, focusing on the Inference part. Inference does not reevaluate the NN. It only applies knowledge acquired from a trained NN model, inferring the result. So, when new unknown data is presented, it outputs a prediction based on predictive accuracy of the NN. The implementation and parameters of this framework was used from GitHub (“GitHub - davidsandberg/facenet: Face recognition using Tensorflow,” n.d.). Showed on Figure 34, the parameters were loaded from NumPy array file, replacing the TensorBoard placeholders used in the implementation Figure 34 - Parameter acquisition via Transfer Learning. 3.3.4 Implementation The three initial variables declared had the same value at every framework. Those were the n x n minimum size of faces to be detected, the thresholds used in the NMS algorithm and the scalar factor for the image pyramid method. The values used are presented in Figure 35
69 Figure 35 - MTCNN variables for face detection. The face detector can be used on individual images and videos by inputting the path file on Ubuntu terminal, or the real-time applications using the computers camera. These are executed with different scripts via Ubuntu Terminal, as showcased in Figure 36. Figure 36 - Executing Python Scripts for face detection; (a) - Images; (b) - Videos; (c) - Real time. As seen in the Figure 37 example of a dataset image, the align_dataset_mtcnn.py script automatically detected and aligned the faces in images in a dataset directory, creating a new dataset with only cropped faces with a specific configuration (160 x 160 image), the same configuration as the input values needed to feed CNN for feature extraction.
70 Figure 37 - Python Script used for detecting and aligning of faces in a dataset. 3.4 Datasets To perform NN training and fine-tuning, two different datasets were used. Initially the CASIA-Webface (Yi et al., n.d.) dataset was used. It contained 494.414 images of 10.575 people for verification performance and it was further verified on the LFW (Huang et al., 2008) benchmark. 3.4.1 LAR dataset Additionally, a personalized dataset was created and used for training and validation. It contains 19 classes of image data from students and teachers associated with the Laboratory of Automation and Robotics (LAR) of Minho University. The elements contained in the dataset are set in Table 9. All members consented the use of their identity and use of one’s images.
71 Table 9 - Elements of the LAR dataset. Name Genre Age António Ribeiro Male 20 Bruno Sousa Male 25 Carlos Silva Male 23 Carolina Pires Female 24 Carolina Rua Female 23 Dimitri Santos Male 23 Fabio Cunha Male 22 Fawad Male 32 Fernando Ribeiro Male 54 Francisco Ribeiro Male 18 Gil Lopes Male 49 Inês Garcia Female 25 Inês Ribeiro Female 23 Michael de Oliveira Male 26 Nuno Andrade Male 22 Nuno Pereira Male 25 Rafael Marques Male 25 Sérgio Baixo Male 24 Tiago Ribeiro Male 25 The individual images that made the dataset were fetched using the OpenCV library. It extracted frames from video of a sole identity using the computer’s camera or from a personal device. The video content was simple: the person would start by looking directly at the camera, then rotating their head 180º from left to right. That way, the model would have different perspectives of its classes. Then, the python script New_class.py, Figure 38, created a directory with the target’s name inside the selected dataset. The script checks the video frames, turning them into ordered file images with the person’s name, inserting them into the created directory. It had 4 arguments: the video for image extraction, dataset’s directory path to be inserted, the class name, and the flag ‘save’ to verify the extraction.
72 Figure 38 - Custom Dataset. 3.4.2 Image Transformations In order to create a robust system, image transformations were performed in some of the frames extracted from the videos when the images were created. This included random rotations and horizontal flips of the image done via OpenCV library. The rotations were restricted to -30 to 30º, as seen in Figure 39. Figure 39 - Image transformations using OpenCV Library, (a) - horizontal flip; (b) - Random rotation (> 0º); (c) - Random rotation (<0º).
73 3.5 Inception-ResNet Network The main deep NN pipeline used for faces feature extraction is the Inception-ResNet version 1 and 2 (Szegedy et al., 2017). This model results in a combination of two different deep learning methodologies, previously reviewed in Convolutional Network Architectures: residual connections introduced by ResNet (K. He et al., 2016) and the Inception modules introduced with GoogleNet (Szegedy et al., 2015). The proposed model was trained locally using supervised learning methods. 3.5.1 Approached Concepts In traditional NNs, a layer feeds data to the following one, but with residual connections (Figure 21), the information is sent directly from a layer into a deeper one. These blocks improve two distinct areas. First, the training time, given that skip-connections can jump layers without training. Secondly, the lost information when making gradient descent, since more deep networks have a hard time being accurate without overfitting or working more straight forward tasks (Vanishing Gradient problem (Glorot & Bengio, 2010)). The residual Inception blocks used on this architecture were optimized with a filterexpansion layer, a 1 X 1 convolutions without activation (Figure 40). Those were implemented in order to compensate the dimensionality reduction induced by the Inception part, given that residual addictions only work if the input and output matched the same depth sizes. Figure 40 - Optimized residual block.
80 Before being inputted to the network, the images are prewhiten, which subtracts the average and normalizes the range of the pixel values of input images. It made the training process a lot easier by speeding up the training and inference. 3.6.3 Learning Methodology The NN used Softmax with Cross Entropy as training loss function over an input batch. The Softmax function computes the output probabilities array of the classes in the dataset. The higher the probability on a class, the more the model thinks the input object represents that class. The sum of the class’s probability is always 1. This is represented by the function: 𝑆𝑖=𝑒𝑉𝑖 ∑𝑒𝑉𝑗 𝑗 (8) Where 𝑉𝑖 represents the input elements and ∑𝑒𝑉𝑗 𝑗 the normalization term to range the probability in the 0-1 range. The loss is then calculated with Cross-Entropy, defined by: 𝐻(𝑝,𝑞)=−∑𝑝(𝑥)log q(𝑥) 𝑥 (9) Where 𝑝(𝑥) represents the conditional empirical distribution over class labels, being 1 to the observed class and 0 for all others, and q(𝑥) is the conditional distribution, probability obtained from the model given an input. 3.6.4 Saving the Model Saving the model and its variable logs and events was carried out with Summary FileWriters, providing a mechanism to create an event file in a directory and add summaries and events to its protocols. The tf.Summary module provides APIs for writing summary data, being visualized in TensorBoard.
81 Split into 3 files for training, validation, and testing, observed in Figure 50, those events were inserted into the directories trained model. That way, when using TensorBoard, one can check the 3 directories at the same time or import one isolated list. Figure 50 - Creation of the file writers for data exportation. After an epoch training, the model’s checkpoint and metagraph were also exported to the model’s directory with a saver. Those can later be used for the classifier pipeline or training other models with transfer learning. The variables tuned from training epoch are then saved to the file writers, as seen in Figure 51. Figure 51 - Saving and importing the model's metagraph and variables. 3.7 Classifier With the model of Inception-ResNet, adding a new person to the dataset implied having to always restart the training with new classes. As a solution, using the model only as a feature extractor to map images into an embedding vector, the predictions can be done using outside classifiers with less computational cost. Before building the classifier, the Inception-ResNet feature extractor graph is loaded, where the images used are encoded into an embedding array. Those are then used to train an SVM classifier.
82 Support Vector Machines produced significant accuracy with less computation power. The objective of the support vector machine algorithm is to find a hyperplane in an N-dimensional space (N the number of features) that distinctly classifies the data points, as observed in Figure 52. Figure 52 - Support Vector Machine representation. Hyperplanes work as decision boundaries that classify the data points. Those allocated on either side of the hyperplane can be attributed to different classes. By finding the maximum margin the maximum distance using the support vectors (data points closer to the hyperplane that influence its position and orientation), future data points could be classified with more confidence. Some classification problems cannot be solved using a linear hyperplane. The SVM used a kernel to transform the input space to a higher dimensional space to be able to segregate the data points. The model used was the SVM implementation of Scikit-learn library (Figure 53). It used linear kernel technique. It is used when the data can be separated using a single line, since the dataset had a large number of features. Figure 53 - SVM implementation on Scikit-Learn library. The python script used has 2 input modes, with its input initialization specified on Figure 54: TRAIN and CLASSIFY.
83 Figure 54 - Classifier Script inputs; (a) Train the classifier; (b) Predict with classifier. The TRAIN mode inserted the images and labels into the SVM model, where the final classifier is stored in a Pickle file, a Python module that enables objects to be serialized on a disk or deserialized into a program runtime classifier uses. On the other hand, the CLASSIFY loaded the classifier, where the input images classes are predicted by the previously trained classifiers. 3.8 Data Visualization TensorFlow’s data visualization toolkit, TensorBoard, provided the necessary mechanisms to evaluate the model’s performance, plotting how the learnable parameters converged over time of training with different hyperparameters. It also allowed the display of different variables, like the dataflow of the computations, images, or projection of data used. 3.8.1 Computational graph The computational graph allowed a schematic view of the TensorFlow model using the TensorBoard's Graph Dashboard, examining its structural design. As previously discussed, the data used by TensorFlow is stored in tensors. Hence, the computations done are schemed into the operations/nodes performed by the code, with the computational dataflow being represented as well. In Annex II – TensorBoard Training Graph, the computational graph of the used model is presented. In order to have a simpler layout, all operations involving a module were designated with the same name scope. As an example, the millions of parameters of the network are hidden inside the Inception-ResNet name scope, not compromising the graphs design.
84 3.8.2 Plots Key metrics, such as loss or accuracy, were plotted using the TensorBoard's Scalars Dashboard via Summary File Writers (Figure 55). The same way, images were exported using the TensorBoard's Image Dashboard (Figure 49). Figure 55 - Scalar call after an epoch train and exporting via Summary writer. 3.8.3 Embedding Projector TensorBoard ‘s Embedding Projector graphically represents the high dimensional feature vectors into smaller dimensions using Dimension Reduction algorithms. That way, examining how those methods separate/cluster the data created by the extractor can validate the training process. To encode the images into the projector, a file directory had to contain a sprite file to be uploaded, the configuration file and the neatly labels that identify the images (Figure 56.(a)). The configuration file associated the sprite image with the metadata. It also set the single image size to then be isolated for each other (Figure 56.(b)). The metadata was a TSV file, a file extension for a tabdelimited file used with spreadsheet software, that contained the matching labels in the sprite images (Figure 56.(c)).
85 Figure 56 – Embedding Projector Setting (a)-Projector Directory; (b)- Projector configuration file; (c) – Metadata file containing the ordered labels The sprite image was a single frame compilation of all images uploaded to the projector as seen in. Figure 57 - Sprite of some images of the classes used in the LAR dataset. 3.8.4 Principal Component Analysis Principal Component Analysis reduces the data dimensionality, making a linear projection of smaller components, with the premise that more straight forward samples are more accessible to interpret and visualize at the cost of very little information loss. At a conceptual level, PCA determines the principal components of new variables that are a linear combination of the original data. It accomplishes this by creating new uncorrelated variables that consecutively maximize variance. (a) (b) (c)
86 After normalizing the data, the covariance matrix is calculated by Equation (10): 𝑐𝑜𝑣(𝑋,𝑌)=1 𝑛−1∑(𝑋𝑖−𝑥)(𝑌𝑖−𝑦) 𝑛 𝑖=1 (10) To check how the variables are related to each other, the Eigenvectors, vectors whose direction remains unchanged when transformed, are calculated, as well as the Eigenvalues. The scalar from which the eigenvector is scaled from uses Equation (11): 𝐴𝑣=𝜆𝑣 (11) Where A is the correlation matrix, v is the eigenvector, and λ is the eigenvalue. The Principal Components are the top k-dimensional eigenvectors that give the direction of the axes, with the largest eigenvalues, meaning that more variance was stored, where k is the new dimension. It ranks these from highest to lowest K value returning the principal components in order of significance. 3.8.5 t-SNE T-distributed stochastic neighbor embedding, presented by Van Der Maaten and Hinton (Van Der Maaten & Hinton, 2008b) is a non-linear method based on Stochastic Neighbor embedding that computes K-dimensional data into a lower dimensional mapping by performing several region-based transformations. t-SNE differs from PCA by preserving only small pairwise distances or local similarities whereas PCA is concerned with preserving large pairwise distances to maximize variance. For that, it calculates the joint probability distributions (similarities between data, mapping them into a dataset of points in the new n dimension), applying gradient descent to tune similarities in the distribution. The similarity of datapoint 𝑥𝑗 to datapoint 𝑥𝑖 is the conditional probability 𝑝𝑗|𝑖, where 𝑥𝑖 would pick 𝑥𝑗 as its neighbor if neighbors were picked in proportion to their probability density under a Gaussian centered at 𝑥𝑖, and those probabilities are proportional to the similarities. That probability is given by Equation (12): 𝑝𝑗|𝑖 =𝑒𝑥𝑝(−‖𝑥𝑖−𝑥𝑗‖2/2𝜎𝑖2) ∑𝑒𝑥𝑝(−‖𝑥𝑖−𝑥𝑘‖2/2𝜎𝑖2) 𝑘≠𝑖 (12)
87 Where 𝜎𝑖 represents the variance of the Gaussian that is centered on datapoint 𝑥𝑖. Joint probability in the high-dimensional of data is defined as 𝑝𝑗𝑖, to be the symmetrized conditional probabilities, calculated by Equation (13): 𝑝𝑖𝑗 =𝑝𝑗|𝑖+𝑝𝑖|𝑗 2𝑛 (13) To reduce the data, a random dataset of the same number of points of the high dimension dataset is created in the K-dimension desired. The distribution joint probability is created with t-distribution, given that it maximizes distances between points in the low dimension space compared to the same distance in the correspondent high-dimensional space. Joint probability in the low dimensional space is defined as 𝑞𝑖𝑗, calculated by Cauchy distribution using Equation (14): 𝑞𝑖𝑗 =(1+‖𝑦𝑖−𝑦𝑗‖2)−1 ∑ (1+‖𝑦𝑘−𝑦𝑙‖2)−1 𝑘≠𝑙 (14) Kullback-Leiber divergence, defined by Equation (15) measures the difference between P (joint probability distribution in the high dimension) and Q (joint probability distribution in the low dimension) distributions in 𝑋 space, the result as smaller as similar they are. This makes the map’s representation of joint probabilities (almost) invariant to changes in the scale of the map for map points that are far apart. 𝐷𝐾𝐿(𝑃∥Q)=∑𝑃(𝑥)log(𝑃(𝑥) 𝑄(𝑥)) 𝑥∈𝑋 (15) The gradient of the Kullback-Leiber divergence between P and the Student-t based joint probability distribution Q is given by Equation (16): 𝛿𝐶 𝛿𝑦𝑖=4∑(𝑝𝑖𝑗− 𝑞𝑖𝑗)(𝑦𝑖−𝑦𝑗))(1+‖𝑦𝑖−𝑦𝑗‖2)−1 𝑗 (16)
88 Where the cost function applies gradient reduction to the low dimensional dataset, so that its distribution resembles the one on the original.
89 4. RESULTS 4.1 MTCNN 4.1.1 Implementation Results The first presented result refers to the output implementations of the MTCNN framework using the computers camera, presented in the Stage Cascaded Network and Non maximum suppression section. With an image-pyramid scale factor of 0.709, as well as a [0.6;0.7;0.7] detector threshold for the bounding box IoU for the 3 stages. The P-Net flagged all face proposals with different kernel sizes, using the image pyramid, generating numerous bounding boxes. Afterwards, those proposals were filtered by non-maximum suppression, ready to be inputted into the next network. The P-Net final output with NMS is shown in Figure 58.(a). Next, the R-Net focuses on filtering a high number of false positives. It used the previous network’s proposals data to generate more precise bounding boxes, with all the lower confident candidates being eliminated. The boxes are then calibrated to have a square-like shape. The R-Net output is presented in Figure 58.(b). By using NMS again, the bounding boxes are reduced, merging overlapped proposals, being calibrated and padded to have a squarer like shape, as shown in Figure 58 - Output bounding boxes of MTCNN framework. (a) P-Net output with NMS. (b) R-Net output. (c) R-Net output after NMS (d) O-Net output (e) O-Net output after NMS (f) Final Cropped face.(c). Finally, the O-Net standardizes both the bounding box and facial landmarks coordinates, Figure 58.(d). After the NMS, only the bounding box prediction with the highest confidence level is provided, as shown in Figure 58.(e). The final output of the MTCNN is the cropped imaged from the final bounding box prediction represented in Figure 58.(f). This image is a representation of the data used for training/inference the Inception- ResNet. The final output is a 160 x 160 image. After the implementation result, more tests were done on public images on the internet, as well as real-time tests regarding different variables that could risk the viability of the framework. The results signalized detected faces in the frames, with the bounding box coordinates serving as measurements. For a better visualization, the bounding box was outlined on the faces in the images. After, the MTCNN aligned and cropped faces in a dataset in an equal configuration to the necessary input settings for the Inception-ResNet CNN.
96 Figure 65.(b) showcasing the [0.5, 0.6; 0.6] output having a better performance. Although neither output can detect all the targets, most of the explicit faces were recognized. Given the current world’s pandemic, images with people wearing masks were also target tested (Figure 66). The model usually can easily detect faces in those settings, as long as the rest of the facial landmarks were not hidden. Figure 65 – MTCNN output on harder faces to characterize with different threshold arrays. (a) - [0.6, 0.7; 0.7]; (b) - [0.5, 0.6; 0.6]. Photo covered by Creative Commons license
97 Figure 66 - MTCNN bounding box results on an image of people wearing masks. Royalty Free photo taken online 4.1.3 Camara tests The same experiments carried out on Tests on Images and videos were applied to real time face detection, using the computer’s camera. The first test done was the number of frames possible using the MTCNN. Being computationally heavy, with the cascaded network, the fps can fluctuate between 10 to 18 fps, depending on other processes being used in parallel. Lighting tests were done using the computer camera with different illumination settings. On Figure 67, different lighting deviations are presented on the same target environment. Having a target person presented in front of the camera, the model manages to identify the face on 3 illumination settings easily. Figure 67 - MTCNN bounding box output on different face poses detected with the camara Another important feature regarding face detection tested was the different face pose scenarios in real world applications. Various poses in front of the camera were carried, with Figure 68 example demonstrating different face-detection perspectives. (a) (b) (c)
98 Some tests were also done on people wearing masks, since its use became a standard variable in day- to-day activities. The face detector managed to accurately identify the faces, failing in some frames, accusing some uncertainty. Two of those poses recorded are showcased in Figure 69. Figure 68- Face detection using wiht computer's camara for diferent lightin settings. (a)- Bright enviroment; (b)- Intermediate lighting; (c) Sub-par ilumination Figure 69 - Face detection using the computer’s camara on masked faces 4.1.4 LAR dataset The custom-built LAR dataset had 19 classes with 300 data points per identity. That summed up to 5700 images in total, with 4617 of them used for training, 513 for cross-validation and 570 for test at the end of training framework. The images were gathered from videos of the individual identities, creating the pre-processed dataset. Before inputting the images into the face detector, random transformations were done on the images. Those allowed for more variety in the data intended to train the model. With that, the classifier was more prone to identifying new samples correctly in the inference part of the model. The methods used were random rotations and horizontal flips, with an example of those results being showcased in the left column of Figure 70.(b), Figure 70.(c) and Figure 70.(d). After the MTCNN output, the dataset images only contained the cropped and aligned faces in a 160 x 160 dimension setting. Those are showcased in the right column of Figure 70.
99 Figure 70 – Image transformations from frames gathered from videos form people in the dataset and respective MTCNN detector and alignment output; (a) - No transformation; (b) – Random rotation(>0º); (c) - Random rotation(<0º); (d) – Horizontal flip. (a) (b) (c) (d)
100 4.1.5 Face Detection Conclusion Regarding the Implementation Results section, the MTCNN pipeline was easy to implement in real-time settings. By loading the weights and bias from transfer learning from the previously trained network by (“GitHub - davidsandberg/facenet: Face recognition using Tensorflow,” n.d.), large part of the implementation was skipped. With those, the model was able to easily detect faces on images, recorded videos and in real-time video in standard conditions. The proposed variable settings displayed in Figure 35 were adequate pursuing a good framework accuracy when not exposed to extreme disadvantage situations. On Tests on Images and videos section, tests with different number of targets, like the ones on Figure 59 and Figure 60, proved that the framework’s performance was not affected by the number of faces to be detected. Those tests also demonstrated that different candidate’s size faces, simulating how far/near the viewpoint was, were equally detected, proving the efficiency of the image pyramid algorithm. MTCNN was also proven capable of identifying a face in various pose scenarios in real world environments, with different analysis being done such as the one in Figure 60 or Figure 65. Although the cascaded CNN was still not able to fully recognize all targets, those whom the model could not identify had a lot of noise in their surroundings or adverse conditions. To better understand the model’s flaws, more tests were done on blurred images, bad lighting or ‘disguise’. Those proven very challenging for the detector framework when facial landmarks were not exposed or in bad detecting conditions. By lowering the threshold array of the 3 stages, more proposals marked as faces, passing through the NMS algorithm, as seen in Figure 61, Figure 63 or Figure 65. That allowed the MTCNN to point out more faces in harder situations. One drawback of this practice was that even when lowering the thresholds, still not all the faces were detected. The other drawback was that false positives were more frequent (Figure 63.(c) and Figure 64.(c)), costing the models accuracy. When implementing the model with the camera for real-time settings, the model reached a constant frame count of 10 to 18 fps. That made the model reliable in real time configurations. The same tests were carried out using the camera in standard environments. Those verified good detection results in different distances from the camera. The model also easily detects different faces pose variations in different illumination settings.
101 When building a dataset for face recognition, the samples are usually the cropped face of the class identity, with the least background possible. The MTCNN pipeline did that by cropping and aligning the face of the people to be inserted in the custom dataset of users from LAR. Those data points were obtained in the frames directly fetched from videos done individually. Due to Covid restrictions, this approach was a simple method to build the dataset, without the acquisition of many images. To make the system more robust to new samples of data, image transformations were implemented on random frames (Figure 70). Those improved the classification of new samples in the inference part of the work. The reason for this framework decision was the motivation of the dissertation. Since the premise was creating a more suitable HRC, real world situations needed to be kept in mind. With more diverse data fed into the classifier, the model was able to recognize identities in various scenarios other than looking directly forward. 4.2 Inception ResNet Training For the Inception-ResNet training, both versions v1 and v2, important hyperparameters were studied to tune the networks to achieve maximum accuracy and minimum loss. Those included the tunning of the batch size, number of mini batches epoch, lr and dropout. The results of training were uploaded into the TensorBoard feature, visualizing the parameters convergence as training went by. For every train done, 3 graphs were plotted and analyzed: train accuracy, loss scalars and cross-validation scalar. Both trained frameworks used ADAM optimizer for gradient descent. The prelogit normalization loss factor for batch normalization was set to 0.005, as well as L2 weight decay and L1 norm loss activation. The batches were divided into a set of mini-batches, for 2 reasons: computer resources and mini-batch gradient descent. Since the computer’s resources were limited, the GPU had difficulty allocating enough memory to train big batches of data, necessary when training a deep neural network such as Inception- ResNet model. Mini-batch gradient descent reduced the variance of the gradients when calculating the error and updating the coefficients. Figure 71 demonstrates how the model’s training was supervised using the Ubuntu’s terminal.
102 Figure 71 - Terminal output example for supervision when training Inception-ResNet models The results presented in this document on developed work in the CASIA-Webface dataset were made using only version 1 on the Inception-ResNet. Since the version 2 presented a much more expensive architecture topology, the computer was not able to allocate enough memory to present good results (Figure 72). Since the custom dataset presented a much smaller number of dataset classes, a of both version results were used and compared. Figure 72 - CUDA error when trying to allocate large sets of data 4.2.1 CASIA-Webface dataset The first hyperparameter test and tunning on the Inception-ResNet v1 CNN models trained with CASIA- Webface dataset was the training lr. For that, the same CNN was trained, with different learning rates. That network had a 5000-batch size (50 batch in 100 mini batches), trained during 300 epochs with a 40% dropout. The framework results are showcased in Figure 73.
103 Figure 73 - Train accuracy and loss plots using different Learning Rate on the same CNN configuration The 0.1 and 0.07 learning rates, although bigger, presented the worst accuracy results and bigger loss. Between 0.03 and 0.06 the CNN presented a good convergence as time went by, with the 0.05 lr having the highest train accuracy at the time of the 300 epochs. This Inception ResNet v1 framework had a training time of around 9 hours. Although the Inception-ResNet models on Figure 73 trained during 300 epochs, its accuracy was still underfitted. By increasing the epoch training, the accuracy on the models plateau at around 65% accuracy during the 500 epochs, taking 14 hours of training. The next test was understanding how increasing the batch size would influence the learning process. Figure 74 presents two Inceptions-ResNet v1 models with a 0.04 lr, 40% dropout, trained in 500 epochs using a 6000-image batch.(1) and 5000 image batch.(2). The 6000 batch was the maximum batch size the networks could train without crashing the whole framework. Figure 74 - Accuracy and Loss comparison between the same network with different batch sizes; 1- 6000 train batch size; 2 5000 train batch size With more 1000 images per batch, the CNNs had the same convergence pattern, with a slightly accuracy gain in the 6000-batch framework. As tradeoff, the 6000-batch network trained for 18 hours while the 5000-batch one only trained for 15 hours and 9 minutes. Even increasing the batch size on different learning rates, the model’s accuracy was having difficulties converging. Since these difficulties involved bad converging status passing a certain number of epochs with a stable lr, learning rate decay technique was applied. The model starts with a large lr, decaying into smaller numbers in a pre-set number of epochs. The technique was added to the model (6) pipeline on Figure
104 73. Starting at a 0.1, the learning rate decrease to 0.009, decaying 0.01 at 30 epochs. It then continue to drop the same 0.01 amount every 50 epochs, substantially increasing the model’s accuracy. The comparison between the models is showcased in Figure 75. After 400 epochs the model went from 29% to 67% accuracy using only the lr decay approach. Figure 75 - Accuracy and Loss gain between the same network using learning rate decay on an undefeated network with high learning rate; (a)- Static 0.1 learning rate; (b)- Learning Rate decay starting at 0.1 Regarding the dropout parameter, different instances were tested to verify overfitting problems. The way the overfitting could be verified was to plot the validation subset accuracy, comparing it to the matching train accuracy. Three models with the same learning rate decay and batch size using different dropout settings were trained and plotted (Figure 76). The network’s dropouts were set to 80%, 70% and 40% dropout. The way the overfitting could be verified was to plot the validation subset accuracy when cross-validation is computed, comparing it to the train accuracy showcases the plots.
105 Figure 76 – Train and validation accuracy and loss plots on the same Inception-ResNet model using different dropout settings. The model with the least amount of dropout had the higher performance Figure 76.(a), as well as the better performing validation performance (Figure 76.(b)). The least accurate model was also the one with the biggest dropout percentage (Figure 76.(e)). Since the 3 modules validation accuracy proved to converge accordingly, lowering the dropout below 40% would only damage its performance. The best performing Inception-ResNet V1 model had the following topology: 5000 batch size, with a starting lr of 0.6, decaying 5e-2 every 100 epochs, finishing with 0.02 lr at 500 epochs. The dropout rate was set at 20%. It reached 90% train accuracy and 77.5% validation accuracy after 500 epochs, taking approximately 14 hours. The model’s convergence over time can be seen in Figure 77. Figure 77 - Best Performing Model using the CASIA-Webface dataset
112 Table 11 - Test Accuracy on the 4 Models trained with 5 images per class 5 images for test subset Accuracy Dataset LFW LAR Model 1 0.2% 36.6% Model 2 0.1% 18.1 Model 3 71.8% 63.1% Model 4 98.5% 90% This framework had bad accuracy results on the models trained with the LAR dataset. Another thing to notice was that the overfitted model (Model 1) produced better results than Model 2. For the models trained with the CASIA-Webface, the accuracy was lackluster on the underfitted Model 3, but was very high on Model 4. Although Model 4 presented good results on accuracy, the confidence of the samples was low. That was checked when new proposals outside the train/test were misclassified regularly. The next framework setting had 10 images per class for training. The results on the test subsets over the 4 trained models are presented on Table 12:
113 Table 12 - Test Accuracy on the 4 Models trained with 10 images per class 10 images for test subset Accuracy Dataset LFW LAR Model 1 0.3% 81.9% Model 2 1.7% 67.5 Model 3 83.4% 97.3% Model 4 99.7% 99.3% With 10 images per class, the Inception-ResNet LAR trained models had a decent performance on classifiers trained with the same dataset, but still were not able to produce good results on the LFW dataset classifiers. The CASIA-Webface trained models produced good accuracy results. When using independent samples from classes of the dataset, some were still prone to misclassification, especially with the LFW dataset. The final classifiers allocated 80% of the dataset for train, with the remaining 20% used for testing. The obtained result on the test subsets over the 4 trained models are presented on Table 13: Table 13 - Test Accuracy on the 4 Models trained with 80% of the dataset images used for train The Inception-ResNet models trained with the LAR dataset presented subpar classification with other datasets. That meant that the feature extractor using the CNN trained with a small amount of data could not generalize outside of the dataset. The CASIA-Webface models had a significant improvement classifying new samples of data. Model 4 using the Table 13 settings showcased great accuracy and confidence to be used as classifier on the real time face detection and recognition pipeline. 80% of original dataset Accuracy Dataset LFW LAR Model 1 23% 98.8% Model 2 23.6% 98.4% Model 3 84.6% 99.6% Model 4 99.6% 99.9%
114 Annex III – Confusion Matrix displays the Matrix Confusion, plotted after every test subset prediction execution. It showcased a visual representation of the predictions percentages of the LAR dataset compared to the ground truths of the data points. This visualization tool was important to understand where the SVM was misclassifying the data when checking the minimal number of images for train. To ensure the model’s performance outside the LFW datasets, more tests were carried out on available images on the internet over celebrities on the LFW dataset. On Figure 86 a compilation of the results is showcased. The images presented the classifier prediction and confidence over the bounding boxes drawn with the help of the MTCNN face detector. Figure 86 - Compilation of the Classifier prediction and confidence on images of LFW classes outside the dataset
115 4.3.3 SVM Conclusions The classifiers training from feature vectors using a linear kernel support vector machine proved to be a fast solution with very high classification results for smaller datasets. The train of the datasets was never over 2 minutes, even when thousands of images were inputted. The pickle serialization file managed to save the progress of the classifier, as well as the classes used for training. When testing the classifier, the feature extractor model always had to be the same as the train framework. Four of the trained models with the Inception-ResNet were used for comparison. As demonstrated in SVM Results, feature extractors trained with the LAR dataset could not generalize outside of that dataset, given the lack of data necessary to make a robust system. It also proved the Model 1 overfitting, since this model had very good results classifying the same data it trained on. It meant that instead of learning how to classify the data, it memorized its patterns. It even outperforming Model 2, the better model on the same dataset. Models 3 and 4, trained on the large CASIA-Webface dataset, proved to be strong feature extractors. Since the produced samples arrays were more distinguishable, the SVM managed to have high accuracy values. Two datasets were used for classification. The LFW dataset presented a bigger challenge, since most of the classes had minimal images, while other presented a larger number. That would bias the classifier to predict those classes with a bigger number of samples when the result was uncertain. The LAR dataset had the same number of images per class, 300, so the classifier results were always balanced. The minimal number of images per class to have a good accuracy result was studied. With only 5 images (Table 11), Model 4 had good accuracy, but the confidence metric was low, leading to misclassification problems outside the dataset. The minimum number of images per class that produced reasonable results on both datasets was 10 images (Table 12). By setting the train dataset to 80% of the images (Table 13), Model 4 obtained great accuracy on datasets, predicting samples outside the model with high confidence, as seen in Figure 86 and Annex III – Confusion Matrix. 4.4 Embedding Projector The embedding arrays extracted in the SVM Classifier and matching sprite images were loaded into TensorBoard (Figure 57). With the projector plugin, the PCA and t-SNE analysis was executed into the Euclidean dimensional space. Those Dimension Reduction Unsupervised Learning methods then clustered the data points into the Euclidean Space. The grouped samples were observed and analyzed.
116 4.4.1 PCA Analysis The PCA output is presented in Figure 87. The analysis was done with the 3 major principal components for max segregation. Overall, samples of the same class/identity were clustered together into different spatial locations. Some classes presented a more spreader cluster. Analyzing those samples, that happened because of the face pose, very similar to others in their surroundings. Hence, the PCA unsupervised method furthermore proved that the feature extractor Inception-ResNet CNN was able to differentiate classes into a lower-dimensional Euclidean space. One helpful setting on the TensorBoard plugin was the coloring of different classes for visualization pouposes, as seen in Figure 88. That way, a better understanding can be experienced from an observer standpoint. Figure 87 - Principal Component Analysis visualizer with three first PCs using the TensorBoard Embedding Plugin
117 Figure 88 – Label coloring of the PCA analysis presented in Figure 87 4.4.2 t-SNE Analysis As stated in t-SNE section, the algorithm starts by calculating the probability of similarity of points in high-dimensional space and calculating the probability of similarity of points in the corresponding lowdimensional space. In TensorBoard, the projector started at interaction 0 (Figure 89). It then tries to minimize the difference between these conditional probability’s interaction by interaction. This process was done automatically by TensorBoard with a pre-set lr. After enough calculating interactions, the images were clustered according to similar neighbors. By analyzing Figure 90, the images in every spatial location were of the same identity, proving a good segregation between the labels.
118 Figure 89 - t-SNE plot on TensorBoard embedding plugin at interaction 0
119 Figure 90 - t-SNE plot on TensorBoard embedding plugin after the necessary calculation interaction to cluster the labeled images 4.5 Real-Time Results The real time framework used the multi-network methodology built by importing the 3 previously implemented modules. With the camera, the MTCNN isolated the faces and generated the bounding boxes. Afterwards, the array of the cropped faces goes through the Inception-ResNet feature extractor, returning the embedding array. That array was inputted one by one by the trained SVM classifier, predicting the input’s identity and confidence. Should the confidence be higher than a certain threshold prediction value, the predicted person information was plotted in the original frame above the matching proposals. Figure 91 presents an example of the final pipeline result in a single person.
120 Figure 91 - Real-time user-based facial detection and recognition The facial detection and recognition system maintained between 4 to 9 fps, depending on the amount of people presented in the camera’s frame. That was a good real-time baseline, given that the model had to run with 2 CNNs and a SVM classifier at the same time. Some tests regarding pose variations and distance to the camera were performed. In Figure 92 the model predicted correctly a slightly tilted face, although the confidence dropped slightly. Figure 93 presents the prediction confidence on a test regarding different distances from the camera. That meant the size of the detected face would vary depending how far the person is from the camera. Figure 94 showcases the identification problem using a mask on the person detected. The pipeline still was able to correctly predict the person’s identity, but with a much smaller accuracy confidence. When using the threshold to discard less reliant proposals, normally candidates with less than 75%, these samples would be filtered. Figure 95 and Figure 96 present two users being detected and classified at the same time. In Figure 95 two users part of the pre-trained classifier were both correctly detected with high confidence. Figure 96 presents 2 more candidates to be classified. Since the right user was not part of the pre-trained users, it was labelled as ‘Unknown’.
121 Figure 92 - Pose variation prediction example using real time face recognition Figure 93 – Prediction on a further distance to the camera
128 REFERENCES Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen, Z., Citro, C., Zheng, X. (2016). TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems . Retrieved from http://arxiv.org/abs/1603.04467 Ahonen, T., Hadid, A., & Pietikäinen, M. (2006). Face description with local binary patterns: Application to face recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence , 28 (12), 2037–2041. https://doi.org/10.1109/TPAMI.2006.244 Basiri, M., Piazza, E., Matteucci, M., & Lima, P. (2019). Benchmarking Functionalities of Domestic Service Robots Through Scientific Competitions. KI - Kunstliche Intelligenz . https://doi.org/10.1007/s13218-019- 00619-9 Bauer, A., Wollherr, D., & Buss, M. (2008). Human-robot collaboration: A survey. International Journal of Humanoid Robotics , 5 (1), 47–66. https://doi.org/10.1142/S0219843608001303 Belhumeur, P. N., Hespanha, J. P., & Kriegman, D. J. (1997). Eigenfaces vs. fisherfaces: Recognition using class specific linear projection. IEEE Transactions on Pattern Analysis and Machine Intelligence . https://doi.org/10.1109/34.598228 Bottou, L. (2010). Large-scale machine learning with stochastic gradient descent. Proceedings of COMPSTAT 2010 - 19th International Conference on Computational Statistics, Keynote, Invited and Contributed Papers , 177–186. https://doi.org/10.1007/978-3-7908-2604-3_16 Cao, Q., Shen, L., Xie, W., Parkhi, O. M., & Zisserman, A. (n.d.). VGGFace2: A dataset for recognising faces across pose and age . Retrieved from http://www.robots.ox.ac.uk/ Cao, Q., Shen, L., Xie, W., Parkhi, O. M., & Zisserman, A. (2018). VGGFace2: A dataset for recognising faces across pose and age. Proceedings - 13th IEEE International Conference on Automatic Face and Gesture Recognition, FG 2018 , 67–74. https://doi.org/10.1109/FG.2018.00020 Capaldi, E. J. (1992). the Organization of Behavior. Journal of Applied Behavior Analysis , 25 (3), 575–577. https://doi.org/10.1901/jaba.1992.25-575 Chan, T.-H., Jia, K., Gao, S., Lu, J., Zeng, Z., & Ma, Y. (n.d.). PCANet: A Simple Deep Learning Baseline for Image Classification? Chen, D., Hua, G., Wen, F., & Sun, J. (n.d.). Supervised Transformer Network for Efficient Face Detection . Dalal, N., & Triggs, B. (2005). Histograms of oriented gradients for human detection. Proceedings - 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, CVPR 2005 , I , 886–893. https://doi.org/10.1109/CVPR.2005.177 Deng, J., Guo, J., Xue, N., & Zafeiriou, S. (2018). ArcFace: Additive Angular Margin Loss for Deep Face Recognition . Retrieved from http://arxiv.org/abs/1801.07698 Deng, J., Guo, J., Zhou, Y., Yu, J., Kotsia, I., & Zafeiriou, S. (n.d.). RetinaFace: Single-stage Dense Face Localisation in the Wild . Retrieved from https://github.com/deepinsight/ Deng, J., Zhou, Y., & Zafeiriou, S. (2017). Marginal Loss for Deep Face Recognition. IEEE Computer Society Conference on Computer Vision and Pattern Recognition Workshops , 2017 - July , 2006–2014. https://doi.org/10.1109/CVPRW.2017.251 GitHub - davidsandberg/facenet: Face recognition using Tensorflow. (n.d.). Retrieved July 6, 2021, from https://github.com/davidsandberg/facenet Glorot, X., & Bengio, Y. (2010). Understanding the difficulty of training deep feedforward neural networks. Journal of Machine Learning Research , 9 , 249–256. Retrieved from http://www.iro.umontreal. Glorot, X., Bordes, A., & Bengio, Y. (2011). Deep sparse rectifier neural networks. Journal of Machine Learning Research , 15 , 315–323.
129 Gonçalves, F., Ribeiro, T., Garcia, I., Ribeiro, F. A., Monteiro, C., & Lopes, G. (2019). Development of an anthropomorphic mobile manipulator with human, machine and environment interaction. FME Transactions , 47 (4), 790–801. https://doi.org/10.5937/fmet1904790F Guo, Y., Zhang, L., Hu, Y., He, X., & Gao, J. (n.d.). MS-Celeb-1M: A Dataset and Benchmark for Large-Scale Face Recognition . Retrieved from http://www.hdwallpapers.in/anne Hasnat, M. A., Bohné, J., Milgram, J., Gentric, S., & Chen, L. (2017). von Mises-Fisher Mixture Model-based Deep learning: Application to Face Verification . 1–16. Retrieved from http://arxiv.org/abs/1706.04264 He, K., Zhang, X., Ren, S., & Sun, J. (2016). Deep residual learning for image recognition. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition , 2016 - Decem , 770–778. https://doi.org/10.1109/CVPR.2016.90 He, X., Yan, S., Hu, Y., Niyogi, P., & Zhang, H. J. (2005). Face recognition using Laplacianfaces. IEEE Transactions on Pattern Analysis and Machine Intelligence . https://doi.org/10.1109/TPAMI.2005.55 Hinton, G. E., Srivastava, N., Krizhevsky, A., Sutskever, I., & Salakhutdinov, R. R. (2012). Improving neural networks by preventing co-adaptation of feature detectors . 1–18. Retrieved from http://arxiv.org/abs/1207.0580 Holland, J., Kingston, L., McCarthy, C., Armstrong, E., O’dwyer, P., Merz, F., & McConnell, M. (2021). Service robots in the healthcare sector. Robotics , 10 (1), 1–47. https://doi.org/10.3390/robotics10010047 Holz, D., & Iocchi, L. (2013). Benchmarking Intelligent Service Robots through Scientific Competitions : The RoboCup @ Home Approach. AAAI Spring Symposium - Designing Intelligent Robots: Reintegrating AI II , 27–32. Huang, G. B., Mattar, M., Berg, T., Labeled, E. L., Images, R., & Learned-miller, E. (2008). Labeled Faces in the Wild : A Database for Studying Face Recognition in Unconstrained Environments. Workshop on Faces in’Real-Life’Images: Detection, Alignment, and Recognition , 07 – 49 . Hubel, D. H., & Wiesel, T. N. (1959). Receptive fields of single neurones in the cat’s striate cortex. The Journal of Physiology , 148 (3), 574–591. https://doi.org/10.1113/jphysiol.1959.sp006308 Hubel, D. H., & Wiesel, T. N. (1968). Receptive fields and functional architecture of monkey striate cortex. The Journal of Physiology , 195 (1), 215–243. https://doi.org/10.1113/jphysiol.1968.sp008455 “ImageNet Large Scale Visual Recognition Competition 2012 (ILSVRC2012).” [Online]. Available:imagenet.org/challenges/LSVRC/2012/ . (n.d.). ImageNet Large Scale Visual Recognition Competition 2014 (ILSVRC2014).” [Online]. Available:imagenet.org/challenges/LSVRC/2014/ . (n.d.). ImageNet Large Scale Visual Recognition Competition 2015 (ILSVRC2015).” [Online]. Available: imagenet.org/challenges/LSVRC/2015/ . (n.d.). Iocchi, L., Holz, D., Ruiz-Del-Solar, J., Sugiura, K., & Van Der Zant, T. (2015). RoboCup@Home: Analysis and results of evolving competitions for domestic and service robots. Artificial Intelligence . https://doi.org/10.1016/j.artint.2015.08.002 Ioffe, S., & Szegedy, C. (2015). Batch normalization: Accelerating deep network training by reducing internal covariate shift. 32nd International Conference on Machine Learning, ICML 2015 , 1 , 448–456. Jollife, I. T., & Cadima, J. (2016). Principal component analysis: A review and recent developments. Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences , Vol. 374. https://doi.org/10.1098/rsta.2015.0202 Kalal, Z., Mikolajczyk, K., & Matas, J. (2010). FACE-TLD : TRACKING-LEARNING-DETECTION APPLIED TO FACES Centre for Vision , Speech and Signal Processing , University of Surrey , UK Center for Machine Perception , Czech Technical University , Czech Republic. 2010 IEEE 17th International Conference on Image Processing , (i), 3789–3792. Kemelmacher-Shlizerman, I., Seitz, S., Miller, D., & Brossard, E. (n.d.). The MegaFace Benchmark: 1 Million
130 Faces for Recognition at Scale . Khaligh-Razavi, S.-M. (2014). What you need to know about the state-of-the-art computational models of objectvision: A tour through the models . Retrieved from http://arxiv.org/abs/1407.2776 Kragic, D., & Vincze, M. (2009). Vision for Robotics. Foundations and Trends in Robotics , 1 (1), 1–78. https://doi.org/10.1561/2300000001 Krizhevsky, A., & Hinton, G. (2009). Learning multiple layers of features from tiny images.(2009) . Retrieved from https://www.cs.toronto.edu/~kriz/cifar.html Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2017). ImageNet Classification with Deep Convolutional Neural Networks. COMMUNICATIONS OF THE ACM , 60 (6). https://doi.org/10.1145/3065386 Lecun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature , 521 (7553), 436–444. https://doi.org/10.1038/nature14539 Lecun, Y., Bottou, L., Bengio, Y., & Ha, P. (1998). Gradient-Based Learning Applied to Document Recognition. Proceedings of the IEEE , (November), 1–46. https://doi.org/10.1109/5.726791 Lecun, Y., Cortes, C., & C.J.C., B. (1998). THE MNIST DATABASE of handwritten digits . Li, H., Lin, Z., Shen, X., Brandt, J., & Hua, G. (n.d.). A Convolutional Neural Network Cascade for Face Detection . Lin, M., Chen, Q., & Yan, S. (2014). Network in network. 2nd International Conference on Learning Representations, ICLR 2014 - Conference Track Proceedings . Lin, T.-Y., Dollár, P., Girshick, R., He, K., Hariharan, B., & Belongie, S. (n.d.). Feature Pyramid Networks for Object Detection . Liu, C., & Wechsler, H. (2002). Gabor feature based classification using the enhanced Fisher linear discriminant model for face recognition. IEEE Transactions on Image Processing , 11 (4), 467–476. https://doi.org/10.1109/TIP.2002.999679 Liu, J., Deng, Y., Bai, T., Wei, Z., & Huang, C. (2015). Targeting Ultimate Accuracy: Face Recognition via Deep Embedding . 1–5. Retrieved from http://arxiv.org/abs/1506.07310 Liu, W., Wen, Y., Yu, Z., Li, M., Raj, B., & Song, L. (2017). SphereFace: Deep hypersphere embedding for face recognition. Proceedings - 30th IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017 , 2017 - Janua , 6738–6746. https://doi.org/10.1109/CVPR.2017.713 Liu, W., Wen, Y., Yu, Z., & Yang, M. (2016). Large-Margin Softmax Loss for Convolutional Neural Networks . Retrieved from http://arxiv.org/abs/1612.02295 Liu, Y., Li, H., & Wang, X. (2017). Rethinking Feature Discrimination and Polymerization for Large-scale Recognition . (Nips). Retrieved from http://arxiv.org/abs/1710.00870 Low, C.-Y. (n.d.). Learning Compact Discriminant Local Face Descriptor with VLAD . Masi, I., Wu, Y., Hassner, T., & Natarajan, P. (2019). Deep Face Recognition: A Survey. Proceedings - 31st Conference on Graphics, Patterns and Images, SIBGRAPI 2018 , 471–478. https://doi.org/10.1109/SIBGRAPI.2018.00067 Min, Y., & Chung, H. W. (2019). Shallow Neural Network can Perfectly Classify an Object following Separable Probability Distribution. IEEE International Symposium on Information Theory - Proceedings , 2019 - July (1), 1812–1816. https://doi.org/10.1109/ISIT.2019.8849497 Minaee, S., Luo, P., Lin, Z., & Bowyer, K. (2021). Going Deeper Into Face Detection: A Survey . 1–17. Retrieved from http://arxiv.org/abs/2103.14983 Nada, H., Sindagi, V. A., Zhang, H., & Patel, V. M. (n.d.). Pushing the Limits of Unconstrained Face Detection: a Challenge Dataset and Baseline Results . Retrieved from www.ufdd.info/ Nair, V., & Hinton, G. E. (n.d.). Rectified Linear Units Improve Restricted Boltzmann Machines . Najibi, M., Samangouei, P., Chellappa, R., & Davis, L. S. (n.d.). SSH: Single Stage Headless Face Detector . Retrieved from https://github.com/ Nielsen, M. (2018). Neural Networks and Deep Learning. Artificial Intelligence , 389–411.
131 https://doi.org/10.1201/b22400-15 O’Shea, K., & Nash, R. (2015). An Introduction to Convolutional Neural Networks . 1–11. Retrieved from http://arxiv.org/abs/1511.08458 Parkhi, O. M., Vedaldi, A., & Zisserman, A. (2015). Deep Face Recognition . (Section 3), 41.1-41.12. https://doi.org/10.5244/c.29.41 Qi, X., & Zhang, L. (2018). Face Recognition via Centralized Coordinate Learning . 1–14. Retrieved from http://arxiv.org/abs/1801.05678 Ranjan, R., Castillo, C. D., & Chellappa, R. (2017). L2-constrained Softmax Loss for Discriminative Face Verification . Retrieved from http://arxiv.org/abs/1703.09507 Rumelhart, D. E., Hinton, G. E., & Williams, R. J. (1986). Learning representations by back-propagating errors. Nature , 323 (6088), 533–536. https://doi.org/10.1038/323533a0 Russakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., … Ma, S. (n.d.). ImageNet Large Scale Visual Recognition Challenge . Schmidhuber, J. (2015). Deep Learning in neural networks: An overview. Neural Networks , Vol. 61, pp. 85–117. https://doi.org/10.1016/j.neunet.2014.09.003 Schroff, F., Kalenichenko, D., & Philbin, J. (2015). FaceNet: A unified embedding for face recognition and clustering. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition , 07 - 12 - June , 815–823. https://doi.org/10.1109/CVPR.2015.7298682 Simonyan, K., & Zisserman, A. (2014). Very Deep Convolutional Networks for Large-Scale Image Recognition . 1– 14. Retrieved from http://arxiv.org/abs/1409.1556 Sun, Y., Chen, Y., Wang, X., & Tang, X. (2014). Deep learning face representation by joint identificationverification. Advances in Neural Information Processing Systems , 3 (January), 1988–1996. Sun, Y., Liang, D., Wang, X., & Tang, X. (2015). DeepID3: Face Recognition with Very Deep Neural Networks . 2– 6. Retrieved from http://arxiv.org/abs/1502.00873 Sun, Y., Wang, X., & Tang, X. (2015). Deeply learned face representations are sparse, selective, and robust. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition . https://doi.org/10.1109/CVPR.2015.7298907 Szegedy, C., Ioffe, S., Vanhoucke, V., & Alemi, A. A. (2017). Inception-v4, Inception-ResNet and the impact of residual connections on learning. 31st AAAI Conference on Artificial Intelligence, AAAI 2017 , 4278–4284. Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., Anguelov, D., … Rabinovich, A. (2015). Going deeper with convolutions. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition , 07 - 12 - June , 1–9. https://doi.org/10.1109/CVPR.2015.7298594 Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., & Wojna, Z. (2016). Rethinking the Inception Architecture for Computer Vision. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition , 2016 - Decem , 2818–2826. https://doi.org/10.1109/CVPR.2016.308 Taigman, Y., Yang, M., Ranzato, M., & Wolf, L. (2014). DeepFace: Closing the gap to human-level performance in face verification. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition , 1701–1708. https://doi.org/10.1109/CVPR.2014.220 Turk, M., & Pentland, A. (1991). Eigenfaces for recognition. Journal of Cognitive Neuroscience . https://doi.org/10.1162/jocn.1991.3.1.71 Van Der Maaten, L., & Hinton, G. (2008a). Visualizing Data using t-SNE. In Journal of Machine Learning Research (Vol. 9). Van Der Maaten, L., & Hinton, G. (2008b). Visualizing Data using t-SNE. Journal of Machine Learning Research , 9 , 2579–2605. Villani, V., Pini, F., Leali, F., & Secchi, C. (2018). Survey on human–robot collaboration in industrial settings: Safety, intuitive interfaces and applications. Mechatronics , 55 (March), 248–266.
132 https://doi.org/10.1016/j.mechatronics.2018.02.009 Viola, P., & Jones, M. (2001). Rapid object detection using a boosted cascade of simple features. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition , 1 . https://doi.org/10.1109/cvpr.2001.990517 Wang, Fei. (n.d.). The Devil of Face Recognition is in the Noise . Retrieved from www.IMDb.com Wang, Feng, Cheng, J., Liu, W., & Liu, H. (2018). Additive Margin Softmax for Face Verification. IEEE Signal Processing Letters , 25 (7), 926–930. https://doi.org/10.1109/LSP.2018.2822810 Wang, Feng, Xiang, X., Cheng, J., & Yuille, A. L. (2017). NormFace: L2 hypersphere embedding for face verification. MM 2017 - Proceedings of the 2017 ACM Multimedia Conference , 1041–1049. https://doi.org/10.1145/3123266.3123359 Wang, H., Wang, Y., Zhou, Z., Ji, X., Gong, D., Zhou, J., … Liu, W. (2018). CosFace: Large Margin Cosine Loss for Deep Face Recognition. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition , 5265–5274. https://doi.org/10.1109/CVPR.2018.00552 Wang, M., & Deng, W. (2021). Deep face recognition: A survey. Neurocomputing . https://doi.org/10.1016/j.neucom.2020.10.081 Wang, Y., Ji, X., Zhou, Z., Wang, H., & Li, Z. (2017). Detecting Faces Using Region-based Fully Convolutional Networks . Retrieved from http://arxiv.org/abs/1709.05256 Wen, Y., Zhang, K., Li, Z., & Qiao, Y. (n.d.). A Discriminative Feature Learning Approach for Deep Face Recognition . https://doi.org/10.1007/978-3-319-46478-7 Wu, X., He, R., Sun, Z., & Tan, T. (2018). A light CNN for deep face representation with noisy labels. IEEE Transactions on Information Forensics and Security , 13 (11), 2884–2896. https://doi.org/10.1109/TIFS.2018.2833032 Yan, J., Zhang, X., Lei, Z., & Li, S. Z. (n.d.). Face detection by structural models ☆ . https://doi.org/10.1016/j.imavis.2013.12.004 Yang, S., Luo, P., Loy, C. C., & Tang, X. (2016). WIDER FACE: A face detection benchmark. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition , 2016 - Decem , 5525– 5533. https://doi.org/10.1109/CVPR.2016.596 Yi, D., Lei, Z., Liao, S., & Li, S. Z. (n.d.). Learning Face Representation from Scratch . Retrieved from http://www.imdb.com Zafeiriou, S., Zhang, C., & Zhang, Z. (2015). A survey on face detection in the wild: Past, present and future. Computer Vision and Image Understanding , 138 , 1–24. https://doi.org/10.1016/j.cviu.2015.03.015 Zhang, J., Wu, X., Hoi, S. C. H., Zhu, J., Zhang, J. ;, Wu, X. ;, & Hoi, S. C. H. ; (n.d.). Feature agglomeration networks for single stage face detection Feature agglomeration networks for single stage face detection Part of the Databases and Information Systems Commons, and the Data Storage Systems Commons Citation Citation Feature Agglomeration Networks for Single Stage Face Detection . Retrieved from https://ink.library.smu.edu.sg/sis_research Zhang, K., Zhang, Z., Li, Z., & Qiao, Y. (2016). Joint Face Detection and Alignment Using Multitask Cascaded Convolutional Networks. IEEE Signal Processing Letters , 23 (10), 1499–1503. https://doi.org/10.1109/LSP.2016.2603342 Zhang, X., Fang, Z., Wen, Y., Li, Z., & Qiao, Y. (2017). Range Loss for Deep Face Recognition with Long-Tailed Training Data. Proceedings of the IEEE International Conference on Computer Vision , 2017 - Octob , 5419– 5428. https://doi.org/10.1109/ICCV.2017.578 Zheng, Y., Pal, D. K., & Savvides, M. (2018). Ring Loss: Convex Feature Normalization for Face Recognition. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition , 5089–5097. https://doi.org/10.1109/CVPR.2018.00534
133
134 ANNEX I – STEM OF INCEPTION - RESNET ARCHITECTURE VERSIONS 1 AND 2
135 ANNEX II – TENSORBOARD TRAINING GRAPH
136 ANNEX III – CONFUSION MATRIX