Federated learning method, device, electronic device and computer-readable storage medium

The differential privacy mechanism is used to perturb the verification information in federated learning, which solves the problems of high communication overhead and low efficiency in federated learning in the existing technology, and achieves a more efficient training process.

CN114662705BActive Publication Date: 2024-09-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202210272358.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-18
Publication Date
2024-09-24
Estimated Expiration
2042-03-18

AI Technical Summary

Technical Problem

In existing federated learning methods, security mechanisms based on cryptography require encryption of information interaction between the server and participants, which increases communication overhead and requires high network communication bandwidth and stability, resulting in low training efficiency.

Method used

A differential privacy mechanism is used to perturb the verification information. Participants and the server interact in plain text without using cryptography. The post-training federated model is generated through the post-perturbation verification information and model index.

Benefits of technology

It reduces communication overhead, reduces network bandwidth and delay requirements, and improves the training efficiency of federated learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114662705B
    Figure CN114662705B
Patent Text Reader

Abstract

The embodiments of the present invention disclose a federated learning method, device, electronic device and computer-readable storage medium. After training a local model and sending the first model information of the trained first local model to a server, the embodiment of the present invention receives the aggregated first federated model returned by the server, verifies the first federated model, performs disturbance processing on the first verification information, and updates a preset first verification information set after disturbance based on the first verification information after disturbance, selects the target first verification information after disturbance from the updated first verification information set after disturbance, constructs a model index corresponding to the target first verification information after disturbance, and sends the target first verification information after disturbance and the model index to the server so that the server generates a trained federated model. The scheme can improve the training efficiency of federated learning, and the embodiments of the present invention can be applied to various scenarios such as cloud technology, artificial intelligence, smart transportation, and assisted driving.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a federated learning method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the development of computer computing and the advancement of artificial intelligence technology, federated learning has gradually become a hot topic. Federated learning completes the model of machine learning and deep learning models through multi-party collaboration. Federated learning also includes horizontal federated learning. In horizontal federated learning, multiple computing devices use their own sample data to jointly train the same model. In order to ensure the security of sample data, cryptographic security mechanisms are usually used to protect the training data of the participants.

[0003] In the process of research and practice of the prior art, the inventors of the present invention found that the cryptographic-based security mechanism requires that all information exchanged between the server and the participants be encrypted, which increases the communication overhead and requires multiple interactions between the server and the participants, which places high demands on the network communication bandwidth and stability. As a result, the training efficiency of federated learning is low. Summary of the invention

[0004] Embodiments of the present invention provide a federated learning method, device, electronic device, and computer-readable storage medium, which can improve the training efficiency of federated learning.

[0005] A federated learning method, comprising:

[0006] Training the local model, and sending first model information of the trained first local model to the server, so that the server aggregates at least one trained first local model based on the first model information;

[0007] receiving the aggregated first federated model returned by the server, and verifying the first federated model to obtain first verification information of the first federated model;

[0008] Performing disturbance processing on the first verification information, and updating a preset disturbed first verification information set based on the disturbed first verification information;

[0009] Filtering out target first post-disturbance verification information from the updated set of first post-disturbance verification information, and constructing a model index of a target federated model corresponding to the target first post-disturbance verification information;

[0010] The first verification information after the target perturbation and the model index are sent to the server, so that the server generates a trained federated model based on the first verification information after the target perturbation and the model index.

[0011] Optionally, an embodiment of the present invention further provides a federated learning method, including:

[0012] Receiving first model information of a trained first local model sent by at least one participating node participating in the current federated learning;

[0013] Aggregating the trained first local model based on the first model information to obtain a first federated model;

[0014] Sending the first federated model to the participating nodes respectively, and receiving the first verification information after the target disturbance and the model index returned by the participating nodes;

[0015] Determining a convergence state of a federated model in current federated learning according to the first verification information after the target disturbance;

[0016] Based on the federated model convergence state and the model index, a trained federated model is generated.

[0017] Accordingly, an embodiment of the present invention provides a federated learning device, including:

[0018] A training unit, configured to train a local model and send first model information of a trained first local model to a server, so that the server aggregates at least one trained first local model based on the first model information;

[0019] a verification unit, configured to receive the aggregated first federated model returned by the server, and verify the first federated model to obtain first verification information of the first federated model;

[0020] A disturbance unit, configured to perform disturbance processing on the first verification information, and update a preset disturbed first verification information set based on the disturbed first verification information;

[0021] A screening unit, configured to screen out target post-disturbance first verification information from the updated post-disturbance first verification information set, and construct a model index of a target federated model corresponding to the target post-disturbance first verification information;

[0022] A sending unit is used to send the first verification information after the target disturbance and the model index to the server, so that the server generates a trained federated model based on the first verification information after the target disturbance and the model index.

[0023] Optionally, the embodiment of the present invention may also be implemented through a federated learning device, including:

[0024] A first receiving unit, configured to receive first model information of a trained first local model sent by at least one participating node participating in the current federated learning;

[0025] an aggregation unit, configured to aggregate the trained first local model based on the first model information to obtain a first federated model;

[0026] A second receiving unit is used to send the first federated model to the participating nodes respectively, and receive the first verification information after the target disturbance and the model index returned by the participating nodes;

[0027] A determination unit, configured to determine a convergence state of a federated model in current federated learning according to the first verification information after the target disturbance;

[0028] A generating unit is used to generate a trained federated model based on the federated model convergence state and the model index.

[0029] Optionally, in some embodiments, the perturbation unit can be specifically used to obtain random noise information of the first verification information according to a preset differential privacy budget; add the random noise information to the first verification information to obtain the disturbed first verification information.

[0030] Optionally, in some embodiments, the perturbation unit can be specifically used to determine noise distribution parameters of noise information according to a preset differential privacy budget; based on the noise distribution parameters, generate a noise information set that obeys the distribution of the noise distribution parameters; randomly filter out noise information from the noise information set to obtain random noise information of the first verification information.

[0031] Optionally, in some embodiments, the training unit can be specifically used to obtain local training sample data, and calculate the gradient of the local model through the local training sample data; perform differential privacy processing on the gradient, and converge the local model based on the processed gradient to obtain a trained first local model; and send the first model information of the trained first local model to the server so that the server aggregates at least one trained first local model based on the first model information, including: extracting the current gradient or model parameter from the trained first local model as the first model information, and sending the first model information to the server so that the server aggregates at least one trained first local model based on the first model information.

[0032] Optionally, in some embodiments, the training unit can be specifically used to obtain local training sample data, and train the local model through the local training sample data to obtain a first local model after initial training; extract the initial gradient or initial model parameters from the first local model after initial training to obtain initial model information; perform differential privacy processing on the initial model information to obtain first model information of the first local model after training.

[0033] Optionally, in some embodiments, the federated learning device may further include a first detection unit, which may be specifically used to obtain the node address of a participating node participating in the current federated learning when the server is not detected; based on the node address, the first model information of the trained first local model is sent to the participating node, so that the participating node generates a trained federated model based on the first model information.

[0034] Optionally, in some embodiments, the first detection unit can be specifically used to, when receiving the second model information of the trained second local surface model sent by the participating node, aggregate the trained first local model and the trained second local model based on the second model information to obtain a second federal model; verify the second federal model to obtain second verification information, and perturb the second verification information to obtain perturbed second verification information; update a preset perturbed second verification information set based on the perturbed second verification information, and generate a trained federal model based on the updated perturbed second verification information set.

[0035] Optionally, in some embodiments, the first detection unit can be specifically used to filter out the target second verification information after disturbance from the updated second verification information after disturbance set, and send the target second verification information after disturbance to the participating node; when receiving the third verification information after disturbance sent by the participating node, the target second verification information after disturbance and the third verification information after disturbance are fused to obtain fused verification information after disturbance; based on the fused verification information after disturbance, the target second verification information after disturbance and the third verification information after disturbance, a trained federated model is generated.

[0036] Optionally, in some embodiments, the federated learning device may further include a second detection unit, which may be specifically used to receive the trained federated model returned by the server when it is detected that the server generates the trained federated model; when it is detected that the server does not generate the trained federated model, receive the training information returned by the server, and based on the training information, return to execute the step of training the local model until the server generates the trained federated model, and then receive the trained federated model returned by the server.

[0037] Optionally, in some embodiments, the determination unit can be specifically used to fuse the first verification information after the target disturbance to obtain current fusion verification information corresponding to the first federated model; obtain historical fusion verification information corresponding to the historical federated model, and calculate the information increment between the current fusion verification information and the historical fusion verification information; based on the information increment, determine the convergence state of the federated model in the current federated learning.

[0038] Optionally, in some embodiments, the generation unit can be specifically used to generate a trained federated model based on the model index when the convergence state of the federated model is converged, and send the trained federated model to the participating nodes; when the convergence state of the federated model is not converged, send training information to the participating nodes so that the participating nodes return to execute the step of training the local model based on the training information until the convergence state of the federated model is converged, so as to obtain the trained federated model, and send the trained federated model to the participating nodes.

[0039] In addition, an embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores an application program, and the processor is used to run the application program in the memory to implement the federated learning method provided by the embodiment of the present invention.

[0040] In addition, an embodiment of the present invention further provides a computer-readable storage medium, which stores a plurality of instructions, and the instructions are suitable for a processor to load to execute the steps in any one of the federated learning methods provided in the embodiment of the present invention.

[0041] In the embodiment of the present invention, after training the local model and sending the first model information of the trained first local model to the server, so that the server aggregates at least one trained first local model based on the first model information, receives the aggregated first federated model returned by the server, verifies the first federated model, and obtains the first verification information of the first federated model. Then, the first verification information is perturbed, and the preset first verification information set after perturbation is updated based on the first verification information after perturbation, the target first verification information after perturbation is screened out from the updated first verification information set after perturbation, and the model index of the target federated model corresponding to the target first verification information after perturbation is constructed. Then, the target first verification information after perturbation and the model index are sent to the server, so that the server generates the trained federated model based on the target first verification information after perturbation and the model index. Since the scheme adopts the differential privacy mechanism to perturb the first verification information, the participants and the server exchange information in plain text, without using any cryptographic method, and will not cause the problem of ciphertext expansion, so that the communication overhead is very small, and the requirements for network bandwidth and delay are very low, so the training efficiency of federated learning can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] 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 those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0043] Figure 1 is a system schematic diagram of a federated learning system provided by an embodiment of the present invention;

[0044] Figure 2 is a schematic diagram of a scenario of a federated learning method provided by an embodiment of the present invention;

[0045] Figure 3 is a flowchart of a federated learning method provided by an embodiment of the present invention;

[0046] Figure 4 It is a flowchart of current federated learning with a federated server provided by an embodiment of the present invention;

[0047] Figure 5 It is a schematic diagram of the process of current federated learning without a federated server provided by an embodiment of the present invention;

[0048] Figure 6 is another flowchart of the federated learning method provided by an embodiment of the present invention;

[0049] Figure 7It is a schematic diagram of a process of federated learning using a differential privacy algorithm provided by an embodiment of the present invention;

[0050] Figure 8 is another flowchart of the federated learning method provided by an embodiment of the present invention;

[0051] Fig. 9 is a schematic diagram of the structure of a first federated learning device provided in an embodiment of the present invention;

[0052] Fig.10 is another structural schematic diagram of the first federated learning device provided by an embodiment of the present invention;

[0053] Fig.11 is another structural schematic diagram of the first federated learning device provided by an embodiment of the present invention;

[0054] Fig.12 is a schematic diagram of the structure of a second federated learning device provided in an embodiment of the present invention;

[0055] Fig.13 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0057] The embodiment of the present invention provides a federated learning method, device, electronic device and computer-readable storage medium. Among them, the federated learning device can be integrated in an electronic device, and the electronic device can be a server or a terminal. Specifically, the embodiment of the present invention provides a federated learning device applicable to a first electronic device (in order to distinguish, it can be called a first federated learning device), and a federated learning device applicable to a second electronic device (in order to distinguish, it can be called a second federated learning device). Among them, the first electronic device can be a distributed node, and the distributed node can be a terminal or a server and other devices. The terminal includes but is not limited to a mobile phone, a computer, an intelligent voice interaction device, a smart home appliance, a vehicle terminal, an aircraft, etc. The second electronic device can be a network-side device such as a server. The server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers. It can also be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal and the server can be directly or indirectly connected by wired or wireless communication, and this application is not limited here. The embodiments of the present invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc.

[0058] In the present application embodiment, the first electronic device is used as a local server and the second electronic device is used as a federated server. Figure 1 The federated learning system provided by the embodiment of the present invention includes a local server 10 and a federated server 20, wherein the local server 10 serves as a participating node or participant, the number of local servers 10 can be one or more, and the local server 10 and the federated server 20 are connected through a network, for example, through a wired or wireless network connection. The local servers 10 can also be connected through a network, for example, through a ring topology or a mesh topology (P2P), so as to achieve communication between the local servers 10.

[0059] Among them, the local server 10 can be used to train the local model and send the first model information of the trained first local model to the federal server 20, so that the federal server 20 aggregates at least one trained first local model based on the first model information, receives the aggregated first federal model returned by the federal server 20, and verifies the first federal model to obtain the first verification information of the first federal model, and then performs disturbance processing on the first verification information, and updates the preset first verification information set after disturbance based on the first verification information after disturbance, filters out the target first verification information after disturbance from the updated first verification information set after disturbance, and constructs the model index of the target federal model corresponding to the target first verification information after disturbance, and then sends the target first verification information after disturbance and the model index to the federal server 20, so that the federal server 20 generates a trained federal model based on the target first verification information after disturbance and the model index, thereby improving the training efficiency of federated learning, which can be specifically as follows Figure 2 shown.

[0060] The federation server 20 is used to aggregate the trained first local model and generate a trained federation model according to the first verification information after the target disturbance and the model index, which can be specifically as follows:

[0061] After receiving the first model information of the trained first local model sent by at least one participating node participating in the current federated learning, the trained first local model is aggregated based on the first model information to obtain the first federated model, and then the first federated model is sent to the participating nodes respectively, and the first verification information after the target disturbance and the model index returned by the participating nodes are received, and the convergence state of the federated model in the current federated learning is determined according to the first verification information after the target disturbance, and then the trained federated model is generated based on the federated model convergence state and the model index.

[0062] Among them, Federated Learning: Federated learning is also called joint learning, which can make data "available but invisible" under the premise of protecting data security, that is, complete the training task of machine learning models through multi-party collaboration, and in addition, it can also provide reasoning services for machine learning models. Unlike traditional centralized machine learning, in the process of federated learning, two or more participants collaborate to train one or more machine learning models. From a classification point of view, based on the distribution characteristics of data, federated learning can be divided into horizontal federated learning, vertical federated learning and federated transfer learning. Among them, horizontal federated learning is also called sample-based federated learning, which is applicable to the case where sample sets share the same feature space but different sample spaces; vertical federated learning is also called feature-based federated learning, which is applicable to the case where sample sets share the same sample space but different feature spaces; federated transfer learning is applicable to the case where sample sets are not only different in sample space but also different in feature space. The federated learning method provided in the embodiment of the present application belongs to the horizontal federated learning method. The application scenario of horizontal federated learning is that each participating node (local server) of federated learning has the same feature space and different sample space in each sample data.

[0063] It should be noted that the federated learning method provided in the embodiment of the present application involves machine learning technology in the field of artificial intelligence, that is, in the embodiment of the present application, the machine learning technology of artificial intelligence can be used to train the federated model through participating nodes and federal servers to obtain the trained federal model.

[0064] Artificial Intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, as well as machine learning / deep learning, autonomous driving, and smart transportation.

[0065] Machine Learning (ML) is a multi-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0066] Among them, the participating nodes and federated servers in federated learning can all be cloud platforms. The so-called cloud platform, also known as cloud computing platform, refers to services based on hardware resources and software resources, providing computing, network and storage capabilities. Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". From the user's perspective, the resources in the "cloud" can be infinitely expanded, and can be obtained at any time, used on demand, expanded at any time, and paid for by use.

[0067] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.

[0068] According to the logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on the PaaS layer. SaaS can also be deployed directly on IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.

[0069] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.

[0070] This embodiment will be described from the perspective of a first federated learning device, which can be specifically integrated in an electronic device, which can be a local server or other device; wherein the local server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0071] A federated learning method, comprising:

[0072] Train the local model, and send the first model information of the trained first local model to the server, so that the server aggregates at least one trained first local model based on the first model information, receives the aggregated first federal model returned by the server, verifies the first federal model, obtains the first verification information of the first federal model, performs perturbation processing on the first verification information, and updates the preset perturbation first verification information set based on the perturbation first verification information, filters out the target perturbation first verification information from the updated perturbation first verification information set, and constructs the model index of the target federal model corresponding to the target perturbation first verification information, and sends the target perturbation first verification information and the model index to the server, so that the server generates the trained federal model based on the target perturbation first verification information and the model index.

[0073] like Figure 3 As shown in Figure 2, the specific process of the federated learning method is as follows:

[0074] 101. Train a local model, and send first model information of a trained first local model to a server, so that the server aggregates at least one trained first local model based on the first model information.

[0075] Among them, the server can be a federal server, which can be used to aggregate local models trained by participants in a federated learning scenario, and generate a trained federal model based on verification information of the federal model returned by the participants.

[0076] The first model information may be understood as the model information of the first local model after training, and the so-called model information may be the model gradient or model parameter of the first local model after training.

[0077] There are many ways to train the local model. For example, differential privacy processing can be performed during the training of the local model, or differential privacy processing can be performed after the local model is trained, so as to obtain a first local model after training that meets the differential privacy requirements. Specifically, it can be as follows:

[0078] (1) Perform differential privacy processing during local model training

[0079] For example, local training sample data may be obtained, and the gradient of the local model may be calculated using the local training sample data. The gradient may be differentially privately processed, and the local model may be converged based on the processed gradient to obtain a first local model after training.

[0080] Among them, differential privacy processing (DP) is a means of privacy protection (statistical means), which aims to provide a method that maximizes the accuracy of data queries when querying from a statistical database while minimizing the chance of identifying its records. A key concept related to differential privacy is adjacent datasets. Suppose two datasets x and x′ are given. If they have only one piece of data that is different, then these two datasets can be called adjacent datasets. If for a random algorithm M, if the two outputs obtained by acting on these two adjacent datasets respectively, for example, two machine learning models are trained separately, and it is difficult to distinguish which dataset the output is obtained from with a certain probability, then this random algorithm M is considered to meet the differential privacy requirements. Mathematically, the definition of ε-differential privacy can be shown as formula (1):

[0081]

[0082] Where o represents the output and ε represents the privacy loss measure. The meaning of formula (1) is that for any adjacent data set, the probability of obtaining a specific output parameter through training is similar. Therefore, it is difficult for an observer to detect small changes in the data set by observing the output parameters, and it is also impossible to infer a specific training data by observing the output parameters. In this way, the purpose of protecting local data is achieved.

[0083] There are many ways to perform differential privacy processing on gradients. For example, the gradients can be clipped by the binary norm and Gaussian noise can be added. Alternatively, other differential privacy processing methods can be used. The privacy budget of the differential privacy processing can be a preset training privacy budget (ε1).

[0084] (2) Perform differential privacy processing after local model training

[0085] For example, local training sample data can be obtained, and the local model can be trained using the local training sample data to obtain a first local model after initial training, initial gradients or initial model parameters can be extracted from the first local model after initial training to obtain initial model information, and differential privacy processing can be performed on the initial model information to obtain first model information of the first local model after training.

[0086] There are many ways to perform differential privacy processing (DP) on the initial model information. For example, the initial gradient or initial model parameter in the initial model information can be clipped by the binary norm and Gaussian noise can be added. Alternatively, other differential privacy processing methods can be used for processing. The privacy budget of the differential privacy processing can be a preset training privacy budget (ε1).

[0087] After training the local model, the first model information of the trained first local model can be sent to the server. For example, when the trained first local model is a model obtained after differential privacy processing during the training process of the local model, the current gradient or model parameter can be extracted from the trained first local model as the first model information, and the first model information can be sent to the server so that the server can aggregate at least one trained first local model based on the first model information. When the trained first local model is a model obtained after differential privacy processing after the local model is trained, the first model of the trained first local model is sent to the server so that the server can aggregate at least one trained local model based on the first model information.

[0088] The server aggregates at least one trained local model, which can be understood as integrating and fusing the trained first local models trained by each participant in the current federated learning, so as to obtain the first federated model M n There are many ways to aggregate the trained first local model. For example, the first federated model can be generated by using a federated average method, or the first federated model can be generated by using an integrated learning method. After the server generates the first federated model, the first federated model can be sent to each participant in the current federated learning.

[0089] 102. Receive the aggregated first federated model returned by the server, and verify the first federated model to obtain first verification information of the first federated model.

[0090] The first verification information is information obtained by the participants of the current federated learning through verification or evaluation of the effect of the first federated model.

[0091] There are multiple ways for the receiving server to return the aggregated first federation model, which can be as follows:

[0092] For example, the first federated model returned by the server may be directly received, or the federated model information of the first federated model returned by the server may be received, and the first federated model is generated based on the federated model information.

[0093] Among them, there can be multiple ways to generate the first federal model based on the federal model information. For example, a basic model can be obtained, and the model parameters or gradients of the basic model can be updated and adjusted based on the federal model information to obtain the first federal model. Alternatively, the gradients or model parameters of the local model can be adjusted based on the federal model information to obtain the first federal model.

[0094] After receiving the first federal model, the first federal model can be verified. The verification here means evaluating the quality of the federal model. There are many ways to verify the first federal model. For example, you can obtain verification sample data, verify the first federal model based on the verification sample data, obtain verification information of the first federal model, evaluate the verification information, and obtain verification information of the first federal model.

[0095] There are many ways to verify the first federated model. For example, the number of sample data that can be correctly identified or classified by the first federated model can be verified, or at least one model indicator of the first federated model can be verified based on the verification sample data to obtain verification information.

[0096] There may be many types of model indicators, for example, AUC (area under the ROC curve, a model evaluation indicator), Accuracy, Precision, Recall and / or F1-Score (a classification indicator), etc.

[0097] After obtaining the verification information, the verification information can be evaluated. There are many ways to evaluate it. For example, when there is only one verification result in the verification information, the verification information can be directly converted into an effect score and the effect score Q n,k As the first verification information, when there are verification results of multiple verification methods in the verification information, each verification result can be weighted respectively, and the weighted verification results can be fused. Based on the fused verification results, the first federated model M is determined. n The effect score Q n,k , the effect score Q n,k As the first verification information.

[0098] 103. Perform disturbance processing on the first verification information, and update a preset disturbed first verification information set based on the disturbed first verification information.

[0099] The disturbance processing can be understood as performing differential privacy processing on the first verification information, or can be understood as adding random noise information to the first verification information, thereby disturbing the first verification information.

[0100] The preset first verification information set after disturbance may be a set storing the first verification information after disturbance received by the participants of the current federated learning each time for the first federated model to be verified. When the nth first federated model to be verified is received, (n-1) first verification information after disturbance will be stored in the preset first verification information set after disturbance. After the disturbance processing of the first verification information of the currently received first federated model is completed, the preset first verification information set after disturbance may be updated, and the updated first verification information set after disturbance may include n first verification information after disturbance.

[0101] There are multiple ways to perform disturbance processing on the first verification information, which can be specifically as follows:

[0102] For example, random noise information of the first verification information may be obtained according to a preset differential privacy budget, and the random noise information may be added to the first verification information to obtain the disturbed first verification information.

[0103] The random noise information can be the noise information randomly added to the first verification information, and the first verification information is used as the effect score Q n,k For example, the random noise information can be noise information such as random numbers. According to the preset differential privacy budget, there are multiple ways to obtain the random noise information of the first verification information. For example, according to the preset differential privacy budget, the noise distribution parameters of the noise information can be determined, based on the noise distribution parameters, a noise information set that obeys the noise distribution parameters is generated, and the noise information is randomly selected from the noise information set to obtain the random noise information of the first verification information.

[0104] Among them, the preset differential privacy budget can also be understood as the total privacy overhead in the current federated learning scenario. The privacy overhead required for differential privacy processing of the first verification information can be the verification differential privacy budget ε2. Therefore, according to the preset differential privacy budget, there are many ways to determine the noise distribution parameters of the noise information. For example, the differential privacy budget difference between the preset differential privacy budget ε and the preset training privacy budget ε1 can be calculated, and the verification differential privacy budget ε2 can be determined based on the differential privacy budget difference. Based on the verification differential privacy budget, the noise distribution parameters of the noise information are determined. The noise distribution parameters can be understood as parameters indicating the distribution of noise information.

[0105] After obtaining the random noise information of the first verification information, the random noise information can be added to the first verification information to obtain the disturbed first verification information. There are many ways to add the random noise information, for example, taking the first verification information as the effect score Q n,k , the random noise information is a random number based on Laplace distribution, for example, we can directly use the effect score Q n,kA random number is added to obtain the first verification information after disturbance, which can be specifically shown as formula (2):

[0106]

[0107] Among them, V n,k is the first verification information after disturbance, is a random number randomly selected from the Laplace distribution, and ε2 is the verification differential privacy budget. The verification differential privacy budget ε2 can be the privacy overhead consumed by this differential privacy processing, which can be specifically shown in formula (3):

[0108]

[0109] Among them, ε2 is the verification differential privacy budget, ε is the preset differential privacy budget, which is the total differential privacy budget preset in the current federated learning, ε1 is the training differential privacy budget, and N is the total number of iterations. The number of iterations can be regarded as one perturbation of the first verification information, which can also be understood as the number of aggregations of the federated model.

[0110] The Laplace privacy mechanism is used to perturb the first verification information. The so-called Laplace mechanism can be to use Laplace noise to perturb the value of the answer query so that the output has a certain probability of being the same, thereby ensuring ε-differential privacy. For the query function f: The Laplace mechanism can be expressed as formula (4):

[0111]

[0112] Among them, Y i are independent variables with the same part, and follow the distribution Δf is the sensitivity value caused by the change of adjacent data sets. Therefore, for any adjacent data sets x, x′, there is a certain probability that the output is the same, and this probability is less than or equal to e ε .

[0113] It should be noted that, in addition to the differential privacy mechanism of Laplace distribution, other differential privacy mechanisms can also be used to perturb the first verification information, for example, exponential mechanism, Gaussian noise and Best Response mechanism, etc.

[0114] After the first verification information is disturbed, the preset first verification information after disturbance can be updated based on the first verification information after disturbance. There can be many ways to update. For example, the first verification information after disturbance can be directly added to the preset first verification information set after disturbance to obtain the updated first verification information set after disturbance. At this time, the updated first verification information set after disturbance includes the first verification information after disturbance after disturbance for each first federal model received.

[0115] 104. Filter out target post-disturbance first verification information from the updated post-disturbance first verification information set, and construct a model index of a target federated model corresponding to the target post-disturbance first verification information.

[0116] The model index may be understood as index information indicating the target federated model.

[0117] There are multiple ways to filter out the target first post-disturbance verification information from the updated first post-disturbance verification information set, which can be specifically as follows:

[0118] For example, the first verification information after disturbance with the largest effect score can be screened out from the updated first verification information after disturbance set to obtain the target first verification information after disturbance, or the first verification information after disturbance in the updated first verification information after disturbance set can be sorted, and based on the sorting result, at least one candidate first verification information after disturbance is screened out from the updated first verification information after disturbance set, and the first verification information after disturbance with the largest effect score or the most effect scores is screened out from the candidate first verification information after disturbance as the target first verification information after disturbance. Optionally, the first verification information after disturbance can be screened out as the target first verification information after disturbance by an exponential mechanism.

[0119] Among them, it should be noted that each first verification information after disturbance corresponds to a first federal model. Therefore, after screening out the first verification information after the target disturbance, the model index of the target federal model corresponding to the first verification information after the target disturbance can be constructed. There are many ways to construct the model index. For example, you can obtain the received first federal model set, screen out the federal model corresponding to the first verification information after the target disturbance in the first federal model set, obtain the target federal model, and then, construct the model index of the target federal model according to the model information of the target federal model.

[0120] 105. Send the first verification information after the target disturbance and the model index to the server, so that the server generates a trained federated model based on the first verification information after the target disturbance and the model index.

[0121] There are many ways to send the first verification information and the model index after the target disturbance to the server, which can be as follows:

[0122] For example, the first verification information after the target disturbance and the model index can be directly sent to the server so that the server can generate a trained federated model based on the first verification information after the target disturbance and the model index. Alternatively, a stop training request can be sent to the server, and the stop training request carries the storage address of the first verification information after the target disturbance and the model index, so that the server can obtain the first verification information after the target disturbance and the model index based on the storage address. Then, the server can generate a trained federated model based on the first verification information after the target disturbance and the model index.

[0123] Optionally, after sending the first verification information and the model index after the target disturbance to the server so that the server generates a trained federated model based on the first verification information and the model index after the target disturbance, it is also possible to detect whether the server has generated the trained federated model. For example, when it is detected that the server has generated the trained federated model, the trained federated model returned by the server is received; when it is detected that the server has not generated the trained federated model, the training information returned by the server is received, and based on the training information, the step of training the local model is returned until the server generates the trained federated model, and the trained federated model returned by the server is received.

[0124] Optionally, after training the local model, the server can also be detected in the current federated learning scenario. When the server is detected, the first model information of the trained first local federated model can be sent to the server. When the server is not detected, it can be said that there is no federal server in the current federated learning scenario. At this time, it can also be determined that there are two participants in the current federated learning. The two participants can communicate directly without going through the federal server. At this time, the trained first local model can be sent to the participating nodes of the participants in the current federated learning. For example, when the server is not detected, the node address of the participating node participating in the current federated learning is obtained, and based on the node address, the first model information of the trained first local model is sent to the participating node, so that the participating node generates a trained federated model based on the first model information.

[0125] Among them, it should be noted that in the current federated learning scenario without a server, the participants can act as participants or as servers in the federated learning, which means that the first model of the trained first local model can be sent to the participating node, and the second model of the trained second local model sent by the participating node can also be received. At this time, the local participating node can aggregate the trained first local model and the trained second local model to obtain the second federated model, and then verify the second federated model to generate a trained federated model. For example, when the second model information of the trained second local model sent by the participating node is received, based on the second model information, the trained first local model and the trained second local model are aggregated to obtain the second federated model, the second federated model is verified to obtain the second verification information, and the second verification information is disturbed to obtain the disturbed second verification information, the preset disturbed second verification information set is updated based on the disturbed second verification information, and the trained federated model is generated based on the updated disturbed second verification information.

[0126] Among them, there can be multiple ways to generate a trained federal model based on the updated second verification information after disturbance. For example, the target second verification information after disturbance is screened out from the updated second verification information after disturbance set, and the target second verification information after disturbance is sent to the participating nodes. When the third verification information after disturbance is received from the participating nodes, the target second verification information after disturbance and the third verification information after disturbance are fused to obtain fused verification information after disturbance. Based on the fused verification information after disturbance, the target second verification information after disturbance and the third verification information after disturbance, a trained federal model is generated.

[0127] Among them, the method of selecting the target post-disturbance second verification information from the updated post-disturbance second verification information set is the same as the method of selecting the target post-disturbance first verification information, as described above, and will not be repeated here.

[0128] There are multiple ways to generate a trained federated model based on the verification information after fusion disturbance, the second verification information after target disturbance, and the third verification information after disturbance. For example, the historical fusion disturbance verification information can be obtained, and the information increment of the fusion disturbance verification information and the historical fusion disturbance verification information can be calculated. Based on the information increment, the convergence state of the federated model of the current federated learning is determined. When the convergence state of the federated model is converged, the first candidate federated model corresponding to the second verification information after target disturbance and the second candidate federated model corresponding to the third verification information after disturbance are obtained, and the trained federated model is generated according to the first candidate federated model and the second candidate federated model. When the convergence state of the federated model is not converged, return to the step of training the local model until the convergence state of the federated model is converged, so as to obtain the trained federated model.

[0129] There are many ways to generate a trained federal model based on the first candidate federal model and the second candidate federal model. For example, the trained federal model can be screened out from the first candidate federal model and the second candidate federal model, or the second candidate federal model and the second federal model can be fused to obtain the trained federal model, and so on.

[0130] It should be noted that the current federated learning may include a server or not. In the federated learning scenario including a server, at least two participating nodes interact with the server. Taking the disturbance processing method as the Laplace mechanism, the first verification information as the effect score, and the server as a federated server as an example, the current federated learning process with a federated server can be as follows: Figure 4 As shown, the participants train the local model based on differential privacy through the participating nodes, and the first local model M after training n,1 The federated server aggregates the first local model after training to obtain the federated model M. n , send the federated model Mn to the participating nodes of the participants, and the participants will n Perform effect evaluation and obtain the effect score Q n,k , then, the effect score Q of the participants on the federated model Mn based on the Laplace mechanism n,k Perturb and change the score V corresponding to the model n,k , and the corresponding model index L n,k In the federated learning scenario without a server, there are participants 1 and 2, and participants 1 and 2 communicate through a ring topology or a mesh topology (P2P). For example, the disturbance processing method is the Laplace mechanism, and the first verification information is the effect score. The current federated learning process without a federated server can be as follows: Figure 5 As shown, participant 1 trains the local model based on the differential privacy mechanism, and sends the first model information of the trained first local model to participant 2, and can also receive the second model information of the trained second local model sent by participant 2, aggregate the trained first local model and the trained second local model, and evaluate the effect of the aggregated federal model, then use the Laplace mechanism to perturb the effect score of the federal model, send the perturbed effect score to participant 2, and can also receive the perturbed effect score sent by participant 2, thereby generating a trained federal model.

[0131] Among them, in the current federated learning scenario of this scheme, the participants use the scheme based on DP-SGD and Laplace differential privacy mechanism to protect their own training data. The participants can send their own trained local models to the federated server or other participants in plain text, and the effect evaluation of the federated model can effectively prevent the overfitting of the horizontal federated model training. In addition, the verification information generated by the effect evaluation is perturbed, so that the data security of the participants can be guaranteed during the model effect evaluation process. In the data interaction process of one iteration between the participants and the server, each participant only needs to send the model information and the perturbed verification information (including the model index) to the federated server once, and all of them are transmitted in plain text. There is only one transmission of the federated model (or model information) from the federated server to each participant, and the transmission is also in plain text, so the communication overhead is very small, and the requirements for the communication network bandwidth and delay are very low. In addition, this scheme can also support two-party horizontal federated learning, and one participant can communicate directly with another participant without the need for a server (federated server).

[0132] From the above, it can be seen that in the embodiment of the present application, after training the local model and sending the first model information of the trained first local model to the server, so that the server aggregates at least one trained first local model based on the first model information, receives the aggregated first federated model returned by the server, and verifies the first federated model to obtain the first verification information of the first federated model, then perturbs the first verification information, and updates the preset perturbed first verification information set based on the perturbed first verification information, and filters out the target perturbed first verification information from the updated perturbed first verification information set. , and construct the model index of the target federated model corresponding to the first verification information after the target perturbation, and then send the first verification information after the target perturbation and the model index to the server, so that the server generates a trained federated model based on the first verification information after the target perturbation and the model index; since the scheme adopts the differential privacy mechanism to perturb the first verification information, the participants and the server exchange information in plain text, without the use of any cryptographic methods, and will not cause the problem of ciphertext expansion, making the communication overhead very small, and the requirements for network bandwidth and delay are very low, therefore, the training efficiency of federated learning can be improved.

[0133] This embodiment will be described from the perspective of a second federated learning device, which can be specifically integrated in an electronic device, which can be a server or other device; wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0134] A federated learning method, comprising:

[0135] After receiving the first model information of the trained first local model sent by at least one participating node participating in the current federated learning, the trained first local model is aggregated based on the first model information to obtain the first federated model, and then the first federated model is sent to the participating nodes respectively, and the first verification information after the target disturbance and the model index returned by the participating nodes are received, and then, according to the first verification information after the target disturbance, the convergence state of the federated model in the current federated learning is determined, and based on the federated model convergence state and the model index, the trained federated model is generated.

[0136] like Figure 6 As shown in the figure, the specific process of the federated learning method is as follows:

[0137] 201. Receive first model information of a trained first local model sent by at least one participating node participating in current federated learning.

[0138] For example, the first model information of the first local model after training sent by the participating nodes participating in the current federated learning can be directly received, or the model aggregation request sent by the participating nodes participating in the current federated learning can be received, and the model aggregation request carries the storage address of the first model of the first local model after training, and based on the storage address, the first model information of the first local model after training is obtained.

[0139] 202. Aggregate the trained first local model based on the first model information to obtain a first federated model.

[0140] For example, a trained first local model may be constructed based on the first model information, and the trained first local model may be aggregated to obtain a first federated model.

[0141] There are many ways to construct the first local model after training based on the first model information. For example, the local model of the participant can be obtained, and information such as the gradient or model parameters of the model can be extracted from the first model information, and the gradient or model parameters can be set in the local model to obtain the first local model after training. Alternatively, information such as the gradient or model parameters of the model can be extracted from the first model information, and the first local model after training can be generated based on the model gradient or model parameters.

[0142] After constructing the trained first local model, the trained first model can be aggregated. There are many ways to aggregate the models. For example, the trained first local models of the participants can be aggregated by using a Federated Average method to obtain a first federated model. Alternatively, the trained first local models of the participating nodes can be integrated and fused by using an ensemble learning method to obtain a first federated model.

[0143] There are many ways to use federal averaging. For example, the sample data volume of each participating node can be obtained, and the weighting coefficient of each participating node can be determined based on the sample data volume. The trained first local model of the participating nodes is weighted averaged based on the weighting coefficient to obtain the first federal model.

[0144] Among them, there are many ways to determine the weighting coefficient of each participating node based on the sample data volume. For example, the sample data volume is accumulated to obtain the total sample data volume of the current federated learning, and the ratio of the sample data volume of each participating node to the total sample data volume is calculated, and the ratio is used as the weighting coefficient of the first local model after training of the corresponding participating node.

[0145] 203. Send the first federated model to the participating nodes respectively, and receive the first verification information and model index after the target disturbance returned by the participating nodes.

[0146] For example, the first federal model can be directly sent to each participating node respectively, or the model gradient or model parameter can be extracted from the first federal model as federal model information, and the federal model information can be sent to the participating nodes respectively. Alternatively, a verification request can be sent to each participating node respectively, and the verification request carries the storage address of the first federal model or the federal model information of the first federal model, so that the participating nodes can obtain the first federal model or the federal model information of the first federal model through the storage address.

[0147] Among them, after receiving the first federal model or the federal model parameters of the first federal model, the participating nodes can verify the first federal model, obtain the first verification information of the first federal model, perform disturbance processing on the first verification information, and update the preset post-disturbance first verification information set based on the post-disturbance first verification information, filter out the target post-disturbance first verification information from the updated post-disturbance first verification information set, and construct the model index of the target federal model corresponding to the target post-disturbance first verification information.

[0148] After the participating nodes verify the first federal model and screen out the first verification information after the target disturbance and the model index, they can receive the first verification information after the target disturbance and the model index sent by the participating nodes. There can be multiple ways to receive the first verification information after the target disturbance and the model index. For example, they can directly receive the first verification information after the target disturbance and the model index sent by the participating nodes, or they can also receive a model generation request, which carries the storage address of the first verification information after the target disturbance and the model index, and can obtain the first verification information after the target disturbance and the model index based on the storage address.

[0149] 204. Determine a convergence state of a federated model in current federated learning according to first verification information after the target disturbance.

[0150] Among them, the federated model status is used to indicate whether the federated model in the current federated learning has converged. The convergence of the federated model can be used to determine whether the current federated learning needs to stop training, thereby preventing the federated model from overfitting.

[0151] There are multiple ways to determine the convergence state of the federated model in the current federated learning according to the first verification information after the target disturbance, which can be specifically as follows:

[0152] For example, the first verification information after the target disturbance is fused to obtain the current fusion verification information corresponding to the first federated model, the historical fusion verification information corresponding to the historical federated model is obtained, and the information increment between the current fusion verification information and the historical fusion verification information is calculated. Based on the information increment, the convergence state of the federated model in the current federated learning is determined.

[0153] There are many ways to fuse the first verification information after the target disturbance. For example, the weighted coefficients of the participating nodes can be obtained, and the first verification information after the target disturbance can be weighted averaged based on the weighted coefficients to obtain the current fused verification information.

[0154] Among them, the historical fusion verification information can be the fusion verification information corresponding to other federal models aggregated by the server before aggregating the first federal model. The information increment can be the increment between the current fusion verification information and the historical fusion verification information, or it can be the information difference. There can be many ways to calculate the information increment between the current fusion verification information and the historical fusion verification information. For example, based on the aggregation time of the federal model, the historical fusion verification information is sorted, and based on the sorting information and the aggregation time, a preset number of historical fusion verification information adjacent to the first federal model is screened out from the historical fusion verification information to obtain the target historical fusion verification information, and the information increment between the current fusion verification information and each target historical fusion verification information is calculated respectively.

[0155] After calculating the information increment, the convergence state of the federated model in the current federated learning can be determined based on the information increment. There are many ways to determine the convergence state of the federated model. For example, the incremental differences between the information increments are calculated separately. When the incremental difference does not exceed the preset incremental threshold, the convergence state of the federated model is determined to be converged. When the incremental difference exceeds the preset incremental threshold, the convergence state of the federated model is determined to be unconverged.

[0156] Among them, it should be noted that in the process of determining the convergence state of the federated model in the current federated learning based on the first verification information after the target disturbance, taking the fusion verification information as the model score as an example, it can be understood that the federated server will compare the weighted average scores of the n rounds of federated models received. If the federated model has converged, that is, the model score is difficult to continue to improve with the number of iterations, the convergence state of the federated model can be accurately judged.

[0157] 205. Generate a trained federated model based on the federated model convergence state and the model index.

[0158] For example, when the convergence state of the federated model is converged, a trained federated model is generated based on the model index and the trained federated model is sent to the participating nodes. When the convergence state of the federated model is unconverged, training information is sent to the participating nodes so that the participating nodes return to the step of training the local model based on the training information until the convergence state of the federated model is converged, so as to obtain the trained federated model and send the trained federated model to the participating nodes.

[0159] There are many ways to generate a trained federated model based on the model index. For example, filter out the model index {L n,1 ,L n,2 ,…,L n,k}, and filter out the trained federal model from the target federal model. Alternatively, the target federal model corresponding to each model index can be filtered out from the aggregated federal model set, and the target federal models can be fused to obtain the trained federal model.

[0160] There are many ways to fuse the target federated models. For example, the target federated models may be averaged to obtain a trained federated model, or the target federated models may be weighted averaged to obtain a trained federated model.

[0161] Among them, in the current federated learning scenario where there is a server, the process of federated learning using differential privacy algorithm can be as follows: Figure 7 As shown, each participant in horizontal federated learning performs DP-SGD (a differential privacy algorithm) algorithm training locally, and after the local training is completed, the trained model is sent to the federated server in plain text. The federated server integrates and fuses the received local model parameters, and then sends the obtained federated integrated learning model to each participant. After receiving the federated model, each participant uses the validation set to evaluate the model effect of the federated model, and sends the model evaluation results to the server, which decides whether to stop training. When it is determined not to stop training, participant K returns to the step of performing local training. When it is determined to stop training, the average model evaluation score is used to select the optimal federated model as the trained federated model.

[0162] From the above, it can be seen that after receiving the first model information of the trained first local model sent by at least one participating node participating in the current federated learning, the embodiment of the present application aggregates the trained first local model based on the first model information to obtain the first federated model, and then sends the first federated model to the participating nodes respectively, and receives the first verification information after the target disturbance and the model index returned by the participating nodes, and then determines the convergence state of the federated model in the current federated learning according to the first verification information after the target disturbance, and generates the trained federated model based on the federated model convergence state and the model index; because the scheme exchanges information between the server and the participating method in plain text, there is no need to use any cryptographic method, and the problem of ciphertext expansion will not occur, so that the communication overhead is very small, and the requirements for network bandwidth and delay are very low, therefore, the training efficiency of federated learning can be improved.

[0163] According to the method described in the above embodiment, the following is further described in detail with examples.

[0164] In this embodiment, in a federated learning scenario involving a federated server, the first federated learning device will be the local server of the participant, and the second federated learning device will be the federated server. In a federated learning scenario without the participation of a federated server, the local server may include a first local model of the local node and a second local model corresponding to the participating node. The verification information is illustrated by taking the effect score of the federated model as an example.

[0165] like Figure 8 As shown in the figure, a federated learning method is shown in the figure. The specific process is as follows:

[0166] 301. The local server trains the local model and sends first model information of the trained first local model to the federal server.

[0167] For example, the local server can perform differential privacy processing during the training process of the local model, or can also perform differential privacy processing after the local model is trained, so as to obtain a first local model after training that meets the differential privacy requirements, which can be specifically as follows:

[0168] (1) The local server performs differential privacy processing during the training of the local model;

[0169] For example, the local server can obtain local training sample data, and calculate the gradient of the local model through the local training sample data, perform two-norm value cutting and add Gaussian noise on the gradient, or other differential privacy processing methods can be used for processing, and the privacy budget of the differential privacy processing can be the preset training privacy budget (ε1). Based on the processed gradient, the local model is converged to obtain the first local model after training.

[0170] (2) The local server performs differential privacy processing after local model training.

[0171] For example, the local server can obtain local training sample data, and train the local model through the local training sample data to obtain the first local model after initial training, extract the initial gradient or initial model parameter from the first local model after initial training, obtain the initial model information, perform bi-norm value cutting and add Gaussian noise to the initial gradient or initial model parameter in the initial model information, or other differential privacy processing methods can be used to obtain the first model information of the first local model after training. The privacy budget of the differential privacy processing can be the preset training privacy budget (ε1).

[0172] When the trained first local model is a model obtained after differential privacy processing during the training process of the local model, the local server can extract the current gradient or model parameter from the trained first local model as the first model information, and send the first model information to the server, so that the server aggregates at least one trained first local model based on the first model information. When the trained first local model is a model obtained after differential privacy processing after the local model is trained, the local server sends the first model of the trained first local model to the server, so that the server aggregates at least one trained local model based on the first model information.

[0173] 302. The federal server aggregates the trained first local model based on the first model information to obtain a first federal model.

[0174] For example, the federal server can obtain the local models of the participants, extract information such as the model gradient or model parameters from each first model information, and set the gradient or model parameters in the local model to obtain the first local model after training for each participant. Alternatively, the federal server can extract information such as the model gradient or model parameters from the first model information, and generate the first local model after training for each participant based on the model gradient or model parameters.

[0175] The federation server obtains the sample data volume of each participating node, accumulates the sample data volume, obtains the total sample data volume of the current federation learning, calculates the quantity ratio of the sample data volume of each participating node to the total sample data volume, and uses the quantity ratio as the weight coefficient of the first local model after training of the corresponding participating node. Based on the weight coefficient, the first local model after training of the participating node is weighted averaged to obtain the first federation model, or the first local model after training of the participating nodes can be integrated and merged by ensemble learning to obtain the first federation model.

[0176] 303. The federation server sends the first federation model to the participating nodes respectively.

[0177] For example, the federal server can directly send the first federal model to the local server of each participating node, or can extract model gradients or model parameters from the first federal model as federal model information, and send the federal model information to the local servers of the participating nodes, or can send a verification request to the local server of each participating node, where the verification request carries the storage address of the first federal model or the federal model information of the first federal model, so that the local server of the participating node can obtain the first federal model or the federal model information of the first federal model through the storage address.

[0178] 304. The local server verifies the first federated model and obtains a first effect score of the first federated model.

[0179] For example, the local server obtains the basic model, updates and adjusts the model parameters or gradient of the basic model based on the federal model information to obtain the first federal model, or adjusts the gradient or model parameters of the local model based on the federal model information to obtain the first federal model.

[0180] The local server obtains the verification sample data, verifies the number of test sample data correctly identified or classified by the first federated model, or verifies at least one model indicator of the first federated model based on the verification sample data, thereby obtaining verification information. The model indicator may include AUC, Accuracy, Precision, Recall and / or F1-Score, etc.

[0181] When there is only one verification result of the verification method in the verification information, the local server can directly convert the verification information into an effect score and store the effect score Q n,k As the first effect score, when there are verification results of multiple verification methods in the verification information, each verification result can be weighted respectively, and the weighted verification results can be fused. Based on the fused verification results, the first federated model M is determined. n The effect score Q n,k , the effect score Q n,k as the first effect score.

[0182] 305. The local server performs disturbance processing on the first effect score, and updates a preset post-disturbance first effect score set based on the post-disturbance first effect score.

[0183] For example, the local server may calculate the differential privacy budget difference between the preset differential privacy budget ε and the preset training privacy budget ε1, determine the verification differential privacy budget ε2 based on the differential privacy budget difference, and determine the noise distribution parameter of the noise information based on the verification differential privacy budget. Based on the noise distribution parameter, generate a noise information set that obeys the noise distribution parameter, randomly select noise information from the noise information set, and obtain random noise information with a first effect score. In this effect score Q n,k A random number is added to obtain the first effect score after disturbance, which can be specifically shown in formula (2).

[0184] The local server can directly add the perturbed first effect score to the preset perturbation first effect score set to obtain an updated perturbation first effect score set. At this time, the updated perturbation first effect score set includes the perturbation first effect score after perturbing the first effect score of each received first federal model.

[0185] 306. The local server selects a target post-disturbance first effect score from the updated post-disturbance first effect score set, and constructs a model index of a target federated model corresponding to the target post-disturbance first effect score.

[0186] For example, the local server can filter out the post-disturbance first effect score with the largest effect score from the updated post-disturbance first effect score set to obtain the target post-disturbance first effect score, or can also sort the post-disturbance first effect scores in the updated post-disturbance first effect score set, and based on the sorting result, filter out at least one candidate post-disturbance first effect score from the updated post-disturbance first effect score set, and filter out the post-disturbance first effect score with the largest effect score or the most effect scores from the candidate post-disturbance first effect scores as the target post-disturbance first effect score. Optionally, the post-disturbance first verification information can also be filtered out through an exponential mechanism as the target post-disturbance first verification information.

[0187] The local server can obtain the received first federal model set, filter out the federal model corresponding to the first effect score after the target disturbance in the first federal model set, obtain the target federal model, and then construct the model index of the target federal model according to the model information of the target federal model.

[0188] 307. The local server sends the first effect score and the model index after the target disturbance to the federal server.

[0189] For example, the local server can directly send the first effect score and model index after the target disturbance to the federal server, so that the federal server generates a trained federal model based on the first effect score after the target disturbance and the model index. Alternatively, a stop training request can be sent to the federal server, and the stop training request carries the storage address of the first effect score and model index after the target disturbance, so that the federal server can obtain the first effect score and model index after the target disturbance based on the storage address.

[0190] 308. The federated server determines the convergence state of the federated model in the current federated learning according to the first effect score after the target disturbance.

[0191] For example, the federal server can obtain the weight coefficients of the participating nodes, and perform weighted averaging on the first effect score after the target disturbance based on the weight coefficients, so as to obtain the current federal model effect score. The historical federal model effect scores corresponding to the historical federal models are obtained, and the historical federal model effect scores are sorted based on the aggregation time of the federal models. Based on the sorting information and the aggregation time, a preset number of historical federal model effect scores adjacent to the first federal model are screened out from the historical federal model effect scores to obtain the target historical federal model effect score, and the effect score increment between the current federal model effect score and each target historical federal model effect score is calculated respectively. The incremental difference between the effect score increments is calculated respectively. When the incremental difference does not exceed the preset incremental threshold, the federal model convergence state is determined to be converged. When the incremental difference exceeds the preset incremental threshold, the federal model convergence state is determined to be unconverged.

[0192] 309. The federation server generates a trained federation model based on the federation model convergence state and the model index.

[0193] For example, when the federated model convergence state is converged, the federated server filters out the model index {L n,1 ,L n,2 ,…,L n,k}, select the trained federated model from the target federated model, or select the target federated model corresponding to each model index from the aggregated federated model set, average the target federated models to obtain the trained federated model, or perform weighted average processing on the target federated models to obtain the trained federated model. Send the trained federated model to the local server of the participating node.

[0194] When the convergence state of the federated model is not converged, the federated server sends training information to the local servers of the participating nodes, so that the local servers of the participating nodes return to the step of training the local model based on the training information until the convergence state of the federated model is converged, so as to obtain the trained federated model, and send the trained federated model to the local servers of the participating nodes.

[0195] Optionally, after sending the first effect score and model index after the target disturbance to the federal server so that the federal server generates a trained federal model based on the first effect score and model index after the target disturbance, the local server can also detect whether the federal server has generated the trained federal model. For example, when it is detected that the federal server has generated the trained federal model, the local server receives the trained federal model returned by the federal server; when it is detected that the federal server has not generated the trained federal model, the local server receives the training information returned by the federal server, and based on the training information, returns to execute the step of training the local model until the federal server generates the trained federal model, and then receives the trained federal model returned by the federal server.

[0196] Optionally, after training the local model, the local server can also detect the federal server in the current federated learning scenario. When the federal server is detected, the first model information of the first local federated model after training can be sent to the federal server. When the federal server is not detected, it can be said that there is no federal server in the current federated learning scenario. At this time, it can also be determined that there are two participants in the current federated learning. Taking the local model of the current participant as the first local model as an example, the local model of the other participant can be the second local model. The two participants can communicate directly without going through the federal server. At this time, the first local server can send the trained first local model to the second local server of the participating node of the participant in the current federated learning. For example, when the server is not detected, the first local server obtains the node address of the participating node participating in the current federated learning, and based on the node address, sends the first model information of the first local model after training to the second local server of the participating node, so that the second local server of the participating node generates a trained federated model based on the first model information.

[0197] It should be noted that in the current federated learning scenario without a server, the participants can act as participants or as servers in the federated learning, which means that the first model of the trained first local model can be sent to the second local server of the participating node, and the second model of the trained second local model sent by the second local server of the participating node can also be received. When receiving the second model information of the trained second local model sent by the second local model of the participating node, the first local model aggregates the trained first local model and the trained second local model based on the second model information to obtain the second federated model, verifies the second federated model to obtain the second effect score, and perturbs the second effect score to obtain the perturbed second effect score. Based on the perturbed second effect score, the preset perturbed second effect score set is updated, and the target perturbed second effect score is screened out from the updated perturbed second effect score set, and the target perturbed second effect score is sent to the participating node. When the perturbed third effect score sent by the participating node is received, the target perturbed second effect score and the perturbed third effect score are fused to obtain the fused perturbed effect score.

[0198] The first local server obtains the historical fused perturbation effect scores of the historical federated models aggregated locally, calculates the effect score increments of the fused perturbation effect scores and the historical fused perturbation effect scores, and determines the convergence state of the federated model of the current federated learning based on the effect score increments. When the convergence state of the federated model is converged, the first candidate federated model corresponding to the second effect score after the target perturbation and the second candidate federated model corresponding to the third effect score after the perturbation are obtained, and the trained federated model is selected from the first candidate federated model and the second candidate federated model. Alternatively, the second candidate federated model and the second federated model may be fused to obtain the trained federated model, and so on. When the convergence state of the federated model is not converged, the step of training the local model is returned until the convergence state of the federated model is converged to obtain the trained federated model.

[0199] As can be seen from the above, in this embodiment, the local server trains the local model and sends the first model information of the trained first local model to the federal server, so that after the federal server aggregates at least one trained first local model based on the first model information, it receives the aggregated first federal model returned by the federal server, verifies the first federal model, obtains the first effect score of the first federal model, and then performs perturbation processing on the first effect score, and updates the preset perturbation first effect score set based on the perturbation first effect score, and selects the target perturbation first effect score from the updated perturbation first effect score set. The first effect score is obtained by calculating the training result, and the model index of the target federated model corresponding to the first effect score after the target perturbation is constructed. Then, the first effect score after the target perturbation and the model index are sent to the federated server, so that the federated server generates a trained federated model based on the first effect score after the target perturbation and the model index. Since the scheme adopts the differential privacy mechanism to perturb the first effect score, the information exchange between the participants and the server is in the form of plain text, without the use of any cryptographic method, and without the problem of ciphertext expansion, the communication overhead is very small, and the requirements for network bandwidth and delay are very low. Therefore, the training efficiency of federated learning can be improved.

[0200] In order to better implement the above method, the embodiment of the present invention further provides a federated learning device (i.e., a first federated learning device), which can be integrated in a terminal or a server, and the terminal can include a smart phone, a tablet computer, a laptop computer and / or a personal computer, etc. The server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0201] For example, Fig. 9 As shown, the first federated learning device may include a training unit 401, a verification unit 402, a perturbation unit 403, a screening unit 404 and a sending unit 405, as follows:

[0202] (1) training unit 401;

[0203] The training unit 401 is used to train the local model and send the first model information of the trained first local model to the server, so that the server aggregates at least one trained first local model based on the first model information.

[0204] For example, the training unit 401 can be specifically used to perform differential privacy processing during the training process of the local model, or it can also perform differential privacy processing after the local model is trained, so as to obtain a trained first local model that meets the differential privacy requirements. When the trained first local model is a model obtained after differential privacy processing during the training process of the local model, the current gradient or model parameter can be extracted from the trained first local model as the first model information, and the first model information is sent to the server so that the server aggregates at least one trained first local model based on the first model information. When the trained first local model is a model after differential privacy processing is performed after the local model is trained, the first model of the trained first local model is sent to the server so that the server aggregates at least one trained local model based on the first model information.

[0205] (2) verification unit 402;

[0206] The verification unit 402 is used to receive the aggregated first federation model returned by the server, and verify the first federation model to obtain first verification information of the first federation model.

[0207] For example, the verification unit 402 may be specifically configured to receive the first federated model returned by the server, or may also receive the federated model information of the first federated model returned by the server, and generate the first federated model based on the federated model information. The test sample data is obtained, and the first federated model is tested based on the test sample data to obtain the test information of the first federated model, and the test information is evaluated to obtain the verification information of the first federated model.

[0208] (3) disturbance unit 403;

[0209] The disturbance unit 403 is configured to perform disturbance processing on the first verification information, and update a preset disturbed first verification information set based on the disturbed first verification information.

[0210] For example, the perturbation unit 403 can specifically determine the noise distribution parameters of the noise information according to the preset differential privacy budget, generate a noise information set that obeys the noise distribution parameters based on the noise distribution parameters, randomly select the noise information from the noise information set, and obtain the random noise information of the first verification information. Add the random noise information to the first verification information to obtain the first verification information after perturbation. According to the preset differential privacy budget, determine the noise distribution parameters of the noise information, generate a noise information set that obeys the noise distribution parameters based on the noise distribution parameters, randomly select the noise information from the noise information set, and obtain the random noise information of the first verification information.

[0211] (4) screening unit 404;

[0212] The screening unit 404 is used to screen out the target post-disturbance first verification information from the updated post-disturbance first verification information set, and construct a model index of the target federated model corresponding to the target post-disturbance first verification information.

[0213] For example, the screening unit 404 can be specifically used to screen out the first verification information after disturbance with the largest effect score in the updated first verification information after disturbance set to obtain the target first verification information after disturbance, or the first verification information after disturbance in the updated first verification information after disturbance set can be sorted, and at least one candidate first verification information after disturbance is screened out from the updated first verification information after disturbance set based on the sorting result, and the first verification information after disturbance with the largest effect score or the largest effect score is screened out from the candidate first verification information after disturbance as the target first verification information after disturbance. The first verification information after disturbance with the largest effect score is screened out from the updated first verification information after disturbance set to obtain the target first verification information after disturbance, or the first verification information after disturbance in the updated first verification information after disturbance set can be sorted, and at least one candidate first verification information after disturbance is screened out from the updated first verification information after disturbance set based on the sorting result, and the first verification information after disturbance with the largest effect score or the largest effect score is screened out from the candidate first verification information after disturbance as the target first verification information after disturbance.

[0214] (5) a sending unit 405;

[0215] The sending unit 405 is used to send the first verification information after the target disturbance and the model index to the server, so that the server generates a trained federated model based on the first verification information after the target disturbance and the model index.

[0216] For example, the sending unit 405 can be specifically used to send the first verification information and the model index after the target disturbance to the server, so that the server generates a trained federated model based on the first verification information after the target disturbance and the model index. Alternatively, a verification information request can be sent to the server, and the verification information request carries the storage address of the first verification information after the target disturbance and the model index, so that the server can obtain the first verification information after the target disturbance and the model index based on the storage address, and then the server can generate a trained federated model based on the first verification information after the target disturbance and the model index.

[0217] Optionally, in some embodiments, the first federated learning device may further include a first detection unit 406, such as Fig.10 As shown, the specific details can be as follows:

[0218] The first detection unit 406 is used to detect a server in the current federated learning, and when no server is detected, generate a trained federated model.

[0219] For example, the first detection unit 406 can be specifically used to obtain the node address of the participating node participating in the current federated learning when the server is not detected, and send the first model information of the trained first local model to the participating node based on the node address, so that the participating node generates a trained federated model based on the first model information. When the second model information of the trained second local model sent by the participating node is received, the trained first local model and the trained second local model are aggregated based on the second model information to obtain the second federated model, the second federated model is verified to obtain the second verification information, and the second verification information is perturbed to obtain the perturbed second verification information, and the preset perturbed second verification information set is updated based on the perturbed second verification information, and the trained federated model is generated based on the updated perturbed second verification information.

[0220] Optionally, in some embodiments, the first federated learning device may further include a second detection unit 407, such as Fig.11 As shown, the specific details can be as follows:

[0221] The second detection unit 407 is used to detect the trained federated model generated by the server to receive the trained federated model.

[0222] For example, the second detection unit 407 can be specifically used to receive the trained federated model returned by the server when it is detected that the server has generated a trained federated model, and to receive the training information returned by the server when it is detected that the server has not generated the trained federated model, and based on the training information, return to execute the step of training the local model until the server generates a trained federated model, and then receive the trained federated model returned by the server.

[0223] As can be seen from the above, in this embodiment, the training unit 401 trains the local model and sends the first model information of the trained first local model to the server, so that after the server aggregates at least one trained first local model based on the first model information, the verification unit 402 receives the first federated model returned by the server after aggregation, and verifies the first federated model to obtain the first verification information of the first federated model. Then, the perturbation unit 403 performs perturbation processing on the first verification information, and updates the preset perturbed first verification information set based on the perturbed first verification information. The screening unit 404 screens out the target model from the updated perturbed first verification information set. The first verification information after the target disturbance is obtained, and the model index of the target federated model corresponding to the first verification information after the target disturbance is constructed. Then, the sending unit 405 sends the first verification information after the target disturbance and the model index to the server, so that the server generates a trained federated model based on the first verification information after the target disturbance and the model index. Since the scheme adopts a differential privacy mechanism to perturb the first verification information, the participants and the server exchange information in plain text without using any cryptographic methods, and the problem of ciphertext expansion will not occur, which makes the communication overhead very small, and has low requirements on network bandwidth and delay. Therefore, the training efficiency of federated learning can be improved.

[0224] In order to better implement the above method, an embodiment of the present invention further provides a federated learning device (ie, a second federated learning device). The second federated learning device can be integrated in a server. The server can be a single server or a server cluster composed of multiple servers.

[0225] For example, Fig.12 As shown, the second federated learning device may include a first receiving unit 501, an aggregation unit 502, a second receiving unit 503, a determination unit 504, and a generation unit 505, as follows:

[0226] (1) a first receiving unit 501;

[0227] The first receiving unit 501 is used to receive first model information of a trained first local model sent by at least one participating node participating in the current federated learning.

[0228] For example, the first receiving unit 501 can be specifically used to receive the first model information of the first local model after training sent by the participating nodes participating in the current federated learning, or, it can also receive the model aggregation request sent by the participating nodes participating in the current federated learning, and the model aggregation request carries the storage address of the first model of the first local model after training, and based on the storage address, obtain the first model information of the first local model after training.

[0229] (2) polymerizing unit 502;

[0230] The aggregation unit 502 is used to aggregate the trained first local model based on the first model information to obtain a first federal model.

[0231] For example, the aggregation unit 502 can be specifically used to construct a trained first local model based on the first model information, and aggregate the trained first local models of the participants by means of federal averaging to obtain a first federal model. Alternatively, the trained first local models of the participating nodes can be integrated and fused by means of ensemble learning to obtain a first federal model.

[0232] (3) a second receiving unit 503;

[0233] The second receiving unit 503 is used to send the first federated model to the participating nodes respectively, and receive the first verification information after the target disturbance and the model index returned by the participating nodes.

[0234] For example, the second receiving unit 503 can be specifically used to send the first federated model to the participating nodes respectively, receive the first verification information after the target disturbance and the model index sent by the participating nodes, or, can also receive a model generation request, which carries the storage address of the first verification information after the target disturbance and the model index, and can obtain the first verification information after the target disturbance and the model index based on the storage address.

[0235] (4) determining unit 504;

[0236] The determination unit 504 is used to determine the convergence state of the federated model in the current federated learning according to the first verification information after the target disturbance.

[0237] For example, determination unit 504 can be specifically used to fuse the first verification information after the target disturbance, obtain the current fusion verification information corresponding to the first federated model, obtain the historical fusion verification information corresponding to the historical federated model, and calculate the information increment between the current fusion verification information and the historical fusion verification information, and determine the convergence state of the federated model in the current federated learning based on the information increment.

[0238] (5) generating unit 505;

[0239] The generating unit 505 is used to generate a trained federated model based on the federated model convergence state and the model index.

[0240] For example, the generation unit 505 can be specifically used to generate a trained federated model based on the model index when the convergence state of the federated model is converged, and send the trained federated model to the participating nodes. When the convergence state of the federated model is not converged, the training information is sent to the participating nodes so that the participating nodes return to the step of training the local model based on the training information until the convergence state of the federated model is converged, so as to obtain the trained federated model and send the trained federated model to the participating nodes.

[0241] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.

[0242] From the above, it can be seen that in this embodiment, after the first receiving unit 501 receives the first model information of the trained first local model sent by at least one participating node participating in the current federated learning, the aggregation unit 502 aggregates the trained first local model based on the first model information to obtain the first federated model, and then the second receiving unit 503 sends the first federated model to the participating nodes respectively, and receives the first verification information after the target disturbance and the model index returned by the participating nodes, and then the determination unit 504 determines the convergence state of the federated model in the current federated learning according to the first verification information after the target disturbance, and the generation unit 505 generates the trained federated model based on the federated model convergence state and the model index; because the scheme exchanges information between the server and the participating method in plain text, there is no need to use any cryptographic method, and the problem of ciphertext expansion will not occur, so that the communication overhead is very small, and the requirements for network bandwidth and delay are very low, therefore, the training efficiency of federated learning can be improved.

[0243] The embodiment of the present invention further provides an electronic device, such as Fig.13 As shown, it shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present invention, specifically:

[0244] The electronic device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will appreciate that Fig.13 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0245] The processor 601 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 602, and calling data stored in the memory 602, the processor 601 performs various functions of the electronic device and processes data. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601.

[0246] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 602 may include a high-speed random access memory, and may 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. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.

[0247] The electronic device also includes a power supply 603 for supplying power to each component. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 603 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0248] The electronic device may further include an input unit 604, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0249] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 601 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 601 will run the application programs stored in the memory 602, thereby realizing various functions, as follows:

[0250] Train the local model, and send the first model information of the trained first local model to the server, so that the server aggregates at least one trained first local model based on the first model information, receives the aggregated first federated model returned by the server, verifies the first federated model, obtains the first verification information of the first federated model, performs perturbation processing on the first verification information, and updates the preset perturbation first verification information set based on the perturbation first verification information, selects the target perturbation first verification information from the updated perturbation first verification information set, and constructs the model index of the target federated model corresponding to the target perturbation first verification information, and sends the target perturbation first verification information and the model index to the server, so that the server generates the trained federated model based on the target perturbation first verification information and the model index. When the server is not detected, obtain the node address of the participating node participating in the current federated learning, and send the first model information of the trained first local model to the participating node based on the node address, so that the participating node generates the trained federated model based on the first model information. When the second model information of the trained second local model sent by the participating node is received, based on the second model information, the trained first local model and the trained second local model are aggregated to obtain the second federal model, the second federal model is verified to obtain the second verification information, and the second verification information is disturbed to obtain the disturbed second verification information, the preset disturbed second verification information set is updated based on the disturbed second verification information, and the trained federal model is generated based on the updated disturbed second verification information.

[0251] or

[0252] After receiving the first model information of the trained first local model sent by at least one participating node participating in the current federated learning, the trained first local model is aggregated based on the first model information to obtain the first federated model, and then the first federated model is sent to the participating nodes respectively, and the first verification information after the target disturbance and the model index returned by the participating nodes are received, and then, according to the first verification information after the target disturbance, the convergence state of the federated model in the current federated learning is determined, and based on the federated model convergence state and the model index, the trained federated model is generated.

[0253] The specific implementation of the above operations can be found in the previous embodiments and will not be described in detail here.

[0254] From the above, it can be seen that in the embodiment of the present application, after training the local model and sending the first model information of the trained first local model to the server, so that the server aggregates at least one trained first local model based on the first model information, receives the aggregated first federated model returned by the server, and verifies the first federated model to obtain the first verification information of the first federated model, then perturbs the first verification information, and updates the preset perturbed first verification information set based on the perturbed first verification information, and filters out the target perturbed first verification information from the updated perturbed first verification information set. , and construct the model index of the target federated model corresponding to the first verification information after the target perturbation, and then send the first verification information after the target perturbation and the model index to the server, so that the server generates a trained federated model based on the first verification information after the target perturbation and the model index; since the scheme adopts the differential privacy mechanism to perturb the first verification information, the participants and the server exchange information in plain text, without the use of any cryptographic methods, and will not cause the problem of ciphertext expansion, making the communication overhead very small, and the requirements for network bandwidth and delay are very low, therefore, the training efficiency of federated learning can be improved.

[0255] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0256] To this end, an embodiment of the present invention provides a computer-readable storage medium, which stores a plurality of instructions, which can be loaded by a processor to execute the steps in any one of the federated learning methods provided in the embodiment of the present invention. For example, the instructions can execute the following steps:

[0257] Train the local model, and send the first model information of the trained first local model to the server, so that the server aggregates at least one trained first local model based on the first model information, receives the aggregated first federated model returned by the server, verifies the first federated model, obtains the first verification information of the first federated model, performs perturbation processing on the first verification information, and updates the preset perturbation first verification information set based on the perturbation first verification information, selects the target perturbation first verification information from the updated perturbation first verification information set, and constructs the model index of the target federated model corresponding to the target perturbation first verification information, and sends the target perturbation first verification information and the model index to the server, so that the server generates the trained federated model based on the target perturbation first verification information and the model index. When the server is not detected, obtain the node address of the participating node participating in the current federated learning, and send the first model information of the trained first local model to the participating node based on the node address, so that the participating node generates the trained federated model based on the first model information. When the second model information of the trained second local model sent by the participating node is received, based on the second model information, the trained first local model and the trained second local model are aggregated to obtain the second federal model, the second federal model is verified to obtain the second verification information, and the second verification information is disturbed to obtain the disturbed second verification information, the preset disturbed second verification information set is updated based on the disturbed second verification information, and the trained federal model is generated based on the updated disturbed second verification information.

[0258] or

[0259] After receiving the first model information of the trained first local model sent by at least one participating node participating in the current federated learning, the trained first local model is aggregated based on the first model information to obtain the first federated model, and then the first federated model is sent to the participating nodes respectively, and the first verification information after the target disturbance and the model index returned by the participating nodes are received, and then, according to the first verification information after the target disturbance, the convergence state of the federated model in the current federated learning is determined, and based on the federated model convergence state and the model index, the trained federated model is generated.

[0260] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0261] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0262] Since the instructions stored in the computer-readable storage medium can execute the steps in any one of the federated learning segmentation methods provided in the embodiments of the present invention, the beneficial effects that can be achieved by any one of the federated learning methods provided in the embodiments of the present invention can be achieved. For details, please refer to the previous embodiments and will not be repeated here.

[0263] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations of the above-mentioned federated learning or federated model training.

[0264] The above is a detailed introduction to a federated learning method, device, electronic device and computer-readable storage medium provided in an embodiment of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A federated learning method, characterized in that: Applied to computer vision, speech processing or natural language processing, the method comprises: Training the local model, and sending first model information of the trained first local model to the server, so that the server aggregates at least one trained first local model based on the first model information; receiving the aggregated first federated model returned by the server, and verifying the first federated model to obtain first verification information of the first federated model, where the first verification information is an effect score for verifying that the first federated model correctly identifies or classifies the verification sample data; According to a preset differential privacy budget, obtaining random noise information of the first verification information; Adding the random noise information to the first verification information to obtain the disturbed first verification information, and updating the preset disturbed first verification information set based on the disturbed first verification information; Selecting the first verification information after disturbance with the largest effect score from the updated first verification information after disturbance as the target first verification information after disturbance, and constructing a model index of the target federated model corresponding to the target first verification information after disturbance; The first verification information after the target perturbation and the model index are sent to the server, so that the server generates a trained federated model based on the first verification information after the target perturbation and the model index.

2. The federated learning method according to claim 1, characterized in that: The obtaining, according to the preset differential privacy budget, random noise information of the first verification information includes: Determine the noise distribution parameters of the noise information according to the preset differential privacy budget; Based on the noise distribution parameters, generating a noise information set that obeys the distribution of the noise distribution parameters; Noise information is randomly selected from the noise information set to obtain random noise information of the first verification information.

3. The federated learning method according to any one of claims 1 to 2, characterized in that: The training of the local model includes: Acquire local training sample data, and calculate the gradient of the local model through the local training sample data; Performing differential privacy processing on the gradient, and converging the local model based on the processed gradient to obtain a first local model after training; The sending of the first model information of the trained first local model to the server so that the server aggregates at least one trained first local model based on the first model information includes: extracting the current gradient or model parameter from the trained first local model as the first model information, and sending the first model information to the server so that the server aggregates at least one trained first local model based on the first model information.

4. The federated learning method according to claim 2, characterized in that: The training of the local model includes: Acquire local training sample data, and train the local model using the local training sample data to obtain a first local model after initial training; Extracting initial gradients or initial model parameters from the first local model after the initial training to obtain initial model information; The initial model information is differentially privacy processed to obtain first model information of a trained first local model.

5. The federated learning method according to claim 1, characterized in that: After the local model is trained, the following steps are also included: When no server is detected, obtain the node addresses of the participating nodes participating in the current federated learning; Based on the node address, the first model information of the trained first local model is sent to the participating node, so that the participating node generates a trained federated model based on the first model information.

6. The federated learning method according to claim 5, characterized in that: Also includes: When receiving the second model information of the trained second local model sent by the participating node, aggregating the trained first local model and the trained second local model based on the second model information to obtain a second federated model; Verifying the second federated model to obtain second verification information, and performing disturbance processing on the second verification information to obtain disturbed second verification information; A preset post-disturbance second verification information set is updated based on the post-disturbance second verification information, and a trained federated model is generated based on the updated post-disturbance second verification information set.

7. The federated learning method according to claim 6, characterized in that: The generating a trained federated model based on the updated perturbed second verification information set includes: Filtering out target post-disturbance second verification information from the updated post-disturbance second verification information set, and sending the target post-disturbance second verification information to the participating nodes; When receiving the third verification information after disturbance sent by the participating node, fusing the second verification information after disturbance of the target and the third verification information after disturbance to obtain fused verification information after disturbance; Based on the fused perturbation verification information, the target perturbation second verification information and the perturbation third verification information, a trained federated model is generated.

8. The federated learning method according to any one of claims 1 to 2, characterized in that: After sending the first verification information after the target disturbance and the model index to the server so that the server generates a trained federated model based on the first verification information after the target disturbance and the model index, the method further includes: When detecting that the server generates a trained federated model, receiving the trained federated model returned by the server; When it is detected that the server has not generated the trained federated model, the training information returned by the server is received, and based on the training information, the step of training the local model is returned to be executed until the server generates the trained federated model, and the trained federated model returned by the server is received.

9. A federated learning method, characterized in that: Applied to computer vision, speech processing or natural language processing, the method comprises: Receiving first model information of a trained first local model sent by at least one participating node participating in the current federated learning; Aggregating the trained first local model based on the first model information to obtain a first federated model; The first federated model is sent to the participating nodes respectively, and the target first verification information after perturbation and the model index returned by the participating nodes are received, the target first verification information after perturbation verifies the first federated model through the participating nodes to obtain the first verification information, and the first verification information is perturbed according to the preset differential privacy budget, and the preset perturbation verification information set is updated based on the first verification information after perturbation, and the first verification information after perturbation with the largest effect score is screened out from the updated first verification information after perturbation set, wherein the first verification information is the effect score for verifying that the first federated model correctly identifies or classifies the verification sample data; The first verification information after the target disturbance is fused to obtain current fused verification information corresponding to the first federated model, the historical fused verification information corresponding to the historical federated model is obtained, and the information increment between the current fused verification information and the historical fused verification information is calculated, and based on the information increment, the convergence state of the federated model in the current federated learning is determined; Based on the federated model convergence state and the model index, a trained federated model is generated.

10. The federated learning method according to claim 9, characterized in that: The generating a trained federated model based on the federated model convergence state and the model index includes: When the convergence state of the federated model is converged, generating a trained federated model based on the model index, and sending the trained federated model to the participating nodes; When the convergence state of the federated model is not converged, training information is sent to the participating nodes so that the participating nodes return to execute the steps of training the local model based on the training information until the convergence state of the federated model is converged, so as to obtain a trained federated model, and send the trained federated model to the participating nodes.

11. A federated learning device, characterized in that: Applied to computer vision, speech processing or natural language processing, the device comprises: A training unit, configured to train a local model and send first model information of a trained first local model to a server, so that the server aggregates at least one trained first local model based on the first model information; a verification unit, configured to receive the aggregated first federated model returned by the server, and verify the first federated model to obtain first verification information of the first federated model, wherein the first verification information is an effect score for verifying that the first federated model correctly identifies or classifies the verification sample data; A perturbation unit, configured to obtain random noise information of the first verification information according to a preset differential privacy budget; add the random noise information to the first verification information to obtain perturbed first verification information, and update a preset perturbed first verification information set based on the perturbed first verification information; A screening unit, configured to screen out the first verification information after disturbance with the largest effect score from the updated first verification information after disturbance as the target first verification information after disturbance, and construct a model index of the target federated model corresponding to the target first verification information after disturbance; A sending unit is used to send the first verification information after the target disturbance and the model index to the server, so that the server generates a trained federated model based on the first verification information after the target disturbance and the model index.

12. A federated learning device, characterized in that: Applied to computer vision, speech processing or natural language processing, the device comprises: A first receiving unit, configured to receive first model information of a trained first local model sent by at least one participating node participating in the current federated learning; an aggregation unit, configured to aggregate the trained first local model based on the first model information to obtain a first federated model; A second receiving unit is used to send the first federated model to the participating nodes respectively, and receive the target first verification information after perturbation and the model index returned by the participating nodes, the target first verification information after perturbation verifies the first federated model through the participating nodes to obtain the first verification information, and according to the preset differential privacy budget, the first verification information is perturbed, and the preset perturbation verification information set is updated based on the first verification information after perturbation, and the first verification information after perturbation with the largest effect score is screened out from the updated first verification information after perturbation set, wherein the first verification information is the effect score for verifying that the first federated model correctly identifies or classifies the verification sample data; A determination unit, configured to fuse the first verification information after the target disturbance to obtain current fusion verification information corresponding to the first federated model, obtain historical fusion verification information corresponding to the historical federated model, and calculate an information increment between the current fusion verification information and the historical fusion verification information, and determine a convergence state of the federated model in the current federated learning based on the information increment; A generating unit is used to generate a trained federated model based on the federated model convergence state and the model index.

13. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores an application program, and the processor is used to run the application program in the memory to execute the steps in the federated learning method according to any one of claims 1 to 10.

14. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the federated learning method described in any one of claims 1 to 10 are implemented.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, which are suitable for being loaded by a processor to execute the steps in the federated learning method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Privacy protection method and system in model training process and related equipment

    CN112052480A

  • Federal learning-based model construction method and device, and storage medium

    CN112785144A

  • Federal learning data privacy protection method and system based on gradient disturbance

    CN113094758A

  • Medical data sharing privacy protection method based on block chain by utilizing federated learning

    CN113536382A

  • Federal learning global model training method based on differential privacy and quantification

    CN113591145A