A method, chip and terminal for completing face recognition
Through the combination of the preset target detection model and the missing face completion network, the problem of low recognition accuracy caused by partial missing face images is solved, achieving more accurate recognition and positioning of the face area, and improving the recognition accuracy.
Patent Information
- Application Number
- CN202410606552.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-05-16
AI Technical Summary
Existing face recognition models have low recognition accuracy when facial images are partially missing, and cannot effectively handle partially missing images.
Use a preset target detection model to perform feature map compression and excitation operations, identify face areas and perform missing detection. If there is a missing face, use the missing face completion network to complete it, combined with the fusion of multi-feature extraction algorithms and majority voting methods. Confirm the recognition result.
The accuracy of face recognition is improved, and the recognition and positioning capabilities of face areas are enhanced through feature fusion and completion technology, thus improving the recognition accuracy.
Smart Images

Figure CN118196875B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a method, chip and terminal for completing face recognition. Background Art
[0002] With the development of science and technology, especially in the field of image recognition, face recognition has become the main means of identity verification. At present, it is mainly achieved by training face recognition models using neural network models, but such models are trained using normal and complete face images as training sets. With the diversification of the collection environment, the collected face images may have partial face image missing. In this case, using the current face recognition model to recognize the non-missing part of the face will greatly reduce the recognition accuracy. Summary of the invention
[0003] The main purpose of the present invention is to provide a method, chip and terminal for completing face recognition, which can at least solve the problem of low recognition accuracy due to partial missing of face images in the prior art.
[0004] To achieve the above object, an embodiment of the present invention provides a method for completing face recognition, comprising:
[0005] In response to a face recognition request, a face image to be recognized is obtained, and a face region in the face image to be recognized is recognized using a preset target detection model, wherein the preset target detection model performs a feature map compression operation and a feature excitation operation;
[0006] Cutting and separating the face area from the face image to be identified to obtain a target face;
[0007] Identify whether there is a missing part in the target face;
[0008] If it exists, the target face is completed using the missing face completion network to obtain a complete face image;
[0009] Based on a fusion multi-feature extraction algorithm, extract and integrate each facial feature in the completed complete facial image to obtain a facial feature vector of the complete facial image;
[0010] The complete face image is divided into multiple image block sets, and image blocks at preset positions are selected from the image block sets to form new image block sets corresponding to each image block set; based on the face feature vector of the new image block set, a relative majority voting method is used to determine the face classification result of the face image to be identified.
[0011] In some embodiments, using a missing face completion network to complete the target face to obtain a complete face image includes:
[0012] Inputting the target face into a first generation network in the missing face completion network to obtain a first completed face image;
[0013] Inputting the first completed face image into the second generation network in the missing face completion network, wherein the second generation network includes an attention module layer and an extended convolution layer, wherein the first completed face image passes through the attention module layer and the extended convolution layer respectively, and the output results of the attention module layer and the extended convolution layer are spliced to obtain a second completed face image;
[0014] The second completed face image is subjected to global discrimination and local discrimination, and the second completed face image whose discrimination result meets preset conditions is determined as the completed complete face image.
[0015] In some embodiments, the complete face image is divided into multiple image block sets, and image blocks at preset positions are selected from the image block sets to form new image block sets corresponding to each image block set. Based on the face feature vector of the new image block set, a face classification result of the face image to be identified is determined by a relative majority voting method, including:
[0016] Dividing the complete face image into a number of image blocks with a certain step length;
[0017] Drawing a window of a certain size with each of the image blocks as the center;
[0018] Selecting a number of image blocks in each of the windows with a certain step length, the image blocks in each of the windows being a set of image blocks corresponding to the window;
[0019] Based on the nonlinear structural similarity of face images in manifold space, the context image block in each window is connected in series with the central image block of the window to obtain a new image block set;
[0020] Using local constraint representation method to classify the set of concatenated image blocks;
[0021] A relative majority voting method is used to determine that the recognition result of the complete face image is the preset face sample with the most classifications in the image block set.
[0022] In some embodiments, based on a fusion multi-feature extraction algorithm, extracting and integrating each facial feature in the completed complete facial image to obtain a facial feature vector of the complete facial image includes:
[0023] Using a first preset convolution kernel to perform feature extraction on the completed complete face image to obtain a feature map of a preset size;
[0024] Inputting the feature map into a preset global attention module to obtain a first line feature, and inputting the feature map into a preset local space and preset channel attention module connected in series to obtain a second line feature, and then fusing the first line feature and the second line feature to obtain a fusion result;
[0025] The fusion result is sequentially input into the first depthwise separable convolutional layer, the bottleneck layer, the second preset convolutional layer and the second depthwise separable convolutional layer to obtain the facial feature vector of the complete facial image.
[0026] In some embodiments, the preset target detection model includes: a feature extraction module with a compressed excitation ResNet-50 module as a backbone network, a compressed excitation Inception module encapsulated with convolution kernels of different sizes, and a Head module with three prediction branches;
[0027] The compressed excitation ResNet-50 module and the compressed excitation Inception module both include a compressed excitation module, which performs feature map compression operations and feature excitation operations.
[0028] In some embodiments, identifying a face region in the face image to be identified using a preset target detection model includes:
[0029] Extracting a global feature map in the face image according to different scales using the compression-excited ResNet-50 module;
[0030] Inputting the global feature map into the compressed excitation Inception module to obtain enhanced global features;
[0031] Each of the enhanced global features is input into the Head module to judge and locate the face, and the face area in the face image is determined based on the results of the judgment and positioning.
[0032] In some embodiments, extracting a global feature map in the face image at different scales using the compression-excited ResNet-50 module includes:
[0033] Inputting the face image into the compression-excitation ResNet-50 module, extracting multiple scale feature maps through ResNet-50 in the compression-excitation ResNet-50 module, and performing feature map compression and feature excitation operations on each of the scale feature maps using the compression-excitation module in the compression-excitation ResNet-50 module to obtain multiple groups of global feature maps;
[0034] The inputting the global feature map into the compressed excitation Inception module to obtain each enhanced global feature includes:
[0035] Input the global feature map into the compressed excitation Inception module to obtain the weight coefficients on each channel dimension;
[0036] Based on the weight coefficient, each group of global feature maps is multiplied to obtain the corresponding enhanced global feature.
[0037] In some embodiments, if the multiple sets of global features are six sets of global features, the face image is input into the compression excitation ResNet-50 module, multiple scale feature maps are extracted through ResNet-50 in the compression excitation ResNet-50 module, and the compression excitation module in the compression excitation ResNet-50 module is used to perform feature map compression operation and feature excitation operation on each of the scale feature maps to obtain multiple sets of global feature maps, including:
[0038] Inputting the face image into the compression-excitation ResNet-50 module, downsampling the face image in a bottom-up manner using the ResNet-50 in the compression-excitation ResNet-50 module to extract a low-level feature map therein, and performing dimensionality reduction convolution on the low-level feature map to obtain four first-scale feature maps;
[0039] Through a 3×3 convolution kernel with a stride of 2, a ReLU activation layer, and a 3×3 convolution kernel with a stride of 2, two of the four first-scale feature maps are convolved to obtain two second-scale feature maps;
[0040] Inputting the face image into the compressed excitation ResNet-50 module, upsampling the face image in a top-down manner using ResNet-50 to obtain a high-level feature map thereof;
[0041] The first-scale feature maps, the second-scale feature maps and the high-level feature maps are fused to obtain six groups of global feature maps.
[0042] In a second aspect, a chip is provided, comprising a first processor, configured to call and run a computer program from a first memory, so that a device equipped with the chip executes each step of the method for completing face recognition as described above.
[0043] In a third aspect, a terminal is provided, comprising a second memory, a second processor, and a computer program stored in the second memory and executable on the second processor, wherein the second processor implements the various steps of the method for completing face recognition as described above when executing the computer program.
[0044] Beneficial effects achieved by the present invention:
[0045] The method obtains a face image to be recognized in response to a face recognition request, and uses a preset target detection model to recognize a face area in the face image to be recognized, wherein the preset target detection model performs a feature map compression operation and a feature excitation operation; the face area is cropped and separated from the face image to be recognized to obtain a target face; it is identified whether there is a missing portion in the target face; if so, the target face is completed using a missing face completion network to obtain a complete face image; based on a fusion multi-feature extraction algorithm, each face feature in the completed complete face image is extracted and integrated to obtain a face feature vector of the complete face image; the complete face image is divided to obtain a plurality of image block sets, and image blocks at preset positions are selected from the image block sets to form new image block sets corresponding to each image block set; based on the face feature vector of the new image block set, a relative majority voting method is used to determine a face classification result of the face image to be recognized. Executing operations including feature map compression and feature excitation can realize continuous stacking convolution of face images by the preset target detection model, realize feature fusion in spatial and channel dimensions to better identify and locate face areas, and greatly improve recognition accuracy. In addition, using a fusion multi-feature extraction algorithm to complete the face, divide the complete face image to obtain multiple image block sets, and select preset position image blocks from the image block set to form a new image block set corresponding to each image block set. Based on the face feature vector of the new image block set, the face classification result of the face image to be identified is determined by the relative majority voting method, which can also improve face recognition accuracy. The preset target detection model in this method continuously stacks and convolves the face image, realizes feature fusion in spatial and channel dimensions to better identify and locate face areas, and greatly improves recognition accuracy.
[0046] Other features and corresponding effects of the present invention are described in the latter part of the specification, and it should be understood that at least part of the effects become obvious from the description in the specification of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0048] Figure 1 A schematic diagram of a first flow chart of the method for completing face recognition provided by the present invention;
[0049] Figure 2A schematic diagram of a missing face completion network structure of the face recognition completion method provided by the present invention;
[0050] Figure 3 A schematic diagram of the structure of a preset target detection model provided by the present invention;
[0051] Figure 4 A schematic diagram of an embodiment of a partially missing face recognition device provided by the present invention;
[0052] Figure 5 This is a basic structural block diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0054] See also Figure 1 As shown, this embodiment proposes a first embodiment of a method for completing face recognition, which includes the following steps:
[0055] 101. In response to a face recognition request, a face image to be recognized is obtained, and a face region in the face image to be recognized is recognized using a preset target detection model.
[0056] The face recognition request may be a request for face recognition to unlock when the user enters the main interface of a digital TV, enters an application on a terminal, mobile phone, tablet or other application device, or enters a page or a paid channel.
[0057] In this embodiment, the face image is an image collected by an infrared or visible light camera under the premise of user authorization. In practical applications, a live video in a specific scene is collected by a camera or a cluster monitoring device, and the head in the live video is identified and marked using image extraction software. The head is cut out from the video screen based on the mark to generate a face image. Further, it is identified whether the head portraits in each picture in the portrait collection are front-facing portraits. Specifically, by identifying the key points of the contour of the head portrait in the picture, and splicing and connecting the key points of the contour in series, it is determined whether it is a complete front-facing portrait contour. If not, the head portrait in the picture is reconstructed using 3D image reconstruction technology and rotated to obtain the corresponding front-facing portrait, thereby obtaining the face image to be identified.
[0058] The preset target detection model is a face detection neural network model, which can quickly locate and identify the face area in the image. The preset target detection model is mainly composed of three modules: feature extraction module, Inception module and Head module. Among them, the feature map compression operation and feature excitation operation also act on the feature extraction module and Inception module respectively. For the convenience of introduction, this article calls them the compression excitation feature extraction module and the compression excitation Inception module.
[0059] The compression-excitation feature extraction module is used to extract multi-scale features of the input image. It adopts a top-down information transfer structure to transfer the rich semantic features contained in the high-level feature map to the shallow feature map, enhance the semantic expression at multiple scales, and thus improve the effect of multi-scale face detection.
[0060] The compressed excitation Inception module is used to enhance the receptive field of the network. The feature extraction module will obtain 6 levels of outputs of different scales from P2 to P7. The feature map output by each layer is further enhanced by the Inception blocks of each layer to enhance the multi-scale face detection capability. The Inception block encapsulates convolution kernels of different sizes (1×1, 3×3, 5×5) to obtain receptive fields of different sizes, which helps to capture face and context information at multiple scales.
[0061] The Head module is used to realize the judgment and positioning of faces. It includes three prediction branches: classification prediction branch, regression prediction branch, and intersection-over-union prediction branch. The Head module can focus the attention of networks at different levels on the face size that the corresponding network should pay attention to, and reduce the attention of faces that do not belong to the corresponding size. In some examples, when the feature map is input into the Head module, the feature map passes through 4 convolutional layers with a channel size of 256 and a convolution kernel size of 3×3 and 1 convolutional layer with a channel size of 1 and a convolution kernel size of 3×3, and obtains a mask with a channel size of 1 and a size of W×H. This mask enables the current network layer to focus on the faces of the corresponding size that the current layer needs to pay attention to.
[0062] After obtaining the face image to be recognized, the face contour recognition model is used to recognize the face contour in the face image, and the face region is constructed based on the face contour. In practical applications, the colors of all pixels in the face image are extracted, and the pixels are screened based on the basic color of the face to obtain the pixels of the face; then the colors of the adjacent pixels of the pixels are determined from the screened pixels of the face, and it is identified whether the color of the adjacent pixels is the hair color, and the pixels of the hair and the pixels of the face are connected in series to obtain the boundary line of the face, thereby obtaining the face region.
[0063] 102. Cut and separate the features in the face area from the face image to obtain the target face.
[0064] In this embodiment, feature extraction is performed based on the face area to obtain the target face. Specifically, the extraction area is determined based on the boundary line of the face area, and the pixel information in the extraction area is intercepted using a pixel analysis tool to obtain the target face constructed with the pixel information.
[0065] 103. Identify whether there is any missing part in the target face.
[0066] In this embodiment, in some examples, a face may be missing due to a hand blocking the face, such as sunglasses, glasses, scarves, masks, hats, etc. Taking the case of wearing a mask as an example, the identification of whether a face is missing can be based on the wearing method of the mask to locate the range of the mask in the target face, and identify whether there are facial features in the range. If not, it is determined whether the target face is missing based on the position of the range and the recognition result. Specifically, when the position of the range is the mouth position or the eye position of the face and there are no facial features, it is determined that the target face is missing due to being blocked by an object, otherwise, it is not missing.
[0067] 104. If it exists, the target face is completed using the missing face completion network to obtain a complete face image.
[0068] In this embodiment, if there is a missing face, the missing position is determined based on the posture of the face, and the pixels at the position are completed using a face completion network based on the missing position to obtain a complete face image.
[0069] In practical applications, the missing face completion network consists of a multimodal information extraction network, a multimodal fusion framework, and a two-stage face completion network. The target face is input into the multimodal information extraction network to extract the face geometry information and attribute information of the target face, and the face geometry information and attribute information are fused through the multimodal fusion framework. Finally, the fused information is input into the two-stage face completion network to complete the missing area, which is specifically modified by pixel reconstruction. For example, the position of the missing facial features is determined by the distribution ratio of the facial features, and the facial features are supplemented based on the change law of pixels, thereby completing face repair.
[0070] In some embodiments of the present application, the step of completing the target face using the missing face completion network may be: inputting the target face into the first generation network in the missing face completion network to obtain a first completed face image, inputting the first completed face image into the second generation network in the missing face completion network, the second generation network includes an attention module layer and an extended convolution layer, the first completed face image passes through the attention module layer and the extended convolution layer respectively, the output results of the attention module layer and the extended convolution layer are spliced to obtain the second completed face image, the second completed face image is globally judged and locally judged, and the second completed face image whose judgment result meets the preset conditions is determined as the completed complete face image.
[0071] 105. Based on a fusion multi-feature extraction algorithm, extract and integrate the facial features in the completed complete facial image to obtain a facial feature vector of the complete facial image.
[0072] The fusion multi-feature extraction algorithm includes: through a first preset convolution kernel, based on the first preset convolution kernel, feature extraction is performed on the completed complete face image to obtain a feature map of a preset size, and then the feature map is input into a preset global attention module to obtain a first line feature, and the feature map is input into a preset local space and preset channel attention module in series to obtain a second line feature, and then the first line feature and the second line feature are fused to obtain a fusion result, and the fusion result is sequentially input into a first depth-separable convolution layer, a bottleneck layer, a second preset convolution layer, and a second depth-separable convolution layer to obtain a face feature vector of the complete face image.
[0073] 106. Divide the complete facial image into multiple image block sets, select image blocks at preset positions from the image block sets to form new image block sets corresponding to each image block set, and determine the face classification result of the face image to be identified by using a relative majority voting method based on the face feature vector of the new image block set.
[0074] In some examples of the embodiments of the present application, a complete facial image can be divided into several image blocks with a certain step size, a window of a certain size is drawn with each image block as the center, and several image blocks are selected in each window with a certain step size. The image blocks in each window are a set of image blocks corresponding to the window. Based on the nonlinear structural similarity of the facial image in the manifold space, the context image block in each window and the center image block of the window are connected in series to obtain a new image block set, and the local constraint representation method is used to classify the series of image blocks. The relative majority voting method is used to determine that the recognition result of the complete facial image is the preset facial sample with the most classifications in the image block set.
[0075] In summary, the method performs operations including feature map compression and feature excitation, which can realize the continuous stacking convolution of the face image by the preset target detection model, realize the fusion of features in the spatial and channel dimensions to better identify and locate the face area, and greatly improve the recognition accuracy. In addition, the face is completed by using a fusion multi-feature extraction algorithm, the complete face image is divided to obtain multiple image block sets, and image blocks at preset positions are selected from the image block sets to form new image block sets corresponding to each image block set. Based on the face feature vector of the new image block set, the face classification result of the face image to be identified is determined by the relative majority voting method, which can also improve the face recognition accuracy. The preset target detection model in the method continuously stacks and convolves the face image, realizes the fusion of features in the spatial and channel dimensions to better identify and locate the face area, and greatly improves the recognition accuracy.
[0076] The second embodiment of the method for completing face recognition provided in this embodiment includes:
[0077] 201. In response to a face recognition request, a face image to be recognized is obtained, and a preset target detection model is used to extract feature maps in the face image according to different scales.
[0078] The preset target detection model is mainly composed of three modules: the compressed excitation feature extraction module, the compressed excitation Inception module and the Head module. The compressed excitation feature extraction module is used to extract multi-scale features of the input image, the compressed excitation Inception module is used to enhance the receptive field of the network, and the Head module is used to realize the judgment and positioning of the face. Among them, the compressed excitation feature extraction module and the compressed excitation Inception module both have a compressed excitation module (Squeeze-and-Excitation module, SE module) to perform operations including feature map compression and feature excitation operations. The Head module has three prediction branches, such as Figure 3 shown.
[0079] In this embodiment, a compression excitation module (Squeeze-and-Excitation module, SE module) is used to perform operations including feature map compression and feature excitation, which can guide the ResNet-50 module (feature extraction module) and the Inception module to focus on the relationship between channels and learn channel features containing more effective information, thereby improving the performance of the face detection model. The compression excitation module (Squeeze-and-Excitation module) first performs a compression (Squeeze) operation on the input feature map, that is, the input feature map is compressed in the H and W dimensions through global flat pooling to obtain global features on each channel dimension. Then an excitation (Excitation) operation is performed, that is, the nonlinear relationship between each channel is first learned through the ReLU activation function, and then the importance of the features of different channel dimensions is learned through the sigmoid function to obtain the weight coefficients on each channel dimension. Finally, by multiplying the weight coefficient by the original input feature map, the model pays more attention to the channel with a large amount of information, thereby improving performance.
[0080] In a specific example of some embodiments, the feature extraction module can be implemented based on a feature pyramid network (FPN), and the feature pyramid adopts a top-down information transmission structure to transmit the rich semantic features contained in the high-level feature map to the shallow feature map, enhance the semantic expression on multiple scales, and thus improve the effect of multi-scale face detection. Although the feature pyramid network transmits the abstract ability of the high-level feature map downward, it does not make full use of the rich positioning information in the shallow layer. If the shallow rich positioning information is also transmitted from bottom to top, the positioning ability on multiple scales can be enhanced. Further, the feature pyramid is optimized by a path aggregation network PANet (Path Aggregation Network). The path aggregation network not only includes the original top-down information transmission structure of the feature pyramid network, but also transmits the rich positioning details contained in the low-level feature map to the high level, increasing the positioning ability on multiple scales, thereby improving the positioning ability when detecting small faces. At the same time, the newly added bottom-up information transmission structure of the path aggregation network also utilizes horizontal connections, thereby shortening the path of information transmission. The path aggregation network is used to improve the feature extraction module of the face detection model. Similar to the way PANet is used in YOLOv4, the lateral connections in the bottom-up information transmission structure are replaced by the concatenation operation instead of the addition operation of adjacent layers to improve the detection accuracy.
[0081] Specifically, the face image is input into the feature extraction module, multiple scale feature maps are extracted by ResNet-50 in the feature extraction module, and each scale feature map is compressed and excited by the compression excitation module in the feature extraction module to obtain multiple sets of global features. That is, in the bottom-up stage, the feature extraction module performs a downsampling operation on the input feature map. Among them, C2, C3, C4, and C5 correspond to the outputs of the convolution modules conv2, conv3, conv4, and conv5 in ResNet-50. C6 is obtained by convolving the feature map of C5 with a 3×3 convolution kernel with a step size of 2. C7 is obtained by convolving the feature map of C6 with a ReLU activation layer and a 3×3 convolution kernel with a step size of 2. In the top-down stage, the feature map is upsampled. The top-down convolutional neural network is extended to the P2 level so that smaller faces can be detected. In the horizontal connection stage, the feature map containing rich semantics at the high level is fused with the feature map containing rich positioning information at the low level.
[0082] The feature extraction module will get 6 levels of output at different scales from P2 to P7. The feature map output by each layer is further enhanced by the Inception blocks of each layer to enhance the multi-scale face detection capability. The Inception module encapsulates convolution kernels of different sizes to obtain receptive fields of different sizes, which helps to capture face and context information at multiple scales.
[0083] In practical applications, if the multiple sets of global features are six sets of global features, the face image is input into the feature extraction module, multiple scale feature maps are extracted by ResNet-50 in the feature extraction module, and each scale feature map is compressed and excited by the compression excitation module in the feature extraction module to obtain multiple sets of global features, including:
[0084] The face image is input into the feature extraction module, and the face image is downsampled in a bottom-up manner using ResNet-50 to extract a low-level feature map therein, and the low-level feature map is convolved with reduced dimension to obtain four first-scale feature maps; a 3×3 convolution kernel with a step size of 2, a ReLU activation layer, and a 3×3 convolution kernel with a step size of 2 are used to perform convolution operations on two of the four first-scale feature maps, respectively, to obtain two second-scale feature maps; the face image is input into the feature extraction module, and the face image is upsampled in a top-down manner using ResNet-50 to obtain a high-level feature map therein; each of the first-scale feature maps, each of the second-scale feature maps, and the high-level feature map are fused to obtain six sets of global feature maps.
[0085] 202. Use the compression excitation module to perform compression and excitation operations on the extracted feature maps of each scale in the spatial and channel dimensions to obtain weight coefficients on each channel dimension, and identify the face area in the face image based on the weight coefficients and the feature maps of each scale.
[0086] If the feature map is six groups of global features, the six groups of global features are sequentially input into the compression excitation Inception module, and the compression excitation module in the compression excitation Inception module compresses and excites each group of the global features according to receptive fields of different sizes to obtain weight coefficients on each channel dimension; each group of global feature maps is multiplied by the weight coefficient to obtain corresponding enhanced global features; each enhanced global feature is input into the Head module to judge and locate the face, and the face area in the face image is determined based on the results of the judgment and positioning.
[0087] That is, the outputs of different scales in the compressed excitation Inception module correspond one-to-one to the inputs of the Head module. The Head module includes three prediction branches: classification prediction branch, regression prediction branch, and intersection-over-union prediction branch.
[0088] in,
[0089] 1) Classification prediction branch. The classification prediction branch is used to predict the probability that each anchor at each spatial position is a face. The classification prediction branch consists of 4 convolutional layers with a channel size of 256 and a convolution kernel size of 3×3, and a convolutional layer with a convolution kernel size of 3×3 that outputs the final result.
[0090] 2) Regression prediction branch. The regression prediction branch is used to predict the relative offset between each prediction anchor and the ground-truth detection box coordinate point at each position. Its structure is similar to the classification prediction branch, except that the number of channels of the convolution layer that outputs the final result is different.
[0091] 3) IoU prediction branch. The IoU-aware Branch is used to predict the ratio of the intersection and union of the generated candidate face bounds (candidate bounds) and the original labeled face bounds (ground truth bounds). The use of IoU prediction can alleviate the problem of mismatch between classification scores and positioning accuracy in single-stage models. The first four convolutional layers of the IoU prediction branch are shared with the regression prediction branch, and the last convolutional layer for outputting the IoU consists of a 3×3 convolutional layer and a sigmoid activation layer.
[0092] Specifically, the feature maps of each scale are input into the compression excitation (SE) module. The compression excitation module first performs a compression operation on the input feature map, that is, the input feature map is compressed in the H and W dimensions through global flat pooling to obtain global features in each channel dimension. Then an excitation operation is performed, that is, the nonlinear relationship between channels is first learned through the ReLU activation function, and then the importance of features of different channel dimensions is learned through the sigmoid function to obtain the weight coefficients in each channel dimension. Finally, by multiplying the weight coefficients by the original input feature map, the model pays more attention to channels with larger amounts of information, thereby improving performance.
[0093] 203. Cut and separate the features in the face area from the face image to obtain the target face.
[0094] 204. Identify whether there is any missing part in the target face.
[0095] 205. If so, input the target face into the first generation network in the missing face completion network to obtain a first completed face image;
[0096] 206. Input the first completed face image into a second generation network in the missing face completion network, wherein the second generation network includes an attention module layer and an extended convolution layer, wherein the first completed face image passes through the attention module layer and the extended convolution layer respectively, and output results of the attention module layer and the extended convolution layer are spliced to obtain a second completed face image;
[0097] 207. Perform global discrimination and local discrimination on the second completed face image, and determine the second completed face image whose discrimination result meets preset conditions as the completed complete face image.
[0098] Missing face completion network, which is a generative adversarial network, including generator and discriminator, see Figure 2 The generator is a two-stage network from coarse to fine, including the first generation network and the second generation network.
[0099] (1) The first generation network
[0100] The first generative network is composed of convolution and dilated convolution. It is a coarse generative network. The input of the network is the complete face image obtained by the missing face completion network, and the output is an RGB image similar to the original image. In the first generative network stage, no changes are expected to occur in the area outside the area to be repaired, that is, the output of the non-missing area is consistent with the original image. The network architecture follows the encoder-decoder structure. First, the feature size is reduced by convolution and dilated convolution to reduce memory usage and calculation time, and then the size of the original image is restored by deconvolution. The network uses a 12-layer convolutional network to encode the original image, and unlike other methods that use many pooling layers to reduce the feature size, the first generative network only performs two poolings, and finally obtains a feature map with a size of one-sixteenth of the original image. In the repair process, the contextual information of the image is very important for the missing part. The dilated convolution uses an extended kernel, which has a larger receptive field when using the same number of parameters and computing power. And the original image is feature extracted through the front convolution layer. At this time, using the dilated convolution is equivalent to further expanding the receptive field, so four layers of dilated convolution are nested in the middle of the network.
[0101] (2) Second Generation Network
[0102] The second generation stage is a fine network, which is more complex. The network takes the rough restoration result output by the first generation network as input. The encoder is divided into two branches. The lower branch is consistent with the encoder structure of the first stage, and is a 12-layer convolutional network composed of convolution and dilated convolution. The second generation network adds a contextual attention layer to the upper branch. The generator of this stage is divided into two branches. The upper branch is consistent with the decoder structure of the first generation network, which mainly generates more refined face restoration images, and the other branch mainly generates mask images of missing areas. The mask image is mainly an image with a black background, and the white represents the area where the mask is missing. There are two main functions of generating a mask image. On the one hand, it is fused with the repaired face image so as to compare it with the original mask-missing face to prevent the non-missing area from changing during the restoration process; on the other hand, it provides information for the low-rank regularization loss.
[0103] In order to extract or copy information from the known non-missing area to repair the missing area, the contextual attention layer first matches the features of the missing part with the features of the non-missing part. Specifically, a 3×3 area block of size is first extracted from the non-missing part and used as the convolution kernel.
[0104] The first generative network produces a rough initial restoration result and is trained with reconstruction loss; meanwhile, the second generative network takes the rough completion image of the first stage as input to obtain a more refined completion result and is trained with reconstruction and adversarial losses. The refined network captures a more complete scene than the original image with missing parts, so its encoder can learn better feature representations than the coarse network.
[0105] (3) Discriminator
[0106] The discriminator is divided into global and local discriminators. The global discriminator identifies whether the entire image is fake, while the local discriminator identifies the authenticity of the repaired area. The two discriminators extract features from the repaired image through convolutional neural networks. The global discriminator takes the entire face image repaired by the generator as input. It consists of six convolutional layers and a fully connected layer with a 1024-dimensional vector. All convolutional layers use a convolution kernel size of 2×2 and a stride of 2 for feature extraction, and the number of convolution kernels increases gradually.
[0107] The local discriminator has the same network architecture as the global discriminator, but the local discriminator only takes the repaired area as input. In the process of training the local discriminator, there must be a repaired area. Assuming that the input image is not a repaired image (not an image with a repaired area), in order to ensure the normal progress of training, a random area of the image will be selected as the input of the local discriminator. In addition, since the initial input resolution is smaller than that of the global discriminator, the local discriminator lacks the first layer of the global discriminator compared to the global discriminator. Like the global discriminator, the output is also a 1024-dimensional vector.
[0108] 208. Use a first preset convolution kernel to perform feature extraction on the completed complete face image to obtain a feature map of a preset size;
[0109] 209. Input the feature map into a preset global attention module to obtain a first line feature, and input the feature map into a preset local space and preset channel attention module connected in series to obtain a second line feature, and then fuse the first line feature and the second line feature to obtain a fusion result;
[0110] 210. Input the fusion result into a first depthwise separable convolutional layer, a bottleneck layer, a second preset convolutional layer, and a second depthwise separable convolutional layer in sequence to obtain a facial feature vector of the complete facial image.
[0111] In the embodiment of the present application, the fusion multi-feature extraction algorithm includes steps 208 to 210. The preset local space and preset channel attention modules in the fusion multi-feature extraction algorithm refer to the preset local space attention module and the preset channel attention module connected in series, and then the series connection is connected in parallel with the preset global attention module. Specifically:
[0112] (1) Preset channel attention module
[0113] The channel domain attention mechanism focuses on the feature map channel and achieves attention by assigning different weights to different channels. In order to compress the features in the spatial dimension, two operations, average pooling and maximum pooling, are used. Average pooling has feedback for every pixel on the feature map, while maximum pooling only has gradient feedback for the place with the largest response in the feature map when performing gradient back propagation calculation. The two pooling methods obtain two 1*1*c feature vectors, which are then sent to a two-layer shared network with C / r and C neurons in the two layers respectively. After that, the two feature vectors are added together and the weight coefficient is obtained through the Sigmoid activation function.
[0114] (2) Preset local spatial attention module
[0115] The spatial domain attention block transforms the spatial information of the original image to another space, retaining more key information. The input channel C is subjected to average pooling and maximum pooling respectively, and then the two feature maps generated after pooling are concatenated to generate effective spatial information features. This function is used to normalize the range of the attention feature map to the [0,1] interval, thereby generating a complete spatial domain feature map.
[0116] (3) Preset global attention module
[0117] The global attention block extracts global image information and weights the features of all positions in the image. The global attention module is mainly divided into three parts. The first part is to model the global content. Similar to the self-attention mechanism, a 1*1 convolution is used to integrate the feature vector extracted from the previous layer. The second part uses 1*1 convolution for feature conversion. The setting of the hyperparameter r can change the capacity and computational cost of the global attention module. In order to balance the module complexity and network accuracy, r is generally taken as 16. At the same time, in order to further simplify the calculation, all positions of the feature are directly weighted and averaged. The third part combines the global attention block with the network, that is, the initial input feature x i The feature y after the attention weighted transformation i Add them together to get the output of the final global attention module.
[0118] (4) Attention Feature Fusion
[0119] The global attention feature map MG generated by the global attention module, the local spatial domain feature map MS generated by the spatial domain attention mechanism, and the local channel domain feature map MC generated by the channel domain attention module are fused by pixel superposition (Point-wiseAddition) to enhance the feature weights of the non-missing areas.
[0120] In some examples, the image size of the completed face image is 256*256*3. First, a convolution kernel with a size of 3*3 and a stride of 2 is used to extract features. A feature map of size 128*128*64 is obtained, which is used as the input of the multi-attention module, and input into the global attention module and the local spatial and channel attention module respectively. After that, the outputs of the two modules are fused and then input into the depthwise separable convolution layer. Then, a 10-layer bottleneck layer is used to extract features, and the channel dimension of the feature map is increased to 128. Then, a 1*1 convolution layer is used to integrate features and increase the dimension to 512. Finally, a depthwise separable convolution layer is used to retain more information.
[0121] 211. Divide the complete face image into a number of image blocks with a certain step length;
[0122] 212. Draw a window of a certain size with each image block as the center, select a number of image blocks in each window with a certain step length, and the image blocks in each window are the image block set corresponding to the window;
[0123] 213. Based on the nonlinear structural similarity of face images in manifold space, the context image block in each window is connected in series with the window center image block to obtain a new image block set.
[0124] For the image blocks obtained based on the division of the complete face image, the context blocks in its window can be represented by a set. Correspondingly, the preset face samples can be divided in the same way, and the divided image blocks can be represented by a set. The preset face samples here refer to preset face samples (preset face images) pre-stored in the face database, which are used to match the face image to be identified, so as to identify the face image to be identified. In some examples, the same user / person in the face database can have multiple images pre-stored (the same type of image refers to the image of the same user / person, and there can be multiple different images in one type of image).
[0125] In the embodiment of the present application, the complete face image set is assumed to be Y, where Y = [Y1, Y2, ..., Y M ],Y t ∈Y represents one of the samples, and the complete face image Y t Divide it into several overlapping image blocks with a certain step size s. Assume that each complete face image can be divided into H image blocks. represents the i-th image block of the t-th complete face image. Given a preset face sample set X = [X1, X2, ..., X c ]=[x1,x2,...,x R ],
[0126] represents the preset face sample of the kth class, Represents the i-th image block of the m-th preset face sample.
[0127] For the complete face image patch The context image patch in its window can be expressed as n=1,…N, N is the number of context image blocks in the window. The context image block set of the complete face image block It can be expressed as:
[0128]
[0129] The preset face samples are divided in the same way. Then, for the i-th image block of the m-th preset face sample, The context image patch set It can be expressed as:
[0130]
[0131] Manifold learning can effectively extract the nonlinear structural features of the image and maintain the local structural characteristics of the image. Based on the representation of the context image block of the image block of the complete face image and the representation of the central image block of the window, the context image block in the window can be connected in series with the central image block to obtain a new image block set. In the embodiment of the present application, the method of dividing the image block set in this way and further obtaining a new image block set for similarity judgment can reduce the use of computer resources and improve recognition efficiency. For the context image block set of the complete face image The context image block set of all preset face samples in the face database at the same position It is expressed as the representation J1 of the context image block of the complete face image block:
[0132]
[0133] represents the optimal reconstruction weight of the kth class.
[0134] Similarly, in each window, in addition to the image block context image block of the complete face image, the window center image block in the window can also be represented, and the representation of the window center image block J2 is:
[0135]
[0136] Considering the representation J1 of the context image block of the complete face image block and the representation J2 of the central image block of the window, the context image block in the window is connected in series with the central image block to obtain a new image block set. The optimal reconstruction weight w can be obtained by the following formula i* :
[0137]
[0138] Local constraints can describe the potential structure of nonlinear manifolds more effectively than sparsity, and the optimal reconstruction weight w i* In the formula, D is a diagonal matrix used to constrain the representation coefficient of the complete face image on the preset face sample, and λ represents the regularization parameter.
[0139] 214. Calculate the similarity between the face feature vector of each of the new image block sets and the image block set at the corresponding position of the preset face sample, and classify the image block sets based on the similarity;
[0140] In the embodiment of the present application, the image block of the complete face image is calculated The similarity between the image block set where the face is located and the image block set at the corresponding position of each type of preset face sample And further determine which category the image block set belongs to based on the similarity.
[0141]
[0142] In the formula in, represents the series combination of image blocks at the corresponding positions of the preset face samples of the kth class, represents the optimal reconstruction weight of the kth class.
[0143] 215. Use a relative majority voting method to determine that the recognition result of the complete facial image is the preset facial sample with the most classifications in the image block set.
[0144] For the H image block sets of a complete face image, the classification results of the H image block sets can be obtained by the above steps. According to the relative majority voting method, if the number of image block sets classified into the kth category among the H image block sets of the complete face image is the largest, then the complete face image is classified into the kth category at this scale.
[0145] In some other examples, in order to fully consider the impact of the scale of the image block in the window on the recognition rate of the face image, the scale of the image block is changed to obtain the recognition rate of the complete face image at different scales, and finally the final recognition rate of the complete face image is obtained by multi-scale integration. That is: the recognition results of the complete face image at different scales are adaptively fused to reduce the impact of the scale of the image block in the image block set on the recognition result, which can not only solve the cumbersome problem of image block scale selection, but also utilize the complementary information of image blocks at other scales, thereby improving the performance and robustness of the algorithm.
[0146] In summary, in response to a face recognition request, a face image to be recognized is obtained, and a preset target detection model is used to recognize the face area in the face image to be recognized, wherein the preset target detection model performs a feature map compression operation and a feature excitation operation; the face area is cut and separated from the face image to be recognized to obtain a target face; it is identified whether there is a missing portion in the target face; if so, the target face is completed using a missing face completion network to obtain a complete face image; based on a fusion multi-feature extraction algorithm, each face feature in the completed complete face image is extracted and integrated to obtain a face feature vector of the complete face image; the complete face image is divided to obtain multiple image block sets, and based on the face feature vectors of the image block sets, a relative majority voting method is used to determine the face classification result of the face image to be recognized. The feature map compression operation and the feature excitation operation are performed, so that the preset target detection model continuously stacks and convolves the face image, realizes the feature fusion in the spatial and channel dimensions to better identify and locate the face area, and greatly improves the recognition accuracy. In addition, using a fusion multi-feature extraction algorithm to complete the face, dividing the complete face image to obtain multiple image block sets, and using a majority voting method can also improve the accuracy of face recognition.
[0147] The above describes the method for completing face recognition in the embodiment of the present invention. The following describes the device for arranging missing faces in the embodiment of the present invention. Figure 4 An embodiment of the partially missing face recognition device in the embodiment of the present invention includes:
[0148] An acquisition module 510 is used to acquire a face image to be recognized, and recognize a face region in the face image using a preset target detection model, wherein the preset target detection model is a face detection model obtained by improving the preset target detection model using a compression excitation module;
[0149] A cropping module 520, used for cropping and separating the features in the face region from the face image to obtain a target face;
[0150] A determination module 530 is used to identify whether there is a missing portion in the target face;
[0151] A completion module 540 is used to complete the target face by using a missing face completion network to obtain a complete face image when there is a missing face in the target face;
[0152] A feature extraction module 550 extracts and integrates each facial feature in the completed complete facial image based on a fusion multi-feature extraction algorithm to obtain a facial feature vector of the complete facial image;
[0153] The recognition module 560 divides the complete facial image into multiple image block sets, selects image blocks at preset positions from the image block sets to form new image block sets corresponding to each image block set, and determines the face classification result of the face image to be recognized by using a relative majority voting method based on the face feature vector of the new image block set.
[0154] In this embodiment, the feature extraction module 550 is specifically used for:
[0155] Using a first preset convolution kernel to perform feature extraction on the completed complete face image to obtain a feature map of a preset size;
[0156] Inputting the feature map into a preset global attention module to obtain a first line feature, and inputting the feature map into a preset local space and preset channel attention module connected in series to obtain a second line feature, and then fusing the first line feature and the second line feature to obtain a fusion result;
[0157] The fusion result is sequentially input into the first depthwise separable convolutional layer, the bottleneck layer, the second preset convolutional layer and the second depthwise separable convolutional layer to obtain the facial feature vector of the complete facial image.
[0158] In this embodiment, the completion module 540 is specifically used for:
[0159] Inputting the target face into a first generation network in the missing face completion network to obtain a first completed face image;
[0160] Inputting the first completed face image into the second generation network in the missing face completion network, wherein the second generation network includes an attention module layer and an extended convolution layer, wherein the first completed face image passes through the attention module layer and the extended convolution layer respectively, and the output results of the attention module layer and the extended convolution layer are spliced to obtain a second completed face image;
[0161] The second completed face image is subjected to global discrimination and local discrimination, and the second completed face image whose discrimination result meets preset conditions is determined as the completed complete face image.
[0162] In this embodiment, the acquisition module 510 is specifically used for:
[0163] Using the preset target detection model, extracting feature maps in the face image according to different scales;
[0164] The compression excitation module is used to perform compression and excitation operations on the extracted feature maps of each scale in spatial and channel dimensions to obtain weight coefficients on each channel dimension, and the face area in the face image is identified based on the weight coefficients and the feature maps of each scale.
[0165] In this embodiment, the acquisition module 510 is specifically used for:
[0166] The preset target detection model includes: a feature extraction module with a compressed excitation ResNet-50 as the backbone network, a compressed excitation Inception module encapsulated with convolution kernels of different sizes, and a Head module with three prediction branches;
[0167] The face image is input into the feature extraction module, a plurality of scale feature maps are extracted by ResNet-50 in the feature extraction module, and each of the scale feature maps is compressed and excited by the compression excitation module in the feature extraction module to obtain a plurality of groups of global features.
[0168] Through the implementation of the above-mentioned device, the preset target detection model is improved by utilizing the compression excitation module, thereby realizing the continuous stacking convolution of the preset target detection model on the face image, realizing the feature fusion in the spatial and channel dimensions to better identify and locate the face area, and greatly improving the recognition accuracy.
[0169] To solve the above technical problems, an embodiment of the present invention further provides a chip, which can be a general-purpose processor or a dedicated processor. The chip includes a processor, which is used to support the terminal to execute the above related steps, such as calling and running a computer program from a memory, so that the device equipped with the chip is executed to implement the face recognition method in each of the above embodiments.
[0170] Optionally, in some examples, the chip also includes a transceiver, which is used to receive control of the processor and support the terminal to execute the above-mentioned related steps to implement the method for completing face recognition in the above-mentioned embodiments.
[0171] Optionally, the chip may also include a storage medium.
[0172] It should be noted that the chip can be implemented using the following circuits or devices: one or more field programmable gate arrays (FPGA), programmable logic devices (PLD), controllers, state machines, gate logic, discrete hardware components, any other suitable circuits, or any combination of circuits that can perform the various functions described throughout this application.
[0173] The present invention also provides a terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method for completing face recognition provided in the above embodiment are implemented.
[0174] Please refer to Figure 5 , Figure 5 The basic structural block diagram of a terminal shown in FIG. 1 includes a processor, a non-volatile storage medium, a memory, and a network interface connected via a system bus. The non-volatile storage medium of the terminal stores an operating system, a database, and a computer-readable instruction. The database may store a control information sequence. When the computer-readable instruction is executed by the processor, the processor may implement a method for completing face recognition. The processor of the terminal is used to provide computing and control capabilities to support the operation of the entire terminal. The memory of the terminal may store computer-readable instructions. When the computer-readable instruction is executed by the processor, the processor may execute a method for completing face recognition. The network interface of the terminal is used to connect and communicate with the terminal. It can be understood by those skilled in the art that the structure shown in the figure is only a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the terminal to which the scheme of the present application is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0175] It will be understood by those skilled in the art that the "terminal" and "terminal device" used herein include both devices with wireless signal receivers, which are devices with only wireless signal receivers without transmission capabilities, and devices with receiving and transmitting hardware, which are electronic devices with receiving and transmitting hardware capable of performing two-way communications on a two-way communication link. Such electronic devices may include: cellular or other communication devices, which have a single-line display or a multi-line display or a cellular or other communication device without a multi-line display; PCS (Personal Communications Service), which may combine voice, data processing, fax and / or data communication capabilities; PDA (Personal Digital Assistant), which may include a radio frequency receiver, a pager, Internet / intranet access, a web browser, a notepad, a calendar and / or a GPS (Global Positioning System) receiver; conventional laptop and / or palmtop computers or other devices, which have and / or include a conventional laptop and / or palmtop computer or other device with a radio frequency receiver. The "terminal" and "terminal device" used herein may be portable, transportable, installed in a vehicle (air, sea and / or land), or adapted and / or configured to operate locally, and / or in a distributed form, at any other location on the earth and / or in space. The "terminal" and "terminal device" used herein may also be a communication terminal, an Internet terminal, a music / video playing terminal, such as a PDA, a MID (Mobile Internet Device) and / or a mobile phone with a music / video playing function, or a smart TV, a set-top box and other devices.
[0176] The present invention also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, enables the one or more processors to execute the steps of the method for completing face recognition described in any of the above embodiments.
[0177] This embodiment also provides a computer program that can be distributed on a computer-readable medium and executed by a computing device to implement at least one step of the above-mentioned method for completing face recognition; and in some cases, at least one of the steps shown or described can be executed in an order different from that described in the above embodiment.
[0178] This embodiment further provides a computer program product, including a computer readable device, on which the computer program as shown above is stored. In this embodiment, the computer readable device may include the computer readable storage medium as shown above.
[0179] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0180] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0181] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0182] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A method for completing face recognition, characterized in that: The method comprises: In response to a face recognition request, a face image to be recognized is obtained, and a face region in the face image to be recognized is recognized using a preset target detection model, wherein the preset target detection model performs a feature map compression operation and a feature excitation operation; Cutting and separating the face area from the face image to be identified to obtain a target face; Identify whether there is a missing part in the target face; If it exists, the target face is completed using the missing face completion network to obtain a complete face image; Based on a fusion multi-feature extraction algorithm, extract and integrate each facial feature in the completed complete facial image to obtain a facial feature vector of the complete facial image; Dividing the complete face image to obtain a plurality of image block sets, selecting image blocks at preset positions from the image block sets to form new image block sets corresponding to each image block set, and determining a face classification result of the face image to be identified by using a relative majority voting method based on face feature vectors of the new image block sets; The method of using a missing face completion network to complete the target face to obtain a complete face image includes: Inputting the target face into a first generation network in the missing face completion network to obtain a first completed face image; Inputting the first completed face image into the second generation network in the missing face completion network, wherein the second generation network includes an attention module layer and an extended convolution layer, wherein the first completed face image passes through the attention module layer and the extended convolution layer respectively, and the output results of the attention module layer and the extended convolution layer are spliced to obtain a second completed face image; Performing global discrimination and local discrimination on the second completed face image, and determining the second completed face image whose discrimination result meets preset conditions as the completed complete face image; The preset target detection model includes: a feature extraction module with a compressed excitation ResNet-50 module as the backbone network, a compressed excitation Inception module encapsulated with convolution kernels of different sizes, and a Head module with three prediction branches; The compression excitation ResNet-50 module and the compression excitation Inception module both include a compression excitation module, which performs a feature map compression operation and a feature excitation operation; The method of using a preset target detection model to identify a face region in the face image to be identified includes: Extracting a global feature map in the face image according to different scales using the compression-excited ResNet-50 module; Inputting the global feature map into the compressed excitation Inception module to obtain enhanced global features; Each of the enhanced global features is input into the Head module to judge and locate the face, and the face area in the face image is determined based on the results of the judgment and positioning.
2. The method for completing face recognition according to claim 1, characterized in that: The step of dividing the complete face image to obtain a plurality of image block sets, extracting image blocks at preset positions from the image block sets to form new image block sets corresponding to each image block set, and determining the face classification result of the face image to be identified by using a relative majority voting method based on the face feature vector of the new image block set, comprises: Dividing the complete face image into a number of image blocks with a certain step length; Drawing a window of a certain size with each image block as the center, selecting a number of image blocks in each window with a certain step length, and the image blocks in each window are the image block set corresponding to the window; Based on the nonlinear structural similarity of face images in manifold space, the context image block in each window is connected in series with the central image block of the window to obtain a new image block set; Calculating the similarity between the face feature vector of each of the new image block sets and the image block set at the corresponding position of the preset face sample, and classifying the image block sets based on the similarity; A relative majority voting method is used to determine that the recognition result of the complete face image is the preset face sample with the most classifications in the image block set.
3. The method for completing face recognition according to claim 1, characterized in that: The method of extracting and integrating the facial features in the completed complete facial image based on the fusion multi-feature extraction algorithm to obtain the facial feature vector of the complete facial image includes: Using a first preset convolution kernel to perform feature extraction on the completed complete face image to obtain a feature map of a preset size; Inputting the feature map into a preset global attention module to obtain a first line feature, and inputting the feature map into a preset local space and preset channel attention module connected in series to obtain a second line feature, and then fusing the first line feature and the second line feature to obtain a fusion result; The fusion result is sequentially input into the first depthwise separable convolutional layer, the bottleneck layer, the second preset convolutional layer and the second depthwise separable convolutional layer to obtain the facial feature vector of the complete facial image.
4. The method for completing face recognition according to claim 1, characterized in that: The extracting the global feature map in the face image according to different scales by using the compression-excited ResNet-50 module includes: Inputting the face image into the compression-excitation ResNet-50 module, extracting multiple scale feature maps through ResNet-50 in the compression-excitation ResNet-50 module, and performing feature map compression and feature excitation operations on each of the scale feature maps using the compression-excitation module in the compression-excitation ResNet-50 module to obtain multiple groups of global feature maps; The inputting the global feature map into the compressed excitation Inception module to obtain each enhanced global feature includes: Input the global feature map into the compressed excitation Inception module to obtain the weight coefficients on each channel dimension; Based on the weight coefficient, each group of global feature maps is multiplied to obtain the corresponding enhanced global feature.
5. The method for completing face recognition according to claim 4, characterized in that: If the multiple sets of global features are six sets of global features, the face image is input into the compression-excitation ResNet-50 module, multiple scale feature maps are extracted through ResNet-50 in the compression-excitation ResNet-50 module, and the compression-excitation module in the compression-excitation ResNet-50 module is used to perform feature map compression and feature excitation operations on each of the scale feature maps to obtain multiple sets of global feature maps, including: Inputting the face image into the compression-excitation ResNet-50 module, downsampling the face image in a bottom-up manner using the ResNet-50 in the compression-excitation ResNet-50 module to extract a low-level feature map therein, and performing dimensionality reduction convolution on the low-level feature map to obtain four first-scale feature maps; Through a 3×3 convolution kernel with a stride of 2, a ReLU activation layer, and a 3×3 convolution kernel with a stride of 2, two of the four first-scale feature maps are convolved to obtain two second-scale feature maps; Inputting the face image into the compressed excitation ResNet-50 module, upsampling the face image in a top-down manner using ResNet-50 to obtain a high-level feature map thereof; The first-scale feature maps, the second-scale feature maps, and the high-level feature maps are fused to obtain six groups of global feature maps.
6. A chip, characterized in that: include: The first processor is used to call and run a computer program from a first memory, so that a device equipped with the chip executes each step of the method for completing face recognition as described in any one of claims 1 to 5.
7. A terminal, characterized in that: The method comprises a second memory, a second processor, and a computer program stored in the second memory and executable on the second processor, wherein the second processor implements the steps of the method for completing face recognition as described in any one of claims 1 to 5 when executing the computer program.
