CN112488053A - Face recognition method and device, robot and storage medium - Google Patents

Face recognition method and device, robot and storage medium Download PDF

Info

Publication number
CN112488053A
CN112488053A CN202011496444.0A CN202011496444A CN112488053A CN 112488053 A CN112488053 A CN 112488053A CN 202011496444 A CN202011496444 A CN 202011496444A CN 112488053 A CN112488053 A CN 112488053A
Authority
CN
China
Prior art keywords
face
registered
image
key point
features
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011496444.0A
Other languages
Chinese (zh)
Other versions
CN112488053B (en
Inventor
曾钰胜
程骏
庞建新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ubtech Technology Co ltd
Original Assignee
Shenzhen Ubtech Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Ubtech Technology Co ltd filed Critical Shenzhen Ubtech Technology Co ltd
Priority to CN202011496444.0A priority Critical patent/CN112488053B/en
Publication of CN112488053A publication Critical patent/CN112488053A/en
Application granted granted Critical
Publication of CN112488053B publication Critical patent/CN112488053B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • G06V40/164Detection; Localisation; Normalisation using holistic features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • G06V40/169Holistic features and representations, i.e. based on the facial image taken as a whole
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the invention discloses a face recognition method, a face recognition device, a robot and a storage medium. The face recognition method comprises the following steps: acquiring a face image to be recognized; carrying out face key point recognition on the face image to be recognized by adopting a pre-trained face key point model, wherein the face key point model is a lightweight neural network model; aligning the face image to be recognized according to the face key points obtained by recognition to obtain an aligned face image; extracting the face features in the aligned face image; and comparing the face features with registered face features in a preset database to identify people in the face image to be identified, wherein the registered face features are obtained by extracting features of a registered face image, and the registered face image is obtained by screening a pre-trained face posture detection model. The embodiment of the invention realizes the effect of accurately finishing face recognition under the condition of limited terminal computing power of equipment.

Description

Face recognition method and device, robot and storage medium
Technical Field
The present invention relates to the field of face recognition technologies, and in particular, to a face recognition method, an apparatus, a robot, and a storage medium.
Background
With the rapid development of scientific technology, face recognition technology is more and more applied to various industries, such as mobile phones, security devices, robots, and the like, and thus, the demand for technical innovation of face recognition technology is more and more urgent.
Face key point recognition is an important component of face recognition algorithms and applications. Wherein the accuracy of the key point recognition directly affects the accuracy of the face recognition. The existing method for improving the accuracy of face key point recognition and the accuracy of subsequent face recognition usually needs to set a relatively complex network model.
Because the computing power of the robot is limited, and a complex model is difficult to use at the robot end, a face recognition method which can be used at the robot end is urgently needed.
Disclosure of Invention
In view of the above, it is necessary to provide a face recognition method, a face recognition apparatus, a computer device, and a storage medium, which can accurately complete face recognition under the condition of limited device end computing power.
In a first aspect, an embodiment of the present invention provides a face recognition method, where the method includes:
acquiring a face image to be recognized;
carrying out face key point recognition on the face image to be recognized by adopting a pre-trained face key point model, wherein the face key point model is a lightweight neural network model;
aligning the face image to be recognized according to the face key points obtained by recognition to obtain an aligned face image;
extracting the face features in the aligned face image;
and comparing the face features with registered face features in a preset database to identify people in the face image to be identified, wherein the registered face features are obtained by extracting features of a registered face image, and the registered face image is obtained by screening a pre-trained face posture detection model.
In a second aspect, an embodiment of the present invention provides a face recognition apparatus, where the apparatus includes:
the image acquisition module is used for acquiring a face image to be recognized;
the key point extraction module is used for carrying out face key point identification on the face image to be identified by adopting a pre-trained face key point model, and the face key point model is a lightweight neural network model;
the face alignment module is used for aligning the face image to be recognized according to the face key point to obtain an aligned face image;
the feature extraction module is used for extracting the face features in the aligned face images;
and the face recognition module is used for comparing the face features with registered face features in a preset database so as to recognize the figures in the face image to be recognized.
In a third aspect, an embodiment of the present invention provides a computer device, including a memory and a processor, where the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to perform the following steps:
acquiring a face image to be recognized;
carrying out face key point recognition on the face image to be recognized by adopting a pre-trained face key point model, wherein the face key point model is a lightweight neural network model;
aligning the face image to be recognized according to the face key points obtained by recognition to obtain an aligned face image;
extracting the face features in the aligned face image;
and comparing the face features with registered face features in a preset database to identify people in the face image to be identified, wherein the registered face features are obtained by extracting features of a registered face image, and the registered face image is obtained by screening a pre-trained face posture detection model.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the processor is caused to execute the following steps:
acquiring a face image to be recognized;
carrying out face key point recognition on the face image to be recognized by adopting a pre-trained face key point model, wherein the face key point model is a lightweight neural network model;
aligning the face image to be recognized according to the face key points obtained by recognition to obtain an aligned face image;
extracting the face features in the aligned face image;
and comparing the face features with registered face features in a preset database to identify people in the face image to be identified, wherein the registered face features are obtained by extracting features of a registered face image, and the registered face image is obtained by screening a pre-trained face posture detection model.
According to the embodiment of the invention, the face key point recognition is carried out on the face image to be recognized by adopting the pre-trained face key point model, wherein the face key point model adopts a lightweight neural network model, the calculation force requirement is reduced, and the recognition accuracy is ensured by adopting the comparison of the registered face features in the preset database, wherein the registered face features are accurate face features obtained through a plurality of models, the problem that the obtained face key points are not accurate enough due to insufficient calculation force of the equipment end is solved, and the effect of accurately finishing the face recognition under the condition of limited calculation force of the equipment end is obtained.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be adopted in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Wherein:
FIG. 1 is a diagram of an exemplary embodiment of a face recognition application;
FIG. 2 is a flow diagram of a face recognition method in one embodiment;
FIG. 3 is a flowchart illustrating an embodiment of obtaining a face image to be recognized in a face recognition method;
FIG. 4 is a flow chart of a face recognition method in another embodiment;
FIG. 5 is a flowchart illustrating an embodiment of obtaining a registered face image in a face recognition method;
FIG. 6 is a block diagram of a face recognition apparatus according to an embodiment;
fig. 7 is a block diagram of a robot in one embodiment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is an application environment diagram of a face recognition method in an embodiment. Referring to fig. 1, the face recognition method is applied to a face recognition apparatus. The face recognition apparatus includes a terminal 110 and a server 120. The terminal 110 and the server 120 are connected through a network, the terminal 110 may be specifically a desktop terminal or a mobile terminal, and the mobile terminal may be specifically at least one of a mobile phone, a tablet computer, a notebook computer, a robot, and the like. The server 120 may be implemented as a stand-alone server or a server cluster composed of a plurality of servers. The terminal 110 is used for acquiring a face image to be recognized and uploading the face image to the server 120, the server 120 is used for receiving the face image to be recognized and performing face key point recognition on the face image to be recognized by adopting a pre-trained face key point model, and the face key point model is a lightweight neural network model; aligning the face image to be recognized according to the face key points obtained by recognition to obtain an aligned face image; extracting the face features in the aligned face image; and comparing the face features with registered face features in a preset database to identify people in the face image to be identified, wherein the registered face features are obtained by extracting features of a registered face image, and the registered face image is obtained by screening a pre-trained face posture detection model.
In another embodiment, the text entity recognition method may be directly applied to the terminal 110, and the terminal 110 is configured to obtain a face image to be recognized; carrying out face key point recognition on the face image to be recognized by adopting a pre-trained face key point model, wherein the face key point model is a lightweight neural network model; aligning the face image to be recognized according to the face key points obtained by recognition to obtain an aligned face image; extracting the face features in the aligned face image; and comparing the face features with registered face features in a preset database to identify people in the face image to be identified, wherein the registered face features are obtained by extracting features of a registered face image, and the registered face image is obtained by screening a pre-trained face posture detection model.
In one embodiment, as shown in FIG. 2, a face recognition method is provided. The method can be applied to both the terminal and the server, and this embodiment is exemplified by being applied to the terminal. The face recognition method specifically comprises the following steps:
and S110, acquiring a face image to be recognized.
In this embodiment, the terminal for executing the method is a robot, the robot includes a camera, and when a user needs to perform face recognition, the user can place a face in front of the camera of the robot, so that the robot can shoot the face through the camera, and the obtained image is used as a face image to be recognized.
Preferably, as shown in fig. 3, step S110 may specifically include the following steps:
and S111, acquiring an image to be identified.
And S112, detecting and extracting the face in the image to be recognized to obtain the image of the face to be recognized.
In this embodiment, an image obtained by shooting by the robot is used as an image to be recognized, and in order to ensure that a face exists in the image to be recognized when face recognition is performed, the face in the image to be recognized needs to be detected, so that an image including only a face part in the image to be recognized is extracted and used as the face image to be recognized, thereby improving the accuracy of face recognition and improving the efficiency of face recognition.
And S120, carrying out face key point recognition on the face image to be recognized by adopting a pre-trained face key point model, wherein the face key point model is a lightweight neural network model.
S130, aligning the face image to be recognized according to the face key points obtained through recognition to obtain an aligned face image.
In this embodiment, after the face image to be recognized is obtained, the face image to be recognized may be subjected to face key point recognition, where the face key point recognition may be performed by using a pre-trained face key point detection model, and after the face image to be recognized is input into the face key point detection model, the face key point detection model may output the face key point of the face image to be recognized. After the face key points are obtained, the face image to be recognized can be aligned according to the face key points obtained through recognition, so that an aligned face image is obtained, the aligned face image is a face image obtained by converting the face image to be recognized into based on the face key points, and the aligned face image can be used for feature comparison of face recognition after the aligned face image is obtained, so that the accuracy of face recognition is ensured. The human face key point detection model can be a neural network model of MobileNetV3_ small, specifically, MobileNetV3_ small is a lightweight model of MobileNetV3, has good accuracy under the condition of excellent speed performance, and requires low calculation force, and the MobileNetV3 combines the advantages of MobileNetV1 and MobileNetV2, and is a strong mobile terminal feature extraction model. Preferably, even if the computational power on the equipment is still limited, for example, a robot with a small volume, the channel clipping can be performed on the mobilonetv 3_ small model to obtain mobilonetv 3_ small 0.5, and the model has a good face recognition effect even if the accuracy is slightly lost.
And S140, extracting the face features in the aligned face image.
S150, comparing the face features with registered face features in a preset database to identify people in the face image to be identified.
In this embodiment, after the aligned face image is obtained, the face features in the aligned face image may be extracted, and then the face features may be compared with the registered face features in the preset database, so that the person in the face image to be recognized may be recognized. The registered face features are obtained by extracting features of registered face images, and the registered face images are obtained by screening a pre-trained face posture detection model. Specifically, before face recognition is performed, a user to be recognized needs to perform face registration, face key point recognition of the registered user can be obtained by the same method as the above steps, and then registered face features are extracted, further, in order to ensure the accuracy of the recognition, a front face image needs to be obtained by screening a pre-trained face posture detection model in advance, feature extraction is performed on the registered front face image to obtain registered face features, and each registered face feature includes a corresponding user name. Therefore, the registered face features of the front face images of all registered users are stored in the preset database, and people in the face images to be recognized can be recognized simply through comparison when face recognition is carried out.
According to the embodiment of the invention, the face key point recognition is carried out on the face image to be recognized by adopting the pre-trained face key point model, wherein the face key point model adopts a lightweight neural network model, the calculation force requirement is reduced, and the recognition accuracy is ensured by adopting the comparison of the registered face features in the preset database, wherein the registered face features are accurate face features obtained through a plurality of models, the problem that the obtained face key points are not accurate enough due to insufficient calculation force of the equipment end is solved, and the effect of accurately finishing the face recognition under the condition of limited calculation force of the equipment end is obtained.
As shown in fig. 4, in another embodiment, before step S110 of the face recognition method in the foregoing embodiment, the method further includes:
and S210, acquiring a registered face image.
In this embodiment, before performing face recognition, a user to be recognized needs to perform face registration, and a registered face image needs to be obtained first, where the registered face image may be shot by a robot in real time, or uploaded by a server by the user, and is used for comparing the face image registered in a preset database by the user for subsequent face recognition.
Preferably, as shown in fig. 5, step S210 may specifically include the following steps:
and S211, acquiring a plurality of face images to be registered.
S212, detecting the faces in the face images to be registered to obtain registered face images, wherein the registered face images are the face images to be registered with the highest face feature value in the face images to be registered.
In this embodiment, because the registered face images of the registered users are obtained, a plurality of face images to be registered can be obtained, and thus the best image among the plurality of face images can be selected as the registered face image. After a plurality of face images to be registered are acquired, firstly, the faces in the plurality of face images to be registered can be detected to obtain registered face images, and it is ensured that faces exist in the registered face images when the registration is performed, and in addition, because the number of face images to be registered is multiple, after the face images to be registered without faces are screened out, the face images to be registered with the highest face feature value are also required to be selected as the registered face images, namely, the registered face images are the face images to be registered with the highest face feature value in the plurality of face images to be registered, wherein the highest face feature value can be embodied as the largest image size of the faces in the plurality of face images to be registered, illustratively, the image size of the faces in the first face image to be registered is 100X100, the image size of the faces in the second face image to be registered is 10X10, and then the face feature value in the first face image to be registered is the highest, and taking the first face image to be registered as a registered face image.
S220, the registered face image is used as the input of a pre-trained face recognition model, the face recognition model comprises a face key point detection model and a face posture detection model, and the face key point detection model is connected with the face posture detection model.
And S230, acquiring the face pose output by the face pose detection model, and acquiring the registered face key points output by the face key point detection model.
And S240, when the face pose is a front face image, aligning the registered face image according to the registered face key points to obtain an aligned registered face.
And S250, extracting the face features in the aligned registered face as registered face features and storing the registered face features in a preset database.
In this embodiment, after the registered face image is obtained, the registered face image may be used as an input of a face recognition model to obtain a face pose and registered face key points, where the face recognition model is trained in advance, the face recognition model includes a pre-trained face key point detection model and a pre-trained face pose detection model, the face key point detection model is connected to the face pose detection model, the face key point detection model is also used for extracting face key points in face recognition, and the face pose detection model may be simply constructed according to actual needs. Specifically, the face key point detection model is connected with the face gesture detection model through the middle feature layer of the face key point detection model, illustratively, the middle feature layer in the face key point detection model is selected, and the face key point detection model is connected with the face gesture detection model through 2 convolution layers with the step length of 2 in the middle feature layer to complete the decoupling function of extracting the face key points and serve as the input of the face gesture detection model, thereby realizing the prediction of the human face gesture assisted by the human face key points, and connecting the middle characteristic layer of the human face key point detection model with the human face gesture detection model to obtain a combined model, namely, the face recognition model has better balance, the dependency and the calculated amount of the face pose prediction on the extraction of key points of the face are not high, and the problem of larger error in the face pose prediction based on a 3D standard module is also solved.
It should be noted that the face recognition model is obtained by training based on a preset loss function, where the preset loss function adopted by the face key point detection model may be a WingLoss function, and specifically:
Figure BDA0002842303130000091
where C is a constant, ω is a positive number for limiting the range of the nonlinear part of the loss function to the range of [ - ω, ω ], and ∈ is the curvature of the nonlinear region that constrains the loss function, and these parameters can be selected according to practical requirements, for example, ω is 10 and ∈ 2. Compared with the L1 loss function, the L2 loss function and the L1_ smooth loss function, the WingLoss loss function has higher response of subtle differences, and can realize more refined positioning of the key points of the human face during training of the human face key point detection model, and the preset loss function adopted by the human face posture detection model can be the L1_ smooth loss function.
In this embodiment, the face key points include eye key points and other face key points, the other face key points may be nose key points, mouth key points, and ear key points, and the eye key points include left eye key points and right eye key points, however, due to differences in eye sizes, diversification of eye opening and closing degrees, and complexity of glasses worn by eyes, the positioning of the eye key points is prone to have a large error.
Furthermore, after the registered face image is input into the face recognition model, the face key point detection model in the face recognition model outputs the registered face key point, the face pose detection model in the face recognition model is connected with the face key point detection model, the face pose detection model takes the input registered face image and the face key point feature output by the face key point detection model intermediate feature layer as input to output the face pose, the face pose realizes the auxiliary prediction through the face key point, the precision of the face key point is not influenced, and the decoupling of the face key point is realized. After the face pose is obtained, whether the registered face image is the front face image or not can be determined according to the face pose, and when the face pose is the front face image, the registered face image can be aligned according to the registered face key point to obtain an aligned registered face. And finally, extracting the face features in the aligned registered face as the registered face features and storing the registered face features in a preset database for subsequent face recognition.
In an alternative embodiment, the acquiring a plurality of face images to be registered includes: and acquiring a plurality of registered face pictures corresponding to the same registered user with eyes in different states. The registering of the face key points comprises registering eye key points and registering other face key points, and the acquiring of the registered face key points output by the face key point detection model further comprises: and extracting eye feature points in the plurality of registered face pictures by adopting the face key point detection model, and taking the obtained eye feature points in different states as the registered eye key points of the same registered user. In this embodiment, in order to further reduce errors of eye key points, when a plurality of face images to be registered are obtained, a plurality of registered face pictures corresponding to the same registered user with eyes in different states are obtained, when the registered face key points output by the face key point detection model are obtained, the face key point detection model may be further used to extract eye feature points in the plurality of registered face pictures, and the obtained eye feature points in different states are used as registered eye key points of the same registered user, so that registered data of the eye key points are improved, and errors in face recognition are reduced in a data source approach.
According to the embodiment of the invention, the registered face image is used as the input of the pre-trained face recognition model, the face recognition model comprises a face key point detection model and a face posture detection model, the face key point detection model is connected with the face posture detection model, and the loss function weight and the data source of the eye key point are increased, so that the problem of insufficient prediction robustness of the face posture is solved, the problem that the eye key point is easy to have larger errors in positioning is also solved, the joint estimation of the face key point and the face posture is completed under the condition of not losing the precision of the face key point, and the effect of improving the accuracy of eye key point recognition is achieved.
As shown in fig. 6, in an embodiment, a face recognition apparatus is provided, and the face recognition apparatus provided in this embodiment can execute the face recognition method provided in any embodiment of the present invention, and has corresponding functional modules and beneficial effects of the execution method. The face recognition device comprises an image acquisition module 100, a key point extraction module 200, a face alignment module 300, a feature extraction module 400 and a face recognition module 500.
Specifically, the image obtaining module 100 is configured to obtain a face image to be recognized; the key point extraction module 200 is configured to perform face key point recognition on the face image to be recognized by using a pre-trained face key point model, where the face key point model is a lightweight neural network model; the face alignment module 300 is configured to align the face image to be recognized according to the face key point to obtain an aligned face image; the feature extraction module 400 is configured to extract facial features from the aligned facial images; the face recognition module 500 is configured to compare the face features with registered face features in a preset database, so as to recognize a person in the face image to be recognized.
In one embodiment, the apparatus further includes a face registration module 600, where the face registration module 600 is configured to obtain a registered face image; the registered face image is used as the input of a pre-trained face recognition model, the face recognition model comprises a face key point detection model and a face gesture detection model, and the face key point detection model is connected with the face gesture detection model; acquiring a face gesture output by the face gesture detection model, and acquiring a registered face key point output by the face key point detection model; when the face pose is a front face image, aligning the registered face image according to the registered face key point to obtain an aligned registered face; and extracting the face features in the aligned registered face as registered face features and storing the registered face features in a preset database.
In one embodiment, the face keypoint detection model is connected to the face pose detection model through an intermediate feature layer of the face keypoint detection model, the face pose detection model is configured to determine whether the registered face image is a frontal face image according to an input registered face image and face keypoint features, and the face keypoint features are output from the intermediate feature layer.
In one embodiment, the face registration module 600 is further configured to obtain a plurality of face images to be registered; and detecting the faces in the plurality of face images to be registered to obtain a registered face image, wherein the registered face image is the face image to be registered with the highest face characteristic value in the plurality of face images to be registered.
In one embodiment, the face registration module 600 is further configured to obtain a plurality of registered face pictures corresponding to the same registered user with eyes in different states; the registered face key points include registered eye key points and registered other face key points, and the face registration module 600 is further configured to extract eye feature points in the plurality of registered face pictures by using the face key point detection model, and use the obtained eye feature points in different states as the registered eye key points of the same registered user.
In one embodiment, the face key points include eye key points and other face key points, the face recognition model is obtained by training based on a preset loss function, and a loss coefficient of the eye key points in the preset loss function is greater than loss coefficients of the other face key points.
In one embodiment, the image obtaining module 100 is further configured to obtain an image to be identified; and detecting and extracting the face in the image to be recognized to obtain the image of the face to be recognized.
Fig. 7 shows an internal structure of the robot in one embodiment. As shown in fig. 7, the robot includes a processor, a memory, and a network interface connected by a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the robot stores an operating system and may also store a computer program which, when executed by the processor, causes the processor to implement the face recognition method. The internal memory may also have a computer program stored therein, which when executed by the processor, causes the processor to perform the age identification method. Those skilled in the art will appreciate that the configuration shown in fig. 7 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation on the robot to which the present application may be applied, and that a particular robot may include more or fewer components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a robot is presented, comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of:
acquiring a face image to be recognized;
carrying out face key point recognition on the face image to be recognized by adopting a pre-trained face key point model, wherein the face key point model is a lightweight neural network model;
aligning the face image to be recognized according to the face key points obtained by recognition to obtain an aligned face image;
extracting the face features in the aligned face image;
and comparing the face features with registered face features in a preset database to identify people in the face image to be identified, wherein the registered face features are obtained by extracting features of a registered face image, and the registered face image is obtained by screening a pre-trained face posture detection model.
In one embodiment, the acquiring the face image to be recognized comprises:
acquiring a registered face image; the registered face image is used as the input of a pre-trained face recognition model, the face recognition model comprises a face key point detection model and a face gesture detection model, and the face key point detection model is connected with the face gesture detection model; acquiring a face gesture output by the face gesture detection model, and acquiring a registered face key point output by the face key point detection model; when the face pose is a front face image, aligning the registered face image according to the registered face key point to obtain an aligned registered face; and extracting the face features in the aligned registered face as registered face features and storing the registered face features in a preset database.
In one embodiment, the face keypoint detection model is connected to the face pose detection model through an intermediate feature layer of the face keypoint detection model, the face pose detection model is configured to determine whether the registered face image is a frontal face image according to an input registered face image and face keypoint features, and the face keypoint features are output from the intermediate feature layer.
In one embodiment, the acquiring the registered face image includes: acquiring a plurality of face images to be registered; and detecting the faces in the plurality of face images to be registered to obtain a registered face image, wherein the registered face image is the face image to be registered with the highest face characteristic value in the plurality of face images to be registered.
In one embodiment, the acquiring the plurality of face images to be registered includes: acquiring a plurality of registered face pictures corresponding to the same registered user with eyes in different states; the registering face key points comprise registering eye key points and registering other face key points, and the acquiring of the registered face key points output by the face key point detection model further comprises: and extracting eye feature points in the plurality of registered face pictures by adopting the face key point detection model, and taking the obtained eye feature points in different states as the registered eye key points of the same registered user.
In one embodiment, the face key points include eye key points and other face key points, the face recognition model is obtained by training based on a preset loss function, and a loss coefficient of the eye key points in the preset loss function is greater than loss coefficients of the other face key points.
In one embodiment, the acquiring the image of the face to be recognized includes: acquiring an image to be identified; and detecting and extracting the face in the image to be recognized to obtain the image of the face to be recognized.
In one embodiment, a computer-readable storage medium is proposed, in which a computer program is stored which, when executed by a processor, causes the processor to carry out the steps of:
acquiring a face image to be recognized;
carrying out face key point recognition on the face image to be recognized by adopting a pre-trained face key point model, wherein the face key point model is a lightweight neural network model;
aligning the face image to be recognized according to the face key points obtained by recognition to obtain an aligned face image;
extracting the face features in the aligned face image;
and comparing the face features with registered face features in a preset database to identify people in the face image to be identified, wherein the registered face features are obtained by extracting features of a registered face image, and the registered face image is obtained by screening a pre-trained face posture detection model.
In one embodiment, the acquiring the face image to be recognized comprises:
acquiring a registered face image; the registered face image is used as the input of a pre-trained face recognition model, the face recognition model comprises a face key point detection model and a face gesture detection model, and the face key point detection model is connected with the face gesture detection model; acquiring a face gesture output by the face gesture detection model, and acquiring a registered face key point output by the face key point detection model; when the face pose is a front face image, aligning the registered face image according to the registered face key point to obtain an aligned registered face; and extracting the face features in the aligned registered face as registered face features and storing the registered face features in a preset database.
In one embodiment, the face keypoint detection model is connected to the face pose detection model through an intermediate feature layer of the face keypoint detection model, the face pose detection model is configured to determine whether the registered face image is a frontal face image according to an input registered face image and face keypoint features, and the face keypoint features are output from the intermediate feature layer.
In one embodiment, the acquiring the registered face image includes: acquiring a plurality of face images to be registered; and detecting the faces in the plurality of face images to be registered to obtain a registered face image, wherein the registered face image is the face image to be registered with the highest face characteristic value in the plurality of face images to be registered.
In one embodiment, the acquiring the plurality of face images to be registered includes: acquiring a plurality of registered face pictures corresponding to the same registered user with eyes in different states; the registering face key points comprise registering eye key points and registering other face key points, and the acquiring of the registered face key points output by the face key point detection model further comprises: and extracting eye feature points in the plurality of registered face pictures by adopting the face key point detection model, and taking the obtained eye feature points in different states as the registered eye key points of the same registered user.
In one embodiment, the face key points include eye key points and other face key points, the face recognition model is obtained by training based on a preset loss function, and a loss coefficient of the eye key points in the preset loss function is greater than loss coefficients of the other face key points.
In one embodiment, the acquiring the image of the face to be recognized includes: acquiring an image to be identified; and detecting and extracting the face in the image to be recognized to obtain the image of the face to be recognized.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims. Please enter the implementation content part.

Claims (10)

1. A face recognition method, comprising:
acquiring a face image to be recognized;
carrying out face key point recognition on the face image to be recognized by adopting a pre-trained face key point model, wherein the face key point model is a lightweight neural network model;
aligning the face image to be recognized according to the face key points obtained by recognition to obtain an aligned face image;
extracting the face features in the aligned face image;
and comparing the face features with registered face features in a preset database to identify people in the face image to be identified, wherein the registered face features are obtained by extracting features of a registered face image, and the registered face image is obtained by screening a pre-trained face posture detection model.
2. The method according to claim 1, wherein the obtaining of the face image to be recognized comprises:
acquiring a registered face image;
the registered face image is used as the input of a pre-trained face recognition model, the face recognition model comprises a face key point detection model and a face gesture detection model, and the face key point detection model is connected with the face gesture detection model;
acquiring a face gesture output by the face gesture detection model, and acquiring a registered face key point output by the face key point detection model;
when the face pose is a front face image, aligning the registered face image according to the registered face key point to obtain an aligned registered face;
and extracting the face features in the aligned registered face as registered face features and storing the registered face features in a preset database.
3. The method of claim 2, wherein the face keypoint detection model is connected to the face pose detection model through an intermediate feature layer of the face keypoint detection model, wherein the face pose detection model is configured to determine whether the registered face image is a frontal face image according to an input registered face image and face keypoint features, and wherein the face keypoint features are an output of the intermediate feature layer.
4. The method of claim 2, wherein the obtaining the registered face image comprises:
acquiring a plurality of face images to be registered;
and detecting the faces in the plurality of face images to be registered to obtain a registered face image, wherein the registered face image is the face image to be registered with the highest face characteristic value in the plurality of face images to be registered.
5. The method according to claim 4, wherein the acquiring the plurality of face images to be registered comprises:
acquiring a plurality of registered face pictures corresponding to the same registered user with eyes in different states;
the registering face key points comprise registering eye key points and registering other face key points, and the acquiring of the registered face key points output by the face key point detection model further comprises:
and extracting eye feature points in the plurality of registered face pictures by adopting the face key point detection model, and taking the obtained eye feature points in different states as the registered eye key points of the same registered user.
6. The method according to claim 2, wherein the face key points include eye key points and other face key points, the face key point detection model is obtained by training based on a preset loss function, and a loss coefficient of the eye key points in the preset loss function is greater than that of the other face key points.
7. The method according to claim 1, wherein the acquiring the face image to be recognized comprises:
acquiring an image to be identified;
and detecting and extracting the face in the image to be recognized to obtain the image of the face to be recognized.
8. An apparatus for face recognition, the apparatus comprising:
the image acquisition module is used for acquiring a face image to be recognized;
the key point extraction module is used for carrying out face key point identification on the face image to be identified by adopting a pre-trained face key point model, and the face key point model is a lightweight neural network model;
the face alignment module is used for aligning the face image to be recognized according to the face key point to obtain an aligned face image;
the feature extraction module is used for extracting the face features in the aligned face images;
and the face recognition module is used for comparing the face features with registered face features in a preset database so as to recognize the figures in the face image to be recognized.
9. A robot comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, storing a computer program which, when executed by a processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 7.
CN202011496444.0A 2020-12-17 2020-12-17 Face recognition method, device, robot and storage medium Active CN112488053B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011496444.0A CN112488053B (en) 2020-12-17 2020-12-17 Face recognition method, device, robot and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011496444.0A CN112488053B (en) 2020-12-17 2020-12-17 Face recognition method, device, robot and storage medium

Publications (2)

Publication Number Publication Date
CN112488053A true CN112488053A (en) 2021-03-12
CN112488053B CN112488053B (en) 2023-10-13

Family

ID=74917321

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011496444.0A Active CN112488053B (en) 2020-12-17 2020-12-17 Face recognition method, device, robot and storage medium

Country Status (1)

Country Link
CN (1) CN112488053B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114267068A (en) * 2021-12-24 2022-04-01 北京的卢深视科技有限公司 Face recognition method based on continuous frame information, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106503669A (en) * 2016-11-02 2017-03-15 重庆中科云丛科技有限公司 A kind of based on the training of multitask deep learning network, recognition methods and system
CN110163806A (en) * 2018-08-06 2019-08-23 腾讯科技(深圳)有限公司 A kind of image processing method, device and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106503669A (en) * 2016-11-02 2017-03-15 重庆中科云丛科技有限公司 A kind of based on the training of multitask deep learning network, recognition methods and system
CN110163806A (en) * 2018-08-06 2019-08-23 腾讯科技(深圳)有限公司 A kind of image processing method, device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114267068A (en) * 2021-12-24 2022-04-01 北京的卢深视科技有限公司 Face recognition method based on continuous frame information, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112488053B (en) 2023-10-13

Similar Documents

Publication Publication Date Title
CN108205655B (en) Key point prediction method and device, electronic equipment and storage medium
CN110209859B (en) Method and device for recognizing places and training models of places and electronic equipment
US11816880B2 (en) Face recognition method and apparatus, computer device, and storage medium
CN111191568B (en) Method, device, equipment and medium for identifying flip image
CN114332994A (en) Method for training age prediction model, age detection method and related device
CN113298158B (en) Data detection method, device, equipment and storage medium
CN113505797B (en) Model training method and device, computer equipment and storage medium
CN111062324A (en) Face detection method and device, computer equipment and storage medium
CN111382791B (en) Deep learning task processing method, image recognition task processing method and device
CN110660078A (en) Object tracking method and device, computer equipment and storage medium
CN112488053B (en) Face recognition method, device, robot and storage medium
CN111582027A (en) Identity authentication method and device, computer equipment and storage medium
CN117115595B (en) Training method and device of attitude estimation model, electronic equipment and storage medium
CN113792643A (en) Living body face recognition method and system
CN111814811A (en) Image information extraction method, training method and device, medium and electronic equipment
CN112348008A (en) Certificate information identification method and device, terminal equipment and storage medium
CN115115552B (en) Image correction model training method, image correction device and computer equipment
CN111507289A (en) Video matching method, computer device and storage medium
CN116304179A (en) Data processing system for acquiring target video
WO2022126464A1 (en) Face recognition method, robot, and storage medium
CN116071804A (en) Face recognition method and device and electronic equipment
CN111723626A (en) Method, device and electronic equipment for living body detection
CN113269176B (en) Image processing model training method, image processing device and computer equipment
CN115083020B (en) Information generation method and device, electronic equipment and computer readable medium
CN113591639A (en) Training method and device for alignment framework, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant