A face recognition method and device, a storage medium and a computer program product
By setting up a matching degree interval table and backing up the face database, the problem of recognition failure due to environmental or angular influences was solved, improving the recognition success rate and user experience.
Patent Information
- Application Number
- CN202210083209.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-21
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2042-01-21
AI Technical Summary
Existing facial recognition technology is prone to matching accuracy falling below the threshold due to environmental factors or shooting angles, leading to recognition failures and requiring users to take multiple photos for recognition, which affects the user experience.
Set up a matching degree interval table, including a success interval, a secondary verification interval, and a failure interval. When the matching degree is in the secondary verification interval, retrieve backup face data from the backup face database and perform multiple matches to improve the recognition success rate.
By repeatedly matching and backing up facial data, the number of recognition failures caused by environmental factors is reduced, thus improving the user experience.
Smart Images

Figure CN114639137B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of face recognition, in particular to a face recognition method and device, a storage medium and a computer program product. BACKGROUND
[0002] Face recognition is a biometric technology that identifies the identity based on the face feature information of a person. It uses a camera or a camera head to collect an image or a video stream containing a face, and automatically detects and tracks the face in the image, and then performs a series of related technologies for face recognition on the detected face, which is also commonly known as portrait recognition or face recognition.
[0003] In the scenarios of cell or company access control, face recognition technology is often used. The existing face recognition technology usually extracts feature values of the face to be recognized and compares them with face data in a database. If the matching degree is higher than a threshold, the recognition is successful, and if it is lower than the threshold, the next matching is performed. This method has a problem: when the matching degree is slightly lower than the threshold due to environmental or shooting angle effects, it is considered as a recognition failure, and the next recognition is performed, which requires the user to take multiple photos for recognition, affecting the user experience. SUMMARY
[0004] The purpose of the present application is to provide a face recognition method, device, storage medium and computer program product, which can solve the problem of multiple recognitions required by the user when the face recognition fails in the prior art.
[0005] In order to achieve the above-mentioned purpose of the application, the present application provides the following technical solutions:
[0006] In a first aspect, a face recognition method is provided, comprising:
[0007] obtaining a face image to be recognized, and extracting feature values of the face image to be recognized;
[0008] calculating a first matching degree of the feature values with face data in a standard face database;
[0009] when the first matching degree is in a secondary verification interval in a matching degree interval table, obtaining backup face data in a backup face database, and sequentially calculating a second matching degree of the feature values with the backup face data, the matching degree interval table being pre-set, and the matching degree interval table including a success interval, a secondary verification interval and a failure interval, the backup face data being face data of the same user as the face data in the standard face database and different from the face data in the standard face database;
[0010] when the second matching degree is in the success interval or the secondary verification interval, the recognition is considered successful, and the matching is ended.
[0011] In a second aspect, a computer device is provided, comprising a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the following steps:
[0012] obtaining a face image to be identified, and extracting a feature value of the face image to be identified;
[0013] calculating a first matching degree of the feature value with respect to face data in a standard face database;
[0014] when the first matching degree is in a secondary verification interval in a matching degree interval table, obtaining backup face data in a backup face database, and sequentially calculating a second matching degree of the feature value with respect to the backup face data, the matching degree interval table being pre-set, the matching degree interval table comprising a success interval, a secondary verification interval and a failure interval, the backup face data being face data of a same user as the face data in the standard face database and different from the face data in the standard face database;
[0015] when the second matching degree is in the success interval or the secondary verification interval, the identification is considered successful, and the matching is ended.
[0016] In a third aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, wherein the computer program is executed by a processor to implement the following steps:
[0017] obtaining a face image to be identified, and extracting a feature value of the face image to be identified;
[0018] calculating a first matching degree of the feature value with respect to face data in a standard face database;
[0019] when the first matching degree is in a secondary verification interval in a matching degree interval table, obtaining backup face data in a backup face database, and sequentially calculating a second matching degree of the feature value with respect to the backup face data, the matching degree interval table being pre-set, the matching degree interval table comprising a success interval, a secondary verification interval and a failure interval, the backup face data being face data of a same user as the face data in the standard face database and different from the face data in the standard face database;
[0020] when the second matching degree is in the success interval or the secondary verification interval, the identification is considered successful, and the matching is ended.
[0021] In a fourth aspect, a computer program product is provided, comprising a computer program, wherein the computer program is executed by a processor to implement the following steps:
[0022] Obtaining a to-be-identified face image, and extracting a feature value of the to-be-identified face image;
[0023] Calculating a first matching degree of the feature value and face data in a standard face database according to the feature value;
[0024] When the first matching degree is in a secondary verification interval in a matching degree interval table, obtaining backup face data in a backup face database, and sequentially calculating second matching degrees of the feature value and the backup face data, the matching degree interval table being pre-set, the matching degree interval table including a success interval, a secondary verification interval, and a failure interval, the backup face data being face data of a same user as the face data in the standard face database and different from the face data in the standard face database;
[0025] When the second matching degree is in the success interval or the secondary verification interval, considering that face recognition is successful, and ending the matching.
[0026] A face recognition method and device, a storage medium, and a program product, by setting a matching degree interval table, when a matching degree of to-be-identified face data and face data in a standard database falls into a secondary verification interval, calculating a matching degree of the to-be-identified face data and backup face data. By multiple matching with the backup face data, the probability of matching is improved, the number of times of recognition failure caused by environmental factors or other factors is reduced, and user experience is improved. BRIEF DESCRIPTION OF DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, without creative labor, other drawings can also be obtained from these drawings.
[0028] Among them:
[0029] Figure 1 A flow chart of a face recognition method in an embodiment;
[0030] Figure 2 A schematic diagram of a face database in an embodiment;
[0031] Figure 3 A flow chart of a face recognition method in an embodiment;
[0032] Figure 4 A schematic diagram of a face database in an embodiment;
[0033] Figure 5 A flow chart of a face recognition method in an embodiment;
[0034] Figure 6 Fig. 1 is a schematic diagram of a face database in one embodiment;
[0035] Figure 7 Fig. 2 is a system block diagram in one embodiment;
[0036] Figure 8 Fig. 3 is an internal structure diagram of a computer device in one embodiment. DETAILED DESCRIPTION
[0037] It should be understood that the specific embodiments described herein are merely exemplary and do not limit the application.
[0038] The technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0039] It should be noted that the terms "comprising", "including", and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover not exclusive inclusion. For example, a process, method, terminal, product or device including a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to the process, method, product or device. The terms such as "first" and "second" and the like in the claims, specification and drawings of the present application are only used to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any actual relationship or order between the entities / operations / objects.
[0040] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase that the phrase in the specification appear not necessarily all refer to the same embodiment, or that they are mutually exclusive or alternative embodiments as opposed to being independent or alternative embodiments.
[0041] The prior art usually sets a threshold to determine whether the face recognition is successful. When the matching degree of the face to be recognized and the pre-stored face in the database is higher than or equal to the threshold, the recognition is passed. When the matching degree of the face to be recognized and the pre-stored face in the database is lower than the threshold, the recognition fails. This has a problem. When the user whose face is pre-recorded in the system performs face recognition, the user's face may be affected by environmental factors such as light or shooting angle, resulting in a matching degree lower than the threshold with the face recorded by the system, and the face recognition fails. The face is matched with other faces, and the face recognition also fails, resulting in the need to take multiple photos of the user's face, and even the face recognition fails all the time, which seriously affects the user experience. Based on this problem, the present application adds the face with a higher matching degree to the backup face database after the user's face recognition is successful. With the increase of the number of successful recognitions, a user has many backup faces with a higher matching degree in addition to the pre-recorded face. These backup faces may be successfully recognized in various environments. Therefore, the probability of successful recognition of the user in the same or similar environment will be improved. When the user performs face recognition in different environments or different angles, the matching degree with the pre-recorded face in the system may be lower than the threshold. At this time, the user's face is verified twice or multiple times, and the user's face is matched with the face in the backup database. The more backup face data in different environments or different angles, the greater the probability of successful face recognition of the user at one time.
[0042] As shown in Figure 1 The present application provides a face recognition method, comprising:
[0043] Step 101: acquiring a face image to be recognized, and extracting a feature value of the face image to be recognized.
[0044] The face recognition method provided by the present application can be applied to occasions requiring face recognition, such as opening doors in communities, companies, and high-speed rail stations. It can also be applied to occasions requiring face recognition, such as identity recognition of terminal devices such as mobile phones and computers. The control system controls the camera to capture the user's face and acquires the face image to be recognized of the user. The face image to be recognized is an image containing the user's face. In addition to real-time shooting, the face image to be recognized transmitted from the outside can also be acquired. After the control system acquires the face image to be recognized, the face image to be recognized is preprocessed, and the face feature value in the face image to be recognized is extracted by a feature extraction algorithm after the preprocessing. Of course, the face image to be recognized can also be preprocessed.
[0045] Step 102: calculating a first matching degree of the feature value with face data in a standard face database.
[0046] When the control system extracts the feature value of the face to be identified, the matching degree with the pre-recorded face feature value in the system is calculated according to the matching degree algorithm. In order to facilitate understanding, an example is given. When the application is used with the community access control system, the owner of the community, i.e. the user, needs to pre-record his own face, and the face data is stored in the standard database. The face data recorded by the owner is the standard face data. When the owner wants to enter the community, face recognition is needed. First, the face needs to be aligned with the camera. When the camera takes the owner's face image, i.e. the face image to be identified, the control system extracts the feature value of the face to be identified, and calculates the matching degree with the standard face in the standard face database one by one. The matching degree of the feature value of the face to be identified with the face data in the standard face database is the first matching degree. When the first matching degree is in the success interval of the matching degree interval table, it is considered to be successful, and the access control is started. The matching degree interval table is an interval divided according to the matching degree in advance. In this application, the matching degree interval table includes: success interval, secondary verification interval, and failure interval. In order to facilitate understanding, the matching degree is expressed by score, the highest score is 100, for example, the success interval is the matching degree above 90 points. According to actual experience, when the matching degree reaches 90 points or more, it means that the face to be identified and the standard face matched with it are the same face with a high probability, and it can be directly considered as successful recognition. The secondary verification interval is the interval between 70-90 points. According to actual experience, when the matching degree is in this interval, it means that the face to be identified and the standard face matched with it are the same face with a high probability, but there is a certain risk of misidentification, so when the matching degree is in this interval, the face to be identified needs to be verified again to ensure the accuracy of the recognition. The failure interval is below 70 points. According to actual experience, when the matching degree is below 70 points, it means that the face to be identified and the standard face matched with it are not the same face with a high probability, and it can be directly considered as failed recognition.
[0047] Step 103: When the first matching degree is in the secondary verification interval of the matching degree interval table, the backup face data in the backup face database is obtained, and the second matching degree of the feature value and the backup face data is calculated in turn. The matching degree interval table is set in advance, and the matching degree interval table includes: success interval, secondary verification interval, and failure interval. The backup face data is the same user as the face data in the standard face database, and is different from the face data in the standard face database.
[0048] For ease of understanding, the same cell access in step 102 is taken as an example, when the first matching degree is in the secondary verification interval in the matching degree interval table, the matching degree interval table includes: success interval, secondary verification interval, failure interval, for ease of understanding, the matching degree is expressed by score, the highest is 100 points, the matching degree of the secondary verification interval here is also between 70-90 points, according to actual experience, when the matching degree is in this interval, it means that there is a high probability that the to-be-identified face and the standard face matched with it are the same face, but there is a certain risk of misidentification, therefore, when the matching degree is in this interval, the to-be-identified face needs to be verified again to ensure the recognition accuracy. The steps of secondary verification are: obtaining backup face data in the backup face database, and sequentially calculating the second matching degree of the feature value and the backup face data. Wherein, the backup face data is the to-be-identified face of the user when the user is face recognition, when the to-be-identified face image of the user taken and the matching degree of a certain face data in the standard database fall into the success interval, that is, the matching degree is greater than or equal to 90 points, this to-be-identified face is taken as the backup face of the standard face matched with it, this to-be-identified face data is the backup face data, and the backup face data is added to the backup face database of the standard face matched with it. For example, Figure 2As shown, there are five pieces of face data A, B, C, D, and E in the standard face database, wherein the backup face database of user A has three pieces of backup face data A1, A2, and A3, the standard face data A is pre-recorded by the user A into the system, and the backup face data A1, A2, and A3 are stored in the backup face database when the matching degree of the user A with the standard face data A is greater than or equal to 90 points during face recognition. In addition, the backup face data can also be the face additionally recorded by the user during the initial face recording, as the backup face. The backup face database is stored in the system, when the first matching degree is in the secondary verification interval, the backup face data in the backup face database of the standard face matched with the to-be-identified face is obtained, the second matching degree of the feature value with the backup face data is calculated in turn, when the matching degree of the backup face data with the to-be-identified face data is in the failure interval, the matching degree of the next face data in the backup face database with the to-be-identified face data is calculated, until the matching degree of the backup face data with the to-be-identified face data is in the success interval or the secondary verification interval, when the matching degree of the backup face data with the to-be-identified face data is in the success interval, it is proved that there is a great probability that the to-be-identified face and the standard face matched therewith are the same face, which can be directly regarded as successful identification; when the matching degree of the backup face data with the to-be-identified face data is in the secondary verification interval, according to practical experience, the matching degrees of the to-be-identified face data with the standard face data and the backup face data of the standard face data are both in the secondary verification interval, which also proves that there is a great probability that the to-be-identified face and the standard face matched therewith are the same face, which can be directly regarded as successful identification. By performing secondary or multiple verifications on the to-be-identified face data and the backup face data with the matching degree in the secondary verification interval, the probability of matching through is improved, the number of identification failures caused by environmental factors or other factors is reduced, and the user experience is improved.
[0049] Step 104: when the second matching degree is in the success interval or the secondary verification interval, it is regarded as successful identification, and the matching is ended.
[0050] When the matching degree of the backup face data with the to-be-identified face data is in the secondary verification interval, according to practical experience, the matching degrees of the to-be-identified face data with the standard face data and the backup face data of the standard face data are both in the secondary verification interval, which also proves that there is a great probability that the to-be-identified face and the standard face matched therewith are the same face, which can be directly regarded as successful identification.
[0051] The above face recognition method sets the matching degree interval table, calculates the matching degree of the to-be-identified face data with the backup face data when the matching degree of the to-be-identified face data with the face data in the standard database falls into the secondary verification interval. By multiple matching with the backup face data, the probability of matching through is improved, the number of identification failures caused by environmental factors or other factors is reduced, and the user experience is improved.
[0052] In one embodiment, the method further comprises: adding the face image feature value after pre-processing and the first matching degree falling into the success interval as backup face data to the backup face database; or adding the face image feature value after the second matching degree falling into the success interval as backup face data to the backup face database.
[0053] Wherein, before the matching degree calculation of the face to be identified, the face to be identified is pre-processed to reduce noise. For ease of understanding, the matching degree is also expressed as a score, with a maximum of 100 points. When the user performs face recognition, if the matching degree between the face data to be identified of the user and the face data in the standard database falls into the success interval, i.e. the matching degree is greater than or equal to 90 points, it means that the face to be identified and the face in the standard database belong to the same person. The face to be identified is taken as the backup face of the standard face matched therewith, and the face data to be identified is the backup face data. The backup face data is added to the backup face database of the standard face matched therewith. In addition, if the matching degree between the face data to be identified and the backup face data is greater than or equal to 90 points, it means that the face to be identified and the backup face belong to the same person. The face to be identified is taken as the backup face of the standard face matched therewith, and the face data to be identified is the backup face data.
[0054] In another embodiment, the method further comprises: adding the face image feature value without pre-processing and the first matching degree falling into the success interval as backup face data to the backup face database; or adding the face image feature value after the second matching degree falling into the success interval as backup face data to the backup face database.
[0055] Wherein, the face to be identified is not pre-processed. If the first matching degree between the face to be identified and a certain standard face still falls into the success interval, the face to be identified is added to the backup database. When the user performs face recognition in the same environment later, the recognition success rate will be improved. Similarly, if the first matching degree between the face data to be identified and the backup face data falls into the success interval, the face to be identified is added to the backup database. When the user performs face recognition in the same environment later, the recognition success rate will be improved.
[0056] As Figure 3As shown, in one embodiment, the secondary verification interval further includes, in high-low order, a first verification interval and a second verification interval, and the method further includes: when the first matching degree is in the second verification interval, obtaining backup face data in a backup face database, and sequentially calculating third matching degrees of the feature value and the backup face data; when there is a third matching degree in the success interval or the secondary verification interval, obtaining first similar face data in a first similar face database, and sequentially calculating fourth matching degrees of the feature value and the first similar face data, the first similar face data being other face data in the standard face database except for target standard face data, the target standard face data being standard face data matched with the face image to be identified, and the first similar face database including the first similar face data; and when all the fourth matching degrees are in the fourth interval, considering that the identification is successful, and ending the matching.
[0057] For ease of understanding, examples are given as follows. As described above, the matching degree of the secondary verification interval is 70-90, and the identification success probability of the matching degree of 80-90 is higher than that of the matching degree of 70-80. When the matching degree of the face image to be identified and the standard face data is 80-90, i.e., in the first verification interval, whether the identification is successful can be directly determined according to the matching degree of the face image to be identified and the backup face data. When the matching degree of the face image to be identified and the standard face data is 70-80, i.e., in the second verification interval, if whether the identification is successful is directly determined according to the matching degree of the face image to be identified and the backup face data, there is a small probability of misidentification. In this embodiment, when the matching degree of the face image to be identified and the standard face data is 70-80, the matching degree of the face image to be identified and the backup face data is calculated, and this matching degree is the third matching degree. When the third matching degree is in the success interval or the secondary verification interval, the first similar face data in the first similar face database is obtained, and the fourth matching degree of the face image to be identified and the first similar face data is sequentially calculated. When a user initially inputs a face, the system will take the standard face data of other users except for the user as the first similar face data of the user, and add the first similar face data to the first similar face database. Figure 4As shown, there are five pieces of face data A, B, C, D and E in the standard face database, and the standard face data A, B, C, D and E are pre-recorded into the system by the users A, B, C, D and E, wherein the face data B, C, D and E except the standard face data A of the user A are added to the similar face database of the user A, and the similar face database of the user A has similar face data B, C, D and E. When the third matching degree is in the success interval or the secondary verification interval, the fourth matching degree between the to-be-identified face data and the first similar face data is compared again, and when the fourth matching degree is all in the fourth interval, i.e. lower than 70, it is indicated that the user is not the user in the similar face database, and since the matching degree between the to-be-identified face data of the user and the backup face data is in the range of 70-80, according to actual experience, the combination of the two indicates that there is a high probability that the user corresponding to the backup face data is the same person, and thus the recognition is considered to be successful, and the matching is ended. By setting the similar face database, the face data with a matching degree in the middle is further verified, the probability of passing the matching is improved, the number of recognition failures is reduced, and the user experience is improved.
[0058] As shown, Figure 5 In another embodiment, the secondary verification interval further includes a first verification interval and a second verification interval in a high-low order, and the method further includes: when the first matching degree is in the second verification interval, obtaining backup face data in a backup face database, and sequentially calculating a third matching degree between the feature value and the backup face data; when there is a third matching degree in the success interval or the secondary verification interval, obtaining second similar face data in a second similar face database, and sequentially calculating a fifth matching degree between the feature value and the second similar face data, the second similar face data being face data in the standard face database with a matching degree greater than a preset value with a target standard face data, the target standard face data being a standard face data matched with the to-be-identified face image, and the second similar face database including the second similar face data; and when the fifth matching degree is all in the fourth interval, considering the recognition to be successful, and ending the matching.
[0059] For ease of understanding, an example is provided. Similar to the examples of the matching intervals mentioned above, the matching score of the secondary verification interval is 70-90 points. The probability of successful recognition is different for a matching score of 70-80 points and a matching score of 80-90 points. The probability of successful recognition for a matching score of 80-90 points is higher than that for a matching score of 70-80 points. When the matching degree between the face data to be identified and the standard face data is 80-90 points, the success of the identification can be determined directly based on the matching degree between the face data to be identified and the backup face data. When the matching degree between the face data to be identified and the standard face data is 70-80 points, there is a small probability of false identification if the success of the identification is determined directly based on the matching degree between the face data to be identified and the backup face data. In this embodiment, when the matching degree between the face data to be identified and the standard face data is 70-80 points, the matching degree between the face data to be identified and the backup face data is calculated. This matching degree is the third matching degree. When the third matching degree is in the success range or the secondary verification range, the second similar face data in the first similar face database is obtained, and the fifth matching degree between the face data to be identified and the second similar face data is calculated sequentially. When a user initially registers their face, the system compares the user's standard facial data with the standard facial data of other users. If the match is greater than a preset value, the standard facial data of those other users is used as the user's second similar facial data and added to the second similar facial data database. For example... Figure 6 As shown, the standard face database contains five sets of face data: A, B, C, D, and E. These standard face data sets A, B, C, D, and E were pre-entered into the system by users A, B, C, D, and E. When the matching degree between standard face data sets B and D and standard face data A is greater than a preset value (e.g., 70%), standard face data sets B and D are considered similar to standard face data A and added to the similar face database of standard face data A. When the third matching degree is in the successful range or the secondary verification range, the fifth matching degree of the face data to be identified is compared with the second similar face data. When the fifth matching degree is entirely in the fourth range (below 70), it indicates that the user is not a user in the similar face database. However, since the matching degree between the user's face data to be identified and the backup face data is between 70-80%, based on practical experience, the combination of these two factors suggests a high probability that the user and the user corresponding to the backup face data are the same person. Therefore, the identification is considered successful, and the matching ends. By setting up a second similar face database, face data with a moderate matching degree is further verified, which increases the probability of successful matching, reduces the number of recognition failures, improves user experience, and requires fewer calculations, resulting in faster face recognition speed.
[0060] In one embodiment, the method further comprises: when the user performs face recognition, obtaining face data in a face database corresponding to a time period according to a current time, the face database corresponding to the time period is a time period in which the user passes through after the user's face recognition is successful, calculating the passing frequency of the user in each time period, and establishing the face database of each time period according to the passing frequency of the user in each time period; and calculating the matching degree with the face data according to the passing frequency.
[0061] In the embodiment, when the user performs face recognition, the time period corresponding to the current time is obtained, and the face database of the time period is established, that is, the frequency of the user passing through face recognition in the time period is calculated, and the face database of the time period is established according to the passing frequency of the user. In order to facilitate understanding, an example is given. In the time period from 9:00 to 10:00, the data in a month is counted, the number of times that the user A passes through face recognition is 28, the number of times that the user B passes through face recognition is 26, the number of times that the user C passes through face recognition is 5, and the number of times that the user D passes through face recognition is 0. According to these data, the face database in the time period from 9:00 to 10:00 is established, and the user A, the user B, and the user C are added to the face database in the time period according to the passing frequency. When the time of triggering the face recognition operation is in the time period, the face data in the face database in the time period is preferentially calculated with the face data to be recognized, for example, the face data of the user A is preferentially matched, so as to improve the face recognition speed and improve the user experience.
[0062] In another embodiment, the method further comprises: when the user performs face recognition, obtaining face data in a face database corresponding to a time period according to a current time, the face database corresponding to the time period is a time period in which the user passes through after the user's face recognition is successful, calculating the passing frequency of the user in each time period, and establishing the face database of each time period according to the passing frequency of the user in each time period; and calculating the matching degree with the face data according to the passing frequency.
[0063] In addition to establishing a face database of a specific time period, a face database of a specific date can also be established. For ease of understanding, an example is given. In the face recognition scene of a company, on Sunday, the data of a month is counted, the number of times that user A passes through face recognition is 4, the number of times that user B passes through face recognition is 2, and the number of times that user C passes through face recognition is 0. According to these data, a face database of Monday is established, and users A and B are added to the face database of the date according to the passing frequency. When the date triggering the face recognition operation is the date, the system preferentially calculates the matching degree between the face data in the face database of the time period and the to-be-identified face data, for example, preferentially matches the face data of user A, so as to improve the face recognition speed and enhance the user experience.
[0064] As shown in Figure 7 The present application provides a computer device, comprising a memory, a processor and a computer program stored in the memory, the device comprising:
[0065] The first acquisition module 401 is configured to acquire a to-be-identified face image and extract a feature value of the to-be-identified face image.
[0066] The calculation module 402 is configured to calculate a first matching degree between the feature value and face data in a standard face database.
[0067] The second acquisition module 403 is configured to acquire backup face data in a backup face database when the first matching degree is in a secondary verification interval in a matching degree interval table, and sequentially calculate a second matching degree between the feature value and the backup face data. The matching degree interval table is pre-set, and the matching degree interval table comprises a success interval, a secondary verification interval and a failure interval. The backup face data is face data of the same user as the face data in the standard face database and different from the face data in the standard face database.
[0068] The end module 404 is configured to end the matching when the second matching degree is in the success interval or the secondary verification interval.
[0069] The face recognition device described above, by setting a matching degree interval table, when the matching degree between the to-be-identified face data and the face data in the standard database falls within the secondary verification interval, the matching degree between the to-be-identified face data and the backup face data is calculated. By matching the backup face data multiple times, the probability of matching is improved, the number of recognition failures caused by environmental factors or other factors is reduced, and the user experience is improved.
[0070] In one embodiment, the device further comprises a first adding module configured to:
[0071] The face image feature value after pre-processing and the first matching degree falling into the success interval is added to the backup face database as backup face data, or the face image feature value and the second matching degree falling into the success interval is added to the backup face database as backup face data.
[0072] In another embodiment, the device further comprises a second adding module for:
[0073] The face image feature value without pre-processing and the first matching degree falling into the success interval is added to the backup face database as backup face data, or the face image feature value and the second matching degree falling into the success interval is added to the backup face database as backup face data.
[0074] In one embodiment, the secondary verification interval further comprises a first verification interval and a second verification interval in high-low order, and the device further comprises a third obtaining module for:
[0075] When the first matching degree is in the second verification interval, backup face data in the backup face database is obtained, and third matching degrees of the feature value and the backup face data are sequentially calculated; when there is a third matching degree in the success interval or the secondary verification interval, first similar face data in the first similar face database is obtained, and fourth matching degrees of the feature value and the first similar face data are sequentially calculated, the first similar face data is other face data in the standard face database except target standard face data, the target standard face data is standard face data matched with the face image to be identified, and the first similar face database comprises the first similar face data; when the fourth matching degrees are all in the fourth interval, it is considered as successful identification, and the matching is ended.
[0076] In another embodiment, the secondary verification interval further comprises a first verification interval and a second verification interval in high-low order, and the device further comprises a fourth obtaining module for: when the first matching degree is in the second verification interval, backup face data in the backup face database is obtained, and third matching degrees of the feature value and the backup face data are sequentially calculated; when there is a third matching degree in the success interval or the secondary verification interval, second similar face data in the second similar face database is obtained, and fourth matching degrees of the feature value and the second similar face data are sequentially calculated, the second similar face data is face data in the standard face database with a matching degree greater than a preset value with target standard face data, the target standard face data is standard face data matched with the face image to be identified, and the second similar face database comprises the second similar face data; when the fourth matching degrees are all in the fourth interval, it is considered as successful identification, and the matching is ended.
[0077] In one embodiment, the apparatus further comprises a second computing module configured to:
[0078] When the user performs face recognition, the face data in the face database corresponding to the time period is acquired according to the current time, the face database corresponding to the time period is the time period in which the user passes through is recorded after the user face recognition is successful, the passing frequency of the user in each time period is calculated, the face database of each time period is established according to the passing frequency of the user in each time period, and the matching degree is calculated according to the passing frequency in turn with the face data.
[0079] In another embodiment, the apparatus further comprises a third computing module configured to:
[0080] When the user performs face recognition, the face data in the face database corresponding to the date is acquired according to the current time, the face database corresponding to the date is the date in which the user passes through is recorded after the user face recognition is successful, the passing frequency of the user in each date is calculated, the face database of each date is established according to the passing frequency of the user in each date, and the matching degree is calculated according to the passing frequency in turn with the face data.
[0081] As Figure 8 shown, the computer device includes a processor, a memory and a network interface connected through a terminal bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer equipment has a storage operation terminal, and can also have a computer program, which is executed by the processor, so that the processor can realize the face recognition method described above. The internal memory can also store a computer program, which is executed by the processor, so that the processor can execute the face recognition method described above. Those skilled in the art can understand Figure 8 that the structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the equipment to which the scheme of the present application is applied. The specific equipment can include more or less components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0082] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by the processor to make the processor execute the steps of the face recognition method described above.
[0083] In one embodiment, a computer program product is provided, which includes a computer program, characterized in that the computer program is executed by the processor to realize the steps of the face recognition method described above.
[0084] It can be understood that the face recognition method, apparatus, storage medium and computer program product described above belong to one general inventive concept, and the embodiments are mutually applicable.
[0085] Those skilled 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. The program can be stored in a non-volatile computer readable storage medium, and when the program is executed, the processes of the above-mentioned embodiment methods can be included. Any reference to memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), 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.
[0086] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, but as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.
[0087] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are all within the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.
Claims
1. A face recognition method, characterized by, The method comprises: obtaining a to-be-identified face image, and extracting a feature value of the to-be-identified face image; calculating a first matching degree of the feature value with respect to face data in a standard face database; when the first matching degree is in a secondary verification interval in a matching degree interval table, obtaining backup face data in a backup face database, and sequentially calculating second matching degrees of the feature value with respect to the backup face data, the matching degree interval table being pre-set, the matching degree interval table comprising a success interval, a secondary verification interval and a failure interval, the backup face data being face data of the same user as the face data in the standard face database and different from the face data in the standard face database; when the second matching degrees are in the success interval or the secondary verification interval, regarding the identification as successful, and ending the matching; the secondary verification interval further comprising a first verification interval and a second verification interval in a high-to-low order, and the method further comprising: when the first matching degree is in the second verification interval, obtaining backup face data in a backup face database, and sequentially calculating third matching degrees of the feature value with respect to the backup face data; when the third matching degrees are in the success interval or the secondary verification interval, obtaining first similar face data in a first similar face database, and sequentially calculating fourth matching degrees of the feature value with respect to the first similar face data, the first similar face data being other face data in the standard face database except for target standard face data, the target standard face data being standard face data matched with the to-be-identified face image, and the first similar face database comprising the first similar face data; when the fourth matching degrees are all in a fourth interval, regarding the identification as successful, and ending the matching.
2. The face recognition method of claim 1, wherein, The method further comprises: adding, as backup face data, a face image feature value after pre-processing and falling into the success interval to the backup face database; or adding, as backup face data, a face image feature value falling into the success interval to the backup face database.
3. The face recognition method of claim 1, wherein, The method further comprises: adding, as backup face data, a face image feature value without pre-processing and falling into the success interval to the backup face database; or adding, as backup face data, a face image feature value falling into the success interval to the backup face database.
4. The face recognition method of claim 1, wherein, The secondary verification interval further comprises a first verification interval and a second verification interval in a high-to-low order, and the method further comprises: when the first matching degree is in the second verification interval, obtaining backup face data in a backup face database, and sequentially calculating third matching degrees of the feature value with respect to the backup face data; When the third matching degree is in the success interval or the secondary verification interval, second similar face data in a second similar face database is acquired, and fifth matching degrees between the feature value and the second similar face data are sequentially calculated, the second similar face data being face data in a standard face database that has a matching degree greater than a preset value with target standard face data, the target standard face data being standard face data that matches the face image to be identified, and the second similar face database including the second similar face data. When the fifth matching degrees are all in a fourth interval, the identification is considered successful, and the matching is ended.
5. The face recognition method of claim 1, wherein, The method further includes: When a user performs face identification, face data in a face database corresponding to a time period is acquired according to a current time, the face database corresponding to the time period being a face database corresponding to a time period in which the user passes after the user successfully performs face identification, the passing frequency of the user in each time period is calculated, and a face database of each time period is established according to the passing frequency of the user in each time period. Matching degrees are sequentially calculated according to the passing frequencies and the face data.
6. The face recognition method of claim 1, wherein, The method further includes: When a user performs face identification, face data in a face database corresponding to a date is acquired according to a current time, the face database corresponding to the date being a face database corresponding to a date in which the user passes after the user successfully performs face identification, the passing frequency of the user in each date is calculated, and a face database of each date is established according to the passing frequency of the user in each date. Matching degrees are sequentially calculated according to the passing frequencies and the face data.
7. A computer apparatus comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program, when executed by the processor, causes the processor to perform the method of any one of claims 1 to 6. The processor executes the computer program to implement the steps of the method in claims 1-6.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in claims 1-6.
9. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in claims 1-6.
Citation Information
Patent Citations
Intelligent security face recognition system
CN112364733A
Device for updating face recognition templates
DE202018000407U1