Face recognition method and device
By fusing local texture features, local directional features, and global features, the face recognition device solves the problem of low face recognition accuracy in complex environments and achieves effective recognition of faces with smaller differences.
Patent Information
- Application Number
- CN202210585473.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-27
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-05-27
AI Technical Summary
In the existing technology, face recognition algorithms have low accuracy for faces with small differences in complex environments. Traditional manual feature extraction has high noise and weak generalization ability, making it difficult to meet recognition needs in complex scenarios.
A face recognition device is used to determine the feature fusion operation of local texture features, local directional features and global features of the target face image, and combines LBP feature function, directional gradient histogram and improved neural network model to extract and fuse features to improve recognition accuracy.
The accuracy of face recognition has been improved, and it can effectively identify faces with smaller differences in complex environments, meeting the recognition needs in complex scenes.
Smart Images

Figure CN115035572B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a face recognition method and device. Background Art
[0002] Face recognition algorithms primarily acquire images through pictures or videos, perform face detection, determine the face's location and size, then extract features from the detected face and compare them with face images in a face database to ultimately identify the face. Feature extraction is a key step. Traditional algorithms primarily design local feature description operators based on various prior models, extract image key points, and generate descriptor feature data. These feature description operators include Local Binary Patterns (LBP), Scale-Invariant Feature Transform (SIFT), and Histogram of Oriented Gradients (HOG). This approach effectively extracts fine-grained local information such as facial texture and edges. However, the local features extracted by these manually designed operators contain a significant amount of noise, resulting in weak generalization capabilities and low face recognition accuracy under unrestricted conditions.
[0003] In recent years, with the development of convolutional neural networks, face recognition has broken through the defects brought by traditional manual features. It can be trained through huge data sets and obtain a relatively large visual perception through layer-by-layer convolution, thereby extracting the global features of the face and overcoming complex recognition scenarios. However, it ignores fine-grained local features such as shape and texture, and cannot solve the classification problem of faces with very small differences.
[0004] It can be seen that how to improve the accuracy of face recognition and meet the needs of face recognition with smaller differences in complex environments are technical problems that need to be solved urgently. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a face recognition method and device, which are conducive to improving the accuracy of face recognition and meeting the demand for face recognition with smaller differences in complex environments.
[0006] In order to solve the above technical problems, the first aspect of the present invention discloses a face recognition method, which is applied to a face recognition device, wherein the face recognition device is used to identify a target face image, and the method includes:
[0007] The face recognition device determines the local texture features of the target face image;
[0008] The face recognition device determines the local directional features of the target face image;
[0009] The face recognition device determines the global features of the target face image;
[0010] The face recognition device performs a feature fusion operation on the local texture features, the local directional features, and the global features to obtain target features of the target face image;
[0011] The face recognition device inputs the target feature into a classifier, and outputs a face recognition result via the classifier.
[0012] It can be seen that in the face recognition method disclosed in the first aspect of the present invention, the face recognition device inputs the target features into the classifier, and outputs the face recognition results through the classifier, wherein the target features of the target face image are obtained by performing feature fusion operations on local texture features, local directional features and global features. This is conducive to making the target face features not only have the advantages of global features that can be applied to complex recognition scenarios, but also have the advantages of local features that can be applied to solving face classification problems with small differences. This is conducive to improving the accuracy of face recognition, and is conducive to meeting the needs of face recognition with small differences in complex environments.
[0013] As an optional implementation manner, in the first aspect of the present invention, the face recognition apparatus determines the local texture features of the target face image, specifically including:
[0014] The face recognition device performs a local texture feature extraction operation on the target face image based on the LBP feature function to obtain the local texture features of the target face image, wherein the operator corresponding to the LBP feature function is an elliptical LBP operator.
[0015] As an optional implementation manner, in the first aspect of the present invention, the face recognition apparatus determines the local directional features of the target face image, specifically including:
[0016] The face recognition device determines the horizontal gradient of the target face image;
[0017] The face recognition device determines the vertical gradient of the target face image;
[0018] The face recognition device determines a directional gradient histogram of the target face image based on the horizontal gradient and the vertical gradient;
[0019] The face recognition device determines the local directional features of the target face image according to the directional gradient histogram.
[0020] As an optional implementation manner, in the first aspect of the present invention, the face recognition device determines the global features of the target face image, specifically including:
[0021] The face recognition device performs a global feature extraction operation on the target face image based on a predetermined neural network model and predetermined weight parameters of the network model to determine the global features of the target face image.
[0022] As an optional embodiment, in the first aspect of the present invention, the face recognition device performs a feature fusion operation on the local texture features, the local directional features, and the global features to obtain target features of the target face image, specifically including:
[0023] The face recognition device performs a feature fusion operation based on a linear function on the local texture features, the local direction features and the global features to determine the target features of the target face image.
[0024] As an optional embodiment, in the first aspect of the present invention, before the face recognition device performs a feature fusion operation based on a linear function on the local texture features, the local directional features, and the global features, and after the face recognition device determines the local texture features, local directional features, and global features of the target face image, the method further includes:
[0025] The face recognition device performs dimension matching processing on the local texture features, local directional features and global features, so that the dimensions of the local texture features, local directional features and global features are consistent.
[0026] As an optional embodiment, in the first aspect of the present invention, the face recognition result includes the name corresponding to the face in the target face image, and the face recognition device inputs the target features into a classifier, and outputs the face recognition result via the classifier, specifically including:
[0027] The face recognition device inputs the target feature into a fully connected neural network and converts it into a target feature vector;
[0028] The face recognition device inputs the target feature vector into a softmax classifier, so that the softmax classifier outputs the name corresponding to the face in the target face image.
[0029] As an optional embodiment, in the first aspect of the present invention, after the face recognition device performs a feature fusion operation on the local texture features, the local directional features, and the global features to obtain target features of the target face image, and before the face recognition device inputs the target features into a classifier and outputs a face recognition result via the classifier, the method further includes:
[0030] The face recognition device performs normalization processing on the target features.
[0031] As an optional embodiment, in the first aspect of the present invention, before the face recognition device determines the local texture features, local directional features, and global features of the target face image, the method further includes:
[0032] The face recognition device performs image preprocessing operations based on the illumination of the target face image.
[0033] A second aspect of the present invention discloses a face recognition device, comprising:
[0034] a memory storing executable program code;
[0035] a processor coupled to the memory;
[0036] The processor calls the executable program code stored in the memory to execute the steps of the face recognition method disclosed in the first aspect of the present invention.
[0037] It can be seen that the face recognition device disclosed in the second aspect of the present invention inputs the target features into the classifier, and outputs the face recognition results through the classifier, wherein the target features of the target face image are obtained by performing feature fusion operations on local texture features, local directional features and global features. This is beneficial for making the target face features not only have the advantages of global features that can be applied to complex recognition scenarios, but also have the advantages of local features that can be applied to solving face classification problems with small differences. This is beneficial for improving the accuracy of face recognition and for meeting the needs of face recognition with small differences in complex environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0039] Figure 1 1 is a flow chart of a face recognition method according to an embodiment of the present invention;
[0040] Figure 2 Schematic diagram of the feature extraction process of the elliptical LBP operator according to an embodiment of the present invention;
[0041] Figure 3 Schematic diagram of a process of extracting global features using a neural network according to an embodiment of the present invention;
[0042] Figure 4is a schematic diagram of a face recognition process according to an embodiment of the present invention;
[0043] Figure 5 is a graph of the loss function during the training process of the neural network model according to an embodiment of the present invention;
[0044] Figure 6 is a comparison chart of the accuracy of different models under different numbers of rounds according to an embodiment of the present invention;
[0045] Figure 7 It is a structural diagram of a face recognition device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0047] The terms "first," "second," and so on, in the description and claims of the present invention are used to distinguish between different objects, not to describe a specific order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or device comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or device.
[0048] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute a separate or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0049] See also Figure 1 , Figure 1 : is a flow chart of a face recognition method disclosed in an embodiment of the present invention. The face recognition method can be used to identify a target face image. Optionally, the target face image can be an image captured from a captured video or a captured photo. Figure 1 As shown, the face recognition method may include the following operations:
[0050] 101. A face recognition device determines local texture features of a target face image.
[0051] Optionally, in step 101, the facial recognition device performs a local texture feature extraction operation on the target facial image to determine the local texture features of the target facial image. Further optionally, the facial recognition device may perform a texture feature extraction operation on the target facial image based on an LBP feature function to obtain the local texture features of the target facial image. Further optionally, to address the shortcomings of traditional rectangular and circular LBP operators in extracting facial texture features, the operator corresponding to the LBP feature function may be an elliptical LBP operator.
[0052] Further optional, such as Figure 2 As shown in the figure, within the 3×5 elliptical window, the center pixel is used as the threshold, and the grayscale values of the 10 adjacent pixels are compared with the center pixel. If the surrounding pixel values are greater than the center pixel, the pixel point is marked as 1, otherwise it is marked as 0. The binary generated by the 10 points is then converted to decimal to obtain the LBP value of the center pixel of the window, that is, the texture information. The LBP feature function can be expressed as:
[0053]
[0054] Among them, (x c ,y c ) represents the center pixel, i p 、i c are the pixel values of the adjacent points and the pixel value of the center point respectively, and s is a composite function, which can be expressed as:
[0055]
[0056] As a further option, an elliptical 3×5 window can be used to traverse the entire target face image from left to right and from top to bottom to extract LBP features, that is, local texture features.
[0057] 102. The face recognition device determines the local directional features of the target face image.
[0058] Optionally, in step 102, the face recognition device performs a local directional feature extraction operation on the target face image to determine the local directional features of the target face image. Further optionally, the operation of extracting the local directional features of the target face image can determine the local directional features of the target face image based on the directional gradient histogram of the target face image, wherein the target image can be divided into 8×8 cells and the directional gradient histogram of each cell can be determined. Further optionally, the data corresponding to each cell can be normalized by L2, and then four cells can be formed into a unit block, and all the unit blocks can be connected in series to determine the HOG feature vector (i.e., the local directional feature).
[0059] Further optionally, the histogram of directional gradients may be determined based on the horizontal gradient and the vertical gradient of the target facial image. Specifically, the histogram of directional gradients may be determined based on the gradient magnitude and the gradient direction.
[0060] The gradient magnitude at the pixel point (x, y) can be expressed as:
[0061]
[0062] The gradient direction at the pixel point (x, y) can be expressed as:
[0063]
[0064] Among them, G x (x,y) represents the horizontal gradient at the pixel point (x,y), G y (x,y) represents the vertical gradient at the pixel point (x,y).
[0065] It is understandable that before determining the directional gradient histogram of the target face image, it is necessary to determine the horizontal gradient and vertical gradient of the target face image. Optionally, the horizontal gradient operator [-1, 0, 1] can be used to perform a dot multiplication operation on each pixel of the target image to obtain the horizontal gradient; the vertical gradient operator [1, 0, -1] can be used to perform a dot multiplication operation on each pixel of the target image to obtain the vertical gradient. Specifically, the horizontal gradient G at the pixel point (x, y) is x (x,y) can be expressed as:
[0066] G x (x,y)=H(x+1,y)-H(x-1,y)
[0067] The vertical gradient G at the pixel point (x, y) y (x,y) can be expressed as:
[0068] G y(x,y)=H(x,y+1)-H(x,y-1)
[0069] 103. The face recognition device determines the global features of the target face image.
[0070] Optionally, the face recognition device performs a global feature extraction operation on the target face image based on a predetermined neural network model and predetermined model weight parameters to determine the global features of the target face image.
[0071] Further optionally, the predetermined neural network model can be modified based on the VGG-16 network model, and the modified network model is as follows: Figure 3 Specifically, the VGG-16 network model can be modified as follows: add two convolutional layers and reduce two fully connected layers, so that each convolution module has three convolutional layers; replace the 3×3 convolution units in the last layer of each convolution module with 5×5 convolution units to obtain a larger receptive field of view; and replace the maximum pooling layer connected to each convolution module with a global average pooling layer to improve the correlation between different pixels. It is understood that the structure of the neural network model can be determined before the face recognition device performs global feature extraction on the target face image.
[0072] Further optionally, a self-made set of facial images can be used to train the neural network model, calculate the difference between the actual results and the predicted results, adjust the weight parameters based on the back-propagation neural network until the errors between the two converge, and output the weight parameters corresponding to the adjusted network model. This allows the weight parameters of the neural network model to be determined before the face recognition device performs the global feature extraction operation.
[0073] It is understood that steps 101, 102, and 103 respectively determine the image features (local texture features, local directional features, and global features) of the target facial image, and there is no necessary ordering between these three steps. Therefore, there is no restriction on the order of steps 101, 102, and 103. It should be noted that the image features determined by steps 101, 102, and 103 are related to the target facial image, and therefore, they must be performed after the target facial image is obtained.
[0074] Further optionally, before executing step 101, step 102 and step 103, the target face image can be preprocessed. Generally, since illumination (such as backlight, dark light, backlight, and strong light) is an influencing factor, it has a significant impact on the face recognition problem. Therefore, the preprocessing operation can be performed on the illumination of the target face image. Specifically, gamma correction can be used to suppress the high brightness part through nonlinear transformation and enhance the strong and dark areas of the target face image. The transformation formula is as follows:
[0075] y(x, y) = I(x, y) γ
[0076] γ is the correction coefficient, and Y(x,y) represents the grayscale value of each pixel in the corrected face image.
[0077] Usually, before performing correction based on the above formula, the target face image can be grayscale processed based on the following formula:
[0078] Gay=0.3×R+0.5×G+0.2×B
[0079] Among them, R, G, and B represent the color grayscale values of the three channels of the face image respectively.
[0080] Furthermore, the difference of Gaussian filter can be used to eliminate the lighting effect in the image. The difference of Gaussian function is constructed as follows:
[0081]
[0082] Among them, A1, A2 and σ1, σ2 are coefficient terms in the function respectively. Optionally, the values of A1 and A2 can be 1.0 and 0.8 respectively, and the values of σ1 and σ2 can be 0.5 and 0.3 respectively.
[0083] Furthermore, the difference result of the Gaussian function can be convolved with the result of the gamma correction, and the formula is as follows:
[0084] H(x,y)=G(x,y)*y(x,y)
[0085] After the above image preprocessing, the contrast of the target face image can be increased, and local face information such as texture and shape can be extracted more effectively.
[0086] 104. The face recognition device performs a feature fusion operation on the local texture features, the local directional features, and the global features to obtain target features of the target face image.
[0087] It can be understood that the target features of the target facial image are essentially fused features obtained after performing feature fusion on local texture features, local directional features and global features.
[0088] Optionally, the feature fusion operation can be performed based on a linear function. Further optionally, the target features obtained through the feature fusion operation can be normalized, which facilitates efficient execution of subsequent steps. Specifically, the following function can be constructed to fuse local texture features, local directional features, and global features based on a linear function and perform normalization. The function is as follows:
[0089] X=BatChNorm(k1x1+k2x2+k3x3)
[0090] Where X represents the target feature of the normalized face image; BatchNorm is the normalization function; x1, x2, and x3 represent local texture features, local directional features, and global features, respectively; and k1, k2, and k3 are the corresponding weights. Specifically, the values of k1, k2, and k3 can be 0.15, 0.25, and 0.6, respectively.
[0091] It can be understood that the above-mentioned operation of normalizing the target features needs to be performed after the feature fusion operation of local texture features, local directional features and global features, and before the face recognition device performs the next step of processing on the target features (that is, the step in which the face recognition device inputs the target features into the classifier).
[0092] Optionally, before step 104, the facial recognition device performs dimensionality matching on the local texture features, local directional features, and global features to ensure that the dimensions of the local texture features, local directional features, and global features are consistent. Furthermore, optionally, the dimensions of the global features can be used as a reference to perform dimensionality reduction on the local texture features and local directional features. Furthermore, optionally, the dimensions of the local texture features and local directional features can be reduced to 4096.
[0093] 105. The face recognition device inputs the target features into the classifier, and the classifier outputs the face recognition result.
[0094] Optionally, the face recognition result may be the name of the person corresponding to the face in the target face image. In addition, the predicted probability of the name may be output. For example, the face recognition result may be "Zhang San, 90%", indicating that there is a 90% probability that the name corresponding to the face in the target face image is Zhang San.
[0095] Optionally, the classifier may be a softmax classifier. Furthermore, the target feature may be input into a fully connected neural network, converted into a target feature vector, and then the target feature vector may be input into the softmax classifier. Specifically, the target feature may be converted into a 1024-dimensional target feature vector through a fully connected neural network, and the feature vector may output a face recognition result through a softmax function. This process may be expressed by the following formula:
[0096] y=softmax(WX+b)
[0097] Among them, W is the network parameter of the fully connected neural network, X is the target feature vector, b is the learning weight, softmax is the classification function, and y represents the result of face recognition.
[0098] It can be seen that in the face recognition method of the embodiment of the first aspect of the present invention, the face recognition device inputs the target features into the classifier, and outputs the face recognition results through the classifier, wherein the target features of the target face image are obtained by performing feature fusion operations on local texture features, local directional features and global features. This is beneficial for making the target face features not only have the advantages of global features that can be applied to complex recognition scenarios, but also have the advantages of local features that can be applied to solving face classification problems with small differences. This is beneficial for improving the accuracy of face recognition and for meeting the needs of face recognition with small differences in complex environments.
[0099] In a specific application scenario of this face recognition method, the target face image processing process can refer to Figure 4 The main details of the implementation process can be referred to the following aspects.
[0100] (1) Based on the original VGG-16 network structure, by deleting the last two fully connected layers and adding two convolutional layers, each convolutional module has three convolutional layers, and the other layers maintain the same structure as the original VGG-16. The improved neural network model is as follows Figure 4 shown.
[0101] (2) The last 3×3 convolution kernel of each convolution module is replaced with a 5×5 convolution kernel to improve the perception field of view and obtain global features with a larger field of view.
[0102] (3) The maximum pooling after each convolution module is modified to global average pooling to improve the correlation between different pixels.
[0103] (4) The face image dataset contains 14,268 face images, and the data is divided into training set and test set according to the 6:4 principle.
[0104] (5) The custom face dataset is preprocessed before model training. Each image is first illuminated to improve the image quality, and then randomly cropped to a size of 224×224×3.
[0105] (6) In the model training layer, the cross entropy loss function is used and the initial learning rate is set to 1×10 -5 , the number of training rounds is 80,000 rounds, and the loss function reaches stability at 50,000 rounds. The corresponding loss function curve is as follows Figure 5 shown.
[0106] (7) After training is completed, save the weight file.
[0107] (8) In actual use, the weight file obtained by training can be used to recognize faces. The recognition process is as follows: Figure 6 shown.
[0108] (9) Capture a facial image from the video stream and perform illumination processing on the facial image to further extract local features of texture and shape.
[0109] (10) Input the image after illumination processing into the improved LBP feature description operator (such as Figure 7 As shown in Figure 2), local texture features are obtained and the texture features are reduced to 4096 dimensions.
[0110] (11) The image after illumination processing is input into the HOG feature description operator to obtain local directional features, and the dimensionality of the local directional features is reduced to 4096.
[0111] (12) The image after illumination processing is input into the modified VGG-16 network model (i.e., the network model shown in Figure X), the weight file obtained after training is loaded, the global features of the face are extracted, and the dimension is reduced to 4096 through the last full connection.
[0112] (13) The local texture features, local directional features and global features are fused using a linear function, and the fused features are normalized using the BatchNorm function.
[0113] (14) The fused features are further passed through the fully connected layer, the dimension is reduced to 1024, and then input into the classification function softmax to discriminate the category of the face and output the face recognition result.
[0114] like Figure 6As shown, the performance of the modified network model based on the VGG-16 model structure involved in the present invention (i.e., the improved VGG-16 weighted fusion model in the figure) can be clearly demonstrated. Specifically, when the number of training rounds is the same, by comparing the accuracy of different models, it can be seen that the improved VGG-16 weighted fusion model is superior; when the number of training rounds reaches 80,000 rounds, the accuracy of each model exceeds 90%, and among them, the improved VGG-16 weighted fusion model has an accuracy of 98.86%, which is relatively high.
[0115] See also Figure 7 , Figure 7 This is a face recognition device disclosed in the second embodiment of the present invention. Figure 7 As shown, the face recognition device may include:
[0116] A memory 701 storing executable program code;
[0117] a processor 702 coupled to the memory 701;
[0118] Furthermore, it may also include an input interface 703 and an output interface 704 coupled to the processor 702;
[0119] The processor 702 calls the executable program code stored in the memory 701 to execute the steps of the face recognition method disclosed in the embodiment of the first aspect of the present invention.
[0120] It can be seen that the face recognition device of the second aspect of the embodiment of the present invention inputs the target features into the classifier, and outputs the face recognition results through the classifier, wherein the target features of the target face image are obtained by performing feature fusion operations on local texture features, local directional features and global features. This is beneficial for making the target face features not only have the advantages of global features that can be applied to complex recognition scenarios, but also have the advantages of local features that can be applied to solving face classification problems with small differences. This is beneficial for improving the accuracy of face recognition and for meeting the needs of face recognition with small differences in complex environments.
[0121] The third aspect of the present invention discloses a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program enables a computer to execute the steps of the face recognition method disclosed in the first aspect of the present invention.
[0122] The fourth aspect embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps of the face recognition method disclosed in the first aspect embodiment of the present invention.
[0123] The device embodiments described above are merely illustrative. Modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0124] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus the necessary general hardware platform, or of course, by means of hardware. Based on this understanding, the above technical solution, in essence, or the portion that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, including a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.
[0125] Finally, it should be noted that the face recognition method and device disclosed in the embodiments of the present invention are only preferred embodiments of the present invention, and are only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A face recognition method, applied to a face recognition device, wherein: The face recognition device is used to identify a target face image, and the method includes: The face recognition device determines the local texture features of the target face image; The face recognition device determines the local directional features of the target face image; The face recognition device determines the global features of the target face image; The face recognition device performs a feature fusion operation on the local texture features, the local directional features, and the global features to obtain the target features of the target face image, specifically comprising: the face recognition device performs a feature fusion operation on the local texture features, the local directional features, and the global features based on a linear function to determine the target features of the target face image; The face recognition device normalizes the target features, and the function is as follows: X=BatchNorm(k1x1+k2x2+k3x3), where X represents the target features of the target face image after normalization; BatchNorm is a normalization function; x1, x2, and x3 represent the local texture features, the local directional features, and the global features, respectively; k1, k2, and k3 are corresponding weights; The face recognition device inputs the target feature into a classifier, and outputs a face recognition result via the classifier: The face recognition result includes the name corresponding to the face in the target face image. The face recognition device inputs the target features into a classifier, and outputs the face recognition result via the classifier, specifically including: The face recognition device inputs the target feature into a fully connected neural network and converts it into a target feature vector; The face recognition device inputs the target feature vector into a softmax classifier, so that the softmax classifier outputs the name corresponding to the face in the target face image; The face recognition device determines the global features of the target face image, specifically including: The face recognition device performs a global feature extraction operation on the target face image based on a predetermined neural network model and predetermined weight parameters of the network model to determine the global features of the target face image; The predetermined neural network model is modified based on the VGG-16 network model, and the following modifications are made to the VGG-16 network model: 2 convolutional layers are added and 2 fully connected layers are reduced so that each convolution module has 3 convolutional layers; the 3×3 convolution unit of the last layer of each convolution module is replaced with a 5×5 convolution unit; the maximum pooling layer connected to each convolution module is changed to a global average pooling layer.
2. The face recognition method according to claim 1, characterized in that The face recognition device determines the local texture features of the target face image, specifically including: The face recognition device performs a local texture feature extraction operation on the target face image based on the LBP feature function to obtain the local texture features of the target face image, wherein the operator corresponding to the LBP feature function is an elliptical LBP operator.
3. The face recognition method according to claim 1, characterized in that The face recognition device determines the local directional features of the target face image, specifically including: The face recognition device determines the horizontal gradient of the target face image; The face recognition device determines the vertical gradient of the target face image; The face recognition device determines a directional gradient histogram of the target face image based on the horizontal gradient and the vertical gradient; The face recognition device determines the local directional features of the target face image according to the directional gradient histogram.
4. The face recognition method according to claim 1, characterized in that Before the face recognition device performs a feature fusion operation on the local texture features, the local directional features, and the global features based on a linear function, and after the face recognition device determines the local texture features, the local directional features, and the global features of the target face image, the method further includes: The face recognition device performs dimension matching processing on the local texture features, local directional features and global features, so that the dimensions of the local texture features, local directional features and global features are consistent.
5. The face recognition method according to claim 1, wherein: Before the face recognition device determines the local texture features, local directional features, and global features of the target face image, the method further includes: The face recognition device performs image preprocessing operations based on the illumination of the target face image.
6. A face recognition device, characterized in that: include: a memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the steps of the face recognition method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Face recognition method based on adaptive weighting and local characteristic fusion
CN106599870A
A method and a system for face recognition
CN107209864A
Feature extraction method and apparatus, computer program, storage medium and electronic device
CN108229302A
Expression recognition method and device
CN109446980A
Facial expression recognition method and device based on CNN-Transform
CN113887487A