Construction method and application of face recognition model

By constructing a dual-path face recognition model and utilizing an adaptive attention mechanism and a Kan network to generate attention weights for feature dimensions, the problem of insufficient consideration of feature importance and differences in traditional models is solved, thereby improving the accuracy of face recognition and the recognition ability in complex environments.

CN122067286APending Publication Date: 2026-05-19GUANGZHOU BAIRUI NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU BAIRUI NETWORK TECH CO LTD
Filing Date
2026-01-29
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

In existing technologies, traditional face recognition models lack consideration for the importance and differences between different features, resulting in low face recognition accuracy.

Method used

A dual-path face recognition model is constructed, which assigns different attention weights to global and local features through an adaptive attention mechanism. The adaptive attention mechanism is also introduced in the feature fusion and comparison stages, and the Kan network is used to generate attention weights for feature dimensions for feature comparison.

Benefits of technology

It improves the accuracy of facial recognition, especially in complex environments, by enhancing the model's recognition capabilities through lighting enhancement and age group segmentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122067286A_ABST
    Figure CN122067286A_ABST
Patent Text Reader

Abstract

According to the face comparison detection method of the scheme, on the basis of an original convolutional network, a kan structure is newly added, global features and local detail features are processed through a double-path parallel convolutional network, training data are constructed in combination with a Morph-UGATIT network and used for face feature extraction network training, the training data are input into a face attribute detection model, and the age of a comparison signal is recognized; according to output results, the output results are respectively input into models of different age groups for feature extraction, so that the recognition accuracy of face comparison is improved; and a distillation technology is adopted to convert a face feature extraction network into a lightweight network, so that the face feature extraction efficiency is improved, and the face comparison detection speed is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method for constructing and applying a face recognition model. Background Technology

[0002] In face comparison and detection scenarios, especially in the financial sector such as banking, the accuracy requirements for face recognition technology are extremely high. Current technologies, particularly traditional models, only extract global and / or local detailed features. While these models can capture global and / or local detailed features of a face, they lack a mechanism in the feature comparison stage to consider the importance and differences between different features. For example, features of the eyes and mouth are often more discriminative than features of the cheek area in face recognition. Traditional models, lacking discriminative evaluation of features, reduce the accuracy of face recognition. Summary of the Invention

[0003] The purpose of this invention is to provide a method for constructing and applying a face recognition model that can take into account the importance and differences between different features, thereby improving the accuracy of face recognition.

[0004] To achieve this objective, this invention provides a method for constructing a face recognition model and its application. Specifically, it is a method for constructing a dual-path face recognition model. The dual paths refer to a first path for extracting global features of the face and a second path for extracting local detail features. Specifically, different convolutional kernels are used in the convolutional layer to extract features from the face image, generating multiple feature maps of different scales. These feature maps are then input into a pooling layer to reduce their size, followed by feature fusion: an adaptive attention mechanism is used to calculate attention weights on the feature maps, which are then assigned to the feature maps to obtain fused feature maps. Finally, these fused feature maps are input into a fully connected layer to generate corresponding feature vectors. Feature vectors are then used for feature comparison. Specifically, the obtained feature vectors are compared with other feature vectors pre-stored in a database to calculate their similarity. The similarity is then compared to a preset similarity threshold, and the face recognition result is output. The key feature is that, during feature comparison, an adaptive attention mechanism is used to generate attention weights on the feature vectors. Each feature dimension in the feature vector is assigned a corresponding attention weight, and each feature dimension is multiplied by its attention weight to obtain a weighted feature vector.

[0005] Furthermore, the global features include facial contour features and the positional distribution features of the facial features; the local detail features include features of the eyes, nose, mouth, and wrinkles.

[0006] Furthermore, the process of generating attention weights for the feature vector using an adaptive attention mechanism specifically involves using a Kan network to generate the attention weights.

[0007] Furthermore, the Kan network receives the feature vector output by the fully connected layer as input, and uses a learnable spline function as the activation function to generate corresponding attention weights for each feature dimension in the feature vector.

[0008] Furthermore, similarity calculation specifically includes cosine similarity calculation.

[0009] Furthermore, in the feature fusion stage, the adaptive attention mechanism is a channel attention mechanism.

[0010] Furthermore, feature fusion specifically employs a channel-wise stitching method to fuse global feature maps and local detail feature maps.

[0011] Furthermore, a method for applying a face recognition model includes the following steps: acquiring a face image to be recognized, inputting the face image into a face attribute detection model for detection, outputting the age of the face image, inputting the face image into a face recognition model corresponding to the age for face recognition, and obtaining a face recognition result. The method is characterized in that, after acquiring the face image to be recognized, a histogram is used to determine the illumination intensity of the face image; if the illumination intensity is determined to be lower than a preset illumination threshold, a convolutional model is invoked to increase the illumination intensity, thereby obtaining an illuminated face image; and the illuminated face image is input into the face recognition model as described in claim 1 for face recognition.

[0012] Furthermore, the corresponding age range is a preset age stage based on the age range.

[0013] Furthermore, the convolutional model is based on the original hdrnet, but with some convolutions replaced by AcBlock structures.

[0014] This invention utilizes an adaptive attention mechanism to assign different attention weights to different feature dimensions during the feature comparison stage of a dual-path face recognition model. As a result, when calculating face similarity, the model pays more attention to feature dimensions that help distinguish different faces, enabling the model to better utilize these feature dimensions for recognition and improving the accuracy of face recognition. Attached Figure Description

[0015] Figure 1 This is a schematic diagram showing the structural changes of the feature map in an embodiment of the present invention.

[0016] Figure 2 This is a diagram showing the overall architecture of the face recognition model of the present invention.

[0017] Figure 3 This is a flowchart illustrating the application of the face recognition model of the present invention. Detailed Implementation

[0018] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0019] The construction method of the dual-path face recognition model is as follows: A dual-path face recognition model based on convolutional neural networks was constructed. The dual-path approach involves processing face images using two separate paths: one path specifically handles global facial features, and the other path handles local detail features. Global features include facial contours and the distribution of facial features; local detail features include eyes, nose, mouth, and wrinkles.

[0020] Figure 2 The overall framework of the model is given.

[0021] Step 1: The convolutional layer obtains the face image and performs a convolution operation on it. Specifically, different convolutional kernels (different sizes, different kernels) are used to extract global features and local detail features. For example, C1 different 7×7 convolutional kernels are used to extract global features in the global feature path, such as facial contours and the distribution of facial features, resulting in C1 intermediate global feature maps [H1, W1] (i.e., a two-dimensional matrix), where H is the height of the feature map, W is the width, and C1 is the number of channels (i.e., each channel includes one intermediate feature map). C2 different 3×3 convolutional kernels are used to extract local detail features, such as eyes, nose, mouth, and wrinkles, resulting in C2 intermediate local detail feature maps [H2, W2].

[0022] The obtained intermediate feature maps are input into the pooling layer for downsampling. The pooling layer can use max pooling to reduce the spatial size [H1, W1] of the intermediate global feature maps using a pooling window of size axa, and reduce the spatial size [H2, W2] of the intermediate local detail feature maps using a pooling window of size bxb, thus outputting smaller C1 intermediate global feature maps [H1', W1'] and C2 intermediate local detail feature maps [H2', W2'].

[0023] Step 2: Input the multiple smaller intermediate feature maps into the multi-scale feature fusion layer for feature fusion. like Figure 1 Assume the intermediate global feature map output by the first path is Fg={Fg1,Fg2,..,Fg c1Fgm is the intermediate global feature map from which different global features have been extracted. The intermediate local detail feature map output by the second path is Fl={Fl1,Fl2,...,Fl...} c2}, Fln is the intermediate local detail feature map extracted from different local detail features, c1 and c2 are the number of intermediate feature maps. Since the size of the intermediate global feature map is different from that of the intermediate local detail feature map, it is necessary to adjust the intermediate feature maps of different sizes to have the same length and width. If intermediate feature maps of different sizes are directly spliced, it may lead to information misalignment, duplication, etc. Therefore, it is necessary to ensure that all intermediate feature maps have the same length and width. Here, the smaller intermediate feature map is upsampled by transposed convolution and then subjected to another convolution operation (such as 3x3). The upsampled intermediate feature map is continuously corrected through training.

[0024] Then, a channel attention mechanism is used to perform weighted fusion of the intermediate global feature map and the intermediate local detail feature map. Specifically, the intermediate global feature map Fg={Fg1,Fg2,...,Fg...} after unification is fused. c1 Each intermediate feature map Fg in} c1 The spatial global average pooling is calculated to compress each intermediate feature map into a 1x1xC1 value, resulting in the average pooled feature of each channel. This feature is a single value, and multiple values ​​form a one-dimensional vector. This one-dimensional vector is then input into a fully connected layer, which performs a convolution operation on the one-dimensional vector using a 1x1 convolution kernel to generate the weights for each channel. The obtained channel attention weights are then input into a sigmoid function to map the channel attention weights to the range [0,1]. Finally, the channel attention weights are assigned to the channels of the global feature map to obtain the weighted intermediate global feature map.

[0025] Similarly, for the intermediate local detail feature map after unification of size, Fl={Fl1,Fl2,..,Fl... c2 Each intermediate local detail feature map of the dataset undergoes the same operation as the intermediate global feature map, resulting in a weighted intermediate local detail feature map. The weighted intermediate global feature map is then fused with the intermediate local detail feature map: this is done by concatenation, i.e., the intermediate global feature map Fg = {Fg1, Fg2, ..., Fg...}. c1} and Fl={Fl1,Fl2,..,Fl c2 The features are stitched together along the channel dimension to output the comprehensive feature map Z: Z = Concat(Fg, Fl) Assuming the size of the intermediate global feature map after unification is [H,W,C1] and the size of the intermediate local detail feature map is [H,W,C2], then the combined feature map Z formed by stacking C1+C2 intermediate feature maps after concatenation has a size of [H,W,C1+C2] and the number of channels is C1+C2.

[0026] In this way, by employing a multi-scale feature fusion approach, the resulting comprehensive feature map contains both global and local detailed features, enabling a more complete representation of facial features. This feature fusion adaptively learns the importance of each channel in both global and local detailed features and performs autonomous weighting.

[0027] Step 3: Input the synthesized feature map into the fully connected layer for classification. The fully connected layer uses linear transformations and non-linear activation functions to perform the following transformations on each intermediate feature map in the synthesized feature map: y=F(Wx+b) Where x is the input intermediate feature map, W is the weight matrix of the fully connected layer, b is the bias vector, W and b are the parameters obtained by continuously adjusting the model during training until it is well trained, and F is a non-linear activation function (such as ReLU, Sigmoid, etc.) that can filter out feature vectors with negative results, outputting feature vector y. Therefore, the fully connected layer filters out irrelevant or interfering features with negative results, outputting feature vector y. fc= [y1,y2,..yn], where yn is the feature dimension and n is the number of feature dimensions.

[0028] Step 5: Feature Comparison Adaptive Weighting Mechanism In the feature comparison stage, this invention introduces an adaptive weighting mechanism to assign different dimensional attention weights to each feature dimension yn in the final fully connected layer output feature vector y. The adaptive attention mechanism utilizes a KAN network to generate corresponding dimensional attention weights for each feature dimension yn in the feature vector. These dimensional attention weights represent the importance of each feature dimension yn in the feature vector. Adding a KAN structure to the original convolutional network enhances the facial feature extraction capability and strengthens feature diversity. Specifically: The KAN network receives the feature vector y. fc =[y1,y2,...yn] as input, and a learnable spline function (such as a B-spline function) as the activation function. The learnable spline function has the following form:

[0029] in, Let Pi be the basis function, and Pi be the learnable parameters during training. The final result is the dimension weight vector. Spline functions can continuously learn and adjust their shape during model training to adapt to different features, automatically assigning low weights to highly discriminative features and high weights to noisy features, resulting in a dynamic dimensionality-weight vector. This improves comparison accuracy by enhancing feature diversity. To better match the feature dimensions, the adaptive attention mechanism adjusts the generated dimensionality weight vector. An activation function is applied to obtain a nonlinearly transformed dimension weight vector. Then, the Softmax function is used to normalize the dimension weight vector, thus converting the dimension weights into a probability distribution such that each dimension weight value is between 0 and 1, and the sum of all dimension weights is 1. This yields the normalized dimension weight vector f. norm .

[0030] The feature dimension adaptive weighting mechanism assigns each feature dimension in the feature vector to its corresponding weight vector f. norm Multiplying them together yields the weighted eigenvector f. wg By using the nonlinear mapping of spline functions in the Kan network, the differences in highly discriminative feature dimensions can be amplified more accurately, significantly increasing the feature distance between different faces. The weighted feature vectors allow the model to focus more on feature dimensions that contribute more to face differentiation and suppress feature dimensions that contribute less. The adaptive attention mechanism enables the model to learn the importance of different feature dimensions in feature comparison, thereby improving the accuracy of face recognition.

[0031] Finally, the weighted feature vector f is... wg The system calculates the similarity between the face feature vectors and pre-stored facial feature vectors in the database, and outputs the face recognition result based on a preset similarity threshold. Specifically, assuming the feature vector of one face in the database is w=[w1,w2,...w...] n The similarity calculation specifically involves calculating the cosine similarity between two feature vectors, and the formula is as follows:

[0032] Where A is the weighted eigenvector f wg, B is the facial feature vector w in the database. n .

[0033] Set a preset similarity threshold T. If the calculated cosine similarity is greater than or equal to the similarity threshold T, it is determined that they are the same person (match successful); otherwise, it is determined that they are different people (match failed).

[0034] In the model output phase, distributed training and optimization of the softmax layer, along with buffer settings to balance resources and computation, improve model training efficiency. During training, for signal comparisons across a wide age range, a novel GAN ​​method is employed. Based on the Morph-UGATIT network, signals from different age groups are generated to construct training data for the face recognition model. This training data is then input into the face attribute detection model to identify the age of each face image. Based on the output age results, these results are fed into the corresponding age-specific dual-path face recognition models for face recognition, improving the accuracy of face comparison. Furthermore, distillation technology is used to transform the face recognition model into a lightweight network, improving the efficiency of face feature extraction and further enhancing the speed of face comparison and detection.

[0035] A method for applying a face recognition model includes the following steps: Step 1: Obtain the face image to be identified The process involves acquiring a face image to be identified, calculating its grayscale histogram, and determining the illumination intensity of the image. If the illumination intensity is determined to be below a preset threshold, a convolutional model is invoked to enhance the illumination intensity, thereby obtaining an enhanced face image and improving the ability to extract facial features in complex environments. The convolutional model is based on the original HDRNet, with some convolutions replaced by an AcBlock structure. AcBlock has an attention mechanism that adaptively monitors the illumination intensity of different regions in the image. Through training data, it learns how to enhance illumination intensity, boosting the illumination intensity of regions below the preset threshold to output an enhanced face image.

[0036] Step 2: Input the enhanced lighting image of the face into the face attribute detection model to identify the age of the face. Age is pre-divided into four stages: children (0-18 years old), youth (19-40 years old), middle-aged (40-60 years old), and elderly (60 years and above). Based on the output age results, they are input into the corresponding dual-path face recognition model for face recognition.

[0037] Step 3: The dual-path face recognition model outputs the face recognition result and determines whether the match is successful.

[0038] The above description is merely an embodiment of the present invention and does not limit the scope of patent protection. Any non-substantial changes or substitutions made by those skilled in the art based on the present invention will still fall within the scope of patent protection.

Claims

1. A method for constructing a dual-path face recognition model, wherein the dual paths refer to a first path for extracting global features of the face and a second path for extracting local detail features of the face. Specifically, different convolutional kernels are used in the convolutional layer to extract features from the face image, generating multiple feature maps of different scales. These feature maps are then input into a pooling layer to reduce their size, followed by feature fusion: an adaptive attention mechanism is used to calculate attention weights on the feature maps, which are then assigned to the feature maps to obtain fused feature maps. Finally, these fused feature maps are input into a fully connected layer to generate corresponding feature vectors. Feature vectors are then used for feature comparison, specifically by calculating the similarity between the obtained feature vectors and other feature vectors pre-stored in a database, determining the relationship between this similarity and a preset similarity threshold, and outputting the face recognition result. The method is characterized by... When performing feature comparison, an adaptive attention mechanism is used to generate attention weights for the feature vector. It assigns a corresponding attention weight to each feature dimension in the feature vector, and multiplies each feature dimension of the feature vector with the attention weight to obtain a weighted feature vector.

2. The method for constructing a face recognition model according to claim 1, characterized in that, The global features include facial contour features and the positional distribution features of the facial features; the local detail features include eye, nose, mouth and wrinkle features.

3. The method for constructing a face recognition model according to claim 1, characterized in that, The process of generating attention weights for feature vectors using an adaptive attention mechanism specifically involves using a Kan network to generate these attention weights.

4. The method for constructing a face recognition model according to claim 3, characterized in that, The Kan network receives the feature vector output by the fully connected layer as input and uses a learnable spline function as the activation function to generate corresponding attention weights for each feature dimension in the feature vector.

5. The method for constructing a face recognition model according to claim 1, characterized in that, Similarity calculation specifically includes cosine similarity calculation.

6. The method for constructing a face recognition model according to claim 1, characterized in that, In the feature fusion stage, the adaptive attention mechanism is a channel attention mechanism.

7. The method for constructing a face recognition model according to claim 1, characterized in that, Feature fusion specifically employs a channel-wise stitching method to fuse global feature maps and local detail feature maps.

8. A method for applying a face recognition model, comprising the following steps: The method involves acquiring a face image to be identified, inputting the face image into a face attribute detection model for detection, outputting the age of the face image, and inputting the face image into a face recognition model corresponding to the age for face recognition to obtain the face recognition result. The method is characterized by: after acquiring the face image to be identified, using a histogram to determine the illumination intensity of the face image; if the illumination intensity is determined to be lower than a preset illumination threshold, then calling a convolutional model to increase the illumination intensity, thereby obtaining an illuminated face image; and inputting the illuminated face image into the face recognition model as described in claim 1 for face recognition.

9. The application method of the face recognition model according to claim 8, characterized in that, The corresponding age range refers to different age stages preset according to the age range.

10. The application method of the face recognition model according to claim 8, characterized in that, The convolutional model is based on the original hdrnet, but with some convolutions replaced by AcBlock structures.