Face recognition method, device, electronic device and computer-readable storage medium

By dividing face training data and performing feature aggregation across multiple neural network models, the method addresses low efficiency and accuracy issues in face recognition, improving training efficiency and accuracy.

CN114519884BActive Publication Date: 2024-12-17SHENZHEN XUMI YUNTU SPACE TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210144279.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-17
Publication Date
2024-12-17
Estimated Expiration
2042-02-17

AI Technical Summary

Technical Problem

Existing face recognition technologies suffer from low training efficiency and accuracy due to the limitations of joint learning methods, which require training on a single device like a GPU and do not effectively utilize multiple neural network models.

Method used

The method involves dividing face training data into parts corresponding to multiple neural network models, extracting data features using a forward algorithm, performing feature aggregation, determining weight matrices and logical calculation values, and updating network parameters to enhance model training efficiency and accuracy.

Benefits of technology

This approach improves model training efficiency and accuracy by distributing training data across multiple neural network models, enhancing recognition performance, especially for difficult examples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114519884B_ABST
    Figure CN114519884B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of artificial intelligence technology, and provides a face recognition method, device, electronic device, and computer-readable storage medium. The method includes: dividing face training data into multiple parts according to the number of neural network models to obtain training data corresponding to each neural network model; extracting data features of the training data corresponding to each neural network model through a forward algorithm according to each neural network model; performing feature aggregation operations on multiple data features to obtain aggregated features; obtaining the weight matrix of each neural network model, and determining the first logical calculation value corresponding to each neural network model according to the weight matrix and aggregated features of each neural network model; updating the network parameters of each neural network model based on the first logical calculation value corresponding to each neural network model; and using any neural network model to perform face recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a face recognition method, device, electronic device and computer-readable storage medium. Background Art

[0002] In model training, in order to reduce the pressure of training, the existing technology often adopts the joint learning method, which trains the neural network model through the data of multiple participants, obtains the participant model of each participant, aggregates the model parameters of the participant model of each participant, and obtains the final joint learning model. However, joint learning is for multi-party training. For the training of one party, the existing technology can only be trained through a training device, such as a GPU. The existing technology has the problems of low training efficiency and low accuracy of the trained model.

[0003] In the process of implementing the concept of the present disclosure, the inventors discovered that there are at least the following technical problems in the related art: low training efficiency during model training and low accuracy of the model after training. Summary of the invention

[0004] In view of this, the embodiments of the present disclosure provide a face recognition method, device, electronic device and computer-readable storage medium to solve the problems of low model training efficiency and low model accuracy after training in the prior art.

[0005] According to a first aspect of an embodiment of the present disclosure, a face recognition method is provided, comprising: dividing face training data into multiple parts according to the number of neural network models to obtain training data corresponding to each neural network model; extracting data features of the training data corresponding to each neural network model through a forward algorithm according to each neural network model; performing feature aggregation operations on multiple data features to obtain aggregated features; obtaining a weight matrix of each neural network model, and determining a first logical calculation value corresponding to each neural network model according to the weight matrix and the aggregated features of each neural network model; updating the network parameters of each neural network model based on the first logical calculation value corresponding to each neural network model; and performing face recognition using any neural network model.

[0006] According to a second aspect of an embodiment of the present disclosure, a face recognition device is provided, comprising: a division module, configured to divide face training data into multiple parts according to the number of neural network models, so as to obtain training data corresponding to each neural network model; an extraction module, configured to extract data features of the training data corresponding to each neural network model through a forward algorithm according to each neural network model; an aggregation module, configured to perform feature aggregation operations on multiple data features to obtain aggregated features; a determination module, configured to obtain a weight matrix of each neural network model, and determine a first logical calculation value corresponding to each neural network model according to the weight matrix and the aggregated features of each neural network model; an update module, configured to update the network parameters of each neural network model based on the first logical calculation value corresponding to each neural network model; and a recognition module, configured to perform face recognition using any neural network model.

[0007] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0008] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0009] Compared with the prior art, the embodiments of the present disclosure have the following beneficial effects: because the embodiments of the present disclosure divide the face training data into multiple parts according to the number of neural network models to obtain the training data corresponding to each neural network model; extract the data features of the training data corresponding to each neural network model through a forward algorithm according to each neural network model; perform feature aggregation operations on multiple data features to obtain aggregated features; obtain the weight matrix of each neural network model, and determine the first logical calculation value corresponding to each neural network model according to the weight matrix and aggregated features of each neural network model; update the network parameters of each neural network model based on the first logical calculation value corresponding to each neural network model; use any neural network model to perform face recognition, therefore, the above-mentioned technical means can solve the problems of low model training efficiency and low model accuracy after training in the prior art, thereby improving the model training efficiency and model accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0011] Figure 1 is a schematic diagram of an application scenario of an embodiment of the present disclosure;

[0012] Figure 2 is a flowchart of a face recognition method provided by an embodiment of the present disclosure;

[0013] Figure 3 is a structural schematic diagram of a face recognition device provided by an embodiment of the present disclosure;

[0014] Figure 4 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0015] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present disclosure. However, it should be clear to those skilled in the art that the present disclosure may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the present disclosure with unnecessary details.

[0016] A face recognition method and device according to an embodiment of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0017] Figure 1 Schematic diagram of an application scenario of an embodiment of the present disclosure. The application scenario may include terminal devices 1, 2 and 3, a server 4 and a network 5.

[0018] Terminal devices 1, 2 and 3 can be hardware or software. When terminal devices 1, 2 and 3 are hardware, they can be various electronic devices with display screens and supporting communication with server 4, including but not limited to smart phones, tablet computers, laptop portable computers and desktop computers, etc.; when terminal devices 1, 2 and 3 are software, they can be installed in the above electronic devices. Terminal devices 1, 2 and 3 can be implemented as multiple software or software modules, or as a single software or software module, and the embodiments of the present disclosure are not limited to this. Furthermore, various applications can be installed on terminal devices 1, 2 and 3, such as data processing applications, instant messaging tools, social platform software, search applications, shopping applications, etc.

[0019] The server 4 may be a server that provides various services, for example, a background server that receives a request sent by a terminal device that establishes a communication connection with the server, and the background server may receive and analyze the request sent by the terminal device, and generate a processing result. The server 4 may be a single server, or a server cluster composed of several servers, or a cloud computing service center, which is not limited in the embodiments of the present disclosure.

[0020] It should be noted that the server 4 can be hardware or software. When the server 4 is hardware, it can be various electronic devices that provide various services for the terminal devices 1, 2, and 3. When the server 4 is software, it can be multiple software or software modules that provide various services for the terminal devices 1, 2, and 3, or it can be a single software or software module that provides various services for the terminal devices 1, 2, and 3, and the embodiments of the present disclosure are not limited to this.

[0021] The network 5 can be a wired network connected by coaxial cable, twisted pair and optical fiber, or it can be a wireless network that can interconnect various communication devices without wiring, such as Bluetooth, Near Field Communication (NFC), infrared, etc., which is not limited in the embodiments of the present disclosure.

[0022] The user can establish a communication connection with the server 4 via the network 5 through the terminal devices 1, 2 and 3 to receive or send information, etc. It should be noted that the specific types, quantities and combinations of the terminal devices 1, 2 and 3, the server 4 and the network 5 can be adjusted according to the actual needs of the application scenario, and the embodiments of the present disclosure are not limited to this.

[0023] Figure 2 It is a flowchart of a face recognition method provided by an embodiment of the present disclosure. Figure 2 The face recognition method can be Figure 1 The terminal device or server executes. Figure 2 As shown, the face recognition method includes:

[0024] S201, dividing the face training data into multiple parts according to the number of neural network models to obtain training data corresponding to each neural network model;

[0025] S202, extracting data features of training data corresponding to each neural network model through a forward algorithm according to each neural network model;

[0026] S203, performing a feature aggregation operation on multiple data features to obtain an aggregated feature;

[0027] S204, obtaining a weight matrix of each neural network model, and determining a first logical calculation value corresponding to each neural network model according to the weight matrix and the aggregated features of each neural network model;

[0028] S205, updating the network parameters of each neural network model based on the first logical calculation value corresponding to each neural network model;

[0029] S206, using any neural network model to perform face recognition.

[0030] There is a neural network model on a GPU, and the types of neural network models on multiple GPUs are the same. Divide the face training data into multiple copies, distribute the multiple copies of training data to multiple GPUs, and then perform model training on multiple GPUs. The function of the forward algorithm is to calculate the influence of the input layer nodes on the hidden layer nodes, that is, to walk the neural network model forward: from the input layer to the hidden layer, and then to the output layer, and calculate the influence of each node on the nodes in the next layer. The feature aggregation operation can be an allgather operation. Determine the first logical calculation value corresponding to each neural network model based on the weight matrix and the aggregated features of each neural network model, respectively, by multiplying the weight matrix and the aggregated features of each neural network model, and determining the product result of each neural network model as the first logical calculation value corresponding to each neural network model.

[0031] According to the technical solution provided by the embodiment of the present disclosure, because the embodiment of the present disclosure divides the face training data into multiple parts according to the number of neural network models, so as to obtain the training data corresponding to each neural network model; according to each neural network model, the data features of the training data corresponding to each neural network model are extracted through the forward algorithm; the multiple data features are subjected to feature aggregation operation to obtain aggregated features; the weight matrix of each neural network model is obtained, and the first logical calculation value corresponding to each neural network model is determined according to the weight matrix and the aggregated features of each neural network model; the network parameters of each neural network model are updated based on the first logical calculation value corresponding to each neural network model; and any neural network model is used for face recognition. Therefore, the above-mentioned technical means can solve the problems of low model training efficiency and low model accuracy after training in the prior art, thereby improving the model training efficiency and the model accuracy.

[0032] In step S205, the network parameters of each neural network model are updated based on the first logical calculation value corresponding to each neural network model, including: performing a difficult example transformation operation on the first logical calculation value corresponding to each neural network model to obtain a second logical calculation value corresponding to each neural network model; performing a feature reduction operation on multiple second logical calculation values ​​to obtain a third logical calculation value corresponding to each neural network model; and updating the network parameters of each neural network model based on the third logical calculation value corresponding to each neural network model.

[0033] In the face training data, there are pictures that are not easy to recognize due to occlusion and other reasons, which are called difficult examples. The difficult examples belonging to the target object A can be called positive difficult examples of the target object A, and the difficult examples that do not belong to the target object A can be called negative difficult examples of the target object A. The low accuracy of the model obtained after training is largely caused by the low accuracy of the model in recognizing difficult examples. In the embodiment of the present disclosure, the relevant training of difficult examples is increased in the model training, thereby improving the accuracy of the model in recognizing difficult examples. The feature reduction operation can be an AllReduce operation. The AllReduce operation is an operation that reduces all target arrays (i.e., represents All) to a single array (i.e., represents Reduce). (For example, the gradient values ​​on all GPUs, assuming they are represented by arrays, are merged and the reduce operation is performed into an array, and returned to all GPUs).

[0034] Based on the third logical calculation value corresponding to each neural network model, the network parameters of each neural network model are updated, including: calculating the probability value and gradient value corresponding to each neural network model according to the third logical calculation value corresponding to each neural network model; based on the probability value and gradient value corresponding to each neural network model, the network parameters of each neural network model are updated by back propagation method.

[0035] The probability value corresponding to each neural network model can be obtained through the normalized exponential layer of each neural network model, and the gradient value corresponding to each neural network model can be obtained through the gradient function in each neural network model. Updating the network parameters of each neural network model by back propagation is a common method in model training and will not be described here.

[0036] Performing a difficult example transformation operation on the first logic calculation value corresponding to each neural network model to obtain a second logic calculation value corresponding to each neural network model, including: determining a negative logic calculation value corresponding to each neural network model from the first logic calculation value corresponding to each neural network model according to a standard angle and preset hyperparameters, wherein the first logic calculation value includes: a negative logic calculation value and a positive logic calculation value; performing a fixed hyperparameter transformation on the negative logic calculation value corresponding to each neural network model to obtain a second logic calculation value corresponding to each neural network model; or performing an adaptive hyperparameter transformation on the negative logic calculation value corresponding to each neural network model to obtain a second logic calculation value corresponding to each neural network model.

[0037] The standard angle is the angle corresponding to a standard positive logic calculation value. The negative logic calculation value indicates the probability value of a difficult example not belonging to the target object, and the positive logic calculation value indicates the probability value of a difficult example belonging to the target object. The negative logic calculation value and the positive logic calculation value corresponding to each neural network model can be determined from the first logic calculation value corresponding to each neural network model by the following formula according to the standard angle and preset hyperparameters:

[0038] cos(θ j )>cos(θ i +m);

[0039] θ i is the standard angle, m is the preset hyperparameter, cos(θ j ) is a negative logic calculation value, and the first logic calculation value corresponding to each neural network model is greater than cos(θ i +m) is determined as the negative logic calculation value, and the first logic calculation value corresponding to each neural network model is smaller than cos(θ i +m) is determined as a positive logic calculation value.

[0040] The negative logic calculation value corresponding to each neural network model can be transformed into a fixed hyperparameter using the following formula:

[0041] tcos(θ j )+α;

[0042] At this time, t and α are preset fixed values, and the result of the above formula is used as the second logical calculation value.

[0043] The following formula can be used to adaptively transform the negative logic calculation value corresponding to each neural network model:

[0044] cos(θ j )(t+cos(θ j ));

[0045] At this time, t and α will be dynamically adjusted with training, and the result of the above formula will be used as the second logical calculation value.

[0046] Performing a difficult example transformation operation on the first logic calculation value corresponding to each neural network model to obtain a second logic calculation value corresponding to each neural network model, including: determining the positive logic calculation value corresponding to each neural network model from the first logic calculation value corresponding to each neural network model according to a standard angle and preset hyperparameters, wherein the first logic calculation value includes: a negative logic calculation value and a positive logic calculation value; performing a fixed hyperparameter transformation on the positive logic calculation value corresponding to each neural network model to obtain the second logic calculation value corresponding to each neural network model; or performing an adaptive hyperparameter transformation on the positive logic calculation value corresponding to each neural network model to obtain the second logic calculation value corresponding to each neural network model.

[0047] The formula for fixed hyperparameter transformation and adaptive hyperparameter transformation of the positive logic calculation value corresponding to each neural network model is the same as the above formula for fixed hyperparameter transformation and adaptive hyperparameter transformation of the negative logic calculation value corresponding to each neural network model, except that the negative logic calculation value cos(θ j ) is replaced with a positive logic calculated value.

[0048] Performing a difficult example transformation operation on the first logical calculation value corresponding to each neural network model to obtain a second logical calculation value corresponding to each neural network model, including: determining a negative logical calculation value corresponding to each neural network model from the first logical calculation value corresponding to each neural network model according to a standard angle and preset hyperparameters, wherein the first logical calculation value includes: a negative logical calculation value and a positive logical calculation value; calculating the second logical calculation value corresponding to each neural network model according to the global false positive rate, the penalty coefficient, the false positive rate corresponding to each neural network model, and the negative logical calculation value.

[0049] The second logic calculation value corresponding to each neural network model is calculated by the following formula:

[0050] cos(θ j )+βr i + / r u + ;

[0051]

[0052] β is the penalty coefficient, which can be set in advance. u + is the global false positive rate, which can be set in advance, r i + is the false positive rate, which can be set in advance, F(cos(θ j)) is the weight function, whose value is related to the type of neural network model and cos(θ j ) related, T u is a threshold set in advance, n is the number of negative logic calculation values ​​corresponding to each neural network model, y i is the serial number of the current neural network model. The false positive rate is introduced into machine learning from medicine. The false positive rate indicates the probability of an image being recognized incorrectly.

[0053] In step S204, before obtaining the weight matrix of each neural network model and determining the first logical calculation value corresponding to each neural network model according to the weight matrix and aggregation features of each neural network model, it includes: obtaining the historical data features of the historical training data corresponding to each neural network model; determining the historical weight matrix corresponding to each neural network model according to the historical data features corresponding to each neural network model; determining the weight matrix of each neural network model according to the weighting coefficient, the historical data features of the historical training data corresponding to each neural network model and the historical weight matrix.

[0054] The weight matrix of each neural network model is determined by the following formula:

[0055] w new =(1-λ)w old +λf;

[0056] λ is the weighting coefficient, f is the historical data feature, w old is the historical weight matrix, w new is the weight matrix.

[0057] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0058] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.

[0059] Figure 3 FIG. 1 is a schematic diagram of a face recognition device provided by an embodiment of the present disclosure. Figure 3 As shown, the face recognition device includes:

[0060] A division module 301 is configured to divide the face training data into multiple parts according to the number of neural network models to obtain training data corresponding to each neural network model;

[0061] The extraction module 302 is configured to extract data features of the training data corresponding to each neural network model through a forward algorithm according to each neural network model;

[0062] Aggregation module 303, configured to perform feature aggregation operation on multiple data features to obtain aggregated features;

[0063] The determination module 304 is configured to obtain a weight matrix of each neural network model, and determine a first logical calculation value corresponding to each neural network model according to the weight matrix and the aggregated features of each neural network model;

[0064] An updating module 305 is configured to update the network parameters of each neural network model based on the first logical calculation value corresponding to each neural network model;

[0065] The recognition module 306 is configured to perform face recognition using any neural network model.

[0066] There is a neural network model on a GPU, and the types of neural network models on multiple GPUs are the same. Divide the face training data into multiple copies, distribute the multiple copies of training data to multiple GPUs, and then perform model training on multiple GPUs. The function of the forward algorithm is to calculate the influence of the input layer nodes on the hidden layer nodes, that is, to walk the neural network model forward: from the input layer to the hidden layer, and then to the output layer, and calculate the influence of each node on the nodes in the next layer. The feature aggregation operation can be an allgather operation. Determine the first logical calculation value corresponding to each neural network model based on the weight matrix and the aggregated features of each neural network model, respectively, by multiplying the weight matrix and the aggregated features of each neural network model, and determining the product result of each neural network model as the first logical calculation value corresponding to each neural network model.

[0067] According to the technical solution provided by the embodiment of the present disclosure, because the embodiment of the present disclosure divides the face training data into multiple parts according to the number of neural network models, so as to obtain the training data corresponding to each neural network model; according to each neural network model, the data features of the training data corresponding to each neural network model are extracted through the forward algorithm; the multiple data features are subjected to feature aggregation operation to obtain aggregated features; the weight matrix of each neural network model is obtained, and the first logical calculation value corresponding to each neural network model is determined according to the weight matrix and the aggregated features of each neural network model; the network parameters of each neural network model are updated based on the first logical calculation value corresponding to each neural network model; and any neural network model is used for face recognition. Therefore, the above-mentioned technical means can solve the problems of low model training efficiency and low model accuracy after training in the prior art, thereby improving the model training efficiency and the model accuracy.

[0068] Optionally, the update module 305 is also configured to perform a difficult-example transformation operation on the first logical calculation value corresponding to each neural network model to obtain a second logical calculation value corresponding to each neural network model; perform a feature reduction operation on multiple second logical calculation values ​​to obtain a third logical calculation value corresponding to each neural network model; and update the network parameters of each neural network model based on the third logical calculation value corresponding to each neural network model.

[0069] In the face training data, there are pictures that are not easy to recognize due to occlusion and other reasons, which are called difficult examples. The difficult examples belonging to the target object A can be called positive difficult examples of the target object A, and the difficult examples that do not belong to the target object A can be called negative difficult examples of the target object A. The low accuracy of the model obtained after training is largely caused by the low accuracy of the model in recognizing difficult examples. In the embodiment of the present disclosure, the relevant training of difficult examples is increased in the model training, thereby improving the accuracy of the model in recognizing difficult examples. The feature reduction operation can be an AllReduce operation. The AllReduce operation is an operation that reduces all target arrays (i.e., represents All) to a single array (i.e., represents Reduce). (For example, the gradient values ​​on all GPUs, assuming they are represented by arrays, are merged and the reduce operation is performed into an array, and returned to all GPUs).

[0070] Optionally, the update module 305 is also configured to calculate the probability value and gradient value corresponding to each neural network model according to the third logical calculation value corresponding to each neural network model; and update the network parameters of each neural network model by back propagation method based on the probability value and gradient value corresponding to each neural network model.

[0071] The probability value corresponding to each neural network model can be obtained through the normalized exponential layer of each neural network model, and the gradient value corresponding to each neural network model can be obtained through the gradient function in each neural network model. Updating the network parameters of each neural network model by back propagation is a common method in model training and will not be described here.

[0072] Optionally, the update module 305 is also configured to determine the negative logic calculation value corresponding to each neural network model from the first logic calculation value corresponding to each neural network model according to a standard angle and preset hyperparameters, wherein the first logic calculation value includes: a negative logic calculation value and a positive logic calculation value; perform a fixed hyperparameter transformation on the negative logic calculation value corresponding to each neural network model to obtain the second logic calculation value corresponding to each neural network model; or perform an adaptive hyperparameter transformation on the negative logic calculation value corresponding to each neural network model to obtain the second logic calculation value corresponding to each neural network model.

[0073] The standard angle is the angle corresponding to a standard positive logic calculation value. The negative logic calculation value indicates the probability value of a difficult example not belonging to the target object, and the positive logic calculation value indicates the probability value of a difficult example belonging to the target object. The negative logic calculation value and the positive logic calculation value corresponding to each neural network model can be determined from the first logic calculation value corresponding to each neural network model by the following formula according to the standard angle and preset hyperparameters:

[0074] cos(θ j )>cos(θ i +m);

[0075] θ i is the standard angle, m is the preset hyperparameter, cos(θ j ) is a negative logic calculation value, and the first logic calculation value corresponding to each neural network model is greater than cos(θ i +m) is determined as the negative logic calculation value, and the first logic calculation value corresponding to each neural network model is smaller than cos(θ i +m) is determined as a positive logic calculation value.

[0076] The negative logic calculation value corresponding to each neural network model can be transformed into a fixed hyperparameter using the following formula:

[0077] tcos(θ j )+α;

[0078] At this time, t and α are preset fixed values, and the result of the above formula is used as the second logical calculation value.

[0079] The following formula can be used to adaptively transform the negative logic calculation value corresponding to each neural network model:

[0080] cos(θ j )(t+cos(θ j ));

[0081] At this time, t and α will be adjusted dynamically with training.

[0082] Optionally, the update module 305 is also configured to determine the positive logic calculation value corresponding to each neural network model from the first logic calculation value corresponding to each neural network model according to a standard angle and preset hyperparameters, wherein the first logic calculation value includes: a negative logic calculation value and a positive logic calculation value; perform a fixed hyperparameter transformation on the positive logic calculation value corresponding to each neural network model to obtain the second logic calculation value corresponding to each neural network model; or perform an adaptive hyperparameter transformation on the positive logic calculation value corresponding to each neural network model to obtain the second logic calculation value corresponding to each neural network model.

[0083] The formula for fixed hyperparameter transformation and adaptive hyperparameter transformation of the positive logic calculation value corresponding to each neural network model is the same as the above formula for fixed hyperparameter transformation and adaptive hyperparameter transformation of the negative logic calculation value corresponding to each neural network model, except that the negative logic calculation value cos(θ j ) is replaced with a positive logic calculated value.

[0084] Optionally, the update module 305 is also configured to determine the negative logic calculation value corresponding to each neural network model from the first logic calculation value corresponding to each neural network model according to the standard angle and preset hyperparameters, wherein the first logic calculation value includes: a negative logic calculation value and a positive logic calculation value; and calculate the second logic calculation value corresponding to each neural network model according to the global false positive rate, the penalty coefficient, the false positive rate corresponding to each neural network model and the negative logic calculation value.

[0085] The second logic calculation value corresponding to each neural network model is calculated by the following formula:

[0086] cos(θ j )+βr i + / r u + ;

[0087]

[0088] β is the penalty coefficient, which can be set in advance. u + is the global false positive rate, which can be set in advance, r i + is the false positive rate, which can be set in advance, F(cos(θ j )) is the weight function, whose value is related to the type of neural network model and cos(θ j ), Tu is a threshold set in advance, n is the number of negative logic calculation values ​​corresponding to each neural network model, y i is the serial number of the current neural network model.

[0089] Optionally, the determination module 304 is also configured to obtain historical data features of historical training data corresponding to each neural network model; determine the historical weight matrix corresponding to each neural network model based on the historical data features corresponding to each neural network model; determine the weight matrix of each neural network model based on the weighting coefficient, the historical data features of the historical training data corresponding to each neural network model and the historical weight matrix.

[0090] The weight matrix of each neural network model is determined by the following formula:

[0091] w new=(1-λ)w old +λf;

[0092] λ is the weighting coefficient, f is the historical data feature, w old is the historical weight matrix, w new is the weight matrix.

[0093] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure.

[0094] Figure 4 Schematic diagram of an electronic device 4 provided in an embodiment of the present disclosure. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 401, a memory 402, and a computer program 403 stored in the memory 402 and executable on the processor 401. When the processor 401 executes the computer program 403, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 401 executes the computer program 403, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0095] Exemplarily, the computer program 403 may be divided into one or more modules / units, which are stored in the memory 402 and executed by the processor 401 to complete the present disclosure. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 403 in the electronic device 4.

[0096] The electronic device 4 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 4 may include, but is not limited to, a processor 401 and a memory 402. Those skilled in the art will appreciate that Figure 4 It is only an example of the electronic device 4 and does not constitute a limitation of the electronic device 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0097] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0098] The memory 402 may be an internal storage unit of the electronic device 4, for example, a hard disk or memory of the electronic device 4. The memory 402 may also be an external storage device of the electronic device 4, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. Further, the memory 402 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 402 is used to store computer programs and other programs and data required by the electronic device. The memory 402 may also be used to temporarily store data that has been output or is to be output.

[0099] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0100] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0101] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.

[0102] In the embodiments provided in the present disclosure, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. Multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection of devices or units, which may be electrical, mechanical or other forms.

[0103] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0104] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0105] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present disclosure implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.

[0106] The above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should all be included in the protection scope of the present disclosure.

Claims

1. A face recognition method, characterized in that: include: Dividing the face training data into multiple parts according to the number of neural network models to obtain training data corresponding to each of the neural network models; According to each of the neural network models, respectively, data features of the training data corresponding to each of the neural network models are extracted by a forward algorithm; Performing a feature aggregation operation on the plurality of data features to obtain an aggregated feature; Obtaining a weight matrix of each of the neural network models, and determining a first logical calculation value corresponding to each of the neural network models according to the weight matrix of each of the neural network models and the aggregated features; Based on the first logical calculation value corresponding to each of the neural network models, the network parameters of each of the neural network models are updated; Using any one of the neural network models to perform face recognition; The updating of the network parameters of each neural network model based on the first logical calculation value corresponding to each neural network model comprises: Performing a difficult example transformation operation on the first logical calculation value corresponding to each of the neural network models to obtain a second logical calculation value corresponding to each of the neural network models; Performing a feature reduction operation on the plurality of second logic calculation values ​​to obtain a third logic calculation value corresponding to each of the neural network models; Based on the third logical calculation value corresponding to each of the neural network models, the network parameters of each of the neural network models are updated; The step of performing a difficult example transformation operation on the first logic calculation value corresponding to each of the neural network models to obtain a second logic calculation value corresponding to each of the neural network models includes: By means of a first formula, according to a standard angle and preset hyperparameters, a negative logic calculation value corresponding to each neural network model is determined from the first logic calculation value corresponding to each neural network model, wherein the first logic calculation value includes: the negative logic calculation value and the positive logic calculation value; the standard angle is an angle corresponding to a standard positive logic calculation value; Performing a fixed hyperparameter transformation on the negative logic calculation value corresponding to each of the neural network models to obtain a second logic calculation value corresponding to each of the neural network models; or Performing an adaptive hyperparameter transformation on the negative logic calculation value corresponding to each of the neural network models to obtain a second logic calculation value corresponding to each of the neural network models; The first formula is: cos(θ j )>cos(θ i +m); θ i is the standard angle, m is the preset hyperparameter, cos(θ j ) is a negative logic calculation value.

2. The method according to claim 1, characterized in that The updating of the network parameters of each neural network model based on the third logic calculation value corresponding to each neural network model comprises: Calculate the probability value and the gradient value corresponding to each of the neural network models according to the third logic calculation value corresponding to each of the neural network models; Based on the probability value and gradient value corresponding to each neural network model, the network parameters of each neural network model are updated by back propagation method.

3. The method according to claim 1, characterized in that The performing a difficult example transformation operation on the first logic calculation value corresponding to each of the neural network models to obtain a second logic calculation value corresponding to each of the neural network models may include: According to the standard angle and the preset hyperparameters, a positive logic calculation value corresponding to each of the neural network models is determined from the first logic calculation values ​​corresponding to each of the neural network models, wherein the first logic calculation value includes: a negative logic calculation value and the positive logic calculation value; Performing a fixed hyperparameter transformation on the positive logic calculation value corresponding to each of the neural network models to obtain a second logic calculation value corresponding to each of the neural network models; or An adaptive hyperparameter transformation is performed on the positive logic calculation value corresponding to each of the neural network models to obtain a second logic calculation value corresponding to each of the neural network models.

4. The method according to claim 1, characterized in that: The performing a difficult example transformation operation on the first logic calculation value corresponding to each of the neural network models to obtain a second logic calculation value corresponding to each of the neural network models may include: According to the standard angle and the preset hyperparameters, a negative logic calculation value corresponding to each neural network model is determined from the first logic calculation value corresponding to each neural network model, wherein the first logic calculation value includes: the negative logic calculation value and the positive logic calculation value; According to the global false positive rate, the penalty coefficient, the false positive rate corresponding to each of the neural network models and the negative logic calculation value, the second logic calculation value corresponding to each of the neural network models is calculated.

5. The method according to claim 1, characterized in that The step of obtaining the weight matrix of each neural network model and determining the first logical calculation value corresponding to each neural network model according to the weight matrix of each neural network model and the aggregated feature includes: Obtaining historical data features of historical training data corresponding to each of the neural network models; Determine a historical weight matrix corresponding to each neural network model according to the historical data features corresponding to each neural network model; The weight matrix of each neural network model is determined according to the weighting coefficient, the historical data features of the historical training data corresponding to each neural network model and the historical weight matrix.

6. A face recognition device, characterized in that: include: A division module is configured to divide the face training data into multiple parts according to the number of neural network models to obtain training data corresponding to each of the neural network models; An extraction module is configured to extract data features of the training data corresponding to each neural network model through a forward algorithm according to each neural network model; An aggregation module is configured to perform a feature aggregation operation on the plurality of data features to obtain an aggregated feature; A determination module is configured to obtain a weight matrix of each of the neural network models, and determine a first logical calculation value corresponding to each of the neural network models according to the weight matrix of each of the neural network models and the aggregated features; An updating module is configured to update the network parameters of each neural network model based on the first logic calculation value corresponding to each neural network model; including: performing a hard case transformation operation on the first logic calculation value corresponding to each neural network model to obtain a second logic calculation value corresponding to each neural network model; performing a feature reduction operation on a plurality of the second logic calculation values ​​to obtain a third logic calculation value corresponding to each neural network model; and updating the network parameters of each neural network model based on the third logic calculation value corresponding to each neural network model; A recognition module, configured to perform face recognition using any one of the neural network models; The update module is specifically configured to: determine the negative logic calculation value corresponding to each neural network model from the first logic calculation value corresponding to each neural network model according to the standard angle and the preset hyperparameters through the first formula, wherein the first logic calculation value includes: the negative logic calculation value and the positive logic calculation value; the standard angle is an angle corresponding to a standard positive logic calculation value; calculate the second logic calculation value corresponding to each neural network model according to the global false positive rate, the penalty coefficient, the false positive rate corresponding to each neural network model and the negative logic calculation value; The first formula is: cos(θ j )>cos(θ i +m); θ i is the standard angle, m is the preset hyperparameter, cos(θ j ) is a negative logic calculation value.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Machine learning model training method, device and system, equipment and storage medium

    CN112257873A

  • Vehicle insurance scoring method and device based on federated learning, equipment and storage medium

    CN112446791A

  • Federal learning-based model training method and device, and federal learning system

    CN112862011A

  • Federal learning method and device, electronic equipment and storage medium

    CN113158550A