Heterogeneous federated learning-based model anti-poisoning attack method, medium and equipment

By employing heterogeneous federated learning, recoverability analysis and frequency domain feature similarity calculation are performed, solving the problem of distinguishing strategic malicious model updates in existing technologies and achieving efficient security protection for federated learning systems.

CN121418149APending Publication Date: 2026-01-27XIAMEN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511539398.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2026-01-27

AI Technical Summary

Technical Problem

Existing defense methods struggle to effectively distinguish between strategically malicious model updates and benign but unique client updates, resulting in low detection accuracy for model poisoning attacks. Furthermore, the stealth of adaptive attacks increases the difficulty of detection.

Method used

By adopting a heterogeneous federated learning approach, the system receives client model update data, performs recoverability analysis, generates proxy datasets and simulates training, calculates similarity, clusters into temporary benign candidate groups and potential malicious groups, generates frequency domain prototypes, calculates frequency domain feature similarity, and selects the final benign update datasets for aggregation.

Benefits of technology

It effectively overcomes interference from data heterogeneity, accurately identifies and filters strategic poisoning attacks, and significantly improves the robustness and security of federated learning systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121418149A_ABST
    Figure CN121418149A_ABST
Patent Text Reader

Abstract

The invention discloses a model anti-poisoning attack method based on heterogeneous federal learning, a medium and equipment, and the method comprises the steps: carrying out the recoverability analysis of received client model updating data, synthesizing an agent data set, and carrying out the simulation training, and calculating the similarity between the original model update data and the simulation model update data as a recoverability score. Dividing a temporary benign candidate group and a potential malicious group based on recoverability score clustering, and respectively generating a benign frequency domain prototype and a malicious frequency domain prototype; for each model update data, the similarity between the frequency domain features thereof and the two prototypes is calculated to obtain a normal form score. And finally, synthesizing the recoverability score and the normal form score, screening out a final benign update data set from all updates, and carrying out aggregation to generate an updated global model. According to the method, interference caused by data isomerism is effectively overcome, strategic poisoning attacks can be accurately recognized and filtered, and the robustness and safety of a federated learning system are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence security, specifically to a method, medium, and device for preventing poisoning attacks based on heterogeneous federated learning. Background Technology

[0002] Federated learning, as a distributed machine learning paradigm that protects data privacy, allows numerous clients to collaboratively train a global model without sharing their local private data. However, this open and distributed nature also makes it vulnerable to model poisoning attacks. In a model poisoning attack, a malicious client uploads carefully crafted malicious model updates to a central server to compromise the integrity of the global model, degrade its performance, or implant backdoors.

[0003] Existing defense methods face two main challenges when facing strategic poisoning attacks:

[0004] (1) Misjudgment problem caused by data heterogeneity: In the real world, client data is usually non-independent and identically distributed, which makes the model updates from different benign clients inherently significantly different. This inherent and natural difference seriously interferes with traditional defense mechanisms based on update similarity or statistical outlier detection. They have difficulty drawing a clear line between benign data distribution differences and malicious adversarial perturbations, and often misjudge benign clients with unique data distributions as malicious clients and remove them, i.e., producing a high "false positive rate". This not only undermines the fairness of federated learning, but also slows down the convergence speed of the global model.

[0005] (2) The concealment problem of adaptive attacks: In order to avoid detection, attackers will adopt strategic means to disguise their malicious updates as benign updates in terms of numerical size and direction. This high degree of concealment makes it difficult to capture the inherent malicious nature by analyzing only the original numerical space of the model update, resulting in a high "false negative rate" for carefully disguised malicious updates.

[0006] At its root, most existing defense methods are based on idealized assumptions such as independent and identically distributed data or easily identifiable attacks. Their detection dimensions are limited, making them unable to fundamentally address the complex and realistic strategic attacks mentioned above. Therefore, there is an urgent need for a robust defense method that can adapt to data heterogeneity and reveal malicious behavior from deeper characteristics, effectively ensuring the security of federated learning systems without excessively sacrificing benign clients. Summary of the Invention

[0007] In view of the above problems, the present invention provides a method, medium and device for preventing model poisoning attacks based on heterogeneous federated learning, which solves the problem that existing defense methods are unable to effectively distinguish between strategic malicious model updates and benign but unique client updates, resulting in low detection accuracy of model poisoning attacks.

[0008] To achieve the above objectives, in a first aspect, this application provides a method for preventing poisoning attacks based on heterogeneous federated learning, applicable to the server side, the method comprising the following steps:

[0009] S1: Receive model update data from multiple clients, the model update data including model parameters or model parameter differences obtained after local training on the client;

[0010] S2: Perform a recoverability analysis on each model update data to obtain a corresponding recoverability score. The recoverability analysis includes: synthesizing a proxy dataset based on the current model update data, performing simulated training using the proxy dataset to obtain simulated model update data, and calculating the similarity between the simulated model update data and the simulated model update data; S3: Based on the recoverability scores of all model update data, divide the corresponding clients into temporary benign candidate groups and potential malicious groups using a clustering algorithm, and generate benign frequency domain prototypes and malicious frequency domain prototypes based on the model update data in the temporary benign candidate groups and the potential malicious groups, respectively;

[0011] S4: For each model update data, based on its corresponding frequency domain features, calculate the similarity between the frequency domain features and the benign frequency domain prototype and the malicious frequency domain prototype respectively, so as to generate the corresponding paradigm score.

[0012] S5: Based on the recoverability score and the paradigm score of each model update data, select the final benign update dataset from all model update data; S6: Aggregate the model update data in the final benign update dataset to generate an updated global model.

[0013] Furthermore, the step of synthesizing a proxy dataset based on the current model update data is achieved by solving an optimization problem, specifically including: Constructing a convex optimization problem for synthesizing the proxy dataset based on the current model update data. The objective function of the convex optimization problem is configured to minimize the difference between the simulated model update data generated by the simulated training using the proxy dataset and the current model update data. The objective function is as follows:

[0014] ;

[0015] ;

[0016] in, Representing the A proxy dataset for each user, For the first The set of clients participating in training within a communication cycle. for The set of clients that carry out poisoning attacks. For the first A global model for each communication cycle. For function exist gradient at, For the first The client in the first Model update per communication cycle, Denotes the F-norm of a matrix;

[0017] Solve the convex optimization problem to obtain the synthesized proxy dataset.

[0018] Furthermore, simulation training is performed using the aforementioned proxy dataset to obtain simulation model update data, including:

[0019] The generation of the simulated model update data is defined as the optimal objective value of a constrained optimization problem. This constrained optimization problem aims to quantify the difference between the original model update data and the update reconstructed through simulated training on the proxy dataset. The constrained optimization problem is expressed as follows:

[0020] ;

[0021] in, For recoverability scoring, This function represents the client's simulation of the local training process. To simulate the number of steps during local training on the client, Let KL divergence be the KL divergence. To preset the error threshold, To simulate the learning rate during local training on the client side, This simulates the model obtained after local training for the client.

[0022] The constrained optimization problem is transformed into an optimization form with a penalty term and solved. The obtained optimal solution is used as the update data for the simulation model.

[0023] Furthermore, the mean frequency domain features of all model update data in the temporary benign candidate group and the potential malicious group are calculated respectively to generate benign frequency domain prototypes and malicious frequency domain prototypes. This includes using discrete wavelet transform to convert each model update data to the frequency domain and extracting its low-frequency component representation as frequency domain features.

[0024] The benign frequency domain prototype is generated by calculating the geometric median of the frequency domain features of all model update data in the temporary benign candidate group, using the following formula: ;

[0025] in, The geometric median of the frequency domain features of all model update data in the temporary benign candidate group. and Representing the model respectively and Frequency domain characteristics after discrete wavelet transform.

[0026] The malicious frequency domain prototype is generated by selecting the K models with the highest recoverability scores from the potential malicious group and updating the data using the arithmetic mean of their frequency domain features.

[0027] Furthermore, in step S4, the formula for calculating the similarity between the frequency domain features of the model update data and the benign frequency domain prototype is as follows:

[0028] ;

[0029] in, for arrive The distance between sets.

[0030] The formula for calculating the similarity between the frequency domain features of the model update data and the malicious frequency domain prototype is as follows:

[0031] ;

[0032] in, for arrive The distance between sets;

[0033] The paradigm score is calculated using the following formula:

[0034] ;

[0035] in, It is a balance parameter. and It is a normalized similarity score.

[0036] Furthermore, step S5 includes:

[0037] S51: For each model update data, calculate a comprehensive trust score based on its recoverability score and paradigm score; S52: Compare the comprehensive trust score with a preset score threshold, and select model update data with a comprehensive trust score higher than the preset score threshold to form the final benign update dataset;

[0038] The calculation formula for step S6 is as follows:

[0039] ;

[0040] in, To eventually update the dataset in a positive way.

[0041] Furthermore, after step S6, an attack strategy adaptive prediction and dynamic adjustment loop is executed, specifically including:

[0042] By aggregating the client identifiers classified into the potential malicious group in the current round and historical rounds, the recoverability score, paradigm score, frequency domain features, and deviation from the malicious frequency domain prototype corresponding to the model update data uploaded by the client, a historical attack behavior sequence is formed.

[0043] Based on the historical attack behavior sequence, time series analysis algorithms are used to extract the evolutionary pattern of the attack behavior in time series. The evolutionary pattern includes the attacker's participation round pattern, the trend of attack intensity change, and the offset direction of attack frequency domain features.

[0044] Based on the aforementioned evolutionary pattern, the attack strategy changes that may occur in the next round of federated learning are predicted, and the attack prediction results are obtained. The attack prediction results include the prediction of the frequency domain feature shift direction, the prediction of the trend of the abnormality of recoverability score, and the prediction of the temporal correlation of attack behavior.

[0045] Based on the attack prediction results, a parameter adjustment strategy is generated and applied to the detection process in the next round of federated learning. The parameter adjustment strategy includes:

[0046] If the attack intensity is predicted to increase, the learning rate in the simulation training process of the proxy dataset is reduced or the perturbation intensity is increased to generate more robust proxy data, thereby improving the sensitivity of recoverability analysis; if the attack intensity is predicted to decrease, the proxy data generation strategy is optimized to make it closer to the data points of the current global model decision boundary.

[0047] If the frequency domain characteristics of the predicted attack will shift, the frequency band weights used to calculate the benign and malicious frequency domain prototypes will be dynamically adjusted.

[0048] Furthermore, step S5 includes:

[0049] During the federated learning initialization phase or after a preset number of rounds, based on the model update data uploaded by each client, its historical data distribution characteristics are extracted. The historical data distribution characteristics are characterized by at least one of the following methods: the statistical characteristics of the client's historical model update data, the cosine similarity or Euclidean distance between the client's model update data and the global model parameters at the same time, and the category distribution entropy of the proxy dataset reconstructed through its model update data.

[0050] Unsupervised clustering algorithm is used to cluster all clients based on their historical data distribution characteristics, and clients with similar historical data distribution characteristics are divided into the same heterogeneous group;

[0051] Based on the recoverability score and paradigm score of all clients in the current round, calculate the global initial recoverability score threshold. and initial paradigm scoring threshold ;

[0052] Calculate each heterogeneous group Data distribution heterogeneity The heterogeneity is quantified by calculating the average distance between the historical data distribution characteristics of clients within the heterogeneous group and the global feature center;

[0053] Based on heterogeneity Generate various heterogeneous groups Personalized thresholds, including personalized thresholds for recoverability scores. Personalized threshold for paradigm scoring The calculation formula is as follows:

[0054] ;

[0055] ;

[0056] in, and An adjustment factor greater than zero;

[0057] For those belonging to the heterogeneous group The client, which scores the recoverability of its model update data. And Paradigm Scoring Each of these threshold values ​​corresponds to a personalized recoverability score threshold for the heterogeneous group. Personalized threshold for paradigm scoring Comparison:

[0058] Only when and Only then are the client's model update data included in the final benign update dataset.

[0059] In a second aspect, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the model-based poisoning attack prevention method based on heterogeneous federated learning as described in the first aspect of this application.

[0060] In a third aspect, this application provides an electronic device having a computer program stored thereon, including a processor and a storage medium, wherein the computer program is stored on the storage medium, and when executed by the processor, the computer program implements the model-based poisoning attack prevention method based on heterogeneous federated learning as described in the first aspect of this application.

[0061] Unlike existing technologies, the above technical solution provides a method, medium, and device for preventing model poisoning attacks based on heterogeneous federated learning. The method includes: performing recoverability analysis on received client model update data; synthesizing a proxy dataset and simulating training; and calculating the similarity between the original model update data and the simulated model update data as a recoverability score. Then, based on the recoverability score, clustering is performed to divide temporary benign candidate groups and potential malicious groups, generating benign frequency domain prototypes and malicious frequency domain prototypes respectively. For each model update data, the similarity between its frequency domain features and the two prototypes is calculated to obtain a paradigm score. Finally, by combining the recoverability score and the paradigm score, the final benign update dataset is selected from all updates and aggregated to generate an updated global model. This invention effectively overcomes the interference caused by data heterogeneity, accurately identifies and filters strategic poisoning attacks, and significantly improves the robustness and security of the federated learning system.

[0062] The above description of the invention is merely an overview of the technical solution of the present invention. In order to enable those skilled in the art to better understand the technical solution of the present invention and to implement it based on the description and drawings, and to make the above-mentioned objectives and other objectives, features and advantages of the present invention easier to understand, the following description is provided in conjunction with the specific embodiments and drawings of the present invention. Attached Figure Description

[0063] The accompanying drawings are only used to illustrate the principles, implementation methods, applications, features, and effects of specific embodiments of the present invention and other related contents, and should not be considered as limitations on the present invention.

[0064] In the accompanying drawings of the instruction manual:

[0065] Figure 1 This is a first flowchart of the model-based poisoning attack prevention method based on heterogeneous federated learning involved in the specific implementation;

[0066] Figure 2 This is the second flowchart of the model-based poisoning attack prevention method based on heterogeneous federated learning involved in the specific implementation;

[0067] Figure 3 This is the third flowchart of the model-based poisoning attack prevention method based on heterogeneous federated learning involved in the specific implementation method;

[0068] Figure 4 A schematic diagram of the modules of the electronic device described in a specific embodiment;

[0069] The reference numerals used in the above figures are explained as follows:

[0070] 10. Electronic devices;

[0071] 101. Processor;

[0072] 102. Storage medium. Detailed Implementation

[0073] To illustrate the possible application scenarios, technical principles, implementable specific solutions, and achievable objectives and effects of this invention in detail, the following description, in conjunction with the listed specific embodiments and accompanying drawings, provides a detailed explanation. The embodiments described herein are merely illustrative of the technical solutions of this invention and are therefore intended only as examples, not as limiting the scope of protection of this invention.

[0074] In this document, the term "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The term "embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment, nor does it specifically limit its independence or connection with other embodiments. In principle, in this invention, as long as there are no technical contradictions or conflicts, the technical features mentioned in each embodiment can be combined in any way to form corresponding implementable technical solutions.

[0075] Unless otherwise defined, the technical terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains; the use of related terms herein is merely for the purpose of describing particular embodiments and is not intended to limit the invention.

[0076] In the description of this invention, the term "and / or" is used to describe the logical relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A exists, B exists, and A and B exist simultaneously. Additionally, the character " / " generally indicates that the preceding and following objects have an "or" logical relationship.

[0077] In this invention, terms such as “first” and “second” are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any actual quantity, hierarchy, or order between these entities or operations.

[0078] Without further limitations, the use of terms such as “comprising,” “including,” “having,” or other similar expressions in this invention is intended to cover non-exclusive inclusion, which does not exclude the presence of additional elements in a process, method, or product that includes the stated elements, such that a process, method, or product that includes a list of elements may include not only those defined elements but also other elements not expressly listed, or elements inherent to such a process, method, or product.

[0079] In this invention, expressions such as "greater than", "less than", and "exceeding" are understood to exclude the stated number; expressions such as "above", "below", and "within" are understood to include the stated number. Furthermore, in the description of the embodiments of this invention, "multiple" means two or more (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups" and "multiple times", unless otherwise explicitly specified.

[0080] In the description of the embodiments of the present invention, the spatial related expressions used, such as "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "vertical," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," "circumferential," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the specific embodiments or drawings. They are only for the purpose of describing the specific embodiments of the present invention or for the reader's understanding, and do not indicate or imply that the device or component referred to must have a specific position, a specific orientation, or be constructed or operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of the present invention.

[0081] Unless otherwise explicitly stated or limited, the terms "installation," "connection," "linking," "fixing," and "setting," as used in the description of the embodiments of this invention, should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral arrangement; it can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal connection of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of this invention according to the specific circumstances.

[0082] In the first aspect, such as Figure 1As shown, this application provides a model poisoning attack prevention method based on heterogeneous federated learning, which is applicable to the server side. The server side is the central server in the federated learning system, which is responsible for core operations such as client sampling, global model broadcasting, model update data reception, detection and aggregation, and global model update. It is the main body for executing this defense method, which is different from the client side that holds local private data and only performs local training.

[0083] The method includes the following steps:

[0084] S1: Receive model update data from multiple clients;

[0085] S2: Perform a recoverability analysis on each model update data to obtain a corresponding recoverability score. The recoverability analysis includes: synthesizing a proxy dataset based on the current model update data, performing simulated training using the proxy dataset to obtain simulated model update data, and calculating the similarity between the simulated model update data and the simulated model update data; S3: Based on the recoverability scores of all model update data, divide the corresponding clients into temporary benign candidate groups and potential malicious groups using a clustering algorithm, and generate benign frequency domain prototypes and malicious frequency domain prototypes based on the model update data in the temporary benign candidate groups and the potential malicious groups, respectively;

[0086] S4: For each model update data, based on its corresponding frequency domain features, calculate the similarity between the frequency domain features and the benign frequency domain prototype and the malicious frequency domain prototype respectively, so as to generate the corresponding paradigm score.

[0087] S5: Based on the recoverability score and the paradigm score of each model update data, select the final benign update dataset from all model update data; S6: Aggregate the model update data in the final benign update dataset to generate an updated global model.

[0088] In step S1, the model update data includes model parameters or model parameter differences obtained after local training on the client. The changes in model parameters obtained after the client performs several steps of stochastic gradient descent (SGD) training on its local dataset based on the global model broadcast by the server can be represented as the difference between the final model parameters after local training and the initial global model parameters. This can also be directly represented as the local model parameters after training. It is the core data that the client uploads to the server and is also a key object for detecting malicious attacks.

[0089] In each round of federated learning, the server first randomly samples a subset of clients. The global model for the current round Broadcast to all clients within that subset; clients receive After that, with As the initial model, on a local private dataset Perform E-step stochastic gradient descent training (update formula is as follows) ,in For learning rate, (For local stochastic gradients), we obtain the trained local model. And calculate model update data. Then Uploaded to the server. The server receives all uploaded data from the sampled clients in this round. This forms the model update dataset to be tested. This provides a data foundation for subsequent testing.

[0090] In step S2, the recoverability score is an indicator that quantifies the similarity between "the original model update data uploaded by the client" and "the simulated model update data obtained by simulating local training based on the proxy dataset synthesized by the server". The lower the score, the more the original update conforms to the normal training trajectory (high probability of benign), and the higher the score, the more the original update deviates from the normal trajectory (high probability of malicious). It is the core single-dimensional indicator for distinguishing between benign and malicious updates.

[0091] Benign updates originate from the optimization process of real local data, and their update trajectory conforms to the normal training pattern. They can be simulated and restored using proxy datasets synthesized on the server side. Malicious updates are adversarial perturbations constructed by attackers, which deviate from the normal training trajectory and are difficult to simulate and restore using proxy datasets. Based on this difference, a preliminary distinction can be made.

[0092] In step S3, the clustering algorithm refers to the k-means unsupervised learning algorithm that divides clients into two classes based on the recoverability scores of all model update data. Its core is to group similar score data into one class by minimizing the sum of squared errors of data within the class, and finally output temporary benign candidate groups (clusters with lower recoverability scores) and potential malicious groups (clusters with higher recoverability scores).

[0093] Frequency domain prototypes refer to representative features generated based on frequency domain features from model update data. They are divided into benign frequency domain prototypes and malicious frequency domain prototypes. A benign frequency domain prototype is the geometric median of all updated frequency domain features within a temporary benign candidate group (more robust than the mean, reducing outlier interference). A malicious frequency domain prototype is the set of the K updated frequency domain features with the highest recoverability scores within a potentially malicious group. Both serve as the reference standard for subsequent calculation of frequency domain similarity.

[0094] Specifically, the k-means clustering algorithm is used for all recoverability score Clustering is performed (k=2), due to benign updates Generally low, malicious updates Generally high scores result in two natural clustering categories: clients corresponding to clusters with lower scores are categorized as "temporary benign candidate groups" (denoted as...). The clients corresponding to the higher-scoring clusters are classified into the "potentially malicious group" (denoted as...). The steps outlined here represent an initial screening process, and a small number of malicious updates disguised as benign updates may have infiltrated the system. This could be due to data heterogeneity causing some beneficial updates to fall into [a certain category]. Further optimization is needed.

[0095] In step S4, frequency domain features refer to the features extracted after the model update data (parameter vector) is transformed from the parameter space to the frequency domain space through discrete wavelet transform. The focus is on low-frequency components (approximation coefficients). The low-frequency components of benign updates have a common structure that reflects the global training trend, while the low-frequency components of malicious updates will be abnormal due to adversarial perturbations. They are the key features for revealing deep differences in the parameter space that are difficult to detect.

[0096] right and Each of them The discrete wavelet transform is used to convert it to the frequency domain. Since the low-frequency features of the wavelet transform reflect the global common structure of the model update and are key to distinguishing between benign and malicious behavior, only the low-frequency features are extracted. The frequency domain characteristics.

[0097] Paradigm score is a quantitative indicator calculated by weighting the similarity between the fusion model update and the benign frequency domain prototype, and the similarity between the model update and the malicious frequency domain prototype. A higher score indicates a greater probability that the update conforms to a benign pattern.

[0098] In step S5, by fusing two complementary indicators, "recoverability score (reflecting the rationality of update trajectories within a client)" and "paradigm score (reflecting the consistency of update patterns between clients)," misjudgments based on a single indicator are avoided. For example, a benign update may have a slightly higher recoverability score due to data heterogeneity (potentially falling into a potentially malicious group), but frequency domain similarity analysis reveals that it is highly similar to a benign prototype (high paradigm score), and it can be reclassified as benign. Conversely, a malicious update may disguise itself as benign (low recoverability score), but its frequency domain characteristics are close to those of a malicious prototype (low paradigm score), and it can be identified as malicious.

[0099] In step S6, only the final benign update dataset is used. Updates are aggregated to eliminate malicious updates from the source from interfering with the global model. Specifically, the new global model is calculated according to the formula below:

[0100] ;

[0101] in, This is the aggregation weight coefficient, which is usually set to a value of [value missing]. , Represents a set (size in the middle); after the calculation is completed, the server enters the next round of federated learning cycle, and will As a new global model broadcast to the client for the next round of sampling, repeat steps S1-S6 until the global model converges or reaches the preset training rounds.

[0102] In this application, the federated learning system includes one central server. Each client holds a local private dataset. The system uses the FedAvg algorithm as its training framework, and the global model optimization objective function is: ,in, , For client weight, The objective function is local to the client. The training process for each round is as follows: client sampling, global modeling... Broadcast and local client training.

[0103] The aforementioned method targets strategic model poisoning attacks with three core characteristics: First, data heterogeneity, where client datasets exhibit heterogeneous (non-IID) distributions, manifested as heterogeneous class distributions (e.g., client 1 primarily uses class A data, while client 2 primarily uses class B data) or heterogeneous feature distributions (significant differences in data mean and variance), allowing benign updates to mask malicious updates; second, malicious clients constitute the majority, with a certain number of clients sampled in a particular round. In the middle, malicious clients accounted for over 50%, rendering traditional defenses such as "majority voting" and "statistical anomaly detection" ineffective; thirdly, attackers possess complete knowledge and strategy, understanding the federated learning training parameters (learning rate). Training steps The detection logic of this defense method can be evaded by "intermittent attacks" (launching attacks in multiple rounds at intervals) and "parameter space camouflage" (making malicious parameter updates appear benign). Malicious updates include two types: "performance-destructive" (reducing the accuracy of the global model) and "backdoor implantation" (implanting specific triggers to make the model output incorrect results for inputs containing triggers).

[0104] The above scheme simulates the training effect of heterogeneous data by "synthesizing proxy datasets" and captures the common patterns of heterogeneous benign updates by "frequency domain feature analysis". Even if the client data distribution is significantly different, it can accurately distinguish the natural differences of benign updates from the adversarial perturbations of malicious updates, effectively avoiding "collateral damage" to benign updates.

[0105] For scenarios where malicious clients dominate, this method abandons "majority voting" or "statistical anomaly detection" and relies on a composite index of "recoverability + frequency domain similarity" to identify malice from two dimensions: the "internal trajectory rationality" and the "external pattern consistency" of updates. Even if malicious updates are numerous, a few benign updates can be screened out and aggregated based on feature differences, ensuring that the global model is not dominated by malice. At the same time, in the first stage, recoverability scoring quickly eliminates obvious malicious updates, reducing the amount of subsequent computation; in the second stage, frequency domain similarity and paradigm scoring are used to correct the initial screening error, minimizing "false positives" and "false negatives," and ensuring the convergence speed and generalization ability of the global model.

[0106] Furthermore, all detection and aggregation operations are performed on the server side. The client does not need to modify the local training logic, but only uploads the model update data according to the original process. There is no additional computational burden or data transmission volume, which makes it easy to be compatible with existing federated learning systems and has low deployment costs.

[0107] In some embodiments, the step of synthesizing a proxy dataset based on the current model update data is achieved by solving an optimization problem, specifically including: constructing a convex optimization problem for synthesizing the proxy dataset based on the current model update data, wherein the objective function of the convex optimization problem is configured to minimize the difference between the simulated model update data generated by the simulated training of the proxy dataset and the current model update data, wherein the objective function is as follows:

[0108] ;

[0109] ;

[0110] in, Representing the A proxy dataset for each user, For the first The set of clients participating in training within a communication cycle. for The set of clients that carry out poisoning attacks. For the first A global model for each communication cycle. For function exist gradient at, For the first The client in the first Model update data for each communication cycle. Denotes the F-norm of a matrix;

[0111] Solve the convex optimization problem to obtain the synthesized proxy dataset.

[0112] In this embodiment, a convex optimization problem refers to an optimization problem in which the objective function is a convex function and the feasible region formed by the constraints is a convex set. It can be solved efficiently by mature algorithms such as gradient descent and interior point method. Convex optimization problems are used to ensure that the synthesis process of the proxy dataset is stable, reproducible, and can obtain the optimal solution.

[0113] The objective function is the function that needs to be minimized (or maximized) in a convex optimization problem. In this application, the objective function is used to quantify the difference between the "simulated training effect of the proxy dataset" and the "update of the original model on the client". The smaller the difference, the more the proxy dataset can approximate the training characteristics of the client's real local data. It is the core evaluation criterion for synthesizing proxy datasets.

[0114] The simulated model update data is based on a server-synthesized proxy dataset. It simulates the client-side local training process (with the same initial model, training steps, and optimizer) to obtain the model update results, denoted as... , indicating the model parameters Find the gradient.

[0115] The current model update data is the original model update uploaded by the client. It serves as a reference standard for synthesizing proxy datasets. The core objective of synthesis is to make the simulated updates generated by the proxy datasets as close as possible to reality. This makes subsequent recoverability analysis based on the proxy dataset effective.

[0116] In this embodiment, since the local training of the client in federated learning is essentially to minimize the local loss function through gradient descent, the model update... Essentially, it's the cumulative effect of multi-step gradient descent; therefore, the core of surrogate dataset synthesis is to make its generated gradients and... Alignment. Considering the approximation between single-step gradient and multi-step update, this application selects "single-step gradient of the proxy dataset" as a substitute for simulated update, and the objective function is set to minimize the difference between this single-step gradient and the original... The square of the Euclidean distance.

[0117] Due to the proxy dataset Since it is a discrete set of samples, directly solving the optimization problem on it is quite difficult. Therefore, the "gradient inversion technique" is used to transform it into a continuous optimization of "sample features", that is, for each sample... Using the feature vectors as optimization variables, the sample features are iteratively updated through gradient descent, allowing the simulated model to gradually approximate the updated data. .

[0118] Due to the global model in the federated learning process The proxy dataset will be updated with each iteration, and the client's local training trajectory will also change accordingly. Using the same proxy dataset for an extended period can lead to a decrease in the accuracy of recoverability analysis. Therefore, the proxy dataset needs to be updated periodically. The specific steps are as follows: Set the update period. (For example, updating every 5 rounds), in non-update rounds, the server directly uses the previously synthesized proxy dataset for recoverability analysis; in update rounds, the server uses the dataset uploaded by the client in the current round. Then, the above convex optimization problem solving process is re-executed to generate a new proxy dataset, ensuring that the proxy dataset is compatible with the current global model and client training state.

[0119] The above scheme uses convex optimization and gradient inversion techniques to update the model on the server side based solely on the model uploaded by the client. This allows for the synthesis of proxy datasets without requiring clients to share local private data, thus avoiding data leakage risks. The objective function of the convex optimization problem directly relates to the difference between the simulated update and the original update, and convexity ensures that the solution is globally optimal. This allows the synthesized proxy dataset to approximate the training effect of the client's real local data to the greatest extent possible, providing a solid foundation for the accuracy of subsequent recoverability scoring. Specifically, if... For a benign update, simulated training based on this proxy dataset can highly reproduce the original update; if For malicious updates, simulated training struggles to reproduce the original update, thus achieving effective differentiation. Convex optimization problems can be solved using mature algorithms such as gradient descent, with controllable computational complexity, avoiding excessive computational burden on the server. Furthermore, the global optimum avoids the problem of proxy dataset failure caused by local optima, ensuring the stability of each round of recoverability analysis.

[0120] In some embodiments, using the proxy dataset for simulation training to obtain simulation model update data includes:

[0121] The generation of the simulated model update data is defined as the optimal objective value of a constrained optimization problem. This constrained optimization problem aims to quantify the difference between the original model update data and the update reconstructed through simulated training on the proxy dataset. The constrained optimization problem is expressed as follows:

[0122] ;

[0123] in, For recoverability scoring, This function represents the client's simulation of the local training process. To simulate the number of steps during local training on the client, Let KL divergence be the KL divergence. To preset the error threshold, To simulate the learning rate during local training on the client side, This simulates the model obtained after local training for the client.

[0124] The constrained optimization problem is transformed into an optimization form with a penalty term and solved. The obtained optimal solution is used as the update data for the simulation model.

[0125] The recoverability scoring mechanism described above combines high accuracy, strong feasibility, and resistance to strategic attacks. Regarding scoring accuracy, a dual mechanism of "difference quantization + distribution constraints" is constructed through a constrained optimization problem. Difference quantization accurately reflects the fit between the original update and the normal training trajectory, while distribution constraints prevent scoring distortion caused by distribution drift in the proxy dataset. Compared to unconstrained difference quantization methods, it can more clearly distinguish between benign and malicious updates. Regarding solution feasibility, constrained optimization is transformed into unconstrained optimization with a penalty term, significantly reducing solution complexity. It can be efficiently solved using nested optimization loops, and the dynamic adjustment mechanism of the penalty coefficient balances the objective function and constraints, ensuring a stable solution process and preventing "no solution" or "distorted solution" problems. Regarding adaptation to strategic attacks, facing attackers' evasion techniques such as "intermittent attacks" and "faking benign updates," the core of recoverability scoring lies in "simulating the consistency of the training trajectory." Even if the attack update is disguised as benign in the parameter space, its deviation from normal logic in the training trajectory is difficult to reconstruct using the proxy dataset, thus ensuring the recoverability score... It will still be significantly higher than benign updates, thus effectively identifying various strategic attacks.

[0126] In some embodiments, the mean frequency domain features of all model update data in the temporary benign candidate group and the potential malicious group are calculated respectively to generate benign frequency domain prototypes and malicious frequency domain prototypes. This includes using discrete wavelet transform to convert each model update data to the frequency domain and extracting its low-frequency component representation as frequency domain features.

[0127] The benign frequency domain prototype is generated by calculating the geometric median of the frequency domain features of all model update data in the temporary benign candidate group, using the following formula: ;

[0128] in, The geometric median of the frequency domain features of all model update data in the temporary benign candidate group. and Representing the model respectively and Frequency domain characteristics after discrete wavelet transform.

[0129] The malicious frequency domain prototype is generated by selecting the K models with the highest recoverability scores from the potential malicious group and updating the data using the arithmetic mean of their frequency domain features.

[0130] In this embodiment, the model updates the data. It is a high-dimensional parameter vector. In the parameter space, it is difficult to distinguish between the differences in benign updates (due to data heterogeneity) and the differences in malicious updates (due to adversarial perturbations). However, after being transformed into the frequency domain by discrete wavelet transform, the low-frequency components of benign updates (reflecting the global training trend) have commonalities, while the low-frequency components of malicious updates will show abnormal shifts. Therefore, extracting low-frequency coefficients as frequency domain features can effectively amplify the differences between the two types of updates.

[0131] The process of generating a benign frequency domain prototype is as follows: Temporary benign candidate group There may be a small number of malicious updates disguised as benign ones mixed in (these updates have low recoverability scores, but their frequency domain features differ from those of benign updates). If the arithmetic mean is used to generate the prototype, the prototype will be shifted due to outliers, reducing the accuracy of subsequent similarity calculations. The geometric median is robust to outliers and can retain the frequency domain commonalities of benign updates to the greatest extent. Therefore, the geometric median is chosen as the benign frequency domain prototype.

[0132] The generation process of the malicious frequency domain prototype is as follows: Potential malicious group It contains different types of malicious updates, including recoverability scores. The highest-performing update deviates most significantly from the normal training trajectory, and its frequency domain features best represent the typical pattern of malicious updates (such as low-frequency component shifts caused by adversarial perturbations). Selecting such updates as representatives can make malicious frequency domain prototypes more distinguishable.

[0133] When calculating the similarity between each update and the benign / malicious frequency domain prototypes, the benign and malicious frequency domain prototypes are used as references. The magnitude of the similarity directly reflects the degree of fit between the update and the benign / malicious pattern, providing core data for the calculation of paradigm scoring. Since the data distribution of updates may change in each round of federated learning, the benign / malicious frequency domain prototypes need to be regenerated in each round to ensure that the prototypes can adapt to the update pattern of the current round and avoid a decrease in detection accuracy due to fixed prototypes.

[0134] The aforementioned scheme achieves a deep balance between discrimination accuracy, robustness, and computational efficiency in the frequency domain feature processing and prototype construction stages. Regarding feature discrimination, the low-frequency components of model updates are extracted using discrete wavelet transform as frequency domain features. This operation effectively amplifies the differences between the commonalities of "benign updates" and the anomalies of "malicious updates." Even though the differences between heterogeneous benign updates and masquerading malicious updates are difficult to identify in the parameter space, the differences in their low-frequency features become significantly more prominent after transformation to the frequency domain, laying the foundation for the accuracy of subsequent similarity calculations.

[0135] In terms of prototype robustness and representativeness, benign frequency domain prototypes are generated using the geometric median, which, compared to the arithmetic mean, can effectively resist interference from a small number of malicious updates (outliers) mixed into the benign group. This ensures that the benign prototype always matches the frequency domain pattern of real benign updates and avoids misjudgment of benign updates due to prototype offset. Malicious frequency domain prototypes, on the other hand, are constructed by selecting the K malicious updates with the highest recoverability scores. These updates have the most significant malicious features, and their arithmetic mean can accurately represent the typical frequency domain pattern of malicious updates. This enables subsequent malicious similarity calculations to effectively identify even highly disguised malicious updates.

[0136] In terms of computational efficiency, the computational complexity of the discrete wavelet transform is only [missing information]. ( The iterative solution for the geometric median (which has a large number of model parameters) converges quickly, and the calculation of the arithmetic mean of the malicious prototype is simple. The overall process does not impose an excessive computational burden on the server, perfectly balancing detection accuracy and system operating efficiency.

[0137] In some embodiments, in step S4, the formula for calculating the similarity between the frequency domain features of the model update data and the benign frequency domain prototype is as follows:

[0138] ;

[0139] in, for arrive The distance between sets.

[0140] The formula for calculating the similarity between the frequency domain features of the model update data and the malicious frequency domain prototype is as follows:

[0141] ;

[0142] in, for arrive The distance between sets.

[0143] The paradigm score is calculated using the following formula:

[0144] ;

[0145] in, It is a balance parameter. and It is a normalized similarity score.

[0146] In this application, frequency domain feature similarity is an indicator that quantifies the similarity between the frequency domain features of a single model update and the "benign / malicious frequency domain prototype". It is achieved by calculating the Euclidean distance between the two. The smaller the Euclidean distance between the two, the higher the similarity between them, indicating that the model update fits the corresponding prototype better.

[0147] Benign frequency domain prototype similarity This refers to model updates benign model The squared Euclidean distance between the (geometric median of the frequency domain features of temporary benign candidate groups) is the core indicator for judging whether the model update conforms to a benign pattern. The smaller the value, the higher the probability of it being updated to a benign state.

[0148] Malicious frequency domain prototype similarity This refers to model updating model With malicious models (Highest recoverability score among potential malicious groups) The squared Euclidean distance between the updated frequency domain feature arithmetic mean and the value of the frequency domain feature. The smaller the value, the higher the probability of it being malicious.

[0149] Normalized similarity score This refers to the original similarity Mapped to The standardized results of the interval. Among them, and negative correlation ( The smaller, The larger ( and negative correlation ( The smaller, The larger the value, the better. This is used to eliminate the dimensional differences in similarity between different rounds and updates, ensuring the rationality of subsequent weighted calculations.

[0150] Balance parameters ( () refers to the hyperparameter used to adjust the weights of malicious and benign similarity in the paradigm scoring, with a value range of... .generally Set as This approach assigns a slightly higher weight to malicious similarities than benign similarities, enhancing the sensitivity to identifying spoofed malicious updates while avoiding over-misjudging benign updates.

[0151] Paradigm scoring ( ) refers to the malicious similarity after fusion and normalization ( ) and benign similarity ( The overall score is calculated using the following formula: A higher paradigm score indicates a greater likelihood that the model update conforms to a benign pattern. It complements and corrects the recoverability score, achieving an upgrade from single-dimensional detection to multi-dimensional verification.

[0152] In practical applications, the first step is to update all model data received in the current round (including temporary benign candidate groups). and potential malicious groups (Update in the model), first perform discrete wavelet transform, the calculation process is as follows: (1) Input model update data (Parameter vector, element index is) ,Right now , (2) Using Daubechies wavelet as the basis function, through the formula Extracting low-frequency approximation coefficients ( The scale parameter controls the coarseness of the frequency. The translation parameters cover the entire parameter vector; (as a scaling function), Flattened into a one-dimensional vector, as Frequency domain characteristics .

[0153] Then, the similarity between benign and malicious frequency domain prototypes is calculated, and the benign similarity ( The calculation process is as follows: Based on the benign frequency domain prototype generated by the aforementioned steps ( (Geometric median of frequency domain features), calculating a single update Frequency domain characteristics and The square of the Euclidean distance is given by the formula: ;

[0154] like For benign updates, its frequency domain characteristics and The difference is small. The value is low; if it is a malicious update, The value is significantly high.

[0155] Malicious similarity ( The calculation process is as follows: Based on the malicious frequency domain prototype generated by the aforementioned steps ( middle (The arithmetic mean of the frequency domain features updated by the high recoverability score) is calculated. Frequency domain characteristics and The square of the Euclidean distance is given by the formula:

[0156] ;

[0157] like As a malicious update, its frequency domain characteristics are similar to The difference is small. The value is low; if it is a benign update, The value is too high.

[0158] Then, similarity score normalization is performed, due to different rounds and different updates. , There may be differences in dimensionality (e.g., the similarity of benign updates is generally low in one round and generally high in another), which needs to be eliminated by linear normalization to obtain the desired result. , :

[0159] For all updates Calculate the minimum value min( ) and maximum value max( The normalization formula is:

[0160] ;

[0161] If max( ) = min( ), indicating that all updates have the same benign similarity, then .

[0162] For all updates Using the same logical normalization, the formula is:

[0163] ;

[0164] After normalization, , All are in the interval [0, 1], and The larger the value, the higher the benign similarity. The larger the value, the higher the degree of malicious similarity, and it can be directly used for weighted calculation.

[0165] Then based on the balance parameters ,right , Weighted fusion is performed to obtain the paradigm score. The formula is:

[0166] ;

[0167] like For benign updates, usually Smaller (original) Small), Larger (original) (Large), after substituting into the formula The value is relatively high; if For malicious updates, usually Larger (original) big), Smaller (original) Small), The value is low. The paradigm score can be combined with the recoverability score obtained from the aforementioned steps. Used together, they correct errors in the initial screening. For example, in a certain update... Slightly higher (possibly due to data heterogeneity, initially categorized as a potential malicious group), but If the value is high (the frequency domain characteristics are similar to those of a benign prototype), it can be reclassified as benign, thus correcting the error in the initial screening.

[0168] The aforementioned scheme achieves synergistic optimization of malicious update detection accuracy, benign protection effectiveness, attack adaptability, and computational efficiency through multi-dimensional design. In malicious update detection, relying on frequency domain similarity analysis, it can capture malicious features that are difficult to detect in the parameter space, such as frequency domain anomalies disguised as benign updates. Compared to solely relying on recoverability scoring, paradigm scoring can further clarify "benign differences caused by data heterogeneity" and "malicious differences caused by adversarial perturbations," significantly improving the accuracy of malicious detection. Regarding benign update protection, normalization processing eliminates the dimensional differences in similarity across different scenarios, and then, combined with balancing parameters... Dynamic adjustment avoids overemphasis on any one dimension, effectively reducing misjudgments of benign updates due to "data heterogeneity causing frequency domain features to deviate from the mean," thus ensuring the effective preservation of benign updates. Against strategic attacks, even if attackers adjust the parameter space features of malicious updates to disguise them as benign, it is difficult to simultaneously disguise the common patterns of low-frequency components in the frequency domain. Even with similar parameter space performance, the frequency domain features of malicious updates will still closely resemble the malicious prototype, leading to paradigm scoring errors. The value was relatively low, but it was ultimately accurately identified. In terms of computational efficiency, the complexity of similarity calculation and normalization processing is linearly related to the frequency domain feature dimension, which is much lower than the complexity of model training. This does not add extra computing power to the server, achieving a balance between detection accuracy and system efficiency.

[0169] In some embodiments, such as Figure 2 As shown, step S5 includes:

[0170] S51: For each model update data, calculate a comprehensive trust score based on its recoverability score and paradigm score; S52: Compare the comprehensive trust score with a preset score threshold, and select model update data with a comprehensive trust score higher than the preset score threshold to form the final benign update dataset;

[0171] The calculation formula for step S6 is as follows:

[0172] ;

[0173] in, To eventually update the dataset in a positive way.

[0174] Regarding aggregation robustness, the above method strictly limits global aggregation to only based on the final benign update dataset, cutting off the interference path of malicious updates to the global model from the source. Even in the extreme scenario where "malicious clients are in the majority," the global model can still maintain stable performance, avoiding the model performance collapse problem caused by malicious updates in traditional aggregation methods.

[0175] Regarding threshold adaptability, the preset scoring threshold is not fixed, but can be dynamically adjusted based on the statistical patterns of historical detection data or cross-validation results. This allows for flexible adaptation to different types of federated learning tasks (such as image classification and text recognition) as well as attack behaviors of varying intensities. It effectively avoids the inadequacy of fixed thresholds in complex scenarios and ensures that the selection criteria always match the current training environment.

[0176] In some embodiments, such as Figure 3 As shown, after step S6, an attack strategy adaptive prediction and dynamic adjustment loop is executed, specifically including:

[0177] S61: Aggregate the client identifiers, recoverability scores, paradigm scores, frequency domain features, and deviations from the malicious frequency domain prototypes of the client-classified potential malicious groups in the current and historical rounds to form a historical attack behavior sequence.

[0178] S62: Based on the historical attack behavior sequence, use time series analysis algorithms to extract the evolutionary pattern of the attack behavior in time series. The evolutionary pattern includes the attacker's participation round pattern, the trend of attack intensity change, and the offset direction of attack frequency domain features.

[0179] S63: Based on the evolutionary pattern, predict the possible changes in attack strategies during the next round of federated learning, and obtain attack prediction results. The attack prediction results include the prediction of the frequency domain feature shift direction, the prediction of the trend of the abnormality of recoverability score, and the prediction of the temporal correlation of attack behavior.

[0180] Preferably, based on the attack prediction results, a parameter adjustment strategy is generated and applied to the detection process in the next round of federated learning. The parameter adjustment strategy includes:

[0181] If the attack intensity is predicted to increase, the learning rate in the simulation training process of the proxy dataset is reduced or the perturbation intensity is increased to generate more robust proxy data, thereby improving the sensitivity of recoverability analysis; if the attack intensity is predicted to decrease, the proxy data generation strategy is optimized to make it closer to the data points of the current global model decision boundary.

[0182] If the frequency domain characteristics of the predicted attack will shift, the frequency band weights used to calculate the benign and malicious frequency domain prototypes will be dynamically adjusted.

[0183] In this embodiment, the historical attack behavior sequence refers to a time-series dataset that aggregates information related to "potential malicious groups" in the current round and historical rounds. It includes client identifiers (used to track specific malicious nodes), recoverability scores (reflecting the degree to which the attack deviates from the normal trajectory), paradigm scores (reflecting the degree of attack camouflage), frequency domain features (reflecting the frequency domain pattern of the attack), and deviation from the malicious frequency domain prototype (reflecting changes in attack strategies). It is the basic data for analyzing the evolution of attack patterns.

[0184] Time series analysis algorithms are used to extract temporal evolution patterns from historical attack behavior sequences. Algorithms such as ARIMA (Autoregressive Integral Moving Average) and LSTM (Long Short-Term Memory) can capture the correlation, trend, and periodicity of attack behavior between rounds, providing support for attack prediction.

[0185] Attack evolution patterns refer to the changes in the behavioral patterns exhibited by attackers in multiple rounds of federated learning, including the round participation pattern (such as the periodicity of "attacking once every 2 rounds"), the trend of attack intensity changes (such as the recoverability score gradually decreasing from 1.2 to 0.8, and the degree of camouflage increasing), and the direction of attack frequency domain feature shift (such as the low-frequency component shifting from "high-frequency band anomaly" to "low-frequency band anomaly").

[0186] Attack prediction results refer to the prediction of the next round of attack strategies based on evolutionary laws, including the direction of frequency domain feature shift (such as predicting that the low frequency coefficients of the next round of attack will shift to a certain interval), changes in the degree of abnormality of recoverability score (such as predicting that the recoverability score of the attack will further decrease and the disguise will be more covert), and attack time sequence correlation (such as predicting that a certain malicious client will continue to attack in the next round after the current attack).

[0187] The parameter adjustment strategy refers to the parameter configuration scheme generated based on the attack prediction results to optimize the next round of detection process. It includes parameters generated from the proxy dataset (learning rate, perturbation strength), parameters calculated from the frequency domain prototype (frequency band weight), etc., to achieve an adaptive cycle of "prediction-adjustment-defense".

[0188] In practical applications, after each round of detection, the server will classify groups as potentially malicious. The updates record the following information according to the "round - client identifier" dimension, forming a historical attack behavior sequence. ( For the first The attack behavior data of the rounds is then analyzed using time series analysis algorithms (such as LSTM, which is suitable for nonlinear time series data). Analysis revealed three core evolutionary patterns, as follows:

[0189] Participation Round Pattern: Statistically analyze the attack round distribution of each malicious client (e.g., client A attacks in rounds 2, 4, and 6, and client B attacks in rounds 3 and 5), and mine the periodicity (e.g., "attacks once every 2 rounds") or correlation (e.g., "after client A attacks, client B will definitely attack in the next round") through association rules.

[0190] Attack strength change trend: based on recoverability score As an indicator of attack strength ( The smaller the size, the more concealed the camouflage, and the higher the attack strength. (Fitting the model using ARIMA). Extract trends from time-series changes (e.g.) The attack intensity decreased from 1.5 in the first round to 0.7 in the tenth round, showing a continuous downward trend, indicating that the attack intensity has increased.

[0191] Attack frequency domain feature offset direction: for frequency domain features Calculate the mean change of each dimension (different frequency bands of low-frequency coefficients) and determine the direction of shift (e.g., after the 5th round, the mean of the attack's low-frequency coefficients in frequency band 1 increases from 0.2 to 0.5, indicating that the attack's frequency domain characteristics have shifted towards frequency band 1).

[0192] Based on the extracted evolutionary patterns, three types of attack prediction results are generated, as follows:

[0193] Frequency domain feature shift prediction: If historical data shows that the attack frequency domain features shift towards frequency band 1, it is predicted that the proportion of low-frequency coefficients in frequency band 1 in the next round of attack will further increase (e.g., from 50% to 60%).

[0194] Recoveryability score anomaly prediction: If the attack intensity shows an increasing trend ( (Continued decline), predicting the next round of attacks It will continue to decrease (e.g., from 0.7 to 0.6), making the update appear more like a benign one;

[0195] Attack sequence correlation prediction: If there is a "sequential attack" correlation between client A and client B, it is predicted that after client A launches an attack in this round, client B will launch an attack in the next round.

[0196] Then, based on the attack prediction results, a targeted parameter adjustment strategy is generated and applied to the next round of detection. The parameter adjustment strategy includes parameter adjustment generated from proxy datasets and parameter adjustment calculated from frequency domain prototypes.

[0197] The parameters for generating the proxy dataset are adjusted as follows:

[0198] If the predicted attack intensity increases ( If the learning rate is lowered, then the learning rate of the simulated training on the proxy dataset will be reduced. (e.g., reduce from 0.01 to 0.005) or increase the perturbation strength of the proxy data (e.g., add small noise to the synthetic data) to make the proxy data more robust and improve the sensitivity of recoverability analysis to covert attacks;

[0199] If the predicted attack intensity weakens ( If the value is increased, the proxy data generation strategy will be optimized to make the synthetic data closer to the decision boundary of the current global model (e.g., by prioritizing the generation of data points that are easily misjudged by the model through gradient inversion), thereby reducing the recoverability scoring error of benign updates.

[0200] The frequency domain prototype calculation parameters are adjusted as follows:

[0201] If the predicted attack frequency domain features shift to a certain frequency band (such as frequency band 1), the weight of that frequency band in the calculation of benign / malicious frequency domain prototypes is dynamically adjusted (such as increasing the weight of frequency band 1 from 0.2 to 0.4), so that the frequency domain prototypes can better capture the attack features after the shift and enhance the accuracy of similarity calculation.

[0202] The above scheme achieves a highly efficient balance of screening accuracy, aggregation robustness, scenario adaptability, and deployment compatibility in the final benign update screening and global model aggregation stages. For screening, the comprehensive trust score integrates "internal trajectory rationality (recoverability)" and "external pattern consistency (paradigm score)," which more accurately distinguishes between benign and malicious updates compared to a single indicator, significantly reducing the probability of false negatives and false positives, and outperforming traditional threshold screening methods. During aggregation, operations are only performed on the final benign update dataset, isolating malicious update interference from the source. Even if "malicious clients are in the majority," the global model can still maintain stable performance, avoiding performance crashes caused by malicious dominance in traditional aggregation. Threshold settings are flexible and can be dynamically adjusted based on historical data or cross-validation to adapt to different federated learning tasks and attack intensities, avoiding the limitations of fixed thresholds in complex scenarios. For deployment, the aggregation formula retains the simplicity of FedAvg, requiring only an additional "comprehensive trust score screening" step before aggregation, without modifying the client training logic. It can be directly embedded into existing federated learning systems, significantly reducing deployment costs and adaptation difficulties.

[0203] In some embodiments, step S5 includes:

[0204] During the federated learning initialization phase or after a preset number of rounds, based on the model update data uploaded by each client, its historical data distribution characteristics are extracted. The historical data distribution characteristics are characterized by at least one of the following methods: the statistical characteristics of the client's historical model update data, the cosine similarity or Euclidean distance between the client's model update data and the global model parameters at the same time, and the category distribution entropy of the proxy dataset reconstructed through its model update data.

[0205] Unsupervised clustering algorithm is used to cluster all clients based on their historical data distribution characteristics, and clients with similar historical data distribution characteristics are divided into the same heterogeneous group;

[0206] Based on the recoverability score and paradigm score of all clients in the current round, calculate the global initial recoverability score threshold. and initial paradigm scoring threshold ;

[0207] Calculate each heterogeneous group Data distribution heterogeneity The heterogeneity is quantified by calculating the average distance between the historical data distribution characteristics of clients within the heterogeneous group and the global feature center;

[0208] Based on heterogeneity Generate various heterogeneous groups Personalized thresholds, including personalized thresholds for recoverability scores. Personalized threshold for paradigm scoring The calculation formula is as follows:

[0209] ;

[0210] ;

[0211] in, and An adjustment factor greater than zero;

[0212] For those belonging to the heterogeneous group The client, which scores the recoverability of its model update data. And Paradigm Scoring Each of these threshold values ​​corresponds to a personalized recoverability score threshold for the heterogeneous group. Personalized threshold for paradigm scoring Comparison:

[0213] Only when and Only then are the client's model update data included in the final benign update dataset.

[0214] In this embodiment, historical data distribution characteristics refer to the long-term distribution patterns of model update data uploaded by the client in multiple rounds of federated learning. These characteristics are used to characterize the client's "data heterogeneity attributes," including statistical features (such as the mean and variance of historical updates), similarity to the global model (cosine similarity and Euclidean distance), and the category distribution entropy of the proxy dataset (reflecting the category diversity of the proxy data). These characteristics are the core basis for classifying heterogeneous groups.

[0215] Unsupervised clustering algorithms are used to group clients based on the distribution characteristics of historical data, such as k-means and DBSCAN. They do not require manual labeling and can automatically divide clients with similar historical data distribution characteristics into the same heterogeneous group, reflecting the heterogeneous commonalities of clients.

[0216] Heterogeneous groups ( A group is a collection of clients with similar historical data distribution characteristics. The heterogeneity of client data within the same group is low (e.g., all are datasets where category A accounts for 80%), while the heterogeneity of client data between different groups is high (e.g., group 1 is dominated by category A, and group 2 is dominated by category B).

[0217] The global initial threshold is a globally unified threshold calculated based on the recoverability score and paradigm score of all clients in the current round. It is the basis for generating personalized thresholds and is usually determined by taking the median of all scores or by statistically analyzing the lowest score of benign updates.

[0218] Data distribution heterogeneity ( () refers to quantifying a certain heterogeneous group The indicator of the difference from the global data distribution is achieved by calculating the average distance between the historical data distribution characteristics of clients within the group and the "global feature center". The larger the value, the greater the heterogeneity between this group and the global data.

[0219] Personalized thresholds refer to thresholds for different heterogeneous groups. Customized recoverability and paradigm scoring thresholds are generated by introducing a heterogeneity correction term on top of the global initial threshold, so that the thresholds are adapted to the heterogeneous attributes of clients within the group, avoiding misjudgments caused by a "one-size-fits-all" threshold.

[0220] The aforementioned scheme uses unsupervised clustering to categorize clients with similar historical data distribution characteristics into heterogeneous groups. This eliminates the need for manual labeling of heterogeneous types and automatically identifies different heterogeneous patterns, flexibly adapting to real-world scenarios such as new client additions and dynamic changes in data distribution. Simultaneously, a global initial threshold ensures consistent judgment criteria across different groups. Personalized thresholds are then generated based on the heterogeneity of each group. For groups with high heterogeneity, the criteria for recoverability and paradigmatic scoring are appropriately relaxed, reflecting both intra-group local characteristics and avoiding inter-group judgment bias. This fundamentally reduces benign misjudgments caused by "abnormal scoring due to data heterogeneity." Furthermore, the personalized thresholds dynamically adjust with group heterogeneity without manual intervention, automatically adapting to changes in client data distribution during federated learning. Compared to a fixed global threshold, this results in more stable detection accuracy.

[0221] In a second aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the model-based poisoning attack prevention method based on heterogeneous federated learning as described in the first aspect of the present invention.

[0222] The computer-readable storage medium may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.

[0223] The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD ROM); the magnetic surface memory may be a disk storage device or a magnetic tape storage device.

[0224] The volatile memory may be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synclink dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The computer-readable storage media described in the embodiments of the present invention are intended to include these and any other suitable types of memory.

[0225] like Figure 4 As shown, in a third aspect, the present invention provides an electronic device 10, including a processor 101 and a storage medium 102, wherein a computer program is stored on the storage medium, and the computer program, when executed by the processor, implements the model anti-poisoning attack method based on heterogeneous federated learning as described in the first aspect of the present invention.

[0226] In some embodiments, the processor may be implemented by software, hardware, firmware, or a combination thereof, and may be a circuit, one or more of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, or a microprocessor, thereby enabling the processor to execute some or all of the steps or any combination thereof in the heterogeneous federated learning-based model poisoning attack prevention method described in the various embodiments of this application.

[0227] Finally, it should be noted that although the above embodiments have been described in the text and drawings of this application, this should not limit the scope of patent protection of this application. Any technical solutions that are based on the essential concept of this application and utilize the content described in the text and drawings of this application, resulting in equivalent structural or procedural substitutions or modifications, as well as the direct or indirect application of the technical solutions of the above embodiments to other related technical fields, are all included within the scope of patent protection of this application.

Claims

1. A method for preventing poisoning attacks based on heterogeneous federated learning, characterized in that, Applicable to the server side, the method includes the following steps: S1: Receive model update data from multiple clients, the model update data including model parameters or model parameter differences obtained after local training on the client; S2: Perform a recoverability analysis on each model update data to obtain a corresponding recoverability score. The recoverability analysis includes: synthesizing a proxy dataset based on the current model update data, performing simulated training using the proxy dataset to obtain simulated model update data, and calculating the similarity between the simulated model update data and the simulated model update data; S3: Based on the recoverability scores of all model update data, divide the corresponding clients into temporary benign candidate groups and potential malicious groups using a clustering algorithm, and generate benign frequency domain prototypes and malicious frequency domain prototypes based on the model update data in the temporary benign candidate groups and the potential malicious groups, respectively; S4: For each model update data, based on its corresponding frequency domain features, calculate the similarity between the frequency domain features and the benign frequency domain prototype and the malicious frequency domain prototype respectively, so as to generate the corresponding paradigm score. S5: Based on the recoverability score and the paradigm score of each model update data, select the final benign update dataset from all model update data; S6: Aggregate the model update data in the final benign update dataset to generate an updated global model.

2. The method for preventing poisoning attacks based on heterogeneous federated learning as described in claim 1, characterized in that, The step of synthesizing a proxy dataset based on the current model update data is achieved by solving an optimization problem, specifically including: Constructing a convex optimization problem for synthesizing the proxy dataset based on the current model update data. The objective function of the convex optimization problem is configured to minimize the difference between the simulated model update data generated by the simulated training using the proxy dataset and the current model update data. The objective function is as follows: ; ; in, Representing the A proxy dataset for each user, For the first The set of clients participating in training within a communication cycle. for The set of clients that carry out poisoning attacks. For the first A global model for each communication cycle. For function exist gradient at, For the first The client in the first Model update data for each communication cycle. Denotes the F-norm of a matrix; Solve the convex optimization problem to obtain the synthesized proxy dataset.

3. The method for preventing poisoning attacks based on heterogeneous federated learning as described in claim 1, characterized in that, The simulation training using the aforementioned proxy dataset yields the following simulation model update data: The generation of the simulated model update data is defined as the optimal objective value of a constrained optimization problem. This constrained optimization problem aims to quantify the difference between the original model update data and the update reconstructed through simulated training on the proxy dataset. The constrained optimization problem is expressed as follows: ; in, For recoverability scoring, This function represents the client's simulation of the local training process. To simulate the number of steps during local training on the client, Let KL divergence be the KL divergence. To preset the error threshold, To simulate the learning rate during local training on the client side, To simulate the model obtained after local training for the client; The constrained optimization problem is transformed into an optimization form with a penalty term and solved. The obtained optimal solution is used as the update data for the simulation model.

4. The method for preventing poisoning attacks based on heterogeneous federated learning as described in claim 1, characterized in that, The mean frequency domain features of all model update data in the temporary benign candidate group and the potential malicious group are calculated respectively to generate benign frequency domain prototypes and malicious frequency domain prototypes. This includes using discrete wavelet transform to convert each model update data to the frequency domain and extracting its low-frequency component representation as frequency domain features. The benign frequency domain prototype is generated by calculating the geometric median of the frequency domain features of all model update data in the temporary benign candidate group, using the following formula: ; The argmin function returns the parameters that minimize the objective function. The geometric median of the frequency domain features of all model update data in the temporary benign candidate group. and Representing the model respectively and model Frequency domain characteristics after discrete wavelet transform; The malicious frequency domain prototype is generated by selecting the K models with the highest recoverability scores from the potential malicious group and updating the data using the arithmetic mean of their frequency domain features.

5. The method for preventing poisoning attacks based on heterogeneous federated learning as described in claim 4, characterized in that, In step S4, the formula for calculating the similarity between the frequency domain features of the model update data and the benign frequency domain prototype is as follows: ; in, express arrive The distance between sets; The formula for calculating the similarity between the frequency domain features of the model update data and the malicious frequency domain prototype is as follows: ; in, express arrive The distance between sets; The paradigm score is calculated using the following formula: ; in, It is a balance parameter. and It is a normalized similarity score.

6. The method for preventing poisoning attacks based on heterogeneous federated learning as described in claim 5, characterized in that, Step S5 includes: S51: For each model update data, calculate a comprehensive trust score based on its recoverability score and paradigm score; S52: Compare the comprehensive trust score with a preset score threshold, and select model update data with a comprehensive trust score higher than the preset score threshold to form the final benign update dataset; The calculation formula for step S6 is as follows: ; in, To eventually update the dataset in a positive way.

7. The method for preventing poisoning attacks based on heterogeneous federated learning as described in claim 5, characterized in that, After step S6, an attack strategy adaptive prediction and dynamic adjustment loop is executed, specifically including: By aggregating the client identifiers classified into the potential malicious group in the current round and historical rounds, the recoverability score, paradigm score, frequency domain features, and deviation from the malicious frequency domain prototype corresponding to the model update data uploaded by the client, a historical attack behavior sequence is formed. Based on the historical attack behavior sequence, time series analysis algorithms are used to extract the evolutionary pattern of the attack behavior in time series. The evolutionary pattern includes the attacker's participation round pattern, the trend of attack intensity change, and the offset direction of attack frequency domain features. Based on the aforementioned evolutionary pattern, the attack strategy changes that may occur in the next round of federated learning are predicted, and the attack prediction results are obtained. The attack prediction results include the prediction of the frequency domain feature shift direction, the prediction of the trend of the abnormality of recoverability score, and the prediction of the temporal correlation of attack behavior. Based on the attack prediction results, a parameter adjustment strategy is generated and applied to the detection process in the next round of federated learning. The parameter adjustment strategy includes: If the attack intensity is predicted to increase, the learning rate in the simulation training process of the proxy dataset is reduced or the perturbation intensity is increased to generate more robust proxy data, thereby improving the sensitivity of recoverability analysis; if the attack intensity is predicted to decrease, the proxy data generation strategy is optimized to make it closer to the data points of the current global model decision boundary. If the frequency domain characteristics of the predicted attack will shift, the frequency band weights used to calculate the benign and malicious frequency domain prototypes will be dynamically adjusted.

8. The method for preventing poisoning attacks based on heterogeneous federated learning as described in claim 5, characterized in that, Step S5 includes: During the federated learning initialization phase or after a preset number of rounds, based on the model update data uploaded by each client, its historical data distribution characteristics are extracted. The historical data distribution characteristics are characterized by at least one of the following methods: the statistical characteristics of the client's historical model update data, the cosine similarity or Euclidean distance between the client's model update data and the global model parameters at the same time, and the category distribution entropy of the proxy dataset reconstructed through its model update data. Unsupervised clustering algorithm is used to cluster all clients based on their historical data distribution characteristics, and clients with similar historical data distribution characteristics are divided into the same heterogeneous group; Based on the recoverability score and paradigm score of all clients in the current round, calculate the global initial recoverability score threshold. and initial paradigm scoring threshold ; Calculate each heterogeneous group Data distribution heterogeneity The heterogeneity is quantified by calculating the average distance between the historical data distribution characteristics of clients within the heterogeneous group and the global feature center; Based on heterogeneity Generate various heterogeneous groups Personalized thresholds, including personalized thresholds for recoverability scores. Personalized threshold for paradigm scoring The calculation formula is as follows: ; ; in, and An adjustment factor greater than zero; For those belonging to the heterogeneous group The client, which scores the recoverability of its model update data. Paradigm scoring Each of these threshold values ​​corresponds to a personalized recoverability score threshold for the heterogeneous group. Personalized threshold for paradigm scoring Comparison: Only when and Only then are the client's model update data included in the final benign update dataset.

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

10. An electronic device having a computer program stored thereon, characterized in that, It includes a processor and a storage medium, wherein a computer program is stored on the storage medium, and when the computer program is executed by the processor, it implements the model-based poisoning attack prevention method according to any one of claims 1 to 8.