Face recognition method and device based on AI, computer equipment and storage medium

By calculating the geometric relationship between facial feature points in the face image, obtaining the head posture angle, and performing posture correction on the face image, the problem of inaccurate recognition caused by different facial postures in video recognition is solved, and the accuracy and user experience of recognition are improved.

CN119785404APending Publication Date: 2025-04-08SHENZHEN COOCAA NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411892016.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

When existing video recognition technologies use different face postures during video playback, they often fail to accurately recognize faces, resulting in inaccurate recognition.

Method used

By collecting facial feature points in the left and right eyes, nose, and left and right mouth corners in the face image, the geometric relationship between these feature points is used to calculate the pitch angle, yaw angle and rolling angle of the head posture, and then posture correction is performed on the face image and face recognition is performed.

Benefits of technology

It improves the accuracy of face recognition, can effectively handle face recognition of different head postures, and improves the user's sense of use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119785404A_ABST
    Figure CN119785404A_ABST
Patent Text Reader

Abstract

The invention discloses an AI-based face recognition method and device, computer equipment and a storage medium. According to the scheme, the method comprises the following steps: collecting facial feature points of left and right eyes, a nose and left and right mouth corners in a face image; calculating a pitch angle, a yaw angle and a roll angle of the head attitude by using the geometrical relationship between the facial feature points so as to obtain calculation results of different head attitudes; and according to the calculation results of the different head postures, performing posture correction on the face image, and performing face recognition on the face after posture correction. According to the method, different head postures are calculated by extracting the facial feature points, proper posture correction is performed on the human faces with different head postures by calculating the head postures, and the corrected pictures are recognized, so that the accuracy of human face recognition is improved, and the use feeling of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of AI-based face recognition, and in particular to a method of AI-based face recognition. Background Art With the continuous advancement of artificial intelligence and computer vision technology, when watching videos on mobile terminals, faces in video playback can now be directly recognized. However, in the current video recognition technology, the screen in the video is captured, the TV screen is saved as a picture, and then the face in the picture is recognized. However, the postures of faces in video playback are different, and it is not necessarily possible to capture the front face for recognition. Therefore, the problem of inaccurate face recognition often occurs. Therefore, a face recognition method is urgently needed to solve the above-mentioned problem of inaccurate face recognition. Summary of the invention

[0002] The embodiments of the present invention provide an AI-based face recognition method, apparatus, computer equipment and storage medium to solve the AI-based face recognition problem.

[0003] In a first aspect, a face recognition method based on AI is provided, comprising: Collect facial feature points of left and right eyes, nose, left and right corners of mouth in face images; Calculating the pitch angle, yaw angle and roll angle of the head posture using the geometric relationship between the facial feature points, so as to obtain calculation results of different head postures; According to the calculation results of the different head postures, posture correction is performed on the face image, and face recognition is performed on the face after posture correction.

[0004] Optionally, the calculation result of the pitch angle head posture includes: Calculate the Y coordinate of the horizontal reference based on the left and right eye center coordinates; Calculate the vertical distance from the nose tip coordinate to the Y coordinate of the horizontal reference and the horizontal distance between the left and right eyes; An arc tangent function is used to calculate a radian value according to the ratio of the vertical distance to the horizontal distance, and the radian value is converted into a pitch angle value of the head posture.

[0005] Optionally, the calculation result of the yaw angle head posture includes: Calculate the horizontal distance from the nose tip coordinates to the midpoints of the left and right eyes, as well as the distance between the midpoints of the left and right eyes; The arc tangent function is used to calculate the radian value according to the ratio of the distance from the nose tip coordinate to the midpoints of the left and right eyes in the horizontal direction and the distance between the midpoints of the left and right eyes, and the radian value is converted into the yaw angle value of the head posture.

[0006] Optionally, the calculation result of the roll angle head posture includes: Calculate the length of the line connecting the left and right eyes; Calculate half of the difference in vertical distance between the left and right mouth corners as the vertical offset; The arc value is calculated according to the ratio of the vertical offset and half the length of the line connecting the left and right eyes by an inverse tangent function, and the arc value is converted into a rolling angle value of the head posture.

[0007] Optionally, performing posture correction on the face image according to the calculation results of the different head postures, and performing face recognition on the face after posture correction, includes: Determining whether the calculation result of the head posture is within a target threshold; If the calculation result of the head posture is within the target threshold, performing angle correction and normalization processing on the face image to obtain a standard posture of the face image after correction; The face image of the standard posture is recognized.

[0008] Optionally, the collecting of facial feature points of left and right eyes, nose, and left and right corners of mouth in the face image may then include: Obtaining the head posture of the pitch angle, yaw angle and roll angle according to the acquired facial key feature points; A face training data set is established using the head postures at different angles, and a face recognition model is trained.

[0009] Optionally, the training of the face recognition model includes: The face image and the corresponding key facial feature points are input into a face training data set, and the pitch angle, yaw angle and roll angle of the head posture are annotated during the training stage so that the face recognition model can recognize different head postures.

[0010] In a second aspect, an AI-based face recognition device is provided, comprising: An acquisition module is used to collect facial feature points of left and right eyes, nose, and left and right corners of mouth in a face image; A calculation module, used to calculate the pitch angle, yaw angle and roll angle of the head posture using the geometric relationship between the facial feature points, so as to obtain a calculation result of the head posture; The recognition module is used to perform posture correction on the face image according to the calculation result of the head posture, and perform face recognition on the face after the posture correction.

[0011] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned AI-based face recognition method when executing the computer program.

[0012] According to a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned AI-based face recognition method is implemented.

[0013] In one solution implemented by the above-mentioned AI-based face recognition method, device, computer equipment and storage medium, facial feature points of the left and right eyes, nose, left and right corners of the mouth are collected in the face image; the pitch angle, yaw angle and roll angle of the head posture are calculated using the geometric relationship between the facial feature points to obtain the calculation results of different head postures; according to the calculation results of the different head postures, the face image is posture corrected, and face recognition is performed on the face after posture correction. This application calculates different head postures by extracting facial feature points, performs appropriate posture correction on faces with different head postures by calculating the head posture, and recognizes the corrected images to improve the accuracy of face recognition and enhance the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0015] Figure 1 This is a schematic diagram of an application environment of an AI-based face recognition method in one embodiment of the present invention; Figure 2 is a flow chart of a face recognition method based on AI in one embodiment of the present invention; Figure 3 is another flow chart of an AI-based face recognition method in one embodiment of the present invention; Figure 4 is another flow chart of an AI-based face recognition method in one embodiment of the present invention; Figure 5 is another flow chart of an AI-based face recognition method in one embodiment of the present invention; Figure 6 is another flow chart of an AI-based face recognition method in one embodiment of the present invention; Figure 7is another flow chart of an AI-based face recognition method in one embodiment of the present invention; Figure 8 is a schematic diagram of an AI-based face recognition device in one embodiment of the present invention; Fig. 9 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0016] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0017] It is worth noting that the data and features obtained in the process of facial image recognition based on facial feature points in this application are obtained under the premise of user authorization, and the technical solutions provided by this application are legally implemented.

[0018] The AI-based face recognition method provided by the embodiment of the present invention can be applied as follows: Figure 1 Specifically, the AI-based face recognition method is applied in an AI-based face recognition system, and the AI-based face recognition system includes: Figure 1 The mobile terminal and server shown in the figure communicate with the server through a network, and are used to collect facial feature points of the left and right eyes, nose, and left and right corners of the mouth in the face image; use the geometric relationship between the facial feature points to calculate the pitch angle, yaw angle, and roll angle of the head posture, so as to obtain the calculation results of different head postures; according to the calculation results of the different head postures, perform posture correction on the face image, and perform face recognition on the face after posture correction. The present application calculates different head postures by extracting facial feature points, performs appropriate posture correction on faces with different head postures by calculating the head posture, and recognizes the corrected pictures to improve the accuracy of face recognition and enhance the user's sense of use. Among them, the mobile terminal is also called the user terminal, which refers to a program corresponding to the server and providing local services to customers. The mobile terminal can be installed on, but not limited to, various personal computers, laptops, smart phones, and tablet devices. The server can be implemented with an independent server or a server cluster consisting of multiple servers.

[0019] The AI-based face recognition method provided by the embodiment of the present invention can be applied to the fields of human-computer interaction, security monitoring, liveness detection, education, autonomous driving, and other fields that require face recognition. In the field of human-computer interaction, head posture recognition can be used to achieve more natural and intuitive human-computer interaction, such as controlling home appliances through nodding, shaking the head, and other actions; or using head movements in games to control the game perspective to increase the interactivity and playability of the game; in the field of security monitoring, it can be used to detect the head posture of the crowd for abnormal behavior detection, such as in public places, to identify whether a person has abnormal behaviors such as long-term head lowering or sudden head turning, to assist security personnel and In the field of liveness detection, it can effectively prevent the face recognition system from being deceived by forged face images by judging whether the face is real rather than a still photo or a copy through actions such as lowering the head or shaking the head, thereby improving safety and accuracy; in the field of education, it can be used in classroom teaching or distance learning to monitor the head posture of students, judge whether the students are focused, and provide teaching feedback to teachers so that they can adjust teaching strategies in time and improve teaching effectiveness; in the field of autonomous driving, it can identify the driver's head posture, assist in judging his attention state and whether he is driving fatigued, and issue an alarm in time when the head frequently droops or deviates to one side, thereby improving driving safety. The face recognition method can be applied simultaneously in different fields where face recognition is required, including but not limited to the application scenarios mentioned above. The following is a detailed description of the AI-based face recognition method provided by the present invention through various embodiments.

[0020] In one embodiment, if Figure 2 As shown, a face recognition method based on AI is provided, and the method is applied in Figure 1 The server in the example is used as an example to illustrate the process, including the following steps: S10: Collect facial feature points of left and right eyes, nose, and left and right corners of mouth in the face image; S20: Calculating the pitch angle, yaw angle, and roll angle of the head posture using the geometric relationship between the facial feature points, so as to obtain calculation results of different head postures; S30: performing posture correction on the face image according to the calculation results of the different head postures, and performing face recognition on the face after the posture correction.

[0021] In this embodiment, the AI-based face recognition method provided in this application can be applied to all fields based on the collection and promotion of face recognition technology. Specifically, in this embodiment, facial feature points of the face can be acquired by collecting and playing videos, monitoring images, etc. that can scan facial features of the face. The acquisition method can be a mobile terminal device with a camera function, or a mobile terminal device with video playback capability. The specific method for acquiring the face image is not limited.

[0022] In the present application, by obtaining the facial feature points of the human face, that is, obtaining the positions of the five facial feature points of the left and right eyes, the nose, and the left and right corners of the mouth, according to the geometric relationship between the facial feature points, by calculating the pitch angle, yaw angle and roll angle of different head postures, the face angle is predicted, and based on the calculation results of the head posture, the face image is posture corrected, and the face image after posture correction is recognized.

[0023] In an embodiment of the present application, facial feature points of the left and right eyes, nose, and left and right corners of the mouth in a facial image are collected, and the pitch angle, yaw angle, and roll angle of the head posture are calculated using the geometric relationship between the facial feature points to obtain calculation results of different head postures; according to the calculation results of the different head postures, the facial image is posture corrected, and face recognition is performed on the face after posture correction, and the non-frontal facial image is converted into a frontal facial image, which greatly improves the recognition accuracy.

[0024] In one embodiment, if Figure 3 As shown, a face recognition method based on AI is provided. In step S20, the calculation result of the pitch angle head posture includes the following steps: S21: Calculate the Y coordinate of the horizontal reference according to the center coordinates of the left and right eyes; S22: Calculate the vertical distance from the nose tip coordinate to the Y coordinate of the horizontal reference and the horizontal distance between the left and right eyes; S23: using an inverse tangent function to calculate a radian value according to a ratio of the vertical distance to the horizontal distance, and converting the radian value into a pitch angle value of the head posture.

[0025] Specifically, the pitch angle is the tilt angle of the head in the vertical direction. The pitch angle is calculated by first calculating the Y coordinate of the horizontal reference through the center coordinates of the left and right eyes, and using this as the horizontal reference line; then, calculating the vertical distance between the nose tip coordinate and the Y value of the horizontal reference line, as well as the horizontal distance of the left and right eyes, and the absolute value of the horizontal coordinate difference; using the inverse tangent function to calculate the radian value based on the ratio of the vertical distance to the horizontal distance, and then converting it into an angle value to obtain the pitch angle value. For example, assuming that we know that the center coordinates of the left and right eyes are divided into (X1, Y1) and (X2, Y2), at this time, the Y coordinate of the horizontal reference line, that is, the eye horizontal line, can be obtained through the Y coordinates of the left and right eyes. ref The average value of the coordinates is calculated: , assuming that the coordinates of the nose tip are (X n ,Y n ). At this point, we can get the vertical distance d between the nose tip and the horizontal reference line. v =|Y n −Y ref ∣, horizontal distance d between left and right eyes h For: h =|X1−X2|, use the inverse tangent function (arctan) to calculate the radian value, and then convert it into an angle value. Among them, the radian value θ rad for: , converted to the pitch angle value θ deg (in degrees) is: .

[0026] In this embodiment, the Y coordinate of the horizontal reference is calculated according to the coordinates of the left and right eye centers, the Y coordinate of the horizontal reference is calculated according to the coordinates of the left and right eye centers, the arc tangent function is used to calculate the radian value according to the ratio of the vertical distance to the horizontal distance, and the radian value is converted into the pitch angle value of the head posture. By using the left and right eye coordinates and the coordinates of the tip of the nose, the rotation angle of the face in the vertical direction can be determined, and the angle value of the user's head raising or lowering can be accurately judged.

[0027] In one embodiment, if Figure 4 As shown, a face recognition method based on AI is provided. In step S20, the calculation result of the yaw angle head posture includes the following steps: S24: Calculate the horizontal distance from the nose tip coordinate to the midpoints of the left and right eyes and the distance between the midpoints of the left and right eyes; S25: using an inverse tangent function, calculating a radian value according to the ratio of the distance from the nose tip coordinate to the midpoints of the left and right eyes in the horizontal direction and the distance between the midpoints of the left and right eyes, and converting the radian value into a yaw angle value of the head posture.

[0028] Specifically, the yaw angle is the rotation angle of the head around the longitudinal axis. Corresponding to the situation where the head rotates left and right, we must first calculate the horizontal distance between the tip of the nose and the midpoints of the left and right eyes, as well as the distance between the midpoints of the left and right eyes, that is, take the absolute value of the difference in the horizontal coordinates. Then, use the inverse tangent function to calculate the radian value based on the ratio of these two distances, and then convert it into an angle value to obtain the yaw angle value.

[0029] For example, suppose we know the center coordinates of the left and right eyes are (X1, Y1) and (X2, Y2) respectively, and the coordinates of the nose tip are (X n ,Y n The coordinates of the midpoints of the left and right eyes (X mid , Y mid )for: , , the horizontal distance d between the nose tip and the midpoint of the left and right eyes hn For: hn =|X n −X mid ∣,However, when calculating the yaw angle, we usually use the midpoint of the left and right eyes as the reference point and assume that the distance between the eyes is d hh is a constant because the distance between the left and right eyes is fixed for the same individual. Then, the inverse tangent function is used to calculate the yaw angle value θ in radians rad for: , but it should be noted that since the yaw angle represents the rotation of the head around the vertical axis, the above formula actually gives the "tilt" angle based on the horizontal distance. In actual situations, in order to accurately calculate the yaw angle, we may need to consider more factors, such as the three-dimensional posture of the head and the camera's viewing angle. However, if we assume that the head rotates only in the horizontal plane and the rotation axis is perpendicular to the eye line, then the above formula can be used as a simplified model. Angle Yaw Angle Pitch Angle Value θ deg (in degrees) is: .

[0030] In this embodiment, the distance from the nose tip coordinates to the midpoints of the left and right eyes in the horizontal direction and the distance between the midpoints of the left and right eyes are calculated; the arc value is calculated according to the ratio of the distance from the nose tip coordinates to the midpoints of the left and right eyes in the horizontal direction and the distance between the midpoints of the left and right eyes using the inverse tangent function, and the arc value is converted into the yaw angle value of the head posture. By using the left and right eye coordinates and the nose tip coordinates, the rotation angle of the face in the horizontal direction can be determined, and the angle value of the user's left and right rotation can be accurately judged.

[0031] In one embodiment, if Figure 5 As shown, a face recognition method based on AI is provided. In step S20, the calculation result of the roll angle head posture includes the following steps: S26: Calculate the length of the line connecting the left and right eyes; S27: Calculate half of the difference in vertical distance between the left and right mouth corners as the vertical offset; S28: Using an inverse tangent function, a radian value is calculated according to the ratio of the vertical offset and half the length of the line connecting the left and right eyes, and the radian value is converted into a rolling angle value of the head posture.

[0032] Specifically, the roll angle is the angle generated by rotating around an axis perpendicular to the face, similar to an action of tilting the head, such as tilting the head. The calculation of the roll angle requires first calculating the length of the line connecting the left and right eyes as a length reference; then, calculating half of the difference in the vertical distance between the left and right corners of the mouth as the vertical offset; finally, using the inverse tangent function to calculate the radian value based on the ratio of the vertical offset and half the length of the line connecting the left and right eyes, and then converting it into an angle value to obtain the roll angle value.

[0033] For example, assuming that the coordinates of the left eye are (X1, Y1) and the coordinates of the right eye are (X2, Y2), the length d of the line connecting the left and right eyes can be calculated using the Euclidean distance formula: , Calculate half of the vertical distance difference between the left and right corners of the mouth: Assume that the coordinates of the left corner of the mouth are (X3, Y3) and the coordinates of the right corner of the mouth are (X4, Y4). The vertical distance difference between the left and right corners of the mouth (Y direction) is: ΔY=|Y4−Y3|, and the vertical offset ο is half of the distance difference: , use the inverse tangent function arctan to calculate the radian value, where the input of arctan is the vertical offset o and half the length of the line connecting the left and right eyes Ratio of: , convert radians to degrees: .

[0034] In this embodiment, by calculating the length of the line connecting the left and right eyes, half of the difference in the vertical distance between the left and right corners of the mouth is calculated as the vertical offset, and the arc value is calculated according to the ratio of the vertical offset and half of the length of the line connecting the left and right eyes by the inverse tangent function, and the arc value is converted into the rolling angle value of the head posture. Through the length of the line connecting the left and right eyes and the coordinates of the left and right corners of the mouth, the angle generated by the rotation of the face perpendicular to the axis of the face can be determined, and the angle value of the user's head tilt can be accurately judged.

[0035] In one embodiment, if Figure 6 As shown, a face recognition method based on AI is provided. In step S30, that is, according to the calculation results of the different head postures, the face image is posture corrected, and the face recognition is performed on the face after the posture correction, including the following steps: S31: Determine whether the calculation result of the head posture is within a target threshold; S32: if the calculation result of the head posture is within the target threshold, performing angle correction and normalization processing on the face image to obtain a standard posture of the face image after correction; S33: Recognize the face image in the standard posture.

[0036] Specifically, according to the calculation results of different head postures, the rotation angle of the current head posture of the face in the face image can be obtained. According to the calculation results, it is judged whether the head posture in the face image is within the preset target threshold. If it is within the preset target threshold, it proves that the posture of the side face in the face image can be corrected through the above calculation. The posture correction includes correcting and normalizing the face image to ensure that the face in the face image is in the front or standard posture, and the face image after posture correction is recognized. Among them, if the calculation result of the head posture is not within the target threshold, it proves that the rotation angle of the head posture in the face image is too large, and the head posture in the face image cannot be corrected. At this time, the recognition of the face in the face image is abandoned.

[0037] In this embodiment, by judging whether the calculation result of the head posture is within the target threshold, the face image of the standard posture is recognized. In this embodiment, by using the head posture estimation technology to pre-judge the angle and head posture of the face, it is possible to first match the data set with different posture features to perform accurate recognition. If the posture information in the data set is incomplete, the face image of the side face, the head down, etc. is appropriately corrected, and converted into an approximate frontal face image before recognition.

[0038] In one embodiment, if Figure 7 As shown, a face recognition method based on AI is provided. In step S30, the facial feature points of the left and right eyes, nose, and left and right corners of the mouth in the face image are collected, and then the following steps are included: S11: Obtaining the head posture of the pitch angle, yaw angle and roll angle according to the acquired facial key feature points; S12: Using the head postures at different angles to establish a face training data set, and train a face recognition model.

[0039] Specifically, by obtaining the facial feature points of the left and right eyes in the face image, the pitch angle, yaw angle and roll angle under different head postures are obtained based on the obtained facial key feature points, and a head posture deep network learning architecture is constructed. The head postures at different angles are used to establish a face training data set. The face training data set trains faces by normalizing and correcting the face images according to the head posture. At the same time, the head postures at each angle obtained in the face training data set are data sets that eliminate face images that exceed the target threshold. The face training data set can be used to perform head posture recognition and face recognition training on the face recognition model to ensure that the face recognition model can cope with face recognition in different postures.

[0040] In this embodiment, the head postures of pitch angle, yaw angle and roll angle are obtained based on the acquired facial key feature points; a face training data set is established using the head postures at different angles, and a face recognition model is trained so that the face recognition model can recognize faces under different head postures.

[0041] In one embodiment, a face recognition method based on AI is provided. In step S12, the facial feature points of the left and right eyes, nose, and left and right corners of the mouth in the face image are collected, and then the face recognition model is trained, including the following steps: S121: Input the face image and the corresponding key facial feature points into a face training data set, and annotate the pitch angle, yaw angle and roll angle of the head posture during the training phase, so that the face recognition model can recognize different head postures.

[0042] In this embodiment, after the face image and the corresponding facial key feature points are input into the face training data set, the angles of the acquired head posture are annotated, such as the pitch angle, yaw angle and roll angle of the head posture, and the sample data of each different angle is learned, so that the face model can accurately recognize the face image for different head postures.

[0043] In one solution implemented by the above-mentioned AI-based face recognition method, device, computer equipment and storage medium, facial feature points of the left and right eyes, nose, left and right corners of the mouth are collected in the face image; the pitch angle, yaw angle and roll angle of the head posture are calculated using the geometric relationship between the facial feature points to obtain the calculation results of different head postures; according to the calculation results of the different head postures, the face image is posture corrected, and face recognition is performed on the face after posture correction. This application calculates different head postures by extracting facial feature points, performs appropriate posture correction on faces with different head postures by calculating the head posture, and recognizes the corrected images to improve the accuracy of face recognition and enhance the user experience.

[0044] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0045] In one embodiment, an AI-based face recognition device is provided, and the AI-based face recognition device corresponds one-to-one to the AI-based face recognition method in the above embodiment. Figure 8 As shown, the AI-based face recognition device includes an acquisition module, a calculation module and a recognition module. The detailed description of each functional module is as follows: An acquisition module is used to collect facial feature points of left and right eyes, nose, and left and right corners of mouth in a face image; A calculation module, used to calculate the pitch angle, yaw angle and roll angle of the head posture using the geometric relationship between the facial feature points, so as to obtain a calculation result of the head posture; The recognition module is used to perform posture correction on the face image according to the calculation result of the head posture, and perform face recognition on the face after the posture correction.

[0046] In this embodiment, the AI-based face recognition method provided in this application can be applied to all fields based on the collection and promotion of face recognition technology. Specifically, in one embodiment, facial feature points of a face can be acquired by collecting and playing videos, monitoring images, etc. that can scan facial features of a face. The acquisition method can be a mobile terminal device with a camera function.

[0047] In the present application, by obtaining the facial feature points of the human face, that is, obtaining the positions of the five facial feature points of the left and right eyes, the nose, and the left and right corners of the mouth, according to the geometric relationship between the facial feature points, by calculating the pitch angle, yaw angle and roll angle of different head postures, the face angle is predicted, and based on the calculation results of the head posture, the face image is posture corrected, and the face image after posture correction is recognized.

[0048] In an embodiment of the present application, facial feature points of the left and right eyes, nose, and left and right corners of the mouth in a facial image are collected, and the pitch angle, yaw angle, and roll angle of the head posture are calculated using the geometric relationship between the facial feature points to obtain calculation results of different head postures; according to the calculation results of the different head postures, the facial image is posture corrected, and face recognition is performed on the face after posture correction, and the non-frontal facial image is converted into a frontal facial image, which greatly improves the recognition accuracy.

[0049] In one solution implemented by the above-mentioned AI-based face recognition device, facial feature points of the left and right eyes, nose, and left and right corners of the mouth are collected in the face image; the pitch angle, yaw angle, and roll angle of the head posture are calculated using the geometric relationship between the facial feature points to obtain the calculation results of different head postures; according to the calculation results of the different head postures, the face image is posture corrected, and face recognition is performed on the face after posture correction. This application calculates different head postures by extracting facial feature points, performs appropriate posture correction on faces with different head postures by calculating the head posture, and recognizes the corrected images to improve the accuracy of face recognition and enhance the user experience.

[0050] For the specific limitations of the AI-based face recognition device, please refer to the limitations of the AI-based face recognition method above, which will not be repeated here. Each module in the above-mentioned AI-based face recognition device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0051] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store face pictures for training face recognition models and head calculation results of different head postures corresponding to the face pictures, and use the head calculation results of different head postures corresponding to the face pictures to establish a face recognition training data set. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a face recognition method based on AI is implemented.

[0052] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the AI-based face recognition method in the above embodiment is implemented, for example: Figures 2 to 7 As shown in , to avoid repetition, it will not be described here. Alternatively, when the processor executes the computer program, the functions of each module / unit in this embodiment of the AI-based face recognition device are realized, such as Figure 8 The AI-based face recognition functions shown are not described here to avoid repetition.

[0053] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the AI-based face recognition method in the above embodiment is implemented, for example Figures 2 to 7 Alternatively, when the computer program is executed by the processor, the functions of each module / unit in the embodiment of the above-mentioned AI-based face recognition device are realized, for example Figure 8 The AI-based face recognition function shown is not described here to avoid repetition. The computer-readable storage medium may be non-volatile or volatile.

[0054] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SYnchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0055] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0056] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. 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 may still be modified, or some of the technical features may be replaced by equivalents. Such 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, and should all be included in the protection scope of the present invention.

Claims

1. A face recognition method based on AI, characterized in that: include: Collect facial feature points of left and right eyes, nose, left and right corners of mouth in face images; Calculating the pitch angle, yaw angle and roll angle of the head posture using the geometric relationship between the facial feature points, so as to obtain calculation results of different head postures; According to the calculation results of the different head postures, posture correction is performed on the face image, and face recognition is performed on the face after posture correction.

2. The AI-based face recognition method according to claim 1, characterized in that: The calculation result of the pitch angle head posture includes: Calculate the Y coordinate of the horizontal reference based on the left and right eye center coordinates; Calculate the vertical distance from the nose tip coordinate to the Y coordinate of the horizontal reference and the horizontal distance between the left and right eyes; An arc tangent function is used to calculate a radian value according to the ratio of the vertical distance to the horizontal distance, and the radian value is converted into a pitch angle value of the head posture.

3. The AI-based face recognition method according to claim 1, characterized in that: The calculation result of the yaw angle head posture includes: Calculate the horizontal distance from the nose tip coordinates to the midpoints of the left and right eyes, as well as the distance between the midpoints of the left and right eyes; The arc tangent function is used to calculate the radian value according to the ratio of the distance from the nose tip coordinate to the midpoints of the left and right eyes in the horizontal direction and the distance between the midpoints of the left and right eyes, and the radian value is converted into the yaw angle value of the head posture.

4. The AI-based face recognition method according to claim 1, characterized in that: The calculation result of the roll angle head posture includes: Calculate the length of the line connecting the left and right eyes; Calculate half of the difference in vertical distance between the left and right mouth corners as the vertical offset; The arc value is calculated according to the ratio of the vertical offset and half the length of the line connecting the left and right eyes by an inverse tangent function, and the arc value is converted into a rolling angle value of the head posture.

5. The AI-based face recognition method according to claim 1, characterized in that: The step of performing posture correction on the face image according to the calculation results of the different head postures, and performing face recognition on the face after the posture correction, comprises: Determining whether the calculation result of the head posture is within a target threshold; If the calculation result of the head posture is within the target threshold, performing angle correction and normalization processing on the face image to obtain a standard posture of the face image after correction; The face image of the standard posture is recognized.

6. The AI-based face recognition method according to claim 1, characterized in that: The facial feature points of the left and right eyes, nose, and left and right corners of the mouth in the face image are collected, and then include: Obtaining the head posture of the pitch angle, yaw angle and roll angle according to the acquired facial key feature points; A face training data set is established using the head postures at different angles, and a face recognition model is trained.

7. The AI-based face recognition method according to claim 6, characterized in that: The training of the face recognition model includes: The face image and the corresponding key facial feature points are input into a face training data set, and the pitch angle, yaw angle and roll angle of the head posture are annotated during the training stage so that the face recognition model can recognize different head postures.

8. An AI-based face recognition device, characterized in that: include: An acquisition module is used to collect facial feature points of left and right eyes, nose, and left and right corners of mouth in a face image; A calculation module, used to calculate the pitch angle, yaw angle and roll angle of the head posture using the geometric relationship between the facial feature points, so as to obtain a calculation result of the head posture; The recognition module is used to perform posture correction on the face image according to the calculation result of the head posture, and perform face recognition on the face after the posture correction.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the AI-based face recognition method as described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the AI-based face recognition method as described in any one of claims 1 to 7 is implemented.