A face recognition method
Through face detection and quality judgment, the recognition threshold is adaptively adjusted to eliminate poor quality face images, solving the recognition efficiency and accuracy problems of the existing technology in poor light and environment, achieving efficient and accurate face recognition, and saving system resources.
Patent Information
- Application Number
- CN202111461533.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-02
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2041-12-02
AI Technical Summary
In the case of poor light, environment and face quality, existing facial recognition technology is difficult to ensure recognition efficiency and accuracy, and occupies a lot of system resources.
Through face detection, quality judgment, environmental quality judgment and optimization, the recognition threshold is adaptively adjusted to eliminate face images with poor quality, save system resources, and improve recognition accuracy.
In different light sources and scenarios, the accuracy and efficiency of facial recognition are improved, system resources are saved, and the best performance of the system is ensured.
Smart Images

Figure CN114155590B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of artificial intelligence, and in particular relates to a face recognition method. Background Art
[0002] Face recognition is a technology that uses facial feature information to identify people. Currently, face recognition technology is widely used in security-related identity authentication fields, such as face attendance, face unlocking, and face payment. Face recognition equipment extracts and compares a series of features of faces, all of which are completed at the terminal. However, the performance of terminal processing face recognition is limited. Terminal devices are often limited by factors such as the environment, optical fiber, face occlusion, motion blur, and camera angle, resulting in unstable image quality when collecting face images, making it difficult to ensure the efficiency or accuracy of face recognition, and real-time detection and recognition occupy a large amount of system resources.
[0003] The invention patent with patent number 201710810714.2 discloses a face recognition method. First, it determines whether the same person is in the same video stream based on coordinate transformation; then Gaussian filtering is performed based on the pixel positions of the same person in different images, and then sharpening and edge detection are performed, and cross-comparison is used to determine whether the people in the video stream are the same person.
[0004] The invention patent with patent number 201310748379.X discloses a face recognition method. First, the captured face image is input into the computer, and the Retinex algorithm is used to calculate the degree to which the face image is affected by light, and the brightness value of the face image is adjusted according to the degree of influence. Then, the active appearance model is used to extract the face feature attributes, and then the self-organizing neural network and rough set reduction algorithm are used to simplify the face feature attributes. The simplified attribute data is used to train a support vector machine classifier, and finally the trained support vector machine classifier is used to analyze the face image to be recognized. Summary of the invention
[0005] The purpose of the present invention is to provide a face recognition method.
[0006] The method of the present invention first performs face detection, then face quality judgment, environment quality judgment, face optimization, and finally face recognition. The specific method is:
[0007] Step (1) performs face detection on the image to be analyzed; specifically:
[0008] (1-1) First, an image to be detected is acquired from an image sensor;
[0009] (1-2) Send the image to the face detection neural network model to obtain the face image I, the coordinates of the facial features, and the confidence C;
[0010] Step (2) analyzes the face image I, the coordinates of the facial features, and the confidence C, and obtains the face quality score S through fuzzy evaluation, confidence evaluation, frontality evaluation, facial features quality evaluation, and brightness evaluation; specifically:
[0011] (2-1) Normalize the face image I and calculate the square of the horizontal gradient and the vertical gradient Q1 to obtain the fuzzy evaluation score S1:
[0012] H is the height of the face image, W is the width of the face image, and (i, j) is the coordinate of pixel point I in the face image.
[0013] Calculate fuzzy evaluation score T1 is the fuzzy evaluation coefficient configured by the user, 5≤T1≤10. The larger the configured T1, the stricter the fuzzy judgment condition.
[0014] (2-2) Obtain confidence evaluation score S2 through confidence C: If C>T2 H , then S2=1; if T2 M <C≤T2 H , then S2=0.9; if T2 L ≤C≤T2 M , then S2=0.8; if C<T2 L , then S2=0.7; T2 H 、T2 M 、T2 L The confidence evaluation threshold configured by the user, and 1 ≥ T2 H >T2 M >T2 L ≥0.1.
[0015] (2-3) The frontal face evaluation score S3 is obtained by using the left and right face images of the face image I:
[0016] First, the face image I is equally divided from the middle to obtain the left face image L and the right face image R. Histogram statistics are performed on L and R respectively, and N gray levels are counted to obtain N-segment histogram statistics sets H_L[n] and H_R[n], where n=1,2,L,N, and N=256;
[0017] Calculate the square of the difference between H_L[n] and H_R[n]
[0018] Then calculate the face degree evaluation score T3 is the frontal face evaluation coefficient configured by the user, 1≤T3≤4. The larger the configured T3 is, the stricter the frontal face judgment condition is.
[0019] (2-4) Through the coordinates of the five sense organs, the five sense organ evaluation score S4 is obtained:
[0020] The distance from the center of the left eye to the center of the right eye The distance from the center of the left eye to the center of the mouth The distance from the center of the right eye to the center of the mouth (a1,b1), (a2,b2), (a3,b3) are the coordinates of the center points of the left eye, right eye, and mouth respectively.
[0021] Five senses evaluation score MAX(·,·) means taking the maximum value, |·| means taking the absolute value, The facial features evaluation coefficient configured by the user, Configuration The bigger it is, the stricter the criteria for judging facial features become.
[0022] (2-5) Obtain the brightness evaluation score through the face image I θ is the brightness evaluation coefficient configured by the user, 0≤θ≤100. The larger the configured θ is, the more stringent the lighting judgment condition is.
[0023] (2-6) Face quality score
[0024] Step (3) obtains the gain value ISO of the camera sensor, and obtains the environmental gain weight w according to the gain value ISO and the weight coefficient configured by the user; specifically:
[0025] (3-1) Get the gain value ISO of the camera sensor;
[0026] (3-2) Calculation of environmental gain weight Where e is the natural base, β is the weight coefficient configured by the user, 0.1≤β≤1, and the larger the β configuration, the greater the weight distribution.
[0027] Step (4) selects the face for recognition based on the face quality score and the environmental gain weight; specifically:
[0028] (4-1) First judgment: If Perform face recognition processing; if A second determination is made; if Then ignore this image and collect the next image; Thresholds set by the user, The larger the setting, the stricter the primary judgment condition.
[0029] (4-2) Secondary determination: If It is determined that the face is clear excluding environmental factors and face recognition is performed; if If the image is determined to be a blurred image, this image will be ignored and the next image will be collected.
[0030] The method of the present invention fully considers the conditions of light, face blur, etc., and ensures that the method can be used under different light sources and scenes. By judging the quality of the face and the environment, the recognition threshold can be adaptively adjusted, thereby avoiding the situation where the face cannot be correctly recognized under the same threshold in scenes where the face is blurred or the environment is relatively harsh, resulting in a low face recognition rate. The method of the present invention excludes faces of poor quality and blur through threshold restrictions, thereby saving system resources for face recognition with huge computational load, and achieving optimal system performance. Through this method of the present invention, adaptive face recognition can be adjusted according to the actual use scenario of the camera and for different image problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a schematic flow chart of the method of the present invention;
[0032] Figure 2 It is a schematic diagram of an environmental quality weight coefficient curve of an embodiment of the present invention. DETAILED DESCRIPTION
[0033] like Figure 1 As shown, a face recognition method first performs face detection, then face quality judgment, environment quality judgment, face optimization, and finally face recognition. The specific method is:
[0034] Step (1) performs face detection on the image to be analyzed; specifically:
[0035] (1-1) First, an image to be detected is acquired from an image sensor;
[0036] (1-2) Send the image to the face detection neural network model to obtain the face image I, the coordinates of the facial features, and the confidence C;
[0037] The face detection neural network model refers to the AI module that searches for facial information and related information. It belongs to the existing open source technology, such as the MTCNN network model. There are also algorithms from different algorithm manufacturers. Here it refers to the neural network algorithm model used by the device.
[0038] Step (2) analyzes the face image I, the coordinates of the facial features, and the confidence C, and obtains the face quality score S through fuzzy evaluation, confidence evaluation, frontality evaluation, facial features quality evaluation, and brightness evaluation; specifically:
[0039] (2-1) Normalize the face image I and calculate the square of the horizontal gradient and the vertical gradient Q1 to obtain the fuzzy evaluation score S1:
[0040] H is the height of the face image, W is the width of the face image, and (i, j) is the coordinate of pixel point I in the face image.
[0041] Calculate fuzzy evaluation score T1 is a fuzzy evaluation coefficient configured by the user, 5≤T1≤10. The larger the configured T1, the stricter the fuzzy judgment condition. This embodiment adopts T1=7.
[0042] (2-2) Obtain confidence evaluation score S2 through confidence C: If C>T2 H , then S2=1; if T2 M <C≤T2 H , then S2=0.9; if T2 L ≤C≤T2 M , then S2=0.8; if C<T2 L , then S2=0.7; T2 H 、T2 M 、T2 L The confidence evaluation threshold configured by the user, and 1 ≥ T2 H >T2 M >T2 L ≥0.1. This embodiment adopts T2 H =0.99, T2 M =0.95, T2 L =0.90.
[0043] (2-3) The frontal face evaluation score S3 is obtained by using the left and right face images of the face image I:
[0044] First, the face image I is divided equally from the middle to obtain the left face image L and the right face image R. Histogram statistics are performed on L and R respectively, and N gray levels are counted to obtain N-segment histogram statistics sets H_L[n] and H_R[n], n=1,2,L,N, N=256; calculate the square of the difference between H_L[n] and H_R[n]
[0045] Then calculate the face degree evaluation score T3 is a frontal face evaluation coefficient configured by the user, 1≤T3≤4, the larger the configured T3, the stricter the frontal face judgment condition. This embodiment adopts T3=2.5.
[0046] (2-4) Through the coordinates of the five sense organs, the five sense organ evaluation score S4 is obtained:
[0047] The distance from the center of the left eye to the center of the right eye The distance from the center of the left eye to the center of the mouth The distance from the center of the right eye to the center of the mouth (a1,b1), (a2,b2), (a3,b3) are the coordinates of the center points of the left eye, right eye, and mouth respectively.
[0048] Five senses evaluation score MAX(·,·) means taking the maximum value, |·| means taking the absolute value, The facial features evaluation coefficient configured by the user, Configuration The larger the value, the stricter the facial features judgment condition.
[0049] (2-5) Obtain the brightness evaluation score through the face image I θ is a brightness evaluation coefficient configured by the user, 0≤θ≤100, the larger the configured θ is, the stricter the illumination judgment condition is. In this embodiment, θ=20 is used.
[0050] (2-6) Face quality score
[0051] Step (3) obtains the gain value ISO of the camera sensor, and obtains the environmental gain weight w according to the gain value ISO and the weight coefficient configured by the user; specifically:
[0052] (3-1) Get the gain value ISO of the camera sensor;
[0053] (3-2) Calculation of environmental gain weight Where e is the natural base, β is the weight coefficient configured by the user, 0.1≤β≤1, the larger the β configuration, the greater the weight allocation. This embodiment adopts β=0.2, and the environmental quality weight coefficient curve is as follows Figure 2 As shown, the horizontal axis is ISO and the vertical axis is w.
[0054] Step (4) selects the face for recognition based on the face quality score and the environmental gain weight; specifically:
[0055] (4-1) First judgment: If Perform face recognition processing; if A second determination is made; if Then ignore this image and collect the next image; Thresholds set by the user, The larger the setting, the stricter the primary judgment condition.
[0056] (4-2) Secondary determination: If It is determined that the face is clear excluding environmental factors and face recognition is performed; if If the image is determined to be a blurred image, this image will be ignored and the next image will be collected.
[0057] The method of the present invention fully considers the conditions of light, face blur, etc., and ensures that the method can be used in different light sources and scenes. By judging the quality of the face and the environment, the recognition threshold can be adjusted adaptively, avoiding the situation where the face cannot be correctly recognized under the same threshold in scenes with blurry faces and relatively bad environments, resulting in low face recognition rates. And through the secondary selection method, the accuracy of face recognition is further improved.
[0058] By limiting the threshold, poor quality and blurred faces are excluded, thereby saving system resources for face recognition with huge computational load, while ensuring the recognition rate, making the system performance optimal. Through this method of the present invention, adaptive face recognition can be adjusted according to the actual use scenario of the camera and for different image problems.
[0059] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be considered as the scope of protection of the present invention.
Claims
1. A face recognition method, characterized in that: The method is as follows: Step (1) performs face detection on the image to be analyzed; specifically: (1-1) First, an image to be detected is acquired from an image sensor; (1-2) Send the image to the face detection neural network model to obtain the face image I, the coordinates of the facial features, and the confidence C; Step (2) analyzing the face image I, the coordinates of the facial features, and the confidence C, and obtaining a face quality score S through fuzzy evaluation, confidence evaluation, frontality evaluation, facial features quality evaluation, and brightness evaluation; Specifically: (2-1) Normalize the face image I and calculate the square of the horizontal gradient and the vertical gradient Q1 to obtain the fuzzy evaluation score S1: H is the height of the face image, W is the width of the face image, (i, j) is the coordinates of pixel point I in the face image; Calculate fuzzy evaluation score T1 is the fuzzy evaluation coefficient configured by the user; (2-2) Obtain confidence evaluation score S2 through confidence C: If C>T2 H , then S2=1; if T2 M <C≤T2 H , then S2=0.9; if T2 L ≤C≤T2 M , then S2=0.8; if C<T2 L , then S2=0.7; T2 H 、T2 M 、T2 L Confidence evaluation thresholds configured by the user; (2-3) The frontal face evaluation score S3 is obtained by using the left and right face images of the face image I: First, the face image I is equally divided from the middle to obtain the left face image L and the right face image R. Histogram statistics are performed on L and R respectively, and N gray levels are counted to obtain N-segment histogram statistics sets H_L[n] and H_R[n], where n=1,2,L,N, and N=256; Calculate the square of the difference between H_L[n] and H_R[n] Then calculate the face degree evaluation score T3 is the frontal face evaluation coefficient configured by the user; (2-4) Obtain the facial features evaluation scores through the facial features coordinates MAX(·,·) means taking the maximum value, |·| means taking the absolute value, Facial features evaluation coefficients configured for users; Among them, the distance from the center point of the left eye to the center point of the right eye The distance from the center of the left eye to the center of the mouth The distance from the center of the right eye to the center of the mouth (a1,b1), (a2,b2), (a3,b3) are the coordinates of the center of the left eye, the center of the right eye, and the center of the mouth respectively; (2-5) Obtain the brightness evaluation score through the face image I θ is the brightness evaluation coefficient configured by the user; (2-6) Face quality score Step (3) obtains the gain value ISO of the camera sensor, and obtains the environmental gain weight w according to the gain value ISO and the weight coefficient configured by the user; specifically: (3-1) Get the gain value ISO of the camera sensor; (3-2) Calculation of environmental gain weight Where e is the natural base, and β is the weight coefficient configured by the user; Step (4) selects the face for recognition based on the face quality score and the environmental gain weight; specifically: (4-1) First judgment: If Perform face recognition processing; if A second determination is then made; if Then ignore this image and collect the next image; Thresholds set for users; (4-2) Secondary determination: If It is determined that the face is clear excluding environmental factors and face recognition is performed; if If the image is determined to be a blurred image, this image will be ignored and the next image will be collected.
2. A face recognition method as claimed in claim 1, characterized in that: In (2-1), 5≤T1≤10, the larger the configuration T1 is, the stricter the fuzzy judgment condition is.
3. A face recognition method as claimed in claim 1, characterized in that: In (2-2), 1≥T2 H >T2 M >T2 L ≥0.1。 4. A face recognition method as claimed in claim 1, characterized in that: In (2-3), 1≤T3≤4, the larger the configuration T3 is, the stricter the front face judgment condition is.
5. A face recognition method as claimed in claim 1, characterized in that: In (2-4), Configuration The bigger it is, the stricter the criteria for judging facial features become.
6. A face recognition method as claimed in claim 1, characterized in that: In (2-5), 0≤θ≤100, the larger the configuration θ is, the more stringent the illumination judgment condition is.
7. A face recognition method as claimed in claim 1, characterized in that: In (3-2), 0.1≤β≤1, the larger the β configuration, the larger the weight allocation.
8. A face recognition method as claimed in claim 1, characterized in that: In (4-1), The larger the setting, the stricter the primary judgment condition.
Citation Information
Patent Citations
Face recognition method
CN104008364A
Facial recognition methods
CN108491750B
An image quality judgment method and a robot face recognition system
CN109215010A
Face quality evaluation method based on SVM
CN111881732A