Face recognition method, device, equipment and storage medium based on federated learning
Through the face recognition method of federated learning, the encrypted interaction between the client and the server avoids data leakage, solves the problem of low mask face recognition performance and privacy leakage, and achieves accurate recognition of mask faces and user operations. Convenience.
Patent Information
- Application Number
- CN202011280331.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-16
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-11-16
AI Technical Summary
Existing face recognition algorithms have low performance when using masks to recognize faces, are difficult to identify accurately, and have the risk of leaking private information, affecting user convenience and security.
Using a face recognition method based on federated learning, the user's face image feature vector is obtained and encrypted through the client, and the server performs statistical processing and model updates to avoid data leakage and improve recognition accuracy and security.
It achieves accurate and rapid recognition of faces in masks, reduces the risk of infectious disease transmission, improves user convenience and data security, and solves the problems of low face recognition performance and privacy leakage in existing technologies.
Smart Images

Figure CN112381000B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial technology (Fintech), and in particular to a face recognition method, device, equipment and storage medium based on federated learning. Background Art
[0002] With the development of computer technology, more and more technologies are being applied in the financial field. Traditional finance is gradually transforming into financial technology. However, due to the security and real-time requirements of the financial industry, higher requirements are also placed on technology. During the epidemic, the behavior of all people wearing masks can effectively prevent the spread of the epidemic. However, at the same time, users will encounter great difficulties when using facial recognition for identity authentication.
[0003] Existing face recognition methods, such as DeepFace, FaceNet and other face recognition algorithms, have good recognition performance for normal face recognition and can accurately and quickly identify facial features. However, if these face recognition algorithms are applied to face recognition with masks, the performance of these face recognition algorithms will be greatly reduced due to the large number of facial feature points being blocked by masks, making it difficult to exert their recognition performance and promote their use. At the same time, there is a risk of leaking the privacy information of masked faces. For example, when users use face recognition for payment, transfer, unlocking mobile phone screens and other operations in public places such as subways and shopping malls, they usually need to take off their masks, which will increase the health risks of the spread of the epidemic and reduce the convenience of user operation.
[0004] In summary, there is an urgent need for a face recognition method based on federated learning to solve the problem of low recognition performance of face recognition algorithms for masked faces in the existing technology and to improve the convenience of user operation. Summary of the invention
[0005] The present invention provides a face recognition method, device, equipment and storage medium based on federated learning, which are used to solve the problem of low recognition performance of face recognition algorithms for masked faces in the prior art and improve the convenience of user operation.
[0006] In a first aspect, the present invention provides a face recognition method based on federated learning, comprising:
[0007] The client obtains M first face pictures of the user, where M is an integer greater than 1;
[0008] The client inputs the M first face images into the face recognition model respectively to obtain M face feature vectors, and encrypts the M face feature vectors and feeds them back to the server;
[0009] The client receives the encrypted loss function value sent by the server, where the loss function value is determined by the server according to the M facial feature vectors and the user's reference facial feature;
[0010] The client updates the face recognition model according to the decrypted loss function value until the face recognition model converges or reaches a preset iterative training round, thereby obtaining a trained mask face recognition model.
[0011] In the above technical scheme, M first face images are respectively input into the face recognition model for training, M face feature vectors are obtained, and the M face feature vectors are encrypted and fed back to the server, so that the server performs statistical processing on the decrypted M face feature vectors and the user's benchmark face features through a preset loss function to determine the loss function value. Then the model parameters of the face recognition model are updated according to the loss function value until a trained mask face recognition model is obtained. Since the interaction between the client and the server does not include the mask face image training data of the client, and the interactive M face feature vectors and the loss function value are encrypted, the leakage of user privacy data can be effectively avoided, thereby helping to improve the security of the data, and based on the trained mask face recognition model, the mask face is recognized, and the user to whom the mask face belongs can be accurately and quickly recognized, effectively reducing the risk of infectious disease transmission, and helping to improve the convenience of user operation, thereby solving the problem that the face recognition algorithm in the prior art has low recognition performance for mask faces and the risk of leaking mask face privacy information.
[0012] Optionally, before the client obtains the M first face pictures of the user wearing a mask, the method further includes:
[0013] The client sends the encrypted identity ID of the user to the server;
[0014] The client receives training sample indication information sent by the server, where the training sample indication information is used to indicate the number of mask face image training samples uploaded by the client or identifiers corresponding to the uploaded training samples.
[0015] In the above technical solution, since the interaction between the client and the server does not include the client's facial image training data, only the user's identity ID or training sample indication information is exchanged, and the user's identity ID or training sample indication information is encrypted, it can effectively avoid the leakage of the user's facial privacy data and help improve the security of the data. In addition, the training sample indication information allows the client to upload a corresponding number of facial feature vectors according to the number of mask face image training samples required by the server, so that the server can determine the loss function value based on the corresponding number of facial feature vectors and use it to update the client's local face recognition model.
[0016] Optionally, the client obtains M first face pictures of the user with the attribute of wearing a mask, including:
[0017] The client obtains M second face pictures of the user with the attribute of wearing a mask;
[0018] The client performs a resection process on the M second face images according to a preset resection rule to obtain the M first face images; the first face images are images of the face above the bridge of the nose.
[0019] In the above technical scheme, since the mask covering position is of little significance for training the mask face recognition model, the M second face images are cut off according to the preset cut-off rules, and only the images above the bridge of the nose are input into the face recognition model for processing. This can reduce the data processing volume of the preset mask face recognition model, thereby improving the training efficiency of the preset mask face recognition model, and can effectively reduce the transmission bandwidth load when the face feature vector is subsequently transmitted to the server.
[0020] Optionally, after obtaining the trained mask face recognition model, the method further includes:
[0021] The client obtains a face recognition request of the user, where the face recognition request includes a third face picture of the user wearing a mask;
[0022] The client inputs the third face image into the mask face recognition model for recognition, obtains the face recognition result of the user, and determines whether the user is a target user based on the face recognition result of the user;
[0023] If so, the client determines that the user authentication is successful.
[0024] In the above technical solution, when the client uses the trained mask face recognition model, the face picture with the attribute of wearing a mask can be directly input into the mask face recognition model for recognition, and the face recognition result can be compared with the face of the real user to directly determine whether the user is a real user, thereby effectively ensuring the security of the user's privacy data and helping to improve data security.
[0025] Optionally, after obtaining the trained mask face recognition model, the method further includes:
[0026] The client encrypts the model parameters of the mask face recognition model;
[0027] The client stores the encrypted model parameters in the server.
[0028] Optionally, the method further comprises:
[0029] After the initial installation, the client sends a parameter update request to the server;
[0030] The client receives a parameter update response carrying encrypted model parameters; the encrypted model parameters are determined by the server according to the user identity ID in the parameter update request;
[0031] The client updates the face recognition model in the client according to the encrypted model parameters to obtain a mask face recognition model.
[0032] In the above technical solution, when the client is first installed, the client only needs to send a model parameter request to the server to obtain the model parameters of the mask face recognition model corresponding to the client. Then, the initial model parameters of the locally stored face recognition model are updated according to the model parameters of the mask face recognition model, and a directly used mask face recognition model can be obtained. The user's face picture is recognized based on the updated mask face recognition model, which can effectively save the user's time in training the mask face recognition model and help improve the efficiency of recognizing the user's mask face picture.
[0033] In a second aspect, the present invention provides a face recognition method based on federated learning, comprising:
[0034] The server obtains the encrypted M facial feature vectors sent by the client, where M is an integer greater than 1;
[0035] The server decrypts the encrypted M facial feature vectors to obtain decrypted M facial feature vectors;
[0036] The server performs statistical processing on the decrypted M facial feature vectors and the user's reference facial features through a preset loss function to determine a loss function value;
[0037] The server sends the encrypted loss function value to the client; the client is used to update the face recognition model according to the decrypted loss function value until the face recognition model converges or reaches a preset iterative training round, thereby obtaining a trained mask face recognition model.
[0038] In the above technical solution, the encrypted M personal face feature vectors are decrypted, and the decrypted M personal face feature vectors and the user's reference face features are statistically processed through a preset loss function to determine the loss function value, and then the encrypted loss function value is sent to the client, so that the client updates the face recognition model and obtains a trained mask face recognition model. Since the interaction between the client and the server does not include the client's face picture training data, and the interactive M personal face feature vectors and the loss function value are encrypted, the leakage of user privacy data can be effectively avoided, thereby helping to improve data security, and based on the trained mask face recognition model, the mask face can be recognized, and the user to whom the mask face belongs can be accurately and quickly identified, effectively reducing the risk of infectious disease transmission, and helping to improve the convenience of user operation, thereby solving the problem that the face recognition algorithm in the prior art has low recognition performance for mask faces and the risk of leaking mask face privacy information.
[0039] Optionally, before the server obtains the encrypted M facial feature vectors sent by the client, the method further includes:
[0040] The server obtains the encrypted user identity ID sent by the client;
[0041] The server decrypts the encrypted user identity ID to obtain a decrypted user identity ID;
[0042] The server determines corresponding training sample indication information according to the decrypted user identity ID, where the training sample indication information is used to indicate the number of facial feature vectors corresponding to the training samples uploaded by the client or the identifiers corresponding to the uploaded training samples;
[0043] The server sends the encrypted training sample indication information to the client; the client is used to determine the corresponding M first face images with mask wearing attributes based on the decrypted training sample indication information, and perform excision processing on the M first face images with mask wearing attributes to obtain M first face images, and input the M first face images into the face recognition model for training respectively to obtain the M face feature vectors.
[0044] In the above technical solution, since the interaction between the client and the server does not include the client's face picture training data, only the user's identity ID or training sample indication information is exchanged, and the user's identity ID or training sample indication information is encrypted, it can ensure that the user's face privacy data is effectively prevented from being leaked, and help improve data security. In addition, the corresponding training sample indication information is determined based on the user's identity ID, and the training sample indication information can enable the client logged in by the user's identity ID to upload a corresponding number of face feature vectors according to the number of face feature vectors corresponding to the training samples required by the server, so that the server determines the loss function value based on the corresponding number of face feature vectors and uses it to update the client's local face recognition model.
[0045] Optionally, the server performs statistical processing on the decrypted M facial feature vectors and the user's reference facial features through a preset loss function to determine a loss function value, including:
[0046] The server calculates the loss function values of the decrypted M facial feature vectors and the user's reference facial features respectively through the preset loss function to obtain M first loss function values;
[0047] The server performs weighted processing on the M first loss function values to obtain the processed loss function value.
[0048] In the above technical solution, weighted processing is performed on the M first loss function values, and the processed loss function values are encrypted and sent to the client, so that the client can update the local face recognition model according to the loss function value, thereby providing support for subsequent training to obtain a mask face recognition model.
[0049] In a third aspect, the present invention further provides a face recognition device based on federated learning, comprising:
[0050] A first acquisition unit, configured to acquire M first face images of a user, wherein M is an integer greater than 1;
[0051] The first processing unit is used to input the M first face images into the face recognition model respectively, obtain M face feature vectors, and encrypt the M face feature vectors and feed them back to the server; receive the encrypted loss function value sent by the server, where the loss function value is determined by the server according to the M face feature vectors and the user's baseline face features; update the face recognition model according to the decrypted loss function value until the face recognition model converges or reaches a preset iterative training round, so as to obtain a trained mask face recognition model.
[0052] Optionally, the first processing unit is further configured to:
[0053] Sending the encrypted user's identity ID to the server;
[0054] Receive training sample indication information sent by the server, where the training sample indication information is used to indicate the number of mask face image training samples uploaded by the client or the identifier corresponding to the uploaded training sample.
[0055] Optionally, the first processing unit is specifically configured to:
[0056] Obtain M second face pictures of the user with the attribute of wearing a mask;
[0057] The M second face images are subjected to excision processing according to a preset excision rule to obtain the M first face images; the M first face images are all images of the face above the bridge of the nose.
[0058] Optionally, the first processing unit is further configured to:
[0059] Obtaining a face recognition request of the user, wherein the face recognition request includes a third face image of the user wearing a mask;
[0060] Inputting the third face image into the mask face recognition model for recognition, obtaining a face recognition result of the user, and determining whether the user is a target user based on the face recognition result of the user;
[0061] If so, it is determined that the user verification is successful.
[0062] Optionally, the first processing unit is further configured to:
[0063] Encrypting the model parameters of the mask face recognition model;
[0064] The encrypted model parameters are stored in the server.
[0065] Optionally, the first processing unit is further configured to:
[0066] After initial installation, sending a parameter update request to the server;
[0067] receiving a parameter update response carrying an encrypted model parameter; the encrypted model parameter is determined by the server according to the user identity ID in the parameter update request;
[0068] The face recognition model in the client is updated according to the encrypted model parameters to obtain a mask face recognition model.
[0069] In a fourth aspect, the present invention further provides a face recognition device based on federated learning, comprising:
[0070] A second acquisition unit is used for the encrypted M facial feature vectors sent by the client, where M is an integer greater than 1;
[0071] The second processing unit is used to decrypt the M encrypted facial feature vectors to obtain the decrypted M facial feature vectors; perform statistical processing on the decrypted M facial feature vectors and the user's benchmark facial features through a preset loss function to determine the loss function value; send the encrypted loss function value to the client; the client is used to update the face recognition model according to the decrypted loss function value until the face recognition model converges or reaches a preset iterative training round, thereby obtaining a trained mask face recognition model.
[0072] Optionally, the second processing unit is further used for:
[0073] Obtaining the encrypted user identity ID sent by the client;
[0074] Decrypting the encrypted user's identity ID to obtain a decrypted user's identity ID;
[0075] Determine corresponding training sample indication information according to the decrypted user's identity ID, where the training sample indication information is used to indicate the number of mask face image training samples uploaded by the client or the identifier corresponding to the uploaded training sample;
[0076] The encrypted training sample indication information is sent to the client; the client is used to determine the corresponding M second face images with mask wearing attributes according to the decrypted training sample indication information, and perform excision processing on the M second face images with mask wearing attributes to obtain M first face images, and input the M first face images into the face recognition model for training respectively to obtain the M face feature vectors.
[0077] Optionally, the second processing unit is specifically configured to:
[0078] Calculating the loss function values of the decrypted M facial feature vectors and the user's benchmark facial features respectively through the preset loss function to obtain M first loss function values;
[0079] The M first loss function values are weighted to obtain the processed loss function value.
[0080] In a fifth aspect, the present invention provides a computing device, comprising:
[0081] Memory for storing computer programs;
[0082] The processor is used to call the computer program stored in the memory and execute the face recognition method based on federated learning according to the obtained program.
[0083] In a sixth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer-executable program, and the computer-executable program is used to enable a computer to execute a face recognition method based on federated learning. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0085] Figure 1 A schematic diagram of a system architecture provided by an embodiment of the present invention;
[0086] Figure 2 A flowchart of a face recognition method based on federated learning provided by an embodiment of the present invention;
[0087] Figure 3 A structural schematic diagram of a face recognition device based on federated learning provided by an embodiment of the present invention;
[0088] Figure 4 A schematic diagram of the structure of another face recognition device based on federated learning provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0089] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0090] Figure 1 A system architecture is provided for an embodiment of the present invention. Figure 1 As shown, the system architecture may be a server 100 , including a processor 110 , a communication interface 120 , and a memory 130 .
[0091] The communication interface 120 is used to communicate with the terminal device, send and receive information transmitted by the terminal device, and realize communication.
[0092] The processor 110 is the control center of the server 100, and uses various interfaces and lines to connect various parts of the entire server 100, and executes various functions of the server 100 and processes data by running or executing software programs and / or modules stored in the memory 130, and calling data stored in the memory 130. Optionally, the processor 110 may include one or more processing units.
[0093] The memory 130 can be used to store software programs and modules. The processor 110 executes various functional applications and data processing by running the software programs and modules stored in the memory 130. The memory 130 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function, etc.; the data storage area can store data created according to business processing, etc. In addition, the memory 130 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0094] It should be noted that the above Figure 1 The structure shown is only an example and is not limited to this embodiment of the present invention.
[0095] Based on the above description, Figure 2 The process of a face recognition method based on federated learning provided by an embodiment of the present invention is exemplarily shown, and the process can be executed by a face recognition device based on federated learning.
[0096] like Figure 2 As shown in the figure, the process specifically includes:
[0097] Step 201: The client obtains M first face pictures of the user.
[0098] Step 202: The client inputs the M first face images into a face recognition model respectively to obtain M face feature vectors.
[0099] Step 203: The client sends the encrypted M facial feature vectors to the server.
[0100] Step 204: the server decrypts the encrypted M facial feature vectors to obtain decrypted M facial feature vectors.
[0101] Step 205: The server performs statistical processing on the decrypted M facial feature vectors and the user's reference facial features through a preset loss function to determine a loss function value.
[0102] Step 206: The server sends the encrypted loss function value to the client.
[0103] Step 207: The client updates the face recognition model according to the decrypted loss function value until the face recognition model converges or reaches a preset iterative training round, thereby obtaining a trained mask face recognition model.
[0104] In the above step 201, before obtaining the M first face pictures of the user, the client needs to send the encrypted user's identity ID to the server so that the server can decrypt the encrypted user's identity ID and determine the corresponding training sample indication information according to the decrypted user's identity ID. The training sample indication information is used to indicate the number of mask face picture training samples uploaded by the client or the corresponding identification of the uploaded training samples, that is, the server needs the client to upload the number of mask face picture training samples corresponding to the face feature vectors to calculate the loss function. Then, the client obtains the user's M second face pictures with mask wearing attributes, and performs a resection process on the M second face pictures according to the preset resection rules to obtain M first face pictures. Among them, the M first face pictures are all pictures of the position above the bridge of the nose in the face.
[0105] It should be noted that, since the interaction between the client and the server does not include the client's face picture training data, only the user's identity ID or training sample indication information is exchanged, and the user's identity ID or training sample indication information is encrypted, so that the leakage of the user's face privacy data can be effectively avoided, and it helps to improve the security of the data. In this way, the training sample indication information can enable the client to upload the corresponding number of face feature vectors according to the number of mask face picture training samples required by the server, so that the server can determine the loss function value according to the corresponding number of face feature vectors and use it to update the client's local face recognition model. In addition, since the mask covering position is not very meaningful for training the mask face recognition model, the M second face pictures are cut off by the preset cutting rule, and only the pictures above the bridge of the nose in the face are input into the face recognition model for processing, which can reduce the data processing amount of the preset mask face recognition model, thereby improving the training efficiency of the preset mask face recognition model, and for the subsequent transmission of the face feature vector to the server, the transmission bandwidth load can be effectively reduced.
[0106] In the above steps 202 and 203, the client inputs the M first face images into the face recognition model for training respectively, obtains M face feature vectors, and sends the encrypted M face feature vectors to the server so that the server processes the encrypted M face feature vectors accordingly.
[0107] In the above steps 204, 205 and 206, before receiving the encrypted M face feature vectors, the server obtains the encrypted user's identity ID sent by the client, and decrypts the encrypted user's identity ID to obtain the decrypted user's identity ID. Then, according to the decrypted user's identity ID, the corresponding training sample indication information is determined, and the training sample indication information is used to indicate the number of mask face image training samples uploaded by the client or the identifier corresponding to the uploaded training sample. After that, the encrypted training sample indication information is sent to the client, and the client is used to determine the corresponding M second face images with mask attributes according to the decrypted training sample indication information, and the M second face images with mask attributes are cut off to obtain M first face images, and the M first face images are respectively input into the face recognition model for training to obtain M face feature vectors.
[0108] After receiving the encrypted M facial feature vectors, the server decrypts the encrypted M facial feature vectors, and calculates the loss function values of the decrypted M facial feature vectors and the user's baseline facial features through a preset loss function to obtain M first loss function values. The M first loss function values are then weighted to obtain a processed loss function value. The loss function value is then encrypted and sent to the client. In this way, by weighting the M first loss function values and encrypting the processed loss function value and sending it to the client, the client can update the local face recognition model according to the loss function value, providing support for subsequent training to obtain a mask face recognition model.
[0109] In the above step 207, the client receives the encrypted loss function value sent by the server, and decrypts the encrypted loss function value to obtain the decrypted loss function value. Then, the face recognition model is updated according to the decrypted loss function value until the face recognition model converges or reaches the preset iterative training rounds, and a trained mask face recognition model is obtained.
[0110] After obtaining the trained mask face recognition model, the client obtains the user's face recognition request, which includes the user's third face picture with the attribute of wearing a mask. Then the third face picture is input into the mask face recognition model for identification, and the user's face recognition result is obtained, and the user is determined to be the target user based on the user's face recognition result. If so, it is determined that the user verification is passed. Or after obtaining the trained mask face recognition model, the client encrypts the model parameters of the mask face recognition model and stores the encrypted model parameters to the server. Then, after the client is first installed or uninstalled and reinstalled, a parameter update request can be sent to the server, and a parameter update response carrying the encrypted model parameters can be received, and the encrypted model parameters are determined by the server according to the user's identity ID in the parameter update request. After that, the face recognition model in the client is updated according to the encrypted model parameters to obtain the mask face recognition model.
[0111] Furthermore, the embodiment of the present invention trains the mask face recognition model in a privacy-preserving manner. Among them, the embodiment of the present invention is based on federated learning technology, and all interactive information between the client and the server must be encrypted before being sent. After one party receives the encrypted information, it will be decrypted locally using the key before performing the operation. The encrypted mask face feature information is obtained from several clients (such as smart phones or tablet computers, etc.) in a privacy-preserving manner, and a mask face recognition model with good performance is obtained through training with a federated learning algorithm. Since the interactive information does not contain the original data, it helps to ensure that the privacy information of the mask face is not leaked, and at the same time, it can effectively solve the problem of the difficulty in implementing mask face recognition applications due to the lack of public mask face data sets. The training process is specifically as follows:
[0112] Step 1: The server distributes the key to each user client for encryption and decryption of the information to be exchanged. The key can be in the form of a symmetric key or an asymmetric key.
[0113] Step 2: When the user uses the client on a local device (such as a smartphone or tablet), the user sends the encrypted user ID to the server.
[0114] Step 3: The server decrypts the received encrypted user ID and performs global sample alignment for user IDs belonging to the same category (i.e., the same user). After that, the server encrypts the training sample indication information corresponding to the user ID (the training sample indication information is used to indicate the number of mask face image training samples uploaded by the client or the identifier corresponding to the uploaded training sample) and sends it to the user client. The server classifies according to the user ID. The same face image belongs to one category, and different face images belong to different categories. The user IDs of the same category are unified, and data alignment is performed according to the unified user ID.
[0115] Step 4: The client randomly selects the mask face image samples with the corresponding quantity value or the corresponding identification from the locally stored mask face image sample set according to the quantity value of the mask face image training samples in the training sample indication information or the identification corresponding to the training samples. If the number of the locally stored mask face image sample set is less than the quantity value of the mask face image training samples in the training sample indication information or the identification corresponding to the training samples, the client needs to continue to collect the user's mask face images until the quantity requirement is met. Then the selected mask face image samples are respectively input into the mask face recognition model for training, and the mask face feature vector generated after training the mask face recognition model is encrypted and sent to the server. It should be noted that the mask face features in the embodiment of the present invention only include the position above the bridge of the nose. Since the mask covering position is not very meaningful for training the mask face recognition model, before uploading the mask face feature vector to the server, it is necessary to perform a resection process on the mask face image, or extract the feature vector of the position above the bridge of the nose from the mask face feature vector to reduce the bandwidth load when the client transmits it to the server, thereby improving the training efficiency of the mask face recognition model. Among them, the excision method can be implemented through open source algorithms (such as Face-Alignment), which can specifically extract feature points of areas such as the periorbital area, eyebrows, and forehead.
[0116] Step 5: Based on the collected multiple mask face feature vectors, the server can use a preset loss function to calculate multiple loss function values of the multiple mask face feature vectors and the user's baseline face features, and perform weighted processing on the multiple loss function values to obtain the processed loss function value.
[0117] Step 6: The server encrypts the processed loss function value and sends it to the corresponding user's client. The corresponding user's client performs statistical processing on the loss function value locally, calculates the gradient value, and updates the mask face recognition model based on the gradient value.
[0118] Repeat the above training process (Step 2 to Step 6) until the model training converges or reaches the preset iterative training rounds to obtain a trained mask face recognition model.
[0119] The above embodiment shows that by inputting M first face pictures into the face recognition model for training, M face feature vectors are obtained, and the M face feature vectors are encrypted and fed back to the server, so that the server performs statistical processing on the decrypted M face feature vectors and the user's benchmark face features through a preset loss function to determine the loss function value. Then the model parameters of the face recognition model are updated according to the loss function value until a trained mask face recognition model is obtained. Since the interaction between the client and the server does not include the face picture training data of the client, and the interactive M face feature vectors and the loss function value are encrypted, the leakage of user privacy data can be effectively avoided, thereby helping to improve the security of the data, and based on the trained mask face recognition model, the mask face is recognized, and the user to whom the mask face belongs can be accurately and quickly recognized, effectively reducing the risk of infectious disease transmission, and helping to improve the convenience of user operation, thereby solving the problem that the face recognition algorithm in the prior art has low recognition performance for the mask face and the risk of leaking the privacy information of the mask face.
[0120] It should be noted that the embodiment of the present invention also provides another form of training method for the mask face recognition model, and the training process is specifically as follows:
[0121] a. The server distributes the key to each user client for encryption and decryption of the information to be exchanged.
[0122] b. The server encrypts the initial face recognition model and distributes it to each user client, so that each user client decrypts the initial face recognition model and stores it locally.
[0123] c. Each user client uses any training sample from the mask face image training sample set stored locally to input into the initial face recognition model for training to obtain the model parameters of the face recognition model.
[0124] d. Each user client encrypts the model parameters obtained by training its own face recognition model and uploads them to the server, so that the server decrypts the model parameters received from each user client and performs weighted processing, encrypts the weighted model parameters and distributes them to each user client, so that each user client decrypts the encrypted model parameters and trains the local face recognition model based on the decrypted model parameters.
[0125] Repeat the above training process (c to d) until the model training converges or reaches the preset iterative training rounds to obtain a trained mask face recognition model. Then each user client can use the locally stored trained mask face recognition model to identify the user of each user client, so as to reduce the influence of differences in model parameters obtained by training the locally stored mask face recognition model by multiple user clients, and use the model parameters uploaded by multiple user clients for weighted processing so that each user client can update the model parameters of the mask face recognition model, thereby improving the accuracy of the mask face recognition model.
[0126] Based on the same technical concept, Figure 3 A face recognition device based on federated learning provided by an embodiment of the present invention is exemplarily shown, and the device can execute the process of a face recognition method based on federated learning.
[0127] like Figure 3 As shown, the device comprises:
[0128] The first acquisition unit 301 is used to acquire M first face pictures of the user, where M is an integer greater than 1;
[0129] The first processing unit 302 is used to input the M first face images into the face recognition model respectively, obtain M face feature vectors, and encrypt the M face feature vectors and feed them back to the server; receive the encrypted loss function value sent by the server, the loss function value is determined by the server according to the M face feature vectors and the user's baseline face features; update the face recognition model according to the decrypted loss function value until the face recognition model converges or reaches a preset iterative training round, to obtain a trained mask face recognition model.
[0130] Optionally, the first processing unit 302 is further configured to:
[0131] Sending the encrypted user's identity ID to the server;
[0132] Receive training sample indication information sent by the server, where the training sample indication information is used to indicate the number of mask face image training samples uploaded by the client or the identifier corresponding to the uploaded training sample.
[0133] Optionally, the first processing unit 302 is specifically configured to:
[0134] Obtain M second face pictures of the user with the attribute of wearing a mask;
[0135] The M second face images are subjected to excision processing according to a preset excision rule to obtain the M first face images; the M first face images are all images of the face above the bridge of the nose.
[0136] Optionally, the first processing unit 302 is further configured to:
[0137] Obtaining a face recognition request of the user, wherein the face recognition request includes a third face image of the user wearing a mask;
[0138] Inputting the third face image into the mask face recognition model for recognition, obtaining a face recognition result of the user, and determining whether the user is a target user based on the face recognition result of the user;
[0139] If so, it is determined that the user verification is successful.
[0140] Optionally, the first processing unit 302 is further configured to:
[0141] Encrypting the model parameters of the mask face recognition model;
[0142] The encrypted model parameters are stored in the server.
[0143] Optionally, the first processing sheet 302 is further used to:
[0144] After initial installation, sending a parameter update request to the server;
[0145] receiving a parameter update response carrying an encrypted model parameter; the encrypted model parameter is determined by the server according to the user identity ID in the parameter update request;
[0146] The face recognition model in the client is updated according to the encrypted model parameters to obtain a mask face recognition model.
[0147] Based on the same technical concept, Figure 4 A face recognition device based on federated learning provided by an embodiment of the present invention is exemplarily shown, and the device can execute the process of a face recognition method based on federated learning.
[0148] like Figure 4 As shown, the device comprises:
[0149] The second acquisition unit 401 is used for the encrypted M facial feature vectors sent by the client, where M is an integer greater than 1;
[0150] The second processing unit 402 is used to decrypt the M encrypted facial feature vectors to obtain the decrypted M facial feature vectors; perform statistical processing on the decrypted M facial feature vectors and the user's baseline facial features through a preset loss function to determine the loss function value; send the encrypted loss function value to the client; the client is used to update the face recognition model according to the decrypted loss function value until the face recognition model converges or reaches a preset iterative training round, thereby obtaining a trained mask face recognition model.
[0151] Optionally, the second processing unit 402 is further configured to:
[0152] Obtaining the encrypted user identity ID sent by the client;
[0153] Decrypting the encrypted user's identity ID to obtain a decrypted user's identity ID;
[0154] Determine corresponding training sample indication information according to the decrypted user's identity ID, where the training sample indication information is used to indicate the number of mask face image training samples uploaded by the client or the identifier corresponding to the uploaded training sample;
[0155] The encrypted training sample indication information is sent to the client; the client is used to determine the corresponding M second face images with mask wearing attributes according to the decrypted training sample indication information, and perform excision processing on the M second face images with mask wearing attributes to obtain M first face images, and input the M first face images into the face recognition model for training respectively to obtain the M face feature vectors.
[0156] Optionally, the second processing unit 402 is specifically configured to:
[0157] Calculating the loss function values of the decrypted M facial feature vectors and the user's benchmark facial features respectively through the preset loss function to obtain M first loss function values;
[0158] The M first loss function values are weighted to obtain the processed loss function value.
[0159] Based on the same technical concept, an embodiment of the present invention provides a computing device, including:
[0160] Memory for storing computer programs;
[0161] The processor is used to call the computer program stored in the memory and execute the face recognition method based on federated learning according to the obtained program.
[0162] Based on the same technical concept, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer-executable program, and the computer-executable program is used to enable a computer to execute a face recognition method based on federated learning.
[0163] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0164] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0165] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0166] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0167] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0168] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of this application and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A face recognition method based on federated learning, It is characterized in that include: The client obtains M first face images of the user; the M first face images are all images of the face above the bridge of the nose; wherein M is an integer greater than 1; The client inputs the M first face images into the face recognition model respectively to obtain M face feature vectors, and encrypts the M face feature vectors and feeds them back to the server; The client receives the encrypted loss function value sent by the server, where the loss function value is determined by the server according to the M facial feature vectors and the user's reference facial feature; The client updates the face recognition model according to the decrypted loss function value until the face recognition model converges or reaches a preset iterative training round, thereby obtaining a trained mask face recognition model; Before the client obtains the M first face images of the user, the method further includes: the client sends the encrypted identity ID of the user to the server; the client receives the training sample indication information sent by the server, where the training sample indication information is used to indicate the number of mask face image training samples uploaded by the client; The method also includes: the client sends a parameter update request to the server; the client receives a parameter update response carrying encrypted model parameters; the encrypted model parameters are determined by the server according to the user's identity ID in the parameter update request; the client updates the face recognition model in the client according to the encrypted model parameters to obtain the mask face recognition model.
2. The method according to claim 1, It is characterized in that The client obtains M first face pictures of the user, including: The client obtains M second face pictures of the user with the attribute of wearing a mask; The client performs excision processing on the M second face images according to a preset excision rule to obtain the M first face images.
3. The method according to claim 1, It is characterized in that After obtaining the trained mask face recognition model, the method further includes: The client obtains a face recognition request of the user, where the face recognition request includes a third face picture of the user wearing a mask; The client inputs the third face image into the mask face recognition model for recognition, obtains the face recognition result of the user, and determines whether the user is a target user based on the face recognition result of the user; If so, the client determines that the user authentication is successful.
4. The method according to any one of claims 1 to 3, It is characterized in that After obtaining the trained mask face recognition model and before the client sends a parameter update request to the server, it also includes: The client encrypts the model parameters of the mask face recognition model; The client stores the encrypted model parameters in the server.
5. A face recognition method based on federated learning, It is characterized in that include: The server obtains the encrypted M facial feature vectors sent by the client; The M first face images are all images of the face above the bridge of the nose; M is an integer greater than 1; The server decrypts the encrypted M facial feature vectors to obtain decrypted M facial feature vectors; The server performs statistical processing on the decrypted M facial feature vectors and the user's reference facial features through a preset loss function to determine a loss function value; The server sends the encrypted loss function value to the client; The client is used to update the face recognition model according to the decrypted loss function value until the face recognition model converges or reaches a preset iterative training round, thereby obtaining a trained mask face recognition model; Before the server obtains the encrypted M facial feature vectors sent by the client, the method further includes: the server obtains the encrypted user identity ID sent by the client; the server decrypts the encrypted user identity ID to obtain the decrypted user identity ID; the server determines corresponding training sample indication information according to the decrypted user identity ID, wherein the training sample indication information is used to indicate the number of mask face image training samples uploaded by the client; and the encrypted training sample indication information is sent to the client; The method also includes: the server receives a parameter update request from the client; according to the user's identity ID in the parameter update request, the parameters of the encrypted model parameters are determined, and a parameter update response carrying the encrypted model parameters is sent to the client; the encrypted model parameters are used to update the face recognition model in the client to obtain the mask face recognition model.
6. The method according to claim 5, It is characterized in that The client is used to determine the corresponding M second face images with mask-wearing attributes according to the decrypted training sample indication information, and perform excision processing on the M second face images with mask-wearing attributes to obtain M first face images, and input the M first face images into the face recognition model for training respectively to obtain the M face feature vectors.
7. The method according to claim 5 or 6, It is characterized in that The server performs statistical processing on the decrypted M facial feature vectors and the user's reference facial features through a preset loss function to determine a loss function value, including: The server calculates the loss function values of the decrypted M facial feature vectors and the user's reference facial features respectively through the preset loss function to obtain M first loss function values; The server performs weighted processing on the M first loss function values to obtain the processed loss function value.
8. A face recognition device based on federated learning, It is characterized in that include: The first acquisition unit is used to acquire M first face pictures of the user; the M first face pictures are all pictures of the face above the bridge of the nose; wherein M is an integer greater than 1 A first processing unit is configured to input the M first face images into a face recognition model respectively, obtain M face feature vectors, and encrypt the M face feature vectors and feed them back to a server; receive an encrypted loss function value sent by the server, where the loss function value is determined by the server according to the M face feature vectors and the user's baseline face features; update the face recognition model according to the decrypted loss function value until the face recognition model converges or reaches a preset iterative training round, thereby obtaining a trained mask face recognition model; The first processing unit is further used to: send the encrypted identity ID of the user to the server; receive training sample indication information sent by the server, where the training sample indication information is used to indicate the number of mask face image training samples uploaded by the client; And, sending a parameter update request to the server; receiving a parameter update response carrying encrypted model parameters; the encrypted model parameters are determined by the server according to the user's identity ID in the parameter update request; updating the face recognition model in the client according to the encrypted model parameters to obtain the mask face recognition model.
9. A face recognition device based on federated learning, It is characterized in that include: A second acquisition unit is used for the encrypted M facial feature vectors sent by the client; The M first face images are all images of the face above the bridge of the nose; M is an integer greater than 1; The second processing unit is used to decrypt the encrypted M facial feature vectors to obtain the decrypted M facial feature vectors; perform statistical processing on the decrypted M facial feature vectors and the user's benchmark facial features through a preset loss function to determine a loss function value; and send the encrypted loss function value to the client; the client is used to update the face recognition model according to the decrypted loss function value until the face recognition model converges or reaches a preset iterative training round, thereby obtaining a trained mask face recognition model; The second processing unit is also used to: obtain the encrypted user identity ID sent by the client; decrypt the encrypted user identity ID to obtain the decrypted user identity ID; determine the corresponding training sample indication information according to the decrypted user identity ID, the training sample indication information is used to indicate the number of mask face image training samples uploaded by the client; send the encrypted training sample indication information to the client; And, receiving a parameter update request from the client; determining the parameters of the encrypted model parameters according to the user's identity ID in the parameter update request, and sending a parameter update response carrying the encrypted model parameters to the client; the encrypted model parameters are used to update the face recognition model in the client to obtain the mask face recognition model.
10. A computing device, It is characterized in that include: Memory for storing computer programs; A processor, configured to call a computer program stored in the memory, and execute the method according to any one of claims 1 to 7 according to the obtained program.
11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer-executable program, and the computer-executable program is used to enable a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for generating model
CN107766940A
Federation network construction method based on federation learning, equipment and readable storage medium
CN109167695A
Federated learning method and system based on state machine, client and electronic equipment
CN110874649A
Training model protection method, device and system, equipment and computer storage medium
CN111241559A
Federated learning method based on trusted execution environment
CN111241580A
