WO2023040202A1 - Face recognition method and apparatus, electronic device, and storage medium - Google Patents

Face recognition method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2023040202A1
WO2023040202A1 PCT/CN2022/078372 CN2022078372W WO2023040202A1 WO 2023040202 A1 WO2023040202 A1 WO 2023040202A1 CN 2022078372 W CN2022078372 W CN 2022078372W WO 2023040202 A1 WO2023040202 A1 WO 2023040202A1
Authority
WO
WIPO (PCT)
Prior art keywords
face
face recognition
feature
user
recognized
Prior art date
Application number
PCT/CN2022/078372
Other languages
French (fr)
Chinese (zh)
Inventor
邵巾芮
蔺颖
Original Assignee
上海商汤智能科技有限公司
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 上海商汤智能科技有限公司 filed Critical 上海商汤智能科技有限公司
Publication of WO2023040202A1 publication Critical patent/WO2023040202A1/en

Links

Images

Definitions

  • the present disclosure relates to the field of computer technology, and in particular to a face recognition method and device, electronic equipment, and a storage medium.
  • face recognition technology is widely used in various fields. Due to the limitation of the computing power of the terminal equipment, the existing face recognition technology directly collects the user's face information and uploads it to the server for face recognition without considering the user's wishes, which has the hidden danger of user privacy leakage.
  • the present disclosure proposes a face recognition method and device, electronic equipment, and a storage medium, aiming at performing the face recognition process under the premise of respecting user privacy choices and ensuring the accuracy of face recognition results.
  • a face recognition method comprising:
  • the face recognition information includes a face image to be recognized, and/or a first face feature obtained by feature extraction of the face image to be recognized ;
  • the determining the face recognition mode of the face image to be recognized includes:
  • a face recognition mode selection page including a first recognition control and/or a second recognition control
  • the face recognition mode of the face image to be recognized In response to the triggering of the first recognition control, determine the face recognition mode of the face image to be recognized as the first recognition mode, and the first recognition mode is used to send the face image to be recognized;
  • the face recognition mode of the face image to be recognized is the second recognition mode
  • the second recognition mode is used to send a feature extraction function to the face image to be recognized. Get the first face features.
  • the sending face recognition information to the server according to the face recognition mode includes:
  • the determination process of the face recognition result includes:
  • the face recognition result is obtained, and the user face feature set includes at least one user face feature corresponding to the user face feature user information.
  • the method further includes:
  • a face recognition method comprising:
  • the face recognition information including the face image to be recognized, and/or the first face feature obtained by feature extraction of the face image to be recognized by the terminal device;
  • performing face recognition according to the face recognition information to obtain a face recognition result includes:
  • the performing feature extraction on the face recognition information to obtain the second face features includes:
  • performing face recognition according to the second face feature, and obtaining a face recognition result includes:
  • a user face feature set including at least one user face feature, and user information corresponding to the user face feature
  • the user information corresponding to the user's face feature is used as the face recognition result
  • the facial recognition result is a non-registered user.
  • the method further includes:
  • a face recognition device comprising:
  • An image determination module configured to determine a face image to be recognized
  • a recognition mode determination module configured to determine the face recognition mode of the face image to be recognized
  • An information sending module configured to send face recognition information to the server according to the face recognition mode, the face recognition information includes a face image to be recognized, and/or a feature extracted from the face image to be recognized first face feature;
  • the result receiving module is configured to receive the face recognition result returned by the server, the face recognition result is obtained according to face recognition on the face recognition information.
  • the identification mode determination module includes:
  • the selection page display submodule is used to display the face recognition mode selection page, and the selection page includes the first recognition control and/or the second recognition control;
  • the first mode determination submodule is configured to determine the face recognition mode of the face image to be recognized as the first recognition mode in response to the first recognition control being triggered, and the first recognition mode is used to send the Face image to be recognized;
  • the second mode determination submodule is used to determine the face recognition mode of the face image to be recognized as the second recognition mode in response to the triggering of the second recognition control, and the second recognition mode is used to send the Describe the first human face feature obtained by performing feature extraction on the face image to be recognized.
  • the information sending module includes:
  • the information determination sub-module is used to input the face image to be recognized into the first feature extraction model obtained by pre-training in response to the face recognition mode being the second recognition mode, and determine that the output first face feature is a face identifying information;
  • the information sending sub-module is configured to send the face recognition information to the server.
  • the determination process of the face recognition result includes:
  • the face recognition result is obtained, and the user face feature set includes at least one user face feature corresponding to the user face feature user information.
  • the device further includes:
  • a user information determination submodule configured to determine current user information in response to the face recognition result being a non-registered user
  • the user information sending sub-module is configured to send the current user information to the server, so as to store the current user information and the corresponding second facial features in the user facial feature set.
  • a face recognition device comprising:
  • the information receiving module is used to receive the face recognition information sent by the terminal device, the face recognition information includes the face image to be recognized, and/or the first person obtained by feature extraction of the face image to be recognized by the terminal device facial features;
  • a face recognition module configured to perform face recognition according to the face recognition information to obtain a face recognition result
  • a result sending module configured to send the face recognition result to the terminal device.
  • the face recognition module includes:
  • the feature extraction submodule is used to perform feature extraction on the face recognition information to obtain a second face feature
  • the face recognition sub-module is configured to perform face recognition according to the second face feature to obtain a face recognition result.
  • the feature extraction submodule includes:
  • a model extraction unit configured to input the first facial feature or the facial image to be recognized into a pre-trained second feature extraction model, and output the second facial feature.
  • the face recognition submodule includes:
  • a set determining unit configured to determine a user face feature set, the user face feature set including at least one user face feature, and user information corresponding to the user face feature;
  • a feature matching unit configured to match the second facial features with the user's facial features to obtain a matching result of the user's facial features
  • the first result determination unit is configured to use the user information corresponding to the user's face feature as the face recognition result in response to the matching result of the user's face feature being successful;
  • the second result determination unit is configured to determine that the face recognition result is a non-registered user in response to the matching result of no user's face feature being a successful match.
  • the device further includes:
  • a feature storage module configured to store the current user information and the corresponding second facial features in the The set of facial features of the user.
  • an electronic device including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
  • a computer-readable storage medium on which computer program instructions are stored, and the above-mentioned method is implemented when the computer program instructions are executed by a processor.
  • a computer program product including computer readable codes, or a non-volatile computer readable storage medium bearing computer readable codes, when the computer readable codes are stored in an electronic device
  • the processor in the electronic device is used to implement the above method.
  • the user can decide whether to upload the face image to the server during the face recognition process, and can upload the feature obtained by extracting the face image when the user does not allow uploading the face image.
  • Face recognition on the server side can also achieve accurate face recognition process.
  • FIG. 1 shows a schematic diagram of an application system of a face recognition method according to an embodiment of the present disclosure
  • FIG. 2 shows a flow chart of a face recognition method on the terminal device side according to an embodiment of the present disclosure
  • Fig. 3 shows a schematic diagram of a face recognition mode selection page according to an embodiment of the present disclosure
  • Fig. 4 shows a schematic diagram of a process of extracting first facial features according to an embodiment of the present disclosure
  • FIG. 5 shows a signaling flow chart of a face recognition method according to an embodiment of the present disclosure
  • FIG. 6 shows a signaling flow chart of another face recognition method according to an embodiment of the present disclosure
  • Fig. 7 shows a signaling flow chart of a process of updating a user's face feature set according to an embodiment of the present disclosure
  • FIG. 8 shows a flow chart of a face recognition method on the server side according to an embodiment of the present disclosure
  • FIG. 9 shows a schematic diagram of a process of extracting second facial features according to an embodiment of the present disclosure.
  • FIG. 10 shows a schematic diagram of a face recognition device on the terminal device side according to an embodiment of the present disclosure
  • FIG. 11 shows a schematic diagram of a face recognition device on the server side according to an embodiment of the present disclosure
  • Fig. 12 shows a schematic diagram of an electronic device according to an embodiment of the present disclosure
  • Fig. 13 shows a schematic diagram of an electronic device according to an embodiment of the present disclosure.
  • Fig. 1 shows a schematic diagram of an application system of a face recognition method according to an embodiment of the present disclosure.
  • the system applying the face recognition method of the embodiment of the present disclosure may include a terminal device 10 and a server 11 connected through a network.
  • the terminal device 10 is used to determine the face image to be recognized and the face recognition mode, and directly send the face image to be recognized to the server 11 for face recognition according to the face recognition mode.
  • extract the first facial feature from the image to be processed according to the face recognition mode, and send the extracted first facial feature to the server 11 for face recognition.
  • the server 11 returns the face recognition result to the terminal device 10 after obtaining the face recognition result based on the received face image to be recognized or the first face feature.
  • the face image to be recognized and the first face feature may also be sent to the server 11 for face recognition.
  • the terminal device 10 may be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device , a computing device, a vehicle-mounted device, a wearable device, etc.
  • the subject of execution of the steps of the method may be executed by hardware, or executed by a processor running computer-executable codes.
  • the face recognition method of the embodiments of the present disclosure may be implemented by a processor calling computer-readable instructions stored in a memory.
  • the server 11 can be a single server, or a server cluster composed of multiple servers.
  • the face recognition method of the embodiments of the present disclosure can be applied to any face recognition scene, such as an application scene in which a smartphone is unlocked through face recognition, or an application scene such as opening a car door by collecting face information through a camera and acquisition device built in a vehicle terminal.
  • Fig. 2 shows a flow chart of a face recognition method on a terminal device side according to an embodiment of the present disclosure.
  • the face recognition method on the terminal device side of the embodiment of the present disclosure includes the following steps:
  • Step S10 determining the face image to be recognized.
  • a face image to be recognized that requires face recognition is determined.
  • the face image to be recognized may be a face image directly collected by a mobile terminal implementing a face recognition method, or an image obtained after preprocessing the collected user's face image.
  • the method of determining the face image to be recognized may also be to receive the face image sent by other electronic devices.
  • the face capture page can be displayed on the display device first.
  • the camera device is turned on, and the user's face image is collected as the face image to be recognized.
  • Step S20 determining the face recognition mode of the face image to be recognized.
  • a face recognition mode of the face image to be recognized is determined, and the face recognition mode is used to characterize a recognition manner of the face image to be recognized.
  • the face recognition mode may be determined according to attribute information of the face image to be recognized, user information of the user in the face image to be recognized, and the like. For example, while obtaining the face image to be recognized, determine the geographical location where the face image to be recognized is obtained, and when the legal regulations corresponding to the geographical location do not allow the upload of the face image to be recognized, determine that the face recognition mode is the first Two modes. Further, when the legal provisions corresponding to the geographic location allow uploading of the face image to be recognized, the face recognition mode is determined to be the first mode.
  • the user can also select the face recognition mode by himself through human-computer interaction with the user.
  • a face recognition mode selection page may be displayed through a display device of the mobile terminal, and the selection page includes a first recognition control and a second recognition control.
  • the first recognition control it is determined that the face recognition mode of the face image to be recognized is the first recognition mode, and the first recognition mode is used to send the face image to be recognized.
  • the second recognition mode it is determined that the face recognition mode of the face image to be recognized is the second recognition mode, and the second recognition mode is used to send the first face feature obtained by feature extraction from the face image to be recognized. That is to say, it is up to the user to choose whether to upload the face image to be recognized to the server for face recognition.
  • the embodiment of the present disclosure may also determine a face recognition mode that simultaneously sends the face image to be recognized and the first face feature as the third recognition mode.
  • Fig. 3 shows a schematic diagram of a face recognition mode selection page according to an embodiment of the present disclosure.
  • the terminal device executing the face recognition method can display a face recognition mode selection page 30 through a display device, which includes a first recognition control 31 and a second recognition control 32 .
  • the terminal device determines that the user allows the upload of the face image to be recognized, that is, determines that the face recognition mode is the first recognition mode for sending the face image to be recognized.
  • the terminal device determines that the user is not allowed to upload the face image to be recognized, that is, determines that the face recognition mode is to send the face image to be recognized and extract the second face feature to obtain the first face feature. recognition pattern.
  • the face recognition mode selection page 30 may only include one recognition control.
  • the terminal device determines that the user allows uploading the face image to be recognized and the first face feature, and directly The face recognition mode is determined as the third recognition mode in which the image of the face to be recognized and the first face feature are simultaneously sent.
  • the embodiment of the present disclosure may also determine the face recognition mode by combining the foregoing multiple manners. For example, while obtaining the face image to be recognized, determine the geographical location where the face image to be recognized is obtained, and when the legal regulations corresponding to the geographical location do not allow the upload of the face image to be recognized, determine that the face recognition mode is the first Two modes. When the legal provisions corresponding to the geographic location allow uploading of facial images to be recognized, the facial recognition mode is determined to be the first mode. Further, when the legal provisions corresponding to the geographic location require the consent of the user to upload the face image to be recognized, the face recognition mode selection page is displayed, and the user can select the required face recognition mode by himself.
  • Step S30 sending face recognition information to the server according to the face recognition mode.
  • the terminal device may determine face recognition information according to the face recognition mode, and send the face recognition information to the server for face recognition.
  • the face recognition information may include a face image to be recognized, and/or a first face feature obtained by feature extraction from the face image to be recognized.
  • the face recognition information may be directly determined as the face image to be recognized.
  • the face recognition mode corresponding to the face image to be recognized is the second recognition mode, it may be determined that the face recognition information is the first face feature extracted from the face image to be recognized.
  • face recognition mode corresponding to the face image to be recognized is the third recognition mode, face recognition information including the face image to be recognized and the first face feature may also be determined.
  • the face recognition mode when the face recognition mode is the first recognition mode, the face image to be recognized may be sent to the server.
  • the face recognition mode is the second recognition mode
  • the first face feature is sent to the server.
  • the face recognition mode is the third recognition mode
  • the first face feature may be determined through a first feature extraction model obtained in advance through training in the terminal device. For example, in response to the face recognition mode being the second recognition mode, the face image to be recognized is input into the pre-trained first feature extraction model, the first face feature output is determined to be face recognition information, and the face recognition information is sent to the server. information.
  • Fig. 4 shows a schematic diagram of a process of extracting first facial features according to an embodiment of the present disclosure.
  • the terminal device inputs the face image 40 to be recognized into the first feature extraction model 41 obtained by pre-training for preliminary feature extraction. , to output the first human face feature 42 representing the key point feature of the human face.
  • Step S40 receiving the face recognition result returned by the server.
  • the server after receiving the face recognition information, performs face recognition according to the face recognition information to obtain a face recognition result. Further, the obtained face recognition result is returned to the terminal device.
  • the process of face recognition by the server may be to input the face recognition information into the pre-trained second feature extraction model through the server, output the second face features, and The face feature set is matched to obtain a face recognition result.
  • the user face feature set includes at least one user face feature and user information corresponding to the user face feature.
  • the server pre-stores a user face feature set including at least one user face feature and user information corresponding to the user face feature.
  • the server can input the face recognition information into the pre-trained second feature extraction model, and output the second face features.
  • the second feature extraction models for feature extraction are the same or different.
  • the server can also perform the first feature extraction model obtained through pre-training before inputting the second feature extraction model. feature extraction.
  • the server performs feature extraction on the first face feature again through the second feature extraction model to obtain a second face feature with higher accuracy.
  • the second face feature is extracted from the first face feature, and the second face feature with higher accuracy is obtained according to the second face feature extraction. Face recognition, improve the accuracy of face recognition results.
  • the similarity between the second facial feature and each user's facial feature in the user's facial feature set calculates the similarity between the second facial feature and each user's facial feature in the user's facial feature set to determine the face recognition result.
  • the user information corresponding to the user's face feature is returned as a face recognition result.
  • the face recognition result is returned as a non-registered user.
  • Fig. 5 shows a signaling flowchart of a face recognition method according to an embodiment of the present disclosure.
  • the face recognition method may include the following steps:
  • Step 50 Determine the face image to be recognized through the terminal device.
  • Step 51 Determine the face recognition mode of the face image to be recognized as the first recognition mode through the terminal device.
  • Step 52 directly send the face image to be recognized to the server through the terminal device.
  • Step 53 extracting high-precision second facial features according to the facial image to be recognized through the server.
  • Step 54 The server matches the second face feature with the pre-stored user face feature set to obtain a face recognition result.
  • Step 55 Return the face recognition result to the terminal device through the server.
  • the above face recognition method can directly upload images for feature extraction when permitted by law and users, respects user privacy and ensures the accuracy of recognition results.
  • Fig. 6 shows a signaling flowchart of another face recognition method according to an embodiment of the present disclosure. As shown in Figure 6, in another possible implementation, the face recognition method may also include the following steps:
  • Step 60 Determine the face image to be recognized through the terminal device.
  • Step 61 Determine, through the terminal device, that the face recognition mode of the face image to be recognized is the second recognition mode.
  • Step 62 Perform preliminary feature extraction on the face image to be recognized through the terminal device to obtain the first face feature.
  • Step 63 Send the first face feature to the server through the terminal device.
  • Step 64 Perform secondary feature extraction on the first facial features through the server to obtain high-precision second facial features.
  • Step 65 The server matches the second face feature with the pre-stored user face feature set to obtain a face recognition result.
  • Step 66 Return the face recognition result to the terminal device through the server.
  • the above-mentioned face recognition method can upload the first face feature obtained by image feature extraction for face recognition without the permission of the user, and ensure the accuracy of the recognition result by performing secondary feature extraction on the first face feature at the server end. degree of accuracy.
  • the terminal device may store the user's current user information and the corresponding second face feature to the server, so as to add the current user as a registered user.
  • the current user information is determined in response to the face recognition result being a non-registered user.
  • the current user information is sent to the server, so that the current user information and the corresponding second facial features are stored in the user facial feature set.
  • the way to determine the current user information may be to display the user information collection page through the display device of the terminal device, and after the user enters the user information through the user information collection page, the user information is determined as the current user information.
  • the second face feature corresponding to the face image to be recognized is stored in the user face feature set as the user face feature corresponding to the current user information.
  • Fig. 7 shows a signaling flowchart of a process of updating a user's face feature set according to an embodiment of the present disclosure.
  • the face recognition method of the embodiment of the present disclosure may also include the following steps:
  • Step 70 Determine through the terminal device that the face recognition result is a non-registered user.
  • Step 71 If the face recognition result is a non-registered user, determine the current user information through the terminal device.
  • Step 72 Send the determined current user information to the server through the terminal device.
  • Step 73 Update the current user information and the second facial feature corresponding to the image to be recognized to the user facial feature set through the server.
  • the embodiment of the present disclosure can determine whether to upload the face image to the server according to legal regulations, or the user can decide whether to upload the face image to the server, so as to ensure compliance with the law and respect for user privacy. Moreover, when the user is not allowed to upload the face image, the features extracted from the face image can be uploaded to the server, and the server can perform face recognition after secondary feature extraction to accurately determine the face recognition result.
  • Fig. 8 shows a flow chart of a face recognition method on the server side according to an embodiment of the present disclosure.
  • the face recognition method on the server side of the embodiment of the present disclosure may include the following steps:
  • Step S50 receiving face recognition information sent by the terminal device.
  • the face recognition information includes a face image to be recognized, and/or a first face feature obtained by feature extraction of the face image to be recognized by the terminal device.
  • the face recognition information includes the face image to be recognized.
  • the face recognition information includes the first face feature obtained by the preliminary feature extraction of the face image to be recognized.
  • Step S60 perform face recognition according to the face recognition information, and obtain a face recognition result.
  • the first face feature obtained by preliminary extraction of the face image to be recognized is a face feature with low precision. Therefore, when the face recognition information includes the face image to be recognized or the first face feature, it is necessary to perform feature extraction on the face recognition information before performing face recognition. For example, feature extraction is performed on the face recognition information to obtain the second face feature. Face recognition is performed according to the second face feature to obtain a face recognition result.
  • the feature extraction process for face recognition information may be to input the first face feature or the face image to be recognized into a pre-trained second feature extraction model, and output the second face feature. That is to say, when the face recognition information is a face image to be recognized, the high-precision second face feature is directly extracted through the second feature extraction model of the server. When the face recognition information is the first face feature with low precision, the first face feature is extracted again through the second feature extraction model of the server to obtain the second face feature with high precision.
  • the server determines the user facial feature set, which includes at least one user facial feature and user information corresponding to the user facial feature. Matching is performed based on the second facial features and the user's facial features to obtain a matching result of the user's facial features. In response to the fact that there is a matching result of the user's face feature, the matching result is successful, and the user information corresponding to the user's face feature is used as the face recognition result. In response to the fact that the matching result of no facial features of the user is successful, it is determined that the facial recognition result is a non-registered user.
  • the manner of matching the second facial feature with the user's facial feature may be to calculate the similarity between the second facial feature and each user's facial feature.
  • Fig. 9 shows a schematic diagram of a process of extracting second facial features according to an embodiment of the present disclosure. As shown in FIG. 9 , after receiving the face recognition information 90 , input the face recognition information 90 into the pre-trained second feature extraction model 91 , and output the high-precision second face feature 92 .
  • Step S40 sending the face recognition result to the terminal device.
  • the server returns the face recognition result to the terminal device after determining the face recognition result.
  • the terminal device may also determine the current user information of the user, so as to update the user's face feature set. That is to say, in response to receiving the current user information returned by the terminal device when the face recognition result is a non-registered user, the current user information and the corresponding second face feature may be stored in the user face feature set.
  • the embodiment of the present disclosure can determine whether to upload the face image to the server according to legal regulations, or the user can decide whether to upload the face image to the server, so as to ensure compliance with the law and respect for user privacy. Moreover, when the user is not allowed to upload the face image, the features extracted from the face image can be uploaded to the server, and the server can perform face recognition after secondary feature extraction to accurately determine the face recognition result.
  • the present disclosure also provides face recognition devices, electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any face recognition method provided in the present disclosure.
  • face recognition devices electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any face recognition method provided in the present disclosure.
  • Fig. 10 shows a schematic diagram of a face recognition device on the terminal device side according to an embodiment of the present disclosure. As shown in Fig. 10 , the device includes:
  • An image determination module 100 configured to determine a face image to be recognized
  • a recognition mode determination module 101 configured to determine the face recognition mode of the face image to be recognized
  • the information sending module 102 is configured to send face recognition information to the server according to the face recognition mode, the face recognition information includes a face image to be recognized, and/or the face image to be recognized is obtained by feature extraction The first face feature of
  • the result receiving module 103 is configured to receive the face recognition result returned by the server, and the face recognition result is obtained by performing face recognition on the face recognition information.
  • the identification mode determination module includes:
  • the selection page display submodule is used to display the face recognition mode selection page, and the selection page includes the first recognition control and/or the second recognition control;
  • the first mode determination submodule is configured to determine the face recognition mode of the face image to be recognized as the first recognition mode in response to the first recognition control being triggered, and the first recognition mode is used to send the Face image to be recognized;
  • the second mode determination submodule is used to determine the face recognition mode of the face image to be recognized as the second recognition mode in response to the triggering of the second recognition control, and the second recognition mode is used to send the Describe the first human face feature obtained by performing feature extraction on the face image to be recognized.
  • the information sending module includes:
  • the information determination sub-module is used to input the face image to be recognized into the first feature extraction model obtained by pre-training in response to the face recognition mode being the second recognition mode, and determine that the output first face feature is a face identifying information;
  • the information sending sub-module is configured to send the face recognition information to the server.
  • the determination process of the face recognition result includes:
  • the face recognition result is obtained, and the user face feature set includes at least one user face feature corresponding to the user face feature user information.
  • the device further includes:
  • a user information determination submodule configured to determine current user information in response to the face recognition result being a non-registered user
  • the user information sending sub-module is configured to send the current user information to the server, so as to store the current user information and the corresponding second facial features in the user facial feature set.
  • FIG. 11 shows a schematic diagram of a face recognition device on the server side according to an embodiment of the present disclosure. As shown in FIG. 11 , the device includes:
  • the information receiving module 110 is configured to receive the face recognition information sent by the terminal device, the face recognition information includes the face image to be recognized, and/or the first feature extracted by the terminal device from the face image to be recognized. facial features;
  • a face recognition module 111 configured to perform face recognition according to the face recognition information to obtain a face recognition result
  • the result sending module 112 is configured to send the face recognition result to the terminal device.
  • the face recognition module includes:
  • the feature extraction submodule is used to perform feature extraction on the face recognition information to obtain a second face feature
  • the face recognition sub-module is configured to perform face recognition according to the second face feature to obtain a face recognition result.
  • the feature extraction submodule includes:
  • a model extraction unit configured to input the first facial feature or the facial image to be recognized into a pre-trained second feature extraction model, and output the second facial feature.
  • the face recognition submodule includes:
  • a set determining unit configured to determine a user face feature set, the user face feature set including at least one user face feature, and user information corresponding to the user face feature;
  • a feature matching unit configured to match the second facial features with the user's facial features to obtain a matching result of the user's facial features
  • the first result determination unit is configured to use the user information corresponding to the user's face feature as the face recognition result in response to the matching result of the user's face feature being successful;
  • the second result determination unit is configured to determine that the face recognition result is a non-registered user in response to the matching result of no user's face feature being a successful match.
  • the device further includes:
  • a feature storage module configured to store the current user information and the corresponding second facial features in the The set of facial features of the user.
  • the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the methods described in the method embodiments above, and its specific implementation can refer to the description of the method embodiments above. For brevity, here No longer.
  • Embodiments of the present disclosure also provide a computer-readable storage medium, on which computer program instructions are stored, and the above-mentioned method is implemented when the computer program instructions are executed by a processor.
  • Computer readable storage media may be volatile or nonvolatile computer readable storage media.
  • An embodiment of the present disclosure also proposes an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to invoke the instructions stored in the memory to execute the above method.
  • An embodiment of the present disclosure also provides a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium carrying computer-readable codes, when the computer-readable codes are stored in a processor of an electronic device When running in the electronic device, the processor in the electronic device executes the above method.
  • Electronic devices may be provided as terminals, servers, or other forms of devices.
  • Fig. 12 shows a schematic diagram of an electronic device 800 according to an embodiment of the present disclosure.
  • the electronic device 800 may be a terminal such as a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, or a personal digital assistant.
  • electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814 , and the communication component 816.
  • the processing component 802 generally controls the overall operations of the electronic device 800, such as those associated with display, telephone calls, data communications, camera operations, and recording operations.
  • the processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802 .
  • the memory 804 is configured to store various types of data to support operations at the electronic device 800 . Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like.
  • the memory 804 can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic or Optical Disk Magnetic Disk
  • the power supply component 806 provides power to various components of the electronic device 800 .
  • Power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 800 .
  • the multimedia component 808 includes a screen providing an output interface between the electronic device 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or swipe action, but also detect duration and pressure associated with the touch or swipe action.
  • the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.
  • the audio component 810 is configured to output and/or input audio signals.
  • the audio component 810 includes a microphone (MIC), which is configured to receive external audio signals when the electronic device 800 is in operation modes, such as call mode, recording mode and voice recognition mode. Received audio signals may be further stored in memory 804 or sent via communication component 816 .
  • the audio component 810 also includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.
  • Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of electronic device 800 .
  • the sensor component 814 can detect the open/closed state of the electronic device 800, the relative positioning of components, such as the display and the keypad of the electronic device 800, the sensor component 814 can also detect the electronic device 800 or a Changes in position of components, presence or absence of user contact with electronic device 800 , electronic device 800 orientation or acceleration/deceleration and temperature changes in electronic device 800 .
  • Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact.
  • Sensor assembly 814 may also include an optical sensor, such as a complementary metal-oxide-semiconductor (CMOS) or charge-coupled device (CCD) image sensor, for use in imaging applications.
  • CMOS complementary metal-oxide-semiconductor
  • CCD charge-coupled device
  • the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
  • the communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices.
  • the electronic device 800 can access a wireless network based on a communication standard, such as a wireless network (WiFi), a second generation mobile communication technology (2G) or a third generation mobile communication technology (3G), or a combination thereof.
  • the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID Radio Frequency Identification
  • IrDA Infrared Data Association
  • UWB Ultra Wide Band
  • Bluetooth Bluetooth
  • electronic device 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A programmable gate array
  • controller microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
  • a non-volatile computer-readable storage medium such as the memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to implement the above method.
  • FIG. 13 shows a schematic diagram of an electronic device 1900 according to an embodiment of the present disclosure.
  • electronic device 1900 may be provided as a server.
  • electronic device 1900 includes processing component 1922 , which further includes one or more processors, and a memory resource represented by memory 1932 for storing instructions executable by processing component 1922 , such as application programs.
  • the application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions.
  • the processing component 1922 is configured to execute instructions to perform the above method.
  • Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input-output (I/O) interface 1958 .
  • the electronic device 1900 can operate based on the operating system stored in the memory 1932, such as the Microsoft server operating system (Windows Server TM ), the graphical user interface-based operating system (Mac OS X TM ) introduced by Apple Inc., and the multi-user and multi-process computer operating system (Unix TM ), a free and open source Unix-like operating system (Linux TM ), an open source Unix-like operating system (FreeBSD TM ), or the like.
  • Microsoft server operating system Windows Server TM
  • Mac OS X TM graphical user interface-based operating system
  • Unix TM multi-user and multi-process computer operating system
  • Linux TM free and open source Unix-like operating system
  • FreeBSD TM open source Unix-like operating system
  • a non-transitory computer-readable storage medium such as the memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to implement the above method.
  • the present disclosure can be a system, method and/or computer program product.
  • a computer program product may include a computer readable storage medium having computer readable program instructions thereon for causing a processor to implement various aspects of the present disclosure.
  • a computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device.
  • a computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Computer-readable storage media include: portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory), static random access memory (SRAM), compact disc read only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanically encoded device, such as a printer with instructions stored thereon A hole card or a raised structure in a groove, and any suitable combination of the above.
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • flash memory static random access memory
  • SRAM static random access memory
  • CD-ROM compact disc read only memory
  • DVD digital versatile disc
  • memory stick floppy disk
  • mechanically encoded device such as a printer with instructions stored thereon
  • a hole card or a raised structure in a groove and any suitable combination of the above.
  • computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals.
  • Computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
  • a network adapter card or a network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
  • Computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or Source or object code written in any combination, including object-oriented programming languages—such as Smalltalk, C++, etc., and conventional procedural programming languages—such as the “C” language or similar programming languages.
  • Computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement.
  • the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as via the Internet using an Internet service provider). connect).
  • LAN local area network
  • WAN wide area network
  • an electronic circuit such as a programmable logic circuit, field programmable gate array (FPGA), or programmable logic array (PLA)
  • FPGA field programmable gate array
  • PDA programmable logic array
  • These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine such that when executed by the processor of the computer or other programmable data processing apparatus , producing an apparatus for realizing the functions/actions specified in one or more blocks in the flowchart and/or block diagram.
  • These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause computers, programmable data processing devices and/or other devices to work in a specific way, so that the computer-readable medium storing instructions includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks in flowcharts and/or block diagrams.
  • each block in a flowchart or block diagram may represent a module, a portion of a program segment, or an instruction that includes one or more Executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified function or action , or may be implemented by a combination of dedicated hardware and computer instructions.
  • the computer program product can be specifically realized by means of hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) etc. wait.
  • a software development kit Software Development Kit, SDK

Landscapes

  • Collating Specific Patterns (AREA)
  • Image Analysis (AREA)

Abstract

A face recognition method and apparatus, an electronic device, and a storage medium. The method comprises: determining, by means of a terminal device, a face image to be recognized and a face recognition mode of the face image to be recognized; sending, to a server according to the face recognition mode, the face image to be recognized and/or a first face feature obtained by performing feature extraction on the face image to be recognized as face recognition information; and after performing face recognition according to the face recognition information, the server returning the obtained face recognition result to the terminal device. During a face recognition process, a user himself/herself can determine whether to upload a face image to a server; and in the case that the user does not allow the uploading of the face image, a feature extracted from the face image can be uploaded to the server for face recognition, so that an accurate face recognition process can also be achieved.

Description

人脸识别方法及装置、电子设备和存储介质Face recognition method and device, electronic device and storage medium
本申请要求2021年09月17日提交、申请号为202111092935.3,发明名称为“人脸识别方法及装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on September 17, 2021, with the application number 202111092935.3, and the title of the invention is "Face recognition method and device, electronic equipment and storage medium", the entire content of which is incorporated by reference in this application middle.
技术领域technical field
本公开涉及计算机技术领域,尤其涉及一种人脸识别方法及装置、电子设备和存储介质。The present disclosure relates to the field of computer technology, and in particular to a face recognition method and device, electronic equipment, and a storage medium.
背景技术Background technique
目前人脸识别技术被广泛应用于各个领域。由于终端设备的算力限制,现有的人脸识别技术在不考虑用户意愿的情况下,直接采集用户的人脸信息上传至服务端进行人脸识别,存在用户隐私泄露的隐患。At present, face recognition technology is widely used in various fields. Due to the limitation of the computing power of the terminal equipment, the existing face recognition technology directly collects the user's face information and uploads it to the server for face recognition without considering the user's wishes, which has the hidden danger of user privacy leakage.
发明内容Contents of the invention
本公开提出了一种人脸识别方法及装置、电子设备和存储介质,旨在尊重用户隐私选择的前提下进行人脸识别过程,并保证人脸识别结果的准确性。The present disclosure proposes a face recognition method and device, electronic equipment, and a storage medium, aiming at performing the face recognition process under the premise of respecting user privacy choices and ensuring the accuracy of face recognition results.
根据本公开的第一方面,提供了一种人脸识别方法,所述方法包括:According to a first aspect of the present disclosure, a face recognition method is provided, the method comprising:
确定待识别人脸图像;Determine the face image to be recognized;
确定所述待识别人脸图像的人脸识别模式;Determine the face recognition mode of the face image to be recognized;
根据所述人脸识别模式向服务端发送人脸识别信息,所述人脸识别信息包括待识别人脸图像,和/或对所述待识别人脸图像进行特征提取得到的第一人脸特征;Send face recognition information to the server according to the face recognition mode, the face recognition information includes a face image to be recognized, and/or a first face feature obtained by feature extraction of the face image to be recognized ;
接收所述服务端返回的人脸识别结果,所述人脸识别结果是根据对所述人脸识别信息进行人脸识别得到。and receiving a face recognition result returned by the server, where the face recognition result is obtained by performing face recognition on the face recognition information.
在一种可能的实现方式中,所述确定所述待识别人脸图像的人脸识别模式包括:In a possible implementation manner, the determining the face recognition mode of the face image to be recognized includes:
显示人脸识别模式选择页面,所述选择页面中包括第一识别控件和/或第二识别控件;Displaying a face recognition mode selection page, the selection page including a first recognition control and/or a second recognition control;
响应于所述第一识别控件被触发,确定所述待识别人脸图像的人脸识别模式为第一识别模式,所述第一识别模式用于发送所述待识别人脸图像;In response to the triggering of the first recognition control, determine the face recognition mode of the face image to be recognized as the first recognition mode, and the first recognition mode is used to send the face image to be recognized;
响应于所述第二识别控件被触发,确定所述待识别人脸图像的人脸识别模式为第二识别模式,所述第二识别模式用于发送对所述待识别人脸图像进行特征提取得到的第一人脸特征。In response to the triggering of the second recognition control, it is determined that the face recognition mode of the face image to be recognized is the second recognition mode, and the second recognition mode is used to send a feature extraction function to the face image to be recognized. Get the first face features.
在一种可能的实现方式中,所述根据所述人脸识别模式向服务端发送人脸识别信息包括:In a possible implementation manner, the sending face recognition information to the server according to the face recognition mode includes:
响应于所述人脸识别模式为第二识别模式,将所述待识别人脸图像输入预先训练得到的第一特征提取模型,确定输出的第一人脸特征为人脸识别信息;In response to the face recognition mode being the second recognition mode, inputting the face image to be recognized into a first feature extraction model obtained through pre-training, and determining that the output first face feature is face recognition information;
向所述服务端发送所述人脸识别信息。Send the face recognition information to the server.
在一种可能的实现方式中,所述人脸识别结果的确定过程包括:In a possible implementation manner, the determination process of the face recognition result includes:
通过服务端将所述人脸识别信息输入预先训练得到的第二特征提取模型,输出第二人脸特征;Input the face recognition information into the pre-trained second feature extraction model through the server, and output the second face feature;
根据所述第二人脸特征与预先存储的用户人脸特征集合进行匹配,得到人脸识别结果,所述用户人脸特征集合中包括至少一个用户人脸特征,和所述用户人脸特征对应的用户信息。According to the matching of the second face feature with the pre-stored user face feature set, the face recognition result is obtained, and the user face feature set includes at least one user face feature corresponding to the user face feature user information.
在一种可能的实现方式中,所述方法还包括:In a possible implementation, the method further includes:
响应于所述人脸识别结果为非注册用户,确定当前用户信息;In response to the face recognition result being a non-registered user, determine current user information;
将所述当前用户信息发送至服务端,以将所述当前用户信息和对应的所述第二人脸特征存储至所述用户人脸特征集合。Send the current user information to the server, so as to store the current user information and the corresponding second facial features in the user facial feature set.
根据本公开的第二方面,提供了一种人脸识别方法,所述方法包括:According to a second aspect of the present disclosure, a face recognition method is provided, the method comprising:
接收终端设备发送的人脸识别信息,所述人脸识别信息包括待识别人脸图像,和/或通过所述终端设备对待识别人脸图像进行特征提取得到的第一人脸特征;receiving face recognition information sent by the terminal device, the face recognition information including the face image to be recognized, and/or the first face feature obtained by feature extraction of the face image to be recognized by the terminal device;
根据所述人脸识别信息进行人脸识别,得到人脸识别结果;performing face recognition according to the face recognition information to obtain a face recognition result;
向所述终端设备发送所述人脸识别结果。Sending the face recognition result to the terminal device.
在一种可能的实现方式中,所述根据所述人脸识别信息进行人脸识别,得到人脸识别结果包括:In a possible implementation manner, performing face recognition according to the face recognition information to obtain a face recognition result includes:
对所述人脸识别信息进行特征提取,得到第二人脸特征;performing feature extraction on the face recognition information to obtain a second face feature;
根据所述第二人脸特征进行人脸识别,得到人脸识别结果。Performing face recognition according to the second face features to obtain a face recognition result.
在一种可能的实现方式中,所述对所述人脸识别信息进行特征提取,得到第二人脸特征包括:In a possible implementation manner, the performing feature extraction on the face recognition information to obtain the second face features includes:
将所述第一人脸特征或所述待识别人脸图像输入预先训练得到的第二特征提取模型,输出第二人脸特征。Inputting the first human face feature or the to-be-recognized human face image into the pre-trained second feature extraction model, and outputting the second human face feature.
在一种可能的实现方式中,所述根据所述第二人脸特征进行人脸识别,得到人脸识别结果包括:In a possible implementation manner, performing face recognition according to the second face feature, and obtaining a face recognition result includes:
确定用户人脸特征集合,所述用户人脸特征集合中包括至少一个用户人脸特征,和所述用户人脸特征对应的用户信息;Determining a user face feature set, the user face feature set including at least one user face feature, and user information corresponding to the user face feature;
根据所述第二人脸特征与所述用户人脸特征进行匹配,得到所述用户人脸特征的匹配结果;matching according to the second facial features and the user's facial features to obtain a matching result of the user's facial features;
响应于存在用户人脸特征的匹配结果为匹配成功,将所述用户人脸特征对应的用户信息作为人脸识别结果;In response to the matching result of the existence of the user's face feature being a successful match, the user information corresponding to the user's face feature is used as the face recognition result;
响应于不存在用户人脸特征的匹配结果为匹配成功,确定所述人脸识别结果为非注册用户。In response to the fact that the matching result of no facial features of the user is successful, it is determined that the facial recognition result is a non-registered user.
在一种可能的实现方式中,所述方法还包括:In a possible implementation, the method further includes:
响应于接收到所述终端设备在人脸识别结果为非注册用户的情况下返回的当前用户信息,将所述当前用户信息和对应的所述第二人脸特征存储至所述用户人脸特征集合。In response to receiving the current user information returned by the terminal device when the face recognition result is a non-registered user, storing the current user information and the corresponding second face feature in the user face feature gather.
根据本公开的第三方面,提供了一种人脸识别装置,所述装置包括:According to a third aspect of the present disclosure, a face recognition device is provided, the device comprising:
图像确定模块,用于确定待识别人脸图像;An image determination module, configured to determine a face image to be recognized;
识别模式确定模块,用于确定所述待识别人脸图像的人脸识别模式;A recognition mode determination module, configured to determine the face recognition mode of the face image to be recognized;
信息发送模块,用于根据所述人脸识别模式向服务端发送人脸识别信息,所述人脸识别信息包括待识别人脸图像,和/或所述待识别人脸图像进行特征提取得到的第一人脸特征;An information sending module, configured to send face recognition information to the server according to the face recognition mode, the face recognition information includes a face image to be recognized, and/or a feature extracted from the face image to be recognized first face feature;
结果接收模块,用于接收所述服务端返回的人脸识别结果,所述人脸识别结果是根据对所述人脸识别信息进行人脸识别得到。The result receiving module is configured to receive the face recognition result returned by the server, the face recognition result is obtained according to face recognition on the face recognition information.
在一种可能的实现方式中,所述识别模式确定模块包括:In a possible implementation manner, the identification mode determination module includes:
选择页面显示子模块,用于显示人脸识别模式选择页面,所述选择页面中包括第一识别控件和/或第二识别控件;The selection page display submodule is used to display the face recognition mode selection page, and the selection page includes the first recognition control and/or the second recognition control;
第一模式确定子模块,用于响应于所述第一识别控件被触发,确定所述待识别人脸图像的人脸识别模式为第一识别模式,所述第一识别模式用于发送所述待识别人脸图像;The first mode determination submodule is configured to determine the face recognition mode of the face image to be recognized as the first recognition mode in response to the first recognition control being triggered, and the first recognition mode is used to send the Face image to be recognized;
第二模式确定子模块,用于响应于所述第二识别控件被触发,确定所述待识别人脸图像的人脸识别模式为第二识别模式,所述第二识别模式用于发送对所述待识别人脸图像进行特征提取得到的第一人脸特征。The second mode determination submodule is used to determine the face recognition mode of the face image to be recognized as the second recognition mode in response to the triggering of the second recognition control, and the second recognition mode is used to send the Describe the first human face feature obtained by performing feature extraction on the face image to be recognized.
在一种可能的实现方式中,所述信息发送模块包括:In a possible implementation manner, the information sending module includes:
信息确定子模块,用于响应于所述人脸识别模式为第二识别模式,将所述待识别人脸图像输入预先训练得到的第一特征提取模型,确定输出的第一人脸特征为人脸识别信息;The information determination sub-module is used to input the face image to be recognized into the first feature extraction model obtained by pre-training in response to the face recognition mode being the second recognition mode, and determine that the output first face feature is a face identifying information;
信息发送子模块,用于向所述服务端发送所述人脸识别信息。The information sending sub-module is configured to send the face recognition information to the server.
在一种可能的实现方式中,所述人脸识别结果的确定过程包括:In a possible implementation manner, the determination process of the face recognition result includes:
通过服务端将所述人脸识别信息输入预先训练得到的第二特征提取模型,输出第二人脸特征;Input the face recognition information into the pre-trained second feature extraction model through the server, and output the second face feature;
根据所述第二人脸特征与预先存储的用户人脸特征集合进行匹配,得到人脸识别结果,所述用户人脸特征集合中包括至少一个用户人脸特征,和所述用户人脸特征对应的用户信息。According to the matching of the second face feature with the pre-stored user face feature set, the face recognition result is obtained, and the user face feature set includes at least one user face feature corresponding to the user face feature user information.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the device further includes:
用户信息确定子模块,用于响应于所述人脸识别结果为非注册用户,确定当前用户信息;A user information determination submodule, configured to determine current user information in response to the face recognition result being a non-registered user;
用户信息发送子模块,用于将所述当前用户信息发送至服务端,以将所述当前用户信息和对应的所述第二人脸特征存储至所述用户人脸特征集合。The user information sending sub-module is configured to send the current user information to the server, so as to store the current user information and the corresponding second facial features in the user facial feature set.
根据本公开的第四方面,提供了一种人脸识别装置,所述装置包括:According to a fourth aspect of the present disclosure, a face recognition device is provided, the device comprising:
信息接收模块,用于接收终端设备发送的人脸识别信息,所述人脸识别信息包括待识别人脸图像,和/或通过所述终端设备对待识别人脸图像进行特征提取得到的第一人脸特征;The information receiving module is used to receive the face recognition information sent by the terminal device, the face recognition information includes the face image to be recognized, and/or the first person obtained by feature extraction of the face image to be recognized by the terminal device facial features;
人脸识别模块,用于根据所述人脸识别信息进行人脸识别,得到人脸识别结果;A face recognition module, configured to perform face recognition according to the face recognition information to obtain a face recognition result;
结果发送模块,用于向所述终端设备发送所述人脸识别结果。A result sending module, configured to send the face recognition result to the terminal device.
在一种可能的实现方式中,所述人脸识别模块包括:In a possible implementation, the face recognition module includes:
特征提取子模块,用于对所述人脸识别信息进行特征提取,得到第二人脸特征;The feature extraction submodule is used to perform feature extraction on the face recognition information to obtain a second face feature;
人脸识别子模块,用于根据所述第二人脸特征进行人脸识别,得到人脸识别结果。The face recognition sub-module is configured to perform face recognition according to the second face feature to obtain a face recognition result.
在一种可能的实现方式中,所述特征提取子模块包括:In a possible implementation, the feature extraction submodule includes:
模型提取单元,用于将所述第一人脸特征或所述待识别人脸图像输入预先训练得到的第二特征提取模型,输出第二人脸特征。A model extraction unit, configured to input the first facial feature or the facial image to be recognized into a pre-trained second feature extraction model, and output the second facial feature.
在一种可能的实现方式中,所述人脸识别子模块包括:In a possible implementation, the face recognition submodule includes:
集合确定单元,用于确定用户人脸特征集合,所述用户人脸特征集合中包括至少一个用户人脸特征,和所述用户人脸特征对应的用户信息;A set determining unit, configured to determine a user face feature set, the user face feature set including at least one user face feature, and user information corresponding to the user face feature;
特征匹配单元,用于根据所述第二人脸特征与所述用户人脸特征进行匹配,得到所述用户人脸特征的匹配结果;A feature matching unit, configured to match the second facial features with the user's facial features to obtain a matching result of the user's facial features;
第一结果确定单元,用于响应于存在用户人脸特征的匹配结果为匹配成功,将所述用户人脸特征对应的用户信息作为人脸识别结果;The first result determination unit is configured to use the user information corresponding to the user's face feature as the face recognition result in response to the matching result of the user's face feature being successful;
第二结果确定单元,用于响应于不存在用户人脸特征的匹配结果为匹配成功,确定所述人脸识别结果为非注册用户。The second result determination unit is configured to determine that the face recognition result is a non-registered user in response to the matching result of no user's face feature being a successful match.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the device further includes:
特征存储模块,用于响应于接收到所述终端设备在人脸识别结果为非注册用户的情况下返回的当前用户信息,将所述当前用户信息和对应的所述第二人脸特征存储至所述用户人脸特征集合。A feature storage module, configured to store the current user information and the corresponding second facial features in the The set of facial features of the user.
根据本公开的第五方面,提供了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。According to a fifth aspect of the present disclosure, there is provided an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
根据本公开的第六方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。According to a sixth aspect of the present disclosure, there is provided a computer-readable storage medium, on which computer program instructions are stored, and the above-mentioned method is implemented when the computer program instructions are executed by a processor.
根据本公开的第七方面,提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行用于实现上述方法。According to a seventh aspect of the present disclosure, there is provided a computer program product, including computer readable codes, or a non-volatile computer readable storage medium bearing computer readable codes, when the computer readable codes are stored in an electronic device When running in the processor of the electronic device, the processor in the electronic device is used to implement the above method.
本公开实施例在人脸识别过程中能够由用户自行决定是否将人脸图像上传至服务端,并且能够在用户不允许上传人脸图像的情况下,可以通过将人脸图像提取得到的特征上传服务端进行人脸识别,也能够实现准确的人脸识别过程。In the embodiment of the present disclosure, the user can decide whether to upload the face image to the server during the face recognition process, and can upload the feature obtained by extracting the face image when the user does not allow uploading the face image. Face recognition on the server side can also achieve accurate face recognition process.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。The accompanying drawings here are incorporated into the description and constitute a part of the present description. These drawings show embodiments consistent with the present disclosure, and are used together with the description to explain the technical solution of the present disclosure.
图1示出根据本公开实施例的一种人脸识别方法的应用系统的示意图;FIG. 1 shows a schematic diagram of an application system of a face recognition method according to an embodiment of the present disclosure;
图2示出根据本公开实施例的终端设备侧的一种人脸识别方法的流程图;FIG. 2 shows a flow chart of a face recognition method on the terminal device side according to an embodiment of the present disclosure;
图3示出根据本公开实施例的一种人脸识别模式选择页面的示意图;Fig. 3 shows a schematic diagram of a face recognition mode selection page according to an embodiment of the present disclosure;
图4示出根据本公开实施例的一种提取第一人脸特征过程的示意图;Fig. 4 shows a schematic diagram of a process of extracting first facial features according to an embodiment of the present disclosure;
图5示出根据本公开实施例的一种人脸识别方法的信令流程图;FIG. 5 shows a signaling flow chart of a face recognition method according to an embodiment of the present disclosure;
图6示出根据本公开实施例的另一种人脸识别方法的信令流程图;FIG. 6 shows a signaling flow chart of another face recognition method according to an embodiment of the present disclosure;
图7示出根据本公开实施例的一种更新用户人脸特征集合过程的信令流程图;Fig. 7 shows a signaling flow chart of a process of updating a user's face feature set according to an embodiment of the present disclosure;
图8示出根据本公开实施例的服务端侧的一种人脸识别方法的流程图;FIG. 8 shows a flow chart of a face recognition method on the server side according to an embodiment of the present disclosure;
图9示出根据本公开实施例的一种提取第二人脸特征过程的示意图;FIG. 9 shows a schematic diagram of a process of extracting second facial features according to an embodiment of the present disclosure;
图10示出根据本公开实施例的终端设备侧的一种人脸识别装置的示意图;FIG. 10 shows a schematic diagram of a face recognition device on the terminal device side according to an embodiment of the present disclosure;
图11示出根据本公开实施例的服务端侧的一种人脸识别装置的示意图;FIG. 11 shows a schematic diagram of a face recognition device on the server side according to an embodiment of the present disclosure;
图12示出根据本公开实施例的一种电子设备的示意图;Fig. 12 shows a schematic diagram of an electronic device according to an embodiment of the present disclosure;
图13示出根据本公开实施例的一种电子设备的示意图。Fig. 13 shows a schematic diagram of an electronic device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。Various exemplary embodiments, features, and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numbers in the figures indicate functionally identical or similar elements. While various aspects of the embodiments are shown in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as superior or better than other embodiments.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this article is just an association relationship describing associated objects, which means that there can be three relationships, for example, A and/or B can mean: A exists alone, A and B exist simultaneously, and there exists alone B these three situations. In addition, the term "at least one" herein means any one of a variety or any combination of at least two of the more, for example, including at least one of A, B, and C, which may mean including from A, Any one or more elements selected from the set formed by B and C.
另外,为了更好地说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific implementation manners. It will be understood by those skilled in the art that the present disclosure may be practiced without some of the specific details. In some instances, methods, means, components and circuits that are well known to those skilled in the art have not been described in detail so as to obscure the gist of the present disclosure.
图1示出根据本公开实施例的一种人脸识别方法的应用系统的示意图。如图1所示,应用本公开实施例的人脸识别方法的系统可以包括通过网络连接的终端设备10和服务端11。其中,终端设备10用于确定待识别人脸图像以及人脸识别模式,并且根据人脸识别模式直接将待识别人脸图像发送至服务端11进行人脸识别。或者根据人脸识别模式对待处理图像进行第一人脸特征提取,将提取到的第一人脸特征发送至服务端11进行人脸识别。该服务端11在基于接收到的待识别人脸图像或者第一人脸特征得到人脸识别结果后,将人脸识别结果返回终端设备10。进一步地,本公开实施例还可以将待识别人脸图像和第一人脸特征一同发送至服务端11进行人脸识别。Fig. 1 shows a schematic diagram of an application system of a face recognition method according to an embodiment of the present disclosure. As shown in FIG. 1 , the system applying the face recognition method of the embodiment of the present disclosure may include a terminal device 10 and a server 11 connected through a network. Among them, the terminal device 10 is used to determine the face image to be recognized and the face recognition mode, and directly send the face image to be recognized to the server 11 for face recognition according to the face recognition mode. Or extract the first facial feature from the image to be processed according to the face recognition mode, and send the extracted first facial feature to the server 11 for face recognition. The server 11 returns the face recognition result to the terminal device 10 after obtaining the face recognition result based on the received face image to be recognized or the first face feature. Further, in the embodiment of the present disclosure, the face image to be recognized and the first face feature may also be sent to the server 11 for face recognition.
在一种可能的实现方式中,终端设备10可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等,该方法步骤的执行主体可以为硬件执行,或者通过处理器运行计算机可执行代码的方式执行。例如,可以通过处理器调用存储器中存储的计算机可读指令的方式来实现本公开实施例的人脸识别方法。服务端11可以为单独的服务器,或者多个服务器组成的服务器集群。In a possible implementation, the terminal device 10 may be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device , a computing device, a vehicle-mounted device, a wearable device, etc., the subject of execution of the steps of the method may be executed by hardware, or executed by a processor running computer-executable codes. For example, the face recognition method of the embodiments of the present disclosure may be implemented by a processor calling computer-readable instructions stored in a memory. The server 11 can be a single server, or a server cluster composed of multiple servers.
本公开实施例的人脸识别方法可以应用于任意人脸识别场景,例如智能手机通过人脸识别解除锁定的应用场景,或者通过车辆内置终端的摄像采集装置采集人脸信息开启车门等应用场景。The face recognition method of the embodiments of the present disclosure can be applied to any face recognition scene, such as an application scene in which a smartphone is unlocked through face recognition, or an application scene such as opening a car door by collecting face information through a camera and acquisition device built in a vehicle terminal.
图2示出根据本公开实施例的终端设备侧的一种人脸识别方法的流程图。如图2所示,在一种可能的实现方式中,本公开实施例终端设备侧的人脸识别方法包括以下步骤:Fig. 2 shows a flow chart of a face recognition method on a terminal device side according to an embodiment of the present disclosure. As shown in FIG. 2, in a possible implementation manner, the face recognition method on the terminal device side of the embodiment of the present disclosure includes the following steps:
步骤S10、确定待识别人脸图像。Step S10, determining the face image to be recognized.
在一种可能的实现方式中,确定需要进行人脸识别的待识别人脸图像。可选地,待识别人脸图像可以为通过执行人脸识别方法的移动终端直接采集的人脸图像,或者对采集的用户人脸图像进行预处理后得到的图像。或者,待识别人脸图像的确定方式还可以为接收其他电子设备发送的人脸图像。In a possible implementation manner, a face image to be recognized that requires face recognition is determined. Optionally, the face image to be recognized may be a face image directly collected by a mobile terminal implementing a face recognition method, or an image obtained after preprocessing the collected user's face image. Alternatively, the method of determining the face image to be recognized may also be to receive the face image sent by other electronic devices.
可选地,在通过执行人脸识别方法的移动终端直接采集人脸图像时,可以先通显示装置显示人脸采集页面。在用户触发显示装置中的人脸采集控件时开启摄像装置,采集用户的人脸图像作为待识别人脸图像。Optionally, when the face image is directly captured by the mobile terminal executing the face recognition method, the face capture page can be displayed on the display device first. When the user triggers the face acquisition control in the display device, the camera device is turned on, and the user's face image is collected as the face image to be recognized.
步骤S20、确定所述待识别人脸图像的人脸识别模式。Step S20, determining the face recognition mode of the face image to be recognized.
在一种可能的实现方式中,确定待识别人脸图像的人脸识别模式,该人脸识别模式用于表征待识别人脸图像的识别方式。可选地,人脸识别模式可以根据待识别人脸图像的属性信息、待识别人脸图 像中用户的用户信息等信息确定。例如,可以在获取待识别人脸图像的同时,确定获取待识别人脸图像的地理位置,在该地理位置对应的法律规定中不允许上传待识别人脸图像时,确定人脸识别模式为第二模式。进一步地,在该地理位置对应的法律规定中允许上传待识别人脸图像时,确定人脸识别模式为第一模式。In a possible implementation manner, a face recognition mode of the face image to be recognized is determined, and the face recognition mode is used to characterize a recognition manner of the face image to be recognized. Optionally, the face recognition mode may be determined according to attribute information of the face image to be recognized, user information of the user in the face image to be recognized, and the like. For example, while obtaining the face image to be recognized, determine the geographical location where the face image to be recognized is obtained, and when the legal regulations corresponding to the geographical location do not allow the upload of the face image to be recognized, determine that the face recognition mode is the first Two modes. Further, when the legal provisions corresponding to the geographic location allow uploading of the face image to be recognized, the face recognition mode is determined to be the first mode.
进一步地,本公开实施例还可以通过与用户人机交互的方式由用户自行选择人脸识别模式。例如,可以通过移动终端的显示装置显示人脸识别模式选择页面,选择页面中包括第一识别控件和第二识别控件。响应于第一识别控件被触发,确定待识别人脸图像的人脸识别模式为第一识别模式,第一识别模式用于发送待识别人脸图像。响应于第二识别控件被触发,确定待识别人脸图像的人脸识别模式为第二识别模式,第二识别模式用于发送对待识别人脸图像进行特征提取得到的第一人脸特征。也就是说,由用户自行选择是否将待识别人脸图像上传至服务端进行人脸识别。Further, in the embodiments of the present disclosure, the user can also select the face recognition mode by himself through human-computer interaction with the user. For example, a face recognition mode selection page may be displayed through a display device of the mobile terminal, and the selection page includes a first recognition control and a second recognition control. In response to the triggering of the first recognition control, it is determined that the face recognition mode of the face image to be recognized is the first recognition mode, and the first recognition mode is used to send the face image to be recognized. In response to the triggering of the second recognition control, it is determined that the face recognition mode of the face image to be recognized is the second recognition mode, and the second recognition mode is used to send the first face feature obtained by feature extraction from the face image to be recognized. That is to say, it is up to the user to choose whether to upload the face image to be recognized to the server for face recognition.
可选地,在法律规定允许的情况下,本公开实施例还可以确定一种同时发送待识别人脸图像和第一人脸特征的人脸识别模式为第三识别模式。Optionally, if permitted by law, the embodiment of the present disclosure may also determine a face recognition mode that simultaneously sends the face image to be recognized and the first face feature as the third recognition mode.
图3示出根据本公开实施例的一种人脸识别模式选择页面的示意图。如图3所示,执行人脸识别方法的终端设备可以通过显示装置显示人脸识别模式选择页面30,其中包括第一识别控件31和第二识别控件32。在用户通过点击等方式触发第一识别控件31时,终端设备确定用户允许上传待识别人脸图像,即确定人脸识别模式为发送待识别人脸图像的第一识别模式。在用户通过点击等方式触发第二识别控件32时,终端设备确定用户不允许上传待识别人脸图像,即确定人脸识别模式为发送待识别人脸图像提取得到第一人脸特征的第二识别模式。Fig. 3 shows a schematic diagram of a face recognition mode selection page according to an embodiment of the present disclosure. As shown in FIG. 3 , the terminal device executing the face recognition method can display a face recognition mode selection page 30 through a display device, which includes a first recognition control 31 and a second recognition control 32 . When the user triggers the first recognition control 31 by clicking or other means, the terminal device determines that the user allows the upload of the face image to be recognized, that is, determines that the face recognition mode is the first recognition mode for sending the face image to be recognized. When the user triggers the second recognition control 32 by clicking or other means, the terminal device determines that the user is not allowed to upload the face image to be recognized, that is, determines that the face recognition mode is to send the face image to be recognized and extract the second face feature to obtain the first face feature. recognition pattern.
进一步地,人脸识别模式选择页面30中还可以仅包括一个识别控件,在用户通过点击等方式触发该识别控件时,终端设备确定用户允许上传待识别人脸图像和第一人脸特征,直接确定人脸识别模式为同时发送待识别人脸图像和第一人脸特征的第三识别模式。Further, the face recognition mode selection page 30 may only include one recognition control. When the user triggers the recognition control by clicking or other means, the terminal device determines that the user allows uploading the face image to be recognized and the first face feature, and directly The face recognition mode is determined as the third recognition mode in which the image of the face to be recognized and the first face feature are simultaneously sent.
在一种可能的实现方式中,本公开实施例还可以通过上述多种方式结合的方式确定人脸识别模式。例如,可以在获取待识别人脸图像的同时,确定获取待识别人脸图像的地理位置,在该地理位置对应的法律规定中不允许上传待识别人脸图像时,确定人脸识别模式为第二模式。在该地理位置对应的法律规定中允许上传待识别人脸图像时,确定人脸识别模式为第一模式。进一步地,在该地理位置对应的法律规定需要用户同意的前提下才能够上传待识别人脸图像时,显示人脸识别模式选择页面,由用户自行选择需要的人脸识别模式。In a possible implementation manner, the embodiment of the present disclosure may also determine the face recognition mode by combining the foregoing multiple manners. For example, while obtaining the face image to be recognized, determine the geographical location where the face image to be recognized is obtained, and when the legal regulations corresponding to the geographical location do not allow the upload of the face image to be recognized, determine that the face recognition mode is the first Two modes. When the legal provisions corresponding to the geographic location allow uploading of facial images to be recognized, the facial recognition mode is determined to be the first mode. Further, when the legal provisions corresponding to the geographic location require the consent of the user to upload the face image to be recognized, the face recognition mode selection page is displayed, and the user can select the required face recognition mode by himself.
步骤S30、根据所述人脸识别模式向服务端发送人脸识别信息。Step S30, sending face recognition information to the server according to the face recognition mode.
在一种可能的实现方式中,终端设备在确定人脸识别模式后,可以根据该人脸识别模式确定人脸识别信息,并向服务端发送该人脸识别信息进行人脸识别。其中,人脸识别信息可以包括待识别人脸图像,和/或待识别人脸图像进行特征提取得到的第一人脸特征。例如,当待识别人脸图像对应的人脸识别模式为第一识别模式时,可以直接确定人脸识别信息为待识别人脸图像。当待识别人脸图像对应的人脸识别模式为第二识别模式时,可以确定人脸识别信息为待识别人脸图像提取得到的第一人脸特征。进一步地,当待识别人脸图像对应的人脸识别模式为第三识别模式时,还可以确定包括待识别人脸图像和第一人脸特征的人脸识别信息。In a possible implementation manner, after determining the face recognition mode, the terminal device may determine face recognition information according to the face recognition mode, and send the face recognition information to the server for face recognition. Wherein, the face recognition information may include a face image to be recognized, and/or a first face feature obtained by feature extraction from the face image to be recognized. For example, when the face recognition mode corresponding to the face image to be recognized is the first recognition mode, the face recognition information may be directly determined as the face image to be recognized. When the face recognition mode corresponding to the face image to be recognized is the second recognition mode, it may be determined that the face recognition information is the first face feature extracted from the face image to be recognized. Further, when the face recognition mode corresponding to the face image to be recognized is the third recognition mode, face recognition information including the face image to be recognized and the first face feature may also be determined.
也就是说,可以在人脸识别模式为第一识别模式时,向服务端发送待识别人脸图像。在人脸识别 模式为第二识别模式时,向服务端发送第一人脸特征。或者在人脸识别模式为第三识别模式时,向服务端发送待识别人脸图像和第一人脸特征。其中,第一人脸特征可以通过终端设备中预先训练得到的第一特征提取模型确定。例如响应于人脸识别模式为第二识别模式,将待识别人脸图像输入预先训练得到的第一特征提取模型,确定输出的第一人脸特征为人脸识别信息,向服务端发送人脸识别信息。That is to say, when the face recognition mode is the first recognition mode, the face image to be recognized may be sent to the server. When the face recognition mode is the second recognition mode, the first face feature is sent to the server. Or when the face recognition mode is the third recognition mode, send the face image to be recognized and the first face feature to the server. Wherein, the first face feature may be determined through a first feature extraction model obtained in advance through training in the terminal device. For example, in response to the face recognition mode being the second recognition mode, the face image to be recognized is input into the pre-trained first feature extraction model, the first face feature output is determined to be face recognition information, and the face recognition information is sent to the server. information.
图4示出根据本公开实施例的一种提取第一人脸特征过程的示意图。如图4所示,在待识别人脸图像对应的人脸识别模式为第一识别模式时,终端设备将待识别人脸图像40输入预先训练得到的第一特征提取模型41进行初步的特征提取,以输出表征人脸关键点特征的第一人脸特征42。Fig. 4 shows a schematic diagram of a process of extracting first facial features according to an embodiment of the present disclosure. As shown in FIG. 4 , when the face recognition mode corresponding to the face image to be recognized is the first recognition mode, the terminal device inputs the face image 40 to be recognized into the first feature extraction model 41 obtained by pre-training for preliminary feature extraction. , to output the first human face feature 42 representing the key point feature of the human face.
步骤S40、接收所述服务端返回的人脸识别结果。Step S40, receiving the face recognition result returned by the server.
在一种可能的实现方式中,服务端在接收到人脸识别信息后,根据人脸识别信息进行人脸识别得到人脸识别结果。进一步地,将得到的人脸识别结果返回终端设备。其中,服务端进行人脸识别的过程可以为通过服务端将人脸识别信息输入预先训练得到的第二特征提取模型,输出第二人脸特征,根据第二人脸特征与预先存储的用户人脸特征集合进行匹配,得到人脸识别结果,用户人脸特征集合中包括至少一个用户人脸特征,和用户人脸特征对应的用户信息。In a possible implementation manner, after receiving the face recognition information, the server performs face recognition according to the face recognition information to obtain a face recognition result. Further, the obtained face recognition result is returned to the terminal device. Wherein, the process of face recognition by the server may be to input the face recognition information into the pre-trained second feature extraction model through the server, output the second face features, and The face feature set is matched to obtain a face recognition result. The user face feature set includes at least one user face feature and user information corresponding to the user face feature.
也就是说,服务端中预先存储包括至少一个用户人脸特征和用户人脸特征对应用户信息的用户人脸特征集合。在接收到人脸识别信息后,服务端可以将人脸识别信息输入预先训练的到的第二特征提取模型,输出第二人脸特征。其中,对于内容不同的人脸识别信息,进行特征提取的第二特征提取模型相同或者不同。进一步地,当第二特征提取模型相同且人脸识别信息为待识别人脸图像时,服务端还可以在输入第二特征提取模型之前,先通过预先训练得到的第一特征提取模型进行第一次特征提取。当人脸识别信息为第一人脸特征时,服务端通过第二特征提取模型对第一人脸特征再次进行特征提取,得到精度更高的第二人脸特征。That is to say, the server pre-stores a user face feature set including at least one user face feature and user information corresponding to the user face feature. After receiving the face recognition information, the server can input the face recognition information into the pre-trained second feature extraction model, and output the second face features. Wherein, for face recognition information with different contents, the second feature extraction models for feature extraction are the same or different. Further, when the second feature extraction model is the same and the face recognition information is a face image to be recognized, the server can also perform the first feature extraction model obtained through pre-training before inputting the second feature extraction model. feature extraction. When the face recognition information is the first face feature, the server performs feature extraction on the first face feature again through the second feature extraction model to obtain a second face feature with higher accuracy.
本公开实施例在终端设备传输的人脸识别信息为第一人脸特征时,对第一人脸特征进行二次特征提取,以根据二次特征提取到精度较高的第二人脸特征进行人脸识别,提高人脸识别结果的准确度。In the embodiment of the present disclosure, when the face recognition information transmitted by the terminal device is the first face feature, the second face feature is extracted from the first face feature, and the second face feature with higher accuracy is obtained according to the second face feature extraction. Face recognition, improve the accuracy of face recognition results.
可选地,在得到待识别图像对应的第二人脸特征后,计算第二人脸特征和用户人脸特征集合中各用户人脸特征的相似度以确定人脸识别结果。其中,在存在相似度大于阈值的用户人脸特征时,确定该用户人脸特征与第二人脸特征匹配,并将该用户人脸特征对应的用户信息作为人脸识别结果返回。在不存在相似度大于阈值的用户人脸特征时,确定不存在用户人脸特征与第二人脸特征匹配,并返回人脸识别结果为非注册用户。Optionally, after obtaining the second facial feature corresponding to the image to be recognized, calculate the similarity between the second facial feature and each user's facial feature in the user's facial feature set to determine the face recognition result. Wherein, when there is a user's face feature whose similarity is greater than a threshold, it is determined that the user's face feature matches the second face feature, and the user information corresponding to the user's face feature is returned as a face recognition result. When there is no facial feature of the user whose similarity is greater than the threshold, it is determined that no facial feature of the user matches the second facial feature, and the face recognition result is returned as a non-registered user.
图5示出根据本公开实施例的一种人脸识别方法的信令流程图。如图5所示,在一种可能的实现方式中,人脸识别方法可以包括以下步骤:Fig. 5 shows a signaling flowchart of a face recognition method according to an embodiment of the present disclosure. As shown in Figure 5, in a possible implementation, the face recognition method may include the following steps:
步骤50、通过终端设备确定待识别人脸图像。 Step 50. Determine the face image to be recognized through the terminal device.
步骤51、通过终端设备确定待识别人脸图像的人脸识别模式为第一识别模式。Step 51. Determine the face recognition mode of the face image to be recognized as the first recognition mode through the terminal device.
步骤52、通过终端设备直接将待识别人脸图像发送至服务端。Step 52, directly send the face image to be recognized to the server through the terminal device.
步骤53、通过服务端根据待识别人脸图像提取高精度的第二人脸特征。 Step 53, extracting high-precision second facial features according to the facial image to be recognized through the server.
步骤54、通过服务端根据第二人脸特征与预存的用户人脸特征集合进行匹配,得到人脸识别结果。Step 54: The server matches the second face feature with the pre-stored user face feature set to obtain a face recognition result.
步骤55、通过服务端将人脸识别结果返回终端设备。Step 55: Return the face recognition result to the terminal device through the server.
上述人脸识别方法能够在法律以及用户允许的情况下直接上传图像进行特征提取,尊重用户隐私 且保证识别结果的准确程度。The above face recognition method can directly upload images for feature extraction when permitted by law and users, respects user privacy and ensures the accuracy of recognition results.
图6示出根据本公开实施例的另一种人脸识别方法的信令流程图。如图6所示,在另一种可能的实现方式中,人脸识别方法还可以包括以下步骤:Fig. 6 shows a signaling flowchart of another face recognition method according to an embodiment of the present disclosure. As shown in Figure 6, in another possible implementation, the face recognition method may also include the following steps:
步骤60、通过终端设备确定待识别人脸图像。 Step 60. Determine the face image to be recognized through the terminal device.
步骤61、通过终端设备确定待识别人脸图像的人脸识别模式为第二识别模式。Step 61. Determine, through the terminal device, that the face recognition mode of the face image to be recognized is the second recognition mode.
步骤62、通过终端设备对待识别人脸图像进行初步的特征提取,得到第一人脸特征。Step 62: Perform preliminary feature extraction on the face image to be recognized through the terminal device to obtain the first face feature.
步骤63、通过终端设备将第一人脸特征发送至服务端。Step 63: Send the first face feature to the server through the terminal device.
步骤64、通过服务端对第一人脸特征进行二次特征提取,得到高精度的第二人脸特征。Step 64: Perform secondary feature extraction on the first facial features through the server to obtain high-precision second facial features.
步骤65、通过服务端根据第二人脸特征与预存的用户人脸特征集合进行匹配,得到人脸识别结果。Step 65: The server matches the second face feature with the pre-stored user face feature set to obtain a face recognition result.
步骤66、通过服务端将人脸识别结果返回终端设备。Step 66: Return the face recognition result to the terminal device through the server.
上述人脸识别方法能够在用户不允许的情况下上传图像特征提取得到的第一人脸特征进行人脸识别,并通过服务端对第一人脸特征进行二次特征提取的方式保证识别结果的准确程度。The above-mentioned face recognition method can upload the first face feature obtained by image feature extraction for face recognition without the permission of the user, and ensure the accuracy of the recognition result by performing secondary feature extraction on the first face feature at the server end. degree of accuracy.
进一步地,在人脸识别结果为非注册用户时,终端设备可以将该用户的当前用户信息和对应的第二人脸特征存储至服务端,以将当前用户添加为注册用户。例如,响应于人脸识别结果为非注册用户,确定当前用户信息。将当前用户信息发送至服务端,以将当前用户信息和对应的第二人脸特征存储至用户人脸特征集合。可选地,确定当前用户信息的方式可以为通过终端设备的显示装置显示用户信息采集页面,在用户通过该用户信息采集页面输入用户信息后,确定该用户信息为当前用户信息。进一步地,将待识别人脸图像对应的第二人脸特征作为当前用户信息对应的用户人脸特征,存储至用户人脸特征集合。Further, when the face recognition result is a non-registered user, the terminal device may store the user's current user information and the corresponding second face feature to the server, so as to add the current user as a registered user. For example, the current user information is determined in response to the face recognition result being a non-registered user. The current user information is sent to the server, so that the current user information and the corresponding second facial features are stored in the user facial feature set. Optionally, the way to determine the current user information may be to display the user information collection page through the display device of the terminal device, and after the user enters the user information through the user information collection page, the user information is determined as the current user information. Further, the second face feature corresponding to the face image to be recognized is stored in the user face feature set as the user face feature corresponding to the current user information.
图7示出根据本公开实施例的一种更新用户人脸特征集合过程的信令流程图。如图7所示,在一种可能的实现方式中,本公开实施例的人脸识别方法还可以包括以下步骤:Fig. 7 shows a signaling flowchart of a process of updating a user's face feature set according to an embodiment of the present disclosure. As shown in FIG. 7, in a possible implementation, the face recognition method of the embodiment of the present disclosure may also include the following steps:
步骤70、通过终端设备确定人脸识别结果为非注册用户。Step 70: Determine through the terminal device that the face recognition result is a non-registered user.
步骤71、在人脸识别结果为非注册用户的情况下,通过终端设备确定当前用户信息。 Step 71. If the face recognition result is a non-registered user, determine the current user information through the terminal device.
步骤72、通过终端设备将确定的当前用户信息发送至服务端。Step 72: Send the determined current user information to the server through the terminal device.
步骤73、通过服务端将当前用户信息,和待识别图像对应的第二人脸特征更新至用户人脸特征集合中。Step 73: Update the current user information and the second facial feature corresponding to the image to be recognized to the user facial feature set through the server.
本公开实施例在人脸识别过程中能够根据法律规定确定是否将人脸图像上传至服务端,或者由用户自行决定是否将人脸图像上传至服务端,保证遵循法律且尊重用户隐私。并且,还能够在用户不允许上传人脸图像的情况下,将人脸图像提取得到的特征上传服务端,由服务端进行二次特征提取后进行人脸识别,准确的确定人脸识别结果。In the face recognition process, the embodiment of the present disclosure can determine whether to upload the face image to the server according to legal regulations, or the user can decide whether to upload the face image to the server, so as to ensure compliance with the law and respect for user privacy. Moreover, when the user is not allowed to upload the face image, the features extracted from the face image can be uploaded to the server, and the server can perform face recognition after secondary feature extraction to accurately determine the face recognition result.
图8示出根据本公开实施例的服务端侧的一种人脸识别方法的流程图。如图8所示,在一种可能的实现方式中,本公开实施例的服务端侧的人脸识别方法可以包括以下步骤:Fig. 8 shows a flow chart of a face recognition method on the server side according to an embodiment of the present disclosure. As shown in FIG. 8, in a possible implementation manner, the face recognition method on the server side of the embodiment of the present disclosure may include the following steps:
步骤S50、接收终端设备发送的人脸识别信息。Step S50, receiving face recognition information sent by the terminal device.
在一种可能的实现方式中,人脸识别信息包括待识别人脸图像,和/或通过终端设备对待识别人脸图像进行特征提取得到的第一人脸特征。其中,待识别人脸图像对应的人脸识别模式为第一人脸识别模式时,该人脸识别信息中包括待识别人脸图像。待识别人脸图像对应的人脸识别模式为第二人脸 识别模式时,该人脸识别信息中包括待识别人脸图像初步特征提取得到的第一人脸特征。In a possible implementation manner, the face recognition information includes a face image to be recognized, and/or a first face feature obtained by feature extraction of the face image to be recognized by the terminal device. Wherein, when the face recognition mode corresponding to the face image to be recognized is the first face recognition mode, the face recognition information includes the face image to be recognized. When the face recognition mode corresponding to the face image to be recognized is the second face recognition mode, the face recognition information includes the first face feature obtained by the preliminary feature extraction of the face image to be recognized.
步骤S60、根据所述人脸识别信息进行人脸识别,得到人脸识别结果。Step S60, perform face recognition according to the face recognition information, and obtain a face recognition result.
在一种可能的实现方式中,由于终端设备的算力限制,待识别人脸图像进行初步提取得到的第一人脸特征为精度较低的人脸特征。因此,在人脸识别信息中包括待识别人脸图像或第一人脸特征时,均需要对人脸识别信息进行特征提取后再进行人脸识别。例如对人脸识别信息进行特征提取,得到第二人脸特征。根据第二人脸特征进行人脸识别,得到人脸识别结果。In a possible implementation manner, due to the limitation of the computing power of the terminal device, the first face feature obtained by preliminary extraction of the face image to be recognized is a face feature with low precision. Therefore, when the face recognition information includes the face image to be recognized or the first face feature, it is necessary to perform feature extraction on the face recognition information before performing face recognition. For example, feature extraction is performed on the face recognition information to obtain the second face feature. Face recognition is performed according to the second face feature to obtain a face recognition result.
可选地,对人脸识别信息进行特征提取的过程可以为将第一人脸特征或待识别人脸图像输入预先训练得到的第二特征提取模型,输出第二人脸特征。也就是说,在人脸识别信息为待识别人脸图像时,直接通过服务端的第二特征提取模型提取得到高精度的第二人脸特征。在人脸识别信息为精度较低的第一人脸特征时,通过服务端的第二特征提取模型对第一人脸特征再次进行特征提取,得到精度高的第二人脸特征。Optionally, the feature extraction process for face recognition information may be to input the first face feature or the face image to be recognized into a pre-trained second feature extraction model, and output the second face feature. That is to say, when the face recognition information is a face image to be recognized, the high-precision second face feature is directly extracted through the second feature extraction model of the server. When the face recognition information is the first face feature with low precision, the first face feature is extracted again through the second feature extraction model of the server to obtain the second face feature with high precision.
进一步地,在得到第二人脸特征后,服务端确定用户人脸特征集合,用户人脸特征集合中包括至少一个用户人脸特征,和用户人脸特征对应的用户信息。根据第二人脸特征与用户人脸特征进行匹配,得到用户人脸特征的匹配结果。响应于存在用户人脸特征的匹配结果为匹配成功,将用户人脸特征对应的用户信息作为人脸识别结果。响应于不存在用户人脸特征的匹配结果为匹配成功,确定人脸识别结果为非注册用户。可选地,根据第二人脸特征与用户人脸特征进行匹配的方式可以为计算第二人脸特征与各用户人脸特征的相似度。Further, after obtaining the second facial feature, the server determines the user facial feature set, which includes at least one user facial feature and user information corresponding to the user facial feature. Matching is performed based on the second facial features and the user's facial features to obtain a matching result of the user's facial features. In response to the fact that there is a matching result of the user's face feature, the matching result is successful, and the user information corresponding to the user's face feature is used as the face recognition result. In response to the fact that the matching result of no facial features of the user is successful, it is determined that the facial recognition result is a non-registered user. Optionally, the manner of matching the second facial feature with the user's facial feature may be to calculate the similarity between the second facial feature and each user's facial feature.
图9示出根据本公开实施例的一种提取第二人脸特征过程的示意图。如图9所示,在接收到人脸识别信息90后,将人脸识别信息90输入预先训练得到的第二特征提取模型91,输出高精度的第二人脸特征92。Fig. 9 shows a schematic diagram of a process of extracting second facial features according to an embodiment of the present disclosure. As shown in FIG. 9 , after receiving the face recognition information 90 , input the face recognition information 90 into the pre-trained second feature extraction model 91 , and output the high-precision second face feature 92 .
步骤S40、向所述终端设备发送所述人脸识别结果。Step S40, sending the face recognition result to the terminal device.
在一种可能的实现方式中,服务端在确定人脸识别结果后将人脸识别结果返回终端设备。进一步地,终端设备在人脸识别结果为非注册用户的情况下,还可以确定用户的当前用户信息,以更新用户人脸特征集合。也就是说,可以响应于接收到终端设备在人脸识别结果为非注册用户的情况下返回的当前用户信息,将当前用户信息和对应的第二人脸特征存储至用户人脸特征集合。In a possible implementation manner, the server returns the face recognition result to the terminal device after determining the face recognition result. Further, when the face recognition result is a non-registered user, the terminal device may also determine the current user information of the user, so as to update the user's face feature set. That is to say, in response to receiving the current user information returned by the terminal device when the face recognition result is a non-registered user, the current user information and the corresponding second face feature may be stored in the user face feature set.
本公开实施例在人脸识别过程中能够根据法律规定确定是否将人脸图像上传至服务端,或者由用户自行决定是否将人脸图像上传至服务端,保证遵循法律且尊重用户隐私。并且,还能够在用户不允许上传人脸图像的情况下,将人脸图像提取得到的特征上传服务端,由服务端进行二次特征提取后进行人脸识别,准确的确定人脸识别结果。In the face recognition process, the embodiment of the present disclosure can determine whether to upload the face image to the server according to legal regulations, or the user can decide whether to upload the face image to the server, so as to ensure compliance with the law and respect for user privacy. Moreover, when the user is not allowed to upload the face image, the features extracted from the face image can be uploaded to the server, and the server can perform face recognition after secondary feature extraction to accurately determine the face recognition result.
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。It can be understood that the above-mentioned method embodiments mentioned in this disclosure can all be combined with each other to form a combined embodiment without violating the principle and logic. Due to space limitations, this disclosure will not repeat them. Those skilled in the art can understand that, in the above method in the specific implementation manner, the specific execution order of each step should be determined according to its function and possible internal logic.
此外,本公开还提供了人脸识别装置、电子设备、计算机可读存储介质、程序,上述均可用来实现本公开提供的任一种人脸识别方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。In addition, the present disclosure also provides face recognition devices, electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any face recognition method provided in the present disclosure. For the corresponding technical solutions and descriptions, refer to the method section Corresponding records are not repeated here.
图10示出根据本公开实施例的终端设备侧的一种人脸识别装置的示意图,如图10所示,所述装置包括:Fig. 10 shows a schematic diagram of a face recognition device on the terminal device side according to an embodiment of the present disclosure. As shown in Fig. 10 , the device includes:
图像确定模块100,用于确定待识别人脸图像;An image determination module 100, configured to determine a face image to be recognized;
识别模式确定模块101,用于确定所述待识别人脸图像的人脸识别模式;A recognition mode determination module 101, configured to determine the face recognition mode of the face image to be recognized;
信息发送模块102,用于根据所述人脸识别模式向服务端发送人脸识别信息,所述人脸识别信息包括待识别人脸图像,和/或所述待识别人脸图像进行特征提取得到的第一人脸特征;The information sending module 102 is configured to send face recognition information to the server according to the face recognition mode, the face recognition information includes a face image to be recognized, and/or the face image to be recognized is obtained by feature extraction The first face feature of
结果接收模块103,用于接收所述服务端返回的人脸识别结果,所述人脸识别结果是根据对所述人脸识别信息进行人脸识别得到。The result receiving module 103 is configured to receive the face recognition result returned by the server, and the face recognition result is obtained by performing face recognition on the face recognition information.
在一种可能的实现方式中,所述识别模式确定模块包括:In a possible implementation manner, the identification mode determination module includes:
选择页面显示子模块,用于显示人脸识别模式选择页面,所述选择页面中包括第一识别控件和/或第二识别控件;The selection page display submodule is used to display the face recognition mode selection page, and the selection page includes the first recognition control and/or the second recognition control;
第一模式确定子模块,用于响应于所述第一识别控件被触发,确定所述待识别人脸图像的人脸识别模式为第一识别模式,所述第一识别模式用于发送所述待识别人脸图像;The first mode determination submodule is configured to determine the face recognition mode of the face image to be recognized as the first recognition mode in response to the first recognition control being triggered, and the first recognition mode is used to send the Face image to be recognized;
第二模式确定子模块,用于响应于所述第二识别控件被触发,确定所述待识别人脸图像的人脸识别模式为第二识别模式,所述第二识别模式用于发送对所述待识别人脸图像进行特征提取得到的第一人脸特征。The second mode determination submodule is used to determine the face recognition mode of the face image to be recognized as the second recognition mode in response to the triggering of the second recognition control, and the second recognition mode is used to send the Describe the first human face feature obtained by performing feature extraction on the face image to be recognized.
在一种可能的实现方式中,所述信息发送模块包括:In a possible implementation manner, the information sending module includes:
信息确定子模块,用于响应于所述人脸识别模式为第二识别模式,将所述待识别人脸图像输入预先训练得到的第一特征提取模型,确定输出的第一人脸特征为人脸识别信息;The information determination sub-module is used to input the face image to be recognized into the first feature extraction model obtained by pre-training in response to the face recognition mode being the second recognition mode, and determine that the output first face feature is a face identifying information;
信息发送子模块,用于向所述服务端发送所述人脸识别信息。The information sending sub-module is configured to send the face recognition information to the server.
在一种可能的实现方式中,所述人脸识别结果的确定过程包括:In a possible implementation manner, the determination process of the face recognition result includes:
通过服务端将所述人脸识别信息输入预先训练得到的第二特征提取模型,输出第二人脸特征;Input the face recognition information into the pre-trained second feature extraction model through the server, and output the second face feature;
根据所述第二人脸特征与预先存储的用户人脸特征集合进行匹配,得到人脸识别结果,所述用户人脸特征集合中包括至少一个用户人脸特征,和所述用户人脸特征对应的用户信息。According to the matching of the second face feature with the pre-stored user face feature set, the face recognition result is obtained, and the user face feature set includes at least one user face feature corresponding to the user face feature user information.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the device further includes:
用户信息确定子模块,用于响应于所述人脸识别结果为非注册用户,确定当前用户信息;A user information determination submodule, configured to determine current user information in response to the face recognition result being a non-registered user;
用户信息发送子模块,用于将所述当前用户信息发送至服务端,以将所述当前用户信息和对应的所述第二人脸特征存储至所述用户人脸特征集合。The user information sending sub-module is configured to send the current user information to the server, so as to store the current user information and the corresponding second facial features in the user facial feature set.
图11示出根据本公开实施例的服务端侧的一种人脸识别装置的示意图,如图11所示,所述装置包括:FIG. 11 shows a schematic diagram of a face recognition device on the server side according to an embodiment of the present disclosure. As shown in FIG. 11 , the device includes:
信息接收模块110,用于接收终端设备发送的人脸识别信息,所述人脸识别信息包括待识别人脸图像,和/或通过所述终端设备对待识别人脸图像进行特征提取得到的第一人脸特征;The information receiving module 110 is configured to receive the face recognition information sent by the terminal device, the face recognition information includes the face image to be recognized, and/or the first feature extracted by the terminal device from the face image to be recognized. facial features;
人脸识别模块111,用于根据所述人脸识别信息进行人脸识别,得到人脸识别结果;A face recognition module 111, configured to perform face recognition according to the face recognition information to obtain a face recognition result;
结果发送模块112,用于向所述终端设备发送所述人脸识别结果。The result sending module 112 is configured to send the face recognition result to the terminal device.
在一种可能的实现方式中,所述人脸识别模块包括:In a possible implementation, the face recognition module includes:
特征提取子模块,用于对所述人脸识别信息进行特征提取,得到第二人脸特征;The feature extraction submodule is used to perform feature extraction on the face recognition information to obtain a second face feature;
人脸识别子模块,用于根据所述第二人脸特征进行人脸识别,得到人脸识别结果。The face recognition sub-module is configured to perform face recognition according to the second face feature to obtain a face recognition result.
在一种可能的实现方式中,所述特征提取子模块包括:In a possible implementation, the feature extraction submodule includes:
模型提取单元,用于将所述第一人脸特征或所述待识别人脸图像输入预先训练得到的第二特征提取模型,输出第二人脸特征。A model extraction unit, configured to input the first facial feature or the facial image to be recognized into a pre-trained second feature extraction model, and output the second facial feature.
在一种可能的实现方式中,所述人脸识别子模块包括:In a possible implementation, the face recognition submodule includes:
集合确定单元,用于确定用户人脸特征集合,所述用户人脸特征集合中包括至少一个用户人脸特征,和所述用户人脸特征对应的用户信息;A set determining unit, configured to determine a user face feature set, the user face feature set including at least one user face feature, and user information corresponding to the user face feature;
特征匹配单元,用于根据所述第二人脸特征与所述用户人脸特征进行匹配,得到所述用户人脸特征的匹配结果;A feature matching unit, configured to match the second facial features with the user's facial features to obtain a matching result of the user's facial features;
第一结果确定单元,用于响应于存在用户人脸特征的匹配结果为匹配成功,将所述用户人脸特征对应的用户信息作为人脸识别结果;The first result determination unit is configured to use the user information corresponding to the user's face feature as the face recognition result in response to the matching result of the user's face feature being successful;
第二结果确定单元,用于响应于不存在用户人脸特征的匹配结果为匹配成功,确定所述人脸识别结果为非注册用户。The second result determination unit is configured to determine that the face recognition result is a non-registered user in response to the matching result of no user's face feature being a successful match.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the device further includes:
特征存储模块,用于响应于接收到所述终端设备在人脸识别结果为非注册用户的情况下返回的当前用户信息,将所述当前用户信息和对应的所述第二人脸特征存储至所述用户人脸特征集合。A feature storage module, configured to store the current user information and the corresponding second facial features in the The set of facial features of the user.
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the methods described in the method embodiments above, and its specific implementation can refer to the description of the method embodiments above. For brevity, here No longer.
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。计算机可读存储介质可以是易失性或非易失性计算机可读存储介质。Embodiments of the present disclosure also provide a computer-readable storage medium, on which computer program instructions are stored, and the above-mentioned method is implemented when the computer program instructions are executed by a processor. Computer readable storage media may be volatile or nonvolatile computer readable storage media.
本公开实施例还提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。An embodiment of the present disclosure also proposes an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to invoke the instructions stored in the memory to execute the above method.
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行上述方法。An embodiment of the present disclosure also provides a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium carrying computer-readable codes, when the computer-readable codes are stored in a processor of an electronic device When running in the electronic device, the processor in the electronic device executes the above method.
电子设备可以被提供为终端、服务器或其它形态的设备。Electronic devices may be provided as terminals, servers, or other forms of devices.
图12示出根据本公开实施例的一种电子设备800的示意图。例如,电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。Fig. 12 shows a schematic diagram of an electronic device 800 according to an embodiment of the present disclosure. For example, the electronic device 800 may be a terminal such as a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, or a personal digital assistant.
参照图12,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。12, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814 , and the communication component 816.
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。The processing component 802 generally controls the overall operations of the electronic device 800, such as those associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802 .
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频 等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 804 is configured to store various types of data to support operations at the electronic device 800 . Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. The memory 804 can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。The power supply component 806 provides power to various components of the electronic device 800 . Power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 800 .
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。The multimedia component 808 includes a screen providing an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or swipe action, but also detect duration and pressure associated with the touch or swipe action. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a microphone (MIC), which is configured to receive external audio signals when the electronic device 800 is in operation modes, such as call mode, recording mode and voice recognition mode. Received audio signals may be further stored in memory 804 or sent via communication component 816 . In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如互补金属氧化物半导体(CMOS)或电荷耦合装置(CCD)图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of electronic device 800 . For example, the sensor component 814 can detect the open/closed state of the electronic device 800, the relative positioning of components, such as the display and the keypad of the electronic device 800, the sensor component 814 can also detect the electronic device 800 or a Changes in position of components, presence or absence of user contact with electronic device 800 , electronic device 800 orientation or acceleration/deceleration and temperature changes in electronic device 800 . Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. Sensor assembly 814 may also include an optical sensor, such as a complementary metal-oxide-semiconductor (CMOS) or charge-coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如无线网络(WiFi),第二代移动通信技术(2G)或第三代移动通信技术(3G),或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as a wireless network (WiFi), a second generation mobile communication technology (2G) or a third generation mobile communication technology (3G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, electronic device 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation for performing the methods described above.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。In an exemplary embodiment, there is also provided a non-volatile computer-readable storage medium, such as the memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to implement the above method.
图13示出根据本公开实施例的一种电子设备1900的示意图。例如,电子设备1900可以被提供为一服务器。参照图13,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。FIG. 13 shows a schematic diagram of an electronic device 1900 according to an embodiment of the present disclosure. For example, electronic device 1900 may be provided as a server. Referring to FIG. 13 , electronic device 1900 includes processing component 1922 , which further includes one or more processors, and a memory resource represented by memory 1932 for storing instructions executable by processing component 1922 , such as application programs. The application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作系统,例如微软服务器操作系统(Windows Server TM),苹果公司推出的基于图形用户界面操作系统(Mac OS X TM),多用户多进程的计算机操作系统(Unix TM),自由和开放原代码的类Unix操作系统(Linux TM),开放原代码的类Unix操作系统(FreeBSD TM)或类似。 Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input-output (I/O) interface 1958 . The electronic device 1900 can operate based on the operating system stored in the memory 1932, such as the Microsoft server operating system (Windows Server TM ), the graphical user interface-based operating system (Mac OS X TM ) introduced by Apple Inc., and the multi-user and multi-process computer operating system (Unix ), a free and open source Unix-like operating system (Linux ), an open source Unix-like operating system (FreeBSD ), or the like.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium, such as the memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to implement the above method.
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。The present disclosure can be a system, method and/or computer program product. A computer program product may include a computer readable storage medium having computer readable program instructions thereon for causing a processor to implement various aspects of the present disclosure.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是(但不限于)电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device. A computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory), static random access memory (SRAM), compact disc read only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanically encoded device, such as a printer with instructions stored thereon A hole card or a raised structure in a groove, and any suitable combination of the above. As used herein, computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。Computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or a network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算 机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。Computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or Source or object code written in any combination, including object-oriented programming languages—such as Smalltalk, C++, etc., and conventional procedural programming languages—such as the “C” language or similar programming languages. Computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement. In cases involving a remote computer, the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as via the Internet using an Internet service provider). connect). In some embodiments, an electronic circuit, such as a programmable logic circuit, field programmable gate array (FPGA), or programmable logic array (PLA), can be customized by utilizing state information of computer-readable program instructions, which can Various aspects of the present disclosure are implemented by executing computer readable program instructions.
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It should be understood that each block of the flowcharts and/or block diagrams, and combinations of blocks in the flowcharts and/or block diagrams, can be implemented by computer-readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine such that when executed by the processor of the computer or other programmable data processing apparatus , producing an apparatus for realizing the functions/actions specified in one or more blocks in the flowchart and/or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause computers, programmable data processing devices and/or other devices to work in a specific way, so that the computer-readable medium storing instructions includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks in flowcharts and/or block diagrams.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。It is also possible to load computer-readable program instructions into a computer, other programmable data processing device, or other equipment, so that a series of operational steps are performed on the computer, other programmable data processing device, or other equipment to produce a computer-implemented process , so that instructions executed on computers, other programmable data processing devices, or other devices implement the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, a portion of a program segment, or an instruction that includes one or more Executable instructions. In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified function or action , or may be implemented by a combination of dedicated hardware and computer instructions.
该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。The computer program product can be specifically realized by means of hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) etc. wait.
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。Having described various embodiments of the present disclosure above, the foregoing description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and alterations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principle of each embodiment, practical application or improvement of technology in the market, or to enable other ordinary skilled in the art to understand each embodiment disclosed herein.

Claims (15)

  1. 一种人脸识别方法,应用于终端设备,其特征在于,所述方法包括:A face recognition method applied to a terminal device, characterized in that the method includes:
    确定待识别人脸图像;Determine the face image to be recognized;
    确定所述待识别人脸图像的人脸识别模式;Determine the face recognition mode of the face image to be recognized;
    根据所述人脸识别模式向服务端发送人脸识别信息,所述人脸识别信息包括待识别人脸图像,和/或对所述待识别人脸图像进行特征提取得到的第一人脸特征;Send face recognition information to the server according to the face recognition mode, the face recognition information includes a face image to be recognized, and/or a first face feature obtained by feature extraction of the face image to be recognized ;
    接收所述服务端返回的人脸识别结果,所述人脸识别结果是根据对所述人脸识别信息进行人脸识别得到。and receiving a face recognition result returned by the server, where the face recognition result is obtained by performing face recognition on the face recognition information.
  2. 根据权利要求1所述的方法,其特征在于,所述确定所述待识别人脸图像的人脸识别模式包括:The method according to claim 1, wherein the determining the face recognition mode of the face image to be recognized comprises:
    显示人脸识别模式选择页面,所述选择页面中包括第一识别控件和/或第二识别控件;Displaying a face recognition mode selection page, the selection page including a first recognition control and/or a second recognition control;
    响应于所述第一识别控件被触发,确定所述待识别人脸图像的人脸识别模式为第一识别模式,所述第一识别模式用于发送所述待识别人脸图像;In response to the triggering of the first recognition control, determine the face recognition mode of the face image to be recognized as the first recognition mode, and the first recognition mode is used to send the face image to be recognized;
    响应于所述第二识别控件被触发,确定所述待识别人脸图像的人脸识别模式为第二识别模式,所述第二识别模式用于发送对所述待识别人脸图像进行特征提取得到的第一人脸特征。In response to the triggering of the second recognition control, it is determined that the face recognition mode of the face image to be recognized is the second recognition mode, and the second recognition mode is used to send a feature extraction function to the face image to be recognized. The obtained first face features.
  3. 根据权利要求1或2所述的方法,其特征在于,所述根据所述人脸识别模式向服务端发送人脸识别信息包括:The method according to claim 1 or 2, wherein the sending face recognition information to the server according to the face recognition mode comprises:
    响应于所述人脸识别模式为第二识别模式,将所述待识别人脸图像输入预先训练得到的第一特征提取模型,确定输出的第一人脸特征为人脸识别信息;In response to the face recognition mode being the second recognition mode, inputting the face image to be recognized into a first feature extraction model obtained through pre-training, and determining that the output first face feature is face recognition information;
    向所述服务端发送所述人脸识别信息。Send the face recognition information to the server.
  4. 根据权利要求1-3中任意一项所述的方法,其特征在于,所述人脸识别结果的确定过程包括:The method according to any one of claims 1-3, wherein the determination process of the face recognition result comprises:
    通过服务端将所述人脸识别信息输入预先训练得到的第二特征提取模型,输出第二人脸特征;Input the face recognition information into the pre-trained second feature extraction model through the server, and output the second face feature;
    根据所述第二人脸特征与预先存储的用户人脸特征集合进行匹配,得到人脸识别结果,所述用户人脸特征集合中包括至少一个用户人脸特征,和所述用户人脸特征对应的用户信息。According to the matching of the second face feature with the pre-stored user face feature set, the face recognition result is obtained, and the user face feature set includes at least one user face feature corresponding to the user face feature user information.
  5. 根据权利要求4中所述的方法,其特征在于,所述方法还包括:According to the method described in claim 4, it is characterized in that, described method also comprises:
    响应于所述人脸识别结果为非注册用户,确定当前用户信息;In response to the face recognition result being a non-registered user, determine current user information;
    将所述当前用户信息发送至服务端,以将所述当前用户信息和对应的所述第二人脸特征存储至所述用户人脸特征集合。Send the current user information to the server, so as to store the current user information and the corresponding second facial features in the user facial feature set.
  6. 一种人脸识别方法,应用于服务端,其特征在于,所述方法包括:A face recognition method applied to a server, characterized in that the method comprises:
    接收终端设备发送的人脸识别信息,所述人脸识别信息包括待识别人脸图像,和/或通过所述终端设备对待识别人脸图像进行特征提取得到的第一人脸特征;receiving face recognition information sent by the terminal device, the face recognition information including the face image to be recognized, and/or the first face feature obtained by feature extraction of the face image to be recognized by the terminal device;
    根据所述人脸识别信息进行人脸识别,得到人脸识别结果;performing face recognition according to the face recognition information to obtain a face recognition result;
    向所述终端设备发送所述人脸识别结果。Sending the face recognition result to the terminal device.
  7. 根据权利要求6所述的方法,其特征在于,所述根据所述人脸识别信息进行人脸识别,得到人脸识别结果包括:The method according to claim 6, wherein performing face recognition according to the face recognition information to obtain a face recognition result comprises:
    对所述人脸识别信息进行特征提取,得到第二人脸特征;performing feature extraction on the face recognition information to obtain a second face feature;
    根据所述第二人脸特征进行人脸识别,得到人脸识别结果。Performing face recognition according to the second face features to obtain a face recognition result.
  8. 根据权利要求7所述的方法,其特征在于,所述对所述人脸识别信息进行特征提取,得到第二 人脸特征包括:method according to claim 7, is characterized in that, described described facial recognition information is carried out feature extraction, obtains the second facial features and comprises:
    将所述第一人脸特征或所述待识别人脸图像输入预先训练得到的第二特征提取模型,输出第二人脸特征。Inputting the first human face feature or the to-be-recognized human face image into the pre-trained second feature extraction model, and outputting the second human face feature.
  9. 根据权利要求7或8所述的方法,其特征在于,所述根据所述第二人脸特征进行人脸识别,得到人脸识别结果包括:The method according to claim 7 or 8, wherein performing face recognition according to the second face feature, and obtaining a face recognition result comprises:
    确定用户人脸特征集合,所述用户人脸特征集合中包括至少一个用户人脸特征,和所述用户人脸特征对应的用户信息;Determining a user face feature set, the user face feature set including at least one user face feature, and user information corresponding to the user face feature;
    根据所述第二人脸特征与所述用户人脸特征进行匹配,得到所述用户人脸特征的匹配结果;matching according to the second facial features and the user's facial features to obtain a matching result of the user's facial features;
    响应于存在用户人脸特征的匹配结果为匹配成功,将所述用户人脸特征对应的用户信息作为人脸识别结果;In response to the matching result of the existence of the user's face feature being a successful match, the user information corresponding to the user's face feature is used as the face recognition result;
    响应于不存在用户人脸特征的匹配结果为匹配成功,确定所述人脸识别结果为非注册用户。In response to the fact that the matching result of no facial features of the user is successful, it is determined that the facial recognition result is a non-registered user.
  10. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method according to claim 9, characterized in that the method further comprises:
    响应于接收到所述终端设备在人脸识别结果为非注册用户的情况下返回的当前用户信息,将所述当前用户信息和对应的所述第二人脸特征存储至所述用户人脸特征集合。In response to receiving the current user information returned by the terminal device when the face recognition result is a non-registered user, storing the current user information and the corresponding second face feature in the user face feature gather.
  11. 一种人脸识别装置,其特征在于,所述装置包括:A face recognition device, characterized in that the device comprises:
    图像确定模块,用于确定待识别人脸图像;An image determination module, configured to determine a face image to be recognized;
    识别模式确定模块,用于确定所述待识别人脸图像的人脸识别模式;A recognition mode determination module, configured to determine the face recognition mode of the face image to be recognized;
    信息发送模块,用于根据所述人脸识别模式向服务端发送人脸识别信息,所述人脸识别信息包括待识别人脸图像,和/或所述待识别人脸图像进行特征提取得到的第一人脸特征;An information sending module, configured to send face recognition information to the server according to the face recognition mode, the face recognition information includes a face image to be recognized, and/or a feature extracted from the face image to be recognized first face feature;
    结果接收模块,用于接收所述服务端返回的人脸识别结果,所述人脸识别结果是根据对所述人脸识别信息进行人脸识别得到。The result receiving module is configured to receive the face recognition result returned by the server, the face recognition result is obtained according to face recognition on the face recognition information.
  12. 一种人脸识别装置,其特征在于,所述装置包括:A face recognition device, characterized in that the device comprises:
    信息接收模块,用于接收终端设备发送的人脸识别信息,所述人脸识别信息包括待识别人脸图像,和/或通过所述终端设备对待识别人脸图像进行特征提取得到的第一人脸特征;The information receiving module is used to receive the face recognition information sent by the terminal device, the face recognition information includes the face image to be recognized, and/or the first person obtained by feature extraction of the face image to be recognized by the terminal device facial features;
    人脸识别模块,用于根据所述人脸识别信息进行人脸识别,得到人脸识别结果;A face recognition module, configured to perform face recognition according to the face recognition information to obtain a face recognition result;
    结果发送模块,用于向所述终端设备发送所述人脸识别结果。A result sending module, configured to send the face recognition result to the terminal device.
  13. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    处理器;processor;
    用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;
    其中,所述处理器被配置为调用所述存储器存储的指令,以执行权利要求1至10中任意一项所述的方法。Wherein, the processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1-10.
  14. 一种计算机可读存储介质,其上存储有计算机程序指令,其特征在于,所述计算机程序指令被处理器执行时实现权利要求1至10中任意一项所述的方法。A computer-readable storage medium, on which computer program instructions are stored, wherein, when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 10 is implemented.
  15. 一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,其特征在于,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中 的处理器执行用于实现权利要求1-10中的任意一项所述的方法。A computer program product, comprising computer-readable codes, or a non-volatile computer-readable storage medium bearing computer-readable codes, characterized in that, when the computer-readable codes are run in a processor of an electronic device , the processor in the electronic device executes the method for realizing any one of claims 1-10.
PCT/CN2022/078372 2021-09-17 2022-02-28 Face recognition method and apparatus, electronic device, and storage medium WO2023040202A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111092935.3A CN113807253A (en) 2021-09-17 2021-09-17 Face recognition method and device, electronic equipment and storage medium
CN202111092935.3 2021-09-17

Publications (1)

Publication Number Publication Date
WO2023040202A1 true WO2023040202A1 (en) 2023-03-23

Family

ID=78939630

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/078372 WO2023040202A1 (en) 2021-09-17 2022-02-28 Face recognition method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN113807253A (en)
WO (1) WO2023040202A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118522061A (en) * 2024-07-24 2024-08-20 支付宝(杭州)信息技术有限公司 Face recognition control method, effect monitoring method thereof, related device and system

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113807253A (en) * 2021-09-17 2021-12-17 上海商汤智能科技有限公司 Face recognition method and device, electronic equipment and storage medium
CN117173161B (en) * 2023-10-30 2024-02-23 杭州海康威视数字技术股份有限公司 Content security detection method, device, equipment and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106407369A (en) * 2016-09-09 2017-02-15 华南理工大学 Photo management method and system based on deep learning face recognition
CN108197318A (en) * 2018-02-01 2018-06-22 广州市君望机器人自动化有限公司 Face identification method, device, robot and storage medium
CN108491806A (en) * 2018-03-28 2018-09-04 成都信达智胜科技有限公司 A kind of fast human face recognition
CN108875515A (en) * 2017-12-11 2018-11-23 北京旷视科技有限公司 Face identification method, device, system, storage medium and capture machine
CN113807253A (en) * 2021-09-17 2021-12-17 上海商汤智能科技有限公司 Face recognition method and device, electronic equipment and storage medium

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108573201A (en) * 2017-03-13 2018-09-25 金德奎 A kind of user identity identification matching process based on face recognition technology
CN110097368B (en) * 2018-01-30 2024-07-26 财付通支付科技有限公司 Face image recognition method, server, terminal and service equipment
CN110533553B (en) * 2018-05-25 2023-04-07 阿里巴巴集团控股有限公司 Service providing method and device
KR102023492B1 (en) * 2018-05-30 2019-09-20 비앤피이노베이션 주식회사 Smart helmet and method for image processing and transmitting for protecting privacy
CN110321829A (en) * 2019-06-27 2019-10-11 北京蓝城兄弟文化传媒有限公司 A kind of face identification method and device, electronic equipment and storage medium
CN110458102A (en) * 2019-08-12 2019-11-15 深圳市商汤科技有限公司 A kind of facial image recognition method and device, electronic equipment and storage medium
CN111401273B (en) * 2020-03-19 2022-04-29 支付宝(杭州)信息技术有限公司 User feature extraction system and device for privacy protection
CN112312011B (en) * 2020-10-15 2021-09-14 珠海格力电器股份有限公司 Protection method and device for camera privacy
CN112651342B (en) * 2020-12-28 2024-06-14 中国平安人寿保险股份有限公司 Face recognition method and device, electronic equipment and storage medium
CN112949545B (en) * 2021-03-17 2022-12-30 中国工商银行股份有限公司 Method, apparatus, computing device and medium for recognizing face image
CN112784823B (en) * 2021-03-17 2023-04-07 中国工商银行股份有限公司 Face image recognition method, face image recognition device, computing equipment and medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106407369A (en) * 2016-09-09 2017-02-15 华南理工大学 Photo management method and system based on deep learning face recognition
CN108875515A (en) * 2017-12-11 2018-11-23 北京旷视科技有限公司 Face identification method, device, system, storage medium and capture machine
CN108197318A (en) * 2018-02-01 2018-06-22 广州市君望机器人自动化有限公司 Face identification method, device, robot and storage medium
CN108491806A (en) * 2018-03-28 2018-09-04 成都信达智胜科技有限公司 A kind of fast human face recognition
CN113807253A (en) * 2021-09-17 2021-12-17 上海商汤智能科技有限公司 Face recognition method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118522061A (en) * 2024-07-24 2024-08-20 支付宝(杭州)信息技术有限公司 Face recognition control method, effect monitoring method thereof, related device and system

Also Published As

Publication number Publication date
CN113807253A (en) 2021-12-17

Similar Documents

Publication Publication Date Title
CN109032675B (en) Screen unlocking method and device of terminal equipment and terminal equipment
CN106709399B (en) Fingerprint identification method and device
CN105224195B (en) Terminal operation method and device
WO2023040202A1 (en) Face recognition method and apparatus, electronic device, and storage medium
CN110569777B (en) Image processing method and device, electronic device and storage medium
CN107025419B (en) Fingerprint template inputting method and device
EP3331226A1 (en) Method and device for reading messages
EP3300407A1 (en) Method and device for processing verification code
US10242678B2 (en) Friend addition using voiceprint analysis method, device and medium
CN110990801B (en) Information verification method and device, electronic equipment and storage medium
WO2017036018A1 (en) Fingerprint identification method and apparatus, and mobile terminal
CN111523346B (en) Image recognition method and device, electronic equipment and storage medium
CN109685041B (en) Image analysis method and device, electronic equipment and storage medium
CN106331328B (en) Information prompting method and device
CN106547850B (en) Expression annotation method and device
CN110909203A (en) Video analysis method and device, electronic equipment and storage medium
EP3261324A1 (en) Method and device for application switching
CN108766427B (en) Voice control method and device
CN113850275A (en) Image processing method, image processing device, electronic equipment and storage medium
CN107580142B (en) Method and device for executing processing
CN110955800A (en) Video retrieval method and device
CN111339964B (en) Image processing method and device, electronic equipment and storage medium
CN110213062B (en) Method and device for processing message
CN111650554A (en) Positioning method and device, electronic equipment and storage medium
CN111753753A (en) Image recognition method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22868582

Country of ref document: EP

Kind code of ref document: A1