Method and related device for training face recognition model and recognizing face

The face feature set is converted through the subclass center transformation matrix and sorted by similarity for progressive training, which solves the problems of insufficient training and overfitting of face recognition models in the existing technology when the sample size is small, and improves recognition Accuracy.

CN113158801BActive Publication Date: 2024-10-18XIAMEN LANFENG FILM NETWORK TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110298550.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-19
Publication Date
2024-10-18
Estimated Expiration
2041-03-19

AI Technical Summary

Technical Problem

Existing face recognition models do not differentiate between data during the training process, resulting in insufficient model training when the sample size is small, prone to overfitting problems, and affecting recognition accuracy.

Method used

The original facial feature set is converted into a new facial feature set through a subclass center transformation matrix with a preset number of subclass centers, and the target facial feature set is selected for progressive training in descending order of similarity to form Target face recognition model.

Benefits of technology

It improves the accuracy of face recognition when the sample size is small, avoids over-fitting, and provides a progressive model training method from easy to difficult based on the degree of similarity, which improves the recognition ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113158801B_ABST
    Figure CN113158801B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose methods, devices, electronic devices, computer-readable storage media, and computer program products for training face recognition models and recognizing faces, which relate to the fields of computer vision and deep learning technology and can be used in face recognition scenarios. A specific implementation method includes: obtaining the original face feature set after normalization; converting the original face feature set into a corresponding number of new face feature sets through a subclass center conversion matrix with a subclass center number as a preset value; respectively calculating the similarity between each new face feature set and the original face feature set; selecting each target face feature set from each new face feature set in order of similarity from large to small, and training the face recognition model with each target face feature set in turn to obtain a trained target face recognition model. This implementation method provides a progressive learning and training method for situations where the sample size is small, thereby improving the recognition accuracy of the trained model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, specifically to computer vision and deep learning technologies, which can be used in face recognition scenarios, and in particular to methods, devices, electronic devices, computer-readable storage media and computer program products for training face recognition models, as well as methods, devices, electronic devices, computer-readable storage media and computer program products for recognizing faces. Background Art

[0002] Current face recognition models do not distinguish between training data during the training process. This approach has limited impact on the accuracy of the final trained model when the sample size is large enough, but when the sample size is small, there are problems of insufficient training and overfitting. Summary of the invention

[0003] The embodiments of the present application propose a method, device, electronic device, computer-readable storage medium and computer program product for training a face recognition model, and also propose a method, device, electronic device, computer-readable storage medium and computer program product for recognizing faces.

[0004] In the first aspect, an embodiment of the present application proposes a method for training a face recognition model, including: obtaining an original face feature set after normalization; converting the original face feature set into a corresponding number of new face feature sets through a subclass center transformation matrix with a subclass center number of a preset value, and the preset value is greater than 1; respectively calculating the similarity between each new face feature set and the original face feature set; selecting each target face feature set from each new face feature set in order of similarity from large to small, and training the face recognition model with each target face feature set in turn to obtain a trained target face recognition model.

[0005] In the second aspect, an embodiment of the present application proposes a device for training a face recognition model, comprising: a normalization processing unit, configured to obtain an original face feature set after normalization processing; a category conversion unit, configured to convert the original face feature set into a corresponding number of new face feature sets through a subclass center conversion matrix with a subclass center number as a preset value, and the preset value is greater than 1; a similarity calculation unit, configured to respectively calculate the similarity between each new face feature set and the original face feature set; a progressive training unit, configured to select each target face feature set from each new face feature set in order of similarity from large to small, and use each target face feature set to train the face recognition model in turn to obtain a trained target face recognition model.

[0006] In a third aspect, an embodiment of the present application proposes a method for recognizing faces, comprising: receiving a face image to be recognized; calling a target face recognition model to recognize the face image to be recognized; wherein the target face recognition model is obtained according to the method for training a face recognition model as described in any implementation method in the first aspect.

[0007] In a fourth aspect, an embodiment of the present application proposes a device for recognizing faces, comprising: a face image receiving unit to be recognized, configured to receive a face image to be recognized; a face recognition unit, configured to call a target face recognition model to recognize the face image to be recognized; wherein the target face recognition model is obtained according to the method for training a face recognition model as described in any implementation method in the second aspect.

[0008] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that when the at least one processor executes, it can implement the method for training a face recognition model as described in any implementation manner in the first aspect and / or the method for recognizing a face as described in any implementation manner in the third aspect.

[0009] In a sixth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium storing computer instructions, which are used to enable a computer to implement the method for training a face recognition model as described in any implementation method in the first aspect and / or the method for recognizing a face as described in any implementation method in the third aspect when executed.

[0010] In the seventh aspect, an embodiment of the present application provides a computer program product comprising a computer program, which, when executed by a processor, can implement the method for training a face recognition model as described in any implementation manner in the first aspect and / or the method for recognizing a face as described in any implementation manner in the third aspect.

[0011] The method, apparatus, electronic device, computer-readable storage medium and computer program product for training a face recognition model provided by the embodiments of the present application first obtain an original face feature set after normalization processing; then, the original face feature set is converted into a corresponding number of new face feature sets through a subclass center conversion matrix with a subclass center number of a preset value, and the preset value is greater than 1; then, the similarity between each new face feature set and the original face feature set is calculated respectively; finally, each target face feature set is selected from each new face feature set in descending order of similarity, and the face recognition model is trained with each target face feature set in turn to obtain a trained target face recognition model.

[0012] Based on the model training scheme provided by the above method, the method, device, electronic device, computer-readable storage medium and computer program product for recognizing faces provided in the embodiments of the present application can call the target face recognition model trained by the above scheme for recognition when receiving a face image to be recognized.

[0013] For the case where the training sample size is small, the technical solution provided in the present application randomly transforms the original facial feature set into multiple new facial feature sets of different categories through multiple subclass centers randomly generated by the subclass center transformation matrix, and distinguishes the new facial feature sets according to the degree of similarity between the new facial feature sets and the original facial feature sets, thereby providing a progressive model training method from easy to difficult according to the degree of similarity. Compared with the conventional non-hierarchical unified model training method, the target face recognition model trained in this way will have higher recognition accuracy.

[0014] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0016] Figure 1 is an exemplary system architecture in which the present application may be applied;

[0017] Figure 2 A flowchart of a method for training a face recognition model provided in an embodiment of the present application;

[0018] Figure 3 A flowchart of another method for training a face recognition model provided in an embodiment of the present application;

[0019] Figure 4 A flowchart of a method for determining a preset value provided in an embodiment of the present application;

[0020] Figure 5 A structural block diagram of a device for training a face recognition model provided in an embodiment of the present application;

[0021] Figure 6 A structural block diagram of a device for recognizing a face provided in an embodiment of the present application;

[0022] Figure 7A schematic diagram of the structure of an electronic device suitable for executing a method for training a face recognition model and / or a method for recognizing a face, provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be appreciated by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description. It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments may be combined with each other.

[0024] Figure 1 An exemplary system architecture 100 is shown to which embodiments of the method, apparatus, electronic device, and computer-readable storage medium for training a face recognition model of the present application can be applied.

[0025] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0026] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 and server 105 can be installed with various applications for realizing information communication between the two, such as data encryption applications, face recognition applications, instant messaging applications, etc.

[0027] Terminal devices 101, 102, 103 and server 105 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc.; when terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above, which can be implemented as multiple software or software modules, or as a single software or software module, and no specific limitation is made here. When server 105 is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server; when the server is software, it can be implemented as multiple software or software modules, or as a single software or software module, and no specific limitation is made here.

[0028] The server 105 can provide various services through various built-in applications. Taking the face recognition application that can provide user services corresponding to face images as an example, the server 105 can achieve the following effects when running the electronic photo album application: first, receive the incoming face images to be recognized from the terminal devices 101, 102, and 103 through the network 104; then, call the previously trained target face recognition model from the preset storage location, and input the face images to be recognized as input data into the target face recognition model; finally, return the recognition results output by the target face recognition model to the terminal devices 101, 102, and 103.

[0029] Among them, the target face recognition model can be obtained by pre-training the training samples by the model training application built into the server 105 according to the following steps: first, obtain the original face feature set after normalization; then, convert the original face feature set into a corresponding number of new face feature sets through a subclass center conversion matrix with a subclass center number as a preset value, and the preset value is greater than 1; then, calculate the similarity between each new face feature set and the original face feature set respectively; finally, select each target face feature set from each new face feature set in order of similarity from large to small, and use each target face feature set to train the face recognition model in turn to obtain a trained target face recognition model.

[0030] Since training the target face recognition model requires more computing resources and stronger computing power, the methods for training the face recognition model provided in the subsequent embodiments of the present application are generally performed by the server 105 with stronger computing power and more computing resources. Accordingly, the device for training the face recognition model is generally also set in the server 105. However, it should also be pointed out that when the terminal devices 101, 102, and 103 also have computing power and computing resources that meet the requirements, the terminal devices 101, 102, and 103 can also complete the various operations handed over to the server 105 through the model training application installed thereon, and then output the same results as the server 105. Correspondingly, the device for training the face recognition model can also be set in the terminal devices 101, 102, and 103. In this case, the exemplary system architecture 100 may also not include the server 105 and the network 104.

[0031] In particular, the target face recognition model trained by the server 105 can also be used through model distillation to obtain a lightweight face recognition model suitable for being placed in the terminal devices 101, 102, and 103. That is, it is possible to flexibly choose to use the lightweight face recognition model in the terminal devices 101, 102, and 103, or to choose to use the target face recognition model in the server 105 according to the recognition accuracy actually required.

[0032] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0033] Please refer to Figure 2 , Figure 2 A flowchart of a method for training a face recognition model provided in an embodiment of the present application, wherein process 200 includes the following steps:

[0034] Step 201: Obtaining a normalized original face feature set;

[0035] This step is intended to be performed by an execution subject (e.g. Figure 1 The server 105 shown in the figure obtains the original facial features after normalization.

[0036] The original face feature set refers to the set of face features obtained after normalization processing. The face features are extracted from each picture containing a face image. There are many ways to extract face features, such as face key point extraction, face contour extraction, etc. The purpose of normalization processing is to unify the description standards of face features extracted from different pictures. The process can also be vividly described as "unified measurement".

[0037] It should be noted that the face image training set used to extract and obtain the original face feature set after normalization can be obtained by the above-mentioned execution subject directly from a local storage device, or from a non-local storage device (such as Figure 1 The local storage device can be a data storage module set in the above-mentioned execution subject, such as a server hard disk. In this case, the face picture set can be quickly read locally; the non-local storage device can also be any other electronic device configured to store data, such as some user terminals, etc. In this case, the above-mentioned execution subject can obtain the required face picture training set by sending an acquisition command to the electronic device. Of course, the original face feature set can also be directly stored in a local storage device or a non-local storage device as a finished product.

[0038] Specifically, the original facial feature set can usually be expressed in multiple forms, such as matrix, vector or other equivalently convertible forms.

[0039] Step 202: converting the original face feature set into a new face feature set of a corresponding number through a subclass center conversion matrix whose number of subclass centers is a preset value;

[0040] Based on step 201, this step aims to convert the original facial features into a corresponding number of new facial feature sets through a subclass center conversion matrix whose subclass center number is a preset value by the above-mentioned execution subject. Because the preset value is the subclass center number, the value range of the preset value should be an integer greater than 1, and its initial value should be greater than 1.

[0041] It should be noted that the multiple (assuming K) new face feature sets converted by the subclass center conversion matrix can be included in a large matrix with K dimensions, or can be represented as K small matrices. Of course, in order to meet the conversion requirements, the original face feature set needs to be converted into a matrix representation when inputting the subclass center conversion matrix.

[0042] Among them, the role of the subclass center conversion matrix is ​​to convert the category center of the input data into a new category center, so as to change the category of the feature set in this way, thereby helping to divide the previous full amount of original facial features into various categories. It can also be understood as dividing the previous full amount of original facial features into different subclasses in this way, so as to adopt a progressive learning and training method in the future.

[0043] The initial value of the preset value (K value) can be set by yourself or randomly. Since the subsequent purpose is to let the model learn from the characteristics of each category progressively, it does not mean that the larger the preset value (K value) and the more groups, the better the training effect can be obtained. It is also affected by the sample content and sample characteristics. In order to get a more appropriate initial value as much as possible, you can also select several preset values ​​(K values) of different sizes for a priori, so as to determine a suitable size based on the prior results.

[0044] Step 203: Calculate the similarity between each new face feature set and the original face feature set respectively;

[0045] On the basis of step 202, this step aims to calculate the similarity between each new face feature set and the original face feature set by the above-mentioned execution subject.

[0046] It should be understood that because the new category center of the category center conversion matrix is ​​randomly generated, it is impossible to determine the similarity between the new category center and the original category center. Therefore, it is necessary to determine the similarity between each category transformation matrix and the original facial features by calculating the similarity, so as to facilitate the determination of the training order of the subsequent progressive model training. It should be understood that the progressive model training order should be from easy to difficult, and it will not go from difficult to easy in the scenario of this application. "Easy" refers to the category transformation matrix with high similarity to the original facial features, and "difficult" refers to the category transformation matrix with low similarity to the original facial features.

[0047] Specifically, each new face feature set and the original face feature set can be multiplied in the form of a matrix, and the similarity expressed in the form of an angle matrix can be obtained by calculating arccos.

[0048] Step 204: Select target face feature sets from each new face feature set in order of similarity from large to small, and use each target face feature set to train the face recognition model in turn to obtain a trained target face recognition model.

[0049] Based on step 203, this step aims to have the above-mentioned execution subject use the new face feature sets ranked from large to small in similarity in sequence to progressively train the face recognition model, and finally obtain a trained target face recognition model after the last new face feature set with the smallest similarity has completed the training of the face recognition model.

[0050] For ease of understanding, an example is given here: Assuming the preset value is 10, that is, 10 new face feature sets will be obtained through step 202, and assuming that the similarities between these 10 new face feature sets and the original face feature sets are respectively ranked from large to small as follows: 90%, 80%, 70%, 60%, 50%, 40%, 30%, 20%, 15%, 10%, then the order of training is to first use the new face feature set with a similarity of up to 90% to train the face recognition model, and then use the 80% new face feature set to train the 90% trained face recognition model, and so on, until the 10% new face feature set with the lowest similarity has also trained the face recognition model, and finally the face recognition model trained to the current one is output as the target face recognition model. That is, the present application provides a progressive training method from easy to difficult according to the similarity from large to small.

[0051] Specifically, each time a new facial feature set is used to train the face recognition model, it can be understood as a round of training or an iteration, and the above 10 trainings can be understood as completed in one round or one iteration. This will not affect the actual training effect and is not specifically limited here.

[0052] However, it should be noted that although only one new face feature set with the highest similarity is used to train the face recognition model each time in the above example, it is not ruled out that multiple new face feature sets with high similarity or multiple new face feature sets with high similarity rankings are selected at one time to train the face recognition model. Selecting only one for training each time will bring better training results, while selecting multiple for training each time will improve training efficiency. The specific selection can be flexibly selected according to actual needs.

[0053] Specifically, each time the face recognition model is trained, the Arcface loss function that is more suitable for face recognition may be used. In this loss function, the arccos angle may be input, and supervised training may be achieved in a manner that minimizes the loss value.

[0054] For the case where the training sample size is small, the technical solution provided in the present application randomly transforms the original facial feature set into multiple new facial feature sets of different categories through multiple subclass centers randomly generated by the subclass center transformation matrix, and distinguishes the new facial feature sets according to the degree of similarity between the new facial feature sets and the original facial feature sets, thereby providing a progressive model training method from easy to difficult according to the degree of similarity. Compared with the conventional non-hierarchical unified model training method, the target face recognition model trained in this way will have higher recognition accuracy.

[0055] exist Figure 2 Based on the embodiment shown, the present application also Figure 3 Another method for training a face recognition model is provided, wherein steps 301 to 303 provide a specific implementation method including sample increment technology for step 201; steps 306 to 308 provide a specific method for implementing progressive training, which is used to deepen the understanding of this solution. Figure 3 The process 300 shown includes the following steps:

[0056] Step 301: performing sample increment processing on each face picture in the face picture sample set by adjusting the image content angle and / or changing the lighting conditions to obtain an incremental face picture set;

[0057] The sample increment method provided in this embodiment is to adjust the angle of the image content and / or change the lighting conditions. Of course, other adjustment methods that do not change the overall image content may also be used.

[0058] Step 302: extracting facial features from each face picture in the incremental face picture set;

[0059] Step 303: normalize the extracted facial features to obtain an original facial feature set.

[0060] The reason why the sample set is incremented by the above scheme is that the situation targeted by this application is a difficult sample (also known as a low resource) situation with a small sample magnitude. Therefore, it is expected to introduce sample increment technology while increasing the magnitude of the original face feature set while adopting a progressive training method, thereby obtaining a better model recognition effect.

[0061] Step 304: converting the original face feature set into a new face feature set of a corresponding number through a subclass center conversion matrix whose number of subclass centers is a preset value;

[0062] Step 305: Calculate the similarity between each new face feature set and the original face feature set respectively;

[0063] Step 306: Arrange the corresponding new face feature sets from top to bottom in a blank list in descending order of similarity to obtain a similarity ranking table;

[0064] Step 307: Selecting target face feature sets from the similarity ranking table in order from top to bottom, and training face recognition models based on the selected target face feature sets;

[0065] Step 308: In response to the completion of training the face recognition model with the last target face feature set, the current face recognition model is determined as the target face recognition model.

[0066] In the specific implementation scheme provided by the above steps 306-308, a similarity ranking table is constructed to arrange each new facial feature set in a specific sorting manner according to the size of the similarity. Therefore, the progressive training method provided in the present application only needs to take out the top one from the similarity ranking table each time (each time the one taken out will be deleted and not retained), which is more convenient and clear.

[0067] In some embodiments of the present application, in order to determine a suitable preset value as much as possible, the following a priori method may also be used:

[0068] Step 401: Randomly select a first positive integer with a smaller value and a second positive integer with a larger value;

[0069] Step 402: When the preset value is a first positive integer and a second positive integer, respectively, a first target face recognition model and a second target face recognition model are obtained by training;

[0070] Step 403: Determine a first recognition accuracy difference between the first target face recognition model and the second target face recognition model using the face image test set;

[0071] Step 404: In response to the first recognition accuracy difference being less than a preset accuracy difference, determining a first positive integer as a preset value.

[0072] That is, two positive integers of different values ​​are selected for the experiment, and the difference in recognition accuracy of the same face image test set is used to determine which of the two positive integers is appropriate. When the difference is less than the preset threshold, it means that the accuracy is not linearly improved by selecting a larger second positive integer. Therefore, it is more appropriate to use the first positive integer that can reduce the number of progressive learning times as the preset value.

[0073] In order to further improve the accuracy of the preset value, a third positive integer whose value is smaller than the first positive integer can be randomly selected on the basis of the above scheme; then, the second recognition accuracy difference between the third positive integer and the first positive integer is verified by repeating the first step (the above steps 402-404); finally, in response to the second recognition accuracy difference being smaller than the preset threshold, the preset value is updated to a smaller third positive integer. The above operation can be repeated multiple times to try to find a preset value of a suitable size as much as possible in the early stage.

[0074] In order to ensure the availability of the target face recognition model trained according to the above embodiment as much as possible, the availability of the target face recognition model can also be tested by designing a comparative verification. A comparative verification method and processing method including but not limited to the following is:

[0075] Using a conventional face recognition model to recognize face images included in a face image verification set, and obtaining a first recognition accuracy rate;

[0076] Using the target face recognition model to recognize face images included in the face image verification set, and obtaining a second recognition accuracy rate;

[0077] In response to the first recognition accuracy being greater than the second recognition accuracy, an initial value of the K value is adjusted until the second recognition accuracy is greater than the first recognition accuracy.

[0078] Among them, the conventional face recognition model is a face recognition model obtained by randomly selecting any new face feature in each new face feature set as the target face feature set for training, that is, like the existing technology, it does not distinguish between difficulty and ease according to similarity, but randomly selects during training.

[0079] Through the above-mentioned comparative verification method and processing method, it is possible to find out as soon as possible whether it is necessary to adopt the progressive learning method provided by this application for the current training sample, that is, based on whether it can bring obvious differences in recognition accuracy, and whether the difference is not obvious due to inappropriate model parameter settings, etc.

[0080] The face image test set and verification set mentioned in the above scheme are respectively used to determine the size of the initial value and to verify the availability of the trained target face model in this embodiment. The number of test sets and verification sets is not specifically limited. Generally speaking, the test set and verification set should have corresponding capabilities (for example, the verification set should have the ability to verify whether it is available). However, in actual situations, inappropriate and imprecise selection of specific data may lead to erroneous conclusions. In order to avoid this situation as much as possible, multiple test or verification sets can be set up independently to perform the operations separately, thereby eliminating the misleading of the conclusions by errors in a single set.

[0081] On the basis of any of the above embodiments, in order to fully enable the target face recognition model trained according to the above training method to play a role, the following steps can also be followed to enable it to play a role in the actual face recognition operation:

[0082] Receiving a face image to be recognized;

[0083] Call the target face recognition model to identify the face image to be identified.

[0084] Among them, the target face recognition model is based on Figure 2-4 The face recognition model obtained by the method provided for training the face recognition model.

[0085] Specifically, the recognition result may include whether the face belongs to a registered user, a prompt message indicating that the image is not clear enough to be recognized, etc. The execution subject of the above-mentioned face recognition method may still be Figure 1 The server 105 shown can also be changed to Figure 1 The terminals 101, 102, and 103 shown, especially when they have the trained target face recognition model to be called. Of course, the lightweight target face recognition model can also be placed locally in the terminals 101, 102, and 103 by model distillation, thereby realizing local calling and recognition.

[0086] To deepen understanding, this application also provides a specific implementation solution in combination with a specific application scenario:

[0087] The customer requested to achieve high-accuracy face recognition for a difficult sample. The service provider first trained a target face recognition model according to the following steps:

[0088] 1) Obtain a face picture sample set containing face images, and increase the picture samples by improving the picture illumination intensity, illumination angle, and adjusting the image content angle;

[0089] 2) extracting facial features from the facial image of each facial image in the incremental facial image sample set, and obtaining an original facial feature matrix expressed in matrix form through normalization processing;

[0090] 3) The subclass center number K is determined to be 10 through previous experiments, and 10 new facial feature matrices are generated using the class center conversion matrix, and the similarities between the 10 new facial feature matrices and the original facial feature matrix are calculated respectively;

[0091] 4) Sort by similarity to obtain a sorting table; the sorting table arranges the similarities from top to bottom in descending order;

[0092] 5) Each time, only one new face feature matrix is ​​selected from the top of the sorting table, and it is used as the target face feature matrix to train the face recognition model, and it is crossed out from the sorting table after use;

[0093] 6) Repeat 5) until the current sorting table is a blank table, and output the face recognition model trained to the current state as the target face recognition model;

[0094] The service provider obtains a lightweight target face recognition model (referred to as a lightweight recognition model for short; to distinguish, the target face recognition model is called a full-scale recognition model) through the model distillation mechanism, and then provides all data files of the lightweight recognition model and the calling interface of the full-scale recognition model to the customer's client, so that the customer can flexibly choose according to actual needs.

[0095] Further references Figure 5 and Figure 6 As an implementation of the methods shown in the above figures, the present application also provides an embodiment of a device for training a face recognition model and an embodiment of a device for recognizing a face. The device embodiment corresponds to the above method embodiment and can be specifically applied to various electronic devices.

[0096] like Figure 5As shown, the apparatus 500 for training a face recognition model in this embodiment may include: a normalization processing unit 501, a category conversion unit 502, a similarity calculation unit 503, and a progressive training unit 504. The normalization processing unit 501 is configured to obtain an original face feature set after normalization processing; the category conversion unit 502 is configured to convert the original face feature set into a corresponding number of new face feature sets through a subclass center conversion matrix with a subclass center number of a preset value, and the preset value is greater than 1; the similarity calculation unit 503 is configured to respectively calculate the similarity between each new face feature set and the original face feature set; the progressive training unit 504 is configured to select each target face feature set from each new face feature set in order of similarity from large to small, and use each target face feature set to train the face recognition model in turn to obtain a trained target face recognition model.

[0097] In the apparatus 500 for training a face recognition model in this embodiment, the specific processing of the normalization processing unit 501, the category conversion unit 502, the similarity calculation unit 503, and the progressive training unit 504 and the technical effects thereof can be referred to respectively. Figure 2 The relevant descriptions of steps 201 - 204 in the corresponding embodiment are not repeated here.

[0098] In some optional implementations of this embodiment, the progressive training unit 504 may be further configured to:

[0099] Arrange the corresponding new face feature sets from top to bottom in the blank list in the order of similarity from high to low to obtain a similarity ranking table;

[0100] Select each target face feature set from the similarity ranking table in order from top to bottom, and train the face recognition model based on each target face feature set selected in turn;

[0101] In response to the completion of training the face recognition model with the last target face feature set, the current face recognition model is determined as the target face recognition model.

[0102] In some optional implementations of this embodiment, the apparatus 500 for training a face recognition model may further include a preset value determining unit configured to determine a preset value, and the preset value determining unit may be further configured to:

[0103] Randomly select a first positive integer with a smaller value and a second positive integer with a larger value;

[0104] When the preset value is a first positive integer and a second positive integer respectively, a corresponding first target face recognition model and a second target face recognition model are obtained by training;

[0105] Determine a first recognition accuracy difference between a first target face recognition model and a second target face recognition model using a face image test set;

[0106] In response to the first recognition accuracy difference being less than a preset accuracy difference, the first positive integer is determined as a preset value.

[0107] In some optional implementations of this embodiment, the normalization processing unit 501 may be further configured to:

[0108] Performing sample increment processing on each face image in the face image sample set by adjusting the image content angle and / or changing the lighting conditions to obtain an incremental face image set;

[0109] Extracting facial features from each face image in the incremental face image set;

[0110] The extracted facial features are normalized to obtain the original facial feature set.

[0111] In some optional implementations of this embodiment, the apparatus 500 for training a face recognition model may further include:

[0112] A first recognition accuracy acquisition unit is configured to use a conventional face recognition model to recognize face images included in the face image verification set to obtain a first recognition accuracy; wherein the conventional face recognition model is a face recognition model obtained by randomly selecting any new face feature in each new face feature set as a target face feature set for training;

[0113] A second recognition accuracy acquisition unit is configured to use the target face recognition model to recognize the face image verification set to obtain a second recognition accuracy;

[0114] The model parameter adjustment unit is configured to adjust the model parameters of the face recognition model in training based on a second accuracy difference between the first recognition accuracy and the second recognition accuracy.

[0115] like Figure 6 As shown, the apparatus 600 for recognizing a face in this embodiment may include: a face image receiving unit 601 to be recognized, and a face recognition unit 602. The face image receiving unit 601 to be recognized is configured to receive a face image to be recognized; the face recognition unit 602 is configured to call a target face recognition model to recognize the face image to be recognized; the target face recognition model is based on Figure 5 The device shown for training a face recognition model is obtained.

[0116] The above-mentioned embodiment exists as an apparatus embodiment corresponding to the above-mentioned method embodiment. For the case where the training sample size is small, the technical solution provided by the present application randomly transforms the original face feature set into multiple new face feature sets of different categories through multiple subclass centers randomly generated by the subclass center transformation matrix, and distinguishes the new face feature sets according to the degree of similarity between the new face feature sets and the original face feature sets, thereby providing a progressive model training method from easy to difficult according to the degree of similarity. Compared with the conventional non-hierarchical unified model training method, the target face recognition model trained in this way will have higher recognition accuracy.

[0117] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.

[0118] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0119] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0120] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0121] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as a method for training a face recognition model. For example, in some embodiments, the method for training a face recognition model may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the method for training a face recognition model described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the method for training a face recognition model in any other appropriate manner (eg, by means of firmware).

[0122] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0123] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0124] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0125] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0126] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0127] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

[0128] For the case where the training sample size is small, the technical solution provided in the present application randomly transforms the original facial feature set into multiple new facial feature sets of different categories through multiple subclass centers randomly generated by the subclass center transformation matrix, and distinguishes the new facial feature sets according to the degree of similarity between the new facial feature sets and the original facial feature sets, thereby providing a progressive model training method from easy to difficult according to the degree of similarity. Compared with the conventional non-hierarchical unified model training method, the target face recognition model trained in this way will have higher recognition accuracy.

[0129] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

[0130] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A method for training a face recognition model, include: Obtain the normalized original face feature set; The original facial feature set is converted into a new facial feature set of a corresponding number through a subclass center conversion matrix with a subclass center number of a preset value, wherein the preset value is greater than 1, and the subclass center conversion matrix is ​​used to convert the category center of the input data, thereby dividing the original facial features in the original facial feature set into a plurality of different subclasses by changing the category center; Calculating the similarity between each of the new face feature sets and the original face feature set respectively; In the order of the similarity from large to small, each target face feature set is selected from each new face feature set in turn, and each target face feature set is used to train the face recognition model in turn to obtain a trained target face recognition model.

2. The method according to claim 1, in, The method of selecting target face feature sets from the new face feature sets in descending order of similarity, and training a face recognition model with the target face feature sets in turn to obtain a trained target face recognition model comprises: Arrange the corresponding new face feature sets from top to bottom in a blank list in the order of the similarity from high to low, and obtain a similarity ranking table; Selecting each of the target face feature sets from the similarity ranking table in order from top to bottom, and training the face recognition model in order based on each of the target face feature sets selected in order; In response to the completion of training the face recognition model with the last target face feature set, the current face recognition model is determined as the target face recognition model.

3. The method according to claim 1, in, The step of determining the preset value comprises: Randomly select a first positive integer with a smaller value and a second positive integer with a larger value; When the preset value is the first positive integer and the second positive integer, respectively, a corresponding first target face recognition model and a corresponding second target face recognition model are obtained by training; Determine a first recognition accuracy difference between the first target face recognition model and the second target face recognition model using a face image test set; In response to the first recognition accuracy difference being less than a preset accuracy difference, the first positive integer is determined as the preset value.

4. The method according to claim 1, in, The step of obtaining the normalized original face feature set includes: Performing sample increment processing on each face image in the face image sample set by adjusting the image content angle and / or changing the lighting conditions to obtain an incremental face image set; Extracting facial features from each face picture in the incremental face picture set; The extracted facial features are normalized to obtain the original facial feature set.

5. The method according to claim 1, further comprising: include: Using a conventional face recognition model to recognize the face images included in the face image verification set, and obtaining a first recognition accuracy rate; wherein the conventional face recognition model is a face recognition model obtained by randomly selecting any new face features in each of the new face feature sets as the target face feature set for training; Using the target face recognition model to recognize the face image verification set, and obtaining a second recognition accuracy rate; Based on a second accuracy difference between the first recognition accuracy and the second recognition accuracy, model parameters of the face recognition model in training are adjusted.

6. A method for recognizing a face, in, include: Receiving a face image to be recognized; Calling a target face recognition model to recognize the face image to be recognized; The target face recognition model is obtained according to the method for training a face recognition model according to any one of claims 1-5.

7. A device for training a face recognition model, include: A normalization processing unit, configured to obtain an original face feature set after normalization processing; A category conversion unit is configured to convert the original facial feature set into a new facial feature set of a corresponding number through a subclass center conversion matrix whose number of subclass centers is a preset value, wherein the preset value is greater than 1, and the subclass center conversion matrix is ​​used to convert the category center of the input data, thereby dividing the original facial features in the original facial feature set into a plurality of different subclasses by changing the category center; A similarity calculation unit is configured to respectively calculate the similarity between each of the new face feature sets and the original face feature set; The progressive training unit is configured to select each target face feature set from each new face feature set in order of similarity from large to small, and use each target face feature set to train the face recognition model in turn to obtain a trained target face recognition model.

8. The device according to claim 7, in, The progressive training unit is further configured to: Arrange the corresponding new face feature sets from top to bottom in a blank list in the order of the similarity from high to low, and obtain a similarity ranking table; Selecting each of the target face feature sets from the similarity ranking table in order from top to bottom, and training the face recognition model in order based on each of the target face feature sets selected in order; In response to the completion of training the face recognition model with the last target face feature set, the current face recognition model is determined as the target face recognition model.

9. The apparatus according to claim 7, further comprising a preset value determining unit configured to determine the preset value, wherein the preset value determining unit is further configured to: Randomly select a first positive integer with a smaller value and a second positive integer with a larger value; When the preset value is the first positive integer and the second positive integer, respectively, a corresponding first target face recognition model and a corresponding second target face recognition model are obtained by training; Determine a first recognition accuracy difference between the first target face recognition model and the second target face recognition model using a face image test set; In response to the first recognition accuracy difference being less than a preset accuracy difference, the first positive integer is determined as the preset value.

10. The device according to claim 7, in, The normalization processing unit is further configured to: Performing sample increment processing on each face image in the face image sample set by adjusting the image content angle and / or changing the lighting conditions to obtain an incremental face image set; Extracting facial features from each face picture in the incremental face picture set; The extracted facial features are normalized to obtain the original facial feature set.

11. The device according to claim 7, further comprising: include: A first recognition accuracy acquisition unit is configured to use a conventional face recognition model to recognize the face images included in the face image verification set to obtain a first recognition accuracy; wherein the conventional face recognition model is a face recognition model obtained by randomly selecting any new face feature in each of the new face feature sets as the target face feature set for training; A second recognition accuracy acquisition unit is configured to use the target face recognition model to recognize the face image verification set to obtain a second recognition accuracy; The model parameter adjustment unit is configured to adjust the model parameters of the face recognition model in training based on a second accuracy difference between the first recognition accuracy and the second recognition accuracy.

12. A device for recognizing a face, in, include: A face image receiving unit to be identified, configured to receive a face image to be identified; A face recognition unit is configured to call a target face recognition model to recognize the face image to be recognized; wherein the target face recognition model is obtained according to the device for training a face recognition model according to any one of claims 7-11.

13. An electronic device, include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for training a face recognition model described in any one of claims 1-5 and / or the method for recognizing a face described in claim 6.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method for training a face recognition model described in any one of claims 1 to 5 and / or the method for recognizing a face described in claim 6.

15. A computer program product, comprising a computer program, which, when executed by a processor, implements the method for training a face recognition model according to any one of claims 1 to 5 and / or the method for recognizing a face according to claim 6.

Citation Information

Patent Citations

  • Small-sample face recognition method

    CN106529447A

  • Face recognition model construction method, face recognition method and related devices

    CN111259738A