Method, device, computer equipment and storage medium for updating face pictures
By judging the face unlocking time interval and performing similarity comparison, the face picture update process is simplified, solving the problems of large calculation amount and cumbersome steps for face recognition standard face picture update in the existing technology, and improving the accuracy of face unlocking. sex and user experience.
Patent Information
- Application Number
- CN201910655450.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-19
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2039-07-19
AI Technical Summary
The standard face picture update process for face recognition in the prior art is computationally intensive and has cumbersome steps, which may cause the user to fail in face recognition when facial features change.
By judging the interval between the current face unlocking time and the previous face unlocking time, if the interval is not greater than the preset time length, the similarity will be directly compared with the first standard face image; if the interval is greater than the preset time length, the similarity will be compared with the first standard face image. Perform similarity calculation with the second standard face picture, and update the second standard face picture to improve recognition accuracy.
It simplifies the face image update process, reduces computing resource consumption, improves the accuracy and user experience of face unlocking, and avoids the need for users to regularly or irregularly enter images at different times.
Smart Images

Figure CN110516543B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image matching, and in particular to a method, device, computer equipment and storage medium for updating a face image. Background Art
[0002] Face recognition is a biometric technology that authenticates users based on their facial features. Face recognition is widely used in scenarios such as login verification and network event authorization (such as payment authorization).
[0003] The process of face recognition is mainly as follows: a standard face picture of a user is stored in a data processing device with face recognition function. The standard face picture is generally a face picture provided by the user when registering. Thus, when face recognition of the user is required, the data processing device can obtain the current face picture of the user and compare the current face picture of the user with the standard face picture. When the comparison result shows that the similarity of the pictures is not less than the similarity threshold, it is determined that the face recognition has passed (i.e., the face recognition is successful). Otherwise, it is determined that the face recognition has failed.
[0004] At present, the face picture provided by the user when registering is used as the standard face picture. This will cause the similarity between the obtained user face picture and the user's standard face picture to become lower and lower when the user's facial features change over time, and even when the user performs face recognition, face recognition fails; therefore, it is particularly necessary to update the user's standard face picture to provide a basis for improving the accuracy of face recognition results. Therefore, a method is proposed in the prior art to determine the change trend of the user's facial target features based on multiple user face pictures of the same user that have passed face recognition, and then update the face picture (standard face picture). However, this method has the following problems: 1. It is necessary to obtain at least two user face pictures, and then calculate the change trend of the user's facial features, which consumes a certain amount of computer computing resources; 2. It is necessary to determine whether the change trends of pictures collected at adjacent times are the same, or whether the changes of pictures collected at non-adjacent times are different, etc., and the execution steps are relatively cumbersome; it is necessary to obtain the face pictures of mobile phone users regularly or irregularly to calculate the change trend, which is relatively troublesome.
[0005] Therefore, it is necessary to provide a new method for updating face images. Summary of the invention
[0006] The main purpose of this application is to provide a method, device, computer equipment and storage medium for updating face images, aiming to solve the technical problems in the prior art such as large amount of calculation and complicated steps for automatically updating face images.
[0007] In order to achieve the above-mentioned invention object, the present application proposes a method for updating a face image, comprising the steps of:
[0008] Collecting the first face image used for the current face unlocking application and the first time the current face unlocking application was used;
[0009] Determine whether a first time of the current face unlocking of the application and a second time interval of the previous face unlocking of the application are greater than a preset time length;
[0010] If the time interval between the first time and the second time is not greater than the preset time length, then calculating a first similarity between the first face picture and a preset first standard face picture, and if the first similarity is greater than a preset first threshold, unlocking is successful, wherein the first standard face picture is the standard face picture currently defaulted by the application;
[0011] If the time interval between the first time and the second time is greater than the preset time length, calculating a first similarity between the first face picture and a preset first standard face picture, and a second similarity between the first face picture and a preset second standard face picture, wherein the second standard face picture is a face picture collected when the application was unlocked last time;
[0012] If the second similarity is greater than the first similarity, the first standard face picture is replaced by the second standard face picture, and the first face picture is used as a new second standard face picture.
[0013] Furthermore, after the step of replacing the first standard face picture with the second standard face picture, the method further includes:
[0014] Determining whether the first standard face image is the original face image uploaded by the user when registering the application;
[0015] If yes, storing the first standard face image in a preset space;
[0016] If not, the first standard face image is deleted.
[0017] Furthermore, after the step of calculating a first similarity between the first face image and a preset first standard face image, and a second similarity between the first face image and a preset second standard face image if the time interval between the first time and the second time is greater than the preset time length, the method further includes:
[0018] If the first similarity is greater than the second similarity and less than the first threshold, calculating the similarity between the first face image and the original face image to obtain a third similarity;
[0019] If the third similarity is greater than the first threshold, the unlocking is successful, otherwise the unlocking fails.
[0020] Furthermore, if the time interval between the first time and the second time is not greater than the preset time length, then calculating the first similarity between the first face image and a preset first standard face image, and if the first similarity is greater than a preset first threshold, after the step of successfully unlocking, the method further includes:
[0021] Determine the number of times the face unlocking of the application was performed within the preset time length before the current face unlocking of the application;
[0022] If the number of times is greater than the number threshold, calculating the change trend of the first similarity for each of the times;
[0023] If the change trend reaches a preset value, the current first face photo replaces the second standard face photo.
[0024] Furthermore, the step of collecting the first face picture used for the current face unlocking application further includes:
[0025] Continuously collecting multiple face images for unlocking the application;
[0026] A face picture of the user with the highest frontality is selected from multiple face pictures as the first face picture.
[0027] Furthermore, before the step of collecting the first face picture used for the current face unlocking application and the first time of the current face unlocking application, the method further includes:
[0028] When the application is triggered, determining whether the application is an application in a preset whitelist;
[0029] If so, a command is generated to execute "collecting the first face picture used for the current face unlocking application, and the first time the current face unlocks the application".
[0030] Furthermore, when the application is triggered, after the step of determining whether the application is an application in a preset whitelist, the method further includes:
[0031] If the application is not an application in a preset whitelist, obtaining a specified attribute of the application according to a preset rule;
[0032] Determine whether the acquired specified attribute is consistent with the preset whitelist attribute;
[0033] If they are consistent, the application is added to the whitelist, and a command is generated to execute "collecting the first face picture used for the current face unlocking application, and the first time of the current face unlocking of the application";
[0034] If they are inconsistent, the application is marked as a non-whitelisted application, and a preset unlocking action for the non-whitelisted application is performed.
[0035] The present application also provides a device for updating a face image, comprising:
[0036] A collection unit, used to collect a first face picture used for a current face unlocking application, and a first time when the current face unlocking application is used;
[0037] A first judgment unit, used to judge whether a first time of the current face unlocking of the application and a second time interval of the previous face unlocking of the application are greater than a preset time length;
[0038] an unlocking unit, configured to calculate a first similarity between the first face image and a preset first standard face image if the time interval between the first time and the second time is not greater than the preset time length, and if the first similarity is greater than a preset first threshold, unlocking is successful, wherein the first standard face image is a standard face image currently defaulted by the application;
[0039] a first calculation unit, configured to calculate a first similarity between the first face image and a preset first standard face image, and a second similarity between the first face image and a preset second standard face image, if the time interval between the first time and the second time is greater than the preset time length, wherein the second standard face image is a face image captured when the application was unlocked last time;
[0040] An updating unit is configured to replace the first standard face picture with the second standard face picture if the second similarity is greater than the first similarity, and to use the first face picture as a new second standard face picture.
[0041] The present application also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.
[0042] The present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of any of the above-described methods when executed by a processor.
[0043] The face picture updating method, device, computer equipment and storage medium of the present application do not need to calculate the face picture change trend, but are associated with time. When the first time of the current face unlocking the application and the second time interval of the previous face unlocking the application are not greater than the preset time length, the similarity is directly compared with the first standard face picture, and the standard face picture does not need to be updated; when the first time of the current face unlocking the application and the second time interval of the previous face unlocking the application are greater than the preset time length, the similarity is calculated with the first standard face picture and the second standard face picture respectively to obtain the first similarity and the second similarity. If the second similarity is greater than the first similarity, it means that the user's face has changed, and the second standard face picture with a higher similarity to the current first face picture is used as the default standard picture, and updating the standard picture is simpler and faster. The present application only needs to compare time and similarity calculation, and consumes less resources. Each picture is obtained when the face is unlocked, and there is no need for the user to regularly or irregularly enter pictures at different times, and the user experience is better. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic diagram of a flow chart of a method for updating a face image according to an embodiment of the present application;
[0045] Figure 2 This is a schematic block diagram of the structure of a device for updating a face image according to an embodiment of the present application;
[0046] Figure 3 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.
[0047] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0049] Reference Figure 1 The present application embodiment provides a method for updating a face image, comprising the steps of:
[0050] S1, collecting a first face picture used for a current face unlocking application, and a first time when the current face unlocking application is used;
[0051] S2, determining whether a first time of the current face unlocking of the application and a second time interval of the previous face unlocking of the application are greater than a preset time length;
[0052] S3. If the time interval between the first time and the second time is not greater than the preset time length, calculating a first similarity between the first face picture and a preset first standard face picture, and if the first similarity is greater than a preset first threshold, unlocking is successful, wherein the first standard face picture is the standard face picture currently defaulted by the application;
[0053] S4. If the time interval between the first time and the second time is greater than the preset time length, calculating a first similarity between the first face picture and a preset first standard face picture, and a second similarity between the first face picture and a preset second standard face picture, wherein the second standard face picture is a face picture collected when the application was unlocked last time;
[0054] S5. If the second similarity is greater than the first similarity, replace the first standard face picture with the second standard face picture, and use the first face picture as a new second standard face picture.
[0055] As described in step S1 above, the above application refers to an application installed in a computer or other intelligent electronic device that can be logged in through a face image, such as a mobile phone unlocking application. The above first face image refers to a picture collected on-site by an image sensor of an intelligent electronic device. For example, when a mobile phone needs to collect a face image through a camera to unlock, the face image collected by the camera in real time is the first face image. The above first time refers to a moment, such as XX year XX month XX day XX hour XX minute XX second, etc., which is generally obtained through the clock device of the above intelligent electronic device.
[0056] As described in step S2 above, the second time of the previous face unlocking of the application refers to the time of the previous face unlocking of the application based on the current face unlocking of the application, which also refers to a certain moment. Because a person's facial image will not change significantly in a short period of time, such as a slow process of getting fatter or thinner, the preset time length can be set to three days, five days, a week, half a month, etc., which can be determined based on usage experience. In a specific embodiment, the preset time length is half a month. In another specific embodiment, the preset time length can be customized by the user to cope with different usage scenarios. For example, if the user's face is injured and the rate of change of the face is large during the recovery process, the preset time length can be shortened, such as three days.
[0057] As described in step S3 above, the method for calculating the similarity of two face images can use any one of the existing technologies, which will not be described in detail here. The first standard face image is the standard face image currently set by the application, which refers to the face image initially set by the application, or the face image replaced by the second standard face image in the subsequent step S5. In this embodiment, if the time interval between the first time and the second time is not greater than the preset time length, the first standard face image is directly used to calculate the similarity with the first face image to determine whether the above application is unlocked successfully.
[0058] As described in the above steps S4 and S5, because the time interval between the above first time and the second time is greater than the above preset time length, it means that the user has not used face unlocking for a long time. At this time, the time when the user sets the first standard face picture is longer than the current time, so the face is more similar to the second standard face picture (a person getting fatter or thinner is a gradual process. The longer the interval, the greater the difference will be under normal circumstances). Therefore, at this time, the second standard face picture will be more suitable as the default standard face picture of the application. For example, within a period of time after the current face unlock, the user frequently uses face unlock, so the default standard face picture of the application will be used (the second standard face picture that replaces the first standard face picture). The fatness and thinness of the face will not change significantly, and the unlocking accuracy will be higher. The first face picture collected this time will replace the previous second standard face picture to repeat the above steps S1-S5.
[0059] In this embodiment, when the above-mentioned second standard face picture does not exist, the first face picture is directly used to compare with the first standard face picture to complete the face unlocking login process, and the first face picture is stored and used as the above-mentioned second standard face picture.
[0060] In one embodiment, after the step of replacing the first standard face picture with the second standard face picture, the method further includes:
[0061] Determining whether the first standard face image is the original face image uploaded by the user when registering the application;
[0062] If yes, storing the first standard face image in a preset space;
[0063] If not, the first standard face image is deleted.
[0064] In this embodiment, the original face picture refers to the standard face picture uploaded by the user when registering the application, and the application will mark the original face picture. Under normal circumstances, after replacing the first standard face picture with the second standard face picture, if the first standard face picture is not the original face picture, the first standard face picture can be directly deleted. If the first standard face picture is the original face picture, it cannot be directly deleted, but stored in a designated storage space for use at a specific time. For example, when changing the password of a bank account, the original face picture must be provided before the password can be changed.
[0065] Furthermore, after the step of calculating a first similarity between the first face image and a preset first standard face image, and a second similarity between the first face image and a preset second standard face image if the time interval between the first time and the second time is greater than the preset time length, the method further includes:
[0066] If the first similarity is greater than the second similarity and less than the first threshold, calculating the similarity between the first face image and the original face image to obtain a third similarity;
[0067] If the third similarity is greater than the first threshold, the unlocking is successful, otherwise the unlocking fails.
[0068] In this embodiment, because the above steps S1-S5 are a cyclic process, after a certain length of time has passed, the last retained first standard face picture is already very different from the original face picture used by the user to register the application. When the user's life changes, such as gradually gaining weight for a long time, or suddenly losing weight, and the user happens not to use face unlocking for the above application during the period of weight loss, then using the current first standard face picture as the standard face picture for unlocking may fail. At this time, the original face picture can be used as the standard picture for unlocking. If the unlocking is successful, the original face picture can be used to replace the current first standard face picture. At this time, the second standard face picture needs to be deleted, and the first standard face picture needs to be regenerated in the next cycle of steps S1-S5.
[0069] In one embodiment, after the step of calculating a first similarity between the first face image and a preset first standard face image if the time interval between the first time and the second time is not greater than the preset time length, and if the first similarity is greater than a preset first threshold, then the unlocking is successful, the method further includes:
[0070] Determine the number of times the face unlocking of the application was performed within the preset time length before the current face unlocking of the application;
[0071] If the number of times is greater than the number threshold, calculating the change trend of the first similarity for each of the times;
[0072] If the change trend reaches a preset value, the current first face photo replaces the second standard face photo.
[0073] In this embodiment, the above-mentioned change trends include two types, one is a trend of getting fatter, and the other is a trend of getting thinner, and the two change trends are opposite. The calculation of the change trend can be calculated by linear algebra and other methods, which will not be repeated here. Because there are two change trends, two preset values of the above-mentioned change trends are also set. Because the change trend is large, it means that the user's face has changed a lot. At this time, the first face photo collected this time is used as the second standard face photo. When the second standard face photo replaces the first standard face photo, the recognition accuracy is higher.
[0074] In one embodiment, the step of acquiring the first face image for the current face unlocking application further includes:
[0075] Continuously collecting multiple face images for unlocking the application;
[0076] A face picture of the user with the highest frontality is selected from multiple face pictures as the first face picture.
[0077] In this embodiment, the frontality refers to the maximum value of the frontality of the face in the photo. For example, when collecting face pictures, pictures of the face at different angles such as the side and the front are collected, among which the frontality of the front is the highest. Because the first face picture may be used as a standard face picture, the face picture with the highest frontality is selected as the first face picture.
[0078] In one embodiment, before the steps of collecting the first face image used for the current face unlocking application and the first time the current face unlocks the application, the method further includes:
[0079] When the application is triggered, determining whether the application is an application in a preset whitelist;
[0080] If so, a command is generated to execute "collecting the first face picture used for the current face unlocking application, and the first time the current face unlocks the application".
[0081] In this embodiment, the whitelist refers to a list of applications that can use the methods in the above embodiments to update face images. That is, each time the above application is used, the application will be triggered first, and it will be checked whether the above application is in the whitelist. If so, the steps of the above embodiment will be executed. In a specific embodiment, the application in the whitelist will have a corresponding whitelist mark. When judging whether the application is an application in the preset whitelist, it is only necessary to judge whether the application has a corresponding whitelist mark, without searching in the table list, and the judgment speed is faster.
[0082] Furthermore, after the step of determining whether the application is an application in a preset whitelist when the application is triggered, the method further includes:
[0083] If the application is not an application in a preset whitelist, obtaining a specified attribute of the application according to a preset rule;
[0084] Determine whether the acquired specified attribute is consistent with the preset whitelist attribute;
[0085] If they are consistent, the application is added to the whitelist, and a command is generated to execute "collecting the first face picture used for the current face unlocking application, and the first time of the current face unlocking of the application";
[0086] If they are inconsistent, the application is marked as a non-whitelisted application, and a preset unlocking action for the non-whitelisted application is performed.
[0087] In this embodiment, the attributes of the above-mentioned application include multiple types, such as the application industry category (finance, games, etc.) of the application, the use category (instant messaging, process management, etc.) of the application, and the above-mentioned specific attributes refer to the pre-set attributes used to determine whether the application can automatically update the standard face picture. For example, the specified attributes are the attributes of the industry category and the use category, and the attributes of the whitelist are games and instant messaging. If the industry category of the specified attributes of the obtained application is finance and the use category is instant messaging, then it can be determined that the application cannot be added to the whitelist; if the industry category of the specified attributes of the obtained application is games and the use category is instant messaging, then it can be determined that the application can be added to the whitelist. When it is confirmed that the application can be added to the whitelist, the first face picture currently collected can be used as the second standard face picture, and the face picture at the time of registration can be used as the original face picture. In the process of using the application later, the face picture can be updated by the methods in the above-mentioned embodiments. If it is confirmed that the application cannot be added to the whitelist, the above-mentioned face picture update method is not executed, but it can be executed according to the conventional face unlocking process.
[0088] The method for updating the face picture of the embodiment of the present application does not need to calculate the trend of face picture changes, but is associated with time. When the first time of the current face unlocking the application and the second time interval of the previous face unlocking the application are not greater than the preset time length, the similarity is directly compared with the first standard face picture, and there is no need to update the standard face picture; when the first time of the current face unlocking the application and the second time interval of the previous face unlocking the application are greater than the preset time length, the similarity is calculated with the first standard face picture and the second standard face picture respectively to obtain the first similarity and the second similarity. If the second similarity is greater than the first similarity, it means that the user's face has changed, and the second standard face picture with a higher similarity to the current first face picture is used as the default standard picture, and updating the standard picture is simpler and faster. The present application only needs to compare time and similarity calculation, and consumes less resources. Each picture is obtained when the face is unlocked, and there is no need for the user to regularly or irregularly enter pictures at different times, and the user experience is better.
[0089] Reference Figure 2 The embodiment of the present application also provides a device for updating a face image, comprising:
[0090] A collection unit 10 is used to collect a first face picture used for a current face unlocking application and a first time when the current face unlocking application is used;
[0091] The first judgment unit 20 is used to judge whether the first time of the current face unlocking of the application and the second time interval of the previous face unlocking of the application are greater than a preset time length;
[0092] The unlocking unit 30 is configured to calculate a first similarity between the first face image and a preset first standard face image if the time interval between the first time and the second time is not greater than the preset time length, and if the first similarity is greater than a preset first threshold, the unlocking is successful, wherein the first standard face image is the standard face image currently defaulted by the application;
[0093] A first calculation unit 40 is configured to calculate a first similarity between the first face image and a preset first standard face image, and a second similarity between the first face image and a preset second standard face image if the time interval between the first time and the second time is greater than the preset time length, wherein the second standard face image is a face image captured when the application was unlocked last time;
[0094] The updating unit 50 is configured to replace the first standard face picture with the second standard face picture if the second similarity is greater than the first similarity, and use the first face picture as a new second standard face picture.
[0095] As in the acquisition unit 10, the application refers to an application installed in a computer or other intelligent electronic device that can be logged in through a face image, such as a mobile phone unlocking application. The first face image refers to a picture collected on-site by an intelligent electronic device through an image sensor. For example, when a mobile phone needs to collect a face image through a camera to unlock, the face image collected in real time by the camera is the first face image. The first time refers to a moment, such as XX year XX month XX day XX hour XX minute XX second, etc., which is generally obtained through the clock device of the intelligent electronic device.
[0096] As in the first judgment unit 20, the second time of the previous face unlocking of the application refers to the time of the previous face unlocking of the application based on the current face unlocking of the application, which also refers to a certain moment. Because a person's facial image will not change significantly in a short period of time, such as a face getting fatter or thinner is a slow process, the preset time length can be set to three days, five days, a week, half a month, etc., which can be determined according to usage experience. In a specific embodiment, the preset time length is half a month. In another specific embodiment, the preset time length can be customized by the user to cope with different usage scenarios. For example, if the user's face is injured and the rate of change of the face is large during the recovery process, the preset time length can be shortened, such as three days.
[0097] As in the unlocking unit 30, any method of calculating the similarity of two face images can be used in the prior art, which will not be described in detail here. The first standard face image is the default standard face image of the application, which refers to the face image initially set by the application, or the face image replaced by the second standard face image as updated by the updating unit 50. In this embodiment, if the time interval between the first time and the second time is not greater than the preset time length, the first standard face image is directly used to calculate the similarity with the first face image to determine whether the application is unlocked successfully.
[0098] As in the calculation unit 40 and the update unit 50, because the time interval between the first time and the second time is greater than the preset time length, it means that the user has not used the face unlocking application for a long time. At this time, the time when the user sets the first standard face picture is longer than the current time, so the face is more similar to the second standard face picture (a person getting fatter or thinner is a gradual process. The longer the interval, the greater the difference will be under normal circumstances). Therefore, at this time, the second standard face picture will be more suitable as the default standard face picture of the application. For example, within a period of time after the current face unlocking, the user frequently uses face unlocking, so the default standard face picture of the application will be used (the second standard face picture that replaces the first standard face picture). The fatness and thinness of the face will not change significantly, and the unlocking accuracy will be higher. The first face picture collected this time will replace the previous second standard face picture to repeat the above steps S1-S5.
[0099] In this embodiment, when the above-mentioned second standard face picture does not exist, the first face picture is directly used to compare with the first standard face picture to complete the face unlocking login process, and the first face picture is stored and used as the above-mentioned second standard face picture.
[0100] In one embodiment, the above-mentioned face image updating device further includes:
[0101] A second judging unit is used to judge whether the first standard face picture is the original face picture uploaded by the user when registering the application;
[0102] a storage unit, configured to store the first standard face picture in a preset space if the first standard face picture is an original face picture uploaded by the user when registering the application;
[0103] A deleting unit is used to delete the first standard face picture if the first standard face picture is not the original face picture uploaded by the user when registering the application.
[0104] In this embodiment, the original face picture refers to the standard face picture uploaded by the user when registering the application, and the application will mark the original face picture. Under normal circumstances, after replacing the first standard face picture with the second standard face picture, if the first standard face picture is not the original face picture, the first standard face picture can be directly deleted. If the first standard face picture is the original face picture, it cannot be directly deleted, but stored in a designated storage space for use at a specific time. For example, when changing the password of a bank account, the original face picture must be provided before the password can be changed.
[0105] Furthermore, the above-mentioned face image updating device further includes:
[0106] a second calculation unit, configured to calculate the similarity between the first face image and the original face image to obtain a third similarity if the first similarity is greater than the second similarity and less than the first threshold;
[0107] The processing unit is configured to: if the third similarity is greater than the first threshold, unlocking is successful; otherwise, unlocking fails.
[0108] In this embodiment, because the acquisition unit 10, the first judgment unit 20, the unlocking unit 30, the first calculation unit 40, and the updating unit 50 are running, it is a cyclical updating process of the face picture. After a certain length of time has passed, the last retained first standard face picture is already very different from the original face picture with which the user registered the application. When the user's life changes, such as gradually gaining weight for a long time, or suddenly losing weight, and the user happens not to use the face to unlock the application during the period of losing weight, the user may fail to unlock the application by using the current first standard face picture as the standard face picture. At this time, the original face picture can be used as the standard picture for unlocking. If the unlocking is successful, the original face picture can be used to replace the current first standard face picture. At this time, the second standard face picture needs to be deleted, and the first standard face picture is regenerated in the next cyclic process of updating the face picture.
[0109] In one embodiment, the above-mentioned face image updating device further includes:
[0110] A third determination unit, used to determine the number of times the face unlocking of the application is performed within the preset time length before the current face unlocking of the application;
[0111] a trend calculation unit, configured to calculate a change trend of the first similarity for each of the times if the times are greater than a times threshold;
[0112] A replacement unit is used to replace the second standard face picture with the current first face picture if the change trend reaches a preset value.
[0113] In this embodiment, the above-mentioned change trends include two types, one is a trend of getting fatter, and the other is a trend of getting thinner, and the two change trends are opposite. The calculation of the change trend can be calculated by linear algebra and other methods, which will not be repeated here. Because there are two change trends, two preset values of the above-mentioned change trends are also set. Because the change trend is large, it means that the user's face has changed a lot. At this time, the first face photo collected this time is used as the second standard face photo. When the second standard face photo replaces the first standard face photo, the recognition accuracy is higher.
[0114] In one embodiment, the acquisition unit 10 further includes:
[0115] A continuous acquisition module, used to continuously acquire multiple face images for unlocking the application;
[0116] The selection module is used to select the user's face picture with the highest frontality from multiple face pictures as the first face picture.
[0117] In this embodiment, the frontality refers to the maximum value of the frontality of the face in the photo. For example, when collecting face pictures, pictures of the face at different angles such as the side and the front are collected, among which the frontality of the front is the highest. Because the first face picture may be used as a standard face picture, the face picture with the highest frontality is selected as the first face picture.
[0118] In one embodiment, the above-mentioned face image updating device further includes:
[0119] a triggering judgment unit, configured to judge whether the application is an application in a preset whitelist when the application is triggered;
[0120] A generating unit is used to generate and execute a command for "collecting the first face picture used for the current face unlocking application and the first time the current face unlocking of the application" if the application is an application in the preset whitelist.
[0121] In this embodiment, the whitelist refers to a list of applications that can use the methods in the above embodiments to update face images. That is, each time the above application is used, the application will be triggered first, and it will be checked whether the above application is in the whitelist. If so, the steps of the above embodiment will be executed. In a specific embodiment, the application in the whitelist will have a corresponding whitelist mark. When judging whether the application is an application in the preset whitelist, it is only necessary to judge whether the application has a corresponding whitelist mark, without searching in the table list, and the judgment speed is faster.
[0122] Furthermore, the above-mentioned face image updating device also includes:
[0123] An attribute acquisition unit, configured to acquire a specified attribute of the application according to a preset rule if the application is not an application in a preset whitelist;
[0124] An attribute determination unit, used to determine whether the acquired specified attribute is consistent with a preset whitelist attribute;
[0125] A first execution unit, configured to add the application to the whitelist if the specified attribute is consistent with a preset whitelist attribute, and generate a command for executing "collecting a first face image for the current face unlocking application and a first time of the current face unlocking of the application";
[0126] The second execution unit is configured to mark the application as a non-whitelist application if the specified attribute is inconsistent with a preset whitelist attribute, and execute a preset unlocking action for the non-whitelist application.
[0127] In this embodiment, the attributes of the above-mentioned application include multiple types, such as the application industry category (finance, games, etc.) of the application, the use category (instant messaging, process management, etc.) of the application, and the above-mentioned specific attributes refer to the pre-set attributes used to determine whether the application can automatically update the standard face picture. For example, the specified attributes are the attributes of the industry category and the use category, and the attributes of the whitelist are games and instant messaging. If the industry category of the specified attributes of the obtained application is finance and the use category is instant messaging, then it can be determined that the application cannot be added to the whitelist; if the industry category of the specified attributes of the obtained application is games and the use category is instant messaging, then it can be determined that the application can be added to the whitelist. When it is confirmed that the application can be added to the whitelist, the first face picture currently collected can be used as the second standard face picture, and the face picture at the time of registration can be used as the original face picture. In the process of using the application later, the face picture can be updated by the methods in the above-mentioned embodiments. If it is confirmed that the application cannot be added to the whitelist, the above-mentioned face picture update method is not executed, but it can be executed according to the conventional face unlocking process.
[0128] The face picture updating device of the embodiment of the present application does not need to calculate the face picture change trend, but is associated with time. When the first time of the current face unlocking the application and the second time interval of the previous face unlocking the application are not greater than the preset time length, the similarity is directly compared with the first standard face picture, and there is no need to update the standard face picture; when the first time of the current face unlocking the application and the second time interval of the previous face unlocking the application are greater than the preset time length, the similarity is calculated with the first standard face picture and the second standard face picture respectively to obtain the first similarity and the second similarity. If the second similarity is greater than the first similarity, it means that the user's face has changed, and the second standard face picture with a higher similarity to the current first face picture is used as the default standard picture, and updating the standard picture is simpler and faster. The present application only needs to compare time and similarity calculation, and consumes less resources. Each picture is obtained when the face is unlocked, and there is no need for the user to regularly or irregularly enter pictures at different times, and the user experience is better.
[0129] Reference Figure 3 In an embodiment of the present invention, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as facial images. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for updating facial images is implemented.
[0130] The processor executes the facial image updating method, including: collecting a first facial image for a current facial unlocking application, and a first time for the current facial unlocking of the application; determining whether a second time interval between the first time for the current facial unlocking of the application and the previous facial unlocking of the application is greater than a preset time length; if the time interval between the first time and the second time is not greater than the preset time length, calculating a first similarity between the first facial image and a preset first standard facial image, and if the first similarity is greater than a preset first threshold, the unlocking is successful, wherein the first standard facial image is a standard facial image currently defaulted by the application; if the time interval between the first time and the second time is greater than the preset time length, calculating a first similarity between the first facial image and the preset first standard facial image, and a second similarity between the first facial image and the preset second standard facial image, wherein the second standard facial image is a facial image collected when the application was unlocked the previous time; if the second similarity is greater than the first similarity, replacing the first standard facial image with the second standard facial image, and using the first facial image as a new second standard facial image.
[0131] In one embodiment, after the above-mentioned step of replacing the first standard face picture with the second standard face picture, it also includes: determining whether the first standard face picture is the original face picture uploaded by the user when registering the application; if so, storing the first standard face picture in a preset space; if not, deleting the first standard face picture.
[0132] In one embodiment, after the step of calculating the first similarity between the first face picture and the preset first standard face picture, and the second similarity between the first face picture and the preset second standard face picture if the time interval between the first time and the second time is greater than the preset time length, the method further includes: if the first similarity is greater than the second similarity and less than the first threshold, calculating the similarity between the first face picture and the original face picture to obtain a third similarity; if the third similarity is greater than the first threshold, unlocking is successful, otherwise unlocking fails.
[0133] In one embodiment, if the time interval between the first time and the second time is not greater than the preset time length, the first similarity between the first face picture and the preset first standard face picture is calculated. If the first similarity is greater than the preset first threshold, after the unlocking step is successful, the method also includes: determining the number of times the face unlocked the application within the preset time length before the current face unlocked the application; if the number is greater than the number threshold, calculating the change trend of the first similarity each time in the number; if the change trend reaches the preset value, replacing the second standard face picture with the current first face photo.
[0134] In one embodiment, the above-mentioned step of collecting the first face picture used for the current face unlocking application also includes: continuously collecting multiple face pictures for unlocking the application; and selecting the face picture of the user with the highest frontality from the multiple face pictures as the first face picture.
[0135] In one embodiment, before the above-mentioned step of collecting the first face picture used for the current face unlocking application, and the first time the current face unlocks the application, the method also includes: when triggering the application, determining whether the application is an application in a preset whitelist; if so, generating and executing a command to "collect the first face picture used for the current face unlocking application, and the first time the current face unlocks the application".
[0136] In one embodiment, when the application is triggered as above, after the step of determining whether the application is an application in a preset whitelist, the method further includes: if the application is not an application in the preset whitelist, obtaining specified attributes of the application according to preset rules; determining whether the obtained specified attributes are consistent with preset whitelist attributes; if they are consistent, adding the application to the whitelist, and generating a command to execute "collecting the first face picture used for the current face unlocking application, and the first time the current face unlocking of the application"; if they are inconsistent, marking the application as a non-whitelist application, and executing the preset unlocking action for non-whitelist applications.
[0137] Those skilled in the art will understand that Figure 3 The structure shown in is merely a block diagram of a portion of the structure related to the present application solution and does not constitute a limitation on the computer device to which the present application solution is applied.
[0138] The computer device of the embodiment of the present invention does not need to calculate the trend of face picture changes, but is associated with time. When the first time of the current face unlocking the application and the second time interval of the previous face unlocking the application are not greater than the preset time length, the similarity is directly compared with the first standard face picture, and there is no need to update the standard face picture; when the first time of the current face unlocking the application and the second time interval of the previous face unlocking the application are greater than the preset time length, the similarity is calculated with the first standard face picture and the second standard face picture respectively to obtain the first similarity and the second similarity. If the second similarity is greater than the first similarity, it means that the user's face has changed, and the second standard face picture with a higher similarity to the current first face picture is used as the default standard picture, and updating the standard picture is simpler and faster. The present application only needs to compare time and similarity calculation, and consumes less resources. Each picture is obtained when the face is unlocked, and there is no need for the user to regularly or irregularly enter pictures at different times, and the user experience is better.
[0139] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, a method for updating a face image is implemented, which is used for short-term profit prediction when the amount of data on the blockchain is less than a preset amount. The prediction method includes: collecting a first face image used for a current face unlocking application, and a first time when the current face unlocks the application; determining whether the first time interval between the first time when the current face unlocks the application and the second time interval between the previous face unlocks the application is greater than a preset time length; if the time interval between the first time and the second time is not greater than the preset time length, calculating a first similarity between the first face image and a preset first standard face image If the first similarity is greater than a preset first threshold, the unlocking is successful, wherein the first standard face picture is the current default standard face picture of the application; if the time interval between the first time and the second time is greater than the preset time length, the first similarity between the first face picture and the preset first standard face picture, and the second similarity between the first face picture and the preset second standard face picture are calculated, wherein the second standard face picture is a face picture collected when the application was unlocked last time; if the second similarity is greater than the first similarity, the first standard face picture is replaced by the second standard face picture, and the first face picture is used as the new second standard face picture.
[0140] The above-mentioned method for updating face pictures does not require the calculation of the face picture change trend, but is associated with time. When the first time of the current face unlocking the application and the second time interval of the previous face unlocking the application are not greater than the preset time length, the similarity is directly compared with the first standard face picture, and there is no need to update the standard face picture; when the first time of the current face unlocking the application and the second time interval of the previous face unlocking the application are greater than the preset time length, the similarity is calculated with the first standard face picture and the second standard face picture respectively to obtain the first similarity and the second similarity. If the second similarity is greater than the first similarity, it means that the user's face has changed, and the second standard face picture with a higher similarity to the current first face picture is used as the default standard picture, and updating the standard picture is simpler and faster. This application only needs to compare time and similarity calculation, and consumes less resources. Each picture is obtained when the face is unlocked, and there is no need for the user to regularly or irregularly enter pictures at different times, which provides a better user experience.
[0141] In one embodiment, after the above-mentioned step of replacing the first standard face picture with the second standard face picture, it also includes: determining whether the first standard face picture is the original face picture uploaded by the user when registering the application; if so, storing the first standard face picture in a preset space; if not, deleting the first standard face picture.
[0142] In one embodiment, after the step of calculating the first similarity between the first face picture and the preset first standard face picture, and the second similarity between the first face picture and the preset second standard face picture if the time interval between the first time and the second time is greater than the preset time length, the method further includes: if the first similarity is greater than the second similarity and less than the first threshold, calculating the similarity between the first face picture and the original face picture to obtain a third similarity; if the third similarity is greater than the first threshold, unlocking is successful, otherwise unlocking fails.
[0143] In one embodiment, if the time interval between the first time and the second time is not greater than the preset time length, the first similarity between the first face picture and the preset first standard face picture is calculated. If the first similarity is greater than the preset first threshold, after the unlocking step is successful, the method also includes: determining the number of times the face unlocked the application within the preset time length before the current face unlocked the application; if the number is greater than the number threshold, calculating the change trend of the first similarity each time in the number; if the change trend reaches the preset value, replacing the second standard face picture with the current first face photo.
[0144] In one embodiment, the above-mentioned step of collecting the first face picture used for the current face unlocking application also includes: continuously collecting multiple face pictures for unlocking the application; and selecting the face picture of the user with the highest frontality from the multiple face pictures as the first face picture.
[0145] In one embodiment, before the above-mentioned step of collecting the first face picture used for the current face unlocking application, and the first time the current face unlocks the application, the method also includes: when triggering the application, determining whether the application is an application in a preset whitelist; if so, generating and executing a command to "collect the first face picture used for the current face unlocking application, and the first time the current face unlocks the application".
[0146] In one embodiment, when the application is triggered as above, after the step of determining whether the application is an application in a preset whitelist, the method further includes: if the application is not an application in the preset whitelist, obtaining specified attributes of the application according to preset rules; determining whether the obtained specified attributes are consistent with preset whitelist attributes; if they are consistent, adding the application to the whitelist, and generating a command to execute "collecting the first face picture used for the current face unlocking application, and the first time the current face unlocking of the application"; if they are inconsistent, marking the application as a non-whitelist application, and executing the preset unlocking action for non-whitelist applications.
[0147] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0148] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0149] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for updating a face image, characterized in that: Includes steps: Collecting the first face image used for the current face unlocking application and the first time the current face unlocking application was used; Determine whether a first time of the current face unlocking of the application and a second time interval of the previous face unlocking of the application are greater than a preset time length; If the time interval between the first time and the second time is not greater than the preset time length, then calculating a first similarity between the first face picture and a preset first standard face picture, and if the first similarity is greater than a preset first threshold, unlocking is successful, wherein the first standard face picture is the standard face picture currently defaulted by the application; If the time interval between the first time and the second time is greater than the preset time length, calculating a first similarity between the first face picture and a preset first standard face picture, and a second similarity between the first face picture and a preset second standard face picture, wherein the second standard face picture is a face picture collected when the application was unlocked last time; If the second similarity is greater than the first similarity, replacing the first standard face picture with the second standard face picture, and using the first face picture as a new second standard face picture; If the time interval between the first time and the second time is not greater than the preset time length, then the first similarity between the first face picture and the preset first standard face picture is calculated, and if the first similarity is greater than the preset first threshold, after the step of successful unlocking, the method further includes: determining the number of times the face unlocking the application is performed within the preset time length before the current face unlocking the application; if the number is greater than the number threshold, calculating the change trend of the first similarity each time in the number; if the change trend reaches the preset value, replacing the second standard face picture with the current first face photo; After the step of replacing the first standard face picture with the second standard face picture, the method further includes: determining whether the first standard face picture is the original face picture uploaded by the user when registering the application; if so, storing the first standard face picture in a preset space; if not, deleting the first standard face picture; The step of acquiring the first face image used for the current face unlocking application further includes: Continuously collect multiple face pictures for unlocking the application; and select the user's face picture with the highest frontality from the multiple face pictures as the first face picture.
2. The method for updating a face image according to claim 1, characterized in that: After the step of calculating a first similarity between the first face image and a preset first standard face image, and a second similarity between the first face image and a preset second standard face image if the time interval between the first time and the second time is greater than the preset time length, the method further includes: If the first similarity is greater than the second similarity and less than the first threshold, calculating the similarity between the first face image and the original face image to obtain a third similarity; If the third similarity is greater than the first threshold, the unlocking is successful, otherwise the unlocking fails.
3. The method for updating a face image according to claim 1, characterized in that: Before the step of acquiring the first face picture used for the current face unlocking application and the first time of the current face unlocking the application, the method further includes: When the application is triggered, determining whether the application is an application in a preset whitelist; If so, a command is generated to execute "collecting the first face picture used for the current face unlocking application, and the first time the current face unlocks the application".
4. The method for updating a face image according to claim 3, characterized in that: After the step of determining whether the application is an application in a preset whitelist when the application is triggered, the method further includes: If the application is not an application in a preset whitelist, obtaining a specified attribute of the application according to a preset rule; Determine whether the acquired specified attribute is consistent with the preset whitelist attribute; If they are consistent, the application is added to the whitelist, and a command is generated to execute "collecting the first face picture used for the current face unlocking application, and the first time the current face unlocking application is used"; If they are inconsistent, the application is marked as a non-whitelisted application, and a preset unlocking action for the non-whitelisted application is performed.
5. A device for updating a face image, characterized in that: include: A collection unit, used to collect a first face picture used for a current face unlocking application, and a first time when the current face unlocking application is used; A first judgment unit, used to judge whether a first time of the current face unlocking of the application and a second time interval of the previous face unlocking of the application are greater than a preset time length; an unlocking unit, configured to calculate a first similarity between the first face image and a preset first standard face image if the time interval between the first time and the second time is not greater than the preset time length, and if the first similarity is greater than a preset first threshold, unlocking is successful, wherein the first standard face image is a standard face image currently defaulted by the application; a first calculation unit, configured to calculate a first similarity between the first face image and a preset first standard face image, and a second similarity between the first face image and a preset second standard face image, if the time interval between the first time and the second time is greater than the preset time length, wherein the second standard face image is a face image captured when the application was unlocked last time; an updating unit, configured to replace the first standard face picture with the second standard face picture if the second similarity is greater than the first similarity, and use the first face picture as a new second standard face picture; A continuous acquisition module, used to continuously acquire multiple face images for unlocking the application; A selection module, used to select a user's face picture with the highest frontality from multiple face pictures as the first face picture; A second judging unit is used to judge whether the first standard face picture is the original face picture uploaded by the user when registering the application; a storage unit, configured to store the first standard face picture in a preset space if the first standard face picture is an original face picture uploaded by the user when registering the application; a deleting unit, configured to delete the first standard face picture if the first standard face picture is not the original face picture uploaded by the user when registering the application; A third determination unit, used to determine the number of times the face unlocking of the application is performed within the preset time length before the current face unlocking of the application; a trend calculation unit, configured to calculate a change trend of the first similarity for each of the times if the times are greater than a times threshold; A replacement unit is used to replace the second standard face picture with the current first face picture if the change trend reaches a preset value.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
