VIETNAM NATIONAL UNIVERSITY HO CHI MINH CITY HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY LÊ ĐỨC HUY AUTHENTICATION VIA DEEP LEARNING FACIAL RECOGNITION WITH AND WITHOUT MASK AND TIMEKEEPING IMPLEMENTATION AT WORKING SPACES Major: Computer Science Major code: 8480101 MASTER’S THESIS HO CHI MINH CITY, July 2023 VIETNAM NATIONAL UNIVERSITY HO CHI MINH CITY HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY LÊ ĐỨC HUY AUTHENTICATION VIA DEEP LEARNING FACIAL RECOGNITION WITH AND WITHOUT MASK AND TIMEKEEPING IMPLEMENTATION AT WORKING SPACES Major: Computer Science Major code: 8480101 MASTER’S THESIS HO CHI MINH CITY, July 2023 THIS THESIS IS COMPLETED AT HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY – VNU-HCM Supervisors: Assoc. Quản Thành Thơ. Nguyễn Tiến Thịnh. Bùi Hoài Thắng.
This master’s thesis is defended at HCM City University of Technology, VNU- HCM City on July 10th, 2023. Master’s Thesis Committee: 1. Nguyễn Lê Duy Lai. Bùi Hoài Thắng.
Mai Hoàng Bảo Ân. Approval of the Chairman of Master’s Thesis Committee and Dean of Faculty of Computer Science and Engineering after the thesis being corrected (If any). CHAIRMAN OF THESIS COMMITTEE HEAD OF FACULTY OF COMPUTER SCIENCE AND ENGINEERING I VIETNAM NATIONAL UNIVERSITY - HO CHI MINH CITY SOCIALIST REPUBLIC OF VIETNAM HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY Independence – Freedom - Happiness THE TASK SHEET OF MASTER’S THESIS Full name: Lê Đức Huy Student ID: 2170306 Date of birth: 22/12/1996 Place of birth: Ho Chi Minh City Major: Computer Science Major ID: 8480101 I. THESIS TITLE (In Vietnamese): HỆ THỐNG NHẬN DIỆN KHUÔN MẶT CÓ VÀ KHÔNG CÓ KHẨU TRANG DỰA TRÊN NỀN TẢNG HỌC SÂU TRONG THỊ GIÁC MÁY TÍNH VÀ ỨNG DỤNG TRONG VIỆC CHẤM CÔNG TẠI CÁC DOANH NGHIỆP HIỆN NAY.
THESIS TITLE (In English): AUTHENTICATION VIA DEEP LEARNING FACIAL RECOGNITION WITH AND WITHOUT MASK AND TIMEKEEPING IMPLEMENTATION AT WORKING SPACES. TASKS AND CONTENTS: - Conduct research on modern machine learning and deep learning architectures. - Conduct research on applied techniques involved in biometric authentication in all walks of life. - Establish a face recognition model to turn theory into reality.
- Discover datasets in search of appropriateness to train the model. - Conduct an end-to-end model training. - Evaluate the model based on evaluation metrics such as Loss and Precision. - Conceptualize the idea, draw the flow diagram and design the time-keeping application using the face recognition method.
- Build up the application and put it under quality assurance. THESIS START DATE: 06/02/2023 V. THESIS COMPLETION DATE: 09/06/2023 II VI. Quản Thành Thơ, Dr.
Nguyễn Tiến Thịnh. Ho Chi Minh City, date. SUPERVISOR 1 SUPERVISOR 2 CHAIR OF PROGRAM COMMITTEE (Full name and signature) (Full name and signature) (Full name and signature) Quản Thành Thơ Nguyễn Tiến Thịnh DEAN OF FACULTY OF COMPUTER SCIENCE AND ENGINEERING (Full name and signature) III ACKNOWLEDGEMENTS For this honor chance, I am truly elated to express my deepest gratitude to my supervisor, Assoc. Quan Thanh Tho and Dr.
Nguyen Tien Thinh for all the advice and elucidation on the road to reach the final target in this Master of Computer Science program. His professions and characteristics paved the way and encouraged me to fulfill the needs of research and complete this thesis writing. I am forever grateful for my family, the belief of my parents and sister keeps my spirit strong and stays motivated throughout even the most difficult time. And also without the continuous support from all my friends, I could not stand where I am as of now.
IV ABSTRACT Face recognition has so far played a crucial role in authentication perspective where it is taken as the most secure and effective way of biometry. However, masked faces post the novel of Covid-19 brought a huge challenge to the existing techniques in which part of the face is covered and occlusion ever since becomes a heated topic of research once again. In regard to the motivation behind this thesis to contribute to the security matter in the face recognition industry, I have been doing the research following the issue path left uncovered by many state-of-the-art machine learning models and coming up with these proposals to alleviate and somewhat enhance the advanced procedure for face verification under masks considering these specific elements: • The first ever use of the Siamese Neural Network (SNN) in human face recognition still wearing masks instead of reusing pre-trained state-of-the-art models. The datasets for training and testing are well collected with the datasets MLFW (Masked Labeled Faces in the Wild) to produce the final output of SNN that fulfills the expectation towards the high accuracy in the first place.
• The advantage and effectiveness of using ensemble learning to separate the tasks of training the models upon different purposes: face with mask and without mask. It also lights up the capabilities of ruling out security breaches of a single model of mixed datasets. • Emulate and visualize the result in such a way that mimics the real circumstances regarding time-keeping in production and enterprises in the long run. For the deployment pipeline, I have employed the leading infrastructure of Flask and Streamlit from what they already achieve with Python web application as it stands.
V TÓM TẮT LUẬN VĂN Nhận diện khuôn mặt cho đến nay đã đóng một vai trò vô cùng quan trọng trong việc xác thực và được xem là phương thức bảo mật sinh trắc học an toàn và hiệu quả nhất. Tuy nhiên, việc nhận diện những khuôn mặt đeo khẩu trang sau đại dịch Covid-19 đã mang đến một thách thức to lớn đối với các kỹ thuật hiện có và trở thành một đề tài được giới chuyên môn hết sức quan tâm. Nhằm gây dựng sự đóng góp cho vấn đề bảo mật trong bài toán nhận diện khuôn mặt, học viên đã thực hiện nghiên cứu theo định hướng giải quyết vấn đề còn tồn đọng của các mô hình học máy tiên tiến nhất hiện nay và đưa ra giải pháp để đáp ứng việc xác minh khuôn mặt kể cả khi đeo khẩu trang dựa trên các yếu tố cụ thể như sau: • Lần đầu áp dụng Siamese Neural Network (SNN) cho bài toán nhận diện khuôn mặt có đeo khẩu trang thay vì sử dụng lại các mô hình hiện đại đã được huấn luyện từ trước. Các tập dữ liệu huấn luyện và kiểm tra được thu thập dựa trên tập MLFW (Masked Labeled Faces in the Wild) để mô hình SNN có thể cho ra kết quả xác thực với độ chính xác đáp ứng được kỳ vọng đã đặt ra ngay từ khi bắt đầu triển khai.
• Tận dụng ưu điểm và tính hiệu quả của việc áp dụng ensemble learning để phân chia nhiệm vụ huấn luyện cho các mô hình phục vụ nhu cầu các bài toán khác nhau: nhận diện được khuôn mặt khi có đeo hoặc không đeo khẩu trang riêng biệt. Điều này cũng giúp cho tính bảo mật được đảm bảo so với việc huấn luyện một mô hình chung cho tác vụ nhận diện khuôn mặt kể cả khi có đeo và không đeo khẩu trang. • Mô phỏng và trực quan hóa kết quả nhằm đánh giá thực tế khả năng chấm công trong môi trường doanh nghiệp trong tương lai. Đối với bước đầu trong công tác triển khai, học viên đã sử dụng cơ sở hạ tầng công nghệ tiên tiến của Flask và Streamlit kế thừa từ những gì họ đã xây dựng trên nền tảng lập trình trang web Python như hiện tại.
VI THE COMMITMENT OF THE THESIS’S AUTHOR I hereby confirm that this thesis and the work presented in it is entirely my own. Where I have consulted the work of others is always clearly stated. All statements taken literally from other writings or referred to by analogy are marked and the source is always given. This paper has not yet been submitted to another examination office, either in the same or similar form.
I agree that the present work may be verified with anti-plagiarism software. THE THESIS’S AUTHOR Lê Đức Huy VII TABLE OF CONTENTS CHAPTER 1: INTRODUCTION. Objectives and missions. Scope of the thesis .5 CHAPTER 2: BACKGROUND KNOWLEDGE.
Convolutional Neural Network (CNN). Cross-Entropy Loss. Siamese Neural Network (SNN). Overall of Siamese Neural Network.
Loss function of SNN. Discussion on SNN .20 CHAPTER 3: RELATED WORKS. Global feature support. Local feature support.
Hand-crafted based. One-shot learning .34 CHAPTER 4: THE PROPOSED MODEL AND IMPLEMENTATION. Datasets and pre-process. Labeled Faces in the Wild (LFW) datasets.
Masked Labeled Faces in the Wild (MLFW) datasets. New hire model training. Database management server (DBMS). Streamlit User Interface.
Motivation and idea. Experimental results and Discussion. Time-keeping application. Multiple models for recognizing employees .58 IX TABLE OF FIGURES Figure 1.1: The face recognition and time-keeping application pipeline architecture2 Figure 2.1: The flowchart of Face Recognition .2: Human brain processes the image and recognizes .3: The process of extracting hidden attributes from of the face .4: The sample calculation of convolution.5: The sample convolutional neural network for image classification .6: A depiction of shared weights in convolutional neural network .7: A sample calculation of max pooling .8: The sample Siamese Neural Network for face recognition .9: A confusion matrix and its actual denotation .1: The technique taxonomy for Face Recognition .1: The complete reference model for Face Recognition .2: Labeled Faces in the Wild datasets .3: MLFW is constructed by adding mask to the images in LFW with perturbation for achieving diverse generation effect .4: Training model process .6: The admin portal for time-keeping boards and visualizations .7: Timesheet in the application .8: Face ID with a Mask in an iPhone.
55 X TABLE OF TABLES Table 1.1: The output use cases of the face recognition model .1: The development of Bagging concept .2: The development of Boosting concept .1: The summary of recent works relating to one-shot learning .1: The originally given parameters .3: Overview of training, validation and testing image set .4: Summary of performance outcome on different face recognition baselines. “#Models” is the number of models used in the method for evaluation .5: Comparison of model-training and model-testing time in seconds of each epoch for different face recognition models .6: PDSN model experiment. Introduction After Covid-19 pandemic, the biggest hit in daily life for over three years now, the world is gradually healing but still the virus is a vicious threat and no one can be able to predict whenever a new mutant suddenly appears. With the challenge being said, business enterprises are now eager to make ways for adapting post-Covid 19 social distancing to some extent, ranging from wearing masks to contactless authentication methods in public places1.
In the midst of Covid-19 resurgence, we also faced the hindrance of timekeeping handled manually by online spreadsheets and it caused a huge delay in terms of regular reports2. These two add up to the existing difficulties that urged scientists to deep dive into the world of Artificial Intelligence (AI) and Machine Learning to mitigate and in the positive manner, contributing to the major accomplishment of AI in all walks of life. In order to tackle the issues, one would see the potential of face recognition using the canonical Siamese Neural Network [1] – a biometric authentication method being integrated with a time-tracking system but the problem occurs when a subject is wearing a mask. Recent studies indicate promising results in both face mask detection and masked face recognition using the DeepMaskNet [2].