Federal learning method and system based on double-end security protection

Through the dual-ended security protection method, the client data and models in federated learning are filtered by using data filters and model filters, solving the problem of security risks in federated learning and improving the robustness and credibility of the system.

CN119067235AActive Publication Date: 2024-12-03BEIJING JIAOTONG UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411159278.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-03
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

In federated learning, security risks are caused by the "available but invisible" nature of data, especially unreliable clients may carry out data poisoning attacks on training data, affecting model training quality and data privacy protection.

Method used

Using the dual-ended security protection method, the client's local data and models are filtered through data filters and model filters, and the abnormality degree is measured by feature extraction, probability distribution fitting and KL divergence metric, the degree of trustworthiness is calculated and the aggregate weight is adjusted. , ensure the security of data and models.

Benefits of technology

Without violating the principle of federal learning privacy protection, comprehensive protection of data and models is achieved, improving the robustness and credibility of federated learning systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119067235A_ABST
    Figure CN119067235A_ABST
Patent Text Reader

Abstract

The invention provides a federated learning method and system based on double-end security protection, and belongs to the technical field of federated learning, local data of each client needs to be screened by a data filter and then input into a main task for local training, and a screening result is saved to generate local data description; each client uploads the local model and the local data description to a server together; and when the server stores enough client historical model information, the model filter is operated, the local model quality is examined by using the local model set processed by each client and local data description, and the subsequent server guides the federal training and aggregation process according to the local model quality examination result of the client. According to the method, off-line automatic examination is performed on the local data set at the client, the collected local model is examined at the server, the data and model security is comprehensively protected on the premise of not violating the federated learning privacy protection principle, and the robustness and credibility of federated learning are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of federated learning, and in particular to a federated learning method and system based on double-end security protection. Background Art

[0002] Federated learning is a promising distributed machine learning paradigm that can be used to collaboratively train deep learning models on a server based on multiple client-owned distributed datasets. Compared with traditional distributed learning methods, federated learning has the following advantages: a) it can utilize private data and computing resources on massive devices that were previously inaccessible; b) the client's private dataset will not be shared or uploaded, thus protecting data privacy and saving communication bandwidth; c) it can crowdsource potentially unlimited device resources. Therefore, federated learning is expected to become the main foundation of ubiquitous intelligent connectivity.

[0003] However, the "available but invisible" nature of training data in federated learning leads to security risks. Federated learning tasks usually rely on the support of a large number of clients, and some unreliable clients, especially those from crowdsourcing, may be manipulated or hijacked by some attackers before federated training, facing data poisoning attacks on training data. What is more challenging is that due to the principle of data privacy protection, the server cannot directly review the private data sets of each client, and the quality of training data will determine the quality of model training. Therefore, the security of local data that is "invisible" to the server and the local models trained from it cannot be guaranteed, which will have an adverse impact on the main task of federated learning.

[0004] As a distributed machine learning paradigm, it is necessary to ensure the security and robustness of federated learning. Malicious attacks on local training data and training processes will indirectly damage the global quality of the main task of federated learning. However, federated learning itself does not provide a corresponding security protection mechanism. Summary of the invention

[0005] The purpose of the present invention is to provide a federated learning method and system based on double-end security protection to solve at least one technical problem existing in the above-mentioned background technology.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] In a first aspect, the present invention provides a federated learning method based on double-end security protection, comprising:

[0008] Obtain the local model and local data description of each client after training; wherein, use a data filter to filter the local data of each client and use the data detected as normal as the training data of the local model;

[0009] The server extracts features from the acquired local model, saves the client's historical information, and obtains a local historical model information set corresponding to each client;

[0010] The model filter based on probability distribution is used to measure the difference of local models of each client, calculate the difference between the model distributions of each client, and calculate the abnormality degree of the local model corresponding to each client according to the degree of difference between the model distributions of each client;

[0011] According to the local data description and the abnormality degree of the local model corresponding to each client, the credibility of each client is obtained, and the aggregation weight of each local model during federation aggregation is obtained according to the credibility.

[0012] Furthermore, the server uses a classification autoencoder for dual data and label screening to train the data filter, and the training data comes from the server's main task test dataset; the classification autoencoder uses the potential representation z to additionally train an auxiliary classifier, using RE cae represents the reconstruction error, L cae represents the loss of the auxiliary classifier on the representation layer z;

[0013] Minimize the training dataset The combined loss on is:

[0014]

[0015] On the client side, given a local data stream, for each data sample, the classification autoencoder uses the combined loss of reconstruction error and classification error as the detection criterion for abnormal data, while detecting deviations in feature space and label space.

[0016] Furthermore, a model filter based on probability distribution is used to fit the historical model information set of each client into a specific probability distribution in the server to obtain the local model distribution of each client. The local data description of each client uploaded by the data filter is combined to calculate the difference between the model distributions of each client using a probability distribution-based method. The degree of abnormality of the local model corresponding to each client is calculated based on the degree of difference.

[0017] Furthermore, the server maintains a historical model set for each client, and after each round of federated aggregation, the local model is feature extracted and stored in the corresponding client model set; after a certain number of training rounds, the model filter fits the feature distribution in each client's historical model set to a specific probability distribution; the model filter sets the benchmark client in combination with the information in the local data description of each client uploaded by the data filter, and uses a probability distribution-based method to measure the model distribution difference between the benchmark client and other clients; the model filter guides the selection of local models for subsequent federated aggregation based on the degree of model distribution difference and the corresponding local data description, giving priority to aggregating client local models with low differences from the benchmark, and appropriately ignoring client local models with high differences from the benchmark.

[0018] Furthermore, the model filter fits the feature information in the historical model information set of each client into a Gaussian distribution using maximum likelihood estimation, and uses KL divergence to measure the difference between the distributions of each client model set.

[0019] Furthermore, feature extraction is performed on the local model, including: θ t,i represents the original high-dimensional local model uploaded by client number i in the tth training round, Represents the low-dimensional model after dimensionality reduction and feature extraction of the original high-dimensional local model uploaded by client number i in the tth training round

[0020] In a second aspect, the present invention provides a federated learning system based on double-end security protection, comprising:

[0021] The acquisition module is used to obtain the local model and local data description completed by the client; wherein, the local data is filtered by the data filter and the data detected as normal is used as the training data of the local model:

[0022] The extraction module is used to extract features from the acquired local model, save the client history information, and obtain the local history model information set corresponding to each client;

[0023] A screening module is used to measure the local model differences of each client using a model filter based on probability distribution, calculate the differences between the model distributions of each client, and calculate the degree of abnormality of the local model corresponding to each client according to the degree of difference between the model distributions of each client;

[0024] The calculation module is used to obtain the credibility of each client according to the local data description and the abnormality of the local model corresponding to each client, and obtain the aggregation weight of each local model during federation aggregation according to the credibility.

[0025] In a third aspect, the present invention provides a non-transitory computer-readable storage medium, which is used to store computer instructions. When the computer instructions are executed by a processor, the federated learning two-end security protection method as described in the first aspect is implemented.

[0026] In a fourth aspect, the present invention provides a computer device comprising a memory and a processor, wherein the processor and the memory communicate with each other, the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the federated learning two-end security protection method as described in the first aspect.

[0027] In a fifth aspect, the present invention provides an electronic device, comprising: a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory so that the electronic device executes instructions for implementing the federated learning two-end security protection method as described in the first aspect.

[0028] The beneficial effects of the present invention are as follows: the local data set is automatically reviewed offline on the client side, and the collected local model is reviewed on the server side. Without violating the privacy protection principle of federated learning, the data and model security can be fully protected, thereby improving the robustness and credibility of the federated learning system.

[0029] Additional advantages of the present invention will be more clearly given in the following description or learned through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0031] Figure 1 The figure is a flow chart of the federated learning dual-end security protection architecture described in an embodiment of the present invention.

[0032] Figure 2 A schematic diagram of a data filter in a federated learning dual-end security protection architecture according to an embodiment of the present invention.

[0033] Figure 3 A schematic diagram of a classification autoencoder network used by a data filter in a federated learning dual-end security protection architecture according to an embodiment of the present invention.

[0034] Figure 4A schematic diagram of a model filter in a federated learning dual-end security protection architecture according to an embodiment of the present invention.

[0035] Figure 5 This is a comparison chart of normal models and abnormal models from the perspective of the model filter in the federated learning dual-end security protection architecture described in the embodiment of the invention.

[0036] Figure 6 This is a schematic diagram of the structure of the federated learning dual-end security protection system described in an embodiment of the present invention.

[0037] Figure 7 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0038] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The embodiments described below by the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.

[0039] It should be understood by those skilled in the art that unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art to which this invention belongs.

[0040] It should also be understood that terms, such as those defined in commonly used dictionaries, should be understood to have a meaning consistent with that in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless as defined herein.

[0041] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements and / or groups thereof.

[0042] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. Different embodiments or examples described in this specification and features of different embodiments or examples may be combined and combined by those skilled in the art without contradiction.

[0043] To facilitate understanding of the present invention, the present invention is further explained below with reference to specific embodiments in conjunction with the accompanying drawings, and the specific embodiments do not constitute a limitation on the embodiments of the present invention.

[0044] Those skilled in the art should understand that the drawings are merely schematic diagrams of embodiments, and the components in the drawings are not necessarily necessary for implementing the present invention.

[0045] Example 1

[0046] In this embodiment 1, a federated learning system based on dual-end security protection is first provided, including: an acquisition module, used to obtain the local model and local data description of each client training; wherein, the local data is filtered by a data filter and the data detected as normal is used as the training data of the local model. An extraction module, used to extract features from the acquired local model, save the client historical information, and obtain the local historical model information set corresponding to each client. A screening module, used to measure the differences in the local models of each client using a model filter based on probability distribution, calculate the differences between the model distributions of each client, calculate the degree of abnormality of the local model corresponding to each client according to the degree of difference between the model distributions of each client, obtain the degree of credibility of each client according to the local data description and the degree of abnormality of the local model corresponding to each client, and obtain the aggregation weight of each local model during federation aggregation according to the degree of credibility.

[0047] In this embodiment, the above-mentioned system is used to implement a federated learning method based on dual-end security protection, including: obtaining a local model and a local data description completed by training for each client; wherein, a data filter is used to filter the local data and detect the normal data as the training data of the local model and generate a local data description. The server extracts features from the acquired local model, saves the client history information, and obtains a set of local history model information corresponding to each client. A model filter based on probability distribution is used to measure the differences in the local models of each client, calculate the differences between the model distributions of each client, and calculate the degree of abnormality of the local model corresponding to each client according to the degree of difference between the model distributions of each client. According to the local data description and the degree of abnormality of the local model corresponding to each client, the credibility of each client is obtained, and the aggregation weight of each local model during federation aggregation is obtained according to the credibility.

[0048] The federated learning method of the dual-end security protection architecture provided in this embodiment specifically includes the following steps:

[0049] First, the acquisition module deployed in the server obtains the local model and local data description obtained after the local training of each client is completed. The server processes and saves these local models and local data descriptions after federation aggregation.

[0050] In order to calculate the credibility of the client, a historical information set is maintained for each client, which includes: low-dimensional features after feature extraction of local models uploaded by each client in historical rounds; and local data descriptions of each client generated by the data filter.

[0051] The calculation of client credibility requires the received client local model information, but the high-dimensional local model parameters are huge and difficult to store and analyze. Therefore, an extraction module is deployed in the server to extract features from the local model.

[0052] When extracting features from a local model, the feature extraction method is used to reduce the local model to one dimension, that is, a single data point. By extracting features from the local model, the space required for model storage is minimized, the complexity of model analysis is also reduced, and information compression does not reduce the accuracy of the model reviewer.

[0053] Therefore, in the server, after T′ training rounds, for each client c i Each has a model information set. If the client c i If it is not selected by the federated aggregation in the tth training round, a "NULL" placeholder will be stored in the corresponding position of the model information set. In addition to the model information set, the server also stores a brief description of the model data set, that is, the data pair of abnormal data volume and local data volume.

[0054] A screening module is also configured in the server. When the server stores enough client historical model information, the module runs a model filter based on probability distribution, and uses the local model set and local data description processed by each client to review the quality of the local model. The server will subsequently guide the federated training and aggregation process based on the client local model quality review results.

[0055] Among them, the model filter analyzes and filters the historical information of each client, obtains the abnormality of each client and takes measures to reduce the abnormal clients, including: fitting the historical model features in each client information set to a Gaussian distribution using maximum likelihood estimation. At this point, the mean and variance of the Gaussian distribution fitted to each client model set are obtained through maximum likelihood estimation. After that, the model filter uses KL divergence to measure the difference between the distributions of each client model set. KL divergence, also called relative entropy, is an indicator of the degree of match between two probability distributions. The greater the difference between the two distributions, the greater the KL divergence. KL divergence is always greater than or equal to zero. When it is equal to zero, it means that the two distributions are consistent. KL divergence is asymmetric, and exchanging the order of the two distributions will produce different results.

[0056] The problem of measuring the differences between client model sets is transformed into measuring the differences between the probability distributions composed of the model sets. The model filter uses the asymmetric distribution measurement method KL divergence (KL divergence outputs different results when the distribution order is swapped), because the model filter needs to calculate the distribution difference between high-trust clients and other clients, that is, the client distribution is regarded as the benchmark distribution to measure the degree of difference between other client distributions and it.

[0057] High-trust clients are benchmark clients, which directly affect the screening accuracy of the model filter. The selection of benchmark clients can greatly reduce the computational complexity and number of calculations of the model reviewer. Specifically, high-trust clients are selected based on the client local data description saved by the model filter.

[0058] In this embodiment, before the start of federated training, the server uses the global test data set to train a data filter, and the trained data filter is fixed at the entrance of the federated learning main task and distributed to each client. Among them, the server uses the global test data set to train a data filter, which is a high-quality data set maintained by the server, which may be obtained through crowdsourcing, manual screening and other steps. It can be understood that the global test set is a standard data set used by the server to verify the effect of each round of the global model. The test data is extremely important for the main task training, and should contain important features that need to be learned by the main task and there is no noise data or labels. Among them, a data screening model based on an autoencoder network is established as the data entry for the main task of the federated learning client training.

[0059] In this embodiment, in order to improve the screening accuracy of the data filter to cope with a variety of low-quality data scenarios such as poisoned data, poisoned labels, noisy data, noisy labels, etc. A classification autoencoder CAE that can double-screen data and labels is used. After the training is completed, the server fixes the CAE at the main task data entrance and distributes it to each training client. On the client, given a local data stream, for each data sample, CAE uses the combined loss of reconstruction error and classification error as the detection standard for abnormal data, and detects the deviation of feature space and label space at the same time. After loss calculation, CAE can automatically and accurately identify abnormal data and abnormal labels in the local data set offline. During the federated training, the local data of each client must be filtered by the data filter and then input into the main task for local training, and the screening results are saved to generate a local data description. Among them, the client receives the federated learning main task with a data filter and uses the local data set for training, that is, the local data stream of the client must be filtered by the offline data filter and detected as normal data before entering the training process of the main task.

[0060] In this implementation, during the local training process, the client needs to input the local data into the main task with the data filter. During this period, the client does not need to worry about data privacy leakage, because the review of the data filter and the main task training process are completely offline, that is, this process is a black box process for the server. After all local data sets pass the data filter, the main task will use the reviewed clean data set for training and complete the subsequent federated training process. During this period, the data filter will save a brief description of this local data set, that is, the (abnormal data amount, local data total amount) data pair.

[0061] It should be understood that the above data screening and local training process of the main task are offline for the server. The server only accepts the trained local model and local data description, and does not involve specific data. In order to ensure the quality of the local training of the main task, all clients need to perform data review and local training process.

[0062] It should be noted that the above brief description of local data sets only involves the number of local data sets and abnormal data sets, and therefore does not violate the privacy protection principle of federated learning.

[0063] Example 2

[0064] like Figure 6As shown, in this embodiment 2, a federated learning dual-end security protection system is provided based on a federated learning dual-end security protection architecture, including: a data screening unit 10, which is used to learn real data features based on a global test data set on the server and screen local data offline on each client, prevent low-quality data from entering the local training stage according to the data filter, record the local data quality and upload it to the server. A model processing unit 20 is used to extract features from the client local model received by the server, so that the server can save the client historical information and the model filter can measure the client model differences, and obtain the local historical model information set corresponding to each client. A model screening unit 30 is used to fit the historical model information set of each client to a specific probability distribution on the server to obtain the local model distribution of each client, and use a probability distribution-based method to calculate the difference between the model distributions of each client in combination with the local data description of each client uploaded by the data filter, and calculate the degree of abnormality of the local model corresponding to each client according to the degree of difference. The exception handling unit 40 is used to summarize the credibility of each client based on the local data quality description of the data filter and the abnormal calculation results of the model filter on the server, and give the aggregation weight of the local model of each client during federation aggregation according to the credibility. Clients with too low credibility will be marked as abnormal clients and their subsequent local models will be ignored. Clients with high credibility will be used as subsequent benchmark clients to guide the regular operation of the model filter; the local model is a model trained by the client using a private data set.

[0065] In this embodiment, the described federated learning dual-end security protection architecture includes: before the start of federated training, the server uses the global test data set to train a data filter, and the trained data filter is fixed at the entrance of the federated learning main task and distributed to each client; during the federated training, the local data of each client must be filtered by the data filter and then input into the main task for local training, and the filtering results are saved to generate a local data description; after the local training is completed, each client uploads the local model and the local data description to the server, and the server processes these local models and local data descriptions after federation aggregation and saves them; when the server has enough client historical model information, it runs a model filter based on probability distribution, and uses the local model set and local data description processed by each client to review the quality of the local model. The server will subsequently guide the federated training and aggregation process based on the client local model quality review results.

[0066] Among them, security protection is performed on the data and model of the federated learning system on the client and server respectively; the server trains an offline data filter as the training entry for the main task of federated learning and distributes it to each client, ensuring the security of local data and local training process without infringing on the client data privacy; the server maintains a lightweight model filter based on probability distribution, and further reviews the received client local models to ensure the security and reliability of federated training and federated aggregation.

[0067] The server trains an offline data filter and uses it as the entry for the main task of federated learning, including: the data filter reuses the global test data set in the server for the main task of federated learning; the data filter learns the data pattern in the global test data set, that is, learns the feature information in the real data; the data filter is sent to each client as the entry for the main task of federated learning, and automatically filters the local training data stream based on the learned real data features and prevents abnormal data from entering the local training stage; after the offline screening is completed, the data filter will record the quality of the local data set, that is, a general description of the local data, such as "(amount of abnormal data, total amount of local data)", and upload it to the server together with the local model of the current round.

[0068] The server maintains a model filter based on probability distribution, including: the server maintains a historical model set for each client, and after each round of federated aggregation, the local model is feature extracted and stored in the corresponding client model set; after a certain number of training rounds, the model filter fits the feature distribution in each client's historical model set to a specific probability distribution; the model filter sets a benchmark client in combination with the information in the local data description of each client uploaded by the data filter, and uses a probability distribution-based method to measure the model distribution difference between the benchmark client and other clients; the model filter guides the selection of local models for subsequent federated aggregation according to the degree of model distribution difference, prioritizes the aggregation of client local models with low difference from the benchmark, and appropriately ignores client local models with high difference from the benchmark.

[0069] The data filter adopts a classification autoencoder network to learn the real data features and calculate the data screening loss. The classification autoencoder includes an encoder and a decoder. Among them, the classification autoencoder additionally trains an auxiliary classifier on the basis of the traditional autoencoder and introduces additional classification errors.

[0070] The model filter fits the feature information in each client's historical model information set into a Gaussian distribution using maximum likelihood estimation, and uses KL divergence to measure the difference between the distributions of each client's model set.

[0071] The federated learning dual-end security protection architecture described in this embodiment is as follows: Figure 1 The specific contents shown include the following:

[0072] S101: Before the federated training starts, the server uses the global test data set to train a data filter. The trained data filter is fixed at the main task entrance of the federated learning and distributed to each client.

[0073] In this step, the server trains a data filter using the global test dataset, which is a high-quality dataset maintained by the server and may be obtained through crowdsourcing, manual screening, etc. Figure 2 As shown, it can be understood that the global test set is a standard data set used by the server to verify the effect of the global model in each round. The test data is extremely important for the main task training and should contain important features that need to be learned for the main task without noise data or labels.

[0074] In this step, a data screening model based on the autoencoder network is established as the data entry for the main training task of the federated learning client.

[0075] Furthermore, in order to improve the screening accuracy of the data filter to cope with various low-quality data scenarios such as poisoned data, poisoned labels, noisy data, noisy labels, etc., a classification autoencoder that can double-screen data and labels is used. The structure diagram of the classification autoencoder is shown in Figure 3 As shown in the figure. The left part is the network model part, and the right part is the detection part. Specifically, it includes:

[0076] Compared with the original VAE, CAE uses the encoder’s latent representation z to train an additional auxiliary classifier. cae represents the reconstruction error, L cae represents the loss of the auxiliary classifier on the representation layer z.

[0077] In practice, CAE tries to minimize the training dataset during training. The combined loss on

[0078]

[0079] This learning method of CAE enables the classifier to predict labels and the decoder to reconstruct relevant inputs. To strengthen the connection between these two tasks, CAE simultaneously trains auxiliary classifiers and decoders to capture test dataset label information and sample information, respectively.

[0080] After training, the server fixes CAE at the main task data entry and distributes it to each training client. On the client, given a local data stream, for each data sample, CAE uses the combined loss of reconstruction error and classification error as the detection criterion for abnormal data, and detects deviations in feature space and label space at the same time. CAE's abnormal loss metric is as follows:

[0081] Error(x)=ψ.RE cae (x)+(1-ψ).L cae (y)

[0082] The first RE cae (x) is the reconstruction error term of CAE, and the second term L cae (y) is the loss term of the CAE-assisted classifier, ψ and 1-ψ are the weights controlling the two terms. cae (x) extracts the difference of x, the second term L cae (y) reflects the loss of the classifier, so the combined loss metric Error(x) can detect the differences in feature space and labels, thereby detecting different types of low-quality data.

[0083] After the loss calculation using the above formula, CAE can automatically and accurately identify abnormal data and abnormal labels in local data sets offline.

[0084] S102: During the federated training, the local data of each client must be filtered by the data filter and then input into the main task for local training, and the filtering results are saved to generate a local data description;

[0085] In this step, the client receives the federated learning main task with a data filter and uses the local data set for training. That is, the client's local data stream must be filtered by the offline data filter and detected as normal data before it can enter the training process of the main task.

[0086] In this implementation, during the local training process, the client needs to input the local data into the main task with the data filter. During this period, the client does not need to worry about data privacy leakage, because the review of the data filter and the main task training process are completely offline, that is, this process is a black box process for the server. After all local data sets pass the data filter, the main task will use the reviewed clean data set for training and complete the subsequent federated training process. During this period, the data filter will save a brief description of this local data set, that is, (abnormal data amount, local data total amount) data pair, which can be specifically expressed as:

[0087]

[0088] in, represents the anomaly dataset marked after review by the data filter, Represents client c i A brief description of the local dataset is uploaded to the server together with the local model.

[0089] It should be understood that the above data screening and local training process of the main task are offline for the server. The server only accepts the trained local model and local data description, and does not involve specific data. In order to ensure the quality of the local training of the main task, all clients need to perform data review and local training process.

[0090] It should be noted that the above brief description of local data sets only involves the number of local data sets and abnormal data sets, and therefore does not violate the privacy protection principle of federated learning.

[0091] S103: After the local training is completed, each client uploads the local model and the local data description to the server. The server processes and saves these local models and local data descriptions after federation aggregation.

[0092] In this step, the model filter in the server maintains a historical information set for each client to calculate the client's credibility. The model filter architecture is as follows: Figure 4 As shown, the historical information set includes:

[0093] The low-dimensional features after feature extraction of the local models uploaded by each client in the historical rounds;

[0094] A description of each client-side local data generated by a data filter.

[0095] The model filter needs to receive the client's local model information, but the high-dimensional local model parameters are huge and difficult to store and analyze, so it is necessary to extract features from the local model. t,i represents the original high-dimensional local model uploaded by client number i in the tth training round, Represents the low-dimensional model after the original high-dimensional local model uploaded by client number i in the tth training round is reduced to a low-dimensional model. Taking the PCA dimensionality reduction method as an example, the local model is reduced to one dimension, that is, a single data point:

[0096]

[0097] The model filter minimizes the space required for model storage and reduces the complexity of model analysis, and information compression does not cause the model reviewer to reduce the review accuracy.

[0098] Therefore, after T′ training rounds, the model filter is now i Each has a model information set denoted by If the client c i If it is not selected by the federated aggregation in the tth training round, a "NULL" placeholder will be stored in the corresponding position of the model information set, that is,

[0099] In addition to the model information set, the model filter also stores a brief description of the model dataset. That is, the data pair of abnormal data volume and local data volume.

[0100] S104: When the server has enough client historical model information, it runs a model filter based on probability distribution, and uses the local model set and local data description processed by each client to review the local model quality. The server will then guide the federated training and aggregation process based on the client local model quality review results.

[0101] In this step, the model filter analyzes and filters the historical information of each client, obtains the abnormality of each client and takes dilution measures for the abnormal client, including: fitting the historical model features in each client information set into a Gaussian distribution using maximum likelihood estimation;

[0102] Specifically include: For client c i The historical model information set is assumed to obey Gaussian distribution:

[0103]

[0104] Use maximum likelihood estimation to solve the parameter Φ, and the log-likelihood function is:

[0105]

[0106] That is the probability density function of the Gaussian distribution. Among them,

[0107]

[0108] Substituting in,

[0109]

[0110] The mean is:

[0111]

[0112] The extreme point of the derivative of the above function is the minimum value:

[0113]

[0114] Then its mean is:

[0115]

[0116] The variance is calculated in the same way:

[0117]

[0118]

[0119] Therefore the parameter variance is:

[0120]

[0121] At this point, the mean and variance of the Gaussian distribution fitted by each client model set are obtained through maximum likelihood estimation.

[0122] The model filter then uses KL divergence to measure the difference between each client model set step. KL divergence, also known as relative entropy, is a measure of the degree of match between two probability distributions. The greater the difference between the two distributions, the greater the KL divergence. KL divergence is always greater than or equal to zero. When it is equal to zero, it means that the two distributions are the same. KL divergence is asymmetric, and swapping the order of the two distributions will produce different results.

[0123] Specifically, KL divergence is used to measure the two clients c i C j The similarity formula of the abnormal distribution of the model set is as follows:

[0124]

[0125] The problem of measuring the differences between client model sets is transformed into measuring the differences between the probability distributions composed of the model sets. The model filter uses the asymmetric distribution measurement method KL divergence (KL divergence outputs different results when the distribution order is swapped), because the model filter needs to calculate the distribution difference between high-trust clients and other clients, that is, the client distribution is regarded as the benchmark distribution to measure the degree of difference between other client distributions and it.

[0126] High-trust clients are benchmark clients, which directly affect the screening accuracy of the model filter. The selection of benchmark clients can greatly reduce the computational complexity and number of calculations of the model reviewer.

[0127] Specifically, the high-trust client is selected based on the client local data description saved by the model filter, as follows:

[0128]

[0129] The first item calculates the proportion of legitimate data in the client dataset. In the second item, Γ represents the standard data batch of the main task of federated learning. This indicator is set according to the scale of the main task, so Indicates the amount of client data. 1 , γ 2 represents the weight factor, where γ 1 >γ 2, that is, the model filter pays more attention to the legal proportion of client data. Combining the first and second items, we can see that the local data set of the benchmark client needs to have sufficient data volume and a high proportion of legal data.

[0130] In summary, the federated learning dual-end security protection architecture provided in this embodiment includes a data filter and a model filter. The data filter solves the problem of poor local data quality in federated learning at the source, and there is no problem of data privacy leakage. Model filter based on probability distribution Even It is simpler and faster, and uses the probability distribution information of the data to identify abnormal distributions by comparing the deviations between the observed values ​​and the baseline distribution. It can better adapt to data changes and distribution uncertainties, thereby providing more representative model information. The federated learning dual-end security protection architecture provided in this embodiment has powerful security maintenance capabilities and development potential, and its application scenarios are wide, and can be applied to various data poisoning attacks, model poisoning attacks, backdoor attacks, and federated learning systems with noisy factors. The dual-end security protection architecture provided in this embodiment is the first to propose an offline automated security review of local data without touching the local data (even without sampling the local data).

[0131] Example 3

[0132] In this embodiment 3, a specific implementation method based on a federated learning dual-end security protection system is provided, which can realize all the contents of the federated learning dual-end security protection architecture. Figure 6 The federated learning dual-end security protection system specifically includes the following contents:

[0133] A data screening unit 10 is used to learn the real data features according to the global test data set on the server and screen the local data offline on each client, avoid low-quality data from entering the local training stage according to the data filter, record the local data quality and upload it to the server;

[0134] The model processing unit 20 is used to extract features from the client local model received by the server, so that the server can save the client historical information and the model filter can measure the client model differences, and obtain the local historical model information set corresponding to each client;

[0135] The model screening unit 30 is used to fit the historical model information set of each client to a specific probability distribution on the server to obtain the local model distribution of each client, and calculate the difference between the model distributions of each client using a probability distribution-based method in combination with the local data description of each client uploaded by the data filter, and calculate the abnormality degree of the local model corresponding to each client according to the degree of difference;

[0136] The exception handling unit 40 is used to summarize the credibility of each client based on the local data quality description of the data filter and the abnormal calculation results of the model filter on the server, and give the aggregation weight of the local model of each client during federation aggregation according to the credibility. Clients with too low credibility will be marked as abnormal clients and their subsequent local models will be ignored. Clients with high credibility will be used as subsequent benchmark clients to guide the regular operation of the model filter; the local model is a model trained by the client using a private data set.

[0137] It also includes: a parameter unit, which is used to set the parameter settings of the security protection system, and sets the parameters of the security protection system according to the number of clients of the federated learning system, the size of the main task model, etc.

[0138] The data screening unit 10 includes: a training module, which is used by the server to train the data filter before the federated training starts; a deployment module, which is used by the server to deploy the trained data filter at the entrance of the federated learning main task, and all data streams input to the main task by the client must first be filtered by the data filter; and a broadcast module, which is used by the server to broadcast the main task carrying the data filter to all training clients.

[0139] The model screening unit 30 includes: a feature extraction module, which is used by the server to extract features from the local models of each client to obtain the main distribution characteristics of each local model; an information storage module, which is used by the server to maintain each historical information set for each client, and store the local model of each round of federal aggregation and the local data description of each client.

[0140] The embodiment of the federated learning dual-end security protection system provided in this embodiment can be specifically used to execute the processing flow of the embodiment of the federated learning dual-end security protection architecture in the above-mentioned embodiment. Its functions will not be repeated here, and reference can be made to the detailed description of the above-mentioned method embodiment.

[0141] The federated learning dual-end security protection system provided by this embodiment uses a global test data set to train a data filter on the server before the start of federated training. The trained data filter is fixed at the entrance of the federated learning main task and distributed to each client together; during the federated training, the local data of each client must be filtered by the data filter and then input into the main task for local training, and the filtering results are saved to generate local data descriptions; after the local training is completed, each client uploads the local model and the local data description to the server together, and the server processes and saves these local models and local data descriptions after federated aggregation; when the server has enough client historical model information, it runs a model filter based on probability distribution, and uses the local model set and local data description processed by each client to review the quality of the local model. The subsequent server will guide the federated training and aggregation process according to the local model quality review results of the client. Among them, the local model is a model trained by the client using a private data set. The present invention performs offline automatic review of the local data set on the client side, and reviews the collected local model on the server side. It can comprehensively protect the data and model security without violating the privacy protection principle of federated learning, greatly improving the robustness and credibility of the federated learning system.

[0142] In this embodiment, an application example of the above-mentioned federated learning dual-end security protection system is provided, wherein the federated learning application system includes 1 central server and 20 clients. The federated learning system runs 200 training rounds. Due to factors such as resource constraints, the server randomly selects 5 clients in each round to receive their local models for global model aggregation. The aggregation algorithm of the federated learning system is the classic FedAvg algorithm.

[0143] Federated learning applications are based on three typical image datasets, namely MNIST, Fashion-MNIST, and CIFAR-10 datasets, but the specific applications are not limited to image data. In order to simulate the distributed training of federated learning and support anomaly detection of defense methods, any dataset is split into two parts: a small part of the data is allocated to the server for global model testing; the rest of the data is distributed to each client for local model training. Specifically, this part of the data is divided into 60 parts and randomly distributed to 60 clients to simulate independent and identically distributed distributed data.

[0144] In the experimental scenarios using the MNIST and Fashion-MNIST datasets, the main task of federated learning is to train a neural network with 2 convolutional layers, while in the experimental scenarios using the CIFAR-10 dataset, the main task of federated learning is to train a neural network with 6 convolutional layers. The server and each client train the same main task model.

[0145] In order to highlight the effectiveness of the two-terminal security protection system, in this embodiment, ablation experiments are used to verify the effectiveness of the data filter and the model filter respectively.

[0146] First, the data filtering capability of the data filter is verified in the data poisoning attack scenario, the noisy data scenario, and the noisy label scenario. The verified poisoned data include: PoisonGAN data poisoning attack, VgaueGAN data poisoning attack, and LSDAM data poisoning attack. The noise data is obtained by superimposing random Gaussian noise and real-time data, and the noise label is obtained by label flipping operation. The data filter's screening accuracy for various abnormal data, the real data false detection rate, and the abnormal loss are shown in Table 1.

[0147] Table 1 (average)

[0148] Abnormal data Recognition accuracy False positive rate Abnormal losses PoisonGAN 0.996 0.004 0.695 VagueGAN 0.981 0.007 0.842 LSDAM 0.976 0.006 0.807 Noisesuperposition 0.989 0.004 0.711 Labelflipping 0.998 0.002 0.625 Realdata - - 0.133

[0149] Table 1 shows the results of the data filter on various abnormal data. In each experiment, abnormal data accounts for 30% of the total data. From Table 1 above, it can be seen that from the perspective of the data filter, there is a large difference between real data and abnormal data (abnormal loss). The data filter has a very high recognition accuracy rate for abnormal data outside the normal data features and rarely misdetects. The data filter can accurately identify abnormal data in various federated learning abnormal scenarios. This reflects the versatility and effectiveness of the data filter in the system.

[0150] Secondly, verify the model filtering capability of the model filter in the above abnormal scenarios. Figure 5 The results of the visualization of the abnormal client and normal client historical models after feature extraction and probability distribution fitting by the data filter. In order to highlight the screening ability of the model filter, two iconic abnormal scenarios are taken as examples: data label flipping attack and VagueGAN data poisoning attack, which demonstrates that the model filter has superior recognition ability for abnormal models and the rationality of the model filter's model processing. It is a fast, accurate and lightweight model protection method, which is expected to become a standardized security maintenance method for federated learning.

[0151] The federated learning dual-end security protection system can accurately identify abnormal links and take corresponding countermeasures when various abnormal situations exist in the federated training client and the client data privacy principle is maintained, and can solve data anomalies and model anomalies in various scenarios. This reflects the superiority of the method proposed in the present invention.

[0152] In summary, a training task of a federated learning system can be deployed with the dual-end security protection system proposed in this example to provide security protection for links and nodes with low credibility. Before the start of federated training, the server uses the global test data set to train a data filter, and the trained data filter is fixed at the entrance of the federated learning main task and distributed to each client; during the federated training, the local data of each client must be filtered by the data filter and then input into the main task for local training, and the filtering results are saved to generate local data descriptions; after the local training, each client uploads the local model and local data description to the server, and the server processes and saves these local models and local data descriptions after federation aggregation; when the server has enough client historical model information, it runs a model filter based on probability distribution, and uses the local model set and local data description processed by each client to review the quality of the local model. The server will then guide the federated training and aggregation process based on the client local model quality review results. Among them, the local model is a model trained by the client using a private data set; the dual-end security protection system performs offline automatic review of the local data set on the client side, and reviews the collected local model on the server side. It can comprehensively protect the data and model security without violating the privacy protection principles of federated learning, greatly improving the robustness and credibility of the federated learning system; the data screening task is assigned to each client for offline work, which solves the problem that the client data quality cannot be verified and protects the client data privacy.

[0153] Example 4

[0154] This embodiment 4 provides a computer-readable storage medium that contains all or part of the contents of the federated learning dual-end security protection architecture embodiment. The computer-readable storage medium stores computer instructions. When the computer instructions are executed, the computer executes the federated learning dual-end security protection architecture in the above embodiment. For example, when the processor executes the computer instructions, the following steps are implemented:

[0155] Before the federated training begins, the server uses the global test data set to train a data filter. The trained data filter is fixed at the main task entrance of the federated learning and distributed to each client.

[0156] During federated training, the local data of each client must be filtered by the data filter and then input into the main task for local training, and the filtering results are saved to generate local data descriptions;

[0157] After the local training is completed, each client uploads the local model and local data description to the server. The server processes and saves these local models and local data descriptions after federation aggregation.

[0158] When the server has enough client historical model information, it runs a model filter based on probability distribution, and uses the local model set and local data description processed by each client to review the local model quality. The server will then guide the federated training and aggregation process based on the client local model quality review results.

[0159] Example 5

[0160] This embodiment 5 provides a computer device, including a memory and a processor, the processor and the memory communicate with each other, the memory stores program instructions executable by the processor, the processor calls the program instructions to execute the above-mentioned federated learning two-end security protection method, the method comprising:

[0161] Before the federated training begins, the server uses the global test data set to train a data filter. The trained data filter is fixed at the main task entrance of the federated learning and distributed to each client.

[0162] During federated training, the local data of each client must be filtered by the data filter and then input into the main task for local training, and the filtering results are saved to generate local data descriptions;

[0163] After the local training is completed, each client uploads the local model and local data description to the server. The server processes and saves these local models and local data descriptions after federation aggregation.

[0164] When the server has enough client historical model information, it runs a model filter based on probability distribution, and uses the local model set and local data description processed by each client to review the local model quality. The server will then guide the federated training and aggregation process based on the client local model quality review results.

[0165] Example 6

[0166] This embodiment 6 provides an embodiment of an electronic device for implementing all or part of the contents of the embodiment of the federated learning dual-end security protection system, see Figure 7 , the electronic device includes: a processor (processor) 810, a communication interface (Communications Interface) 820, a memory (memory) 830 and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call the computer instructions in the memory 830 to execute the following method:

[0167] Before the federated training begins, the server uses the global test data set to train a data filter. The trained data filter is fixed at the main task entrance of the federated learning and distributed to each client.

[0168] During federated training, the local data of each client must be filtered by the data filter and then input into the main task for local training, and the filtering results are saved to generate local data descriptions;

[0169] After the local training is completed, each client uploads the local model and local data description to the server. The server processes and saves these local models and local data descriptions after federation aggregation.

[0170] When the server has enough client historical model information, it runs a model filter based on probability distribution, and uses the local model set and local data description processed by each client to review the local model quality. The server will then guide the federated training and aggregation process based on the client local model quality review results.

[0171] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative work on the basis of the technical solution disclosed in the present invention should be included in the scope of protection of the present invention.

Claims

1. A federated learning method based on dual-end security protection, characterized in that: include: Obtain the local model and local data description trained by each client; wherein, the local data is filtered by a data filter and the data detected as normal is used as the training data of the local model; Extract features from the acquired local model, save client history information, and obtain a local history model information set corresponding to each client; The model filter based on probability distribution is used to measure the difference of local models of each client, calculate the difference between the model distributions of each client, and calculate the abnormality degree of the local model corresponding to each client according to the degree of difference between the model distributions of each client; According to the local data description and the abnormality degree of the local model corresponding to each client, the credibility of each client is obtained, and the aggregation weight of each local model during federation aggregation is obtained according to the credibility.

2. The federated learning method based on dual-end security protection according to claim 1 is characterized in that: The data filter is trained using a classification autoencoder for dual data and label filtering; the classification autoencoder uses the latent representation z to additionally train an auxiliary classifier using RE cae represents the reconstruction error, L cae represents the loss of the auxiliary classifier on the representation layer z; Minimize the training dataset The combined loss on is: On the client side, given a local data stream, for each data sample, the classification autoencoder uses the combined loss of reconstruction error and classification error as the detection criterion for abnormal data, while detecting deviations in feature space and label space.

3. The federated learning method based on dual-end security protection according to claim 1 is characterized in that: A model filter based on probability distribution is used to fit the historical model information set of each client into a specific probability distribution in the server to obtain the local model distribution of each client. The difference between the model distributions of each client is calculated using a probability distribution-based method in combination with the local data description of each client uploaded by the data filter. The degree of abnormality of the local model corresponding to each client is calculated based on the degree of difference.

4. The federated learning method based on dual-end security protection according to claim 3 is characterized in that: The server maintains a historical model set for each client. After each round of federated aggregation, the local model is feature extracted and stored in the corresponding client model set. After a certain number of training rounds, the model filter fits the feature distribution in each client's historical model set to a specific probability distribution. The model filter sets the benchmark client based on the information in the local data description of each client uploaded by the data filter, and uses a probability distribution-based method to measure the model distribution difference between the benchmark client and other clients. The model filter guides the selection of local models for subsequent federated aggregation based on the degree of model distribution difference, giving priority to aggregating client local models with low differences from the benchmark, and appropriately ignoring client local models with high differences from the benchmark.

5. The federated learning method based on dual-end security protection according to claim 1 is characterized in that: The model filter fits the feature information in each client's historical model information set into a Gaussian distribution using maximum likelihood estimation, and uses KL divergence to measure the difference between the distributions of each client's model set.

6. The federated learning method based on dual-end security protection according to claim 5 is characterized in that: Extract features from the local model, including: θ t,i represents the original high-dimensional local model uploaded by client number i in the tth training round, Represents the low-dimensional model after the original high-dimensional local model uploaded by client number i in the tth training round is reduced to one dimension using the PCA dimensionality reduction method:

7. A federated learning system based on dual-end security protection, characterized in that: include: The acquisition module is used to acquire the local model and local data description completed by the client; wherein the local data is filtered by the data filter and the data detected as normal is used as the training data of the local model; The extraction module is used to extract features from the acquired local model, save the client history information, and obtain the local history model information set corresponding to each client; A screening module is used to measure the local model differences of each client using a model filter based on probability distribution, calculate the differences between the model distributions of each client, and calculate the degree of abnormality of the local model corresponding to each client according to the degree of difference between the model distributions of each client; The calculation module is used to obtain the credibility of each client according to the local data description and the abnormality of the local model corresponding to each client, and obtain the aggregation weight of each local model during federation aggregation according to the credibility.

8. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by the processor, the federated learning method based on double-end security protection as described in any one of claims 1-6 is implemented.

9. A computer device, characterized in that: It includes a memory and a processor, the processor and the memory communicate with each other, the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the federated learning method based on double-end security protection as described in any one of claims 1-6.

10. An electronic device, characterized in that: include: A processor, a memory and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory so that the electronic device executes instructions for implementing the federated learning method based on double-end security protection as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Salt hill identification method and device and computer equipment

    CN116068640A

  • Defense method and system for federal learning data poisoning attack

    CN117610674A

  • Methods and apparatuses for detecting data-poisoning attacks in federated learning environment

    WO2024158348A1