Training scheme and system for improving ability of face recognition model

By calculating the feature space boundary threshold t and constructing a face loss function LFeasibleFace, combined with the SGD optimizer and dynamic learning rate, the problems of unstable and inefficient face recognition model training are solved, achieving more efficient and stable recognition results.

CN120708253APending Publication Date: 2025-09-26XIAMEN MEIYA PICO INFORMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510667339.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing face recognition model training schemes suffer from training instability, severe hyperparameter dependence, and low training efficiency, resulting in insufficient recognition capabilities.

Method used

By calculating the boundary threshold t in the feature space, we construct a face loss function called LFeasibleFace. Combined with the SGD optimizer and a dynamic learning rate strategy, we filter the gradients between face samples of different people, abandon the Softmax function and cross entropy calculation, and optimize the model training process.

Benefits of technology

It improves the training stability and recognition accuracy of the face recognition model, reduces the cost of hyperparameter adjustment, improves training efficiency, reduces GPU communication overhead, and significantly improves the recognition ability and training speed of the face recognition system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120708253A_ABST
    Figure CN120708253A_ABST
Patent Text Reader

Abstract

The invention discloses a training scheme and system for improving the ability of a face recognition model. A feature space boundary threshold value t is calculated, a function LFeasibleFace capable of meeting the face loss is constructed, dissimilar sample gradients are filtered, and stable convergence of the model is achieved. According to the scheme, a dynamic learning rate strategy is adopted, a Softmax function is not needed, GPU communication is reduced, and the training efficiency is improved. Experiments show that the scheme is superior to a mainstream method in recognition precision on multiple test sets, the training speed is improved by 2%, and the scheme is suitable for face recognition system optimization in scenes such as security and protection and finance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence and computer vision technology, and specifically relates to a face recognition model training scheme and system based on a face loss function that can satisfy the face loss function, which is used to improve the training stability, recognition accuracy and training efficiency of the face recognition model. Background Art

[0002] Face recognition technology has matured, and the mainstream training approach is based on the following paradigm: first, the cosine similarity between the training sample and all categories in the training set is calculated. This cosine similarity is then mapped and transformed. A Softmax function is then used to predict the probability of the sample being classified into each category. Finally, a cross-entropy loss is calculated with the sample's category label to optimize the model. This approach has become the mainstream training approach for face recognition feature extraction models, outperforming earlier methods such as contrastive loss and triplet loss.

[0003] The existing mainstream training programs have the following shortcomings:

[0004] 1. Unstable training: Mainstream loss functions (such as ArcFace and CosFace) fail to achieve true convergence. Because the minimum cosine similarity of facial features across different people is -1, a small positive gradient is still generated after Softmax processing, causing the category center features to continuously vibrate in the feature space and become unstable.

[0005] 2. Severe reliance on hyperparameters: Mainstream solutions rely on a large number of hyperparameters such as penalties, weighting, and scaling, and require repeated parameter adjustments for different application scenarios, increasing manpower and time costs.

[0006] 3. Low training efficiency: Mainstream solutions are often combined with the PartialFC method, which requires two rounds of inter-GPU communication through the Softmax function (obtaining the global maximum value and summation), resulting in reduced training efficiency.

[0007] In view of this, it is very meaningful to propose a training scheme and system to improve the ability of face recognition models. Summary of the Invention

[0008] In order to address the shortcomings of the existing technology, the present invention provides a training scheme and system for improving the capabilities of face recognition models, aiming to solve the problems of unstable training, redundant hyperparameters and low training efficiency, and to improve the recognition capability and training speed of face recognition models.

[0009] In a first aspect, the present invention proposes a training scheme for improving the ability of a face recognition model, the method comprising the following steps:

[0010] S1: Calculate the boundary threshold t in the feature space based on the number of training set categories c and the length of facial features d. The boundary threshold t is used to filter the gradient between face samples of different people;

[0011] S2: Construct a face loss function L that satisfies the face loss function FeasibleFace , the loss function expression is: That

[0012] In the equation, N represents the total number of samples. is the vector angle between the i-th sample feature and the corresponding category feature; θ j is the vector angle between the sample feature and the j-th category feature; t is the boundary threshold, t∈[-1,1];

[0013] S3: Train the model based on the gradient descent method, using the SGD optimizer and a dynamic learning rate strategy until the model converges;

[0014] S4: Obtain the optimized feature extraction model and build a face recognition system based on the model.

[0015] By dynamically calculating boundary thresholds to filter gradients and constructing a face loss function, we can improve training stability and recognition accuracy, reduce parameter adjustment costs and GPU communication, and optimize model efficiency.

[0016] Preferably, the method for calculating the boundary threshold t in the feature space in S1 includes:

[0017] Assuming that the feature space is a d-dimensional hypersphere, the training set contains c categories and the features between categories do not overlap, construct a classification hyperplane, and the distance between the hyperplane and the center of the sphere is t;

[0018] By integrating the surface area of ​​the front of the hyperplane to the area of ​​the hypersphere, we can establish the equation: front area / hypersphere area = 1 / c, that is: Where c is the number of training set categories, which is a positive integer, d is the length of the facial feature, d is an even number greater than or equal to 2, and t∈[-1,1];

[0019] The Newton method is used to iteratively solve the equation to obtain an approximate value of the threshold t. The iterative termination condition is g(x n )<0.0001, where g(x) is a monotonic function derived based on integration.

[0020] Through geometric modeling and integral derivation, the threshold t is associated with the number of categories c and feature dimension d of the training data, realizing automatic threshold calculation, reducing manual parameter adjustment, and improving model adaptability.

[0021] Further preferably, the solution of the approximate value of the boundary threshold t further includes:

[0022] Let the indefinite integral be f(x) = ∫cos(x) d-2 dx, assuming d is an even number, the widely used facial feature dimensions of 128, 256, and 512 all meet the assumption. If d is an odd number, the formula derivation and calculation results will be different. Calculate the integral:

[0023]

[0024] Where C is a constant, and we substitute it into the numerator and denominator of the next equation, we have:

[0025]

[0026] Sin -1 (t) = x, is a constant, the equation to be solved can be transformed into:

[0027]

[0028] At this point, the specific value of x is still difficult to obtain, but the function is monotonic, and g(x) and g'(x) are both known, so an approximate solution can be obtained using Newton's method:

[0029]

[0030] x0=0

[0031]

[0032] When g(x n )<0.0001, then the iteration stops, and t=sin(x n ), we can get the specific parameters of the loss function.

[0033] By deriving the integral formula in even dimensions and combining it with the Newton iteration method, the threshold t is efficiently solved to ensure calculation accuracy and enhance the adaptability of the model in 128 / 256 / 512-dimensional feature spaces.

[0034] Preferably, the dynamic learning rate strategy in S3 is:

[0035] In the first 10% of iterations, the learning rate increases linearly from 0 to a peak learning rate of 0.1;

[0036] In the remaining iterations, the learning rate decays to 0 using a polynomial with an exponential of 2, and the iterations are repeated until the model converges. The total number of training rounds is 25.

[0037] A segmented dynamic learning rate strategy is adopted, which first increases linearly to the peak value and then decays polynomially, accelerating model convergence and optimizing training stability, thereby improving overall training efficiency.

[0038] Preferably, the loss function L FeasibleFace No margining, scaling, Softmax function or cross entropy calculation is used.

[0039] Abandoning margins, scaling, and Softmax / cross entropy, simplifying the loss function structure, reducing hyperparameter dependency and GPU communication overhead, and improving training efficiency and model stability.

[0040] In a second aspect, an embodiment of the present invention further provides a training system for improving the capabilities of a face recognition model, comprising:

[0041] A threshold calculation module is configured to calculate a boundary threshold t in the feature space based on the number of training set categories c and the length of facial features d, wherein the boundary threshold t is used to filter the gradient between facial samples of different people;

[0042] The loss function module is configured to construct a face loss function L based on the boundary threshold t. FeasibleFace , filter the gradients between non-similar face samples;

[0043] The model training module is configured to train the model based on the gradient descent method, using the SGD optimizer and a dynamic learning rate strategy until the model converges;

[0044] The face recognition module is configured to build a face recognition system based on the optimized feature extraction model.

[0045] The training system realizes automatic threshold calculation, gradient filtering, dynamic training and model deployment through multi-module collaboration, improving recognition accuracy and training efficiency and adapting to multi-scenario applications.

[0046] Preferably, the threshold calculation module includes:

[0047] The space division unit is used to divide the d-dimensional feature space into c equal intervals and construct a classification hyperplane;

[0048] An integral calculation unit is used to calculate the ratio of the front area of ​​the hyperplane to the area of ​​the hypersphere and derive the solution equation of the threshold t;

[0049] The iterative solution unit is used to iteratively solve the equation by Newton's method to obtain an approximate value of the threshold value t.

[0050] The threshold calculation module realizes the automatic derivation of the threshold t through space division, integral calculation and Newton iteration solution, enhances the adaptability of the model to the data dimension and number of categories, and reduces manual intervention.

[0051] Preferably, the face loss function L FeasibleFace The expression is:

[0052]

[0053] Where N represents the total number of samples, is the vector angle between the i-th sample feature and the corresponding category feature; θ j is the vector angle between the sample feature and the j-th category feature; t is the boundary threshold, t∈[-1,1].

[0054] This loss function focuses on optimizing difficult-to-distinguish samples through compactness constraints on similar samples and gradient filtering mechanism for non-similar samples, improving model training stability and recognition accuracy. It also has a simple structure and few hyperparameters.

[0055] Preferably, in the model training module, the dynamic learning rate strategy is:

[0056] In the first 10% of iterations, the learning rate increases linearly from 0 to a peak learning rate of 0.1;

[0057] In the remaining iterations, the learning rate decays to 0 using a polynomial with an exponential of 2, and the iterations are repeated until the model converges. The total number of training rounds is 25.

[0058] The model training module adopts a segmented dynamic learning rate strategy, first using linear temperature increase to stimulate optimization vitality, and then using polynomial decay to stabilize convergence, completing training efficiently within 25 rounds, improving efficiency and stability.

[0059] Preferably, the model training module does not use the Softmax function during training, reducing the number of inter-GPU communications and improving training speed. The model training module abandons the Softmax function, reducing inter-GPU communication overhead, effectively improving training speed, and significantly reducing computing costs and time consumption in industrial-grade scenarios.

[0060] In a third aspect, an embodiment of the present invention provides an electronic device comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement a training scheme for improving the capabilities of a face recognition model as described in any implementation method in the first aspect.

[0061] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a training scheme for improving the capabilities of a face recognition model as described in any implementation method in the first aspect.

[0062] Compared with the existing technology, the beneficial results of the present invention are: the present invention proposes a training scheme and system for improving the capabilities of face recognition models, which greatly reduces the number of hyperparameters required for training and reduces the parameter adjustment cost of the training system; moreover, this scheme can effectively improve the capabilities of the face recognition system; further, this scheme reduces the number of GPU communication operators during single gradient backpropagation, improves the system training speed, and creates more space for further optimization of the face recognition system. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and, together with the description, serve to explain the principles of the present invention. Other embodiments and many of the expected advantages of the embodiments will be readily apparent as they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with respect to each other. Like reference numerals designate corresponding similar parts.

[0064] Figure 1 1 is a flow chart of a training scheme for improving the ability of a face recognition model according to an embodiment of the present invention;

[0065] Figure 2 Schematic diagram of the FeasibleFace gradient filtering solution according to an embodiment of the present invention;

[0066] Figure 3 This is a schematic diagram of the FeasibleFace training process according to an embodiment of the present invention;

[0067] Figure 4 Schematic diagram of the architecture of a training system for improving the capabilities of a face recognition model according to an embodiment of the present invention;

[0068] Figure 5 Schematic diagram of the architecture of a threshold calculation module according to an embodiment of the present invention;

[0069] Figure 6 It is a schematic structural diagram of a computer device suitable for implementing an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0070] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are intended only to illustrate the invention and are not intended to limit the invention. It should also be noted that, for ease of description, only portions relevant to the invention are shown in the accompanying drawings.

[0071] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments of the present invention can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0072] Today, facial recognition technology has matured, achieving a high level of accuracy. These successful training schemes are based on a unified paradigm: first, the cosine similarity between the training sample and all categories in the training set is calculated. The cosine similarity is then mapped and transformed. The Softmax function is then used to predict the probability of the sample being classified into each category. Finally, the cross-entropy loss is calculated with the sample's category label to optimize the model. This scheme has outperformed earlier schemes such as contrastive loss, triplet loss, and structured lifting loss, becoming the mainstream training scheme for facial recognition feature extraction models. Over the past three years, despite the increasing application of facial recognition technology, research results that can further optimize facial recognition systems have become increasingly scarce. Perhaps only by breaking away from the framework of this mainstream training scheme can the model be further improved.

[0073] Currently, mainstream face recognition loss functions fail to achieve true convergence. Regardless of the differences between two faces, the minimum cosine similarity between them is negative one. Therefore, regardless of the scaling factor, the cosine similarity between them will be converted to a small positive value after the Softmax function. This positive value can negatively impact the model during training, causing various adverse effects. This impact can be categorized into two aspects: First, it causes the central features of each category to constantly oscillate in the feature space during training, never reaching a stable state. Second, for face recognition tasks, due to the large number of categories, the number of irrelevant face pairs far exceeds the number of similar face pairs. When accumulated to a certain level, these small gradient perturbations can easily overwhelm the true optimization gradient, affecting the model's optimization progress. We propose a loss function whose convergence state is truly satisfying, called the FeasibleFace loss. By excluding the gradients of irrelevant faces, it achieves stable model training and ultimately improves the recognition capability of face recognition systems.

[0074] On the other hand, the core of mainstream face recognition training schemes is to process cosine similarity and then construct it into a classification problem for optimization. These processing methods include penalizing the similarity between samples and target class features, weighting the similarities of different samples, and scaling the overall similarity, which is the focus of most research. These penalty, weighting, and scaling coefficients significantly affect the final training results of the model. In many cases, the difference in results caused by parameter settings is far greater than the difference in training schemes. Moreover, the optimal hyperparameter settings vary for different fields and scenarios of face recognition applications, requiring time and manpower to adjust and test accordingly. Our proposed new face recognition training scheme constructs a loss function that deviates from the mainstream paradigm, simplifies all penalty, weighting, and scaling coefficients, and improves the model's ultimate recognition capabilities.

[0075] Furthermore, mainstream training solutions are often used in conjunction with the PartialFC method. This method splits the feature centers of different person categories and assigns them to different GPUs, reducing the GPU memory usage and accelerating model training. However, this also incurs additional inter-GPU communication overhead. In the PartialFC method, the Softmax function requires two inter-GPU communications to obtain the global maximum and perform the global summation, which reduces training efficiency to a certain extent. Our solution does not use the Softmax function, thus reducing the two inter-GPU communications and improving model training speed.

[0076] In summary, in order to optimize the problems of traditional face loss function such as unstable training, numerous hyperparameters, and the need for multiple GPU communications, the embodiment of the present invention proposes a face loss function and a corresponding training scheme that can satisfy the requirements. Based on the equal division of the feature space, the theoretical interval of positive and negative samples is calculated, and the optimization gradient between samples that exceed the theoretical interval is filtered to achieve a more stable, efficient and satisfactory loss function, ultimately accelerating the training of the face recognition feature model and improving the modeling and recognition capabilities of the face recognition system.

[0077] First, as Figure 1 As shown, an embodiment of the present invention discloses a training scheme for improving the ability of a face recognition model, the method comprising the following steps:

[0078] S1: Calculate the boundary threshold t in the feature space based on the number of training set categories c and the length of facial features d. The boundary threshold t is used to filter the gradient between face samples of different people;

[0079] S2: Construct a face loss function L that satisfies the face loss function FeasibleFace , the loss function expression is: That

[0080] In the equation, N represents the total number of samples. is the vector angle between the i-th sample feature and the corresponding category feature; θ j is the vector angle between the sample feature and the j-th category feature; t is the boundary threshold, t∈[-1,1];

[0081] S3: Train the model based on the gradient descent method, using the SGD optimizer and a dynamic learning rate strategy until the model converges;

[0082] S4: Obtain the optimized feature extraction model and build a face recognition system based on the model.

[0083] Specifically, the training process of the face recognition feature model is to increase the distance between different people in the training set in the feature space as much as possible. However, because the feature space is a hypersphere, the feature distance cannot increase infinitely. This makes it impossible for traditional loss functions such as ArcFace to reach the theoretical minimum value, that is, the convergence state of the model is unsatisfactory.

[0084] The embodiment of the present invention considers that there is a boundary threshold t. When the feature similarity of the face is less than t, it can be considered that the two faces are not the same person. Furthermore, if the interaction gradients between samples that are clearly different people during the training process are filtered out, the convergence condition can be lowered, so that the convergence state of the model can be met, such as Figure 2 As shown. Assuming that the training data is sufficient and evenly distributed, the optimal value of t satisfies the following conditions:

[0085] In a spherical feature space of a given dimension d, assuming that there are c IDs in the training set and each category does not overlap (this is the most ideal classification situation), then the area of ​​the partition interval of any given category is 1 / c of ​​the spherical area. Assuming that the boundary of this partition interval is a circle (in high-dimensional space, this boundary is approximately a circle), a classification hyperplane can be constructed based on this boundary. Let the side of the hyperplane facing the center of the feature space be the back side. When the sample feature is above the front side of the hyperplane, the sample belongs to the given category, otherwise it does not belong to the given category. The distance between the classification hyperplane and the center of the sphere is t that needs to be solved in this embodiment of the present invention.

[0086] Based on the above assumptions, t should satisfy the following equation:

[0087]

[0088] Where c is the number of training set categories (a positive integer), d is the length of the facial features (an even integer greater than or equal to 2), and t∈[-1,1]. The equation states that the area of ​​the surface in front of the hyperplane is equal to the area of ​​the hypersphere equal to 1 times the number of categories. Solving for t is the next step.

[0089] Let the indefinite integral be f(x) = ∫cos(x)d-2 dx, assuming d is an even number, the widely used facial feature dimensions of 128, 256, and 512 all meet the assumption. If d is an odd number, the formula derivation and calculation results will be different. Calculate the integral:

[0090]

[0091] Where C is a constant. Substitute the numerator and denominator of the integral term in equation 3 into the equation:

[0092]

[0093] Sin -1 (t) = x, is a constant, the equation to be solved can be transformed into:

[0094]

[0095] At this point, the specific value of x is still difficult to obtain, but the function is monotonic, and g(x) and g'(x) are both known, so an approximate solution can be obtained using Newton's method:

[0096]

[0097] x0=0

[0098]

[0099] When g(x n )<0.0001, then the iteration stops, and t=sin(x n ), the specific parameters of the loss function can be obtained;

[0100] Furthermore, based on the obtained t value, a face loss function L is constructed to satisfy FeasibleFace , the function form is as follows:

[0101]

[0102] in is the vector angle between the i-th sample feature and the corresponding ID category feature; θ j is the angle between the sample feature and the feature vector of the jth ID category; t is a constant hyperparameter, the determination of which is the core of this training scheme. t serves as a filtering threshold, filtering out gradients when the facial similarity between different faces is less than a given value. t also serves as a measure of the optimization scale, with the difference between the sample and the center similarity of the non-target category and t being used as the training gradient. We do not use any margin or scaling, and do not use softmax or cross entropy functions.

[0103] Furthermore, the model was trained based on the traditional gradient descent method using the SGD optimizer with a dynamic learning rate and a peak learning rate of 0.1. In the first 10% of iterations, the learning rate increased linearly from 0 to the peak value, and then decreased to 0 using a polynomial decay of exponent 2. The iterations were repeated until the model converged, and the total number of training rounds was 25.

[0104] The feature extraction model optimized based on the above process is shown in the full process diagram. Figure 3 , and build a face recognition system based on this model.

[0105] Further references Figure 4 As an implementation of the methods shown in the above figures, this application provides an embodiment of a training system for improving the ability of a face recognition model. The embodiment of the training system for improving the ability of a face recognition model is similar to Figure 1 Corresponding to the method embodiment shown, the system can be specifically applied to various electronic devices.

[0106] In a second aspect, an embodiment of the present invention further discloses a training system for improving the ability of a face recognition model, such as Figure 4 As shown, it includes: a threshold calculation module 41, a loss function module 42, a model training module 43 and a face recognition module 44.

[0107] In a specific embodiment, the threshold calculation module 41 is configured to calculate the boundary threshold t in the feature space according to the number of training set categories c and the length of the facial feature d, and the boundary threshold t is used to filter the gradient between the face samples of different people; the loss function module 42 is configured to construct a face loss function L based on the boundary threshold t. FeasibleFace , filter the gradients between non-similar face samples;

[0108] The model training module 43 is configured to train the model based on the gradient descent method, using the SGD optimizer and the dynamic learning rate strategy until the model converges; the face recognition module 44 is configured to build a face recognition system based on the optimized feature extraction model.

[0109] Preferably, Figure 5 As shown, the threshold calculation module 41 includes:

[0110] The space division unit 411 is used to divide the d-dimensional feature space into c equal intervals and construct a classification hyperplane;

[0111] An integral calculation unit 412 is used to calculate the ratio of the front area of ​​the hyperplane to the area of ​​the hypersphere, and derive a solution equation for the threshold value t;

[0112] The iterative solution unit 413 is configured to iteratively solve the equation using the Newton method to obtain an approximate value of the threshold value t.

[0113] The threshold calculation module 41 realizes the automatic derivation of the threshold t through space division, integral calculation and Newton iteration solution, enhances the adaptability of the model to the data dimension and number of categories, and reduces manual intervention.

[0114] Preferably, the face loss function L FeasibleFace The expression is:

[0115]

[0116] Where N represents the total number of samples, is the vector angle between the i-th sample feature and the corresponding category feature; θ j is the vector angle between the sample feature and the j-th category feature; t is the boundary threshold, t∈[-1,1].

[0117] Preferably, in the model training module 43, the dynamic learning rate strategy is: in the first 10% of the iteration rounds, the learning rate increases linearly from 0 to a peak learning rate of 0.1; in the remaining iteration rounds, the learning rate decays to 0 using a polynomial with an exponent of 2, and the iteration is repeated until the model converges, and the total number of training rounds is 25 rounds.

[0118] Preferably, the model training module 43 does not use the Softmax function during training, reducing the number of inter-GPU communications and improving training speed. The model training module 43 abandons the Softmax function, reduces the inter-GPU communication overhead, effectively improves training speed, and can significantly reduce computing costs and time consumption in industrial-grade scenarios.

[0119] The functions of the above modules correspond to the methods and will not be described in detail here.

[0120] This embodiment of the present invention implements a new face recognition training loss function, FeasibleFace. By increasing the influence of similar samples on the optimization gradient during feature extraction model training and reducing the gradient interaction between dissimilar faces, this improves model training stability. This allows the model to ultimately reach a better convergence state than traditional loss functions (such as CosFace and ArcFace), thereby enhancing the recognition capabilities of the face recognition system. Based on this new loss function, we have constructed a corresponding training scheme and system.

[0121] To compare the capabilities of FeasibleFace with CosFace and ArcFace, this example uses the same training settings as the original ArcFace paper. The model is trained on the MS1MV2 training set, using the same feature extraction network IResNet100, as well as the same batch size, number of training iterations, and learning rate curve. Accuracy is calculated on the LFW, CFP-FP, AgeDB, CALFW, and CPLFW test sets, and tar@1e-4 is calculated on the IJBC dataset as the evaluation metric. No data augmentation methods other than horizontal flipping are performed on either the training or test data. The results are shown in Table 1:

[0122] Loss Function LFW CFP-FP AgeDB CALFW CPLFW IJBC CosFace 99.81 98.12 98.11 95.76 92.28 96.37 ArcFace 99.83 98.27 98.28 95.45 92.08 96.03 FeasibleFace 99.85 98.27 98.22 96.23 93.00 96.38

[0123] Table 1: Performance of models trained with different loss functions on different test sets

[0124] As can be seen from Table 1, FeasibleFace is the best in most evaluation indicators, indicating that the present invention is effective in improving the recognition ability of the face recognition system.

[0125] On the other hand, the embodiment of the present invention compares the unit time training speed of ArcFace and FeasibleFace under the same hardware environment. The test hardware is an Intel Xeon E5-2620 CPU and a 4-way Quadro RTX 8000 GPU. The training speed under the MS1MV2 training set is statistically analyzed, as shown in Table 2.

[0126] Loss Function Training speed (Samples / sec) ArcFace 1316.7 FeasibleFace 1343.8

[0127] Table 2: Comparison of training speed of different loss functions

[0128] The results show that this scheme can improve the training speed by 2% compared with the most widely used ArcFace training scheme. This is a considerable improvement for training tasks in the industry that often require thousands of hours of GPU time.

[0129] In summary, the embodiments of the present invention propose a training scheme and system for improving the capabilities of face recognition models, which significantly reduces the number of hyperparameters required for training and reduces the parameter adjustment cost of the training system; moreover, this scheme can effectively improve the capabilities of the face recognition system; further, this scheme reduces the number of GPU communication operators during single gradient backpropagation, improves the system training speed, and creates more room for further optimization of the face recognition system.

[0130] Reference below Figure 6 , which shows a schematic structural diagram of a computer device 600 of an electronic device suitable for implementing an embodiment of the present invention. Figure 6 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention.

[0131] like Figure 6 As shown, the computer device 600 includes a central processing unit (CPU) 601 and a graphics processing unit (GPU) 602, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 603 or the program loaded from the storage part 609 to the random access memory (RAM) 604. Various programs and data required for the operation of the device 600 are also stored in the RAM 604. The CPU 601, GPU 602, ROM 603 and RAM 604 are connected to each other through a bus 605. An input / output (I / O) interface 606 is also connected to the bus 605.

[0132] The following components are connected to the I / O interface 606: an input section 607 including a keyboard, a mouse, and the like; an output section 608 including a display such as a liquid crystal display (LCD), a speaker, and the like; a storage section 609 including a hard disk and the like; and a communication section 610 including a network interface card such as a LAN card or a modem. The communication section 610 performs communication processing via a network such as the Internet. A drive 611 may also be connected to the I / O interface 606 as needed. A removable medium 612, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like, is installed in the drive 611 as needed, so that a computer program read therefrom can be installed into the storage section 609 as needed.

[0133] In particular, according to an embodiment disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment disclosed in the present invention includes a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication portion 610, and / or installed from a removable medium 612. When the computer program is executed by a central processing unit (CPU) 601 and a graphics processing unit (GPU) 602, the above-mentioned functions defined in the method of the present invention are performed.

[0134] It should be noted that the computer-readable medium described in the present invention may be a computer-readable signal medium or a computer-readable medium, or any combination thereof. Computer-readable media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor devices, apparatuses, or components, or any combination thereof. More specific examples of computer-readable media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution device, apparatus, or component. In the present invention, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution apparatus, device, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical cable, RF, or any suitable combination thereof.

[0135] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0136] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the devices, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based device that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0137] The modules involved in the embodiments of the present invention may be implemented in software or hardware, and may also be set in a processor.

[0138] As another aspect, the present invention further provides a computer-readable medium, which may be included in the electronic device described in the above embodiments, or may exist independently and not incorporated into the electronic device. The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the method and steps described in the first aspect.

[0139] The above description is merely an illustration of the preferred embodiments of the present invention and the technical principles employed. Those skilled in the art should understand that the scope of the invention is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned inventive concept. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in the present invention.

Claims

1. A training scheme for improving the ability of face recognition models, characterized by: The method comprises the following steps: S1: Calculate the boundary threshold t in the feature space based on the number of training set categories c and the length of facial features d. The boundary threshold t is used to filter the gradient between face samples of different people; S2: Construct a face loss function L that satisfies the face loss function FeasibleFace , the loss function expression is: Where N represents the total number of samples, is the vector angle between the i-th sample feature and the corresponding category feature; θ j is the vector angle between the sample feature and the j-th category feature; t is the boundary threshold, t∈[-1,1]; S3: Train the model based on the gradient descent method, using the SGD optimizer and a dynamic learning rate strategy until the model converges; S4: Obtain the optimized feature extraction model and build a face recognition system based on the model.

2. The training scheme for improving the ability of face recognition models according to claim 1, characterized in that: The method for calculating the boundary threshold t in the feature space in S1 includes: Assuming that the feature space is a d-dimensional hypersphere, the training set contains c categories and the features between categories do not overlap, construct a classification hyperplane, and the distance between the hyperplane and the center of the sphere is t; By integrating the surface area of ​​the front of the hyperplane to the area of ​​the hypersphere, we can establish the equation: front area / hypersphere area = 1 / c, that is: Where c is the number of training set categories, which is a positive integer, d is the length of the facial feature, d is an even number greater than or equal to 2, and t∈[-1,1]; The Newton method is used to iteratively solve the equation to obtain an approximate value of the threshold t. The iterative termination condition is g(x n )<0.0001, where g(x) is a monotonic function derived based on integration.

3. The training scheme for improving the ability of face recognition models according to claim 2, characterized in that: The solution of the approximate value of the boundary threshold t also includes: Let the indefinite integral be f(x) = ∫cos(x) d-2 dx, assuming d is an even number, the widely used facial feature dimensions of 128, 256, and 512 all meet the assumption. If d is an odd number, the formula derivation and calculation results will be different. Calculate the integral: Where C is a constant, and we substitute it into the numerator and denominator of the next equation, we have: Sin -1 (t) = x, is a constant, the equation to be solved can be transformed into: At this point, the specific value of x is still difficult to obtain, but the function is monotonic, and g(x) and g'(x) are both known, so an approximate solution can be obtained using Newton's method: x0=0 When g(x n )<0.0001, then the iteration stops, and t=sin(x n ), we can get the specific parameters of the loss function.

4. The training scheme for improving the ability of face recognition models according to claim 1, characterized in that: The dynamic learning rate strategy described in S3 is: In the first 10% of iterations, the learning rate increases linearly from 0 to a peak learning rate of 0.1; In the remaining iterations, the learning rate decays to 0 using a polynomial with an exponential of 2, and the iterations are repeated until the model converges. The total number of training rounds is 25.

5. The training scheme for improving the ability of face recognition models according to claim 1, characterized in that: The loss function L FeasibleFace No margining, scaling, Softmax function or cross entropy calculation is used.

6. A training system for improving the ability of a face recognition model, characterized in that: include: A threshold calculation module is configured to calculate a boundary threshold t in the feature space based on the number of training set categories c and the length of facial features d, wherein the boundary threshold t is used to filter the gradient between facial samples of different people; The loss function module is configured to construct a face loss function L based on the boundary threshold t. FeasibleFace , filter the gradients between non-similar face samples; The model training module is configured to train the model based on the gradient descent method, using the SGD optimizer and a dynamic learning rate strategy until the model converges; The face recognition module is configured to build a face recognition system based on the optimized feature extraction model.

7. The training scheme for improving the ability of face recognition models according to claim 6, characterized in that: The threshold calculation module includes: The space division unit is used to divide the d-dimensional feature space into c equal intervals and construct a classification hyperplane; An integral calculation unit is used to calculate the ratio of the front area of ​​the hyperplane to the area of ​​the hypersphere and derive the solution equation of the threshold t; The iterative solution unit is used to iteratively solve the equation by Newton's method to obtain an approximate value of the threshold value t.

8. The training scheme for improving the ability of face recognition models according to claim 6, characterized in that: The face loss function L FeasibleFace The expression is: Where N represents the total number of samples, is the vector angle between the i-th sample feature and the corresponding category feature; θ j is the vector angle between the sample feature and the j-th category feature; t is the boundary threshold, t∈[-1,1].

9. The training scheme for improving the ability of face recognition models according to claim 6, characterized in that: In the model training module, the dynamic learning rate strategy is: In the first 10% of iterations, the learning rate increases linearly from 0 to a peak learning rate of 0.1; In the remaining iterations, the learning rate decays to 0 using a polynomial with an exponential of 2, and the iterations are repeated until the model converges. The total number of training rounds is 25.

10. The training scheme for improving the ability of face recognition models according to claim 6, characterized in that: The model training module does not use the Softmax function during the training process, which reduces the number of communications between GPUs and improves the training speed.

11. An electronic device comprising: one or more processors; a storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the training scheme for improving the ability of the face recognition model as described in any one of claims 1 to 5.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the training scheme for improving the ability of the face recognition model as described in any one of claims 1 to 5.