A face retrieval method based on one-dimensional local features
By freezing the front neural network layers in the face recognition model and using age information for feature compression, it solves the problems of high memory consumption and low recognition accuracy in face recognition in the existing technology, and achieves faster and more accurate face retrieval. , suitable for edge devices.
Patent Information
- Application Number
- CN202110523566.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-13
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-05-13
AI Technical Summary
In the existing technology, the 512-dimensional features extracted by the ArcFace network structure during face recognition result in high memory consumption and long calculation time, which affects the efficiency of face retrieval, especially in the case of multiple data streams concurrently; although the MobilefaceNets method performs feature compression, However, the lack of prior information guidance affects the recognition accuracy.
In the training phase of the face recognition model, the previous neural network layers are frozen, age information is used as prior knowledge for feature compression, lower-dimensional single-dimensional features are extracted, and in the inference phase, rapid retrieval is performed based on age information to construct facial features. library to speed up the matching process.
By reducing the feature dimension, the memory usage is reduced, the speed and accuracy of face recognition are improved, it is suitable for edge devices, and the application field of face detection technology is expanded.
Smart Images

Figure CN113191298B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of face recognition, and in particular to a face retrieval method based on single-dimensional local features. Background Art
[0002] With the explosion of artificial intelligence technology, face recognition has gradually been implemented in scenarios such as face payment, personnel control, and finding missing persons. After obtaining the face feature matrix, face recognition based on neural networks needs to measure the similarity with the real face feature matrix, and compare the measured value with the corresponding threshold to identify the target in the face library (a large number of face feature sets). Convolutional neural network (CNN) is the most representative and one of the most commonly used algorithms in neural networks. Convolutional neural network is a type of feedforward neural network with deep structure that includes convolution calculation. Convolutional neural network has the ability to represent learning and can classify input information according to its hierarchical structure. By combining with nonlinear activation function, it can fit the high-dimensional semantic information of the input signal, so that the machine can relatively understand some things in the outside world. Face recognition technology generally includes two steps: first, the position information of the face in the input image is obtained through the face detection model, and second, the face detected in the first step is cut out and input into the recognition network to obtain a face feature vector of fixed dimension size, and then the vector is compared with the base library to obtain the specific information of the face in the image, such as Figure 1 There are two ways to implement face retrieval in the prior art. Method 1 is to use the features obtained by the ArcFace face recognition network to build a face library and perform face retrieval. The feature pair vector output by ResNet (MobileNet) is normalized and the angle interval is added to improve the inter-class separability, strengthen the intra-class compactness and inter-class differences, and significantly improve the face recognition effect. In addition, the ArcFace network model will output 512-dimensional face features during inference for subsequent feature matching processes, such as Figure 2 Method 2 is to use MobilefaceNets for face recognition. When extracting single-dimensional features at the end, the global deep convolution layer is used instead of the average pooling layer or the fully connected layer. While making full use of the global features, the dimension of the output features is reduced, for example, from 512 dimensions to 128 dimensions. Figure 3 shown.
[0003] The disadvantages of the existing technology are: when using the ArcFace network structure to extract 512-dimensional embedded features from the output of the fully connected layer (FC1) of the face classifier for feature matching or feature comparison during inference, the face feature library is huge, and when face retrieval, feature matching or feature comparison, it consumes a lot of memory, takes a long time to calculate, and has low comparison efficiency, especially in the scenario of face detection and recognition in parallel with multiple data streams, which affects the overall performance of the project. The MobilefaceNets method only processes feature compression from the level of representation learning, without giving any other effective prior information as a guide for network learning. Errors in the previous layer learning stage of the network will be amplified, seriously affecting the final result and accuracy of face recognition. Summary of the invention
[0004] The present invention relates to a method for face retrieval based on single-dimensional local features, which is characterized in that, in the training stage of the face recognition model, on the premise of using convolutional neural network training to obtain the single-dimensional features of the first stage, the features extracted by the previous neural network layer are frozen, and the age information of the person is used as prior knowledge for the feature compression process of the second stage, and the single-dimensional face features with lower dimensions are fitted and extracted for feature compression; in the actual reasoning stage, the detected face area and age information are input, and rapid retrieval is achieved according to the age, and detailed query results are output. The specific implementation steps are:
[0005] Training phase of face recognition model
[0006] Step 1: Use the face recognition model to obtain single-dimensional face information;
[0007] Step 2: Add the age information of the face image as prior knowledge for feature compression;
[0008] Step 3: Use the network parameters and age information trained in steps 1 and 2 to build a face feature library;
[0009] Actual reasoning stage
[0010] Step 4: Input the image to be identified for face recognition, and output the face information results including the name after retrieval.
[0011] As described above, the specific process of step 1 is as follows:
[0012] Step 101: preprocessing the input image using a traditional data enhancement method, wherein the preprocessing includes face rotation and cropping;
[0013] Step 102: Use the Resnet series of convolutional neural networks to train the input face and obtain the single-dimensional information of the face after the full convolution layer.
[0014] As described above, the specific process of step 2 is as follows:
[0015] Step 201: Freeze the network layer of the single-dimensional face information obtained in step 1, specifically freezing the convolution layer and downsampling layer of the convolutional neural network of the Resnet series;
[0016] Step 202: Add two fully connected layers with dimensions smaller than the input dimension for a second training, add the age information of the face image as prior knowledge to fit the face features of lower dimensions, and perform feature compression.
[0017] As described above, the specific process of step 3 is as follows:
[0018] Step 301: Prepare to generate a face image of the face feature library;
[0019] Step 302: Integrate the network parameters trained in step 1 and step 2, and use the integrated parameters to extract single-dimensional features of the face in the face feature library;
[0020] Step 303: Divide the facial feature library into blocks according to age groups using the acquired single-dimensional facial features.
[0021] As described above, the specific process of step 4 is as follows:
[0022] Step 401: input the image to be identified and the corresponding age;
[0023] Step 402: extracting single-dimensional features of the face in the image to be recognized using the network parameters trained in steps 1 and 2;
[0024] Step 403: searching for all features corresponding to the age group in the face feature library constructed in step 3 according to the input corresponding age, if the features can be found, proceed to the next step, otherwise outputting the information that the search is empty;
[0025] Step 404: perform facial feature matching on the input single-dimensional facial features in the image to be identified and the features in the retrieved facial feature library, and output the matching results.
[0026] Compared with the prior art, the advantage of the present invention is that by reducing the dimension of single-dimensional features, when comparing a large facial feature library, the memory occupancy is reduced according to the magnitude of feature reduction, and it plays an auxiliary role in edge devices or devices or systems with high memory occupancy requirements, thereby improving the speed of reasoning. By adding an age auxiliary index, the retrieval speed of features in the memory is accelerated, the accuracy and response speed of face recognition results are improved, the practical application value is enhanced, and the application field of face detection technology is expanded. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is the face recognition process of the existing technology;
[0028] Figure 2 It is the existing technology that uses ArcFace for reasoning process;
[0029] Figure 3 It is a flow chart of executing a single request by a face retrieval method based on a single-dimensional local feature of the present invention;
[0030] Figure 4 It is a schematic diagram of three stages of obtaining single-dimensional features in a face retrieval method based on single-dimensional local features of the present invention; DETAILED DESCRIPTION
[0031] like Figure 3 In one embodiment shown, a method embodiment of the present invention for face retrieval based on one-dimensional local features processes a single comparison retrieval request, including the following steps:
[0032] Training phase of face recognition model
[0033] Step 3-1: Start the program;
[0034] Step 3-2: Input face image;
[0035] Step 3-3: Use traditional data enhancement methods to preprocess the face image input in step 3-2, where the preprocessing includes face rotation and cropping operations;
[0036] Step 3-4: Use the Resnet series of convolutional neural networks to train the input face and obtain the single-dimensional information of the face after the full convolution layer;
[0037] Step 3-5: Add the age information of the face image in step 3-4;
[0038] Step 3-6: Extract the 512-dimensional information features in step 3-4;
[0039] Step 3-7: Use the age information in step 3-5 as prior knowledge to compress and reduce the 512-dimensional information features in step 3-6;
[0040] Step 3-8: After freezing the convolutional layer and downsampling layer in the single-dimensional face feature network in step 3-4, add two fully connected layers with dimensions smaller than the input dimension after the single-dimensional layer for a second training to perform feature fitting so that the network can fit lower-dimensional face features. Thus, under the premise of ensuring the robustness of face recognition, the corresponding feature redundancy is reduced and feature compression is achieved;
[0041] Step 3-9: Prepare to generate a facial image for a facial feature library, then integrate the network parameters trained in steps 3-4 and 3-8, and use the integrated parameters to extract single-dimensional facial features in the facial feature library, and finally divide the facial feature library into blocks according to age groups using the acquired single-dimensional facial features; in this embodiment, the facial feature library is divided into blocks, for example: 10-20 years old is one feature library block, and 20-30 years old is another feature library block.
[0042] Actual reasoning stage
[0043] Input the image to be identified and the corresponding age, use the network parameters that have been trained in steps 3-4 and 3-8, splice the features of the training phase together, and extract the single-dimensional features of the face in the image to be identified;
[0044] Step 3-10: Match or search the face feature library of the blocks in step 3-9 according to age;
[0045] Step 3-11: Determine whether the retrieval is successful;
[0046] Step 3-12: If the search is successful, the single-dimensional features of the face in the input image to be identified are matched with the features in the retrieved face feature library, and the matching result is output, wherein the matching result is the face information result including the name of the person;
[0047] Step 3-13: If the search fails, output the information that the search result is empty;
[0048] Step 3-14: The search and comparison operation is completed.
[0049] Figure 4 In one embodiment shown, the third stage of obtaining the single-dimensional feature training of a face in a method for face retrieval based on single-dimensional local features of the present invention includes the following steps:
[0050] Step 4-1: Preprocess the face image to be input to generate the face feature library, including face rotation and cropping operations, and then use the Resnet series of convolutional neural networks to train the input face to obtain the single-dimensional face information after the full convolution layer;
[0051] Step 4-2: Freeze the network layer of the single-dimensional face information obtained in step 4-1, specifically freeze the convolutional layer and downsampling layer of the Resnet series convolutional neural network, then add two fully connected layers with dimensions smaller than the input dimension for the second training, add the age information of the face image as prior knowledge to fit the lower-dimensional face features, and perform feature compression;
[0052] Step 4-3: Prepare to generate facial images for the facial feature library, integrate the network parameters trained in steps 4-1 and 4-2, and use the integrated parameters to extract single-dimensional facial features in the facial feature library, and divide the facial feature library into blocks according to age groups using the obtained single-dimensional facial features.
Claims
1. A face retrieval method based on one-dimensional local features, It is characterized in that In the training phase of the face recognition model, on the premise of using the convolutional neural network to train the first-stage single-dimensional features, the features extracted by the previous neural network layer are frozen, and the age information of the person is used as prior knowledge for the feature compression process in the second stage, and the single-dimensional face features with lower dimensions are fitted and extracted for feature compression; in the actual reasoning phase, the detected face area and age information are input, and fast retrieval is achieved based on age, and detailed query results are output. The specific implementation steps are as follows: The training phase of the face recognition model: Step 1: Use the face recognition model to obtain single-dimensional face information; Step 2: Add the age information of the face image as prior knowledge to perform feature compression. The specific process is as follows: Step 201: Freeze the network layer of the single-dimensional face information obtained in step 1, specifically freezing the convolution layer and downsampling layer of the convolutional neural network of the Resnet series; Step 202: adding two fully connected layers with dimensions smaller than the input dimension for a second training, adding age information of the face image as prior knowledge to fit lower dimensional face features, and performing feature compression; Step 3: Use the network parameters and age information trained in steps 1 and 2 to build a face feature library. The specific process is as follows: Step 301: Prepare to generate a face image of the face feature library; Step 302: Integrate the network parameters trained in step 1 and step 2, and use the integrated parameters to extract single-dimensional features of the face in the face feature library; Step 303: dividing the facial feature library into blocks according to age groups using the acquired single-dimensional facial features; Actual reasoning stage: Step 4: Input the image to be identified for face recognition, and output the face information results including the name after retrieval.
2. The method according to claim 1, It is characterized in that The specific process of step 1 is: Step 101: preprocessing the input image using a traditional data enhancement method, wherein the preprocessing includes face rotation and cropping; Step 102: Use the Resnet series of convolutional neural networks to train the input face and obtain the single-dimensional information of the face after the full convolution layer.
3. The method according to claim 1, It is characterized in that The specific process of step 4 is: Step 401: input the image to be identified and the corresponding age; Step 402: extracting single-dimensional features of the face in the image to be recognized using the network parameters trained in steps 1 and 2; Step 403: searching all features of the corresponding age group in the face feature library constructed in step 3 according to the input corresponding age, if the features can be found, proceed to the next step, otherwise outputting the information that the search is empty; Step 404: perform facial feature matching on the single-dimensional facial features in the input image to be identified and the features in the retrieved facial feature library, and output the matching results.
