Face recognition method and device and electronic equipment

By merging and dividing the feature identifiers of the facial feature database, the target facial feature database is selected, which solves the problem of low recognition efficiency caused by the increase in the size of the facial feature database and achieves efficient facial recognition.

CN120877342APending Publication Date: 2025-10-31JINAN BOGUAN INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410531944.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-29
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

As the number of facial features stored in the facial feature database increases, existing technologies need to traverse a large number of facial features during matching, resulting in low facial recognition efficiency.

Method used

By determining the first feature identifier corresponding to the facial features of the face image to be identified, and based on the second feature identifiers of multiple face feature databases, merging the columns in the distance matrix, dividing the target distance matrix, filtering out the target face feature database that matches the first feature identifier, and determining the face recognition result based on the matching degree.

Benefits of technology

It eliminates the need to traverse numerous facial features, thereby improving facial recognition efficiency, reducing computational load, and increasing recognition speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120877342A_ABST
    Figure CN120877342A_ABST
Patent Text Reader

Abstract

The invention provides a face recognition method and device and electronic equipment, and relates to the technical field of image processing. The method comprises the following steps: determining a first feature identifier corresponding to a face feature of a to-be-recognized face image; based on respective second feature identifiers of multiple face feature libraries, a target face feature library corresponding to a target feature identifier matched with the first feature identifier is determined, and the multiple face feature libraries are a target distance matrix obtained by combining columns in a distance matrix based on multiple feature values corresponding to multiple preset face features; the distance matrix is obtained by dividing the plurality of preset face features, and the distance matrix is determined based on the plurality of preset face features and a group of preset standard orthogonal bases; and determining a face recognition result of the to-be-recognized face image based on a matching degree between the face feature and each preset face feature in a target face feature library. Compared with the prior art, the method does not need to traverse more face features, so that the face recognition efficiency can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a face recognition method, apparatus and electronic device. Background Technology

[0002] In face recognition scenarios, facial features are typically extracted from the face image to be recognized. These extracted features are then matched with facial features in a pre-built facial feature library, and the facial feature with the highest matching degree is taken as the face recognition result.

[0003] However, as the number of facial features stored in the facial feature database increases, if the above scheme continues to be used, it will be necessary to traverse a large number of facial features during matching, which will result in low facial recognition efficiency. Summary of the Invention

[0004] This application provides a face recognition method, apparatus, and electronic device that can effectively improve face recognition efficiency.

[0005] This application provides a face recognition method, including:

[0006] Determine the first feature identifier corresponding to the facial features of the face image to be identified;

[0007] Based on the second feature identifiers of each of the multiple face feature databases, a target face feature database corresponding to the target feature identifier that matches the first feature identifier is determined. The multiple face feature databases are obtained by merging the columns of the distance matrix based on multiple feature values ​​corresponding to multiple preset face features, and the multiple preset face features are divided into a target distance matrix. The distance matrix is ​​determined based on the multiple preset face features and a set of preset orthonormal bases.

[0008] Based on the matching degree between the facial features and each preset facial feature in the target facial feature library, the facial recognition result of the face image to be recognized is determined.

[0009] According to the face recognition method provided in this application, determining the first feature identifier corresponding to the facial features of the face image to be recognized includes:

[0010] Based on the facial features and the orthogonal basis, determine the distance vector corresponding to the facial features;

[0011] Based on the operation of merging the columns of the distance matrix, the columns of the distance vector are merged to obtain the merged distance vector;

[0012] The first feature identifier is determined based on the merged distance vector.

[0013] According to a face recognition method provided in this application, determining the first feature identifier based on the merged distance vector includes:

[0014] For each element value in the merged distance vector, the type corresponding to the column where the element value is located is determined based on the coefficient of variation. The type includes a dispersed type or a non-dispersed type.

[0015] The first feature identifier is determined based on the type corresponding to the column where each element value is located.

[0016] According to the face recognition method provided in this application, the step of determining the target face feature library corresponding to the target feature identifier that matches the first feature identifier based on the second feature identifier of each of multiple face feature libraries includes:

[0017] Based on the second feature identifiers of the multiple face feature databases, if there is a second feature identifier that is the same as the first feature identifier, the second feature identifier that is the same as the first feature identifier is determined as the target feature identifier;

[0018] If no second feature identifier is identical to the first feature identifier, the second feature identifier that is closest to the first feature identifier is determined as the target feature identifier;

[0019] The facial feature library corresponding to the target feature identifier is the target facial feature library.

[0020] According to a face recognition method provided in this application, when the target feature identifier is a second feature identifier that is the same as the first feature identifier, the step of determining the face recognition result of the face image to be recognized based on the matching degree between the face feature and each preset face feature in the target face feature database includes:

[0021] Determine whether the maximum matching degree in the matching degree is greater than or equal to the first matching threshold;

[0022] If the maximum matching degree is greater than or equal to the first matching threshold, the preset facial feature corresponding to the maximum matching degree is determined as the facial recognition result.

[0023] If the maximum matching degree is less than the first matching threshold, the face recognition result is determined based on the maximum matching degree and the matching degree between the face feature and each preset face feature in the first face feature library. The first face feature library is the face feature library corresponding to the second feature identifier that is closest to the first feature identifier.

[0024] According to the face recognition method provided in this application, based on multiple feature values ​​corresponding to multiple preset face features, the columns in the distance matrix are merged to obtain a target distance matrix, including:

[0025] The sum of the multiple eigenvalues ​​is used to normalize each eigenvalue to obtain the normalized eigenvalues.

[0026] From multiple normalized feature values, determine multiple target feature values ​​arranged in descending order, wherein the sum of the multiple target feature values ​​is greater than or equal to a first preset value;

[0027] Based on a second preset value, the plurality of target feature values ​​are grouped to obtain at least one group;

[0028] If there is a target group in the at least one group that includes at least two target feature values, the corresponding columns in the distance matrix are merged based on the column containing the target feature value in the target group to obtain the target distance matrix.

[0029] According to the face recognition method provided in this application, based on a target distance matrix, a plurality of preset face features are divided to obtain a plurality of face feature libraries, including:

[0030] Based on the elements in the target distance matrix, determine the target variation coefficient corresponding to each column in the target distance matrix;

[0031] Based on the target variation coefficients corresponding to each column, a spatial partitioning matrix corresponding to the plurality of preset face features is determined, wherein the spatial partitioning matrix includes the feature identifiers of each of the plurality of preset face features;

[0032] The multiple preset facial features are divided based on the spatial partitioning matrix to obtain multiple facial feature libraries, wherein at least one preset facial feature in the facial feature library has the same feature identifier.

[0033] According to the face recognition method provided in this application, the method further includes:

[0034] Based on the target coefficient of variation corresponding to each column, the non-dispersed column and dispersed column in the spatial partitioning matrix are determined. The target coefficient of variation corresponding to the non-dispersed column is less than a preset threshold, and the target coefficient of variation corresponding to the dispersed column is greater than or equal to the preset threshold.

[0035] The number of the multiple facial feature databases is determined based on the number of non-dispersed columns and the number of dispersed columns.

[0036] This application also provides a face recognition device, including:

[0037] The first processing unit is used to determine the first feature identifier corresponding to the facial features of the face image to be identified;

[0038] The second processing unit is used to determine the target face feature library corresponding to the target feature identifier that matches the first feature identifier based on the second feature identifier of each of the multiple face feature libraries. The multiple face feature libraries are obtained by merging the columns of the distance matrix based on the multiple feature values ​​corresponding to multiple preset face features, and then dividing the multiple preset face features. The distance matrix is ​​determined based on the multiple preset face features and a set of preset orthogonal bases.

[0039] The third processing unit is used to determine the face recognition result of the face image to be recognized based on the matching degree between the face features and each preset face feature in the target face feature library.

[0040] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the face recognition method as described in any of the preceding claims.

[0041] This application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the face recognition method as described in any of the preceding claims.

[0042] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the face recognition method as described in any of the preceding claims.

[0043] The face recognition method, apparatus, and electronic device provided in this application, when performing face recognition, can first determine the first feature identifier corresponding to the face features of the face image to be recognized; and based on the second feature identifiers of multiple face feature databases, determine the target face feature database corresponding to the target feature identifier that matches the first feature identifier. The multiple face feature databases are obtained by merging the columns of a distance matrix based on multiple feature values ​​corresponding to multiple preset face features, and then dividing the multiple preset face features into a target distance matrix. Finally, based on the matching degree between the face feature and each preset face feature in the target face feature database, determine the face recognition result of the face image to be recognized. In this way, based on the first feature identifier corresponding to the face feature and the second feature identifiers of multiple face feature databases, the target face feature database corresponding to the target feature identifier that matches the first feature identifier can be selected from the pre-divided multiple face feature databases. Based on the matching degree between the face feature and each preset face feature in the target face feature database, determine the face recognition result of the face image to be recognized. Compared with existing technologies, this eliminates the need to traverse a large number of face features, thereby effectively improving face recognition efficiency. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1 A flowchart illustrating a face recognition method provided in an embodiment of this application;

[0046] Figure 2 This is a flowchart illustrating a method for determining a first feature identifier corresponding to facial features in a face image to be identified, provided in an embodiment of this application.

[0047] Figure 3 This is a flowchart illustrating a method for dividing multiple facial feature databases according to an embodiment of this application.

[0048] Figure 4 This is a schematic diagram of the structure of a face recognition device provided in an embodiment of this application;

[0049] Figure 5 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0051] In the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone, where A and B can be singular or plural. In the textual description of this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0052] The technical solutions provided in this application can be applied to face recognition scenarios, such as urban security, public security, or finance. Currently, in face recognition scenarios, the facial features of the extracted face image to be recognized are usually matched with facial features in a pre-built face feature library. However, as the number of facial features stored in the face feature library increases, parallel computing or hardware-accelerated matching is usually required when performing face feature matching. This places high demands on the hardware acceleration unit or computing power of the chip, resulting in high hardware costs. Chips without hardware acceleration units or with low computing power are not suitable. Alternatively, face feature libraries of different sizes need to be established locally and in the cloud to speed up recognition through binary matching. This is not suitable for offline scenarios, and the quality checks of different face feature libraries are not related, limiting the matching efficiency of face features. This leads to low face recognition efficiency.

[0053] To effectively improve the efficiency of face recognition, this application provides a face recognition method. The face recognition method provided in this application will be described in detail below through several specific embodiments. It is understood that these specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0054] Figure 1 This is a flowchart illustrating a face recognition method provided in an embodiment of this application. This method can be executed by software and / or hardware devices. For example, please refer to... Figure 1 As shown, the face recognition method may include:

[0055] S101. Determine the first feature identifier corresponding to the facial features of the face image to be identified.

[0056] The first feature identifier can be used to identify the facial features of the face image to be identified, so as to distinguish other facial features.

[0057] For example, in the embodiments of this application, the first feature identifier can be represented by a one-dimensional vector, for example, it can be [1, 1, 2, 3], or [0, 1, 2, 2], etc., and can be set according to actual needs.

[0058] S102. Based on the second feature identifiers of each of the multiple face feature databases, determine the target face feature database corresponding to the target feature identifier that matches the first feature identifier.

[0059] Among them, multiple face feature libraries are based on multiple feature values ​​corresponding to multiple preset face features. The target distance matrix is ​​obtained by merging the columns in the distance matrix. The distance matrix is ​​obtained by dividing multiple preset face features. The distance matrix is ​​determined based on multiple preset face features and a set of preset orthogonal bases.

[0060] It is understood that, in the embodiments of this application, the second feature identifier can be used to identify a face feature library to distinguish different face feature libraries. The orthonormal basis is determined based on the dimensions of the face features.

[0061] Typically, different face feature databases correspond to different second feature identifiers. For each face feature database, the feature identifier of at least one face feature included in the database is the same, and it is the second feature identifier corresponding to that face feature database.

[0062] For example, in the embodiments of this application, the second feature identifier can be represented by a one-dimensional vector, for example, it can be [0, 1, 2, 3], or [0, 0, 2, 3], etc., and can be set according to actual needs.

[0063] For example, in an embodiment of this application, assuming the dimension of the facial features is n, a pre-defined set of orthogonal bases {e1,e2,...,e...} can be constructed. n Each orthonormal basis is 1 only at its corresponding position, and 0 at all other positions. Where e1 = (1, 0, 0, ..., 0), e2 = (0, 1, 0, ..., 0), ..., e n = (0,0,...,1).

[0064] For example, in the embodiments of this application, the target feature identifier that matches the first feature identifier can be a second feature identifier that is the same as the first feature identifier, or it can be a second feature identifier that is closest to the first feature identifier. The specific setting can be made according to actual needs.

[0065] For example, when the first feature identifier is [1, 1, 2, 3] and the second feature identifier is [0, 1, 2, 3], the spatial distance between the first feature identifier [1, 1, 2, 3] and the second feature identifier [0, 1, 2, 3] can be denoted as 1; when the first feature identifier is [0, 1, 2, 2] and the second feature identifier is [0, 1, 2, 3], the spatial distance between the first feature identifier [0, 1, 2, 2] and the second feature identifier [0, 1, 2, 3] can be denoted as... 1; When the first feature identifier is [0, 1, 2, 2] and the second feature identifier is [0, 0, 2, 3], the spatial distance between the first feature identifier [0, 1, 2, 2] and the second feature identifier [0, 0, 2, 3] can be recorded as 2; When the first feature identifier is [0, 1, 2, 2] and the second feature identifier is [0, 0, 3, 3], the spatial distance between the first feature identifier [0, 1, 2, 2] and the second feature identifier [0, 0, 3, 3] can be recorded as 3.

[0066] For example, in this embodiment of the application, assuming that the number of all preset face features is m and the dimension of the face features is n, the distance matrix determined based on multiple preset face features and a preset set of orthogonal bases can be denoted as T. m×n For the distance matrix T m×n The columns in the matrix are merged, and the merged distance matrix can be denoted as matrix T. m×l .

[0067] Wherein, the merged distance matrix T m×l Each row of elements in the array represents a facial feature, and each column of elements represents the distance after merging the corresponding dimensions.

[0068] In the above situation, the second feature identifier with the smallest spatial distance from the first feature identifier among the second feature identifiers of multiple face feature databases can be determined as the second feature identifier that is closest to the first feature identifier.

[0069] After determining the target feature identifier that matches the first feature identifier, the face feature library corresponding to the target feature identifier can be determined as the target face feature library, and the following S103 can be executed:

[0070] S103. Based on the matching degree between the facial features and each preset facial feature in the target facial feature library, determine the facial recognition result of the face image to be recognized.

[0071] When matching a facial feature with each preset facial feature in the target facial feature database, a matching degree will be obtained for each preset facial feature, resulting in multiple matching degrees.

[0072] Generally, the higher the matching score, the higher the similarity between the facial feature and the corresponding preset facial feature; the lower the matching score, the lower the similarity between the facial feature and the corresponding preset facial feature.

[0073] For example, when determining the matching degree between a facial feature and a preset facial feature, one can calculate the cosine distance between the facial feature and the preset facial feature, and determine the matching degree based on the calculated cosine distance; alternatively, one can calculate the Euclidean distance between the facial feature and the preset facial feature, and determine the matching degree based on the calculated Euclidean distance, etc. The specific settings can be configured according to actual needs.

[0074] After determining the matching degree between the facial features and each preset facial feature in the target facial feature database, the facial recognition result of the face image to be recognized can be determined based on the matching degree between the facial features and each preset facial feature in the target facial feature database.

[0075] As can be seen, in this embodiment, when performing face recognition, a first feature identifier corresponding to the face features of the face image to be recognized can be determined first; and based on the second feature identifiers of multiple face feature libraries, a target face feature library corresponding to the target feature identifier that matches the first feature identifier is determined. These multiple face feature libraries are obtained by merging columns in a distance matrix based on multiple feature values ​​corresponding to multiple preset face features, and then dividing the multiple preset face features into a target distance matrix. Finally, based on the matching degree between the face feature and each preset face feature in the target face feature library, the face recognition result of the face image to be recognized is determined. In this way, based on the first feature identifier corresponding to the face feature and the second feature identifiers of multiple face feature libraries, the target face feature library corresponding to the target feature identifier that matches the first feature identifier can be selected from the pre-divided multiple face feature libraries. Based on the matching degree between the face feature and each preset face feature in the target face feature library, the face recognition result of the face image to be recognized is determined. Compared with existing technologies, this eliminates the need to traverse a large number of face features, thereby effectively improving face recognition efficiency.

[0076] Based on the above Figure 1 The embodiment shown illustrates how the first feature identifier corresponding to the facial features of the face image to be identified is determined in S101 above. The following will explain this process. Figure 2 The embodiments shown are described in detail below.

[0077] Figure 2 This is a flowchart illustrating a method for determining a first feature identifier corresponding to facial features in a face image to be identified, provided in an embodiment of this application. This method can also be executed by software and / or hardware devices. For example, please refer to... Figure 2 As shown, the method may include:

[0078] S201. Based on facial features and orthogonal basis, determine the distance vector corresponding to the facial features.

[0079] For example, in an embodiment of this application, when determining the distance vector corresponding to a face feature based on the face feature and the orthonormal basis, the cosine distance between the face feature and the orthonormal basis can be calculated, and the distance vector corresponding to the face feature can be determined based on the calculated cosine distance.

[0080] For example, in the embodiments of this application, the facial feature can be denoted as u, and the orthonormal basis can be denoted as {e1, e2, ..., e}. n}, based on facial features u and orthogonal basis {e1, e2, ..., e n The cosine distance between} can be used to obtain the distance vector corresponding to the face features, which can be denoted as s = (s1, s2, ..., s...). n ).

[0081] After determining the distance vector corresponding to the facial features, the following step S202 can be executed:

[0082] S202. Based on the operation of merging the columns of the distance matrix, the columns of the distance vector are merged to obtain the merged distance vector.

[0083] For example, in an embodiment of this application, it can be based on the distance matrix T m×n The columns in the distance vector s = (s1, s2, ..., s3) are merged. n Merge the columns in the distance matrix T. For example, merge the columns in the distance matrix T. m×n If the first and third columns of the distance vector s are merged, then the first and third columns of the distance vector s are also merged; for the distance matrix T m×n If the second, fourth, and fifth columns in the vector s are merged, then the second, fourth, and fifth columns in the distance vector s are also merged.

[0084] It should be noted that how to merge the columns of the distance matrix will be described in detail later; please refer to the following for details. Figure 3 The embodiments shown will not be described in detail here.

[0085] S203. Determine the first feature identifier based on the merged distance vector.

[0086] For example, in the embodiments of this application, when determining the first feature identifier based on the merged distance vector, the coefficient of variation corresponding to the column where each element value is located can be determined first, and the type corresponding to the column where each element value is located can be determined based on the coefficient of variation corresponding to the column where each element value is located, and then the first feature identifier can be determined based on each element value and the type corresponding to the column.

[0087] It is understood that, in the embodiments of this application, when determining the coefficient of variation corresponding to the column where each element value is located, the target coefficient of variation corresponding to each column in the merged target distance matrix involved in dividing multiple face feature databases can be reused. The specific details will be described in detail later when introducing how to divide multiple face feature databases.

[0088] For example, in this embodiment of the application, when determining the type corresponding to the column where the element value is located based on the coefficient of variation corresponding to the column where the element value is located, it can be determined whether the coefficient of variation corresponding to the column where the element value is located is less than a preset threshold, such as 0.25. If the coefficient of variation corresponding to the column where the element value is located is less than 0.25, then the type corresponding to the column where the element value is located is determined to be a non-dispersive type; if the coefficient of variation corresponding to the column where the element value is located is greater than or equal to 0.25, then the type corresponding to the column where the element value is located is determined to be a dispersed type.

[0089] For example, in this embodiment of the application, when determining the first feature identifier based on each element value and the type corresponding to its column, for each element value, if the type corresponding to the column of the element value is a non-dispersive type, the element value can be compared with the median of its column. If the element value is less than the median of its column, the identifier value corresponding to the element value is 0; if the element value is greater than or equal to the median of its column, the identifier value corresponding to the element value is 1, so as to determine the identifier value corresponding to the column of each element value. The identifier value corresponding to the column of each element value can constitute the first feature identifier corresponding to the facial features of the face image to be identified.

[0090] If the column containing an element value corresponds to a scatter type, the element value can be compared with the quartiles of that column. If the element value is less than the first quartile of its column, the identifier value is 0; if the element value is greater than or equal to the first quartile of its column and less than the median of the column, the identifier value is 1; if the element value is greater than or equal to the median of its column and less than the third quartile of its column, the identifier value is 2; if the element value is greater than or equal to the third quartile of its column, the identifier value is 3. This process determines the identifier value for each element value, which can constitute the first feature identifier corresponding to the facial features of the face image to be identified.

[0091] It should be noted that the median and quartile of the column containing the element value can be reused from the median and quartile of each column in the merged distance matrix involved in dividing multiple face feature databases. This will be described in detail later when we introduce how to divide multiple face feature databases.

[0092] As can be seen, in this embodiment of the application, when determining the first feature identifier corresponding to the facial features of the face image to be identified, the distance vector corresponding to the facial features can be determined first based on the facial features and the orthogonal basis; and based on the operation of merging the columns of the distance matrix, the columns in the distance vector are merged to obtain the merged distance vector; and based on the merged distance vector, the first feature identifier is determined. In this way, the determined first feature identifier can be used as the basis for subsequent face recognition, and the target face feature library corresponding to the target feature identifier that matches the first feature identifier can be selected from multiple face feature libraries. Based on the matching degree between the facial features and each preset facial feature in the target face feature library, the face recognition result of the face image to be identified is determined.

[0093] For example, in this embodiment of the application, when determining the target face feature library corresponding to the target feature library that matches the first feature library based on the second feature identifiers of the respective multiple face feature libraries, the first feature library can be matched with the second feature identifiers of the respective multiple face feature libraries to determine whether there is a second feature identifier that is the same as the first feature identifier. This includes at least two possible scenarios:

[0094] In one possible scenario, if a second feature identifier that is identical to the first feature identifier exists, the second feature identifier that is identical to the first feature identifier can be identified as the target feature identifier, and the face feature library corresponding to the target feature identifier is the target face feature library.

[0095] In this scenario, when determining the face recognition result of the image to be recognized based on the matching degree between the facial features and each preset facial feature in the target facial feature library, the matching degree between the facial features and each preset facial feature in the target facial feature library can be determined separately to obtain multiple matching degrees. It is then determined whether the maximum matching degree among these multiple matching degrees is greater than or equal to a first matching threshold. If the maximum matching degree is greater than or equal to the first matching threshold, the preset facial feature corresponding to the maximum matching degree can be identified as the face recognition result, thus obtaining the face recognition result of the image to be recognized. The value of the first matching threshold can be set according to actual needs.

[0096] If the maximum matching degree is less than the first matching threshold, the first face feature library corresponding to the second feature identifier that is closest to the first feature identifier is further determined, and the face recognition result is determined based on the maximum matching degree and the matching degree between the face feature and each preset face feature in the first face feature library.

[0097] For example, in this embodiment of the application, when determining the face recognition result based on the maximum matching degree and the matching degree between the face feature and each preset face feature in the first face feature library, the matching degree between the face feature and each preset face feature in the first face feature library can be determined separately to obtain multiple target matching degrees. The maximum target matching degree and the maximum value among the multiple target matching degrees are then determined, and it is determined whether the maximum value is greater than or equal to a second matching threshold. If the maximum value is greater than or equal to the second matching threshold, the preset face feature corresponding to the maximum value can be determined as the face recognition result, thereby obtaining the face recognition result of the face image to be recognized. The value of the second matching threshold can be set according to actual needs.

[0098] If the maximum value is less than the second matching threshold, then multiple face feature databases are traversed, and the face recognition result is determined based on the matching degree between the face feature and each preset face feature in the multiple face feature databases.

[0099] For example, in the embodiments of this application, the value of the second matching threshold can be less than the first matching threshold. The first matching threshold can be understood as a relatively strict matching threshold, while the second matching threshold can be understood as a retrieval standard in a normal face recognition scenario, which is usually calculated from the false recognition rate.

[0100] In another possible scenario, if there is no second feature identifier that is identical to the first feature identifier, the second feature identifier that is closest to the first feature identifier can be identified as the target feature identifier. The face feature library corresponding to the target feature identifier is the target face feature library, which is the first face feature library corresponding to the second feature identifier that is closest to the first feature identifier.

[0101] In this case, when determining the face recognition result of the face image to be recognized based on the matching degree between the face features and each preset face feature in the target face feature library, the matching degree between the face features and each preset face feature in the target face feature library can be determined separately to obtain multiple target matching degrees. It is then determined whether the maximum target matching degree among the multiple target matching degrees is greater than or equal to the second matching threshold. If the maximum target matching degree is greater than or equal to the second matching threshold, the preset face feature corresponding to the maximum target matching degree can be determined as the face recognition result, thereby obtaining the face recognition result of the face image to be recognized.

[0102] If the maximum target matching degree is less than the second matching threshold, multiple face feature databases are traversed, and the face recognition result is determined based on the matching degree between the face feature and each preset face feature in the multiple face feature databases.

[0103] As can be seen from the above description, in this embodiment of the application, when performing face recognition, the first feature identifier corresponding to the face features of the face image to be recognized can be determined first, and the target face feature library corresponding to the target feature identifier that matches the first feature identifier can be selected from multiple face feature libraries. Based on the matching degree between the face features and each preset face feature in the target face feature library, the face recognition result of the face image to be recognized can be determined. Compared with the prior art, it is not necessary to traverse a large number of face features, thereby effectively improving the efficiency of face recognition.

[0104] Based on any of the above embodiments, multiple face feature databases can be understood as a target distance matrix obtained by merging the columns of a distance matrix based on multiple feature values ​​corresponding to multiple preset face features, and then dividing the multiple preset face features. For example, in this embodiment, for each face feature database, the feature identifier corresponding to each preset face feature in the face feature database is the same, which is the second feature identifier of that face feature database.

[0105] The following will be done through the following Figure 3The illustrated embodiment provides a detailed description of how to divide multiple facial feature databases.

[0106] Figure 3 This application provides a flowchart illustrating a method for dividing multiple facial feature databases. For example, see [link to relevant documentation]. Figure 3 As shown, the method may include:

[0107] S301. Based on multiple feature values ​​corresponding to multiple preset facial features, merge the columns in the distance matrix to obtain the target distance matrix.

[0108] The distance matrix is ​​determined based on multiple preset facial features and a set of preset orthogonal bases.

[0109] For example, assuming there are m preset facial features and n dimensions for each feature, we can construct an orthonormal basis {e1, e2, ..., e...} n Each orthonormal basis is 1 only at its corresponding position, and 0 at all other positions. Where e1 = (1, 0, 0, ..., 0), e2 = (0, 1, 0, ..., 0), ..., e n = (0, 0, ..., 1).

[0110] For example, in the embodiments of this application, when determining the distance matrix based on multiple preset face features and orthogonal basis, the cosine distance between the multiple preset face features and orthogonal basis can be calculated, and the distance matrix corresponding to the multiple preset face features can be determined based on the calculated cosine distance.

[0111] For example, in the embodiments of this application, multiple preset facial features can be denoted as v, and the orthonormal basis can be denoted as {e1, e2, ..., e}. n}, based on multiple preset facial features v and orthogonal basis {e1, e2, ..., e n The cosine distance between}, the distance matrix corresponding to multiple preset face features obtained can be denoted as T. m×n .

[0112] For example, in this embodiment of the application, when merging columns in a distance matrix based on multiple feature values ​​corresponding to multiple preset facial features, multiple feature values ​​corresponding to multiple preset facial features can be determined first, and each feature value can be normalized based on the sum of the multiple feature values ​​to obtain normalized feature values; from the multiple normalized feature values, multiple target feature values ​​arranged in descending order can be determined, and the sum of the multiple target feature values ​​is greater than or equal to a first preset value; the multiple target feature values ​​can be grouped based on a second preset value to obtain at least one group; if there is a target group including at least two target feature values ​​in the at least one group, the corresponding columns in the distance matrix can be merged based on the column where the target feature value in the target group is located to obtain a merged target distance matrix.

[0113] The values ​​of the first and second preset values ​​can be set according to actual needs.

[0114] For example, the first preset value can be denoted as x, and the value of x is generally 0.8 or 0.9, which represents the selection of feature values ​​with greater influence. This can eliminate redundant feature values, thereby reducing the amount of calculation and improving the accuracy of subsequent merging.

[0115] For example, the second preset value can be represented by x / L. The value of L is related to factors such as the number of feature values, feature dimensions, feature extraction model, and device computing power. The value of L is generally 4, 6, 8, etc. The larger the value of L, the more groups are divided in the subsequent division, and the greater the acceleration rate of feature retrieval. If the division is too fine, it may lead to a decrease in recognition rate. Therefore, the value of L should not be too large. Generally, the preferred value of L is a small value of 4.

[0116] For example, in this embodiment of the application, when determining multiple feature values ​​corresponding to multiple preset facial features, it is assumed that the multiple preset facial features can be obtained through feature matrix D. m×n It is represented that, where the characteristic matrix D m×n Each row of elements in the matrix represents an n-dimensional preset face feature of a preset face image. Therefore, the feature matrix D can be calculated first. m×n The covariance matrix can be denoted as C n×n And for the covariance matrix C n×n Feature decomposition is performed to obtain multiple feature values ​​corresponding to multiple preset facial features, which can be denoted as v = (v1, v2, v3, ..., v...). n ).

[0117] Suppose that multiple preset facial features correspond to multiple feature values ​​v = (v1, v2, v3, ..., v...). n For multiple preset facial features, multiple feature values ​​v = (v1, v2, v3, ..., v) are given. nWhen performing normalization, please refer to Formula 1 below:

[0118]

[0119] Where, v′ j Represents the eigenvalue v j The normalized eigenvalues, where V represents the sum of multiple eigenvalues, i.e. The normalized eigenvalues ​​of multiple eigenvalues ​​v can be denoted as v′, and v′=(v′1, v′2, ..., v′) n ).

[0120] For example, when determining multiple target feature values ​​arranged in descending order from multiple normalized feature values, assuming the first preset value x is 0.8, and the multiple normalized feature values ​​v′=(0.1, 0.05, 0.03, 0.02, 0.23, 0.15, 0.2, 0.04, 0.01, 0.06, 0.09), then the multiple target feature values ​​determined from the multiple normalized feature values ​​arranged in descending order can be 0.23, 0.2, 0.15, 0.1, 0.09, and 0.06. The sum of these six target feature values ​​is greater than the first preset value 0.8.

[0121] For example, when multiple target feature values ​​are grouped based on a second preset value to obtain at least one group, assuming the first preset value x is 0.8 and l is 4, the second preset value is 0.2. Correspondingly, based on the second preset value 0.2, multiple target feature values ​​0.23, 0.2, 0.15, 0.1, 0.09 and 0.06 are grouped, and the resulting groups are group [0.23], group [0.2], group [0.15, 0.1], and group [0.09, 0.06], respectively.

[0122] For the four groups mentioned above, the target group [0.15, 0.1] and the target group [0.09, 0.06] both include two target feature values. Therefore, based on the two target feature values ​​included in the target group [0.15, 0.1], the distance matrix T can be... m×n The corresponding columns in the matrix are merged, and based on the two target feature values ​​included in the target group [0.09, 0.06], the distance matrix T is adjusted. m×n The corresponding columns are merged to obtain the merged target distance matrix. For example, in this embodiment, the target distance matrix can be denoted as matrix T. m×l .

[0123] Wherein, the target distance matrix T m×l Each row of elements in the array represents a facial feature, and each column of elements represents the distance after merging the corresponding dimensions.

[0124] After obtaining the merged target distance matrix, the multiple preset facial features can be segmented based on the target distance matrix, i.e., the following steps S302-S304 are executed:

[0125] S302. Based on the elements in the target distance matrix, determine the target variation coefficient corresponding to each column in the target distance matrix.

[0126] For example, when determining the target variation coefficient corresponding to each column in the target distance matrix, for the k-th column in the target distance matrix, the target variation coefficient corresponding to the k-th column can be determined based on the following formulas 2, 3 and 4.

[0127]

[0128]

[0129]

[0130] Among them, cv k σ represents the target coefficient of variation corresponding to the k-th column. k μ represents the standard deviation corresponding to the k-th column. k Let α represent the mean of the k-th column. (i,k) Represents the target distance matrix T m×l The element corresponding to the i-th row and k-th column.

[0131] Based on the above formulas 2, 3, and 4, the target distance matrix T is determined. m×l After determining the target coefficient of variation for each column, the following S304 can be executed:

[0132] S303. Based on the target variation coefficients corresponding to each column, determine the spatial partitioning matrix corresponding to multiple preset facial features.

[0133] The spatial partitioning matrix includes the feature identifiers of multiple preset facial features.

[0134] For example, in the embodiments of this application, when determining the spatial partitioning matrix corresponding to multiple preset facial features based on the target coefficient of variation corresponding to each column, for each column, the type corresponding to that column can be determined based on the target coefficient of variation corresponding to that column. The type includes a dispersed type or a non-dispersed type. And based on the element values ​​in each column and the corresponding type, the spatial partitioning matrix corresponding to multiple preset facial features is determined.

[0135] For example, in this embodiment of the application, when determining the type of a column based on the target coefficient of variation corresponding to the column, it can be determined whether the target coefficient of variation corresponding to the column is less than a preset threshold, such as 0.25. If the target coefficient of variation corresponding to the column is less than 0.25, then the type of the column is determined to be a non-dispersive type; if the target coefficient of variation corresponding to the column is greater than or equal to 0.25, then the type of the column is determined to be a dispersed type. In this way, determining the type of each column based on the target coefficient of variation helps to distinguish certain abnormal columns, thereby effectively improving the segmentation accuracy of multiple face feature databases.

[0136] For example, in the embodiments of this application, when determining the spatial partitioning matrix corresponding to multiple preset face features based on the element values ​​and corresponding types in each column, for each column in the target distance matrix, the corresponding identifier value of the column can be determined according to the element values ​​and corresponding types in that column, and the identifier values ​​corresponding to each column can constitute the spatial partitioning matrix corresponding to multiple preset face features.

[0137] For example, when determining the identifier value corresponding to a column based on the element values ​​and their corresponding types, if the type corresponding to the column is a non-dispersive type, each element value in the column can be compared with the median of the column. If the element value is less than the median of the column, the identifier value corresponding to the element value is 0; if the element value is greater than or equal to the median of the column, the identifier value corresponding to the element value is 1, thus determining the identifier value corresponding to the column. The identifier values ​​corresponding to each column can form a spatial partitioning matrix corresponding to multiple preset facial features.

[0138] If the type corresponding to the column is a scatter type, then each element value in the column can be compared with the quartile of the column. If the element value is less than the first quartile of the column, the corresponding identifier value is 0; if the element value is greater than or equal to the first quartile of the column and less than the median of the column, the corresponding identifier value is 1; if the element value is greater than or equal to the median of the column and less than the third quartile of the column, the corresponding identifier value is 2; if the element value is greater than or equal to the third quartile of the column, the corresponding identifier value is 3, thus determining the identifier value corresponding to the column. The identifier values ​​corresponding to each column can form a spatial partitioning matrix corresponding to multiple preset facial features.

[0139] After determining the identifier value corresponding to each column, a spatial partitioning matrix corresponding to multiple preset facial features can be obtained based on the identifier value of each column. For example, in this embodiment, the spatial partitioning matrix can be denoted as R. m×l R m×l The element values ​​in the table have no actual meaning; they are only used to identify and distinguish different preset facial features.

[0140] S304. Divide multiple preset facial features based on the spatial partitioning matrix to obtain multiple facial feature libraries.

[0141] Among them, at least one preset facial feature in the facial feature database has the same feature identifier.

[0142] For example, in this embodiment of the application, when multiple preset facial features are divided based on a spatial partitioning matrix to obtain multiple facial feature libraries, the preset facial features corresponding to the same row in the spatial partitioning matrix can be assigned to the same facial feature library. This allows all preset facial features to be divided into 2... p+2q A personal facial feature database, where p represents the number of non-dispersed columns in the merged distance matrix and q represents the number of dispersed columns in the merged distance matrix, i.e., the number of multiple facial feature databases, is determined based on the number of non-dispersed columns and the number of dispersed columns.

[0143] As can be seen in this embodiment, when dividing multiple face feature libraries, the columns in the distance matrix can be merged based on the multiple feature values ​​corresponding to multiple preset face features to obtain a target distance matrix; based on the elements in the target distance matrix, the target variation coefficients corresponding to each column in the target distance matrix are determined; based on the target variation coefficients corresponding to each column, the spatial partitioning matrix corresponding to multiple preset face features is determined; based on the spatial partitioning matrix, the multiple preset face features are divided to divide the high-dimensional feature space into multiple sub-feature spaces to form corresponding face feature libraries, thus obtaining multiple face feature libraries. In this way, based on the spatial partitioning matrix, the multiple preset face features are divided into multiple sub-feature spaces to form corresponding face feature libraries. Multiple preset facial features are divided into multiple facial feature libraries. The preset facial features in each facial feature library are more correlated than the facial features in randomly divided facial sub-libraries. The distance between each pair of facial feature libraries is determined, so that when performing facial recognition, the target facial feature library that matches the first feature identifier corresponding to the facial features of the face image to be recognized can be selected from multiple facial feature libraries. Based on the matching degree between the facial features and each preset facial feature in the target facial feature library, the facial recognition result of the face image to be recognized is determined, without having to traverse a large number of facial features, thereby effectively improving the efficiency of facial recognition.

[0144] It is understandable that, when dividing multiple facial feature databases, if the number of preset facial features in a certain facial feature database exceeds a first preset proportion of the total number of all preset facial features, then the value of L can be incremented by 1, and based on the above... Figure 3 In the embodiment shown, all preset facial features are re-divided until the number of preset facial features in the resulting multiple facial features does not exceed a first preset proportion of the total number of all preset facial features.

[0145] The value of the first preset ratio can be set according to actual needs. For example, in this embodiment, the first preset ratio can be 50% or 49%, which can be set according to actual needs.

[0146] For example, in this embodiment of the application, when a new preset facial feature is added, if the new preset facial feature exceeds the second preset ratio of the total number of all current preset facial features, then based on the above... Figure 3 In the illustrated embodiment, all preset facial features are reclassified. If the new preset facial feature does not exceed a second preset proportion of the current number of all preset facial features, then the identifier value corresponding to the new preset facial feature can be calculated, and based on the identifier value corresponding to the new preset facial feature, the new preset facial feature is assigned to the corresponding facial feature database.

[0147] The value of the second preset ratio can be set according to actual needs. For example, it can be adjusted appropriately based on the quality and size of the face image corresponding to the new preset facial features. For instance, in this embodiment, the second preset ratio can be 10% or 11%, depending on actual needs. Furthermore, in this embodiment, if the extraction network used to extract the preset facial features changes, all preset facial features can be re-extracted based on the new extraction network, and based on the above... Figure 3 The embodiment shown reclassifies all preset facial features. Through the above-described update method, the classification accuracy of multiple facial feature databases can be further improved.

[0148] The face recognition device provided in this application is described below. The face recognition device described below can be referred to in correspondence with the face recognition method described above.

[0149] Figure 4 This is a schematic diagram of the structure of a face recognition device provided in an embodiment of this application. For example, please refer to [link / reference]. Figure 4 As shown, the face recognition device 40 may include:

[0150] The first processing unit 401 is used to determine the first feature identifier corresponding to the facial features of the face image to be identified;

[0151] The second processing unit 402 is used to determine the target face feature library corresponding to the target feature identifier that matches the first feature identifier based on the second feature identifier of each of the multiple face feature libraries. The multiple face feature libraries are obtained by merging the columns of the distance matrix based on the multiple feature values ​​corresponding to multiple preset face features, and then dividing the multiple preset face features. The distance matrix is ​​determined based on the multiple preset face features and a set of preset orthogonal bases.

[0152] The third processing unit 403 is used to determine the face recognition result of the face image to be recognized based on the matching degree between the face features and each preset face feature in the target face feature library.

[0153] For example, in this embodiment of the application, the first processing unit 401 is used to determine a first feature identifier corresponding to the facial features of the face image to be identified, including:

[0154] Based on the facial features and the orthogonal basis, determine the distance vector corresponding to the facial features;

[0155] Based on the operation of merging the columns of the distance matrix, the columns of the distance vector are merged to obtain the merged distance vector;

[0156] The first feature identifier is determined based on the merged distance vector.

[0157] For example, in an embodiment of this application, the first processing unit 401 is configured to determine the first feature identifier based on the merged distance vector, including:

[0158] For each element value in the merged distance vector, the type corresponding to the column where the element value is located is determined based on the coefficient of variation. The type includes a dispersed type or a non-dispersed type.

[0159] The first feature identifier is determined based on the type corresponding to the column where each element value is located.

[0160] For example, in an embodiment of this application, the second processing unit 402 is configured to determine, based on the second feature identifiers of multiple face feature databases, a target face feature database corresponding to a target feature identifier that matches the first feature identifier, including:

[0161] Based on the second feature identifiers of the multiple face feature databases, if there is a second feature identifier that is the same as the first feature identifier, the second feature identifier that is the same as the first feature identifier is determined as the target feature identifier;

[0162] If no second feature identifier is identical to the first feature identifier, the second feature identifier that is closest to the first feature identifier is determined as the target feature identifier;

[0163] The facial feature library corresponding to the target feature identifier is the target facial feature library.

[0164] For example, in this embodiment of the application, when the target feature identifier is a second feature identifier that is the same as the first feature identifier, the second processing unit 402 is used to determine the face recognition result of the face image to be recognized based on the matching degree between the face feature and each preset face feature in the target face feature library, including:

[0165] Determine whether the maximum matching degree in the matching degree is greater than or equal to the first matching threshold;

[0166] If the maximum matching degree is greater than or equal to the first matching threshold, the preset facial feature corresponding to the maximum matching degree is determined as the facial recognition result.

[0167] If the maximum matching degree is less than the first matching threshold, the face recognition result is determined based on the maximum matching degree and the matching degree between the face feature and each preset face feature in the first face feature library. The first face feature library is the face feature library corresponding to the second feature identifier that is closest to the first feature identifier.

[0168] For example, in this embodiment of the application, based on multiple feature values ​​corresponding to multiple preset facial features, the columns in the distance matrix are merged to obtain a target distance matrix, including:

[0169] The sum of the multiple eigenvalues ​​is used to normalize each eigenvalue to obtain the normalized eigenvalues.

[0170] From multiple normalized feature values, determine multiple target feature values ​​arranged in descending order, wherein the sum of the multiple target feature values ​​is greater than or equal to a first preset value;

[0171] Based on a second preset value, the plurality of target feature values ​​are grouped to obtain at least one group;

[0172] If there is a target group in the at least one group that includes at least two target feature values, the corresponding columns in the distance matrix are merged based on the column containing the target feature value in the target group to obtain the target distance matrix.

[0173] For example, in this embodiment of the application, based on the target distance matrix, the plurality of preset facial features are divided to obtain the plurality of facial feature libraries, including:

[0174] Based on the elements in the target distance matrix, determine the target variation coefficient corresponding to each column in the target distance matrix;

[0175] Based on the target variation coefficients corresponding to each column, a spatial partitioning matrix corresponding to the plurality of preset face features is determined, wherein the spatial partitioning matrix includes the feature identifiers of each of the plurality of preset face features;

[0176] The multiple preset facial features are divided based on the spatial partitioning matrix to obtain multiple facial feature libraries, wherein at least one preset facial feature in the facial feature library has the same feature identifier.

[0177] For example, in an embodiment of this application, the face recognition device 40 further includes:

[0178] The fourth processing unit is used to determine the non-dispersed columns and dispersed columns in the spatial partitioning matrix based on the target coefficient of variation corresponding to each column, wherein the target coefficient of variation corresponding to the non-dispersed column is less than a preset threshold, and the target coefficient of variation corresponding to the dispersed column is greater than or equal to the preset threshold.

[0179] The number of the multiple facial feature databases is determined based on the number of non-dispersed columns and the number of dispersed columns.

[0180] The face recognition device 40 provided in this application embodiment can execute the technical solution of the face recognition method in any of the above embodiments. Its implementation principle and beneficial effects are similar to those of the face recognition method. Please refer to the implementation principle and beneficial effects of the face recognition method. It will not be repeated here.

[0181] Figure 5 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of this application, such as... Figure 5As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute the above-described face recognition method. The method includes: determining a first feature identifier corresponding to the face features of the face image to be recognized; determining a target face feature library corresponding to a target feature identifier that matches the first feature identifier based on the second feature identifiers of multiple face feature libraries, wherein the multiple face feature libraries are obtained by merging the columns of a distance matrix based on multiple feature values ​​corresponding to multiple preset face features, and dividing the multiple preset face features into a target distance matrix, wherein the distance matrix is ​​determined based on the multiple preset face features and a set of preset orthonormal bases; and determining the face recognition result of the face image to be recognized based on the matching degree between the face features and each preset face feature in the target face feature library.

[0182] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0183] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the above-described face recognition method. The method includes: determining a first feature identifier corresponding to the face features of a face image to be recognized; determining a target face feature library corresponding to a target feature identifier that matches the first feature identifier based on the second feature identifiers of multiple face feature libraries, wherein the multiple face feature libraries are obtained by merging the columns of a distance matrix based on multiple feature values ​​corresponding to multiple preset face features, and dividing the multiple preset face features into a target distance matrix, wherein the distance matrix is ​​determined based on the multiple preset face features and a set of preset orthonormal bases; and determining the face recognition result of the face image to be recognized based on the matching degree between the face features and each preset face feature in the target face feature library.

[0184] In another aspect, this application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the above-described face recognition method. The method includes: determining a first feature identifier corresponding to a face feature of a face image to be recognized; determining a target face feature library corresponding to a target feature identifier matching the first feature identifier based on second feature identifiers of multiple face feature libraries, wherein the multiple face feature libraries are obtained by merging columns in a distance matrix based on multiple feature values ​​corresponding to multiple preset face features, and the distance matrix is ​​obtained by dividing the multiple preset face features, wherein the distance matrix is ​​determined based on the multiple preset face features and a preset set of orthonormal bases; and determining a face recognition result of the face image to be recognized based on the matching degree between the face feature and each preset face feature in the target face feature library.

[0185] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0186] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0187] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A face recognition method, characterized in that, include: Determine the first feature identifier corresponding to the facial features of the face image to be identified; Based on the second feature identifiers of each of the multiple face feature databases, a target face feature database corresponding to the target feature identifier that matches the first feature identifier is determined. The multiple face feature databases are obtained by merging the columns of the distance matrix based on multiple feature values ​​corresponding to multiple preset face features, and the multiple preset face features are divided into a target distance matrix. The distance matrix is ​​determined based on the multiple preset face features and a set of preset orthonormal bases. Based on the matching degree between the facial features and each preset facial feature in the target facial feature library, the facial recognition result of the face image to be recognized is determined.

2. The method according to claim 1, characterized in that, The first feature identifier corresponding to the facial features of the face image to be identified includes: Based on the facial features and the orthogonal basis, determine the distance vector corresponding to the facial features; Based on the operation of merging the columns of the distance matrix, the columns of the distance vector are merged to obtain the merged distance vector; The first feature identifier is determined based on the merged distance vector.

3. The method according to claim 2, characterized in that, Determining the first feature identifier based on the merged distance vector includes: For each element value in the merged distance vector, the type corresponding to the column where the element value is located is determined based on the coefficient of variation. The type includes a dispersed type or a non-dispersed type. The first feature identifier is determined based on the type corresponding to the column where each element value is located.

4. The method according to any one of claims 1-3, characterized in that, The step of determining the target face feature library corresponding to the target feature identifier that matches the first feature identifier based on the second feature identifier of each of multiple face feature libraries includes: Based on the second feature identifiers of the multiple face feature databases, if there is a second feature identifier that is the same as the first feature identifier, the second feature identifier that is the same as the first feature identifier is determined as the target feature identifier; If no second feature identifier is identical to the first feature identifier, the second feature identifier that is closest to the first feature identifier is determined as the target feature identifier; The facial feature library corresponding to the target feature identifier is the target facial feature library.

5. The method according to claim 4, characterized in that, When the target feature identifier is a second feature identifier that is the same as the first feature identifier, determining the face recognition result of the face image to be recognized based on the matching degree between the face feature and each preset face feature in the target face feature library includes: Determine whether the maximum matching degree in the matching degree is greater than or equal to the first matching threshold; If the maximum matching degree is greater than or equal to the first matching threshold, the preset facial feature corresponding to the maximum matching degree is determined as the facial recognition result. If the maximum matching degree is less than the first matching threshold, the face recognition result is determined based on the maximum matching degree and the matching degree between the face feature and each preset face feature in the first face feature library. The first face feature library is the face feature library corresponding to the second feature identifier that is closest to the first feature identifier.

6. The method according to any one of claims 1-3, characterized in that, Based on multiple feature values ​​corresponding to multiple preset facial features, the columns in the distance matrix are merged to obtain the target distance matrix, including: The sum of the multiple eigenvalues ​​is used to normalize each eigenvalue to obtain the normalized eigenvalues. From multiple normalized feature values, determine multiple target feature values ​​arranged in descending order, wherein the sum of the multiple target feature values ​​is greater than or equal to a first preset value; Based on a second preset value, the plurality of target feature values ​​are grouped to obtain at least one group; If there is a target group in the at least one group that includes at least two target feature values, the corresponding columns in the distance matrix are merged based on the column containing the target feature value in the target group to obtain the target distance matrix.

7. The method according to any one of claims 1-3, characterized in that, Based on the target distance matrix, the multiple preset facial features are divided to obtain the multiple facial feature libraries, including: Based on the elements in the target distance matrix, determine the target variation coefficient corresponding to each column in the target distance matrix; Based on the target variation coefficients corresponding to each column, a spatial partitioning matrix corresponding to the plurality of preset face features is determined, wherein the spatial partitioning matrix includes the feature identifiers of each of the plurality of preset face features; The multiple preset facial features are divided based on the spatial partitioning matrix to obtain multiple facial feature libraries, wherein at least one preset facial feature in the facial feature library has the same feature identifier.

8. The method according to claim 7, characterized in that, The method further includes: Based on the target coefficient of variation corresponding to each column, the non-dispersed column and dispersed column in the spatial partitioning matrix are determined. The target coefficient of variation corresponding to the non-dispersed column is less than a preset threshold, and the target coefficient of variation corresponding to the dispersed column is greater than or equal to the preset threshold. The number of the multiple facial feature databases is determined based on the number of non-dispersed columns and the number of dispersed columns.

9. A face recognition device, characterized in that, include: The first processing unit is used to determine the first feature identifier corresponding to the facial features of the face image to be identified; The second processing unit is used to determine the target face feature library corresponding to the target feature identifier that matches the first feature identifier based on the second feature identifier of each of the multiple face feature libraries. The multiple face feature libraries are obtained by merging the columns of the distance matrix based on the multiple feature values ​​corresponding to multiple preset face features, and then dividing the multiple preset face features. The distance matrix is ​​determined based on the multiple preset face features and a set of preset orthogonal bases. The third processing unit is used to determine the face recognition result of the face image to be recognized based on the matching degree between the face features and each preset face feature in the target face feature library.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the face recognition method as described in any one of claims 1 to 8.