Face recognition method and device based on deep separable convolution and additive angle interval loss
By combining a deep separable convolutional neural network with an additive angular interval loss function, a lightweight face recognition model was realized, which solved the problems of model complexity and high training cost in existing technologies, and improved recognition speed and robustness.
Patent Information
- Application Number
- CN202210942319.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-08
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2042-08-08
AI Technical Summary
Existing face recognition methods are relatively complex, have high training costs, and their recognition speed needs to be improved.
A deep separable convolutional neural network is used to complete the face detection and registration task, and the robustness of the model is improved by using an additive angular interval loss function to construct a lightweight network structure.
It reduces training costs, improves recognition speed and model robustness, and meets the requirements of industrial applications.
Smart Images

Figure CN115393928B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of face recognition, and particularly relates to a face recognition method and device based on deep separable convolution and additive angle interval loss. BACKGROUND
[0002] Face recognition is one of the most important applications of image analysis and understanding. Face recognition is to use a computer to analyze face videos or images and extract effective recognition information from them to ultimately identify the identity of the face object. The research of face recognition can be traced back to the late 1960s. The main idea is to design a feature extractor and then use a machine learning algorithm for classification. After deep learning was introduced into the field of face recognition in 2012, feature extraction was completed by a neural network. With the development of deep convolutional neural networks and large-scale data sets, face recognition based on deep learning emerged and has made significant progress and has been widely used in practical applications.
[0003] A whole face recognition system generally consists of three key elements: face detection, face preprocessing, and face representation. Face detection locates the face in an image or video frame. Then, face preprocessing is to align faces to a standard view and crop them to a standardized pixel size. Finally, in the face representation stage, discriminative features are extracted from the preprocessed images for recognition. Specifically, a face recognition system usually consists of three modules: a face detection module, a face registration module, and a face recognition module. The face detection module completes the target recognition task, identifies the face from the given picture, and returns the corresponding face frame coordinates and face picture. The input information of the face registration module is the face picture and face coordinate frame output by the face detection module, and the output information is a sequence of key point coordinates of the face. Through the sequence of face key point coordinates, the face picture is aligned. The input information of the face recognition module is the aligned face picture, and the output is the corresponding face feature vector. The similarity between the feature vectors of two face pictures is compared to determine the face identity information.
[0004] Existing face recognition methods have achieved good recognition accuracy, but most network models are still relatively complex, the training cost is high, and the recognition speed needs to be improved. SUMMARY
[0005] To solve the problems involved in the above technical background, the present application provides a face recognition method and device based on deep separable convolution and additive angle interval loss. The deep separable convolutional neural network simultaneously completes the face detection and face registration tasks, and the additive angle interval loss is used to improve the robustness of the model, which not only reduces the training cost, but also because of its lightweight network structure, the recognition speed can meet the requirements of industrial applications.
[0006] The specific technical scheme of the present application is: a face recognition method based on deep separable convolution and additive angle interval loss, comprising the following steps:
[0007] S1. Extracting original images from a public face dataset to form a training dataset, and then preprocessing the original images to obtain grayscale images, wherein the original images include pictures containing face information and corresponding face position annotation information;
[0008] S2. Constructing a deep separable convolutional neural network module I to extract multi-scale region features of the grayscale images in step S1;
[0009] S3. Constructing a feature pyramid II to perform feature fusion;
[0010] S4. Using the fused features obtained in step S3 to construct a convolutional neural network module III to strengthen the receptive field and complete feature extraction, obtaining face prior box classification prediction results, face box regression prediction results, and face key point coordinate sequence prediction results;
[0011] S5: According to the face key point coordinates, comparing the standard face five key point coordinates, calculating the affine transformation matrix, and correcting the face frame;
[0012] S6: Constructing a convolutional neural network module IV using an additive angle interval loss function to train the network model and extract face feature vectors;
[0013] S7: Inputting two given pictures containing faces to be recognized into the trained convolutional neural network model respectively to obtain the feature vectors of the faces contained in the two pictures, calculating the similarity between the feature vectors, comparing the recognition threshold, and matching the face identity information.
[0014] Further, in the step S2, the depth separable convolutional neural network module I includes two main network modules, a normalization module I-I and a depth separable convolution module I-II; the input of the depth separable convolutional neural network module I is the input of the normalization module I-I, the output of the normalization module is the input of the depth separable convolution module I-II, and the output of the depth separable convolution module I-II is the output of the depth separable convolutional neural network I; the normalization module I-I first fills the input of the depth separable convolutional neural network I through a zero padding layer I-I-I, inputs the output result of the zero padding layer I-I-I into a convolution layer I-I-II with a convolution kernel size of 2x2 for convolution, inputs the output result of the convolution layer I-I-II into a batch normalization layer I-I-III, inputs the output result of the batch normalization layer into a ReLU layer, inputs the output result of the ReLU layer into a depth separable convolution unit I-I-IV with a channel number of 16, and the output of the depth separable convolution unit I-I-IV is the output of the normalization module I-I; the depth separable convolution module I-II is composed of four depth separable convolution sub-modules, which are a depth separable convolution sub-module I-II-I with a channel number of 32, a depth separable convolution sub-module I-II-II with a channel number of 64, a depth separable convolution sub-module I-II-III with a channel number of 128, and a depth separable convolution sub-module I-II-IV with a channel number of 256, and the output of a previous sub-module is the input of a subsequent sub-module, wherein the depth separable convolution sub-module I-II-I with a channel number of 32 includes two depth separable convolution units, the depth separable convolution sub-module I-II-I with a channel number of 64 includes two depth separable convolution units, the depth separable convolution sub-module I-II-I with a channel number of 128 includes six depth separable convolution units, the depth separable convolution sub-module I-II-I with a channel number of 256 includes two depth separable convolution units, and the output C1 of the depth separable convolution sub-module I-II-II, the output C2 of the depth separable convolution sub-module I-II-III, and the output C3 of the depth separable convolution sub-module I-II-IV are the network outputs of the depth separable convolutional neural network I.The deep separable convolution unit I-I-IV, the deep separable convolution submodule I-II-I, the deep separable convolution submodule I-II-II, the deep separable convolution submodule I-II-III, and the deep separable convolution submodule I-II-IV are composed of a plurality of deep separable convolution units I-III, which input through a convolution layer I-III-I with a convolution kernel size of 3x3, input the output result of the convolution layer I-III-I to a batch normalization layer I-III-II, input the result of the batch normalization layer I-III-II to a ReLU layer I-III-III, input the output result of the ReLU layer I-III-III to a convolution layer I-III-IV with a convolution kernel size of 1x1, input the output result of the convolution layer I-III-IV to a batch normalization layer I-III-V, and finally input the output result of the batch normalization layer I-III-V to a ReLU layer I-III-VI, and the output result of the ReLU layer is taken as the output result of the deep separable convolution unit I-III.
[0015] Further, in the step S3, C1, C2, and C3 are input into a convolution layer II-I with a convolution kernel size of 1x1 and a channel number of 64, and D1, D2, and D3 are output, wherein D3 is one of the outputs P3 of the feature pyramid II, P3 is added to D2 and input into a convolution layer II-II, and the output fusion feature is taken as one of the outputs P2 of the feature pyramid II, P2 is added to D1 and input into a convolution layer II-III, and the output fusion feature is taken as one of the outputs P1 of the feature pyramid II.
[0016] Further, in the step S4, the fusion features P1, P2, and P3 obtained in the step S3 are used to construct a convolution neural network module III to strengthen the receptive field, P1, P2, and P3 are input into a convolution layer III-I with a convolution kernel size of 3x3, the output result of the convolution layer III-I is input into a convolution layer III-II with a convolution kernel size of 3x3, the output result of the convolution layer III-II is input into a convolution layer III-III with a convolution kernel size of 3x3, and the output results S1, S2, and S3 of the convolution layer III-III are taken as the output results of the convolution neural network module III, S1 is a face prior box classification prediction result, S2 is a face box regression prediction result, and S3 is a face feature key point coordinate sequence prediction result.
[0017] Further, in the step S5, according to the face key point coordinates, the standard face five key point coordinates are compared, the affine transformation matrix is calculated, and the face frame is corrected; the face key point coordinates are the coordinate values when the face picture size is 112*112, the coordinate value matrix is M1, the standard coordinate value matrix of the face five key point when the picture size is 112*112 is M2, and the angle that the face image should be rotated is calculated as The corresponding affine transformation matrix M x, Wherein:
[0018] , .
[0019] Further, in the step S6, the convolutional neural network module IV adopting the additive angle interval loss function is constructed, and the face feature vector is extracted; the convolutional neural network module IV is trained by an end-to-end method to train the entire convolutional neural network model; wherein the backbone network of the convolutional neural network module IV is ResNet50, and the loss function adopted is the additive angle interval loss function :
[0020]
[0021] Wherein, is an interval function:
[0022]
[0023] is a true value label, is the angle between the feature vector and the first feature weight vector, m is an interval value of , the method takes , s is a hyperparameter of an adjustment range, and the method takes .
[0024] Further, in the step S7, two given face pictures containing the face to be identified are respectively input into the trained convolutional neural network model, the feature vectors of the faces contained in the two pictures are respectively obtained, the similarity between the feature vectors is calculated, the recognition threshold is compared, and the face identity information is matched; wherein the similarity is the cosine similarity between the two vectors:
[0025]
[0026] Wherein are the 512-dimensional feature vectors output by the convolutional neural network module IV of the two face pictures to be compared, represents vector dot multiplication, represents the length of the x vector.
[0027] Further, the convolutional neural network model comprises a deep separable convolutional neural network module I, a feature pyramid II, a convolutional neural network module III, and a convolutional neural network module IV.
[0028] The device for face recognition based on deep separable convolution and additive angle interval loss comprises an image acquisition unit, a face region learning unit, a feature fusion unit, a feature extraction unit, a face correction unit, a face feature learning unit, and a feature similarity calculation unit.
[0029] The image acquisition unit is configured to extract a large number of original images required for model training from a data set to form a training data set, and to pre-process original image pairs to obtain grayscale images.
[0030] The face region learning unit comprises a deep separable convolutional neural network module I, which is configured to learn face frame position information and face feature point position information in an image by using a deep separable convolution unit.
[0031] The feature fusion unit comprises a feature pyramid module II, which is configured to perform feature fusion on three outputs of the face region learning unit, and further strengthen the learning effect.
[0032] The feature extraction unit comprises a convolutional neural network module III, which is configured to perform feature extraction on the result of the feature fusion unit, strengthen the receptive field, and output final face classification prediction results, face frame regression prediction results, and face five-point feature point regression prediction results.
[0033] The face correction unit is configured to calculate a corresponding affine transformation matrix according to a standard face feature point sequence and face feature point regression prediction results obtained by the feature extraction unit, and to correct a face image according to the matrix.
[0034] The face feature learning unit comprises a convolutional neural network module IV, which is configured to use ResNet50 as a backbone network, use an additive angle interval loss as a loss function, train and extract features contained in a face image, and finally output a 512-dimensional feature vector representing face features.
[0035] The feature similarity calculation unit is configured to match face identity information by calculating the cosine similarity between two face feature vectors output by the face feature learning unit.
[0036] Compared with the prior art, the face recognition method and device based on the deep separable convolution and the additive angle interval loss have the following beneficial effects: the face detection and face registration in an image are simultaneously completed through the deep separable convolutional neural network, the network structure is lighter, and the model has higher expression ability and robustness. BRIEF DESCRIPTION OF DRAWINGS
[0037] Figure 1 is a flowchart of the implementation process of the method of the present application;
[0038] Figure 2 is a structural schematic diagram of the deep separable convolutional neural network module I;
[0039] Figure 3 is a structural schematic diagram of the deep separable convolution unit I-III;
[0040] Figure 4 is a structural schematic diagram of the feature pyramid II;
[0041] Figure 5 is a structural schematic diagram of the convolutional neural network module III;
[0042] Figure 6 is a flowchart of the whole face recognition system. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and do not limit the present application.
[0044] As Figure 1 is a flowchart of a face recognition method based on a deep separable convolution and an additive angle interval loss, which comprises the following steps:
[0045] S1: the original images extracted from the public face data set are used to form a training data set, and the original images are preprocessed to obtain gray images, the original images including pictures containing face information and corresponding face position annotation information.
[0046] In order to make the model have better generalization ability, the original face detection data set selects the public data set WIDER FACE containing faces in multiple scenes, and the original face recognition data set selects the large-scale public data set glint360k, and the data is uniformly extracted from the data set to form the face detection training data set and the face recognition training data set, respectively.
[0047] S2: constructing a deep separable convolutional neural network module I to extract multi-scale region features of the gray image.
[0048] As shown in Figure 2 , the deep separable convolutional neural network module I is used to extract multi-scale region features of the gray image, and the deep separable convolutional neural network module I includes two main network modules, namely a normalization module I-I and a deep separable convolution module I-II. The input of the deep separable convolutional neural network module I is used as the input of the normalization module I-I, the output of the normalization module is used as the input of the deep separable convolution module I-II, and the output of the deep separable convolution module I-II is the output of the deep separable convolutional neural network I.
[0049] The normalization module I-I first fills the input of the deep separable convolutional neural network I through a zero padding layer I-I-I, inputs the output result of the zero padding layer I-I-I into a convolution layer I-I-II with a convolution kernel size of 2x2 for convolution, inputs the output result of the convolution layer I-I-II into a batch normalization layer I-I-III, inputs the output result of the batch normalization layer into a ReLU layer, and inputs the output result of the ReLU layer into a deep separable convolution unit I-I-IV with a channel number of 16. The output of the deep separable convolution unit I-I-IV is the output of the normalization module I-I. The deep separable convolution module I-II is composed of four deep separable convolution sub-modules, namely a deep separable convolution sub-module I-II-I with a channel number of 32, a deep separable convolution sub-module I-II-II with a channel number of 64, a deep separable convolution sub-module I-II-III with a channel number of 128, and a deep separable convolution sub-module I-II-IV with a channel number of 256. The output of the previous sub-module is the input of the next sub-module. The deep separable convolution sub-module I-II-I with a channel number of 32 includes two deep separable convolution units, the deep separable convolution sub-module I-II-I with a channel number of 64 includes two deep separable convolution units, the deep separable convolution sub-module I-II-I with a channel number of 128 includes six deep separable convolution units, and the deep separable convolution sub-module I-II-I with a channel number of 256 includes two deep separable convolution units. The output C1 of the deep separable convolution sub-module I-II-II, the output C2 of the deep separable convolution sub-module I-II-III, and the output C3 of the deep separable convolution sub-module I-II-IV are the network outputs of the deep separable convolutional neural network I.
[0050] The depthwise separable convolutional unit II-IV, depthwise separable convolutional submodule I-II-I, depthwise separable convolutional submodule I-II-II, depthwise separable convolutional submodule I-II-III, and depthwise separable convolutional submodule I-II-IV are all composed of several depthwise separable convolutional units I-III. Each depthwise separable convolutional unit I-III passes the input through a convolutional layer I-III-I with a kernel size of 3×3, and the output of the convolutional layer I-III-I is input into the batch normalization layer I-III-II. The results of batch normalization layer I-III-II are input into ReLU layer I-III-III. The output of ReLU layer I-III-III is input into convolutional layer I-III-IV with a kernel size of 1×1. The output of convolutional layer I-III-IV is input into batch normalization layer I-III-V. Finally, the output of batch normalization layer I-III-V is input into ReLU layer I-III-VI. The output of the ReLU layer is used as the output of depthwise separable convolutional unit I-III. The specific network structure of depthwise separable convolutional unit I-III is as follows: Figure 3 As shown.
[0051] Since a deep separable convolutional neural network I has multiple outputs, it falls under the category of multi-task learning. For each training anchor i, we minimize the multi-task loss L:
[0052]
[0053] in:
[0054] 1) For face classification loss, Let i represent the probability that i is a face. This represents the true probability. The classification task is binary (i is a face or not a face). Positive samples have an anchor of 1, and negative samples have an anchor of 0. It is the softmax loss;
[0055] 2) For face frame regression loss, among which , These represent the positions of the predicted bounding box and the ground truth bounding box corresponding to the positive sample anchor, respectively.
[0056] 3) For facial landmark regression functions, , These represent the predicted and ground truth values of the five key points of the face anchor in the positive sample, respectively.
[0057] 4) This is the dense regression loss function.
[0058] 5) The values of 0.25, 0.1, 0.01, respectively
[0059] S3: build feature pyramid II, and perform feature fusion;
[0060] As shown in Figure 4 , build feature pyramid II, and perform feature fusion. First, input C1, C2, and C3 of the output of the deep separable convolutional neural network I into the convolutional neural network II-I with a convolution kernel size of 1x1 and a channel number of 64, and output D1, D2, and D3, wherein D3 is one of the outputs of the feature pyramid II. Add P3 and D2, input them into the convolutional layer II-II, and output the fusion feature to obtain one of the outputs of the feature pyramid II, P2. Add P2 and D1, input them into the convolutional layer II-III, and output the fusion feature to obtain one of the outputs of the feature pyramid II, P1.
[0061] The convolutional neural network II-I adjusts the channel number to be consistent, facilitates the addition of feature maps, and completes feature fusion.
[0062] S4: use the fusion feature obtained in step S3 to build a convolutional neural network module III to strengthen the receptive field, complete feature extraction, and obtain face prior box classification prediction results, face box regression prediction results, and face feature key point coordinate sequence prediction results.
[0063] As shown in Figure 5 , use the fusion features P1, P2, and P3 obtained in step S3 to build a convolutional neural network module III to strengthen the receptive field. Input P1, P2, and P3 into the convolutional layer III-I with a convolution kernel size of 3x3, input the output results of the convolutional layer III-I into the convolutional layer III-II with a convolution kernel size of 3x3, and input the output results of the convolutional layer III-II into the convolutional layer III-III with a convolution kernel size of 3x3. The output results S1, S2, and S3 of the convolutional layer III-III are the output results of the convolutional neural network module III. S1 is the face prior box classification prediction result, S2 is the face box regression prediction result, and S3 is the face feature key point coordinate sequence prediction result.
[0064] S5: compare the standard face five key point coordinates according to the face key point coordinates, calculate an affine transformation matrix, and perform face correction on the face box.
[0065] Specifically, in the step S05, according to the face key point coordinates, the affine transformation matrix is calculated by comparing the standard face five key point coordinates, and the face frame is corrected. Wherein, the face key point coordinates are the coordinate values when the face picture size is 112x112, the coordinate value matrix is M1, the standard coordinate value matrix of the face five key point when the picture size is 112x112 is M2, and the angle that the face image should be rotated is calculated as The corresponding affine transformation matrix M x, Wherein:
[0066] ,
[0067] S6: Constructing a convolutional neural network module IV using an additive angle interval loss function, training the network model, and extracting a face feature vector;
[0068] Constructing a convolutional neural network module IV using an additive angle interval loss function, extracting a face feature vector; the convolutional neural network module IV is trained by an end-to-end method to train the entire convolutional neural network model. The backbone network of the convolutional neural network module IV is ResNet50, and the loss function used is an additive angle interval loss function :
[0069]
[0070] Wherein, is an interval function:
[0071]
[0072] is a true value label, is the angle between the feature vector and the first feature weight vector, m is an interval value of , the method takes , s is a hyperparameter of the adjustment range, the method takes .
[0073] S7: Inputting two given pictures containing faces to be identified into the trained convolutional neural network model respectively, obtaining the feature vectors of the faces contained in the two pictures respectively, calculating the similarity between the feature vectors, comparing the recognition threshold, and matching the face identity information;
[0074] Inputting two given pictures containing faces to be identified into the trained convolutional neural network model respectively, obtaining the feature vectors of the faces contained in the two pictures respectively, calculating the similarity between the feature vectors, comparing the recognition threshold, and matching the face identity information; wherein the similarity is the cosine similarity between the two vectors:
[0075]
[0076] wherein are 512-dimensional feature vectors output by the convolutional neural network module IV of the two face pictures to be compared respectively, denotes a vector dot product operation, denotes the length of the x vector.
[0077] wherein the convolutional neural network model comprises a deep separable convolutional neural network module I, a feature pyramid II, a convolutional neural network module III, and a convolutional neural network module IV.
[0078] The overall flowchart of the method is shown in Figure 6 It can be completely realized by a computer without manual assistance; this shows that the application can realize batch automatic processing, which can greatly improve the processing efficiency and reduce the labor cost.
[0079] An apparatus for implementing the above method comprises an image acquisition unit, a face region learning unit, a feature fusion unit, a feature extraction unit, a face correction unit, a face feature learning unit, and a feature similarity calculation unit; the image acquisition unit is configured to extract a large number of original images required for model training from a data set to form a training data set, and to pre-process the original image pairs to obtain grayscale images; the face region learning unit comprises a deep separable convolutional neural network module I, which uses a deep separable convolution unit to learn the face frame position information and the face feature point position information in the image; the feature fusion unit comprises a feature pyramid module II, which is configured to perform feature fusion on the three outputs of the face region learning unit to further strengthen the learning effect; the feature extraction unit comprises a convolutional neural network module III, which is configured to perform feature extraction on the result of the feature fusion unit, to strengthen the receptive field, and to output the final face classification prediction result, the face frame regression prediction result, and the face five-point feature point regression prediction result; the face correction unit is configured to calculate a corresponding affine transformation matrix according to the standard face feature point sequence and the face feature point regression prediction result obtained by the feature extraction unit, and to correct the face picture according to the matrix; the face feature learning unit comprises a convolutional neural network module IV, which uses ResNet50 as the backbone network and additive angle interval loss as the loss function, trains and extracts the features contained in the face picture, and finally outputs a 512-dimensional feature vector representing the face features; the feature similarity calculation unit calculates the cosine similarity between two face feature vectors output by the face feature learning unit, and matches the face identity information.
[0080] When using the system, picture 1 is inputted into S1, S2, S3, S4, S5 and S6 to obtain the feature vector 1 corresponding to the face contained in picture 1, and then picture 2 is inputted into S1, S2, S3, S4, S5 and S6 to obtain the feature vector 2 corresponding to the face contained in picture 2, at this time, two feature vectors to be compared are obtained, then S7 is performed, the cosine similarity (range [0, 1]) between the two vectors is calculated, and the threshold value (the threshold value is set according to the experience and requirements in actual production, for example, set to 0.6) is compared, if the calculated cosine similarity is greater than the threshold value, the faces in picture 1 and picture 2 are of the same person, otherwise, it is considered that they are not the same person.
[0081] In addition, the picture data set mentioned in S1 is only used for training the model, after the training is completed, in the actual use of the system, only the trained model is contained in the system, and there is no picture. When using the system, only two pictures need to be inputted, and then the system outputs the judgment result (the same person or not the same person).
[0082] The above is a description of the present application and its embodiments, which is not limited. The embodiment shown in the drawings is only one of the embodiments of the present application, and the actual structure is not limited thereto. Therefore, if a person skilled in the art is inspired thereby, without departing from the purpose of the present application, similar structural modes and embodiments can be designed without creativity, which all belong to the protection scope of the present application.
Claims
1. A face recognition method based on depthwise separable convolution and additive angle interval loss, characterized in that, The method comprises the following steps: S1. Extracting original images from a public face dataset to form a training dataset, and pre-processing the original images to obtain grayscale images, wherein the original images include pictures containing face information and corresponding face position annotation information; S2. Constructing a deep separable convolutional neural network module I to extract multi-scale region features of the grayscale images in step S1; The deep separable convolutional neural network module I comprises two main network modules, a normalization module I-I and a deep separable convolution module I-II; the input of the deep separable convolutional neural network module I is the input of the normalization module I-I, the output of the normalization module is the input of the deep separable convolution module I-II, and the output of the deep separable convolution module I-II is the output of the deep separable convolutional neural network I; The normalization module I-I first inputs the input of the deep separable convolutional neural network I through a zero padding layer I-I-I, inputs the output result of the zero padding layer I-I-I into a convolution layer I-I-II with a convolution kernel size of 2x2 for convolution, inputs the output result of the convolution layer I-I-II into a batch normalization layer I-I-III, inputs the output result of the batch normalization layer into a ReLU layer, inputs the output result of the ReLU layer into a deep separable convolution unit I-I-IV with a channel number of 16, and the output of the deep separable convolution unit I-I-IV is the output of the normalization module I-I; the deep separable convolution module I-II is composed of four deep separable convolution sub-modules, namely a deep separable convolution sub-module I-II-I with a channel number of 32, a deep separable convolution sub-module I-II-II with a channel number of 64, a deep separable convolution sub-module I-II-III with a channel number of 128, and a deep separable convolution sub-module I-II-IV with a channel number of 256, wherein the output of a previous sub-module is the input of a subsequent sub-module, the deep separable convolution sub-module I-II-I with a channel number of 32 comprises two deep separable convolution units, the deep separable convolution sub-module I-II-I with a channel number of 64 comprises two deep separable convolution units, the deep separable convolution sub-module I-II-I with a channel number of 128 comprises six deep separable convolution units, the deep separable convolution sub-module I-II-I with a channel number of 256 comprises two deep separable convolution units, the output C1 of the deep separable convolution sub-module I-II-II, the output C2 of the deep separable convolution sub-module I-II-III, and the output C3 of the deep separable convolution sub-module I-II-IV are the network outputs of the deep separable convolutional neural network I; The deep separable convolution unit I-I-IV, the deep separable convolution submodule I-II-I, the deep separable convolution submodule I-II-II, the deep separable convolution submodule I-II-III, and the deep separable convolution submodule I-II-IV are composed of a plurality of deep separable convolution units I-III, the deep separable convolution unit I-III inputs an input through a convolution layer I-III-I with a convolution kernel size of 3*3, inputs an output result of the convolution layer I-III-I into a batch normalization layer I-III-II, inputs a result of the batch normalization layer I-III-II into a ReLU layer I-III-III, inputs an output result of the ReLU layer I-III-III into a convolution layer I-III-IV with a convolution kernel size of 1*1, inputs an output result of the convolution layer I-III-IV into a batch normalization layer I-III-V, and finally inputs an output result of the batch normalization layer I-III-V into a ReLU layer I-III-VI, and the output result of the ReLU layer is an output result of the deep separable convolution unit I-III; S3. Constructing a feature pyramid II and performing feature fusion; C1, C2, and C3 are respectively input into a convolution layer II-I with a convolution kernel size of 1*1 and a channel number of 64, and D1, D2, and D3 are output, wherein D3 is one of outputs of the feature pyramid II, P3, P3 is added to D2, input into a convolution layer II-II, and output fusion features to obtain one of outputs of the feature pyramid II, P2, P2 is added to D1, input into a convolution layer II-III, and output fusion features to obtain one of outputs of the feature pyramid II, P1; S4. Using the fusion features obtained in step S3, constructing a convolutional neural network module III to strengthen a receptive field, completing feature extraction, obtaining a face prior box classification prediction result, a face box regression prediction result, and a face key point coordinate sequence prediction result, and using the fusion features P1, P2, and P3 obtained in step S3, constructing a convolutional neural network module III to strengthen a receptive field, inputting P1, P2, and P3 into a convolution layer III-I with a convolution kernel size of 3*3, inputting an output result of the convolution layer III-I into a convolution layer III-II with a convolution kernel size of 3*3, inputting an output result of the convolution layer III-II into a convolution layer III-III with a convolution kernel size of 3*3, and taking S1, S2, and S3, which are output results of the convolutional neural network module III, as the output results, wherein S1 is the face prior box classification prediction result, S2 is the face box regression prediction result, and S3 is the face key point coordinate sequence prediction result; S5. According to the face key point coordinates, comparing standard face five key point coordinates, calculating an affine transformation matrix, and performing face correction on the face box; S6. Constructing a convolutional neural network module IV using an additive angle interval loss function, training a network model, and extracting a face feature vector; S7: inputting two given pictures containing faces to be identified into the trained convolutional neural network model respectively to obtain feature vectors of the faces contained in the two pictures respectively, calculating the similarity between the feature vectors, comparing the recognition threshold, and matching the face identity information.
2. The face recognition method based on deep separable convolution and additive angular margin loss according to claim 1, characterized in that: In the step S5, the affine transformation matrix is calculated according to the face key point coordinates and the standard face five key point coordinates, and the face frame is corrected. The face key point coordinates are coordinate values when the face picture size is 112x112, and the coordinate value matrix is M1. The face five key point standard coordinate value matrix when the picture size is 112x112 is M2. The angle at which the face image should be rotated is θ, and the corresponding affine change matrix M x, wherein:
3. The face recognition method based on deep separable convolution and additive angular margin loss according to claim 1, characterized in that: In the step S6, a convolutional neural network module IV adopting an additive angle interval loss function is constructed to extract the face feature vector; the entire convolutional neural network model is trained by an end-to-end method; wherein The backbone network of the convolutional neural network module IV is ResNet50, and the loss function adopted is an additive angle interval loss function Wherein, f is an interval function: y is the true value label, θ j is the angle between the feature vector and the jth feature weight vector, m is the interval value with the interval [0, 1], the method takes m = 0.4, s is the hyperparameter for adjusting the range, the method takes s = 0.
33.
4. The face recognition method based on deep separable convolution and additive angular margin loss according to claim 1, characterized in that: In the step S7, the two given pictures containing faces to be identified are input into the trained convolutional neural network model respectively to obtain feature vectors of the faces contained in the two pictures respectively, the similarity between the feature vectors is calculated, the recognition threshold is compared, and the face identity information is matched; wherein the similarity S is the cosine similarity between the two vectors: Wherein, a and b are respectively the 512-dimensional feature vectors output by the convolutional neural network module IV of the two face pictures to be compared, "·" represents vector dot multiplication operation, and ||x|| represents the length of the x vector.
5. The face recognition method based on deep separable convolution and additive angular margin loss according to claim 4, characterized in that: The convolutional neural network model comprises a deep separable convolutional neural network module I, a feature pyramid II, a convolutional neural network module III, and a convolutional neural network module IV.
6. A device for implementing any of the face recognition methods based on deep separable convolution and additive angular margin loss of claims 1-5, characterized in that: It comprises an image acquisition unit, a face region learning unit, a feature fusion unit, a feature extraction unit, a face correction unit, a face feature learning unit, and a feature similarity calculation unit. The image acquisition unit is used to extract a large number of original images required for model training from a data set to form a training data set, and to pre-process the original image pairs to obtain gray images. The face region learning unit comprises a deep separable convolutional neural network module I, which adopts a deep separable convolution unit to learn the face frame position information and the face feature point position information in the picture. The feature fusion unit comprises a feature pyramid module II, which is used to perform feature fusion on the three outputs of the face region learning unit to further strengthen the learning effect. The feature extraction unit comprises a convolutional neural network module III, which performs feature extraction on the result of the feature fusion unit, strengthens the receptive field, and outputs the final face classification prediction result, face frame regression prediction result, and face five feature point regression prediction result. The face correction unit calculates the corresponding affine transformation matrix according to the standard face feature point sequence and the face feature point regression prediction result obtained by the feature extraction unit, and corrects the face picture according to the matrix. The face feature learning unit comprises a convolutional neural network module IV, which adopts ResNet50 as the backbone network and an additive angle interval loss as the loss function, trains and extracts the features contained in the face picture, and finally outputs a 512-dimensional feature vector representing the face features. The feature similarity calculation unit matches the face identity information by calculating the cosine similarity between the two face feature vectors output by the face feature learning unit.
Citation Information
Patent Citations
Lightweight face recognition method and system based on depth separable convolution
CN109063666A
Face detection method and device, electronic equipment and storage medium
CN111783749A