Научная статья на тему 'REAL-TIME FACE RECOGNITION USING A DEEP LEARNING MODEL'

REAL-TIME FACE RECOGNITION USING A DEEP LEARNING MODEL Текст научной статьи по специальности «Компьютерные и информационные науки»

CC BY
368
66
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
real-time face recognition / algorithm / Keras / Tensorflow library / cosine matching / neural network / Python.

Аннотация научной статьи по компьютерным и информационным наукам, автор научной работы — Zhumakhan N.

The article shows that real-time face recognition using facial orientation using the Keras, Tensorflow and dlib libraries is one of the most effective methods and is suitable for beginners in facial recognition. The methods used in facial recognition are sufficiently studied, and the resulting result is reflected in the article. Using the cosine matching formula, a person is defined in real time in Python

i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «REAL-TIME FACE RECOGNITION USING A DEEP LEARNING MODEL»

9. Автор: Бернет, Марк Книга: Как создать свой идеальный пароль. Выбираем пароли, отпугивающие хакеров / Марк Бернет, Дейв Клейман. - М.: НТ Пресс, 2011. - 176 с.

10. Автор: Касперский, Е. Книга: Компьютерные вирусы в MS-DOS / Е. Касперский. - М.: Русская Редакция, 1992. - 176 с.

11. Автор: Лебедев, Алексей Книга: Защита компьютера от вирусов, хакеров и сбоев. Понятный самоучитель / Алексей Лебедев. - М.: Питер, 2013. - 160 с.

12. Статья: Как защитить компьютер от взлома и хакеров Автор: Лаборатория Касперского

REAL-TIME FACE RECOGNITION USING A DEEP LEARNING MODEL

Zhumakhan N.

Master's student at the Department of IT Engineering Almaty University of Power Engineering and Telecommunications named after G. Daukeev, Kazakhstan,

Almaty

Abstract

The article shows that real-time face recognition using facial orientation using the Keras, Tensorflow and dlib libraries is one of the most effective methods and is suitable for beginners in facial recognition. The methods used in facial recognition are sufficiently studied, and the resulting result is reflected in the article. Using the cosine matching formula, a person is defined in real time in Python.

Keywords: real-time face recognition, algorithm, Keras, Tensorflow library, cosine matching, neural network, Python.

Introduction. The issue of formalization and automation of the process of recognizing a person's face remains relevant in the early stages of development of the model recognition system and to this day. However, over the past decade, the number of research and publications on this topic has increased several times, which indicates the urgency of the issue.

One of the practical applications of model recognition theory is facial recognition, the task of which is to automatically localize the person in the image and identify the person with the person.

The first face recognition systems compared only two-dimensional images from a database with an image captured by a camera. The accuracy of identification was highly dependent on external factors, including lighting and foreshortening, while a person had to be sure to look into the camera. Then they were replaced by systems based on 3D recognition. Depending on the software, the algorithms take into account a different number of unique facial characteristics, including the shape of the cheekbones, the length of the nose, the distance between the eyes or from the chin to the forehead, and more.

All modern face recognition technologies use systems that learn using test images. For training, bases with images containing faces and not containing faces are used. Each fragment of the investigated image is characterized as a vector of features, with the help of

which classifiers (algorithms for determining an object in a frame) determine whether this part of the image is a face or not.

In 2020, the use of facial recognition technology starts with mobile apps and financial services and does not end with safe cities projects, military developments and self-driving cars. And this is not counting stores without sellers in China and the USA, where cameras read what products the buyer goes to the exit with, and money for the purchase is automatically debited from his card.

Methods and forms of research. The main purpose of the work is to improve the accuracy and speed of face recognition in real-time video streaming, to determine the data structure of the neural network with the help of Tensorflow and Keras libraries.

Using the Haar Cascade to identify a person in real time was an effective method for me.This is because Haar Cascade classifiers are an effective way to find objects. This method was proposed by Paul Viola and Michael Jones in their article "Quick Object Detection" using an extended cascade of simple objects. The Haar Cascade is a machine learning method that uses many positive and negative images to train the classifier.

The main requirement for using the Haar Cascade is that the computer has Python, Matpotlib and OpenCV libraries installed. You can see that these libraries are installed in Figure 1.

S File Edit View .Help camera.py - ...\Desktop\Face_Verificatior

r app.py

base_camera.py

ri camera.py

func.py

[import cv2

from base_camera import BaseCamera

from time import localtime, strftime

import os

import time

import numpy as np

import cv2

import sys

import glob

from func import FaceControl

11

faceCascade = cv2. CascadeClassifier (' Cascades/haarcascade_frontalface_default. xml')

Fig. 1. Import the required libraries and packages

The symbol of Haara is calculated for the adjacent rectangular areas. In the standard method of ViolaJones, rectangular primitives depicted in Figure 2 are used.

Fig. 2. Primitives of Haara

The calculated value of F is the sign of Haara

F = X - Y, (1)

where X is the sum of the brightness points of the point covered by the primitive part, Y is the sum of the values of the brightness points covered by the dark part. The calculation uses the concept of an integrated image, considered above, and the signs of Haara can be calculated quickly, over a period of time. The use of signs Haara gives a point value of the change in brightness along the X and Y axes respectively.

The number of signs of Haara is not suitable for training or classification, for the description of the

object with sufficient accuracy it is necessary to have a large number of signs. Therefore, the symptoms of Haara are performed in a cascading classifier, which serves for the rapid disposal of the window, where the desired object is not found, and the result of "truth" or "lie" relative to the object is found.

In my work, I use the formula for Cosine similarity with the Haar cascade. Cosine similarity is a measure of collision between two vectors of pre-bilge space, which is used to measure the cosine angle between them.

The cosine of two nonzero vectors can be obtained using the Euclidean dot product formula:

A • B = ||A|| ||B||cos0. (2)

Given two feature vectors, A and B, then cosine similarity, cos (0), can be represented using dot product and norm:

similarity = cos 8 =

AB

HAH IIBII

zE=i№=i*i2

:.(3)

In the case of information retrieval, the cosine similarity of the two documents ranges from 0 to 1, since the frequency of the term (weight tf-idf) cannot be negative. The angle between two vectors of the frequency of a term cannot be greater than 90

One of the reasons for the popularity of cosine similarity is that it is effective as an evaluative measure, especially for sparse vectors, since only nonzero dimensions need to be considered.

Cosine similarity is written in Python as shown in Figure 3.

B File Edit

Ü! app.py

75

76

77 H

78

79

30

31

32 0 83

34

35

36

37

33 39

90

91

92

93 H

94

95

96

97 93

View Help camera.py - _\Desktop\FaceVerification ba&e_camera.py func.py camera.py

cosines=[]

for i in range(len(a)):

cosine_similarity - fc.findCosineSimitarityCimgl.representation, a[i][i]) cosines.append(cosine_simitarity)

minimum - cosines.index(min(cosines))

#percent = (0,4-flaat(cosines[minimum]))*100/O.4 #print(str(percent)+') print(cosines[minimum] ) print(ph[minimum])

print(1-----------------------------1 )

cv2.putText(frame, str(ph[minimum][:-3]), fontFace=cv2.FONT_HERSHEY_SIHPLEXf fontScale=l( org=(x, y-15), color=(255,0,0), thickness=3)

if ftoat(cosines[minimum])<0.2: text=str(images[minimum])

if float(cosines[minimum])>0.35: text-'not found' idx=len(a)

pathname-os.path.basename()

write_name = 'dataset/new_face.,+str(idx) + l .jpg1 cv2.imwrite(write_name, face)

Fig. 3. Using the cosine similarity formula in face recognition

Results and their discussion. I used Keras, Ten-sorflow, OpenCV libraries for real-time video identification. Keras is an open source Python library that simplifies the creation of neural networks. OpenCV is an open library of computer views for image analysis, classification and processing. It is widely used in languages such as C, C ++, Python and Java. TensorFlow is Google's ML-framework for designing, building and learning advanced learning models. TensorFlow is good for complex projects such as multilayer neural networks. It is used for images and text applications such as voice recognition or Google Translate._

■ Anaconda Prompt (miniconda3) - python app.py

After installing all these programs and modules, we write the code to the facial recognition system. When creating a facial recognition system, we will need pre-made images. Thus, a comparison is made on the basis of pre-stored data in facial recognition. Identification is done through Anaconda.

The first thing to do after opening the terminal is to run the created conda environment. I have a conda environment called "diplom". Then we go to the directory where our file is stored and run the app.py file in python. This can be seen in Figure 4.

□ X

(base) C:\Users\nazym>conda activate diplom (diplom) C :\Users\nazym>cd Desktop

(diplom) C:\Users\nazym\Desktop>cd FaceVerification

(diplom) C:\llsers\nazym\Desktop\Face_Verificationipython app.py Using TensorFlow backend.

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

C:\Users\nazym\miniconda3\envs\diplom\lib\site-packages\tensorflow\python\framework\dt ypes.py:523: FutureWarning: Passing (type., 1) or 'ltype' as a synonym of type is depre catedj in a future version of numpy., it will be understood as (type., (1,)) / '(l,)type

_np_qint8 = np.dtype([("qintß", np.intß., 1)]) C:\Users\nazym\miniconda3\envs\diplom\lib\site-packages\tensorflow\python\framework\dt ypes.py:524: FutureWarning: Passing (type., 1) or 'ltype' as a synonym of type is depre

Fig. 4. Run the conda environment and run the app.py file

After the file is launched, the webcam is activated that address. As a result, the images stored in the (Figure 5). The webcam is connected via localhost. directory will identify the person in the camera. This is because it is specified in the code to export it to

Fig. 5. The result of facial recognition Facial recognition results are also available at the anaconda terminal. It is shown in Figure 6.

Выбрать Anaconda Prompt (rriniconda3) - python app.py

* Running on http://localhost:4455/ (Press CTRL+C to quit) 0.27426308393478394 nazym.jpg

□ X

0.2708495259284973 nazym.jpg

0.2717280387878418 nazym.jpg

0.26301276683807373 nazym.jpg

0.26489323377609253 nazym.jpg

Fig. 6. The result in the terminal anaconda

Conclusions. Artificial intelligence is one of the most popular trends of recent times. Machine learning and in-depth training make up artificial intelligence. Machine learning and in-depth learning algorithms offer an exciting perspective for many entrepreneurs and industry leaders.

Many organizations are using artificial intelligence to expand their reach or improve their quality in their decisions, but one important thing to understand is that the chosen development technology must be accompanied by a good framework for in-depth learning, especially if each framework serves its own purpose. In this case, the search for the perfect tandem is a necessary condition for the smooth and rapid development of business and successful deployment of projects.

In conclusion, the project will be created using the libraries Miniconda, TensorFlow, Keras and the programming language Python. These are the most advanced technologies today. In addition, the recognition system is very effective for beginners and easy to learn.

References

1. Grigori Sidorov, Alexander Gelbukh, Helena GómezAdorno, and David Pinto. Soft Similarity and Soft Cosine Measure: Similarity of Features in Vector Space Model. Computación y Sistemas, Vol. 18, No. 3, pp. 491—504, 2014, DOI: 10.13053/CyS-18-3-2043.

2. Р. М. Болл, Дж. Х. Коннел, Ш. Панканти, Н. К. Ратха, Э. У. Сеньор. Руководство по биометрии. - М.: Техносфера, 2007. - С. 22. - 368 с. - ISBN 978-5-94836-109-3.

3. Сверточная нейронная сеть на Python и Keras [Электронный ресурс]. URL: https://xn--90aeniddllys.xn--p1ai/svertochnaya-nejronnaya-set-na-python-i-keres/

4. Косинусное сходство/Cosine similarity [Электронный ресурс]. URL: https://ru.qaz.wiki/wiki/Cosine_similarity

5. Все про технологию распознавания лиц [Электронный ресурс] URL: https://www.cloudav.ru/mediacenter/technology/facial -recognition-technology/

6. Face Detection using Haar Cascades [Online]. Available: https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_ob-jdetect/py_face_detection/py_face_detection.html

ОСОБЕННОСТИ БИОМЕТРИЧЕСКОЙ ИДЕНТИФИКАЦИИ ЛИЧНОСТИ В ИНФОРМАЦИОННОЙ СИСТЕМЕ

Касымкулова Д. С.

магистрант специальности 7М06103 - «Вычислительная техника и программное обеспечение». Научныйруководитель-Маликова Ф.У., доктор PhD, доцент.

FEATURES OF BIOMETRIC IDENTIFICATION OF A PERSON IN AN INFORMATION SYSTEM

Kassymkulova D.

undergraduate specialty 7М06103 - "Computer Engineering and Software"

Аннотация

В статье рассмотрены особенности биометрической идентификации личности в информационной системе, технология автоматического распознавания лица в режиме реального времени с выделением антропометрических точек личности, обработка цифровых изображений, в частности, задача повышения разрешения изображений.

Abstract

The article considers the features of biometric identification in the information system, the technology of automatic face recognition in real-time, highlighting points of the person, digital image processing, in particular, the problem of increasing image resolution.

Ключевые слова: ключевые точки страницы, цифровое изображение, пиксель, алгоритм увеличения изображения, интерполяция.

Keywords: key points of the page, digital image, pixel, image magnification algorithm, interpolation

Технологии автоматической идентификации человека применяются в различных отраслях промышленности и железнодорожного транспорта. Идентификация лица требуется в работе контрольно - пропускных пунктов, при учете рабочего времени сотрудников, ограничении доступа к рабочим местам, мобильным устройствам и информационным системам и т.д. Внедрение методов распознавания лиц по изображению лица решает проблему учета рабочего времени на предприятии.

Технология распознавания лицевых изображений находит применение в операциях расчета времени пребывания каждого работника на рабочем месте и установления времени прибытия и убытия работников на предприятие. При дистанционном обучении необходимо автоматически распознавать и подтверждать подлинность опознаваемого объекта.

Существует множество принципиально различных методов, позволяющих определить личность человека через образ личности. Основными критериями оценки методов являются вычисли-

тельная сложность алгоритмов и вероятность правильного распознавания. Геометрические характеристики лица-один из первых признаков, используемых для распознавания лица. Далее была разработана компьютерная система, использующая геометрические характеристики поверхности. Суть метода заключается в выборе набора антропометрических точек и дальнейшем сравнении расстояний между точками. Набор точек выбирается исследователем эмпирическим путем. В работе использовались волны Габора для определения антропометрических точек на изображении лица. Число антропометрических точек составляло 35-45. Доля правильного распознавания образов составила 86% [1].

Геометрическое сравнение характеристик поверхности полезно для нахождения возможных совпадений в относительно больших базах данных. К подготовке изображений для использования метода, как показано на рисунке 1, предъявляются следующие требования: отсутствие направленного света, нейтральные черты лица и отсутствие посторонних предметов, пересекающих область лица.

i Надоели баннеры? Вы всегда можете отключить рекламу.