WO2022174699A1 - Image updating method and apparatus, and electronic device and computer-readable medium - Google Patents

Image updating method and apparatus, and electronic device and computer-readable medium Download PDF

Info

Publication number
WO2022174699A1
WO2022174699A1 PCT/CN2022/071647 CN2022071647W WO2022174699A1 WO 2022174699 A1 WO2022174699 A1 WO 2022174699A1 CN 2022071647 W CN2022071647 W CN 2022071647W WO 2022174699 A1 WO2022174699 A1 WO 2022174699A1
Authority
WO
WIPO (PCT)
Prior art keywords
face image
database
image
recognized
face
Prior art date
Application number
PCT/CN2022/071647
Other languages
French (fr)
Chinese (zh)
Inventor
陶训强
郭彦东
何苗
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2022174699A1 publication Critical patent/WO2022174699A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation

Definitions

  • the present application relates to the technical field of image processing, and more particularly, to an image updating method, apparatus, electronic device, and computer-readable medium.
  • the face recognition system in the prior art generally does not update the registered face image in the face registration database after the registration image is entered for the first time.
  • factors such as lighting, whether to wear makeup, whether to wear glasses/sunglasses, whether to wear a mask, age growth, changes in hairstyles and other factors may cause changes in the user's facial features. It may lead to a decrease in the accuracy of face recognition.
  • the present application proposes an image updating method, apparatus, electronic device and computer-readable medium to improve the above-mentioned defects.
  • an embodiment of the present application provides an image updating method, including: acquiring a face image to be identified; matching the face image to be identified with a face image of a registered user in a database to obtain a matching Result; if the matching result is less than the first threshold and greater than the second threshold, update the face image to be identified as a new face image to the database, wherein the matching result is greater than the second threshold.
  • the face image to be recognized and the face image of the registered user correspond to the same user, and when the matching result is less than the first threshold, the face image to be recognized corresponds to the registered user's face image. There are differences between face images.
  • the embodiments of the present application further provide an image updating apparatus, including: an acquiring unit, a matching unit, and an updating unit.
  • the acquiring unit is used to acquire the face image to be recognized.
  • the matching unit is configured to match the face image to be recognized with the face image of the registered user in the database to obtain a matching result.
  • An update unit configured to update the face image to be recognized as a new face image to the database if the matching result is less than a first threshold and greater than a second threshold, wherein the matching result is greater than the first
  • the face image to be recognized corresponds to the same user as the face image of the registered user, and when the matching result is less than the first threshold, the face image to be recognized corresponds to the registered user. There are differences between the user's face images.
  • embodiments of the present application further provide an electronic device, one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and accessed by Configured to be executed by the one or more processors, the one or more programs are configured to perform the above-described method.
  • an embodiment of the present application further provides a computer-readable medium, where the readable storage medium stores program code executable by a processor, and when the program code is executed by the processor, causes the processor to Perform the above method.
  • an embodiment of the present application further provides a computer program product, including a computer program/instruction, wherein the computer program/instruction is executed by a processor to implement the above method.
  • FIG. 1 shows a schematic diagram of a face recognition system provided by an embodiment of the present application
  • FIG. 2 shows a method flowchart of an image updating method provided by an embodiment of the present application
  • FIG. 3 shows a schematic diagram of a face image storage table provided by an embodiment of the present application
  • FIG. 4 shows a schematic diagram of a face image storage table provided by another embodiment of the present application.
  • FIG. 5 shows a schematic diagram of a face image storage table provided by another embodiment of the present application.
  • FIG. 6 shows a schematic diagram of a face image storage table provided by still another embodiment of the present application.
  • FIG. 7 shows a method flowchart of an image updating method provided by another embodiment of the present application.
  • FIG. 8 shows a schematic diagram of prompt information provided by an embodiment of the present application.
  • Fig. 9 shows the flowchart of S740 in Fig. 7;
  • FIG. 10 shows a method flowchart of an image updating method provided by another embodiment of the present application.
  • FIG. 11 shows a schematic diagram of a face image storage table provided by yet another embodiment of the present application.
  • FIG. 12 shows a schematic diagram of a face image storage table provided by another embodiment of the present application.
  • FIG. 13 shows a method flowchart of an image updating method provided by still another embodiment of the present application.
  • Fig. 14 shows the flowchart of S1320 in Fig. 13;
  • FIG. 15 shows a block diagram of a module of an image updating apparatus provided by an embodiment of the present application.
  • FIG. 16 shows a module block diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 17 shows a storage unit for storing or carrying a program code for implementing the image updating method according to the embodiment of the present application according to the embodiment of the present application.
  • FIG. 18 shows a structural block diagram of a computer program product provided by an embodiment of the present application.
  • face recognition technology is gradually applied to people's work and life.
  • face images can be collected for payment authentication, unlock authentication, and facial images can be beautified.
  • the face recognition technology the face in the image can be detected, and the face in the image can also be identified to which person's face, so as to identify the user's identity.
  • FIG. 1 shows a schematic diagram of the face recognition system provided by the present application.
  • the face recognition system includes a server 10 and a user terminal 20, the user terminal 20 and the server 10 are located in a wireless network or a wired network, and the server 10 and the user terminal 20 can perform data interaction, and the data interaction can include face recognition and face images. update etc.
  • the user terminal 20 is provided with a biometric information collection device, which is used to collect the user's biometric information.
  • the biometric information collection device can be a fingerprint module, an iris collector and a face collection device, the fingerprint module is used to collect the user's fingerprint information, the iris collector is used to collect the user's iris information, and the face collection device is used for collecting the user's iris information. It is used to collect the user's face image information.
  • the user terminal 20 may be a mobile user terminal device, for example, may include a smart phone, a tablet computer, an e-book reader, a laptop computer, a vehicle-mounted computer, a wearable mobile user terminal, etc. Payment user terminal with biometric information collection device, etc.
  • a client terminal may be installed in the user terminal 20.
  • the client terminal may be an application program installed in the user terminal 20.
  • the client terminal may acquire the face image collected by the user terminal 20 and send the face image to the server 10.
  • the server 10 recognizes the face image and feeds back the recognition result to the client.
  • the client can also record the face image collected by the user terminal 20 into the server 10 to update the face image in the server 10 .
  • the face image of the registered user is stored in the server 10, and the face image can be used as the identity information of the registered user to verify the identity of the logged-in user in scenarios that require identity verification, such as payment and unlocking of user terminals. That is, the face recognition operation is performed.
  • face recognition generally includes the following two processes: face registration and face verification and recognition.
  • the user usually needs to perform face registration before the first use, that is, the user's face image is entered into the face registration database. After the entry, the corresponding face is recognized by matching the registered face image and the collected face image.
  • the registered image is updated according to different update strategies.
  • the current face update has the following two defects: if the preset threshold is set too low, it will lead to misidentification and frequent registration database updates; if the preset threshold is set too high, the input image and the registered image are similar , ignoring the changes, and cannot achieve the purpose of improving the recognition performance by updating the registration template; in addition, when updating the face image in the database, the new face image is directly updated into the database, and then the new face image is updated.
  • the face image of the user may not be the face image of the registered user in the database, that is, there is a misrecognition. Furthermore, the image with the recent registration time should be similar to the real state of the user, and should be given when identifying. The more you think about it; in the end, you need to manually set the number of registered images. Too little may result in loss of performance, and too much will take up too much system resources.
  • the embodiments of the present application provide an image updating method, apparatus, electronic device, and computer-readable medium, which use double thresholds to judge the face image to be recognized, and filter out the matching scores that are too high and too low.
  • the face image to be recognized is updated, and the face image of the registered user in the database is updated, which can not only improve the recognition performance, but also reduce the loss caused by frequent writing to the database.
  • FIG. 2 shows an image updating method provided by an embodiment of the present application.
  • the execution body of the updating method may be the above-mentioned server or the above-mentioned user terminal, which is not limited here. .
  • the method includes: S201 to S203.
  • S201 Acquire a face image to be recognized.
  • the scenario of executing the method for updating the face image may be, when the user terminal verifies the user's identity information through the user's face image, specifically, when the user logs in to the client of the user terminal. , input the user's face image through the camera of the user terminal, and the client of the user terminal obtains the user's face image, and performs identity verification on the face image.
  • the update of the face image entered during registration that is, the face image used for user identity recognition as the face image to be recognized this time.
  • the user can operate the client of the user terminal to make the client perform the face image update operation, that is, the face image update operation can be performed independently without performing the authentication operation.
  • the client provides a face image update function, and the administrator can obtain the face image input by the user, and perform the update operation of the face image based on the face image.
  • the face image to be recognized may be a face image obtained by on-site shooting of the user's face area.
  • the user's face image is collected during the above-mentioned user authentication.
  • the face image to be recognized may also be a pre-stored face image including the user's face area.
  • the user collects the face image of the user through the user terminal, sends the face image to the server, the server stores the face images uploaded by multiple users, and obtains the face image of the user at the moment of updating the face image.
  • the image update operation is performed as the face image to be identified this time, that is, the face image of the user pre-stored in the server is updated based on the face image to be identified.
  • the database is arranged in the above-mentioned server, that is, the database is a storage space in the above-mentioned server, and when a user registers, at least one face image will be stored in the server. Specifically, when the user registers at the client of the user terminal, he will enter at least one face image and the user account, and then send the user account and the entered at least one image to the server, and the server is in the database The received at least one image sent by the client is stored corresponding to the user account.
  • the server stores the face images corresponding to different users in the database, such as the face image storage table shown in FIG. 3 , each user account corresponds to the face image corresponding to the user account Store, where "face 11" is used as the image identifier of the face image of user 1.
  • the format of the face image stored in the database may be a picture format, for example, bmp, jpg, png, tif, gif, pcx, tga, exif, fpx, svg, psd, cdr, pcd, dxf, ufo, eps, ai, raw, WMF, webp and other formats.
  • the format of the face images stored in the database may be feature data, that is, the server extracts the feature values of the face images, and stores the feature values of each face image corresponding to the user account.
  • feature 11 is used as the data identifier of the feature data of the face image of user 1, wherein the database stores the original image and feature data of the face image respectively, that is, the picture format and the data format are stored separately , wherein the image identifier corresponds to a face image in a picture format, and the data format corresponds to the feature data of the face image.
  • the user account corresponding to the feature 11 is the user 1.
  • the feature data of the face image corresponding to the user account can be conveniently found through the user account and the feature identifier.
  • the user account can also be stored corresponding to the image identification and data identification of the face image at the same time, and the face image corresponding to the user account and the face can be conveniently found through the user account, image identification and feature identification.
  • the feature data corresponding to the image By directly storing the feature data, it is convenient to perform comparison, recognition, matching and image processing on face images.
  • the face image to be recognized is matched with the face image of the registered user in the database, wherein the registered user is pre-registered successfully and the face is entered in the database image user.
  • the face image to be recognized is matched with the face image of the registered user in the database according to a preset matching algorithm.
  • the preset matching algorithm may be to extract features from the face image to be recognized, and compare the features with the face features extracted from the face images of registered users in the database. Specifically, the Euclidean pattern between the features may be used. The distance, etc., is not limited here, so as to obtain the matching score between the image to be recognized and the face image of the registered user.
  • the matching score between the face image to be recognized and the face image of the registered user is normalized to [0, 1], and the closer it is to 1, the more it indicates the same user.
  • the matching score of the face image to be recognized and the registered user's face image may be expressed as the matching score of the face image to be recognized and the registered user's face image with the highest similarity.
  • the face image to be recognized is matched with each face image of the registered user, and the similarity corresponding to each face image is obtained.
  • the similarity of the face images determines the matching result between the face image to be recognized and the face image of the registered user.
  • the similarity between the face image to be recognized and each face image is obtained through the above-mentioned preset algorithm, and the average value of all the similarities may be used as the matching result, or the lowest among all the similarities may be used. or the highest similarity as the matching result.
  • the database when the database includes a plurality of registered users, obtain a matching result corresponding to the face image to be recognized and the face image of each registered user, and search for the matching results that are smaller than the first
  • the matching result whose threshold is greater than the second threshold is regarded as the target matching result, and the registered user corresponding to the target matching result is regarded as the target user.
  • the matching result when the matching result is greater than the second threshold, and the face image to be identified corresponds to the same user as the face image of the registered user, it can be considered that the user corresponding to the face image to be identified corresponds to the user It is the same as the registered user in the database, that is, the user corresponding to the face image to be recognized is the registered user in the database.
  • the matching result is less than or equal to the second threshold
  • the face image to be identified corresponds to a different user from the face image of the registered user, then it can be considered that the user corresponding to the face image to be identified is the same as the user already in the database.
  • the registered users are not the same, that is, the user corresponding to the face image to be recognized is not a registered user in the database.
  • the matching result when the matching result is greater than or equal to the first threshold, it can be considered that the user corresponding to the face image to be recognized is the same as the registered user in the database, and the face image to be recognized is the same as the registered user in the database.
  • the difference between the registered user's face images is very small, that is, it can be considered that there is no difference between the two, that is, the difference can be ignored, or the difference does not meet the update condition, that is, the matching
  • the result is greater than or equal to the first threshold, it means that the probability that the face image to be recognized and the registered user in the database are the same person is very high, the face image is very similar, and cannot reflect the change of the face image, and the current pending recognition is discarded.
  • the face image of the registered user in the database is not updated based on the face image to be recognized.
  • the matching result is less than the first threshold, there is a difference between the face image to be identified and the face image of the registered user, that is, it can be determined that the face image to be identified and the face of the registered user are different
  • the images are not the same image, or the facial features of the two are not the same.
  • the matching result is less than the first threshold and greater than the second threshold, it can be determined that the face image to be identified corresponds to the same user as the face image of the registered user, and the face image to be identified is the same as the face image of the registered user.
  • the face image to be recognized can be used as a supplementary image of the face image of the registered user in the database, that is, a new face image, and then the The operation of updating the recognized face image to the database as a new face image.
  • the embodiment of updating the face image to be recognized to the database as a new face image may be that the face image to be recognized is written into the database, and the database uses the face image to be recognized.
  • the recognized face image is stored corresponding to the target user.
  • the face image to be recognized can be additionally stored.
  • feature 14 is the data of the feature data of the face image to be recognized. It can be seen that, on the basis of the features 11, 12 and 13 corresponding to the user 1 in the database, the data identification of the feature data of the face image to be recognized, that is, the feature 14 is newly added.
  • At least one face image in all face images corresponding to the target user in the database may be replaced with the face image to be recognized.
  • feature 13 ′ is the feature data after the feature 13 is replaced
  • the feature 13' is the feature data of the face image to be recognized.
  • the target face image can be determined from the multiple face images, and the target face image is updated to the face image to be recognized.
  • the face image with the lowest matching result among the multiple face images may be used as the target face image, or the face image with the highest matching result among the multiple face images may be used as the target face image .
  • the face image to be identified is obtained; the face image to be identified is matched with the face image of the registered user in the database, and a matching result is obtained.
  • the user's face image is updated, for example, adding a new image or modifying an existing image.
  • the method of determining whether to update is as follows: if the matching result is less than a first threshold and greater than a second threshold, update the face image to be recognized to the database as a new face image, wherein if If the matching result is greater than the second threshold, it indicates that the face image to be recognized corresponds to the same user as the registered user’s face image, and if the matching result is less than the first threshold, it indicates that the face image to be recognized is the same as the registered user’s face image.
  • the face image update of registered users can not only improve the recognition performance, but also reduce the loss caused by frequent writing to the database.
  • the image updating method provided by the embodiments of the present application can reduce misrecognition and improve recognition stability and performance, in addition to using double thresholds to improve the recognition performance and reduce the loss caused by frequent writing to the database.
  • 7 which shows an image updating method provided by an embodiment of the present application.
  • the execution body of the updating method may be the above-mentioned server or the above-mentioned user terminal, which is not limited here.
  • the method includes: S710 to S740.
  • S710 Acquire a face image to be recognized.
  • the execution body of this embodiment of the present application may be a server, and when the server determines that the matching result is less than the first threshold and greater than the second threshold, the server may directly execute the face image to be recognized as a new face image
  • the operation of updating to the database for example, directly executes S730.
  • the server feeds back prompt information to the user terminal after determining that the matching result is less than the first threshold and greater than the second threshold, and the user terminal displays the prompt information in the designated interface.
  • the confirmation instruction is performed, the operation of updating the face image to be recognized to the database as a new face image or the operation of S730 is performed based on the confirmation instruction.
  • the designated interface may be a face recognition interface, and specifically, the face recognition interface may be an interface corresponding to a payment operation or an unlock operation, which is not limited herein.
  • the payment operation may be an operation performed by the user on the payment module of the application
  • the unlocking operation may be an operation performed when the user unlocks the user terminal. Therefore, the designated interface may be a payment interface or an unlocking interface displayed by the user terminal.
  • a prompt box 810 is displayed on the designation interface 80, and “whether to allow updating the face image database” is displayed in the prompt box 810, that is, as shown in FIG. 8, the prompt information can be displayed in the figure. "Whether to allow updating face image library”.
  • the user performs face recognition in the designated interface, and the designated interface 80 displays prompt information when the face recognition passes and the matching result satisfies less than the first threshold and greater than the second threshold.
  • the user inputs a confirmation instruction in the prompt message to instruct the server to perform the operation of updating the face image to be recognized to the database as a new face image or the operation of S730.
  • the input method of the confirmation instruction may be operating a confirmation button on the designated interface, or may be input by voice, or may be input by facial expression.
  • a confirmation button 811 and a reject button 812 are displayed in the prompt box 810.
  • the user can input a confirmation instruction through the confirmation button 811, or can input a rejection instruction through the reject button 812.
  • the server obtains the rejection instruction do not perform the operation of updating the face image to be identified as a new face image to the database or the operation of S730, but perform the operation of the application function corresponding to the designated interface after the face recognition is successful, such as , if the specified interface is a payment interface, the subsequent operation is to display the payment success interface or display the payment order, return to the interface before payment, etc. If the specified interface is an unlock interface, then the subsequent operation is to display the system desktop or The interface displayed on the screen before the user terminal locks the screen this time.
  • the facial motion information may include dynamic changes of eyes, dynamic changes of mouth corners, and dynamic changes of ears, etc. It is determined whether the facial motion information is the first facial motion, and if so, it is determined that a confirmation instruction is received, and if the first facial motion is not received, it is determined that a rejection instruction is received.
  • a face image may be collected in real time within a first preset time period, and facial motion information may be determined in real time according to the collected multiple face images, if the facial motion information is determined to be the first facial motion, then It is determined that a confirmation instruction has been received, and if the facial motion information is the second facial motion, it is determined that a rejection instruction has been received. If the first facial motion has not been detected at the end of the first preset time period, it can be determined that Deny the order.
  • the first facial action and the second facial action may be two different expressions determined by blinking, moving the pupil from the first position to the second position, raising the corner of the mouth, opening and closing the mouth, etc.
  • the position is the leftmost position of the eye, and the second position is the rightmost position of the eye, which is not limited here.
  • the first facial motion and the second facial motion may be opposite motions, eg, the first facial motion is mouth opening and the second facial motion is mouth closing.
  • the user terminal collected by the user terminal in the second preset time period is acquired.
  • Limb images determine the user's body motion information based on the collected multiple user body images, where the body motion information may include the actions of the user's hands, arms, etc. angle range, etc. It is determined whether the body motion information is the first body motion, if so, it is determined that a confirmation instruction is received, and if the first body motion is not received, it is determined that a rejection instruction is received.
  • a face image may be collected in real time within a second preset time period, and facial motion information may be determined in real time according to the collected multiple face images, and if it is determined that the body motion information is the first body motion If the confirmation instruction is received, if the body motion information is the second body motion, it is determined that a rejection instruction is received. If the first body motion is still not detected at the end of the second preset time period, it can be determined that the rejection instruction is received.
  • the first body movement and the second body movement may be two different movements determined from actions such as clenching a fist, clenching a fist and extending it, turning a hand, or other gestures made by the hand, which are not limited herein.
  • the above-mentioned facial motion information and body motion information may also be used in combination. Specifically, when it is determined that the facial motion information is the first facial motion and the body motion information is the first body motion, It is determined that a confirmation instruction is received, and a rejection instruction is determined to be received when it is determined that at least one of the situations in which the facial motion information is not the first facial motion and the body motion information is not the first body motion occurs. Specifically, for the determination of the facial motion information and the body motion information, reference may be made to the foregoing embodiments, which will not be repeated here.
  • the designated action information input by the user can be detected at the same time as the user's response to the confirmation button 811 and the reject button 812, and the designated action can be detected.
  • the information can be at least one of the above-mentioned facial motion information and body motion information. Specifically, when it is detected that the user triggers the confirmation button 811 and the specified motion information satisfies the specified conditions, it is determined that a confirmation instruction is received, and when the user is detected When the reject button 812 is triggered and the designated action information does not satisfy the designated condition, it is determined that a reject instruction has been received.
  • the specified action information satisfies the specified condition may be that the body action information is a first body action or if the facial action information is at least one of the first facial actions, specifically, please refer to the foregoing embodiment, which is not repeated here. Repeat.
  • the implementation of acquiring the first feature data of the face image to be recognized and the second feature data of the registered user's face image may be: processing the person to be recognized by a preset feature extraction algorithm
  • the face image obtains the first feature data. If the feature data of the face image of the registered user is pre-stored in the database, the second feature data of the face image of the registered user can be searched in advance from the database. If there is feature data of the face image of the registered user, the second feature data is obtained by processing the face image of the registered user through a preset feature extraction algorithm.
  • the preset algorithm may be a traditional machine learning method, or a deep learning method based on a CNN (Convolutional Neural Network, convolutional neural network) model, etc., which is not limited here.
  • S740 Acquire feature data of a new face image of a registered user according to the first feature data and the second feature data, and update the new feature data to the database.
  • the first feature data can be directly used as the feature data of the new face image, and the new feature data can be updated to the database, and the step of S740 can also be performed, wherein the features of the new face image
  • the data can be named as third feature data, then the third feature data is related to the first feature data and the second feature data, so that the third feature data can retain the first feature data and the second feature data at the same time.
  • the face image corresponding to the registered user not only has the feature of the face image to be recognized, but also has the feature of the face image that has been stored in advance, which can To avoid the problem of misrecognition, the face image to be recognized is directly used as the new face image, resulting in an error in the new face image corresponding to the registered user.
  • first feature data and the second feature data may be fused to obtain the third feature by weighted summation, multiplication, subtraction or convolution of the first feature data and the second feature data by a preset method. data.
  • the third feature data may be obtained by means of weighted fusion.
  • the implementation of S740 may include S741 to S743.
  • S741 Acquire a first weight value of the first feature data and a second weight value of the second feature data.
  • the first weight value and the second weight value can be set according to experience and user requirements.
  • the sum of the first weight value and the second weight value is 1.
  • the first weight is ⁇
  • the second weight value is 1- ⁇ .
  • the first reference data is determined according to the first weight value and the first feature data
  • the second reference data is obtained according to the second weight value and the second feature data
  • the first reference data is obtained according to the first reference data and the second reference data.
  • Three characteristic data may be to multiply the first weight value and the first feature data to obtain the first reference data.
  • the second reference data is obtained by multiplying the second weight value and the second characteristic data. Then, the first reference data and the second reference data are added to obtain third characteristic data.
  • Obtaining the second feature data means obtaining the second feature data according to all face images of the registered user.
  • an embodiment of processing the feature data of all the face images may be, when obtaining the matching result between the face image to be identified and each face image of the registered user in the database, that is, the matching score
  • find the feature data of the face image with the highest matching score and use the feature data as the second feature data, so that the face image corresponding to the second feature data can maintain the most similar characteristics to the face image to be recognized, It is avoided that the setting of the second threshold is unreasonable, such as being too low, so that the feature data of the face images of different users is used as the face images of the registered user.
  • the implementation manner of processing the characteristic data of all the face images may be, when obtaining the matching result between the face image to be recognized and each face image of the registered user in the database, that is, matching
  • the feature data of the face image with the lowest matching score is searched, and the feature data is used as the second feature data, so that the face image corresponding to the second feature data can be kept the most different from the face image to be recognized.
  • feature so that the face image of the registered user in the updated database can better reflect the real face characteristics of the user, and it can also avoid the unreasonable setting of the first threshold, for example, if it is too large, which leads to an excessively high matching result.
  • the face image has little difference with the face image in the database in essence, and using the face image with the lowest matching score can improve the difference, so that the updated face image can better complement the face image in the database It improves the comprehensiveness of face images in the data.
  • the second characteristic data can retain the characteristics of each face image of the registered user, so that the face image corresponding to the second characteristic data can maintain the average characteristics of the original registered pictures, which is equivalent to the average face of the user.
  • the embodiment of the present application improves the update strategy, and always retains the image that is determined to be the first registration of the registrant. Then features are extracted from the image to be recognized and the registered face image set of the target registered object, and feature fusion is performed. In addition, all feature data are stored and updated, which can reduce the amount of calculation.
  • FIG. 10 shows an image updating method provided by an embodiment of the present application.
  • the execution body of the updating method may be the above-mentioned server or the above-mentioned user terminal, which is not limited here. .
  • the method includes: S1001 to S1005.
  • S1001 Acquire a face image to be recognized.
  • S1002 Match the face image to be recognized with the face image of the registered user in the database to obtain a matching result.
  • the database not only stores the face images corresponding to the registered users, but also stores the time points of each entry or update of the face images.
  • the database The data identifiers of the feature data of the face image can also be numbered in the order of update time. For example, the time sequence of the update operations corresponding to feature 11, feature 12, and feature 13 is later in order, that is, the larger the number of the data identifier, the corresponding The later the update time of , so that the latest operation of updating the face image can be quickly found according to the data identification, and then the update time corresponding to the operation can be obtained.
  • the time of the latest update of the face image corresponding to user 1 is 2020.03.25, which is March 25, 2020.
  • the search rate is faster and the effect is higher.
  • S1004 Determine the acquisition time of the face image to be recognized as the second time.
  • the system time when the face image to be recognized is acquired may be used as the second time.
  • the specified threshold can be set according to experience, for example, it can be 3-60 days, for example, it can be 15 days. If the time interval between the first time and the second time is greater than the specified threshold, it indicates that the length of time between the face image to be recognized and the face image updated in the latest update of the registered user in the database is relatively large. In this case, the difference between the face image to be recognized and the face image of the registered user in the database will be relatively large, for example, the user does not cut his hair or shave his beard for a long time.
  • the face image corresponding to the feature 22 is a new face image, that is, the face image to be recognized, and the corresponding update time is 2021.01.28, as an embodiment , the update time may be the above-mentioned second time.
  • the server may need to determine whether the data volume of the face image to be written is greater than the specified data volume, and if so, write the face image to be recognized into the database. For the number of writes, you can wait until the total amount of face images to be written by multiple users is greater than the specified amount of data, and then perform the write operation. Then the update time may be the time when the face image to be recognized is written into the database.
  • the determination of the first threshold and the second threshold may be set by the user according to experience, or may be a fixed value preset by the server, or may be determined by using sample data ,
  • FIG. 13 shows an image updating method provided by an embodiment of the present application.
  • the execution body of the updating method may be the above-mentioned server or the above-mentioned user terminal, which is not limited here. .
  • the method includes: S1310 to S1350.
  • S1320 Determine a first threshold and a second threshold based on the plurality of sample images.
  • the sample image may be a pre-collected face image, and by matching the face image with the face image of the registered user in the database, it can be verified whether the settings of the first threshold and the second threshold are reasonable.
  • the S1320 includes S1321 to S1324.
  • the plurality of sample images include a first image marked as a positive example and a second image marked as a negative example, wherein the positive example indicates that the sample image matches the face image in the database, and the negative example indicates that the sample image matches the person in the database. Face images do not match.
  • the collection scene of the sample image is similar to the registration scene when the user registers the face image in the database, for example, it may be of the same type or under the same environmental parameters, and the environmental parameters may include lighting, weather, time period etc.
  • the type may include the type of environment, eg, the type of scene, eg, indoor, or mall, office, bedroom, street, etc.
  • the first result indicates that the matching result in the first image is a positive example, that is, after obtaining multiple matches obtained by matching the first image marked as a positive example with the face image of the registered user in the database
  • the results find the matching result whose matching result is greater than the specified threshold, and record it as the first result, and record the matching result less than or equal to the specified threshold as the second result
  • the second result indicates that the matching result in the first image is a negative example.
  • the matching result greater than the specified threshold indicates that the image and the face image of the registered user correspond to the same user, that is, it indicates that the user corresponding to the first image exists in the database.
  • the first result is TP (True positive)
  • TP True positive
  • the user corresponding to the image is predicted to exist in the database, and is marked as a positive example in the sample image, that is, in a real situation, the user corresponding to the image actually exists in the In-database, that is, the predicted results are the same as the real results, that is, the real positives are predicted as positives.
  • the second result is FP (False positive)
  • FP False positive
  • the predicted results are not the same as the real results, that is, the real positive examples are predicted as negative examples.
  • the third result is FN (False negative)
  • FN False negative
  • In-database that is, the predicted results are not the same as the real results, that is, the real negative examples are predicted as positive examples.
  • the fourth result is TN (True negative)
  • it is used to indicate that the user corresponding to the image is predicted not to exist in the database, and is marked as a negative example in the sample image, that is, in the real situation, the user corresponding to the image does not really exist
  • the predicted results are the same as the real results, that is, the real counterexamples are predicted as counterexamples.
  • the first ratio is used to represent the ratio of the number of positive matching results in the first image to the number of positive matching results in all sample images
  • the second ratio is used to represent the matching results in the second image: The ratio of the number of positive examples to the number of negative examples in all sample images.
  • the first ratio can reflect the ratio of the predicted positive examples and the real situation to be positive examples, accounting for the ratio of all the positive examples in the real situation
  • the second ratio can reflect the predicted positive examples but the real situation is a negative example, accounting for all the positive examples.
  • the second ratio can reflect the error rate caused by the setting of the threshold. Therefore, under the condition that a certain error rate requirement is met, the first index and the second index of the first ratio are determined, and then according to the first index and the second index of the first ratio are determined. Different metrics of a ratio adjust the first threshold and the second threshold.
  • the first threshold is determined based on the first index of the first ratio and the third index of the second ratio.
  • the above specified threshold is used as the first threshold, and when the second ratio satisfies the third index, the first threshold is set so that the first ratio satisfies the first index.
  • the third instruction is that the second ratio is not greater than 10 -4 , specifically, the third indicator is that the second ratio is 10 -4 , and the first indicator of the first ratio is TPR>99%, that is, at FPR In the case of 10 ⁇ 4 , the first threshold is set so that TPR>99%.
  • the second threshold may be determined based on the second index of the first ratio and the third index of the second ratio.
  • the above specified threshold is used as the second threshold, and when the second ratio satisfies the third index, the second threshold is set so that the first ratio satisfies the second index.
  • the third instruction is that the second ratio is not greater than 10 -4 , specifically, the third indicator is that the second ratio is 10 -4 , and the second indicator of the first ratio is TPR>95%, that is, at FPR In the case of 10 ⁇ 4 , the second threshold is set so that TPR>95%.
  • S1330 Perform image quality evaluation on the face image to be recognized to obtain an image quality evaluation result.
  • comprehensive grade classification is performed according to one or more factors such as occlusion, blur, illumination, expression, Euler angle, etc. of the face image to be recognized, such as low quality, average quality, and high quality.
  • a rating value can be a continuous numerical distribution, for example, 1-100.
  • multiple intervals are set, and each interval corresponds to a quality level, so that the identification to be identified can be determined.
  • the quality level of the face image may be that the quality level of the face image to be recognized is higher than a specified level.
  • the execution data of S1320 to S1340 may not be limited to the sequence shown in FIG. 13 , and may also be after S1310 , performing image quality evaluation on the to-be-recognized face image to obtain an image quality evaluation result , if the image quality evaluation result satisfies the preset conditions, determine the first threshold and the second threshold based on a plurality of sample images, and then match the face image to be recognized with the face image of the registered user in the database , to obtain a matching result, as long as the first threshold and the second threshold are determined based on a plurality of sample images before performing the matching between the face image to be recognized and the registered user's face image in the database.
  • FIG. 15 shows a structural block diagram of an image updating apparatus 1500 provided by an embodiment of the present application.
  • the apparatus may include: an acquiring unit 1501 , a matching unit 1502 , and an updating unit 1503 .
  • the obtaining unit 1501 is configured to obtain a face image to be recognized.
  • the matching unit 1502 is configured to match the face image to be recognized with the face image of the registered user in the database to obtain a matching result.
  • the matching unit 1502 is further configured to evaluate the image quality of the face image to be identified, so as to obtain an image quality evaluation result; if the image quality evaluation result satisfies a preset condition, the face image to be identified The face image is matched with the face image of the registered user in the database, and the matching result is obtained.
  • the updating unit 1503 is configured to update the face image to be recognized as a new face image to the database if the matching result is less than the first threshold and greater than the second threshold, wherein the matching result is greater than
  • the face image to be recognized corresponds to the same user as the face image of the registered user, and in the case that the matching result is less than the first threshold, the face image to be recognized is the same as that of the registered user. There are differences between the face images of registered users.
  • the updating unit 1503 is also used to obtain the first feature data of the face image to be recognized and the second feature data of the registered user's face image; according to the first feature data and the second feature The data acquires the feature data of the new face image of the registered user, and updates the new feature data to the database.
  • the updating unit 1503 is further configured to obtain the first weight value of the first characteristic data and the second weight value of the second characteristic data; according to the first weight value, the first characteristic data, the second weight value and the second feature data to obtain the third feature data; the third feature data is used as the feature data of the new face image of the registered user.
  • the updating unit 1503 is further configured to acquire all face images corresponding to the registered user; and process the feature data of all the face images to obtain second feature data.
  • the updating unit 1503 is further configured to perform averaging processing on the feature data of all the face images to obtain second feature data.
  • the updating unit 1503 is also used to obtain the first time of the last updated face image of the registered user in the database; determine the obtaining time of the face image to be recognized as the second time; The time interval between a first time and the second time is greater than a specified threshold, and the face image to be recognized is updated to the database as a new face image.
  • the image updating apparatus 1500 further includes a setting unit for acquiring a plurality of sample images, wherein the plurality of sample images include a first image marked as a positive example and a second image marked as a negative example, wherein the positive The example indicates that the sample image matches the face image of the database, and the negative example indicates that the sample image does not match the face image of the database; obtain the matching result between each of the sample images and the face image of the registered user in the database Obtain the first ratio and the second ratio based on the matching result of each described sample image, wherein, the first ratio is used to characterize that the matching result in the first image is the number of positive examples and the matching result in all sample images is positive The ratio of the number of examples, the second ratio is used to characterize the ratio of the number of positive examples in the second image to the number of negative examples in all sample images; based on the first ratio and the second A ratio sets the first threshold and the second threshold.
  • the first ratio is used to characterize that the matching result in the first image is the number of positive examples and the matching
  • the setting unit is further configured to obtain the first index and the second index of the first ratio and the third index of the second ratio; based on the first index of the first ratio and the third index of the second ratio, determining a first threshold; determining a second threshold based on the second index of the first ratio and the third index of the second ratio.
  • the coupling between the modules may be electrical, mechanical or other forms of coupling.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically alone, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules.
  • FIG. 16 shows a structural block diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device 100 may be the above-mentioned user terminal or server.
  • the electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more application programs, wherein the one or more application programs may be stored in the memory 120 and configured to be executed by One or more processors 110 execute, and one or more programs are configured to execute the methods described in the foregoing method embodiments.
  • the processor 110 may include one or more processing cores.
  • the processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes by running or executing the instructions, programs, code sets or instruction sets stored in the memory 120, and calling the data stored in the memory 120.
  • the processor 110 may adopt at least one of a digital signal processing (Digital Signal Processing, DSP), a Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and a Programmable Logic Array (Programmable Logic Array, PLA).
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), a modem, and the like.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • the CPU mainly handles the operating system, user interface and application programs, etc.
  • the GPU is used for rendering and drawing of the display content
  • the modem is used to handle wireless communication. It can be understood that, the above-mentioned modem may also not be integrated into the processor 110, and is implemented by a communication chip alone.
  • the memory 120 may include random access memory (Random Access Memory, RAM), or may include read-only memory (Read-Only Memory). Memory 120 may be used to store instructions, programs, codes, sets of codes, or sets of instructions.
  • the memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like.
  • the storage data area may also store data created by the terminal 100 during use (such as phone book, audio and video data, chat record data) and the like.
  • FIG. 17 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable medium 1700 stores program codes, and the program codes can be invoked by the processor to execute the methods described in the above method embodiments.
  • the computer-readable storage medium 1700 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 1700 includes a non-transitory computer-readable storage medium.
  • Computer readable storage medium 1700 has storage space for program code 1710 to perform any of the method steps in the above-described methods. These program codes can be read from or written to one or more computer program products.
  • Program code 1710 may be compressed, for example, in a suitable form.
  • FIG. 18 shows a computer program product 1800 provided by an embodiment of the present application, including a computer program/instruction 1810, which implements the above method when the computer program/instruction is executed by a processor.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Library & Information Science (AREA)
  • Collating Specific Patterns (AREA)

Abstract

The present application relates to the technical field of image processing. Disclosed are an image updating method and apparatus, and an electronic device and a computer-readable medium. The method comprises: acquiring a facial image to be subjected to recognition; matching said facial image with a facial image of a registered user in a database, so as to obtain a matching result; and if the matching result is less than a first threshold value and greater than a second threshold value, taking said facial image as a new facial image, and updating same to the database, wherein when the matching result is greater than the second threshold value, said facial image and the facial image of the registered user correspond to the same user, and when the matching result is less than the first threshold value, there is a difference between the two facial images. Therefore, when it is determined that a facial image to be subjected to recognition belongs to a registered user and has a relatively great difference over same, a facial image of the registered user in a database is updated, such that not only can the recognition performance be improved, but loss caused by frequent writing in the database can also be reduced.

Description

图像更新方法、装置、电子设备及计算机可读介质Image updating method, apparatus, electronic device, and computer-readable medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求于2021年02月22日提交中国专利局的申请号为202110199718.8、名称为“图像更新方法、装置、电子设备及计算机可读介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application No. 202110199718.8 and entitled "Image Update Method, Apparatus, Electronic Device and Computer-Readable Medium" filed with the China Patent Office on February 22, 2021, the entire contents of which are by reference Incorporated in this application.
技术领域technical field
本申请涉及图像处理技术领域,更具体地,涉及一种图像更新方法、装置、电子设备及计算机可读介质。The present application relates to the technical field of image processing, and more particularly, to an image updating method, apparatus, electronic device, and computer-readable medium.
背景技术Background technique
现有技术中的人脸识别系统在首次录入注册图像之后,后续一般不对人脸注册库中的注册人脸图像进行更新。而在人脸识别系统使用的过程中,光照,是否化妆、是否戴眼镜/墨镜,是否戴口罩、年龄的增长,发型的变化等因素都有可能使得用户的脸部特征发生变化,这种变化可能会导致人脸识别的准确率下降。The face recognition system in the prior art generally does not update the registered face image in the face registration database after the registration image is entered for the first time. In the process of using the face recognition system, factors such as lighting, whether to wear makeup, whether to wear glasses/sunglasses, whether to wear a mask, age growth, changes in hairstyles and other factors may cause changes in the user's facial features. It may lead to a decrease in the accuracy of face recognition.
发明内容SUMMARY OF THE INVENTION
本申请提出了一种图像更新方法、装置、电子设备及计算机可读介质,以改善上述缺陷。The present application proposes an image updating method, apparatus, electronic device and computer-readable medium to improve the above-mentioned defects.
第一方面,本申请实施例提供了一种图像更新方法,包括:获取待识别的人脸图像;将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果;若所述匹配结果小于第一阈值且大于第二阈值,则将所述待识别的人脸图像作为新的人脸图像更新至所述数据库,其中,所述匹配结果大于第二阈值的情况下,所述待识别的人脸图像与已注册用户的人脸图像对应相同的用户,所述匹配结果小于第一阈值的情况下,所述待识别的人脸图像与已注册用户的人脸图像之间存在差异。In a first aspect, an embodiment of the present application provides an image updating method, including: acquiring a face image to be identified; matching the face image to be identified with a face image of a registered user in a database to obtain a matching Result; if the matching result is less than the first threshold and greater than the second threshold, update the face image to be identified as a new face image to the database, wherein the matching result is greater than the second threshold In this case, the face image to be recognized and the face image of the registered user correspond to the same user, and when the matching result is less than the first threshold, the face image to be recognized corresponds to the registered user's face image. There are differences between face images.
第二方面,本申请实施例还提供了图像更新装置,包括:获取单元、匹配单元和更新单元。获取单元,用于获取待识别的人脸图像。匹配单元,用于将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果。更新单元,用于若所述匹配结果小于第一阈值且大于第二阈值,则将所述待识别的人脸图像作为新的人脸图像更新至所述数据库,其中,所述匹配结果大于第二阈值的情况下,所述待识别的人脸图像与已注册用户的人脸图像对应相同的用户,所述匹配结果小于第一阈值的情况下,所述待识别的人脸图像与已注册用户的人脸图像之间存在差异。In a second aspect, the embodiments of the present application further provide an image updating apparatus, including: an acquiring unit, a matching unit, and an updating unit. The acquiring unit is used to acquire the face image to be recognized. The matching unit is configured to match the face image to be recognized with the face image of the registered user in the database to obtain a matching result. An update unit, configured to update the face image to be recognized as a new face image to the database if the matching result is less than a first threshold and greater than a second threshold, wherein the matching result is greater than the first In the case of two thresholds, the face image to be recognized corresponds to the same user as the face image of the registered user, and when the matching result is less than the first threshold, the face image to be recognized corresponds to the registered user. There are differences between the user's face images.
第三方面,本申请实施例还提供了一种电子设备,一个或多个处理器;存储器;一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行上述方法。In a third aspect, embodiments of the present application further provide an electronic device, one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and accessed by Configured to be executed by the one or more processors, the one or more programs are configured to perform the above-described method.
第四方面,本申请实施例还提供了一种计算机可读介质,所述可读存储介质存储有处理器可执行的程序代码,所述程序代码被所述处理器执行时使所述处理器执行上述方法。In a fourth aspect, an embodiment of the present application further provides a computer-readable medium, where the readable storage medium stores program code executable by a processor, and when the program code is executed by the processor, causes the processor to Perform the above method.
第五方面,本申请实施例还提供了一种计算机程序产品,包括计算机程序/指令,其特征在于, 该计算机程序/指令被处理器执行时实现上述方法。In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program/instruction, wherein the computer program/instruction is executed by a processor to implement the above method.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained from these drawings without creative effort.
图1示出了本申请实施例提供的人脸识别系统的示意图;1 shows a schematic diagram of a face recognition system provided by an embodiment of the present application;
图2示出了本申请一实施例提供的图像更新方法的方法流程图;FIG. 2 shows a method flowchart of an image updating method provided by an embodiment of the present application;
图3示出了本申请一实施例提供的人脸图像存储表的示意图;3 shows a schematic diagram of a face image storage table provided by an embodiment of the present application;
图4示出了本申请另一实施例提供的人脸图像存储表的示意图;4 shows a schematic diagram of a face image storage table provided by another embodiment of the present application;
图5示出了本申请又一实施例提供的人脸图像存储表的示意图;5 shows a schematic diagram of a face image storage table provided by another embodiment of the present application;
图6示出了本申请再一实施例提供的人脸图像存储表的示意图;6 shows a schematic diagram of a face image storage table provided by still another embodiment of the present application;
图7示出了本申请另一实施例提供的图像更新方法的方法流程图;FIG. 7 shows a method flowchart of an image updating method provided by another embodiment of the present application;
图8示出了本申请实施例提供的提示信息的示意图;FIG. 8 shows a schematic diagram of prompt information provided by an embodiment of the present application;
图9示出了图7中S740的流程图;Fig. 9 shows the flowchart of S740 in Fig. 7;
图10示出了本申请又一实施例提供的图像更新方法的方法流程图;FIG. 10 shows a method flowchart of an image updating method provided by another embodiment of the present application;
图11示出了本申请再又一实施例提供的人脸图像存储表的示意图;11 shows a schematic diagram of a face image storage table provided by yet another embodiment of the present application;
图12示出了本申请再另一实施例提供的人脸图像存储表的示意图;12 shows a schematic diagram of a face image storage table provided by another embodiment of the present application;
图13示出了本申请再一实施例提供的图像更新方法的方法流程图;FIG. 13 shows a method flowchart of an image updating method provided by still another embodiment of the present application;
图14示出了图13中S1320的流程图;Fig. 14 shows the flowchart of S1320 in Fig. 13;
图15示出了本申请一实施例提供的图像更新装置的模块框图;15 shows a block diagram of a module of an image updating apparatus provided by an embodiment of the present application;
图16示出了本申请实施例提供的电子设备的模块框图;FIG. 16 shows a module block diagram of an electronic device provided by an embodiment of the present application;
图17示出了本申请实施例的用于保存或者携带实现根据本申请实施例的图像更新方法的程序代码的存储单元。FIG. 17 shows a storage unit for storing or carrying a program code for implementing the image updating method according to the embodiment of the present application according to the embodiment of the present application.
图18示出了本申请实施例提供的计算机程序产品的结构框图。FIG. 18 shows a structural block diagram of a computer program product provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本申请实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本申请的实施例的详细描述并非旨在限制要求保护的本申请的范围,而是仅仅表示本申请的选定实施例。基于本申请的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application generally described and illustrated in the drawings herein may be arranged and designed in a variety of different configurations. Thus, the following detailed description of the embodiments of the application provided in the accompanying drawings is not intended to limit the scope of the application as claimed, but is merely representative of selected embodiments of the application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。同时,在本申请的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。It should be noted that like numerals and letters refer to like items in the following figures, so once an item is defined in one figure, it does not require further definition and explanation in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
人脸识别技术的应用逐渐被应用到人们的工作和生活中,比如可以采集人脸图像进行支付认证、解锁认证,还可以对拍摄的人脸图像进行美颜处理。通过人脸识别技术中可以对图像中的人脸进行检测,还可以识别图像中的人脸是属于哪一个人的人脸,从而识别用户的身份。The application of face recognition technology is gradually applied to people's work and life. For example, face images can be collected for payment authentication, unlock authentication, and facial images can be beautified. Through the face recognition technology, the face in the image can be detected, and the face in the image can also be identified to which person's face, so as to identify the user's identity.
如图1所示,图1示出了本申请提供的人脸识别系统的示意图。该人脸识别系统包括服务器10 和用户终端20,用户终端20和服务器10位于无线网络或有线网络中,服务器10和用户终端20可以进行数据交互,该数据交互可以包括人脸识别以及人脸图像的更新等。As shown in FIG. 1 , FIG. 1 shows a schematic diagram of the face recognition system provided by the present application. The face recognition system includes a server 10 and a user terminal 20, the user terminal 20 and the server 10 are located in a wireless network or a wired network, and the server 10 and the user terminal 20 can perform data interaction, and the data interaction can include face recognition and face images. update etc.
于本申请实施例中,用户终端20设置有生物特征信息采集装置,用于采集用户的生物特征信息。其中,该生物特征信息采集装置可以是指纹模组、虹膜采集器和人脸采集装置,该指纹模组用于采集用户的指纹信息,虹膜采集器用于采集用户的虹膜信息,人脸采集装置用于采集用户的人脸图像信息。作为一种实施方式,用户终端20可以是移动用户终端设备,例如可以包括智能手机、平板电脑、电子书阅读器、膝上型便携计算机、车载电脑、穿戴式移动用户终端等等,也可以是具有生物特征信息采集装置的支付用户终端等。In the embodiment of the present application, the user terminal 20 is provided with a biometric information collection device, which is used to collect the user's biometric information. Wherein, the biometric information collection device can be a fingerprint module, an iris collector and a face collection device, the fingerprint module is used to collect the user's fingerprint information, the iris collector is used to collect the user's iris information, and the face collection device is used for collecting the user's iris information. It is used to collect the user's face image information. As an embodiment, the user terminal 20 may be a mobile user terminal device, for example, may include a smart phone, a tablet computer, an e-book reader, a laptop computer, a vehicle-mounted computer, a wearable mobile user terminal, etc. Payment user terminal with biometric information collection device, etc.
用户终端20内可以安装有客户端,具体地,客户端可以是安装在用户终端20的应用程序,该客户端可以获取用户终端20所采集的人脸图像,将该人脸图像发送至服务器10,服务器10对该人脸图像识别并将识别结果反馈至客户端,当然,该客户端也可以将用户终端20所采集的人脸图像录入服务器10,以便对服务器10内的人脸图像更新。A client terminal may be installed in the user terminal 20. Specifically, the client terminal may be an application program installed in the user terminal 20. The client terminal may acquire the face image collected by the user terminal 20 and send the face image to the server 10. , the server 10 recognizes the face image and feeds back the recognition result to the client. Of course, the client can also record the face image collected by the user terminal 20 into the server 10 to update the face image in the server 10 .
其中,服务器10内存储有已注册用户的人脸图像,该人脸图像可以作为已注册用户的身份信息,在支付、解锁用户终端等需要验证身份的场景中对登录的用户的身份进行验证,即执行人脸识别操作。The face image of the registered user is stored in the server 10, and the face image can be used as the identity information of the registered user to verify the identity of the logged-in user in scenarios that require identity verification, such as payment and unlocking of user terminals. That is, the face recognition operation is performed.
具体地,人脸识别一般包括如下两个流程:人脸注册和人脸验证识别。用户在首次使用前通常需要进行人脸注册,即将用户的人脸图像录入人脸注册库。在录入之后,通过匹配注册人脸图像和采集到的脸部图像识别对应的人脸。Specifically, face recognition generally includes the following two processes: face registration and face verification and recognition. The user usually needs to perform face registration before the first use, that is, the user's face image is entered into the face registration database. After the entry, the corresponding face is recognized by matching the registered face image and the collected face image.
而在人脸识别系统使用的过程中,光照,是否化妆,是否戴眼镜/墨镜,是否戴口罩、年龄的增长,发型的变化等因素都有可能使得用户的脸部特征发生变化,这种变化可能会导致人脸识别的准确率下降。所以需要对注册图像进行更新。In the process of using the face recognition system, factors such as lighting, whether to wear makeup, whether to wear glasses/sunglasses, whether to wear a mask, age growth, changes in hairstyles and other factors may cause changes in the user's facial features. It may lead to a decrease in the accuracy of face recognition. So the registration image needs to be updated.
发明人在研究中发现,目前的人脸更新往往需要将待识别的人脸图像与已注册人脸图像进行匹配,得到匹配分数。当得到的匹配分数大于预设阈值后,根据不同的更新策略对注册图像进行更新。具体地,目前的人脸更新存在以下两个缺陷:预设阈值如果设置的过低,会导致误识别和频繁的注册库更新,预设阈值如果设置的过高,输入图片和注册图像比较相似,忽略了变化,达不到通过更新注册模板,来提升识别性能的目的;另外,现在更新数据库内的人脸图像的时候,是直接将新的人脸图像更新到数据库内的,然后,新的人脸图像可能并非是数据库内的已注册用户的人脸图像,即出现误识别,再者,注册时间越近的图像,应该和用户现在的真实状态相似,在识别的时候应该给与的考虑越多;最后,需要人为设置注册图片数目,过少可能性能有损失,过多会占用太多的系统资源。The inventor found in the research that the current face update often needs to match the face image to be recognized with the registered face image to obtain a matching score. When the obtained matching score is greater than the preset threshold, the registered image is updated according to different update strategies. Specifically, the current face update has the following two defects: if the preset threshold is set too low, it will lead to misidentification and frequent registration database updates; if the preset threshold is set too high, the input image and the registered image are similar , ignoring the changes, and cannot achieve the purpose of improving the recognition performance by updating the registration template; in addition, when updating the face image in the database, the new face image is directly updated into the database, and then the new face image is updated. The face image of the user may not be the face image of the registered user in the database, that is, there is a misrecognition. Furthermore, the image with the recent registration time should be similar to the real state of the user, and should be given when identifying. The more you think about it; in the end, you need to manually set the number of registered images. Too little may result in loss of performance, and too much will take up too much system resources.
因此,为了改善上述缺陷,本申请实施例提供了一种图像更新方法、装置、电子设备及计算机可读介质,使用双阈值对待识别的人脸图像进行判断,过滤掉匹配分数过高和过低的待识别人脸图像,对数据库中的已注册用户的人脸图像更新,不仅能够提高识别性能,还能够降低对数据库的频繁写入造成的损耗。Therefore, in order to improve the above-mentioned defects, the embodiments of the present application provide an image updating method, apparatus, electronic device, and computer-readable medium, which use double thresholds to judge the face image to be recognized, and filter out the matching scores that are too high and too low. The face image to be recognized is updated, and the face image of the registered user in the database is updated, which can not only improve the recognition performance, but also reduce the loss caused by frequent writing to the database.
具体地,请参阅图2,图2示出了本申请实施例提供的一种图像更新方法,该更新方法的执行主体可以是上述的服务器,也可以是上述的用户终端,在此不做限定。具体地,该方法包括:S201至S203。Specifically, please refer to FIG. 2. FIG. 2 shows an image updating method provided by an embodiment of the present application. The execution body of the updating method may be the above-mentioned server or the above-mentioned user terminal, which is not limited here. . Specifically, the method includes: S201 to S203.
S201:获取待识别的人脸图像。S201: Acquire a face image to be recognized.
于本申请实施例中,执行人脸图像的更新方法的场景可以是,在用户终端通过用户的人脸图像 对用户的身份信息进行验证的时候,具体地,用户在登录用户终端的客户端的时候,通过用户终端的摄像头输入用户的人脸图像,用户终端的客户端获取该用户的人脸图像,对该人脸图像进行身份验证,在验证通过的时候,可以基于该人脸图像执行对用户在注册时录入的人脸图像的更新,即将该用于用户身份识别的人脸图像作为本次的待识别的人脸图像。In the embodiment of the present application, the scenario of executing the method for updating the face image may be, when the user terminal verifies the user's identity information through the user's face image, specifically, when the user logs in to the client of the user terminal. , input the user's face image through the camera of the user terminal, and the client of the user terminal obtains the user's face image, and performs identity verification on the face image. The update of the face image entered during registration, that is, the face image used for user identity recognition as the face image to be recognized this time.
作为另一种实施方式,用户可以操作用户终端的客户端,使该客户端执行人脸图像更新操作,即可以在未执行身份验证的操作的情况下,单独执行人脸图像的更新操作。例如,客户端提供人脸图像更新功能,管理员能够获取用户输入的人脸图像,基于该人脸图像执行人脸图像的更新操作。As another implementation manner, the user can operate the client of the user terminal to make the client perform the face image update operation, that is, the face image update operation can be performed independently without performing the authentication operation. For example, the client provides a face image update function, and the administrator can obtain the face image input by the user, and perform the update operation of the face image based on the face image.
在一些实施例中,待识别的人脸图像可以是对用户的人脸区域现场拍摄得到的人脸图像。例如,上述的用户身份验证的时候采集的用户的人脸图像。在另一些实施例中,待识别的人脸图像还可以是预先存储的包含用户的人脸区域的人脸图像。例如,用户通过用户终端采集该用户的人脸图像,将该人脸图像发送至服务器,服务器存储多个用户上传的人脸图像,在执行更新人脸图像的时刻,获取该用户的人脸图像作为本次待识别的人脸图像执行图像更新操作,即基于该待识别的人脸图像对服务器内预先存储的用户的人脸图像进行更新。In some embodiments, the face image to be recognized may be a face image obtained by on-site shooting of the user's face area. For example, the user's face image is collected during the above-mentioned user authentication. In other embodiments, the face image to be recognized may also be a pre-stored face image including the user's face area. For example, the user collects the face image of the user through the user terminal, sends the face image to the server, the server stores the face images uploaded by multiple users, and obtains the face image of the user at the moment of updating the face image. The image update operation is performed as the face image to be identified this time, that is, the face image of the user pre-stored in the server is updated based on the face image to be identified.
S202:将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果。S202: Match the face image to be recognized with the face image of the registered user in the database to obtain a matching result.
作为一种实施方式,该数据库布置在上述的服务器内,即该数据库为上述服务器内的存储空间,用户在注册的时候,会在服务器内存储至少一个人脸图像。具体地,用户在用户终端的客户端注册的时候,会录入至少一张人脸图像,并且录入用户帐号,然后,将该用户帐号和所录入的至少一张图像发送至服务器,服务器在数据库内将所接收的客户端发送的至少一张图像与该用户帐号对应存储。As an implementation manner, the database is arranged in the above-mentioned server, that is, the database is a storage space in the above-mentioned server, and when a user registers, at least one face image will be stored in the server. Specifically, when the user registers at the client of the user terminal, he will enter at least one face image and the user account, and then send the user account and the entered at least one image to the server, and the server is in the database The received at least one image sent by the client is stored corresponding to the user account.
作为一种实施方式,服务器在数据库内将不同的用户对应存储各用户对应的人脸图像,如图3所示的人脸图像存储表,每个用户帐号与该用户帐号对应的人脸图像对应存储,其中,“人脸11”作为用户1的人脸图像的图像标识。As an implementation manner, the server stores the face images corresponding to different users in the database, such as the face image storage table shown in FIG. 3 , each user account corresponds to the face image corresponding to the user account Store, where "face 11" is used as the image identifier of the face image of user 1.
其中,该数据库内所存储的人脸图像的格式可以是图片格式,例如,bmp,jpg,png,tif,gif,pcx,tga,exif,fpx,svg,psd,cdr,pcd,dxf,ufo,eps,ai,raw,WMF,webp等格式。The format of the face image stored in the database may be a picture format, for example, bmp, jpg, png, tif, gif, pcx, tga, exif, fpx, svg, psd, cdr, pcd, dxf, ufo, eps, ai, raw, WMF, webp and other formats.
作为另一种实施方式,该数据库内所存储的人脸图像的格式可以是特征数据,即服务器将该人脸图像的特征值提取,将每个人脸图像的特征值与用户账号对应存储。如图4所示,其中,“特征11”作为用户1的人脸图像的特征数据的数据标识,其中,数据库将人脸图像的原始图像和特征数据分别存储,即图片格式和数据格式分别存储,其中,图像标识对应图片格式的人脸图像,数据格式对应人脸图像的特征数据。如图4所示,特征11对应的用户账号为用户1,因此,通过该用户账号和特征标识能够便捷地查找到用户账号对应的人脸图像的特征数据。在一些实施例中,还可以将用户帐号同时对应存储人脸图像的图像标识和数据标识,通过该用户账号、图像标识和特征标识能够便捷地查找到用户账号对应的人脸图像以及该人脸图像对应的特征数据。通过直接将特征数据存储,能够方便对人脸图像执行比对、识别、匹配以及图像处理。As another embodiment, the format of the face images stored in the database may be feature data, that is, the server extracts the feature values of the face images, and stores the feature values of each face image corresponding to the user account. As shown in Fig. 4, "feature 11" is used as the data identifier of the feature data of the face image of user 1, wherein the database stores the original image and feature data of the face image respectively, that is, the picture format and the data format are stored separately , wherein the image identifier corresponds to a face image in a picture format, and the data format corresponds to the feature data of the face image. As shown in FIG. 4 , the user account corresponding to the feature 11 is the user 1. Therefore, the feature data of the face image corresponding to the user account can be conveniently found through the user account and the feature identifier. In some embodiments, the user account can also be stored corresponding to the image identification and data identification of the face image at the same time, and the face image corresponding to the user account and the face can be conveniently found through the user account, image identification and feature identification. The feature data corresponding to the image. By directly storing the feature data, it is convenient to perform comparison, recognition, matching and image processing on face images.
在获取到待识别的人脸图像之后,将该待识别的人脸图像与数据库中的已注册用户的人脸图像进行匹配,其中,该已注册用户为预先成功注册且在数据库内录入人脸图像的用户。作为一种实施方式,根据预设匹配算法将该待识别的人脸图像与数据库中的已注册用户的人脸图像进行匹配。其中,该预设匹配算法可以是,对待识别的人脸图像人脸提取特征,并和数据库中的已注册用户的人脸图像提取的人脸特征进行特征比较,具体可采用特征之间的欧式距离等,在此不做限定,从而获取待识别图像与已注册用户的人脸图像的匹配分数。After acquiring the face image to be recognized, the face image to be recognized is matched with the face image of the registered user in the database, wherein the registered user is pre-registered successfully and the face is entered in the database image user. As an implementation manner, the face image to be recognized is matched with the face image of the registered user in the database according to a preset matching algorithm. The preset matching algorithm may be to extract features from the face image to be recognized, and compare the features with the face features extracted from the face images of registered users in the database. Specifically, the Euclidean pattern between the features may be used. The distance, etc., is not limited here, so as to obtain the matching score between the image to be recognized and the face image of the registered user.
需要说明的是,待识别的人脸图像与已注册用户的人脸图像的匹配分数越高,则可以表示待识别的人脸图像中的用户与该已注册用户为同一用户的概率越大。例如,待识别的人脸图像与已注册用户的人脸图像的匹配分数归一化到[0,1]之间,越接近于1越说明是同一用户。作为示例,待识别的人脸图像与已注册用户的人脸图像的匹配分数可以表示为待识别的人脸图像与已注册用户的人脸图像中相似度最高的人脸图像的匹配分数。It should be noted that the higher the matching score between the face image to be identified and the face image of the registered user, the higher the probability that the user in the face image to be identified and the registered user are the same user. For example, the matching score between the face image to be recognized and the face image of the registered user is normalized to [0, 1], and the closer it is to 1, the more it indicates the same user. As an example, the matching score of the face image to be recognized and the registered user's face image may be expressed as the matching score of the face image to be recognized and the registered user's face image with the highest similarity.
作为一种实施方式,如果已注册用户对应的人脸图像为多个,将待识别的人脸图像与该已注册用户的每个人脸图像匹配,得到每个人脸图像对应的相似度,根据每个人脸图像的相似度确定待识别的人脸图像与该已注册用户的人脸图像之间的匹配结果。具体地,通过上述的预设算法获取待识别的人脸图像与每个人脸图像之间的相似度,可以将所有的相似度的平均值作为匹配结果,也可以是将所有的相似度中最低或最高的相似度作为匹配结果。As an implementation manner, if there are multiple face images corresponding to the registered user, the face image to be recognized is matched with each face image of the registered user, and the similarity corresponding to each face image is obtained. The similarity of the face images determines the matching result between the face image to be recognized and the face image of the registered user. Specifically, the similarity between the face image to be recognized and each face image is obtained through the above-mentioned preset algorithm, and the average value of all the similarities may be used as the matching result, or the lowest among all the similarities may be used. or the highest similarity as the matching result.
S203:若所述匹配结果小于第一阈值且大于第二阈值,则将所述待识别的人脸图像作为新的人脸图像更新至所述数据库。S203: If the matching result is less than the first threshold and greater than the second threshold, update the face image to be recognized to the database as a new face image.
作为一种实施方式,当所述数据库包括多个已注册用户的时候,获取待识别的人脸图像与每个已注册用户的人脸图像对应的匹配结果,由所有匹配结果中查找小于第一阈值且大于第二阈值的匹配结果,作为目标匹配结果,将该目标匹配结果对应的已注册用户作为目标用户。As an embodiment, when the database includes a plurality of registered users, obtain a matching result corresponding to the face image to be recognized and the face image of each registered user, and search for the matching results that are smaller than the first The matching result whose threshold is greater than the second threshold is regarded as the target matching result, and the registered user corresponding to the target matching result is regarded as the target user.
作为一种实施方式,所述匹配结果大于第二阈值的情况下,所述待识别的人脸图像与已注册用户的人脸图像对应相同的用户,则可以认为待识别人脸图像对应的用户与数据库内的已注册用户相同,即待识别人脸图像对应的用户为数据库内的已注册用户。具体地,获取匹配结果的实施方式可以参考前述步骤,在此不再赘述。匹配结果小于或等于第二阈值的情况下,所述待识别的人脸图像与已注册用户的人脸图像对应不相同的用户,则可以认为待识别人脸图像对应的用户与数据库内的已注册用户不相同,即待识别人脸图像对应的用户并非数据库内的已注册用户。As an embodiment, when the matching result is greater than the second threshold, and the face image to be identified corresponds to the same user as the face image of the registered user, it can be considered that the user corresponding to the face image to be identified corresponds to the user It is the same as the registered user in the database, that is, the user corresponding to the face image to be recognized is the registered user in the database. Specifically, for the implementation manner of obtaining the matching result, reference may be made to the foregoing steps, which will not be repeated here. In the case where the matching result is less than or equal to the second threshold, the face image to be identified corresponds to a different user from the face image of the registered user, then it can be considered that the user corresponding to the face image to be identified is the same as the user already in the database. The registered users are not the same, that is, the user corresponding to the face image to be recognized is not a registered user in the database.
作为另一种实施方式,所述匹配结果大于或等于第一阈值的情况下,则可以认为待识别人脸图像对应的用户与数据库内的已注册用户相同,并且,待识别的人脸图像与已注册用户的人脸图像之间的差异度非常小,即可以认为二者之间不存在差异,即该差异可以忽略不计,或者而说,该差异度不满足更新条件,也就是说,匹配结果大于或等于第一阈值的情况下,表示待识别人脸图像与数据库内的已注册用户是同一个人的概率非常高,人脸图像非常相似,不能体现人脸图像的变化,舍弃当前待识别的人脸图像,即不执行基于该待识别的人脸图像对数据库内的已注册用户的人脸图像更新的操作。As another implementation, when the matching result is greater than or equal to the first threshold, it can be considered that the user corresponding to the face image to be recognized is the same as the registered user in the database, and the face image to be recognized is the same as the registered user in the database. The difference between the registered user's face images is very small, that is, it can be considered that there is no difference between the two, that is, the difference can be ignored, or the difference does not meet the update condition, that is, the matching When the result is greater than or equal to the first threshold, it means that the probability that the face image to be recognized and the registered user in the database are the same person is very high, the face image is very similar, and cannot reflect the change of the face image, and the current pending recognition is discarded. The face image of the registered user in the database is not updated based on the face image to be recognized.
如果所述匹配结果小于第一阈值的情况下,所述待识别的人脸图像与已注册用户的人脸图像之间存在差异,即可以判定待识别的人脸图像与已注册用户的人脸图像并非同一个图像,或者说,二者的人脸特征并非是同样的特征。If the matching result is less than the first threshold, there is a difference between the face image to be identified and the face image of the registered user, that is, it can be determined that the face image to be identified and the face of the registered user are different The images are not the same image, or the facial features of the two are not the same.
因此,在匹配结果小于第一阈值且大于第二阈值的情况下,可以判定所述待识别的人脸图像与已注册用户的人脸图像对应相同的用户,并且,待识别的人脸图像与已注册用户的人脸图像之间存在差异,所以,该待识别的人脸图像可以作为数据库内的已注册用户的人脸图像的补充图像,即新的人脸图像,进而执行将所述待识别的人脸图像作为新的人脸图像更新至所述数据库的操作。Therefore, when the matching result is less than the first threshold and greater than the second threshold, it can be determined that the face image to be identified corresponds to the same user as the face image of the registered user, and the face image to be identified is the same as the face image of the registered user. There are differences between the face images of the registered users, so the face image to be recognized can be used as a supplementary image of the face image of the registered user in the database, that is, a new face image, and then the The operation of updating the recognized face image to the database as a new face image.
作为一种实施方式,将所述待识别的人脸图像作为新的人脸图像更新至所述数据库的实施方式可以是,将所述待识别的人脸图像写入数据库,由数据库将该待识别的人脸图像与目标用户对应存储。具体地,可以在目标用户本已对应存储的人脸图像的基础上,再增加存储该待识别的人脸图像,如图5所示,特征14为待识别的人脸图像的特征数据的数据标识,可以看出,在数据库内在用户1 之前对应的特征11、特征12和特征13的基础上,新增加了待识别的人脸图像的特征数据的数据标识,即特征14。As an embodiment, the embodiment of updating the face image to be recognized to the database as a new face image may be that the face image to be recognized is written into the database, and the database uses the face image to be recognized. The recognized face image is stored corresponding to the target user. Specifically, on the basis of the face image that has been stored correspondingly by the target user, the face image to be recognized can be additionally stored. As shown in FIG. 5 , feature 14 is the data of the feature data of the face image to be recognized. It can be seen that, on the basis of the features 11, 12 and 13 corresponding to the user 1 in the database, the data identification of the feature data of the face image to be recognized, that is, the feature 14 is newly added.
作为另一种实施方式,还可以是将数据库内目标用户对应的所有的人脸图像中的至少一个人脸图像替换为待识别的人脸图像,具体地,如图6所示,特征13’为特征13被替换后的特征数据,该特征13’为待识别的人脸图像的特征数据。作为一种实施方式,当目标用户对应多个人脸图像时,可以从多个人脸图像中确定目标人脸图像,将目标人脸图像更新为待识别的人脸图像。作为一种实施方式,可以是将多个人脸图像中的匹配结果最低的人脸图像作为目标人脸图像,也可以是将多个人脸图像中的匹配结果最高的人脸图像作为目标人脸图像。As another implementation, at least one face image in all face images corresponding to the target user in the database may be replaced with the face image to be recognized. Specifically, as shown in FIG. 6 , feature 13 ′ is the feature data after the feature 13 is replaced, and the feature 13' is the feature data of the face image to be recognized. As an embodiment, when the target user corresponds to multiple face images, the target face image can be determined from the multiple face images, and the target face image is updated to the face image to be recognized. As an embodiment, the face image with the lowest matching result among the multiple face images may be used as the target face image, or the face image with the highest matching result among the multiple face images may be used as the target face image .
因此,上述方法中,获取待识别的人脸图像;将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果,根据匹配结果能够对数据库中的已注册用户的人脸图像更新,例如,增加新的图像或者修改已有图像。具体地,确定是否更新的方式为,若所述匹配结果小于第一阈值且大于第二阈值,则将所述待识别的人脸图像作为新的人脸图像更新至所述数据库,其中,如果匹配结果大于第二阈值,则表明待识别的人脸图像与已注册用户的人脸图像对应相同的用户,如果匹配结果小于第一阈值,则表明待识别的人脸图像与已注册用户的人脸图像之间存在差异,因此,在根据匹配结果确定待识别的人脸图像属于已注册用户且与数据库内的人脸图像的差异较大,满足更新的要求的情况下,对数据库中的已注册用户的人脸图像更新,不仅能够提高识别性能,还能够降低对数据库的频繁写入造成的损耗。Therefore, in the above method, the face image to be identified is obtained; the face image to be identified is matched with the face image of the registered user in the database, and a matching result is obtained. The user's face image is updated, for example, adding a new image or modifying an existing image. Specifically, the method of determining whether to update is as follows: if the matching result is less than a first threshold and greater than a second threshold, update the face image to be recognized to the database as a new face image, wherein if If the matching result is greater than the second threshold, it indicates that the face image to be recognized corresponds to the same user as the registered user’s face image, and if the matching result is less than the first threshold, it indicates that the face image to be recognized is the same as the registered user’s face image. There are differences between face images. Therefore, when it is determined according to the matching result that the face image to be recognized belongs to a registered user and is quite different from the face image in the database and meets the requirements for updating, the existing face image in the database is determined. The face image update of registered users can not only improve the recognition performance, but also reduce the loss caused by frequent writing to the database.
另外,本申请实施例提供的图像更新方法,除了采用双阈值的方式提高识别性能以及降低对数据库的频繁写入造成的损耗之外,还可以降低误识别,提高识别稳定性和性能,具体地,请参阅图7,图7示出了本申请实施例提供的一种图像更新方法,该更新方法的执行主体可以是上述的服务器,也可以是上述的用户终端,在此不做限定。具体地,该方法包括:S710至S740。In addition, the image updating method provided by the embodiments of the present application can reduce misrecognition and improve recognition stability and performance, in addition to using double thresholds to improve the recognition performance and reduce the loss caused by frequent writing to the database. 7 , which shows an image updating method provided by an embodiment of the present application. The execution body of the updating method may be the above-mentioned server or the above-mentioned user terminal, which is not limited here. Specifically, the method includes: S710 to S740.
S710:获取待识别的人脸图像。S710: Acquire a face image to be recognized.
S720:将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果。S720: Match the face image to be recognized with the face image of the registered user in the database to obtain a matching result.
S710和S720的实施方式可以参考前述实施例,在此不再赘述。For the implementation of S710 and S720, reference may be made to the foregoing embodiments, and details are not described herein again.
S730:若所述匹配结果小于第一阈值且大于第二阈值,则获取所述待识别的人脸图像的第一特征数据以及已注册用户的人脸图像的第二特征数据。S730: If the matching result is less than the first threshold and greater than the second threshold, obtain the first feature data of the face image to be recognized and the second feature data of the face image of the registered user.
作为一种实施方式,本申请实施例的执行主体可以是服务器,服务器在判定匹配结果小于第一阈值且大于第二阈值,可以直接执行将所述待识别的人脸图像作为新的人脸图像更新至所述数据库的操作,例如,直接执行S730。作为另一种实施方式,服务器在判定匹配结果小于第一阈值且大于第二阈值,反馈提示信息至用户终端,用户终端在指定界面内显示该提示信息,当检测到用户基于该提示信息输入的确认指令时,基于该确认指令执行将所述待识别的人脸图像作为新的人脸图像更新至所述数据库的操作或S730的操作。As an implementation manner, the execution body of this embodiment of the present application may be a server, and when the server determines that the matching result is less than the first threshold and greater than the second threshold, the server may directly execute the face image to be recognized as a new face image The operation of updating to the database, for example, directly executes S730. As another implementation, the server feeds back prompt information to the user terminal after determining that the matching result is less than the first threshold and greater than the second threshold, and the user terminal displays the prompt information in the designated interface. When the confirmation instruction is performed, the operation of updating the face image to be recognized to the database as a new face image or the operation of S730 is performed based on the confirmation instruction.
在一些实施例中,该指定界面可以是人脸识别的界面,具体地,该人脸识别的界面可以是支付操作或解锁操作对应的界面,在此不做限定。其中,该支付操作可以是用户针对应用程序的支付模块的操作,解锁操作可以是用户对用户终端解锁时的操作。因此,该指定界面可以是用户终端所显示的支付界面或解锁界面。In some embodiments, the designated interface may be a face recognition interface, and specifically, the face recognition interface may be an interface corresponding to a payment operation or an unlock operation, which is not limited herein. The payment operation may be an operation performed by the user on the payment module of the application, and the unlocking operation may be an operation performed when the user unlocks the user terminal. Therefore, the designated interface may be a payment interface or an unlocking interface displayed by the user terminal.
如图8所示,该指定界面80上显示有提示框810,在该提示框810内显示有“是否允许更新人脸图像库”,即图8所示,该提示信息可以是图中所显示的“是否允许更新人脸图像库”。用户在支付或者解锁终端等场景下,在指定界面内进行人脸识别,在人脸识别通过,并且匹配结果满足小于 第一阈值且大于第二阈值的情况下,该指定界面80显示提示信息,用户在该提示信息内输入确认指令,以指示服务器执行将所述待识别的人脸图像作为新的人脸图像更新至所述数据库的操作或S730的操作。作为一种实施方式,该确认指令的输入方式可以是操作该指定界面的确认按钮,也可以是通过语音的方式输入,还可以是通过人脸的表情输入。As shown in FIG. 8 , a prompt box 810 is displayed on the designation interface 80, and “whether to allow updating the face image database” is displayed in the prompt box 810, that is, as shown in FIG. 8, the prompt information can be displayed in the figure. "Whether to allow updating face image library". In scenarios such as payment or unlocking of the terminal, the user performs face recognition in the designated interface, and the designated interface 80 displays prompt information when the face recognition passes and the matching result satisfies less than the first threshold and greater than the second threshold. The user inputs a confirmation instruction in the prompt message to instruct the server to perform the operation of updating the face image to be recognized to the database as a new face image or the operation of S730. As an implementation manner, the input method of the confirmation instruction may be operating a confirmation button on the designated interface, or may be input by voice, or may be input by facial expression.
作为一种实施方式,在该提示框810内显示有确认按钮811和拒绝按钮812,用户通过该确认按钮811输入确认指令,也可以通过拒绝按钮812输入拒绝指令,则当服务器获取到该拒绝指令时,不执行将所述待识别的人脸图像作为新的人脸图像更新至所述数据库的操作或S730的操作,而执行在指定界面对应的应用功能在人脸识别成功之后的操作,例如,如果该指定界面为支付界面,则该之后的操作为显示支付成功的界面或者显示支付订单、返回支付之前的界面等,如果该指定界面为解锁界面,则该之后的操作为显示系统桌面或者在用户终端本次锁屏之前屏幕上显示的界面。As an embodiment, a confirmation button 811 and a reject button 812 are displayed in the prompt box 810. The user can input a confirmation instruction through the confirmation button 811, or can input a rejection instruction through the reject button 812. When the server obtains the rejection instruction , do not perform the operation of updating the face image to be identified as a new face image to the database or the operation of S730, but perform the operation of the application function corresponding to the designated interface after the face recognition is successful, such as , if the specified interface is a payment interface, the subsequent operation is to display the payment success interface or display the payment order, return to the interface before payment, etc. If the specified interface is an unlock interface, then the subsequent operation is to display the system desktop or The interface displayed on the screen before the user terminal locks the screen this time.
作为另一种实施方式,在该指定界面内显示提示信息之后,可以不必在该界面内显示确认按钮811和拒绝按钮812,然后,获取用户终端在第一预设时间段内采集的多张人脸图像,基于采集的多张人脸图像确定用户的面部动作信息,该面部动作信息可以包括眼睛的动态变化、嘴角的动态变化以及耳朵的动态变化等。确定该面部动作信息是否为第一面部动作,如果是,则判定接收到确认指令,如果未接收到第一面部动作,则判定接收到拒绝指令。作为一种实施方式,可以是在第一预设时间段内实时采集人脸图像,并且实时根据采集的多张人脸图像确定面部动作信息,如果确定该面部动作信息为第一面部动作则判定接收到确认指令,如果该面部动作信息为第二面部动作,则判定接收到拒绝指令,如果在第一预设时间段结束时,仍未检测到第一面部动作,则可以判定接收到拒绝指令。其中,该第一面部动作和第二面部动作可以是由眨眼、瞳孔由第一位置向第二位置移动、嘴角上扬以及嘴巴张开再闭合等确定的两个不同的表情,其中,第一位置为眼睛最左侧位置,第二位置为眼睛最右侧位置,在此不做限定。示例性地,第一面部动作和第二面部动作可以是相反的动作,例如,第一面对动作是嘴巴张开,第二面部动作是嘴巴闭合。通过设置第一面部动作和第二面部动作是相反的动作,使得用户比较容易记住第一面部动作和第二面部动作,减少操作复杂度。As another implementation manner, after the prompt information is displayed in the designated interface, it is not necessary to display the confirmation button 811 and the reject button 812 in the interface, and then acquire a plurality of people collected by the user terminal within the first preset time period Face image, based on the collected multiple face images to determine the user's facial motion information, the facial motion information may include dynamic changes of eyes, dynamic changes of mouth corners, and dynamic changes of ears, etc. It is determined whether the facial motion information is the first facial motion, and if so, it is determined that a confirmation instruction is received, and if the first facial motion is not received, it is determined that a rejection instruction is received. As an embodiment, a face image may be collected in real time within a first preset time period, and facial motion information may be determined in real time according to the collected multiple face images, if the facial motion information is determined to be the first facial motion, then It is determined that a confirmation instruction has been received, and if the facial motion information is the second facial motion, it is determined that a rejection instruction has been received. If the first facial motion has not been detected at the end of the first preset time period, it can be determined that Deny the order. The first facial action and the second facial action may be two different expressions determined by blinking, moving the pupil from the first position to the second position, raising the corner of the mouth, opening and closing the mouth, etc. The position is the leftmost position of the eye, and the second position is the rightmost position of the eye, which is not limited here. Illustratively, the first facial motion and the second facial motion may be opposite motions, eg, the first facial motion is mouth opening and the second facial motion is mouth closing. By setting the first facial action and the second facial action to be opposite actions, it is easier for the user to remember the first facial action and the second facial action, and the operation complexity is reduced.
作为又一种实施方式,可以是在该指定界面内显示提示信息之后,可以不必在该界面内显示确认按钮811和拒绝按钮812,然后,获取用户终端在第二预设时间段内采集的用户肢体图像,基于采集的多张用户肢体图像确定用户的身体动作信息,其中,该身体动作信息可以包括用户的手部、胳膊等部位的动作,例如,手部的手势动作以及胳膊的摆动次数和角度范围等信息。确定该身体动作信息是否为第一身体动作,如果是,则判定接收到确认指令,如果未接收到第一身体动作,则判定接收到拒绝指令。作为一种实施方式,可以是在第二预设时间段内实时采集人脸图像,并且实时根据采集的多张人脸图像确定面部动作信息,如果确定该身体动作信息为第一身体动作则判定接收到确认指令,如果该身体动作信息为第二身体动作,则判定接收到拒绝指令,如果在第二预设时间段结束时,仍未检测到第一身体动作,则可以判定接收到拒绝指令。其中,第一身体动作和第二身体动作可以由手部握拳、手部握拳再伸开、翻手或者手部作出的其他手势等动作中确定的两个不同的动作,在此不做限定。As another embodiment, after the prompt information is displayed in the designated interface, it is not necessary to display the confirmation button 811 and the reject button 812 in the interface, and then the user terminal collected by the user terminal in the second preset time period is acquired. Limb images, determine the user's body motion information based on the collected multiple user body images, where the body motion information may include the actions of the user's hands, arms, etc. angle range, etc. It is determined whether the body motion information is the first body motion, if so, it is determined that a confirmation instruction is received, and if the first body motion is not received, it is determined that a rejection instruction is received. As an embodiment, a face image may be collected in real time within a second preset time period, and facial motion information may be determined in real time according to the collected multiple face images, and if it is determined that the body motion information is the first body motion If the confirmation instruction is received, if the body motion information is the second body motion, it is determined that a rejection instruction is received. If the first body motion is still not detected at the end of the second preset time period, it can be determined that the rejection instruction is received. . Wherein, the first body movement and the second body movement may be two different movements determined from actions such as clenching a fist, clenching a fist and extending it, turning a hand, or other gestures made by the hand, which are not limited herein.
作为再一种实施方式,还可以是同时将上述的面部动作信息和身体动作信息结合使用,具体地,在确定面部动作信息为第一面部动作且身体动作信息为第一身体动作的时候,判定接收到确认指令,在确定面部动作信息不为第一面部动作且身体动作信息不为第一身体动作的至少一种情况发生时,判定接收到拒绝指令。具体地,面部动作信息和身体动作信息的判定,可以参考前述实施方式,在此不再赘述。As a further embodiment, the above-mentioned facial motion information and body motion information may also be used in combination. Specifically, when it is determined that the facial motion information is the first facial motion and the body motion information is the first body motion, It is determined that a confirmation instruction is received, and a rejection instruction is determined to be received when it is determined that at least one of the situations in which the facial motion information is not the first facial motion and the body motion information is not the first body motion occurs. Specifically, for the determination of the facial motion information and the body motion information, reference may be made to the foregoing embodiments, which will not be repeated here.
作为又一种实施方式,可以在该指定界面内显示确认按钮811和拒绝按钮812的情况下,在检测用户对确认按钮811和拒绝按钮812的同时,检测用户输入的指定动作信息,该指定动作信息可以是上述的面部动作信息和身体动作信息的至少一种,具体地,在检测到用户触发确认按钮811,并且指定动作信息满足指定条件的情况下,判定接收到确认指令,在检测到用户触发拒绝按钮812,并且指定动作信息不满足指定条件的情况下,判定接收到拒绝指令。其中,指定动作信息满足指定条件可以是,该身体动作信息为第一身体动作或如果该面部动作信息为第一面部动作的至少一种,具体地,请参考前述实施例,在此不再赘述。As another embodiment, when the confirmation button 811 and the reject button 812 are displayed in the designated interface, the designated action information input by the user can be detected at the same time as the user's response to the confirmation button 811 and the reject button 812, and the designated action can be detected. The information can be at least one of the above-mentioned facial motion information and body motion information. Specifically, when it is detected that the user triggers the confirmation button 811 and the specified motion information satisfies the specified conditions, it is determined that a confirmation instruction is received, and when the user is detected When the reject button 812 is triggered and the designated action information does not satisfy the designated condition, it is determined that a reject instruction has been received. Wherein, the specified action information satisfies the specified condition may be that the body action information is a first body action or if the facial action information is at least one of the first facial actions, specifically, please refer to the foregoing embodiment, which is not repeated here. Repeat.
作为一种实施方式,获取所述待识别的人脸图像的第一特征数据以及已注册用户的人脸图像的第二特征数据的实施方式可以是,通过预设特征提取算法处理待识别的人脸图像得到第一特征数据,如果数据库内预先存储有已注册用户的人脸图像的特征数据,则已注册用户的人脸图像的第二特征数据可以预先从数据库内查找,如果数据库内未存储有已注册用户的人脸图像的特征数据,则通过预设特征提取算法处理已注册用户的人脸图像得到第二特征数据。其中,预设算法可以是传统的机器学习方法,也可以采用基于CNN(Convolutional Neural Network,卷积神经网络)模型的深度学习方法等,在此不做限定。As an implementation manner, the implementation of acquiring the first feature data of the face image to be recognized and the second feature data of the registered user's face image may be: processing the person to be recognized by a preset feature extraction algorithm The face image obtains the first feature data. If the feature data of the face image of the registered user is pre-stored in the database, the second feature data of the face image of the registered user can be searched in advance from the database. If there is feature data of the face image of the registered user, the second feature data is obtained by processing the face image of the registered user through a preset feature extraction algorithm. The preset algorithm may be a traditional machine learning method, or a deep learning method based on a CNN (Convolutional Neural Network, convolutional neural network) model, etc., which is not limited here.
S740:根据所述第一特征数据和所述第二特征数据获取已注册用户的新的人脸图像的特征数据,并将新的特征数据更新至所述数据库。S740: Acquire feature data of a new face image of a registered user according to the first feature data and the second feature data, and update the new feature data to the database.
需要说明的是,可以直接将第一特征数据作为新的人脸图像的特征数据,并将新的特征数据更新至所述数据库,也可以执行S740的步骤,其中,新的人脸图像的特征数据可以命名为第三特征数据,则第三特征数据与第一特征数据和所述第二特征数据相关,从而可以使得第三特征数据同时保留第一特征数据和所述第二特征数据的部分特性,因此,将该新的特征数据更新至所述数据库之后,使得已注册用户对应的人脸图像不仅具有待识别的人脸图像的特征,还具有预先已经存储的人脸图像的特征,能够避免由于误识别的问题,直接将待识别的人脸图像作为新的人脸图像而导致与已注册用户对应的新的人脸图像有误。It should be noted that the first feature data can be directly used as the feature data of the new face image, and the new feature data can be updated to the database, and the step of S740 can also be performed, wherein the features of the new face image The data can be named as third feature data, then the third feature data is related to the first feature data and the second feature data, so that the third feature data can retain the first feature data and the second feature data at the same time. Therefore, after the new feature data is updated to the database, the face image corresponding to the registered user not only has the feature of the face image to be recognized, but also has the feature of the face image that has been stored in advance, which can To avoid the problem of misrecognition, the face image to be recognized is directly used as the new face image, resulting in an error in the new face image corresponding to the registered user.
其中,可以通过预设方法将第一特征数据和所述第二特征数据加权求和、相乘、相减或者卷积的方式实现第一特征数据和所述第二特征数据融合得到第三特征数据。Wherein, the first feature data and the second feature data may be fused to obtain the third feature by weighted summation, multiplication, subtraction or convolution of the first feature data and the second feature data by a preset method. data.
作为一种实施方式,可以采用加权融合的方式,得到第三特征数据,具体地,如图9所示,S740的实施方式可以包括S741至S743。As an implementation manner, the third feature data may be obtained by means of weighted fusion. Specifically, as shown in FIG. 9 , the implementation of S740 may include S741 to S743.
S741:获取所述第一特征数据的第一权重值和所述第二特征数据的第二权重值。S741: Acquire a first weight value of the first feature data and a second weight value of the second feature data.
作为一种实施方式,该第一权重值和第二权重值可以根据经验以及用户的使用需求而设定。其中,第一权重值和第二权重值之和为1。例如,第一权重为α,第二权重值为1-α。As an implementation manner, the first weight value and the second weight value can be set according to experience and user requirements. The sum of the first weight value and the second weight value is 1. For example, the first weight is α, and the second weight value is 1-α.
S742:根据所述第一权重值、第一特征数据、第二权重值和第二特征数据得到第三特征数据。S742: Obtain third characteristic data according to the first weight value, the first characteristic data, the second weight value and the second characteristic data.
作为一种实施方式,根据第一权重值和第一特征数据确定第一参考数据,根据第二权重值和第二特征数据得到第二参考数据,根据第一参考数据和第二参考数据得到第三特征数据。具体地,根据第一权重值和第一特征数据确定第一参考数据的实施方式可以是,将第一权重值和第一特征数据相乘得到第一参考数据。同理,将第二权重值和第二特征数据相乘得到第二参考数据。然后,再将第一参考数据和第二参考数据相加得到第三特征数据。As an embodiment, the first reference data is determined according to the first weight value and the first feature data, the second reference data is obtained according to the second weight value and the second feature data, and the first reference data is obtained according to the first reference data and the second reference data. Three characteristic data. Specifically, an implementation manner of determining the first reference data according to the first weight value and the first feature data may be to multiply the first weight value and the first feature data to obtain the first reference data. Similarly, the second reference data is obtained by multiplying the second weight value and the second characteristic data. Then, the first reference data and the second reference data are added to obtain third characteristic data.
S743:将所述第三特征数据作为已注册用户的新的人脸图像的特征数据。S743: Use the third feature data as feature data of a new face image of the registered user.
作为一种实施方式,如果数据库内的已注册用户对应的人脸图像为多个,则可以获取所述已注册用户对应的所有人脸图像;对所述所有人脸图像的特征数据处理,以得到第二特征数据,即根据 该已注册用户的所有人脸图像得到第二特征数据。As an implementation manner, if there are multiple face images corresponding to the registered users in the database, all face images corresponding to the registered users can be obtained; Obtaining the second feature data means obtaining the second feature data according to all face images of the registered user.
作为一种实施方式,对所述所有人脸图像的特征数据处理的实施方式可以是,在获取待识别的人脸图像与数据库内的已注册用户的每个人脸图像的匹配结果,即匹配分数的时候,查找匹配分数最高的人脸图像的特征数据,将该特征数据作为第二特征数据,从而使得第二特征数据对应的人脸图像可以保持与待识别的人脸图像最相似的特性,避免第二阈值的设置不合理,例如过低,而导致将不同用户的人脸图像的特征数据作为该已注册用户的人脸图像。As an embodiment, an embodiment of processing the feature data of all the face images may be, when obtaining the matching result between the face image to be identified and each face image of the registered user in the database, that is, the matching score When , find the feature data of the face image with the highest matching score, and use the feature data as the second feature data, so that the face image corresponding to the second feature data can maintain the most similar characteristics to the face image to be recognized, It is avoided that the setting of the second threshold is unreasonable, such as being too low, so that the feature data of the face images of different users is used as the face images of the registered user.
作为另一种实施方式,对所述所有人脸图像的特征数据处理的实施方式可以是,在获取待识别的人脸图像与数据库内的已注册用户的每个人脸图像的匹配结果,即匹配分数的时候,查找匹配分数最低的人脸图像的特征数据,将该特征数据作为第二特征数据,从而使得第二特征数据对应的人脸图像可以保持与待识别的人脸图像差异性最大的特性,从而使得更新后的数据库内的已注册用户的人脸图像更能反映用户的真实人脸特征,也能够避免第一阈值设置的不合理,例如,过大,而导致匹配结果过高的人脸图像,其实质与数据库内的人脸图像的差异甚微,而使用匹配分数最低的人脸图像,能够提高该差异性,使得更新人脸图像能够更好的补充数据库内的人脸图像的不足,提高了数据内的人脸图像的全面性。As another implementation manner, the implementation manner of processing the characteristic data of all the face images may be, when obtaining the matching result between the face image to be recognized and each face image of the registered user in the database, that is, matching When the score is obtained, the feature data of the face image with the lowest matching score is searched, and the feature data is used as the second feature data, so that the face image corresponding to the second feature data can be kept the most different from the face image to be recognized. feature, so that the face image of the registered user in the updated database can better reflect the real face characteristics of the user, and it can also avoid the unreasonable setting of the first threshold, for example, if it is too large, which leads to an excessively high matching result. The face image has little difference with the face image in the database in essence, and using the face image with the lowest matching score can improve the difference, so that the updated face image can better complement the face image in the database It improves the comprehensiveness of face images in the data.
作为又一种实施方式,还可以是对所述所有人脸图像的特征数据执行平均处理,以得到第二特征数据,即将所有的人脸图像的特征数据求均值,得到第二特征数据,从而使得第二特征数据能够保留已注册用户的每个人脸图像的特性,使得第二特征数据对应的人脸图像可以保持原来已有注册图片的平均特性,相当于用户的平均脸。As yet another embodiment, it is also possible to perform an averaging process on the feature data of all the face images to obtain the second feature data, that is, to average the feature data of all the face images to obtain the second feature data, so as to obtain the second feature data. The second characteristic data can retain the characteristics of each face image of the registered user, so that the face image corresponding to the second characteristic data can maintain the average characteristics of the original registered pictures, which is equivalent to the average face of the user.
需要说明的是,前述步骤未详细描述的内容,可以参考前述实施例,在此不再赘述。It should be noted that, for the content not described in detail in the foregoing steps, reference may be made to the foregoing embodiments, and details are not described herein again.
因此,本申请实施例改进更新策略,始终保留确定是注册者本人的第一次注册的图像。然后对待识别图像和目标已注册对象的注册人脸图像集合提取特征,进行特征融合。并且,存储和更新的均为特征数据,能够降低计算量。Therefore, the embodiment of the present application improves the update strategy, and always retains the image that is determined to be the first registration of the registrant. Then features are extracted from the image to be recognized and the registered face image set of the target registered object, and feature fusion is performed. In addition, all feature data are stored and updated, which can reduce the amount of calculation.
另外,本申请实施例提供的图像更新方法,除了采用双阈值的方式提高识别性能以及降低对数据库的频繁写入造成的损耗之外,还可以进一步通过待识别的人脸图像的采集时间来降低对数据库的频繁写入。具体地,请参阅图10,图10示出了本申请实施例提供的一种图像更新方法,该更新方法的执行主体可以是上述的服务器,也可以是上述的用户终端,在此不做限定。具体地,该方法包括:S1001至S1005。In addition, the image update method provided by the embodiment of the present application, in addition to using double thresholds to improve the recognition performance and reduce the loss caused by frequent writing to the database, it can further reduce the time of collecting the face image to be recognized. Frequent writes to the database. Specifically, please refer to FIG. 10. FIG. 10 shows an image updating method provided by an embodiment of the present application. The execution body of the updating method may be the above-mentioned server or the above-mentioned user terminal, which is not limited here. . Specifically, the method includes: S1001 to S1005.
S1001:获取待识别的人脸图像。S1001: Acquire a face image to be recognized.
S1002:将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果。S1002: Match the face image to be recognized with the face image of the registered user in the database to obtain a matching result.
S1001和S1002的实施方式可以参考前述实施例,在此不再赘述。For the implementation of S1001 and S1002, reference may be made to the foregoing embodiments, and details are not described herein again.
S1003:若所述匹配结果小于第一阈值且大于第二阈值,则获取所述数据库中的已注册用户的最近一次更新人脸图像的第一时间。S1003: If the matching result is less than the first threshold and greater than the second threshold, obtain the first time of the last updated face image of the registered user in the database.
作为一种实施方式,数据库内不仅存储有已注册用户对应的人脸图像,还存储有每次录入或更新人脸图像的时间点,如图11所示,作为一种实施方式,数据库内的人脸图像的特征数据的数据标识也可以采用更新时间的先后顺序进行编号,例如,特征11、特征12、特征13对应的更新操作的时间顺序依次靠后,即数据标识的编号越大,对应的更新时间越靠后,从而,根据该数据标识能够快速查找到最新一次更新人脸图像的操作,进而获取该操作对应的更新时间,例如,用户1对应的最新一次更新人脸图像的时间为2020.03.25,即2020年3月25日。通过数据标识的方式查找最新依次的更新人脸的更新时间,相比直接确定各个更新时间的先后顺序,查找速率更快,效果更高。 当然,也可以直接确定各个更新时间的先后顺序,从而查找到最新一次更新人脸图像的时间。As an embodiment, the database not only stores the face images corresponding to the registered users, but also stores the time points of each entry or update of the face images. As shown in FIG. 11 , as an embodiment, the database The data identifiers of the feature data of the face image can also be numbered in the order of update time. For example, the time sequence of the update operations corresponding to feature 11, feature 12, and feature 13 is later in order, that is, the larger the number of the data identifier, the corresponding The later the update time of , so that the latest operation of updating the face image can be quickly found according to the data identification, and then the update time corresponding to the operation can be obtained. For example, the time of the latest update of the face image corresponding to user 1 is 2020.03.25, which is March 25, 2020. To find the update time of the latest and sequentially updated faces by means of data identification, compared with directly determining the sequence of each update time, the search rate is faster and the effect is higher. Of course, it is also possible to directly determine the sequence of each update time, so as to find the time of the latest update of the face image.
S1004:确定待识别的人脸图像的获取时间,作为第二时间。S1004: Determine the acquisition time of the face image to be recognized as the second time.
作为一种实施方式,可以将获取到待识别的人脸图像时的系统时间作为第二时间。As an implementation manner, the system time when the face image to be recognized is acquired may be used as the second time.
S1005:若所述第一时间和所述第二时间的时间间隔大于指定阈值,则将所述待识别的人脸图像作为新的人脸图像更新至所述数据库。S1005: If the time interval between the first time and the second time is greater than a specified threshold, update the face image to be recognized to the database as a new face image.
其中,指定阈值可以根据经验而设定,例如,可以是3-60天,例如,可以是15天。如果第一时间和所述第二时间的时间间隔大于指定阈值,则表明待识别的人脸图像与数据库内的已注册用户的最新一次更新的人脸图像相隔的时间长度比较大,则此种情况下,待识别的人脸图像与数据库内的已注册用户的人脸图像的差异性会比较大,例如,用户长时间不剪头发或不剃胡须。Wherein, the specified threshold can be set according to experience, for example, it can be 3-60 days, for example, it can be 15 days. If the time interval between the first time and the second time is greater than the specified threshold, it indicates that the length of time between the face image to be recognized and the face image updated in the latest update of the registered user in the database is relatively large. In this case, the difference between the face image to be recognized and the face image of the registered user in the database will be relatively large, for example, the user does not cut his hair or shave his beard for a long time.
作为一种实施方式,如图12所示,该特征22对应的人脸图像为新的人脸图像,即待识别的人脸图像,其对应的更新时间为2021.01.28,作为一种实施方式,该更新时间可以是上述的第二时间。作为另一种实施方式,服务器可能需要确定待写入的人脸图像的数据量是否大于指定数据量,如果大于,则将该待识别的人脸图像写入数据库,例如,服务器为了减少数据库的写入次数,可以等到多个用户的待写入的人脸图像的总量大于指定数据量的时候,再执行写入操作。则该更新时间可以是待识别的人脸图像被写入数据库的时间。As an embodiment, as shown in FIG. 12 , the face image corresponding to the feature 22 is a new face image, that is, the face image to be recognized, and the corresponding update time is 2021.01.28, as an embodiment , the update time may be the above-mentioned second time. As another implementation manner, the server may need to determine whether the data volume of the face image to be written is greater than the specified data volume, and if so, write the face image to be recognized into the database. For the number of writes, you can wait until the total amount of face images to be written by multiple users is greater than the specified amount of data, and then perform the write operation. Then the update time may be the time when the face image to be recognized is written into the database.
因此,本申请实施例,能够在待识别的人脸图像与数据库内的已注册用户的最新一次更新的人脸图像相隔的时间长度比较大的情况下,再对数据库内的已注册用户的人脸图像更新,避免频繁地对数据库内的人脸图像更新,而造成较高的硬件损耗。Therefore, in the embodiment of the present application, when the time interval between the face image to be recognized and the face image of the registered user in the database is relatively large, the registered user's person in the database can be compared. Face image update avoids frequent update of face images in the database, which causes high hardware loss.
需要说明的是,前述步骤未详细描述的内容,可以参考前述实施例,在此不再赘述。It should be noted that, for the content not described in detail in the foregoing steps, reference may be made to the foregoing embodiments, and details are not described herein again.
另外,本申请实施例提供的图像更新方法,第一阈值和第二阈值的确定可以是用户根据经验而设定,也可以是服务器预先设定的固定值,还可以是使用样本数据来确定的,另外,还可以在进行更新之前,先判断待识别的人脸图像的质量如何,在质量较高的情况下,才进行更新。具体地,请参阅图13,图13示出了本申请实施例提供的一种图像更新方法,该更新方法的执行主体可以是上述的服务器,也可以是上述的用户终端,在此不做限定。具体地,该方法包括:S1310至S1350。In addition, in the image updating method provided by the embodiment of the present application, the determination of the first threshold and the second threshold may be set by the user according to experience, or may be a fixed value preset by the server, or may be determined by using sample data , In addition, it is also possible to judge the quality of the face image to be recognized before performing the update, and only perform the update when the quality is relatively high. Specifically, please refer to FIG. 13. FIG. 13 shows an image updating method provided by an embodiment of the present application. The execution body of the updating method may be the above-mentioned server or the above-mentioned user terminal, which is not limited here. . Specifically, the method includes: S1310 to S1350.
S1310:获取待识别的人脸图像。S1310: Acquire a face image to be recognized.
S1320:基于多个样本图像确定第一阈值和第二阈值。S1320: Determine a first threshold and a second threshold based on the plurality of sample images.
作为一种实施方式,该样本图像可以是预先采集的人脸图像,通过该人脸图像与数据库内的已注册用户的人脸图像的匹配,能够验证第一阈值和第二阈值的设置是否合理,具体地,请参阅图14,该S1320包括S1321至S1324。As an embodiment, the sample image may be a pre-collected face image, and by matching the face image with the face image of the registered user in the database, it can be verified whether the settings of the first threshold and the second threshold are reasonable. 14, the S1320 includes S1321 to S1324.
S1321:获取多个样本图像。S1321: Acquire multiple sample images.
其中,多个样本图像中包括被标记为正例的第一图像和被标记为反例的第二图像,其中,正例表征样本图像与数据库的人脸图像匹配,反例表征样本图像与数据库的人脸图像不匹配。作为一种实施方式,该样本图像的采集场景与用户注册时录入数据库人脸图像时的注册场景相似,例如,可以是相同类型或者相同环境参数下,该环境参数可以包括光照、天气、时间段等,该类型可以包括环境类型,例如,场景的类型,例如,室内,或者商城、办公室、卧室、街道等。The plurality of sample images include a first image marked as a positive example and a second image marked as a negative example, wherein the positive example indicates that the sample image matches the face image in the database, and the negative example indicates that the sample image matches the person in the database. Face images do not match. As an embodiment, the collection scene of the sample image is similar to the registration scene when the user registers the face image in the database, for example, it may be of the same type or under the same environmental parameters, and the environmental parameters may include lighting, weather, time period etc., the type may include the type of environment, eg, the type of scene, eg, indoor, or mall, office, bedroom, street, etc.
S1322:获取每个所述样本图像与所述数据库中的已注册用户的人脸图像之间的匹配结果。S1322: Obtain a matching result between each of the sample images and the face images of the registered users in the database.
将被标记为正例的第一图像与数据库中的已注册用户的人脸图像匹配,得到多个匹配结果,并且,将被标记为反例的第二图像与数据库中的已注册用户的人脸图像匹配,得到多个匹配结果。Match the first image marked as a positive example with the face image of the registered user in the database to obtain multiple matching results, and match the second image marked as a negative example with the face of the registered user in the database Image matching to get multiple matching results.
作为一种实施方式,将所有的匹配结果中定义四种匹配结果,分别为第一结果、第二结果、第 三结果和第四结果。其中,第一结果表征第一图像中的匹配结果为正例,也就是说,在获取到被标记为正例的第一图像与数据库中的已注册用户的人脸图像匹配得到的多个匹配结果中,查找该匹配结果大于指定阈值的匹配结果,记为第一结果,将小于或等于指定阈值的匹配结果,记为第二结果,第二结果表征第一图像中的匹配结果为反例。其中,匹配结果大于指定阈值表征该图像与已注册用户的人脸图像对应同一个用户,即表征该第一图像对应的用户存在于数据库内。As an implementation manner, four matching results are defined in all the matching results, namely the first result, the second result, the third result and the fourth result. Wherein, the first result indicates that the matching result in the first image is a positive example, that is, after obtaining multiple matches obtained by matching the first image marked as a positive example with the face image of the registered user in the database Among the results, find the matching result whose matching result is greater than the specified threshold, and record it as the first result, and record the matching result less than or equal to the specified threshold as the second result, and the second result indicates that the matching result in the first image is a negative example. The matching result greater than the specified threshold indicates that the image and the face image of the registered user correspond to the same user, that is, it indicates that the user corresponding to the first image exists in the database.
假设第一结果为TP(True positive),用于表征该图像对应的用户被预测存在于数据库内,并且在样本图像内被标记为正例,即真实情况下,该图像对应的用户真实存在于数据库内,即预测结果与真实结果相同,也就是说,真实的正例被预测为正例。假设第二结果为FP(False positive),用于表征该图像对应的用户被预测不存在于数据库内,并且在样本图像内被标记为正例,即真实情况下,该图像对应的用户真实存在于数据库内,即预测结果与真实结果不相同,也就是说,真实的正例被预测为反例。Assuming that the first result is TP (True positive), it is used to indicate that the user corresponding to the image is predicted to exist in the database, and is marked as a positive example in the sample image, that is, in a real situation, the user corresponding to the image actually exists in the In-database, that is, the predicted results are the same as the real results, that is, the real positives are predicted as positives. Assuming that the second result is FP (False positive), it is used to represent that the user corresponding to the image is predicted not to exist in the database, and is marked as a positive example in the sample image, that is, in a real situation, the user corresponding to the image really exists In the database, the predicted results are not the same as the real results, that is, the real positive examples are predicted as negative examples.
在获取到被标记为反例的第二图像与数据库中的已注册用户的人脸图像匹配得到的多个匹配结果中,查找该匹配结果大于指定阈值的匹配结果,记为第三结果,将小于或等于指定阈值的匹配结果,记为第四结果,第四结果表征第二图像中的匹配结果为反例。In the obtained multiple matching results obtained by matching the second image marked as a negative example with the face image of the registered user in the database, find the matching result whose matching result is greater than the specified threshold, and record it as the third result, which is less than The matching result that is equal to or equal to the specified threshold is denoted as the fourth result, and the fourth result indicates that the matching result in the second image is a negative example.
假设第三结果为FN(False negative),用于表征该图像对应的用户被预测存在于数据库内,并且在样本图像内被标记为反例,即真实情况下,该图像对应的用户真实不存在于数据库内,即预测结果与真实结果不相同,也就是说,真实的反例被预测为正例。假设第四结果为TN(True negative),用于表征该图像对应的用户被预测不存在于数据库内,并且在样本图像内被标记为反例,即真实情况下,该图像对应的用户真实不存在于数据库内,即预测结果与真实结果相同,也就是说,真实的反例被预测为反例。Assuming that the third result is FN (False negative), it is used to represent that the user corresponding to the image is predicted to exist in the database, and is marked as a negative example in the sample image, that is, in the real situation, the user corresponding to the image does not actually exist in the database. In-database, that is, the predicted results are not the same as the real results, that is, the real negative examples are predicted as positive examples. Assuming that the fourth result is TN (True negative), it is used to indicate that the user corresponding to the image is predicted not to exist in the database, and is marked as a negative example in the sample image, that is, in the real situation, the user corresponding to the image does not really exist In the database, that is, the predicted results are the same as the real results, that is, the real counterexamples are predicted as counterexamples.
S1323:基于每个所述样本图像的匹配结果获取第一比率和第二比率。S1323: Obtain a first ratio and a second ratio based on the matching result of each of the sample images.
其中,第一比率用于表征第一图像中的匹配结果为正例的数量与所有样本图像中的匹配结果为正例的数量的比值,第二比率用于表征第二图像中的匹配结果为正例的数量与所有样本图像中的匹配结果为反例的数量的比值。The first ratio is used to represent the ratio of the number of positive matching results in the first image to the number of positive matching results in all sample images, and the second ratio is used to represent the matching results in the second image: The ratio of the number of positive examples to the number of negative examples in all sample images.
具体地,所有样本图像中的匹配结果为正例的结果可以包括第一结果和第三结果,则所有样本图像中的匹配结果为正例的数量为第一结果和第三结果的数量之和,则第一比率可以是,TPR=TP/(TP+FN),其中,TPR(True Positive Rate)表示第一比率。所有样本图像中的匹配结果为反例的结果可以包括第二结果和第四结果,则所有样本图像中的匹配结果为反例的数量为第二结果和第四结果的数量之和,则第二比率可以是,FPR=FP/(TN+FP),其中,FPR(False Positive Rate)表示第二比率。Specifically, the results in which the matching results in all sample images are positive examples may include the first result and the third result, and the number of matching results in all sample images that are positive examples is the sum of the numbers of the first and third results , then the first ratio may be, TPR=TP/(TP+FN), where TPR (True Positive Rate) represents the first ratio. The results in which the matching results in all sample images are negative examples can include the second result and the fourth result, then the number of matching results in all sample images that are negative examples is the sum of the numbers of the second and fourth results, then the second ratio It can be, FPR=FP/(TN+FP), wherein, FPR (False Positive Rate) represents the second ratio.
S1324:基于所述第一比率和所述第二比率设置所述第一阈值和所述第二阈值。S1324: Set the first threshold and the second threshold based on the first ratio and the second ratio.
作为一种实施方式,第一比率能够反应预测为正例且真实情况为正例的,占所有真实情况中正例的比率,第二比率能够反应预测为正例但真实情况为反例的,占所有真实情况中反例的比率。二者均受指定阈值的影响,根据实际任务要求对FPR和TPR的要求,可灵活选择第一阈值和第二阈值。例如,将在不同任务要求下得到的指定阈值分别作为第一阈值和第二阈值。As an embodiment, the first ratio can reflect the ratio of the predicted positive examples and the real situation to be positive examples, accounting for the ratio of all the positive examples in the real situation, and the second ratio can reflect the predicted positive examples but the real situation is a negative example, accounting for all the positive examples. The ratio of counterexamples in the real case. Both are affected by the specified threshold, and the first threshold and the second threshold can be flexibly selected according to the actual task requirements for FPR and TPR. For example, the specified thresholds obtained under different task requirements are used as the first threshold and the second threshold, respectively.
具体地,获取所述第一比率的第一指标和第二指标以及第二比率的第三指标,基于所述第一比率的第一指标和第二比率的第三指标,确定第一阈值;基于所述第一比率的第二指标和第二比率的第三指标,确定第二阈值。Specifically, acquiring the first index and the second index of the first ratio and the third index of the second ratio, and determining the first threshold based on the first index of the first ratio and the third index of the second ratio; A second threshold is determined based on the second index of the first ratio and the third index of the second ratio.
作为一种实施方式,第二比率可以反应由于阈值的设定而导致的误差率,因此在满足一定误差 率要求的情况下,确定第一比率的第一指标和第二指标,再根据该第一比率的不同指标调整第一阈值和第二阈值。As an embodiment, the second ratio can reflect the error rate caused by the setting of the threshold. Therefore, under the condition that a certain error rate requirement is met, the first index and the second index of the first ratio are determined, and then according to the first index and the second index of the first ratio are determined. Different metrics of a ratio adjust the first threshold and the second threshold.
具体地,基于所述第一比率的第一指标和第二比率的第三指标,确定第一阈值。作为一种实施方式,将上述的指定阈值作为第一阈值,在第二比率满足第三指标的情况下,设置第一阈值,以使第一比率满足第一指标。例如,第三指令为第二比率不大于10 -4,具体地,该第三指标为第二比率为10 -4,第一比率的第一指标为TPR>99%,也就是说,在FPR为10 -4的情况下,设置第一阈值使得TPR>99%。 Specifically, the first threshold is determined based on the first index of the first ratio and the third index of the second ratio. As an embodiment, the above specified threshold is used as the first threshold, and when the second ratio satisfies the third index, the first threshold is set so that the first ratio satisfies the first index. For example, the third instruction is that the second ratio is not greater than 10 -4 , specifically, the third indicator is that the second ratio is 10 -4 , and the first indicator of the first ratio is TPR>99%, that is, at FPR In the case of 10 −4 , the first threshold is set so that TPR>99%.
同理,可以基于所述第一比率的第二指标和第二比率的第三指标,确定第二阈值。作为一种实施方式,将上述的指定阈值作为第二阈值,在第二比率满足第三指标的情况下,设置第二阈值,以使第一比率满足第二指标。例如,第三指令为第二比率不大于10 -4,具体地,该第三指标为第二比率为10 -4,第一比率的第二指标为TPR>95%,也就是说,在FPR为10 -4的情况下,设置第二阈值使得TPR>95%。 Similarly, the second threshold may be determined based on the second index of the first ratio and the third index of the second ratio. As an embodiment, the above specified threshold is used as the second threshold, and when the second ratio satisfies the third index, the second threshold is set so that the first ratio satisfies the second index. For example, the third instruction is that the second ratio is not greater than 10 -4 , specifically, the third indicator is that the second ratio is 10 -4 , and the second indicator of the first ratio is TPR>95%, that is, at FPR In the case of 10 −4 , the second threshold is set so that TPR>95%.
S1330:对所述待识别的人脸图像进行图像质量的评价,以得到图像质量评价结果。S1330: Perform image quality evaluation on the face image to be recognized to obtain an image quality evaluation result.
S1340:若所述图像质量评价结果满足预设条件,将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果。S1340: If the image quality evaluation result satisfies the preset condition, match the face image to be recognized with the face image of the registered user in the database to obtain a matching result.
作为一种实施方式,根据待识别的人脸图像的遮挡、模糊、光照、表情、欧拉角等一个或者多个因素进行综合等级划分,如质量低,质量一般,质量高等,例如,可以确定一个评分值,将评分值作为上述的评价结果,该评分值可以是一个连续的数值分布,例如,1-100,然后,设置多个区间,每个区间对应一个质量等级,从而能够确定待识别的人脸图像的质量等级。则所述图像质量评价结果满足预设条件的实施方式可以是,该待识别的人脸图像的质量等级高于指定等级。As an embodiment, comprehensive grade classification is performed according to one or more factors such as occlusion, blur, illumination, expression, Euler angle, etc. of the face image to be recognized, such as low quality, average quality, and high quality. For example, it can be determined that A rating value, and the rating value is used as the above evaluation result. The rating value can be a continuous numerical distribution, for example, 1-100. Then, multiple intervals are set, and each interval corresponds to a quality level, so that the identification to be identified can be determined. The quality level of the face image. Then, an implementation manner in which the image quality evaluation result satisfies the preset condition may be that the quality level of the face image to be recognized is higher than a specified level.
作为一种实施方式,S1320至S1340的执行数据可以不限于图13所示的顺序,也可以是在S1310之后,对所述待识别的人脸图像进行图像质量的评价,以得到图像质量评价结果,若所述图像质量评价结果满足预设条件,基于多个样本图像确定第一阈值和第二阈值,然后,将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果,只要在执行将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配之前,基于多个样本图像确定第一阈值和第二阈值即可。As an implementation manner, the execution data of S1320 to S1340 may not be limited to the sequence shown in FIG. 13 , and may also be after S1310 , performing image quality evaluation on the to-be-recognized face image to obtain an image quality evaluation result , if the image quality evaluation result satisfies the preset conditions, determine the first threshold and the second threshold based on a plurality of sample images, and then match the face image to be recognized with the face image of the registered user in the database , to obtain a matching result, as long as the first threshold and the second threshold are determined based on a plurality of sample images before performing the matching between the face image to be recognized and the registered user's face image in the database.
S1350:若所述匹配结果小于第一阈值且大于第二阈值,则将所述待识别的人脸图像作为新的人脸图像更新至所述数据库。S1350: If the matching result is less than the first threshold and greater than the second threshold, update the face image to be recognized to the database as a new face image.
需要说明的是,前述步骤未详细描述的内容,可以参考前述实施例,在此不再赘述。It should be noted that, for the content not described in detail in the foregoing steps, reference may be made to the foregoing embodiments, and details are not described herein again.
请参阅图15,其示出了本申请实施例提供的一种图像更新装置1500的结构框图,该装置可以包括:获取单元1501、匹配单元1502和更新单元1503。Please refer to FIG. 15 , which shows a structural block diagram of an image updating apparatus 1500 provided by an embodiment of the present application. The apparatus may include: an acquiring unit 1501 , a matching unit 1502 , and an updating unit 1503 .
获取单元1501,用于获取待识别的人脸图像。The obtaining unit 1501 is configured to obtain a face image to be recognized.
匹配单元1502,用于将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果。The matching unit 1502 is configured to match the face image to be recognized with the face image of the registered user in the database to obtain a matching result.
进一步的,匹配单元1502还用于对所述待识别的人脸图像进行图像质量的评价,以得到图像质量评价结果;若所述图像质量评价结果满足预设条件,将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果。Further, the matching unit 1502 is further configured to evaluate the image quality of the face image to be identified, so as to obtain an image quality evaluation result; if the image quality evaluation result satisfies a preset condition, the face image to be identified The face image is matched with the face image of the registered user in the database, and the matching result is obtained.
更新单元1503,用于若所述匹配结果小于第一阈值且大于第二阈值,则将所述待识别的人脸图像作为新的人脸图像更新至所述数据库,其中,所述匹配结果大于第二阈值的情况下,所述待识别的人脸图像与已注册用户的人脸图像对应相同的用户,所述匹配结果小于第一阈值的情况下,所述 待识别的人脸图像与已注册用户的人脸图像之间存在差异。The updating unit 1503 is configured to update the face image to be recognized as a new face image to the database if the matching result is less than the first threshold and greater than the second threshold, wherein the matching result is greater than In the case of the second threshold, the face image to be recognized corresponds to the same user as the face image of the registered user, and in the case that the matching result is less than the first threshold, the face image to be recognized is the same as that of the registered user. There are differences between the face images of registered users.
进一步的,更新单元1503还用于获取所述待识别的人脸图像的第一特征数据以及已注册用户的人脸图像的第二特征数据;根据所述第一特征数据和所述第二特征数据获取已注册用户的新的人脸图像的特征数据,并将新的特征数据更新至所述数据库。Further, the updating unit 1503 is also used to obtain the first feature data of the face image to be recognized and the second feature data of the registered user's face image; according to the first feature data and the second feature The data acquires the feature data of the new face image of the registered user, and updates the new feature data to the database.
进一步的,更新单元1503还用于获取所述第一特征数据的第一权重值和所述第二特征数据的第二权重值;根据所述第一权重值、第一特征数据、第二权重值和第二特征数据得到第三特征数据;将所述第三特征数据作为已注册用户的新的人脸图像的特征数据。Further, the updating unit 1503 is further configured to obtain the first weight value of the first characteristic data and the second weight value of the second characteristic data; according to the first weight value, the first characteristic data, the second weight value and the second feature data to obtain the third feature data; the third feature data is used as the feature data of the new face image of the registered user.
进一步的,更新单元1503还用于获取所述已注册用户对应的所有人脸图像;对所述所有人脸图像的特征数据处理,以得到第二特征数据。Further, the updating unit 1503 is further configured to acquire all face images corresponding to the registered user; and process the feature data of all the face images to obtain second feature data.
进一步的,更新单元1503还用于对所述所有人脸图像的特征数据执行平均处理,以得到第二特征数据。Further, the updating unit 1503 is further configured to perform averaging processing on the feature data of all the face images to obtain second feature data.
进一步的,更新单元1503还用于获取所述数据库中的已注册用户的最近一次更新人脸图像的第一时间;确定待识别的人脸图像的获取时间,作为第二时间;若所述第一时间和所述第二时间的时间间隔大于指定阈值,则将所述待识别的人脸图像作为新的人脸图像更新至所述数据库。Further, the updating unit 1503 is also used to obtain the first time of the last updated face image of the registered user in the database; determine the obtaining time of the face image to be recognized as the second time; The time interval between a first time and the second time is greater than a specified threshold, and the face image to be recognized is updated to the database as a new face image.
进一步的,图像更新装置1500还包括设置单元,用于获取多个样本图像,所述多个样本图像中包括被标记为正例的第一图像和被标记为反例的第二图像,其中,正例表征样本图像与数据库的人脸图像匹配,反例表征样本图像与数据库的人脸图像不匹配;获取每个所述样本图像与所述数据库中的已注册用户的人脸图像之间的匹配结果;基于每个所述样本图像的匹配结果获取第一比率和第二比率,其中,第一比率用于表征第一图像中的匹配结果为正例的数量与所有样本图像中的匹配结果为正例的数量的比值,第二比率用于表征第二图像中的匹配结果为正例的数量与所有样本图像中的匹配结果为反例的数量的比值;基于所述第一比率和所述第二比率设置所述第一阈值和所述第二阈值。Further, the image updating apparatus 1500 further includes a setting unit for acquiring a plurality of sample images, wherein the plurality of sample images include a first image marked as a positive example and a second image marked as a negative example, wherein the positive The example indicates that the sample image matches the face image of the database, and the negative example indicates that the sample image does not match the face image of the database; obtain the matching result between each of the sample images and the face image of the registered user in the database Obtain the first ratio and the second ratio based on the matching result of each described sample image, wherein, the first ratio is used to characterize that the matching result in the first image is the number of positive examples and the matching result in all sample images is positive The ratio of the number of examples, the second ratio is used to characterize the ratio of the number of positive examples in the second image to the number of negative examples in all sample images; based on the first ratio and the second A ratio sets the first threshold and the second threshold.
进一步的,设置单元还用于获取所述第一比率的第一指标和第二指标以及第二比率的第三指标;基于所述第一比率的第一指标和第二比率的第三指标,确定第一阈值;基于所述第一比率的第二指标和第二比率的第三指标,确定第二阈值。Further, the setting unit is further configured to obtain the first index and the second index of the first ratio and the third index of the second ratio; based on the first index of the first ratio and the third index of the second ratio, determining a first threshold; determining a second threshold based on the second index of the first ratio and the third index of the second ratio.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, for the specific working process of the above-described devices and modules, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。In several embodiments provided in this application, the coupling between the modules may be electrical, mechanical or other forms of coupling.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically alone, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules.
请参考图16,其示出了本申请实施例提供的一种电子设备的结构框图。该电子设备100可以是上述的用户终端或服务器。本申请中的电子设备100可以包括一个或多个如下部件:处理器110、存储器120、以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器120中并被配置为由一个或多个处理器110执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。Please refer to FIG. 16 , which shows a structural block diagram of an electronic device provided by an embodiment of the present application. The electronic device 100 may be the above-mentioned user terminal or server. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more application programs, wherein the one or more application programs may be stored in the memory 120 and configured to be executed by One or more processors 110 execute, and one or more programs are configured to execute the methods described in the foregoing method embodiments.
处理器110可以包括一个或者多个处理核。处理器110利用各种接口和线路连接整个电子设备100内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行电子设备100的各种功能和处理数据。可选地,处理器110可 以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes by running or executing the instructions, programs, code sets or instruction sets stored in the memory 120, and calling the data stored in the memory 120. Various functions of the electronic device 100 and processing data. Optionally, the processor 110 may adopt at least one of a digital signal processing (Digital Signal Processing, DSP), a Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and a Programmable Logic Array (Programmable Logic Array, PLA). A hardware form is implemented. The processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), a modem, and the like. Among them, the CPU mainly handles the operating system, user interface and application programs, etc.; the GPU is used for rendering and drawing of the display content; the modem is used to handle wireless communication. It can be understood that, the above-mentioned modem may also not be integrated into the processor 110, and is implemented by a communication chip alone.
存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储终端100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The memory 120 may include random access memory (Random Access Memory, RAM), or may include read-only memory (Read-Only Memory). Memory 120 may be used to store instructions, programs, codes, sets of codes, or sets of instructions. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like. The storage data area may also store data created by the terminal 100 during use (such as phone book, audio and video data, chat record data) and the like.
请参考图17,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质1700中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。Please refer to FIG. 17 , which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. The computer-readable medium 1700 stores program codes, and the program codes can be invoked by the processor to execute the methods described in the above method embodiments.
计算机可读存储介质1700可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质1700包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质1700具有执行上述方法中的任何方法步骤的程序代码1710的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码1710可以例如以适当形式进行压缩。The computer-readable storage medium 1700 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 1700 includes a non-transitory computer-readable storage medium. Computer readable storage medium 1700 has storage space for program code 1710 to perform any of the method steps in the above-described methods. These program codes can be read from or written to one or more computer program products. Program code 1710 may be compressed, for example, in a suitable form.
请参考图18,其示出了本申请实施例提供的一种计算机程序产品1800,包括计算机程序/指令1810,该计算机程序/指令被处理器执行时实现上述方法。Please refer to FIG. 18, which shows a computer program product 1800 provided by an embodiment of the present application, including a computer program/instruction 1810, which implements the above method when the computer program/instruction is executed by a processor.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or some technical features thereof are equivalently replaced; and these modifications or replacements do not drive the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (23)

  1. 一种图像更新方法,其特征在于,包括:An image updating method, comprising:
    获取待识别的人脸图像;Obtain the face image to be recognized;
    将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果;Matching the face image to be identified with the face image of the registered user in the database to obtain a matching result;
    若所述匹配结果小于第一阈值且大于第二阈值,则将所述待识别的人脸图像作为新的人脸图像更新至所述数据库,其中,所述匹配结果大于第二阈值的情况下,所述待识别的人脸图像与已注册用户的人脸图像对应相同的用户,所述匹配结果小于第一阈值的情况下,所述待识别的人脸图像与已注册用户的人脸图像之间存在差异。If the matching result is less than the first threshold and greater than the second threshold, the face image to be recognized is updated to the database as a new face image, where the matching result is greater than the second threshold , the to-be-recognized face image and the registered user's face image correspond to the same user, and when the matching result is less than the first threshold, the to-be-recognized face image and the registered user's face image There are differences.
  2. 根据权利要求1所述的方法,其特征在于,所述将所述待识别的人脸图像作为新的人脸图像更新至所述数据库,包括:The method according to claim 1, wherein the updating the face image to be recognized to the database as a new face image comprises:
    获取所述待识别的人脸图像的第一特征数据以及已注册用户的人脸图像的第二特征数据;Obtain the first feature data of the face image to be recognized and the second feature data of the registered user's face image;
    根据所述第一特征数据和所述第二特征数据获取已注册用户的新的人脸图像的特征数据,并将新的特征数据更新至所述数据库。The feature data of the new face image of the registered user is acquired according to the first feature data and the second feature data, and the new feature data is updated to the database.
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述第一特征数据和所述第二特征数据获取已注册用户的新的人脸图像的特征数据,包括:The method according to claim 2, wherein the acquiring the feature data of the new face image of the registered user according to the first feature data and the second feature data comprises:
    获取所述第一特征数据的第一权重值和所述第二特征数据的第二权重值;obtaining the first weight value of the first characteristic data and the second weight value of the second characteristic data;
    根据所述第一权重值、第一特征数据、第二权重值和第二特征数据得到第三特征数据;Obtain third characteristic data according to the first weight value, the first characteristic data, the second weight value and the second characteristic data;
    将所述第三特征数据作为已注册用户的新的人脸图像的特征数据。The third feature data is used as feature data of a new face image of the registered user.
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述第一权重值、第一特征数据、第二权重值和第二特征数据得到第三特征数据,包括:The method according to claim 3, wherein obtaining the third characteristic data according to the first weight value, the first characteristic data, the second weight value and the second characteristic data comprises:
    根据所述第一权重值和所述第一特征数据确定第一参考数据;Determine first reference data according to the first weight value and the first feature data;
    根据所述第二权重值和所述第二特征数据得到第二参考数据;Obtain second reference data according to the second weight value and the second characteristic data;
    根据所述第一参考数据和所述第二参考数据得到所述第三特征数据。The third characteristic data is obtained according to the first reference data and the second reference data.
  5. 根据权利要求2所述的方法,其特征在于,所述获取已注册用户的人脸图像的第二特征数据,包括:The method according to claim 2, wherein the acquiring the second feature data of the face image of the registered user comprises:
    获取所述已注册用户对应的所有人脸图像;Obtain all face images corresponding to the registered user;
    对所述所有人脸图像的特征数据处理,以得到第二特征数据。The feature data of all the face images are processed to obtain second feature data.
  6. 根据权利要求5所述的方法,其特征在于,所述对所述所有人脸图像的特征数据处理,以得到第二特征数据,包括:The method according to claim 5, wherein the processing of the feature data of the all face images to obtain the second feature data comprises:
    对所述所有人脸图像的特征数据执行平均处理,以得到第二特征数据。Averaging processing is performed on the feature data of all the face images to obtain second feature data.
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述将所述待识别的人脸图像作为新的人脸图像更新至所述数据库,包括:The method according to any one of claims 1-6, wherein the updating the face image to be recognized to the database as a new face image comprises:
    获取所述数据库中的已注册用户的最近一次更新人脸图像的第一时间;Obtain the first time of the last updated face image of the registered user in the database;
    确定待识别的人脸图像的获取时间,作为第二时间;Determine the acquisition time of the face image to be recognized as the second time;
    若所述第一时间和所述第二时间的时间间隔大于指定阈值,则将所述待识别的人脸图像作为新的人脸图像更新至所述数据库。If the time interval between the first time and the second time is greater than a specified threshold, the face image to be recognized is updated to the database as a new face image.
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述若所述匹配结果小于第一阈值且大于第二阈值,则将所述待识别的人脸图像作为新的人脸图像更新至所述数据库之前,还包括:The method according to any one of claims 1-7, wherein, if the matching result is less than a first threshold and greater than a second threshold, the to-be-recognized face image is used as a new face Before the image is updated to the database, it also includes:
    获取多个样本图像,所述多个样本图像中包括被标记为正例的第一图像和被标记为反例的第二 图像,正例表征样本图像与数据库的人脸图像匹配,反例表征样本图像与数据库的人脸图像不匹配;Acquiring a plurality of sample images, the plurality of sample images include a first image marked as a positive example and a second image marked as a negative example, the positive example represents that the sample image matches the face image in the database, and the negative example represents the sample image Does not match the face image in the database;
    获取每个所述样本图像与所述数据库中的已注册用户的人脸图像之间的匹配结果;Obtain a matching result between each of the sample images and the face images of the registered users in the database;
    基于每个所述样本图像的匹配结果获取第一比率和第二比率,其中,第一比率用于表征第一图像中的匹配结果为正例的数量与所有样本图像中的匹配结果为正例的数量的比值,第二比率用于表征第二图像中的匹配结果为正例的数量与所有样本图像中的匹配结果为反例的数量的比值;A first ratio and a second ratio are obtained based on the matching results of each of the sample images, wherein the first ratio is used to characterize the number of positive matching results in the first image and the positive matching results in all sample images The second ratio is used to represent the ratio of the number of positive examples in the second image and the number of negative examples in all sample images;
    基于所述第一比率和所述第二比率设置所述第一阈值和所述第二阈值。The first threshold and the second threshold are set based on the first ratio and the second ratio.
  9. 根据权利要求8所述的方法,其特征在于,所述基于所述第一比率和所述第二比率设置所述第一阈值和所述第二阈值,包括:The method of claim 8, wherein the setting the first threshold and the second threshold based on the first ratio and the second ratio comprises:
    获取所述第一比率的第一指标和第二指标以及第二比率的第三指标;obtaining the first index and the second index of the first ratio and the third index of the second ratio;
    基于所述第一比率的第一指标和第二比率的第三指标,确定第一阈值;determining a first threshold based on the first index of the first ratio and the third index of the second ratio;
    基于所述第一比率的第二指标和第二比率的第三指标,确定第二阈值。A second threshold is determined based on the second index of the first ratio and the third index of the second ratio.
  10. 根据权利要求8所述的方法,其特征在于,所述基于每个所述样本图像的匹配结果获取第一比率和第二比率,包括:The method according to claim 8, wherein the obtaining the first ratio and the second ratio based on the matching result of each of the sample images comprises:
    在所有第一图像的匹配结果中,将大于指定阈值的匹配结果记为第一结果TP,将小于或等于指定阈值的匹配结果记为第二结果FP,所述第二结果表征第一图像中的匹配结果为反例;Among all the matching results of the first image, the matching results greater than the specified threshold are recorded as the first result TP, and the matching results less than or equal to the specified threshold are recorded as the second result FP, and the second results represent the The matching result is a negative example;
    在所有第二图像的匹配结果中,将大于指定阈值的匹配结果记为第三结果FN,将小于或等于指定阈值的匹配结果记为第四结果TN,所述第四结果表征第二图像中的匹配结果为反例;Among all the matching results of the second image, the matching results greater than the specified threshold are recorded as the third result FN, and the matching results less than or equal to the specified threshold are recorded as the fourth result TN, and the fourth result represents the The matching result is a negative example;
    所述第一比率为TPR=TP/(TP+FN),所述第二比率为FPR=FP/(TN+FP)。The first ratio is TPR=TP/(TP+FN), and the second ratio is FPR=FP/(TN+FP).
  11. 根据权利要求1-10任一项所述的方法,其特征在于,所述将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果,包括:The method according to any one of claims 1-10, wherein the matching of the face image to be identified with the face image of the registered user in the database to obtain a matching result, comprising:
    对所述待识别的人脸图像进行图像质量的评价,以得到图像质量评价结果;Perform image quality evaluation on the face image to be recognized to obtain an image quality evaluation result;
    若所述图像质量评价结果满足预设条件,将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果。If the image quality evaluation result satisfies the preset condition, the face image to be recognized is matched with the face image of the registered user in the database to obtain a matching result.
  12. 根据权利要求1-11任一项所述的方法,其特征在于,所述将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果,包括:The method according to any one of claims 1-11, wherein the matching of the face image to be identified with the face image of a registered user in a database to obtain a matching result, comprising:
    若所述已注册用户对应的人脸图像为多个,将所述待识别的人脸图像与该已注册用户的每个人脸图像匹配,得到每个人脸图像对应的相似度;If there are multiple face images corresponding to the registered user, match the face image to be recognized with each face image of the registered user to obtain the similarity corresponding to each face image;
    根据所述每个人脸图像的相似度确定所述待识别的人脸图像与该已注册用户的人脸图像之间的匹配结果。The matching result between the face image to be recognized and the face image of the registered user is determined according to the similarity of each face image.
  13. 根据权利要求1-12任一项所述的方法,其特征在于,所述数据库包括多个已注册用户,所述将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果,若所述匹配结果小于第一阈值且大于第二阈值,则将所述待识别的人脸图像作为新的人脸图像更新至所述数据库,包括:The method according to any one of claims 1-12, wherein the database includes a plurality of registered users, and the face image to be recognized is compared with the face images of the registered users in the database. Matching to obtain a matching result, if the matching result is less than the first threshold and greater than the second threshold, then the face image to be recognized is updated to the database as a new face image, including:
    获取所述待识别的人脸图像与每个已注册用户的人脸图像对应的匹配结果,由所有匹配结果中查找小于第一阈值且大于第二阈值的匹配结果,作为目标匹配结果,将所述目标匹配结果对应的已注册用户作为目标用户;Obtain the matching result corresponding to the face image to be recognized and the face image of each registered user, and find the matching result that is smaller than the first threshold and greater than the second threshold from all the matching results. The registered user corresponding to the target matching result is regarded as the target user;
    将所述待识别的人脸图像写入所述数据库,在所述数据库中将所述待识别的人脸图像与所述目标用户对应存储。The face image to be recognized is written into the database, and the face image to be recognized is stored in the database corresponding to the target user.
  14. 根据权利要求13所述的方法,其特征在于,所述将所述待识别的人脸图像写入所述数据库, 在所述数据库中将所述待识别的人脸图像与所述目标用户对应存储,包括:The method according to claim 13, characterized in that, writing the face image to be recognized into the database, wherein the face image to be recognized corresponds to the target user in the database storage, including:
    保留所述数据库中所述目标用户对应存储的历史人脸图像,将所述待识别的人脸图像存储为所述目标用户的新的人脸图像。The historical face image stored correspondingly to the target user in the database is retained, and the face image to be recognized is stored as a new face image of the target user.
  15. 根据权利要求13所述的方法,其特征在于,所述将所述待识别的人脸图像写入所述数据库,在所述数据库中将所述待识别的人脸图像与所述目标用户对应存储,包括:The method according to claim 13, wherein the face image to be recognized is written into the database, and the face image to be recognized corresponds to the target user in the database storage, including:
    将所述数据库内所述目标用户对应的所有人脸图像中的至少一个人脸图像替换为所述待识别的人脸图像。At least one face image in all face images corresponding to the target user in the database is replaced with the face image to be recognized.
  16. 根据权利要求15所述的方法,其特征在于,所述将所述数据库内所述目标用户对应的所有人脸图像中的至少一个人脸图像替换为所述待识别的人脸图像,包括:The method according to claim 15, wherein the replacing at least one face image in all face images corresponding to the target user in the database with the face image to be recognized comprises:
    当所述目标用户对应多个人脸图像时,从多个人脸图像中确定目标人脸图像,将目标人脸图像更新为所述待识别的人脸图像。When the target user corresponds to multiple face images, the target face image is determined from the multiple face images, and the target face image is updated to the face image to be recognized.
  17. 根据权利要求16所述的方法,其特征在于,所述从多个人脸图像中确定目标人脸图像包括:The method according to claim 16, wherein the determining the target face image from the plurality of face images comprises:
    将所述多个人脸图像中的匹配结果最低的人脸图像作为所述目标人脸图像。The face image with the lowest matching result among the plurality of face images is used as the target face image.
  18. 根据权利要求16所述的方法,其特征在于,所述从多个人脸图像中确定目标人脸图像包括:The method according to claim 16, wherein the determining the target face image from the plurality of face images comprises:
    将所述多个人脸图像中的匹配结果最高的人脸图像作为所述目标人脸图像。The face image with the highest matching result among the plurality of face images is used as the target face image.
  19. 根据权利要求1-18任一项所述的方法,其特征在于,所述若所述匹配结果小于第一阈值且大于第二阈值,则将所述待识别的人脸图像作为新的人脸图像更新至所述数据库,包括:The method according to any one of claims 1-18, wherein, if the matching result is less than a first threshold and greater than a second threshold, the to-be-recognized face image is used as a new face Images are updated to the database, including:
    若所述匹配结果小于第一阈值且大于第二阈值,将提示信息发送至用户终端,以使所述用户终端在指定界面内显示所述提示信息;If the matching result is less than the first threshold and greater than the second threshold, sending prompt information to the user terminal, so that the user terminal displays the prompt information in the designated interface;
    当检测到用户基于所述提示信息输入的确认指令时,基于所述确认指令将所述待识别的人脸图像作为新的人脸图像更新至所述数据库。When a confirmation instruction input by the user based on the prompt information is detected, the face image to be recognized is updated to the database as a new face image based on the confirmation instruction.
  20. 一种图像更新装置,其特征在于,包括:An image updating device, comprising:
    获取单元,用于获取待识别的人脸图像;an acquisition unit for acquiring a face image to be recognized;
    匹配单元,用于将所述待识别的人脸图像与数据库中的已注册用户的人脸图像匹配,得到匹配结果;a matching unit for matching the face image to be identified with the face image of the registered user in the database to obtain a matching result;
    更新单元,用于若所述匹配结果小于第一阈值且大于第二阈值,则将所述待识别的人脸图像作为新的人脸图像更新至所述数据库,其中,所述匹配结果大于第二阈值的情况下,所述待识别的人脸图像与已注册用户的人脸图像对应相同的用户,所述匹配结果小于第一阈值的情况下,所述待识别的人脸图像与已注册用户的人脸图像之间存在差异。An update unit, configured to update the face image to be recognized as a new face image to the database if the matching result is less than a first threshold and greater than a second threshold, wherein the matching result is greater than the first In the case of two thresholds, the face image to be recognized corresponds to the same user as the face image of the registered user, and when the matching result is less than the first threshold, the face image to be recognized corresponds to the registered user. There are differences between the user's face images.
  21. 一种电子设备,其特征在于,包括:An electronic device, comprising:
    一个或多个处理器;one or more processors;
    存储器;memory;
    一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行如权利要求1-19任一项所述的方法。One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs are configured to perform such as The method of any one of claims 1-19.
  22. 一种计算机可读介质,其特征在于,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行所述权利要求1-19任一项所述方法。A computer-readable medium, characterized in that the computer-readable storage medium stores program codes, and the program codes can be invoked by a processor to execute the method of any one of claims 1-19.
  23. 一种计算机程序产品,其特征在于,包括计算机程序/指令,其特征在于,该计算机程序/指令被处理器执行时实现权利要求1-19任一项所述的方法。A computer program product, characterized in that it includes a computer program/instruction, characterized in that, when the computer program/instruction is executed by a processor, the method according to any one of claims 1-19 is implemented.
PCT/CN2022/071647 2021-02-22 2022-01-12 Image updating method and apparatus, and electronic device and computer-readable medium WO2022174699A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110199718.8A CN112818909A (en) 2021-02-22 2021-02-22 Image updating method and device, electronic equipment and computer readable medium
CN202110199718.8 2021-02-22

Publications (1)

Publication Number Publication Date
WO2022174699A1 true WO2022174699A1 (en) 2022-08-25

Family

ID=75864834

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/071647 WO2022174699A1 (en) 2021-02-22 2022-01-12 Image updating method and apparatus, and electronic device and computer-readable medium

Country Status (2)

Country Link
CN (1) CN112818909A (en)
WO (1) WO2022174699A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112818909A (en) * 2021-02-22 2021-05-18 Oppo广东移动通信有限公司 Image updating method and device, electronic equipment and computer readable medium
CN113486749A (en) * 2021-06-28 2021-10-08 中星电子股份有限公司 Image data collection method, device, electronic equipment and computer readable medium
CN113538721A (en) * 2021-06-28 2021-10-22 福建数博讯信息科技有限公司 Optimization method for attendance data interaction
WO2023284307A1 (en) * 2021-07-16 2023-01-19 上海商汤智能科技有限公司 Image processing method and apparatus, and electronic device, storage medium and computer program product
CN113722522A (en) * 2021-09-02 2021-11-30 四川楠水农牧科技有限公司 Cattle uniqueness identification method, terminal and readable storage medium
CN113792668A (en) * 2021-09-16 2021-12-14 深圳市商汤科技有限公司 Face recognition and access control method and device, computer equipment and storage medium
CN115798023B (en) * 2023-02-13 2023-04-18 成都睿瞳科技有限责任公司 Face identification authentication method and device, storage medium and processor

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107609508A (en) * 2017-09-08 2018-01-19 深圳市金立通信设备有限公司 A kind of face identification method, terminal and computer-readable recording medium
CN108446387A (en) * 2018-03-22 2018-08-24 百度在线网络技术(北京)有限公司 Method and apparatus for updating face registration library
US20190057270A1 (en) * 2017-08-16 2019-02-21 Samsung Electronics Co., Ltd. Method of evaluating performance of bio-sensor, authentication method using bio-image, and electronic apparatus adopting the authentication method
CN112818909A (en) * 2021-02-22 2021-05-18 Oppo广东移动通信有限公司 Image updating method and device, electronic equipment and computer readable medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111104825A (en) * 2018-10-26 2020-05-05 北京陌陌信息技术有限公司 Face registry updating method, device, equipment and medium
TWI682329B (en) * 2018-12-14 2020-01-11 技嘉科技股份有限公司 Method, device and computer readable medium of facial recognition
CN110532991A (en) * 2019-09-04 2019-12-03 深圳市捷顺科技实业股份有限公司 A kind of face identification method, device and equipment
CN111414803A (en) * 2020-02-24 2020-07-14 北京三快在线科技有限公司 Face recognition method and device and electronic equipment
CN111339990B (en) * 2020-03-13 2023-03-24 乐鑫信息科技(上海)股份有限公司 Face recognition system and method based on dynamic update of face features
CN111310743B (en) * 2020-05-11 2020-08-25 腾讯科技(深圳)有限公司 Face recognition method and device, electronic equipment and readable storage medium
CN111695502A (en) * 2020-06-11 2020-09-22 腾讯科技(深圳)有限公司 Feature updating method and device for face recognition and computer equipment
CN112364801A (en) * 2020-11-19 2021-02-12 天津中科虹星科技有限公司 Dynamic threshold face recognition method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190057270A1 (en) * 2017-08-16 2019-02-21 Samsung Electronics Co., Ltd. Method of evaluating performance of bio-sensor, authentication method using bio-image, and electronic apparatus adopting the authentication method
CN107609508A (en) * 2017-09-08 2018-01-19 深圳市金立通信设备有限公司 A kind of face identification method, terminal and computer-readable recording medium
CN108446387A (en) * 2018-03-22 2018-08-24 百度在线网络技术(北京)有限公司 Method and apparatus for updating face registration library
CN112818909A (en) * 2021-02-22 2021-05-18 Oppo广东移动通信有限公司 Image updating method and device, electronic equipment and computer readable medium

Also Published As

Publication number Publication date
CN112818909A (en) 2021-05-18

Similar Documents

Publication Publication Date Title
WO2022174699A1 (en) Image updating method and apparatus, and electronic device and computer-readable medium
CN109117803B (en) Face image clustering method and device, server and storage medium
TWI687879B (en) Server, client, user verification method and system
US20210012777A1 (en) Context acquiring method and device based on voice interaction
CN106778450B (en) Face recognition method and device
CN111758116B (en) Face image recognition system, recognizer generation device, recognition device, and face image recognition system
WO2016172872A1 (en) Method and device for verifying real human face, and computer program product
CN111626371B (en) Image classification method, device, equipment and readable storage medium
CN107911643B (en) Method and device for showing scene special effect in video communication
JP7454105B2 (en) Facial image quality evaluation method and device, computer equipment and computer program
WO2022105118A1 (en) Image-based health status identification method and apparatus, device and storage medium
TWI679584B (en) Human recognition method based on data fusion
WO2022166532A1 (en) Facial recognition method and apparatus, and electronic device and storage medium
WO2021088640A1 (en) Facial recognition technology based on heuristic gaussian cloud transformation
WO2020050413A1 (en) Device for deciding face image candidate for authentication, method for deciding face image candidate for authentication, program, and recording medium
CN108596110A (en) Image-recognizing method and device, electronic equipment, storage medium
CN112199530B (en) Multi-dimensional face library picture automatic updating method, system, equipment and medium
CN111862413A (en) Method and system for realizing epidemic situation resistant non-contact multidimensional identity rapid identification
CN111814923A (en) Image clustering method, system, device and medium
CN111428666A (en) Intelligent family accompanying robot system and method based on rapid face detection
CN103258190A (en) Face recognition method used for mobile terminal
CN108174141B (en) Video communication method and mobile device
WO2022033068A1 (en) Image management method and apparatus, and terminal device and system
CN113947209A (en) Integrated learning method, system and storage medium based on cloud edge cooperation
Fegade et al. Residential security system based on facial recognition

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22755472

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22755472

Country of ref document: EP

Kind code of ref document: A1