Federal learning system defense method and device, computer equipment and storage medium

By acquiring client model parameters through a federated learning system and employing random sampling and classification techniques to identify and process important model parameters, the problem of backdoor attack concealment is solved, effective defense against malicious clients is achieved, and the quality of training data for the global model is ensured.

CN116471078BActive Publication Date: 2026-11-27INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310405381.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-17
Publication Date
2026-11-27
Estimated Expiration
2043-04-17

AI Technical Summary

Technical Problem

Backdoor attacks in federated learning systems are difficult to detect and defend against, especially due to the invisibility of their internal logic and the stealth of malicious client attacks, which can interfere with the model's performance.

Method used

By acquiring the parameters of each client model, a random sampling strategy is used to generate and classify the dataset. A subset of the target data is retained, and important model parameters are determined based on the frequency of model parameter retention. These parameters are then preprocessed to identify normal clients.

Benefits of technology

Initially, model parameters that differ significantly from normal client characteristics are eliminated. Further screening is performed to identify malicious client model parameters with concealed characteristics, thus defending against backdoor attacks and ensuring the data quality of global model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116471078B_ABST
    Figure CN116471078B_ABST
Patent Text Reader

Abstract

The application relates to a federal learning system defense method and device, computer equipment, a storage medium and a computer program product, and relates to the technical field of machine learning, the technical field of artificial intelligence and the field of information security. The method comprises the following steps: acquiring model parameters of each client model; according to a preset random sampling strategy, randomly sampling the model parameters for each dimension contained in the model parameters to obtain a plurality of data sets, classifying each data set, determining a target classification result, and retaining a target data subset corresponding to the target classification result in the data set; determining important model parameters in the model parameters according to the frequency at which the model parameters in the target data subset are retained; preprocessing the important model parameters to obtain target model parameters, and determining a normal client according to the client corresponding to the target model parameters. The method can realize defense against backdoor attacks by bad clients in a data federal learning system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of artificial intelligence technology and information security, and in particular to a method, apparatus, computer equipment, storage medium and computer program product for defending a federated learning system. Background Technology

[0002] With the development of artificial intelligence technology, federated learning systems are becoming increasingly vulnerable to adversarial attacks. Due to the black-box nature of federated learning systems, attackers can implant backdoors into the model after the system has been trained, thereby interfering with the global model's performance by modifying the global model training data.

[0003] Due to the invisibility of the internal logic of federated learning and the highly covert nature of malicious client attacks in federated learning systems, backdoor attacks are difficult to detect in federated learning systems. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for defending a federated learning system, addressing the aforementioned technical problems.

[0005] Firstly, this application provides a method for defending a federated learning system. The method includes:

[0006] Obtain the model parameters for each client model;

[0007] For each dimension included in the model parameters, the model parameters are randomly sampled according to a preset random sampling strategy to obtain multiple datasets. Each dataset is classified to determine the target classification result, and the target data subset corresponding to the target classification result in the dataset is retained.

[0008] Based on the frequency with which model parameters are retained in the target data subset, important model parameters are determined among the model parameters;

[0009] The important model parameters are preprocessed to obtain the target model parameters, and the normal client is determined based on the client corresponding to the target model parameters.

[0010] In one embodiment, before obtaining the model parameters of each client model, the method further includes:

[0011] Send the initial model to each client;

[0012] Receive the model parameters returned by each client after the initial model training is completed.

[0013] In one embodiment, after randomly sampling the model parameters according to a preset random sampling strategy for each dimension included in the model parameters to obtain multiple datasets, the method further includes:

[0014] For each client corresponding to a model parameter in the dataset, generate a client serial number corresponding to each model parameter in the dataset.

[0015] In one embodiment, classifying each dataset, determining a target classification result, and retaining the target data subset corresponding to the target classification result in the dataset includes:

[0016] The binary classification model is used to classify each of the datasets to obtain the classification result for each dataset.

[0017] The target classification result is determined from the classification results, and the model parameters corresponding to the target classification result are retained as the target data subset.

[0018] In one embodiment, determining the target classification result from the classification results and retaining the model parameters corresponding to the target classification result as the target data subset includes:

[0019] The classification result with the highest proportion of model parameters in the classification results is determined as the target classification result;

[0020] Based on the model parameters corresponding to the target classification results, a subset of target data is formed and retained.

[0021] In one embodiment, after forming and retaining the target data subset based on the model parameters corresponding to the target classification result, the method further includes:

[0022] Record the client sequence number of the model parameters in the target data subset;

[0023] Eliminate the model parameters from other classification results.

[0024] In one embodiment, determining the important model parameters among the model parameters based on the frequency with which model parameters are retained in the target data subset includes:

[0025] The frequency of model parameters being retained in the target data subset is determined based on the number of times the model parameters are retained and the number of times the model parameters are randomly sampled to form the multiple datasets.

[0026] Model parameters whose retention frequency in the target data subset is higher than the retention threshold are retained as important model parameters.

[0027] In one embodiment, the preprocessing of the important model parameters to obtain target model parameters, and the determination of normal clients based on the clients corresponding to the target model parameters, includes:

[0028] The important model parameters are decomposed by dimensionality reduction and cluster analysis. The important model parameters contained in the cluster with the largest amount of data in the cluster results are determined as the target model parameters.

[0029] The client corresponding to the client serial number of the target model parameters is identified as a normal client.

[0030] Secondly, this application also provides a defense device for a federal learning system. The device includes:

[0031] The acquisition module is used to obtain the model parameters of each client model;

[0032] The sampling module is used to randomly sample the model parameters according to a preset random sampling strategy for each dimension contained in the model parameters to obtain multiple datasets, classify each dataset, determine the target classification result, and retain the target data subset corresponding to the target classification result in the dataset.

[0033] The first determining module is used to determine the important model parameters in the model parameters based on the frequency at which the model parameters in the target data subset are retained.

[0034] The second determining module is used to preprocess the important model parameters to obtain the target model parameters, and determine the normal client based on the client corresponding to the target model parameters.

[0035] In one embodiment, the acquisition module is further configured to:

[0036] Send the initial model to each client;

[0037] Receive the model parameters returned by each client after the initial model training is completed.

[0038] In one embodiment, the sampling module is further configured to:

[0039] For each client corresponding to a model parameter in the dataset, generate a client serial number corresponding to each model parameter in the dataset.

[0040] In one embodiment, the sampling module is specifically used for:

[0041] The binary classification model is used to classify each of the datasets to obtain the classification result for each dataset.

[0042] The target classification result is determined from the classification results, and the model parameters corresponding to the target classification result are retained as the target data subset.

[0043] In one embodiment, the sampling module is specifically used for:

[0044] The classification result with the highest proportion of model parameters in the classification results is determined as the target classification result;

[0045] Based on the model parameters corresponding to the target classification results, a subset of target data is formed and retained.

[0046] In one embodiment, the sampling module is specifically used for:

[0047] Record the client sequence number of the model parameters in the target data subset;

[0048] Eliminate the model parameters from other classification results.

[0049] In one embodiment, the first determining module is specifically used for:

[0050] The frequency of model parameters being retained in the target data subset is determined based on the number of times the model parameters are retained and the number of times the model parameters are randomly sampled to form the multiple datasets.

[0051] Model parameters whose retention frequency in the target data subset is higher than the retention threshold are retained as important model parameters.

[0052] In one embodiment, the second determining module is specifically used for:

[0053] The important model parameters are decomposed by dimensionality reduction and cluster analysis. The important model parameters contained in the cluster with the largest amount of data in the cluster results are determined as the target model parameters.

[0054] The client corresponding to the client serial number of the target model parameters is identified as a normal client.

[0055] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0056] Obtain the model parameters for each client model;

[0057] For each dimension included in the model parameters, the model parameters are randomly sampled according to a preset random sampling strategy to obtain multiple datasets. Each dataset is classified to determine the target classification result, and the target data subset corresponding to the target classification result in the dataset is retained.

[0058] Based on the frequency with which model parameters are retained in the target data subset, important model parameters are determined among the model parameters;

[0059] The important model parameters are preprocessed to obtain the target model parameters, and the normal client is determined based on the client corresponding to the target model parameters.

[0060] In one embodiment, before obtaining the model parameters of each client model, the method further includes:

[0061] Send the initial model to each client;

[0062] Receive the model parameters returned by each client after the initial model training is completed.

[0063] In one embodiment, after randomly sampling the model parameters according to a preset random sampling strategy for each dimension included in the model parameters to obtain multiple datasets, the method further includes:

[0064] For each client corresponding to a model parameter in the dataset, generate a client serial number corresponding to each model parameter in the dataset.

[0065] In one embodiment, classifying each dataset, determining a target classification result, and retaining the target data subset corresponding to the target classification result in the dataset includes:

[0066] The binary classification model is used to classify each of the datasets to obtain the classification result for each dataset.

[0067] The target classification result is determined from the classification results, and the model parameters corresponding to the target classification result are retained as the target data subset.

[0068] In one embodiment, determining the target classification result from the classification results and retaining the model parameters corresponding to the target classification result as the target data subset includes:

[0069] The classification result with the highest proportion of model parameters in the classification results is determined as the target classification result;

[0070] Based on the model parameters corresponding to the target classification results, a subset of target data is formed and retained.

[0071] In one embodiment, after forming and retaining the target data subset based on the model parameters corresponding to the target classification result, the method further includes:

[0072] Record the client sequence number of the model parameters in the target data subset;

[0073] Eliminate the model parameters from other classification results.

[0074] In one embodiment, determining the important model parameters among the model parameters based on the frequency with which model parameters are retained in the target data subset includes:

[0075] The frequency of model parameters being retained in the target data subset is determined based on the number of times the model parameters are retained and the number of times the model parameters are randomly sampled to form the multiple datasets.

[0076] Model parameters whose retention frequency in the target data subset is higher than the retention threshold are retained as important model parameters.

[0077] In one embodiment, the preprocessing of the important model parameters to obtain target model parameters, and the determination of normal clients based on the clients corresponding to the target model parameters, includes:

[0078] The important model parameters are decomposed by dimensionality reduction and cluster analysis. The important model parameters contained in the cluster with the largest amount of data in the cluster results are determined as the target model parameters.

[0079] The client corresponding to the client serial number of the target model parameters is identified as a normal client.

[0080] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0081] Obtain the model parameters for each client model;

[0082] For each dimension included in the model parameters, the model parameters are randomly sampled according to a preset random sampling strategy to obtain multiple datasets. Each dataset is classified to determine the target classification result, and the target data subset corresponding to the target classification result in the dataset is retained.

[0083] Based on the frequency with which model parameters are retained in the target data subset, important model parameters are determined among the model parameters;

[0084] The important model parameters are preprocessed to obtain the target model parameters, and the normal client is determined based on the client corresponding to the target model parameters.

[0085] In one embodiment, before obtaining the model parameters of each client model, the method further includes:

[0086] Send the initial model to each client;

[0087] Receive the model parameters returned by each client after the initial model training is completed.

[0088] In one embodiment, after randomly sampling the model parameters according to a preset random sampling strategy for each dimension included in the model parameters to obtain multiple datasets, the method further includes:

[0089] For each client corresponding to a model parameter in the dataset, generate a client serial number corresponding to each model parameter in the dataset.

[0090] In one embodiment, classifying each dataset, determining a target classification result, and retaining the target data subset corresponding to the target classification result in the dataset includes:

[0091] The binary classification model is used to classify each of the datasets to obtain the classification result for each dataset.

[0092] The target classification result is determined from the classification results, and the model parameters corresponding to the target classification result are retained as the target data subset.

[0093] In one embodiment, determining the target classification result from the classification results and retaining the model parameters corresponding to the target classification result as the target data subset includes:

[0094] The classification result with the highest proportion of model parameters in the classification results is determined as the target classification result;

[0095] Based on the model parameters corresponding to the target classification results, a subset of target data is formed and retained.

[0096] In one embodiment, after forming and retaining the target data subset based on the model parameters corresponding to the target classification result, the method further includes:

[0097] Record the client sequence number of the model parameters in the target data subset;

[0098] Eliminate the model parameters from other classification results.

[0099] In one embodiment, determining the important model parameters among the model parameters based on the frequency with which model parameters are retained in the target data subset includes:

[0100] The frequency of model parameters being retained in the target data subset is determined based on the number of times the model parameters are retained and the number of times the model parameters are randomly sampled to form the multiple datasets.

[0101] Model parameters whose retention frequency in the target data subset is higher than the retention threshold are retained as important model parameters.

[0102] In one embodiment, the preprocessing of the important model parameters to obtain target model parameters, and the determination of normal clients based on the clients corresponding to the target model parameters, includes:

[0103] The important model parameters are decomposed by dimensionality reduction and cluster analysis. The important model parameters contained in the cluster with the largest amount of data in the cluster results are determined as the target model parameters.

[0104] The client corresponding to the client serial number of the target model parameters is identified as a normal client.

[0105] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0106] Obtain the model parameters for each client model;

[0107] For each dimension included in the model parameters, the model parameters are randomly sampled according to a preset random sampling strategy to obtain multiple datasets. Each dataset is classified to determine the target classification result, and the target data subset corresponding to the target classification result in the dataset is retained.

[0108] Based on the frequency with which model parameters are retained in the target data subset, important model parameters are determined among the model parameters;

[0109] The important model parameters are preprocessed to obtain the target model parameters, and the normal client is determined based on the client corresponding to the target model parameters.

[0110] In one embodiment, before obtaining the model parameters of each client model, the method further includes:

[0111] Send the initial model to each client;

[0112] Receive the model parameters returned by each client after the initial model training is completed.

[0113] In one embodiment, after randomly sampling the model parameters according to a preset random sampling strategy for each dimension included in the model parameters to obtain multiple datasets, the method further includes:

[0114] For each client corresponding to a model parameter in the dataset, generate a client serial number corresponding to each model parameter in the dataset.

[0115] In one embodiment, classifying each dataset, determining a target classification result, and retaining the target data subset corresponding to the target classification result in the dataset includes:

[0116] The binary classification model is used to classify each of the datasets to obtain the classification result for each dataset.

[0117] The target classification result is determined from the classification results, and the model parameters corresponding to the target classification result are retained as the target data subset.

[0118] In one embodiment, determining the target classification result from the classification results and retaining the model parameters corresponding to the target classification result as the target data subset includes:

[0119] The classification result with the highest proportion of model parameters in the classification results is determined as the target classification result;

[0120] Based on the model parameters corresponding to the target classification results, the target data subset is formed and retained.

[0121] In one embodiment, after forming and retaining the target data subset based on the model parameters corresponding to the target classification result, the method further includes:

[0122] Record the client sequence number of the model parameters in the target data subset;

[0123] Eliminate the model parameters from other classification results.

[0124] In one embodiment, determining the important model parameters among the model parameters based on the frequency with which model parameters are retained in the target data subset includes:

[0125] The frequency of model parameters being retained in the target data subset is determined based on the number of times the model parameters are retained and the number of times the model parameters are randomly sampled to form the multiple datasets.

[0126] Model parameters whose retention frequency in the target data subset is higher than the retention threshold are retained as important model parameters.

[0127] In one embodiment, the preprocessing of the important model parameters to obtain target model parameters, and the determination of normal clients based on the clients corresponding to the target model parameters, includes:

[0128] The important model parameters are decomposed by dimensionality reduction and cluster analysis. The important model parameters contained in the cluster with the largest amount of data in the cluster results are determined as the target model parameters.

[0129] The client corresponding to the client serial number of the target model parameters is identified as a normal client.

[0130] The aforementioned federated learning system defense methods, devices, computer equipment, storage media, and computer program products can initially eliminate some model parameters that differ significantly from normal client characteristics by retaining the target data subset in the first data subset. Then, by performing dimensionality reduction decomposition on the important data in the target data subset, it is possible to further filter out the model parameters of malicious clients with more covert characteristics and determine the target data for global model training, thereby obtaining normal clients and realizing the defense against backdoor attacks by malicious clients in the data federated learning system. Attached Figure Description

[0131] Figure 1 This is a diagram illustrating the application environment of a federated learning system defense method in one embodiment.

[0132] Figure 2 This is a flowchart illustrating a defense method for a federated learning system in one embodiment;

[0133] Figure 3 This is a flowchart illustrating the steps for obtaining parameters of each client model in one embodiment;

[0134] Figure 4 This is a flowchart illustrating the classification steps for each dataset in one embodiment;

[0135] Figure 5 This is a flowchart illustrating a method for determining a target data subset in one embodiment;

[0136] Figure 6 This is a flowchart illustrating the steps for eliminating other classification results in each dataset in one embodiment;

[0137] Figure 7 This is a flowchart illustrating a method for determining important model parameters in one embodiment;

[0138] Figure 8 This is a flowchart illustrating a method for determining a target model in one embodiment;

[0139] Figure 9 This is a flowchart illustrating an example of a defense method for a federated learning system in one embodiment;

[0140] Figure 10 This is a structural block diagram of a federated learning system defense device in one embodiment;

[0141] Figure 11 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0142] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0143] The federated learning system defense method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, the central server 102 communicates with the client 104 via a network. A data storage system can store the data that the central server 102 needs to process. The data storage system can be integrated onto the central server 102 or placed on a cloud or other network server. The central server 102 obtains the model parameters of each client model; for each dimension contained in the model parameters, the central server 102 randomly samples the model parameters according to a preset random sampling strategy to obtain multiple datasets, classifies each dataset, determines the target classification result, and retains the target data subset corresponding to the target classification result in the dataset; based on the frequency of model parameters being retained in the target data subset, the central server 102 determines the important model parameters; the central server 102 preprocesses the important model parameters to obtain the target model parameters, and determines the normal client based on the client corresponding to the target model parameters.

[0144] In one embodiment, such as Figure 2 As shown, a defense method for federated learning systems is provided, which can be applied to... Figure 1 Taking the central server 102 as an example, the following steps are included:

[0145] Step 202: Obtain the model parameters for each client model.

[0146] In this embodiment of the application, the federated learning system includes a central server and multiple clients. The client model is the initial model issued by the central server. The central server obtains the model parameters of each client model. The client model parameters are used to train the global model of the central server to improve the performance of the global model.

[0147] Each client includes both legitimate and malicious users, and the actions performed by legitimate and malicious users are identical. The central server obtains the training results of legitimate users on the initial model, i.e., the normal model parameters. At the same time, the central server also obtains the poisoned model parameters obtained by malicious users using malicious sample data constructed on the initial model. These poisoned model parameters are maliciously misleading and will cause the central server's global model to make incorrect judgments on specific features.

[0148] Step 204: For each dimension contained in the model parameters, the model parameters are randomly sampled according to a preset random sampling strategy to obtain multiple datasets. Each dataset is classified to determine the target classification result, and the target data subset corresponding to the target classification result in the dataset is retained.

[0149] In this embodiment, each client trains the initial model issued by the central server, obtaining model parameters for multiple dimensions corresponding to the initial model. After receiving the model parameters from each client, the central server determines a preset number of random samples for each dimension contained in the model parameters of the initial model, based on the number of model parameters, and randomly samples the model parameters from each client to obtain multiple datasets containing a preset number of random model parameters.

[0150] For each of the multiple datasets, the central server can classify these datasets using a binary classification model, such as an SVM (Support Vector Machine). After determining the target classification result, the central server retains the target data subset from the target classification result; that is, it eliminates the model parameters other than the target data subset.

[0151] Step 206: Determine the important model parameters in the model parameters based on the frequency of model parameters being retained in the target data subset.

[0152] In this embodiment, the central server calculates the retention frequency of each model parameter in the target data subset according to a preset calculation strategy, and determines whether it is an important model parameter based on its retention frequency, thereby identifying important model parameters in the target data subset. Specifically, when the retention frequency of each model parameter is greater than a preset threshold, it is identified as an important model parameter.

[0153] Step 208: Preprocess the important model parameters to obtain the target model parameters, and determine the normal client based on the client corresponding to the target model parameters.

[0154] In this embodiment, the preprocessing operation may involve performing PCA (principal component analysis) dimensionality reduction decomposition on important model parameters, followed by cluster analysis on the dimensionality-reduced model parameters to determine the target model parameters. For each target model parameter, the central server determines the corresponding client and designates each client as a normal client. During federated learning update training of the global model on the central server, the model parameters from the normal clients are used for update training.

[0155] In the above-mentioned defense method for federated learning systems, by retaining the target data subset in the first data subset, some model parameters that differ significantly from the characteristics of normal clients can be initially eliminated. Then, by performing dimensionality reduction decomposition on the important data in the target data subset, model parameters of malicious clients with more covert characteristics can be further filtered out, and target data for global model training can be determined. This allows normal clients to be obtained, thus enabling the defense against backdoor attacks by malicious clients in the data federated learning system.

[0156] In one embodiment, such as Figure 3 As shown, before step 202 obtains the model parameters of each client model, the method further includes:

[0157] Step 302: Send the initial model to each client.

[0158] In this embodiment, the central server sends an initial model to each client. Each client uses local data to train the initial model, obtaining the trained model parameters. The client model parameters are used to train the central server's global model to improve its performance.

[0159] Step 304: Receive the model parameters returned by each client after the initial model training is completed.

[0160] In this embodiment of the application, each client sends the model parameters obtained after training the initial model to the central server. The central server receives the model parameters from each client to obtain the client's model parameters.

[0161] In this embodiment, by training the initial model issued by the central server through each client, the model parameters used for training by the central server can be obtained.

[0162] In one embodiment, after step 204 randomly samples the model parameters according to a preset random sampling strategy for each dimension included in the model parameters to obtain multiple datasets, the method further includes:

[0163] For each client corresponding to the model parameters in each dataset, generate a client sequence number corresponding to each model parameter in the dataset.

[0164] In this embodiment of the application, when the central server receives the model parameters returned by each client, it generates a corresponding client sequence number for each model parameter. After randomly sampling the model parameters to generate multiple datasets, it generates the client sequence number corresponding to each model parameter in each dataset based on the client sequence number corresponding to each model parameter.

[0165] In this embodiment, by generating client sequence numbers corresponding to the dataset for each model parameter, it is possible to identify the client corresponding to the model parameter, thereby filtering out models with normal clients for global model training.

[0166] In one embodiment, such as Figure 4 As shown, step 204 classifies each dataset, determines the target classification result, and retains the target data subset corresponding to the target classification result in the dataset, including:

[0167] Step 402: Classify each dataset in each dataset according to the binary classification model to obtain the classification result corresponding to each dataset.

[0168] In this embodiment, after the central server obtains the model parameters from each client, it performs classification using a binary classification model (SVM). Two classification results are obtained for each dataset, and these results are used for preliminary filtering of the model parameters in each dataset. Optionally, the central server can classify each dataset, obtaining multiple classification results. The classification results are then filtered according to a preset filtering strategy, and the classification results with a larger number of model parameters are retained as normal model parameters.

[0169] Step 404: Determine the target classification result from the classification results and retain the model parameters corresponding to the target classification result as a subset of the target data.

[0170] In this embodiment of the application, the central server filters out the target classification result from the classification results according to the preset filtering strategy, uses the target classification result as the model parameter of the normal client model, and retains it as a subset of the target data.

[0171] In this embodiment, by determining the target data subset to be retained in each dataset, it is possible to perform preliminary screening of the model parameters of each client and discard the model parameters of malicious clients that are significantly different from those of normal clients.

[0172] In one embodiment, such as Figure 5 As shown, step 404 determines the target classification result from the classification results and retains the model parameters corresponding to the target classification result as a subset of the target data, including:

[0173] Step 502: The classification result with a high proportion of model parameters in the classification results is determined as the target classification result.

[0174] In this embodiment, after the central server classifies the model parameters using a binary classification model, the central server can determine the target data subset based on the number of model parameters in each classification result. Specifically, the central server determines the classification result with the highest proportion of model parameters in the current dataset as the target classification result. The target classification result represents the classification result composed of model parameters from a normal client.

[0175] Step 504: Based on the model parameters corresponding to the target classification results, form a subset of target data and retain it.

[0176] In this embodiment, the central server assembles the model parameters from the target classification results into a target data subset and retains the target data subset. The target data subset includes model parameters from different client models. The target data subset represents the model parameters of normal clients, while model parameters outside the target data subset represent model parameters with significantly different characteristics from those in the target data subset; these may be model parameters used by malicious clients to attack the global model.

[0177] In this embodiment, by selecting the classification result with a large number of model parameters from the classification results of the dataset as the target classification result, and then forming a target data subset from the model parameters in the target classification result and retaining it, the model parameters used by malicious clients to attack the global model can be initially discarded.

[0178] In one embodiment, such as Figure 6 As shown, after step 504, which involves forming and retaining a subset of target data based on the model parameters corresponding to the target classification results, the method further includes:

[0179] Step 602: Record the client sequence number of the model parameters in the target data subset.

[0180] In this embodiment of the application, the central server records the client serial number corresponding to the model parameters in the target data subset. This client serial number indicates that the corresponding client is a normal client.

[0181] Step 604: Eliminate model parameters from other classification results.

[0182] In this embodiment, the central server uses classification results other than the target classification result as model parameters for the malicious client for elimination.

[0183] In this embodiment, by eliminating model parameters other than the target classification result, the model parameters used by malicious clients to attack the global model can be initially eliminated.

[0184] In one embodiment, such as Figure 7 As shown, step 206 determines the important model parameters in the model parameters based on the frequency of model parameters being retained in the target data subset, including:

[0185] Step 702: Determine the frequency of model parameters being retained in the target data subset based on the number of times the model parameters are retained and the number of times the model parameters are randomly sampled to form multiple datasets.

[0186] In this embodiment, the central server further filters the retained target data subset to determine the important model parameters within it. Specifically, the central server calculates the ratio of the number of times a model parameter in the target data subset is retained to the number of times each model parameter constituting the target data subset is sampled to form multiple datasets, obtaining the frequency of model parameter retention in the target data subset. This frequency characterizes the importance of each retained model parameter and is used to determine the important model parameters in the target data subset.

[0187] Step 704: The model parameters in the target data subset whose retention frequency is higher than the retention threshold are retained as important model parameters.

[0188] In this embodiment, the central server filters important model parameters based on the frequency with which model parameters are retained in the target data subset. Ideally, important model data would be retained almost 100% of the time, while model parameters that might be associated with malicious clients would be retained almost 0% of the time. The central server can discard model parameters in the target data subset whose retention frequency is less than 10%, treating them as model parameters associated with malicious clients, and retain model parameters in the target data subset whose retention frequency is greater than 10%, treating them as important model parameters.

[0189] In this embodiment, by filtering the model parameters in the target data subset according to the frequency at which each model parameter is retained, and retaining the important model parameters in the target data subset, it is possible to further discard the model parameters used by malicious clients for attacks.

[0190] In one embodiment, such as Figure 8 As shown, step 208 preprocesses important model parameters to obtain target model parameters, and determines normal clients based on the clients corresponding to the target model parameters, including:

[0191] Step 802: Perform dimensionality reduction decomposition and cluster analysis on important model parameters, and determine the important model parameters contained in the cluster with the largest amount of data in the cluster results as the target model parameters.

[0192] In this embodiment, the central server can perform PCA dimensionality reduction decomposition on the important model parameters obtained after screening, project the high-dimensional model parameters into a low-dimensional space with the largest variance, and then perform cluster analysis on the dimensionality-reduced model parameters to obtain clustering results. The clustering result with the largest amount of model parameters in the clustering results is determined as the target model parameter, and the target model parameter is used for updating and training the global model of the central server.

[0193] Step 804: Identify the client corresponding to the client serial number of the target model parameters as a normal client.

[0194] In this embodiment, the central server identifies the client corresponding to the generated target model parameter client sequence number as a normal client. The model parameters of the normal client are used for global model update training.

[0195] In this embodiment, after performing PCA dimensionality reduction decomposition and cluster analysis on important model parameters by the central server, malicious clients with more covert characteristics can be further screened out. After three rounds of detection and screening of client model parameters, the clients corresponding to the remaining model parameters are regarded as normal clients, thereby realizing the defense against backdoor attacks by malicious clients in the data federated learning system.

[0196] This application also provides an example of a defense method for a federated learning system, such as... Figure 9 As shown, the specific steps include:

[0197] Step S1: Obtain the model parameters for each client model;

[0198] Step S2: For each dimension contained in the model parameters, random sampling is performed on the model parameters according to a preset random sampling strategy to obtain multiple datasets;

[0199] Step S3: Classify each dataset, determine the target classification result, and retain the target data subset corresponding to the target classification result in the dataset;

[0200] Step S4: Based on the frequency of model parameters being retained in the target data subset, determine the important model parameters among the model parameters;

[0201] Step S5: Preprocess the important model parameters to obtain the target model parameters, and determine the normal client based on the client corresponding to the target model parameters.

[0202] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0203] Based on the same inventive concept, this application also provides a federated learning system defense device for implementing the federated learning system defense method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more embodiments of the federated learning system defense device provided below can be found in the limitations of the federated learning system defense method described above, and will not be repeated here.

[0204] In one embodiment, such as Figure 10 As shown, a defense device for a federated learning system is provided, comprising: an acquisition module, a sampling module, a first determination module, and a second determination module, wherein:

[0205] The acquisition module is used to obtain the model parameters of each client model;

[0206] The sampling module is used to randomly sample the model parameters according to a preset random sampling strategy for each dimension contained in the model parameters, obtain multiple datasets, classify each dataset, determine the target classification result, and retain the target data subset corresponding to the target classification result in the dataset.

[0207] The first determining module is used to determine the important model parameters in the model parameters based on the frequency of model parameters being retained in the target data subset;

[0208] The second determination module is used to preprocess important model parameters to obtain target model parameters, and determine normal clients based on the clients corresponding to the target model parameters.

[0209] In one embodiment, the acquisition module is further configured to:

[0210] Send the initial model to each client;

[0211] Receive the model parameters returned by each client after the initial model training is completed.

[0212] In one embodiment, the sampling module is further configured to:

[0213] For each client corresponding to the model parameters in each dataset, generate a client sequence number corresponding to each model parameter in the dataset.

[0214] In one embodiment, the sampling module is specifically used for:

[0215] The binary classification model is used to classify each dataset in each dataset, and the classification result corresponding to each dataset is obtained.

[0216] The target classification result is determined from the classification results, and the model parameters corresponding to the target classification result are retained as a subset of the target data.

[0217] In one embodiment, the sampling module is specifically used for:

[0218] The classification result with a high proportion of model parameters in the classification results is identified as the target classification result.

[0219] Based on the model parameters corresponding to the target classification results, a subset of target data is formed and retained.

[0220] In one embodiment, the sampling module is specifically used for:

[0221] Record the client sequence number of the model parameters in the target data subset;

[0222] Eliminate model parameters from other classification results.

[0223] In one embodiment, the first determining module is specifically used for:

[0224] The frequency of model parameters being retained in the target data subset is determined by the number of times the model parameters are retained and the number of times the model parameters are randomly sampled to form multiple datasets.

[0225] Model parameters whose retention frequency is higher than the retention threshold in the target data subset are retained as important model parameters.

[0226] In one embodiment, the second determining module is specifically used for:

[0227] The important model parameters are decomposed by dimensionality reduction and cluster analysis. The important model parameters contained in the cluster with the largest amount of data in the cluster results are determined as the target model parameters.

[0228] The client corresponding to the client serial number of the target model parameters is identified as a normal client.

[0229] The modules in the aforementioned federated learning system defense device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.

[0230] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 11 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores model parameters. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a federated learning system defense method.

[0231] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0232] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0233] Obtain the model parameters for each client model;

[0234] For each dimension contained in the model parameters, the model parameters are randomly sampled according to a preset random sampling strategy to obtain multiple datasets. Each dataset is classified to determine the target classification result, and the target data subset corresponding to the target classification result in the dataset is retained.

[0235] Based on the frequency with which model parameters are retained in the target data subset, identify the important model parameters among the model parameters;

[0236] Important model parameters are preprocessed to obtain target model parameters, and normal clients are determined based on the clients corresponding to the target model parameters.

[0237] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0238] Send the initial model to each client;

[0239] Receive the model parameters returned by each client after the initial model training is completed.

[0240] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0241] For each client corresponding to the model parameters in each dataset, generate a client sequence number corresponding to each model parameter in the dataset.

[0242] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0243] The binary classification model is used to classify each dataset in each dataset, and the classification result corresponding to each dataset is obtained.

[0244] The target classification result is determined from the classification results, and the model parameters corresponding to the target classification result are retained as a subset of the target data.

[0245] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0246] The classification result with a high proportion of model parameters in the classification results is identified as the target classification result.

[0247] Based on the model parameters corresponding to the target classification results, a subset of target data is formed and retained.

[0248] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0249] Record the client sequence number of the model parameters in the target data subset;

[0250] Eliminate model parameters from other classification results.

[0251] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0252] The frequency of model parameters being retained in the target data subset is determined by the number of times the model parameters are retained and the number of times the model parameters are randomly sampled to form multiple datasets.

[0253] Model parameters whose retention frequency is higher than the retention threshold in the target data subset are retained as important model parameters.

[0254] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0255] The important model parameters are decomposed by dimensionality reduction and cluster analysis. The important model parameters contained in the cluster with the largest amount of data in the cluster results are determined as the target model parameters.

[0256] The client corresponding to the client serial number of the target model parameters is identified as a normal client.

[0257] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0258] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0259] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0260] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0261] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0262] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A defense method for a federated learning system, characterized in that, The method includes: Obtain the model parameters for each client model; For each dimension included in the model parameters, the model parameters are randomly sampled according to a preset random sampling strategy to obtain multiple datasets; each dataset in each dataset is classified according to a binary classification model to obtain a classification result corresponding to each dataset; the classification results are filtered according to a preset filtering strategy, and the classification results with a high proportion of the number of model parameters in the classification results are determined as the target classification results; a target data subset is formed and retained according to the model parameters corresponding to the target classification results; the target classification results represent the classification results composed of model parameters of normal clients; Based on the number of times the model parameters in the target data subset are retained and the number of times the model parameters are randomly sampled to form the multiple datasets, the retention frequency of the model parameters in the target data subset is determined; model parameters in the target data subset with a retention frequency of less than 10% are discarded as model parameters of malicious clients, and model parameters in the target data subset with a retention frequency of more than 10% are retained as important model parameters; The important model parameters are preprocessed to obtain target model parameters, and normal clients are determined based on the clients corresponding to the target model parameters. The preprocessing includes: performing dimensionality reduction decomposition on the important model parameters, and performing cluster analysis on the dimensionality-reduced model parameters to determine the target model parameters.

2. The method according to claim 1, characterized in that, Before obtaining the model parameters of each client model, the method further includes: Send the initial model to each client; Receive the model parameters returned by each client after the initial model training is completed.

3. The method according to claim 1, characterized in that, After randomly sampling the model parameters according to a preset random sampling strategy for each dimension included in the model parameters to obtain multiple datasets, the method further includes: For each client corresponding to a model parameter in the dataset, generate a client serial number corresponding to each model parameter in the dataset.

4. The method according to claim 1, characterized in that, After forming and retaining the target data subset based on the model parameters corresponding to the target classification result, the method further includes: Record the client sequence number of the model parameters in the target data subset; Eliminate the model parameters from other classification results.

5. The method according to claim 1, characterized in that, The process of preprocessing the important model parameters to obtain target model parameters, and determining normal clients based on the clients corresponding to the target model parameters, includes: The important model parameters are decomposed by dimensionality reduction and cluster analysis. The important model parameters contained in the cluster with the largest amount of data in the cluster results are determined as the target model parameters. The client corresponding to the client serial number of the target model parameters is identified as a normal client.

6. A defense device for a federated learning system, characterized in that, The device includes: The module retrieves model parameters used to obtain models from each client model; The sampling module is used to randomly sample the model parameters according to a preset random sampling strategy for each dimension contained in the model parameters, thereby obtaining multiple datasets; classify each dataset in each dataset according to a binary classification model, thereby obtaining a classification result corresponding to each dataset; filter the classification results according to a preset filtering strategy, and determine the classification result with a high proportion of the number of model parameters in the classification results as the target classification result; form a target data subset according to the model parameters corresponding to the target classification result and retain it; the target classification result represents the classification result composed of model parameters of a normal client. The first determining module is used to determine the frequency of model parameters being retained in the target data subset based on the number of times the model parameters in the target data subset are retained and the number of times the model parameters are randomly sampled to form the multiple datasets; model parameters in the target data subset whose retention frequency is less than 10% are discarded as model parameters of malicious clients, and model parameters in the target data subset whose retention frequency is greater than 10% are retained as important model parameters; The second determining module is used to preprocess the important model parameters to obtain target model parameters, and determine normal clients based on the clients corresponding to the target model parameters; the preprocessing includes: performing dimensionality reduction decomposition on the important model parameters, and performing cluster analysis on the dimensionality-reduced model parameters to determine the target model parameters.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Federated learning defense method and device, computer equipment and computer storage medium

    CN113962402A