Multi-face recognition and dynamic tracking based on reinforcement learning algorithm

Aiming at the problem that the current low accuracy rate of face detection and target tracking, a reinforcement learning algorithm is proposed, which integrates face detection technology and target tracking technology organically, adopts the face detection algorithm based on Multi-Task Convolutional Neural Network (MTCNN) and target tracking algorithm based on Kalman filtering, so as to realize face detection, multiplayer face recognition and dynamic tracking of personnel movement. In this paper, the configuration environment is Anaconda, the operating platform is PyCharm, the video-based face detection and dynamic capture and rapid identification system has been designed and developed. The system consists of two modules: face detection module and target tracking module. The optimized face detection and dynamic capture algorithm improved the detection success rate by about 11.5%, the face detection success rate by about 15.2%, the dynamic capture success rate increased by about 12.0%, and the optimized system has a wider practicality.


Introduction
Face detection can indicate the correct position and size of face, most of which is used in the pre-processing part before face recognition. Nowadays, the research on face detection and target tracking at home and abroad is a hot spot. The goal of tracking and identifying faces complements each other. Without finding faces, target monitoring cannot avoid security vulnerabilities, so the collaborative application of two technologies in different areas is significant.
Yang Xiao [1] elaborated carefully face recognition algorithm based on OpenCV and introduced several special algorithms. Shuo Yuan et al. [2] proposed a face tracking algorithm based on deep learning. Jinyi Pan [3] presents a dynamic face tracking algorithm KCFVR that integrates tracking checks and deep learning recognition aids. Weilin Li et al. [4] put forward a face detection and tracking method based on HOG and feature description, which reduces the interference of multi-face factors. Chengpan Liu et al. [5] introduced Deep-Sort tracking algorithm, which effectively solves the problem of poor real-time face tracking performance.
In the above literature, a variety of methods are proposed for face detection and target tracking. However, the face of the person being measured in the walk is distorted, deformed, partially or completely covered, the above methods are not accurate enough for face detection and tracking. Therefore, this paper proposes a combination of face detection algorithm based on MTCNN and target tracking algorithm based on Kalman filter to detect and track faces. The system block diagram as follows:

Face detection based on MTCNN
MTCNN (Multi-task convolutional neural network) [6] adopts the form of multilevel link, and its function is to predict people's facial features. The precision can be improved gradually from rough at first. In the environment affected by various complex factors, it can mark 5 feature points in the block diagram to achieve the face detection with reasonable accuracy, and finally achieve the function of output the correct result of face detection.
MTCNN is mainly divided into three steps: P-NET (Proposal Network), R-NET (Refine Network), O-NET (Output Network). As shown in the figure 2.

Single target dynamic capture algorithm
Kalman filtering [13] is adopted in this single target dynamic capture. Kalman filtering is divided into two steps: state prediction and state update, which will be discussed below.
Here are two important equations (equation of state and observation equation): is the state matrix of the system, is the observed quantity of the state matrix, A is the state transition matrix, B is the control input matrix, H is the state observation matrix, is the process noise (white noise), is the measurement noise (white noise), the covariance is Q and R, namely, , . The specific process of Kalman filtering state prediction and update is as follows: a) Time update equation:

Multi-target dynamic capture algorithm
The primary purpose of this algorithm is to generate a set of exclusive sequences from the received image stream, and to search and identify the moving target in this set of sequences.
SORT (Simple Online and Realtime Tracking) algorithm can be applied to achieve dynamic capture in multiple targets. It combines the advantages of Kalman filtering and Hungary algorithm, which can significantly improve the speed and keep the accuracy stable on the excellent line. It is an algorithm with extremely excellent indexes at present.
It can be seen from Figure 3 above that the SORT algorithm selected in this paper achieves a compatibility between accuracy and speed.
In the original algorithm of SORT, the face detection part adopts the Faster-RCNN architecture, and the advantages of the Faster-RCNN are reflected in two aspects. First, because of its advantages as a network structure, it can quickly form corresponding patterns for different design systems, and the performance improvement is visible to the naked eye. Second, the parameters between the two stages can be shared, and then the detection framework can be formed quickly. However, considering the tradeoff between speed and accuracy, this paper has replaced the original Faster-RCNN algorithm in SOFT algorithm with the MTCNN algorithm which is more suitable for requirements of this paper.
This section discusses a linear isokinetic model, because it has no connection with any other moving object in the system, so it is extremely suitable to represent the approximate displacement between the frames of each moving object in the system, that is, to transfer the data information of the detection target of the current frame to the next frame. The relationship between the target states in the isokinetic model is shown in the formula: Variables u,v,s and r in the formula respectively represent the position of horizontal pixel in the center of the target under test, the position of vertical pixel in the center of the target under test, the ratio of binding frame and aspect ratio of the target under test.

Results analysis
The experimental environment of this system includes 2.4 (GHz) Intel Core i5-6200U, 8192MB memory, Anaconda as configuration environment, PyCharm2019 as the operating platform, and Python 3.6 as the programming language.

Face detection
In this paper, the method of training samples on WIDER_FACE data set is adopted, and the parameter allocation is as follows: The video stream collected from the Face was transferred to the computer environment, and then the Face-track-Detect environment was configured with Anaconda, and the code of the program was run with PyCharm to achieve the function of face detection.
The actual test results are shown in the figure 5.

Target dynamic capture
The dynamic target tracking of human face is to mark and predict the moving position of human face with the box in real time.
The process of SORT capture target algorithm and its actual effect diagram are shown in the following figure:   Fig. 6. Algorithm implementation flow. Fig. 7. Full face effect. Fig. 8. Renderings of the side face.  Compared with the original algorithm, the method in this paper has a higher success rate of detection and capture. Meanwhile, compared with the previous method, the method in this paper has the shorter running time and better real-time performance.

Conclusion
In this experiment, MTCNN algorithm and SORT algorithm are used to work together to process images, extract facial information and further modify it into a face box. SORT algorithm fuses the advantages between Kalman filtering and Hungary algorithm in the realization of multi-objective dynamic capture, and maintains the compatibility of accuracy and speed.
In this study, reinforcement learning algorithm is adopted to realize face detection, multi-face detection and dynamic tracking when people are moving. The framework proposed in this paper is also applicable to the detection and recognition of other objects. After comparing the basic knowledge and advantages and disadvantages of several common algorithms, the combination of MTCNN face detection algorithm and SORT target tracking algorithm is selected as the algorithm in this paper, which has high accuracy in face detection and target tracking, and also plays a key role in face recognition and other related work. This work is supported by Beijing Natural Science Foundation (Grant No.4192023 and 4202024)