User face recognition method, electronic equipment and storage medium
By adopting an adaptive federated model training mechanism based on asynchronous communication and asynchronous aggregation processing of information freshness data in the user facial recognition method, the problems of low recognition efficiency, poor adaptability and high privacy leakage risk in the prior art are solved, and efficient, accurate and secure user facial recognition is achieved.
Patent Information
- Application Number
- CN202411863642.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-11
Smart Images

Figure CN119810889A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of artificial intelligence and big data technology, and in particular to a user face recognition method, an electronic device, and a storage medium. Background Art
[0002] With the rapid development of artificial intelligence and big data technology, face recognition technology has become increasingly popular, playing a key role in identity authentication, security monitoring and user services. Traditional face recognition technology usually requires the collection and centralized storage of a large amount of personal biometric data for training efficient recognition models. However, this centralized data collection method has serious privacy leakage risks. Under the framework of federated learning, multiple data holders can collaboratively train a global model without sharing the original data. Therefore, the user face recognition method in the related technology solves the problem of data privacy protection to a certain extent by introducing federated learning technology. However, due to the problems of low model training efficiency and difficulty in meeting personalized needs in federated learning technology, it is difficult to achieve efficient and accurate recognition effects while ensuring privacy security.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present disclosure provide a user face recognition method, an electronic device, and a storage medium to at least solve the technical problems of low recognition efficiency, poor adaptability, high risk of privacy leakage, and difficulty in meeting personalized needs in the user face recognition method provided in the related art.
[0005] According to one aspect of an embodiment of the present disclosure, a user face recognition method is provided, including: acquiring user face data; preprocessing the user face data to obtain a preprocessing result; performing data inference on the preprocessing result using a target face recognition model to obtain a target recognition result, wherein the target face recognition model is obtained by iterative training using an adaptive federated model training mechanism based on asynchronous communication, and the target recognition result is used to represent an identity authentication result corresponding to the user face data; and displaying the target recognition result on a graphical user interface.
[0006] Optionally, the user face recognition method also includes: obtaining information freshness data corresponding to at least one training entity, wherein the information freshness data is used to determine according to update time data and update quality data of model update data associated with the training entity; performing asynchronous aggregation processing on the model update data associated with at least one training entity based on the information freshness data to obtain a global recognition model; and performing iterative training based on the global recognition model until a preset convergence condition is met to obtain a target face recognition model.
[0007] Optionally, obtaining information freshness data corresponding to at least one training entity includes: obtaining update time data and a target expected value corresponding to the training entity, wherein the target expected value is used to represent the expected value corresponding to the local data set of the training entity; determining update quality data based on the target expected value; and determining information freshness data based on the update time data and the update quality data.
[0008] Optionally, asynchronously aggregating the model update data associated with at least one training entity based on the information freshness data to obtain a global recognition model includes: sorting the model update data based on the information freshness data to obtain a sorting result; filtering the sorting result to obtain a filtering result; and asynchronously aggregating the filtering result to obtain a global recognition model.
[0009] Optionally, iterative training is performed based on the global recognition model until a preset convergence condition is met to obtain a target facial recognition model, including: determining a target loss function for the current training round based on the global recognition model; adjusting initial budget parameters according to the target loss function to obtain an adjustment result; generating target noise data based on the adjustment result; and updating and iterating using the target noise data until the global recognition model meets the preset convergence condition to obtain the target facial recognition model.
[0010] Optionally, the initial budget parameters are adjusted according to the target loss function to obtain an adjustment result, including: determining the loss function change rate using the historical loss function of the historical training rounds and the target loss function, wherein the loss function change rate is used to evaluate the model convergence; adjusting the initial budget parameters according to the loss function change rate to obtain an adjustment result; or, determining the global model gradient corresponding to the current training round based on the target loss function; and adjusting the initial budget parameters using the global model gradient to obtain an adjustment result.
[0011] Optionally, the user face recognition method also includes: determining a personalized model gradient corresponding to the training entity based on a global recognition model and a local data set; updating the global recognition model using the personalized model gradient and the personalized learning rate to obtain a personalized recognition model; fusing the global recognition model and the personalized recognition model according to preset fusion parameters to obtain a target face recognition model.
[0012] According to another aspect of an embodiment of the present disclosure, a user face recognition device is also provided, including: a first acquisition module, used to acquire user face data; a preprocessing module, used to preprocess the user face data to obtain a preprocessing result; a first processing module, used to perform data inference on the preprocessing result using a target face recognition model to obtain a target recognition result, wherein the target face recognition model is obtained by iterative training using an adaptive federated model training mechanism based on asynchronous communication, and the target recognition result is used to represent the identity authentication result corresponding to the user face data; a display module, used to display the target recognition result on a graphical user interface.
[0013] Optionally, the user face recognition device also includes: a second acquisition module, used to obtain information freshness data corresponding to at least one training entity, wherein the information freshness data is used to be determined based on update time data and update quality data of the model update data associated with the training entity; a second processing module, used to perform asynchronous aggregation processing on the model update data associated with the at least one training entity based on the information freshness data to obtain a global recognition model; a training module, used to perform iterative training based on the global recognition model until a preset convergence condition is met to obtain the target face recognition model.
[0014] Optionally, the second acquisition module is also used to: obtain update time data and target expected value corresponding to the training entity, wherein the target expected value is used to represent the expected value corresponding to the local data set of the training entity; determine update quality data based on the target expected value; determine information freshness data based on the update time data and update quality data.
[0015] Optionally, the second processing module is also used to: sort the model update data according to the information freshness data to obtain a sorting result; filter the sorting result to obtain a filtering result; and perform asynchronous aggregation processing based on the filtering result to obtain a global recognition model.
[0016] Optionally, the training module is also used to: determine the target loss function of the current training round based on the global recognition model; adjust the initial budget parameters according to the target loss function to obtain an adjustment result; generate target noise data based on the adjustment result; use the target noise data to update and iterate until the global recognition model meets the preset convergence conditions to obtain a target facial recognition model.
[0017] Optionally, the training module is also used to: determine the loss function change rate using the historical loss function of the historical training rounds and the target loss function, wherein the loss function change rate is used to evaluate the model convergence; adjust the initial budget parameters according to the loss function change rate to obtain an adjustment result; or, determine the global model gradient corresponding to the current training round based on the target loss function; and adjust the initial budget parameters using the global model gradient to obtain an adjustment result.
[0018] Optionally, the user face recognition device also includes: a determination module, used to determine the personalized model gradient corresponding to the training entity based on the global recognition model and the local data set; a third processing module, used to update the global recognition model using the personalized model gradient and the personalized learning rate to obtain a personalized recognition model; a fourth processing module, used to fuse the global recognition model and the personalized recognition model according to preset fusion parameters to obtain a target face recognition model.
[0019] According to another aspect of an embodiment of the present disclosure, an electronic device is also provided, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement the user face recognition method in the embodiment of the present disclosure.
[0020] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is further provided, the computer-readable storage medium including a stored executable program, wherein when the executable program runs, the device where the storage medium is located is controlled to execute the user face recognition method in the embodiment of the present disclosure.
[0021] According to another aspect of an embodiment of the present disclosure, a computer program product is further provided. The computer program product includes computer instructions. When the computer instructions are executed by a processor, the user face recognition method in the embodiment of the present disclosure is implemented.
[0022] In the embodiment of the present disclosure, by acquiring user facial data and preprocessing the user facial data to obtain a preprocessing result, and then using a target facial recognition model to perform data inference on the preprocessing result to obtain a target recognition result, and finally displaying the target recognition result on a graphical user interface, the purpose of optimizing the user facial recognition process is achieved, thereby achieving the technical effect of improving face recognition efficiency, enhancing privacy protection and meeting personalized needs, and thus solving the technical problems of low recognition efficiency, poor adaptability, high risk of privacy leakage and difficulty in meeting personalized needs in the user facial recognition method provided in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:
[0024] Figure 1 is a flow chart of a user face recognition method according to one embodiment of the present disclosure;
[0025] Figure 2 is a schematic diagram of a user face recognition system according to one embodiment of the present disclosure;
[0026] Figure 3 It is a structural block diagram of a user face recognition device according to one embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present disclosure, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present disclosure.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0029] With the rapid development of artificial intelligence and big data technology, face recognition technology has become increasingly popular, playing a key role in identity authentication, security monitoring and user services. Traditional face recognition technology usually requires the collection and centralized storage of a large amount of personal biometric data for training efficient recognition models. However, this centralized data collection method has serious privacy leakage risks. Under the framework of federated learning, multiple data holders can collaboratively train a global model without sharing the original data. Therefore, the user face recognition method in the related technology solves the problem of data privacy protection to a certain extent by introducing federated learning technology. However, due to the problems of low model training efficiency and difficulty in meeting personalized needs in federated learning technology, it is difficult to achieve efficient and accurate recognition effects while ensuring privacy security.
[0030] Specifically, most of the existing federated face recognition technologies are based on a synchronous federated learning framework, which reduces the risk of data leakage by allowing each participant to train the model locally and then send the model parameters to a central server for aggregation to generate a global model. Traditional federated learning usually assumes that the participants update the model synchronously, and all participants must upload their model parameters at the same time and perform synchronous aggregation. However, in practical applications, due to the imbalance of network bandwidth, computing power and data distribution, there is often a lack of synchronization between the participants. Asynchronous communication allows participants to upload model updates at different time points, thereby improving the efficiency and practicality of federated learning. Existing asynchronous federated learning methods are usually based on the asynchronous aggregation strategy of the global model, that is, allowing participants to upload updates at different time points and update the global model by weighted averaging. However, this method mainly focuses on improving the convergence speed of the global model and is difficult to meet personalized needs. In addition, differential privacy technology usually introduces noise in model parameters or gradients to ensure that the model has high accuracy while protecting user privacy. In federated learning, differential privacy technology is usually used in combination with the global model to protect the privacy security of data holders. However, a single global model often relies on centralized training or makes a trade-off between personalization and privacy protection, lacks flexibility and adaptability, and thus cannot fully capture the personalized needs of different data holders.
[0031] In summary, there are still many problems with the current combination of federated learning technology, differential privacy technology, and asynchronous communication technology.
[0032] According to an embodiment of the present disclosure, a method embodiment of a user face recognition method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0033] The method embodiment can be executed in an electronic device or a similar computing device including a memory and a processor. Taking running on a computer terminal as an example, the computer terminal may include one or more processors (processors may include but are not limited to central processing units (CPU), graphics processing units (GPU), digital signal processing (DSP) chips, microprocessors (MCU), programmable logic devices (Field Programmable Gate Array, FPGA), neural network processors (Neural-network Processor Unit, NPU), tensor processors (TensorProcessing Unit, TPU), artificial intelligence (Artificial Intelligence, AI) type processors and other processing devices) and a memory for storing data. Optionally, the above-mentioned computer terminal may also include a transmission device, an input and output device, and a display device for communication functions. It can be understood by those of ordinary skill in the art that the above-mentioned structural description is only for illustration, and it does not limit the structure of the above-mentioned computer terminal. For example, the computer terminal may also include more or fewer components than the above-mentioned structural description, or have a configuration different from the above-mentioned structural description.
[0034] The memory can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the user face recognition method in the embodiment of the present disclosure. The processor executes various functional applications and data processing by running the computer program stored in the memory, that is, realizing the above-mentioned user face recognition method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0035] The transmission device is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0036] The display device may be, for example, a touch screen type liquid crystal display (LCD) and a touch display (also referred to as a "touch screen" or "touch display screen"). The liquid crystal display may enable a user to interact with a user interface of a mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI), and a user may interact with the GUI by finger contacts and / or gestures on a touch-sensitive surface, wherein the human-computer interaction functions here may optionally include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music and / or web browsing, etc. The executable instructions for executing the above human-computer interaction functions are configured / stored in a computer program product or readable storage medium executable by one or more processors.
[0037] Figure 1 is a flow chart of a user face recognition method according to one embodiment of the present disclosure, such as Figure 1 As shown, the method comprises the following steps:
[0038] Step S11, obtaining user facial data;
[0039] Step S12, preprocessing the user's facial data to obtain a preprocessing result;
[0040] Step S13, using the target facial recognition model to perform data inference on the preprocessing result to obtain a target recognition result, wherein the target facial recognition model is obtained by iterative training using an adaptive federated model training mechanism based on asynchronous communication, and the target recognition result is used to represent the identity authentication result corresponding to the user facial data;
[0041] Step S14, displaying the target recognition result on the graphical user interface.
[0042] The above-mentioned user facial data refers to the original image or video frame containing the user's facial features obtained through various collection methods, such as camera shooting, photo uploading, video stream interception, etc. The above-mentioned data can be an image captured in real time, or it can be a historical image or video clip extracted from a database.
[0043] The above-mentioned preprocessing refers to a series of image processing operations performed on the original image or video frame containing the user's facial features, which is used to remove irrelevant information, enhance key features, unify data formats, and improve model processing efficiency. Preprocessing steps usually include but are not limited to: image standardization, grayscale conversion, face detection and alignment, image denoising, feature extraction, format conversion, etc.
[0044] Exemplarily, the user's facial data is preprocessed, the image size and pixel value are adjusted, and the image is normalized to ensure that all input images have the same size and color range to facilitate model processing, or image processing technology is applied to remove random noise in the image and improve the clarity of facial features.
[0045] For example, assuming that a user needs to board the plane through facial recognition, when the user approaches the gate, the camera on the gate automatically captures a high-definition image of the user's face as the user's facial data. Subsequently, the user's facial image obtained above is transmitted to the back-end system for preprocessing, and the preprocessed data is input into the target facial recognition model for data inference to obtain the identity authentication result corresponding to the user's facial data. After the identity authentication is passed, the graphical user interface on the gate will display the green font "Authentication passed, please pass", and the user's registered name will be clearly displayed on the interface. On the contrary, if the facial recognition and identity authentication processes fail to match successfully, the graphical user interface will switch to a red warning mode, displaying: "Authentication failed, request re-verification".
[0046] Based on the above steps S11 to S14, by acquiring user facial data and preprocessing the user facial data to obtain a preprocessing result, and then using the target facial recognition model to perform data inference on the preprocessing result to obtain a target recognition result, and finally displaying the target recognition result on a graphical user interface, the purpose of optimizing the user facial recognition process is achieved, thereby achieving the technical effect of improving face recognition efficiency, enhancing privacy protection and meeting personalized needs, and thus solving the technical problems of low recognition efficiency, poor adaptability, high risk of privacy leakage and difficulty in meeting personalized needs in the user facial recognition method provided in the relevant technology.
[0047] Optionally, the user face recognition method further includes:
[0048] Step S21, obtaining information freshness data corresponding to at least one training entity, wherein the information freshness data is used to determine according to update time data and update quality data of model update data associated with the training entity;
[0049] Step S22, performing asynchronous aggregation processing on the model update data associated with at least one training entity according to the information freshness data to obtain a global recognition model;
[0050] Step S23, performing iterative training based on the global recognition model until a preset convergence condition is met to obtain a target facial recognition model.
[0051] The above-mentioned training entities, or participants, refer to the independent nodes or devices that participate in the distributed model training in the federated learning framework, including but not limited to smartphones, personal computers, edge servers, IoT devices, etc. In the traditional federated learning framework, the training entities often have communication delays and computing power differences, resulting in different times for model updates to arrive at the server.
[0052] The above-mentioned information freshness index (FI) refers to the key parameter used to evaluate and quantify the timeliness and quality of the model update data uploaded by each training entity. The introduction of FI solves the time delay and quality difference problems of model update data under the asynchronous communication mechanism.
[0053] The above asynchronous aggregation processing refers to the process in which the central server, after receiving model update data from different training entities, prioritizes and aggregates the model update data according to FI to build a global model under the framework of federated learning. Asynchronous aggregation processing avoids the common synchronous waiting problem in federated learning, that is, there is no need to wait for all entities to complete uploading updates before aggregation.
[0054] For example, assume that there are five training entities: E1, E2, E3, E4, and E5. Each training entity has a different face image dataset for local model training. The central server first collects update time data (TimeDelay, TD) and update quality data (Update Quality, UQ) from each training entity, and calculates the FI value corresponding to each training entity based on TD and UQ. The specific data are as follows:
[0055] E1: TD=100ms, UQ=0.85, FI=0.0085;
[0056] E2: TD=150ms, UQ=0.78, FI=0.0052;
[0057] E3: TD=80ms, UQ=0.82, FI=0.01025;
[0058] E4: TD=120ms, UQ=0.90, FI=0.0075;
[0059] E5: TD=180ms, UQ=0.70, FI=0.00389.
[0060] Furthermore, based on the calculated FI value, the central server asynchronously aggregates the model update data associated with at least one training entity to obtain a global recognition model, and uses the model for iterative training. In each iteration, the server updates the data according to the aggregated global model, evaluates the model performance, and adjusts the training strategy until the model meets the preset convergence conditions.
[0061] For example, it is assumed that the preset convergence condition is that the model accuracy does not change by more than 1% in five consecutive iterations, or the number of iterations reaches 50. If the model performance changes by less than 1% in five consecutive iterations, the central server will stop iterating, and the global model at this time is the target facial recognition model.
[0062] Based on the above optional embodiments, the asynchronous aggregation strategy based on information freshness data ensures that the central server can give priority to the most timely and highest quality model update data without waiting for all entities to complete the upload, thereby shortening the update cycle of the global model and improving the overall training speed of federated learning.
[0063] Optionally, in step S21, obtaining information freshness data corresponding to at least one training entity includes:
[0064] Step S211, obtaining update time data and target expected value corresponding to the training entity, wherein the target expected value is used to represent the expected value corresponding to the local data set of the training entity;
[0065] Step S212, determining and updating quality data based on the target expected value;
[0066] Step S213, determining the information freshness data according to the update time data and the update quality data.
[0067] The above update time data refers to the time delay experienced by the model update data from the local training entity completing the calculation and uploading it to the central server. In the federated learning framework, due to the different network conditions and computing power of each training entity, the time point of the model update will also vary. The central server needs to judge the "freshness" of the model update based on the update time data, that is, whether the update is timely and whether it can reflect the latest training results. The smaller the update time data, the more timely the update and the higher the freshness of the information.
[0068] The above update quality data refers to the key indicator used in the federated learning framework to evaluate the effectiveness and value of model updates. Specifically, it refers to the degree of improvement in the performance of the model after the update relative to the performance before the update or relative to the fixed benchmark on the local training entity. Generally speaking, the higher the update quality data, the greater the contribution to the global model and the higher the information freshness.
[0069] For example, suppose that in the tth iteration, the update time data of training entity i is T i (t) , the target expected value is The updated quality data can be calculated by formula (1)
[0070]
[0071] Among them, D i is the local data set, l is the loss function, For Model The predicted value on input x, y is the actual label, Indicates that in the local dataset D i expectations.
[0072] Furthermore, the information freshness data can be determined based on the update time data and the update quality data by formula (2):
[0073]
[0074] Based on the above optional embodiments, the update time data and target expected value corresponding to the training entity are obtained, and the update quality data is determined based on the target expected value, and then the information freshness data is determined based on the update time data and the update quality data. This can achieve effective evaluation and priority sorting of the model update data uploaded by the training entity, thereby optimizing the model training efficiency and quality in the federated learning environment.
[0075] Optionally, in step S22, asynchronously aggregating the model update data associated with at least one training entity according to the information freshness data to obtain a global recognition model includes:
[0076] Step S221, sorting the model update data according to the information freshness data to obtain a sorting result;
[0077] Step S222, screening the sorting results to obtain screening results;
[0078] Step S223, performing asynchronous aggregation processing based on the screening results to obtain a global recognition model.
[0079] For example, in the asynchronous aggregation processing stage, after receiving the model update data uploaded by the training entity, the central server does not have to wait for the update of all participants to be completed, but performs the aggregation operation of some models in real time. Specifically, the central server receives the model update data of training entity i in the tth iteration. Then, calculate the information freshness data Furthermore, according to the information freshness data All received model update data are sorted, and the top k model update data are selected for asynchronous aggregation processing to obtain a global recognition model.
[0080] Exemplarily, the global recognition model can be updated by formula (3):
[0081]
[0082] Among them, w (t+1) is the updated global recognition model, Update the model data for training entity i in round t, that is,
[0083] Exemplarily, the FI values of the above training entities E1 to E5 are sorted, and the sorting results are as follows:
[0084] (1)E3: TD=80ms, UQ=0.82, FI=0.01025;
[0085] (2)E1: TD=100ms, UQ=0.85, FI=0.0085;
[0086] (3)E4: TD=120ms, UQ=0.90, FI=0.0075;
[0087] (4)E2: TD=150ms, UQ=0.78, FI=0.0052;
[0088] (5)E5: TD=180ms, UQ=0.70, FI=0.00389.
[0089] From the sorting results, we can see that E3 has the highest FI value, followed by E1. Therefore, E3 and E1 are selected for asynchronous aggregation processing to obtain the global recognition model.
[0090] Based on the above optional embodiments, the model update data is sorted according to the information freshness data to obtain a sorting result based on the update time data and the update quality data; then, the sorting result is screened to select the model update data with the top k freshness indicators to obtain a screening result; finally, asynchronous aggregation is performed based on the screening result, and a weighted average strategy is used to assign weights according to the freshness indicators, and the selected model update data are fused to obtain an optimized global recognition model, which can improve training efficiency, optimize model quality, and enhance the adaptability of the model.
[0091] Optionally, in step S23, iterative training is performed based on the global recognition model until a preset convergence condition is met, and obtaining a target facial recognition model includes:
[0092] Step S231, determining the target loss function of the current training round based on the global recognition model;
[0093] Step S232, adjusting the initial budget parameters according to the target loss function to obtain an adjustment result;
[0094] Step S233, generating target noise data based on the adjustment result;
[0095] Step S234, using the target noise data to perform update iterations until the global recognition model meets a preset convergence condition, thereby obtaining a target facial recognition model.
[0096] The above-mentioned target loss function refers to the key indicator used to evaluate and guide the model training process in federated learning face recognition technology. By comparing the model's prediction results with the actual labels of the local data set and calculating the gap between the two, the current performance level of the model can be judged, and the direction and degree of model adjustment can be determined accordingly.
[0097] The above initial budget parameters refer to the differential privacy parameters set at the beginning of the training process to quantify the degree of privacy protection. These parameters mainly control the level and characteristics of noise added during the federated learning process to protect the privacy of local data of each training entity. Specifically, the differential privacy mechanism blurs the model update by introducing random noise, ensuring that even if the attacker has the specific content of the model update, he cannot reversely infer the original data details of any training entity through this information.
[0098] For example, the commonly used noise generation mechanism is the Gaussian Mechanism. When a stronger probability guarantee is required, the Gaussian Mechanism can provide stronger privacy protection. Based on the Gaussian Mechanism, the target noise data can be generated by formula (4):
[0099]
[0100] Among them, N(0,σ 2 ) means that the mean is zero, σ 2 is a Gaussian distribution with variance; ∈ t is the adjusted budget parameter. The key to generating target noise data is to calculate the ∈ t ,dynamically adjust the amplitude of the noise to minimize the negative impact on model performance while protecting privacy.,Therefore, the noise can be adaptively added to the local client-aggregated gradient to protect privacy.
[0101] For example, assume that the global loss function L(w) satisfies the Lipschitz continuity condition, that is, there exists a constant L>0, so that for any w1, w2:
[0102] ||▽L(w1)-▽L(w2)||≤L||w1-w2|| Formula (5)
[0103] Assume that the gradient of the local loss function of the training entity has bounded noise, that is, there exists a constant σ>0 such that:
[0104] E[||▽L(D i ,w)-▽L(w)|| 2 ]≤σ 2 Formula (6)
[0105] Assume the learning rate η of the global model t Satisfy the attenuation condition shown in formula (6):
[0106]
[0107] In the tth iteration, the global model update can be expressed as:
[0108]
[0109] Furthermore, the gradient of the current model is shown in formula (8):
[0110]
[0111] in, is the gradient noise term, whose expectation is zero. Then the expected update of the global model can be expressed as:
[0112]
[0113] because The update of the global model can be simplified as:
[0114] E[w (t+1) ]=w (t) -η t·▽L(w (t) ) Formula (11)
[0115] In order to prove the convergence of the global model, we define an auxiliary function Φ(t)=L(w (t) ), represents the global loss function value at the tth iteration. According to Lipschitz continuity, we can get:
[0116]
[0117] Substituting the global model update formula into the formula, we get:
[0118]
[0119] After sorting, we get:
[0120]
[0121] Due to the learning rate decay condition η t satisfy and It can be proved that as the number of iterations t increases, the loss function L(w (t) ) monotonically decreases and converges to a local optimal value L * ,Right now:
[0122]
[0123] Based on the above optional embodiments, the target loss function of the current training round is determined based on the global recognition model, and the initial budget parameters are adjusted according to the target loss function to obtain a more suitable balance between privacy protection and model performance. The target noise data is generated based on the adjusted parameters and integrated into the model update. Finally, iterative training is performed using the noise-added data until the global recognition model reaches the preset convergence conditions, thereby obtaining the final optimized target facial recognition model, which can ensure the efficiency of model training, the optimization of model performance and the security of data privacy.
[0124] Optionally, in step S232, the initial budget parameters are adjusted according to the target loss function, and the adjustment results include:
[0125] Step S2321, using the historical loss function of the historical training rounds and the target loss function to determine the loss function change rate, wherein the loss function change rate is used to evaluate the model convergence;
[0126] Step S2322, adjusting the initial budget parameters according to the loss function change rate to obtain an adjustment result; or,
[0127] Step S2323, determining the global model gradient corresponding to the current training round based on the target loss function;
[0128] Step S2324, using the global model gradient to adjust the initial budget parameters to obtain an adjustment result.
[0129] Exemplarily, the initial budget parameters may be adjusted according to formula (16):
[0130]
[0131] Among them, ∈ min and ∈ max denote the maximum and minimum values of the privacy budget respectively; L(w (t) ) is the loss function value of the tth round; σ(·) is the adaptive control function, which can be selected as a linear or nonlinear function to flexibly adjust the budget, usually expressed by formula (17):
[0132]
[0133] Among them, k is a control parameter that determines the sensitivity of budget adjustment. This formula shows that when the loss function decreases faster, the privacy budget ∈ t Increase, thereby reducing the introduction of noise and promoting faster convergence of the model; when the loss function changes little or tends to be stable, ∈ t Reduce and increase privacy protection.
[0134] Or, suppose the global gradient at round t is ▽L(w (t) ), the initial budget parameters can be adjusted according to formula (18) to obtain the adjustment result:
[0135]
[0136] Among them, max||▽L(w (t) )|| is the maximum value of the gradient amplitude in the first t rounds. This formula shows that when the gradient amplitude is large, it means that the model is still in a large adjustment stage. At this time, noise interference should be reduced and the privacy budget should be increased; conversely, as the gradient amplitude decreases, the privacy budget ∈ t It should be appropriately reduced to increase the noise amplitude and enhance privacy protection.
[0137] Based on the above optional embodiments, through adaptive adjustment of the privacy budget parameters, the scale and distribution characteristics of the noise can be optimized in real time during the model iteration process according to the changes in the convergence speed and gradient amplitude, thereby maintaining the efficiency of the model training and ensuring the security of data privacy.
[0138] Optionally, the user face recognition method further includes:
[0139] Step S31, determining a personalized model gradient corresponding to the training entity based on the global recognition model and the local data set;
[0140] Step S32, using the personalized model gradient and the personalized learning rate to update the global recognition model to obtain a personalized recognition model;
[0141] Step S33, fusing the global recognition model and the personalized recognition model according to preset fusion parameters to obtain a target facial recognition model.
[0142] For example, in order to ensure that the personalized model can achieve good performance on local data while not deviating from the basic structure of the global model, the objective function of personalized adjustment is designed as shown in formula (19):
[0143]
[0144] in, Indicates that the local data D i The loss function calculated above is used to measure the personalized recognition model performance; is the global model of the tth round; λ is the regularization parameter used to control the personalized recognition model With the global model The larger the λ value, the closer the personalized recognition model is to the global model.
[0145] Further, as shown in formula (20), after receiving the global model, the training entity uses its local data D i Calculate personalized model gradients:
[0146]
[0147] in, is the gradient of the regularization term to the personalized recognition model, which is used to make the personalized recognition model maintain similarity with the global model.
[0148] The personalized model gradient calculated according to the above formula (20) is used with the personalized learning rate η personal Update the personalized recognition model:
[0149]
[0150] Formula (21) makes the personalized recognition model of each training entity not only consider the global model The knowledge can also be optimized based on local data to improve performance on local data.
[0151] Furthermore, the updated personalized recognition model It will continue to be used in the next iteration. The training entity can choose to contribute part of its personalized recognition model to the global recognition model update. The specific form is shown in formula (22):
[0152]
[0153] Among them, α is the coefficient that controls the degree of fusion between the personalized recognition model and the global recognition model, that is, the preset fusion parameter. When α=1, the personalized recognition model is completely generated by local training; when α=0, the personalized model is equivalent to the global model.
[0154] For example, in the process of updating the personalized recognition model, in order to protect the privacy of the training entity, the model update uploaded to the central server must be differentially privately protected. The process of combining the adaptive differential privacy mechanism with the personalized recognition model is as follows:
[0155] Upload personalized recognition model update Before training, the entity adds noise N(0,σ 2 ) to ensure differential privacy:
[0156]
[0157] Among them, N(0,σ 2 ) has a mean of 0 and a variance of σ 2 Gaussian noise. The variance of the noise is σ 2 It is dynamically controlled by an adaptive privacy budget parameter ∈ to ensure a balance between privacy protection and model performance.
[0158] In order to further optimize the differential privacy mechanism, adaptive privacy budget control is introduced. According to the convergence of the model and the personalized needs of the training entity, the noise variance σ is dynamically adjusted. 2 , as shown in formula (24):
[0159]
[0160] Where c is a constant used to adjust the reference level of noise; It is used to measure the change of the global recognition model between two adjacent iterations. The larger the change, the smaller the noise variance and the higher the risk of information leakage.
[0161] Based on the above optional embodiments, the personalized model gradient corresponding to the training entity is determined based on the global recognition model and the local data set of each training entity, and then the personalized model gradient and the personalized learning rate adjusted are used to update the global recognition model, so as to obtain a personalized recognition model that is more adapted to the characteristics of local data; then, according to the preset fusion parameters, the global recognition model and the personalized recognition model are fused to retain the generalization ability of the global model while optimizing the performance of the model on local data. The target facial recognition model finally obtained can ensure that the model can reflect the commonality of global data and meet the personalized needs of different training entities, thereby improving the applicability and accuracy of the model. At the same time, by dynamically adjusting the personalized learning rate and fusion parameters, a better balance can be achieved between privacy protection and model performance, so that the federated face recognition technology can more effectively serve the actual application scenarios while protecting data privacy.
[0162] Figure 2 is a schematic diagram of a user face recognition system according to one embodiment of the present disclosure, such as Figure 2 As shown, the system includes: data collection and preprocessing components, participants, model training and reasoning components, federated learning framework components, and supervision and monitoring components. Among them, the data collection and preprocessing components include data collectors (such as cameras), databases, and database preprocessors; the participants are training entities; the model training and reasoning components include local model trainers, personalized model aggregators, and reasoning engines; the federated learning framework components include distributed learning managers, adaptive differential privacy modules, and asynchronous communication modules; the management and monitoring components include system managers and user interfaces.
[0163] Exemplarily, first, a data collector such as a camera captures a user's facial image; then, the collected raw image data is stored in a database, and the database preprocessor preprocesses the raw image data to ensure that the format and quality of the data are suitable for subsequent model training. Next, the participant, as a training entity, receives the preprocessed data from the data collection and preprocessing component, and trains the model based on the local data set to form a preliminary personalized recognition model. The personalized recognition model then interacts with the federated learning framework component, and the participants upload their respective model updates to the central server through the asynchronous communication module. The distributed learning manager of the central server receives the above-mentioned update data, and uses the adaptive differential privacy module to dynamically adjust the privacy protection strategy according to the training status of the current model to ensure that the uploaded model update meets the differential privacy standard while retaining useful information to the maximum extent. Supported by the asynchronous communication mechanism, the personalized model aggregator of the central server prioritizes high-quality and latest model updates based on the information freshness index, performs asynchronous aggregation of the global model, and generates a new global model. As the global model is updated, the central server sends the model parameters back to each participant. After receiving the model, the participant continues to train the model locally to form an optimized personalized recognition model.
[0164] Furthermore, according to the preset fusion parameters, the personalized recognition model and the global recognition model are fused to generate the final target facial recognition model. The target facial recognition model generated by the above steps has both the generalization ability of the global recognition model and can be specifically optimized for the local data characteristics of different participants, thereby improving the applicability and accuracy of the model. Finally, the target facial recognition model is applied to the inference engine in the model training and reasoning component to perform actual facial recognition tasks. At the same time, the system manager and user interface in the management and monitoring component continuously monitor the operating status of the system, including the progress of model training, performance indicators, activities of participants, and system security, to ensure that the entire training process is compliant and efficient. At the same time, the user interface provides intuitive system status feedback to system administrators and users, facilitating real-time monitoring and necessary intervention to maintain system stability and optimize model performance.
[0165] Based on the above optional embodiments, by acquiring user facial data and preprocessing the user facial data to obtain a preprocessing result, and then using the target facial recognition model to perform data inference on the preprocessing result to obtain a target recognition result, and finally displaying the target recognition result on a graphical user interface, the purpose of optimizing the user facial recognition process is achieved, thereby achieving the technical effect of improving face recognition efficiency, enhancing privacy protection and meeting personalized needs, and thus solving the technical problems of low recognition efficiency, poor adaptability, high risk of privacy leakage and difficulty in meeting personalized needs in the user facial recognition method provided in the related art.
[0166] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present disclosure.
[0167] In the embodiments of the present disclosure, a user face recognition device is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0168] Figure 3 is a structural block diagram of a user face recognition device according to one embodiment of the present disclosure, such as Figure 3 As shown, the device comprises:
[0169] The first acquisition module 301 is used to acquire user facial data;
[0170] The preprocessing module 302 is used to preprocess the user's facial data to obtain a preprocessing result;
[0171] The first processing module 303 is used to perform data inference on the preprocessing result using a target facial recognition model to obtain a target recognition result, wherein the target facial recognition model is obtained by iterative training using an adaptive federated model training mechanism based on asynchronous communication, and the target recognition result is used to represent an identity authentication result corresponding to the user facial data;
[0172] The display module 304 is used to display the target recognition result on a graphical user interface.
[0173] Optionally, the user face recognition device further includes:
[0174] A second acquisition module 305, configured to acquire information freshness data corresponding to at least one training entity, wherein the information freshness data is used to be determined according to update time data and update quality data of model update data associated with the training entity;
[0175] A second processing module 306 is used to perform asynchronous aggregation processing on the model update data associated with the at least one training entity according to the information freshness data to obtain a global recognition model;
[0176] The training module 307 is used to perform iterative training based on the global recognition model until a preset convergence condition is met to obtain the target facial recognition model.
[0177] Optionally, the second acquisition module 305 is also used to: obtain update time data and target expected value corresponding to the training entity, wherein the target expected value is used to represent the expected value corresponding to the local data set of the training entity; determine update quality data based on the target expected value; determine information freshness data based on the update time data and update quality data.
[0178] Optionally, the second processing module 305 is further used to: sort the model update data according to the information freshness data to obtain a sorting result; filter the sorting result to obtain a filtering result; and perform asynchronous aggregation processing based on the filtering result to obtain a global recognition model.
[0179] Optionally, the training module 307 is also used to: determine the target loss function of the current training round based on the global recognition model; adjust the initial budget parameters according to the target loss function to obtain an adjustment result; generate target noise data based on the adjustment result; use the target noise data to update and iterate until the global recognition model meets the preset convergence conditions to obtain a target facial recognition model.
[0180] Optionally, the training module 307 is also used to: determine the loss function change rate using the historical loss function of the historical training rounds and the target loss function, wherein the loss function change rate is used to evaluate the model convergence; adjust the initial budget parameters according to the loss function change rate to obtain an adjustment result; or determine the global model gradient corresponding to the current training round based on the target loss function; and adjust the initial budget parameters using the global model gradient to obtain an adjustment result.
[0181] Optionally, the user face recognition device further includes:
[0182] A determination module 308, configured to determine a personalized model gradient corresponding to a training entity based on a global recognition model and a local data set;
[0183] The third processing module 309 is used to update the global recognition model using the personalized model gradient and the personalized learning rate to obtain a personalized recognition model;
[0184] The fourth processing module 310 is used to fuse the global recognition model and the personalized recognition model according to preset fusion parameters to obtain a target facial recognition model.
[0185] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0186] According to another aspect of an embodiment of the present disclosure, an electronic device is also provided, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement the user face recognition method in the embodiment of the present disclosure.
[0187] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0188] S1, obtain user facial data;
[0189] S2, preprocessing the user's facial data to obtain a preprocessing result;
[0190] S3, using the target facial recognition model to perform data inference on the preprocessing result to obtain a target recognition result, wherein the target facial recognition model is obtained by iterative training using an adaptive federated model training mechanism based on asynchronous communication, and the target recognition result is used to represent the identity authentication result corresponding to the user facial data;
[0191] S4, displaying the target recognition result on the graphical user interface.
[0192] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is further provided, the computer-readable storage medium including a stored executable program, wherein when the executable program runs, the device where the storage medium is located is controlled to execute the user face recognition method in the embodiment of the present disclosure.
[0193] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0194] S1, obtain user facial data;
[0195] S2, preprocessing the user's facial data to obtain a preprocessing result;
[0196] S3, using the target facial recognition model to perform data inference on the preprocessing result to obtain a target recognition result, wherein the target facial recognition model is obtained by iterative training using an adaptive federated model training mechanism based on asynchronous communication, and the target recognition result is used to represent the identity authentication result corresponding to the user facial data;
[0197] S4, displaying the target recognition result on the graphical user interface.
[0198] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0199] According to another aspect of an embodiment of the present disclosure, a computer program product is further provided. The computer program product includes computer instructions. When the computer instructions are executed by a processor, the user face recognition method in the embodiment of the present disclosure is implemented.
[0200] Optionally, in this embodiment, the computer program product may be configured as a computer program for executing the following steps:
[0201] S1, obtain user facial data;
[0202] S2, preprocessing the user's facial data to obtain a preprocessing result;
[0203] S3, using the target facial recognition model to perform data inference on the preprocessing result to obtain a target recognition result, wherein the target facial recognition model is obtained by iterative training using an adaptive federated model training mechanism based on asynchronous communication, and the target recognition result is used to represent the identity authentication result corresponding to the user facial data;
[0204] S4, displaying the target recognition result on the graphical user interface.
[0205] The serial numbers of the above-mentioned embodiments of the present disclosure are only for description and do not represent the advantages or disadvantages of the embodiments.
[0206] In the above embodiments of the present disclosure, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0207] In the several embodiments provided in the present disclosure, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0208] 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 units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0209] 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.
[0210] If the integrated 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 technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0211] The above is only a preferred embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present disclosure. These improvements and modifications should also be regarded as the scope of protection of the present disclosure.
Claims
1. A user face recognition method, characterized in that: include: Get user facial data; Preprocessing the user facial data to obtain a preprocessing result; Performing data inference on the preprocessing result using a target facial recognition model to obtain a target recognition result, wherein the target facial recognition model is obtained by iterative training using an adaptive federated model training mechanism based on asynchronous communication, and the target recognition result is used to represent an identity authentication result corresponding to the user facial data; The target recognition result is displayed on a graphical user interface.
2. The user face recognition method according to claim 1, characterized in that: The method further comprises: Acquire information freshness data corresponding to at least one training entity, wherein the information freshness data is used to be determined according to update time data and update quality data of model update data associated with the training entity; Performing asynchronous aggregation processing on the model update data associated with the at least one training entity according to the information freshness data to obtain a global recognition model; Iterative training is performed based on the global recognition model until a preset convergence condition is met to obtain the target facial recognition model.
3. The user face recognition method according to claim 2, characterized in that: Acquiring the information freshness data corresponding to the at least one training entity includes: Acquire the update time data and target expected value corresponding to the training entity, wherein the target expected value is used to represent the expected value corresponding to the local data set of the training entity; determining the update quality data based on the target expected value; The information freshness data is determined according to the update time data and the update quality data.
4. The user face recognition method according to claim 2, characterized in that: Asynchronously aggregating the model update data associated with the at least one training entity according to the information freshness data to obtain the global recognition model includes: Sorting the model update data according to the information freshness data to obtain a sorting result; Performing screening processing on the sorting results to obtain screening results; Asynchronous aggregation processing is performed based on the screening results to obtain the global recognition model.
5. The user face recognition method according to claim 2, characterized in that: Performing iterative training based on the global recognition model until the preset convergence condition is met, obtaining the target facial recognition model includes: Determine a target loss function for a current training round based on the global recognition model; Adjusting the initial budget parameters according to the target loss function to obtain an adjustment result; generating target noise data based on the adjustment result; The target noise data is used to perform update iterations until the global recognition model meets the preset convergence condition, thereby obtaining the target facial recognition model.
6. The user face recognition method according to claim 5, characterized in that: The initial budget parameters are adjusted according to the target loss function to obtain the adjustment result, including: Determine the loss function change rate using the historical loss function of the historical training rounds and the target loss function, wherein the loss function change rate is used to evaluate the model convergence; adjusting the initial budget parameter according to the loss function change rate to obtain the adjustment result; or, Determine the global model gradient corresponding to the current training round based on the target loss function; The initial budget parameter is adjusted using the global model gradient to obtain the adjustment result.
7. The user face recognition method according to claim 2, characterized in that: The method further comprises: Determine a personalized model gradient corresponding to the training entity based on the global recognition model and the local data set; The global recognition model is updated using the personalized model gradient and the personalized learning rate to obtain a personalized recognition model; The global recognition model and the personalized recognition model are fused according to preset fusion parameters to obtain the target facial recognition model.
8. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the user face recognition method according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the storage medium is located is controlled to execute the user face recognition method according to any one of claims 1 to 7.
10. A computer program product, characterized in that The computer program product comprises computer instructions, which, when executed by a processor, implement the user face recognition method described in any one of claims 1 to 7.