Federal learning robust aggregation method and system fusing layer-by-layer dynamic clustering and statistical magnitude self-adaptive preferential selection

By introducing a layer-by-layer dynamic switching clustering algorithm and an adaptive selection strategy for statistics into federated learning, the problems of fixed strategies being easily cracked and data distribution differences are solved, achieving higher robustness and improved model performance.

CN122021802APending Publication Date: 2026-05-12BEIJING JIAOTONG UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING JIAOTONG UNIV
Filing Date
2026-01-20
Publication Date
2026-05-12

Smart Images

  • Figure CN122021802A_ABST
    Figure CN122021802A_ABST
Patent Text Reader

Abstract

The invention provides a federated learning robust aggregation method and system fusing layer-by-layer dynamic clustering and statistic adaptive preferential selection, and belongs to the technical field of federated learning. The method can dynamically cluster and screen benign update layer by layer: after a server receives client model update, the benign update is accurately identified through a hierarchical clustering mechanism, a randomized clustering algorithm selection strategy is introduced, each layer of clustering algorithm is dynamically determined, and clustering robustness is enhanced; based on a hierarchical clustering result, a statistical magnitude calculation mode (such as a mean value and a median) is selected through a random number, so that random statistical magnitude self-adaptive preferential selection is realized; the situation that a single statistic is dominated by an abnormal value is avoided, the influence of abnormal data on global model updating is reduced, multi-source information is fused to generate global model updating, abnormal value interference is effectively restrained, and the adaptability to complex data distribution is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of federated learning technology, specifically to a robust aggregation method and system for federated learning that integrates hierarchical dynamic clustering and adaptive statistical selection. Background Technology

[0002] Federated learning, as a privacy-preserving distributed machine learning paradigm, constructs a global model by aggregating updates from models trained locally on multiple clients, showing broad application prospects in fields such as healthcare and finance. However, the FL framework faces two core challenges in practical applications: on the one hand, malicious clients may upload forged model updates, directly compromising the convergence and generalization performance of the global model; on the other hand, the significant differences in client data distribution make traditional aggregation methods (such as simple averaging) highly susceptible to outliers, thus significantly reducing model performance.

[0003] Current mainstream defense solutions primarily rely on static strategies—that is, using fixed clustering algorithms to filter benign updates during the global aggregation phase and calculating global model updates based on preset statistics (such as mean or median). The core assumption underlying these methods is that attack patterns and data distributions are relatively stable. However, this premise is difficult to uphold in real-world scenarios, leading to three severe limitations: First, the rules of fixed clustering algorithms and statistics are easily cracked by attackers through reverse engineering, allowing malicious clients to specifically forge updates that meet the filtering criteria to bypass detection. Second, a single statistic (whether mean or median) cannot simultaneously satisfy the data characteristic requirements of different model layers; for example, the lower-level feature layer requires strong noise resistance while the higher-level semantic layer needs to retain global trends. Finally, the fixed nature of static strategies makes them ineffective against dynamically changing attack patterns, including new threats such as adaptive backdoor attacks and cross-layer poisoning, significantly limiting their robustness.

[0004] The shortcomings of existing robust aggregation methods in federated learning are as follows: First, fixed strategies lead to strong predictability: the rules of traditional methods are fixed, and attackers can bypass detection by reverse-engineering the aggregation logic on the server side and forging malicious model updates that meet the screening criteria. Second, they lack layered targeting: they cannot dynamically adjust the aggregation strategy according to the characteristics of the model layers, which may lead to the loss of information in some layers or over-aggregation. Summary of the Invention

[0005] The purpose of this invention is to provide a robust aggregation method and system for federated learning that integrates layer-by-layer dynamic clustering and adaptive selection of statistical measures. By dynamically switching clustering algorithms and adaptively selecting statistical measures, it overcomes the limitations of traditional fixed strategies. Based on the characteristics of different layers of the model, clustering algorithms and statistical measures are randomly selected to enhance robustness against heterogeneous data and dynamic attacks. Simultaneously, it prevents attackers from launching attacks by reverse-engineering fixed rules, thereby improving the convergence and security of the global model. This addresses at least one of the technical problems existing in the aforementioned background art.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] In a first aspect, the present invention provides a robust aggregation method for federated learning that integrates layer-by-layer dynamic clustering and statistical adaptive selection, comprising:

[0008] Layer-by-layer dynamic switching of clustering algorithms for clustering model updates: After the server fully receives the updated models from all clients participating in the model update, it initiates a hierarchical clustering mechanism to accurately identify benign updates; in this process, a randomized clustering algorithm selection strategy is introduced, which dynamically determines the clustering algorithm for the current layer by generating random numbers, thereby enhancing the robustness of the clustering effect;

[0009] Randomly select statistics for benign model updates: After completing cluster screening, the server selects the calculation method of statistics for the current layer through a random number generator to construct a global model update;

[0010] Update global model parameters: The server uses the global update generated from the benign updates selected from the layer-wise clustering to update the global model parameters in round t according to the following rules. :

[0011]

[0012] in, This represents the global model update in round t. To control the learning rate for updating the step size.

[0013] As a further limitation of the first aspect of the present invention, the hierarchical clustering process is formally characterized as follows:

[0014] ;

[0015] in, Represents the total number of model updates received; This represents the model update of layer j accepted by the i-th client in round t. This is the clustering algorithm for the current layer.

[0016] As a further limitation of the first aspect of the present invention, a global model update is constructed:

[0017] ;

[0018] In the formula, Let f(·) represent the aggregation result of the j-th layer of the global model in the t-th round, where f(·) is a configurable statistical function.

[0019] Secondly, this invention provides a robust aggregation system for federated learning that integrates hierarchical dynamic clustering and statistical adaptive optimization, comprising:

[0020] The dynamic switching unit is used to dynamically switch clustering algorithms and clustering model updates layer by layer: After the server fully receives the updated models from all clients participating in the model update, it starts the hierarchical clustering mechanism to accurately identify benign updates; in this process, a randomized clustering algorithm selection strategy is introduced, which dynamically determines the clustering algorithm of the current layer by generating random numbers, thereby enhancing the robustness of the clustering effect;

[0021] The selection unit is used to randomly select statistics for benign model updates: after completing the clustering screening, the server selects the calculation method of statistics for the current layer through a random number generator to construct a global model update;

[0022] The global update unit is used to update the global model parameters: The server uses the global update generated from the benign updates selected from the layer-wise clustering to update the global model parameters in round t according to the following rules. :

[0023]

[0024] in, This represents the global model update in round t. To control the learning rate for updating the step size.

[0025] Thirdly, the present invention provides a non-transitory computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, they implement the robust aggregation method of federated learning that integrates layer-by-layer dynamic clustering and statistical adaptive selection as described in the first aspect.

[0026] Fourthly, the present invention provides a computer device including a memory and a processor, wherein the processor and the memory communicate with each other, the memory stores program instructions executable by the processor, and the processor invokes the program instructions to execute the robust aggregation method of federated learning that integrates layer-by-layer dynamic clustering and statistical adaptive selection as described in the first aspect.

[0027] Fifthly, the present invention provides an electronic device, comprising: a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to cause the electronic device to execute instructions for implementing the robust aggregation method of federated learning that integrates layer-by-layer dynamic clustering and statistical adaptive selection as described in the first aspect.

[0028] Terminology Explanation:

[0029] Federated Learning: As a distributed machine learning paradigm, Federated Learning's core characteristic lies in allowing multiple participants (including end devices or organizations) to collaboratively model data while strictly protecting the privacy of their original data. This framework adopts the design principle of "data remains still, model moves": each participant first completes model training (such as deep neural networks) locally, and then only uploads the model parameters (including weight matrices and gradient vectors) to a central server for secure aggregation. The globally generated model parameters are then distributed to each participant for local model iteration and updates. Compared to traditional centralized training methods, this technology effectively avoids the privacy risks associated with centralized raw data while achieving cross-institutional data collaboration, and significantly reduces the communication costs of large-scale data transmission, providing a compliant solution for machine learning applications in distributed data scenarios.

[0030] Poisoning attacks: As a typical malicious attack method against machine learning systems, the core mechanism of a poisoning attack lies in the attacker's deliberate injection of carefully crafted malicious samples into the training dataset, thereby distorting the model's learning process and disrupting its decision boundaries. Under the federated learning framework, such attacks exhibit a more complex implementation path: attackers may interfere with the global model's aggregation process by injecting contaminated samples into local training data, tampering with the gradient update direction of the local model, or manipulating local model parameters.

[0031] Byzantine robustness refers to the ability of a system to continue functioning correctly in the face of Byzantine faults. Byzantine faults refer to the arbitrary, inconsistent, or even malicious behavior of some nodes in the system. In federated learning, Byzantine robustness means that the system can maintain the robustness and accuracy of the global model even when some participants may send erroneous or malicious updates. Methods to achieve Byzantine robustness include using aggregation algorithms that can identify and ignore malicious updates.

[0032] Aggregation Algorithm: In federated learning, the aggregation algorithm is used to combine the local model updates of multiple participants to generate a global model.

[0033] The beneficial effects of this invention are as follows: By dynamically switching between clustering algorithms and adaptive optimization strategies for statistical calculations, the aggregation rules become unpredictable, effectively blocking attackers from launching attacks through reverse analysis; by introducing a hierarchical dynamic mechanism, a suitable clustering algorithm is independently and randomly selected for each network layer, achieving precise adaptation of model hierarchical characteristics and effectively balancing the needs of feature preservation and noise suppression.

[0034] The advantages of additional aspects of the invention will be set forth more clearly in the following description or will be learned by practice of the invention. Attached Figure Description

[0035] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0036] Figure 1 This is a flowchart of the robust aggregation method of federated learning that integrates layer-by-layer dynamic clustering and statistical adaptive selection, as described in an embodiment of the present invention. Detailed Implementation

[0037] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0038] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0039] It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with their meanings in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless defined as here.

[0040] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, and / or groups thereof.

[0041] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0042] To facilitate understanding of the present invention, the present invention will be further explained and described below with reference to the accompanying drawings and specific embodiments. However, the specific embodiments do not constitute a limitation on the embodiments of the present invention.

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

[0044] This invention aims to address the insufficient robustness of traditional methods relying on fixed clustering algorithms and single statistics in federated learning model aggregation. By dynamically switching clustering strategies and statistical calculation methods, it enhances resistance to malicious model updates and adapts to diverse data distribution scenarios. Specifically: First, overcoming the limitations of traditional methods with fixed clustering algorithms and single clustering strategies that cannot cope with diverse attack patterns such as backdoor attacks and data skew, this invention innovatively selects clustering algorithms randomly layer by layer, preventing malicious clients from using fixed patterns to launch attacks. Second, addressing the vulnerability of traditional mean / median statistics to outlier interference in non-independent and identically distributed data, this invention dynamically adjusts the statistical calculation method according to the characteristics of the model layer, thereby enhancing the robustness of the aggregation process. Third, by randomly switching the combination strategy of clustering algorithms and statistics, it not only interferes with the attack path of malicious clients forging similar model updates, but also uses the differences between statistics such as mean and median to identify abnormal models, significantly reducing the risk of misjudgment and improving the security and generalization ability of the global model.

[0045] This invention proposes a robust aggregation method for federated learning that integrates layer-by-layer dynamic clustering and adaptive selection of statistical measures. This method can dynamically select benign updates through layer-by-layer clustering: after receiving model updates from clients, the server accurately identifies benign updates through a hierarchical clustering mechanism. A randomized clustering algorithm selection strategy is introduced to dynamically determine the clustering algorithm for each layer, enhancing clustering robustness. Adaptive selection of random statistical measures is implemented: based on the hierarchical clustering results, the calculation method of statistical measures (such as mean and median) is selected using random numbers. Since different statistical measures have different sensitivities to outliers, random switching can prevent a single statistical measure from being dominated by outliers, reducing the impact of outlier data on global model updates. Integrating multi-source information to generate global model updates effectively suppresses outlier interference and improves adaptability to complex data distributions.

[0046] Example 1

[0047] In this embodiment 1, a robust aggregation system for federated learning that integrates layer-by-layer dynamic clustering and adaptive statistical selection is first provided. This system includes: a dynamic switching unit for layer-by-layer dynamic switching of clustering algorithms and clustering model updates: After receiving updated models from all participating clients, the server initiates a hierarchical clustering mechanism to accurately identify benign updates; this process introduces a randomized clustering algorithm selection strategy, dynamically determining the clustering algorithm for the current layer by generating random numbers, thereby enhancing the robustness of the clustering effect. A selection unit for randomly selecting statistics for benign model updates: After completing clustering screening, the server selects the statistical calculation method for the current layer using a random number generator to construct a global model update. A global update unit for updating global model parameters: The server uses the global update generated from the benign updates selected from layer-by-layer clustering to update the global model parameters for the t-th round according to the following rules. :

[0048]

[0049] in, This represents the global model update in round t. To control the learning rate for updating the step size.

[0050] In this embodiment, the above-described system is used to implement a robust federated learning aggregation method that integrates layer-by-layer dynamic clustering and statistical adaptive selection, including:

[0051] Layer-by-layer dynamic switching of clustering algorithms for clustering model updates: After the server fully receives the updated models from all clients participating in the model update, it initiates a hierarchical clustering mechanism to accurately identify benign updates; in this process, a randomized clustering algorithm selection strategy is introduced, which dynamically determines the clustering algorithm for the current layer by generating random numbers, thereby enhancing the robustness of the clustering effect;

[0052] Randomly select statistics for benign model updates: After completing cluster screening, the server selects the calculation method of statistics for the current layer through a random number generator to construct a global model update;

[0053] Update global model parameters: The server uses the global update generated from the benign updates selected from the layer-wise clustering to update the global model parameters in round t according to the following rules. :

[0054]

[0055] in, This represents the global model update in round t. To control the learning rate for updating the step size.

[0056] The hierarchical clustering process is formally represented as follows:

[0057] ;

[0058] in, Represents the total number of model updates received; This represents the model update of layer j accepted by the i-th client in round t. This is the clustering algorithm for the current layer.

[0059] Specifically, the global model update is constructed as follows:

[0060] ;

[0061] In the formula, Let f(·) represent the aggregation result of the j-th layer of the global model in the t-th round, where f(·) is a configurable statistical function.

[0062] Example 2

[0063] like Figure 1 As shown in Example 2, a robust aggregation method for federated learning that integrates layer-by-layer dynamic clustering and adaptive statistical selection is provided. This method innovatively constructs a three-stage framework: "layer-by-layer dynamic switching of clustering algorithms for clustering model update - random selection of statistics for benign model update - global parameter update," which improves model convergence accuracy while resisting malicious attacks in complex data environments. The specific implementation process is as follows:

[0064] Step 1: Dynamically switch clustering algorithms layer by layer and update the clustering model.

[0065] After receiving all model updates from participating clients, the server initiates a hierarchical clustering mechanism to accurately identify beneficial updates. This process introduces a randomized clustering algorithm selection strategy, dynamically determining the clustering algorithm for the current layer by generating random numbers, thereby enhancing the robustness of the clustering results. This hierarchical clustering process can be formally represented as:

[0066]

[0067] in, This represents the total number of model updates received. This represents the model update of layer j accepted by the i-th client in round t. This is the clustering algorithm for the current layer.

[0068] Step 2: Randomly select statistics for updating the benign model

[0069] After completing the clustering screening, the server uses a random number generator to select the statistical calculation method for the current layer and constructs a global model update:

[0070]

[0071] In the formula, This represents the aggregation result of the j-th layer of the global model in the t-th round, where f(·) is a configurable statistical function (such as mean / median). Since different statistics (such as mean and median) have varying sensitivities to outliers, random switching can prevent a single statistic from being dominated by outliers, reducing the impact of outlier data on the global model update. This mechanism effectively suppresses outlier interference by hierarchically aggregating multi-source information, significantly improving the model's adaptability to complex data distributions and exhibiting stronger stability than traditional averaging methods.

[0072] Step 3: Update global model parameters

[0073] The server generates a global update based on benign updates selected from hierarchical clustering. Update the global model parameters according to the following rules:

[0074]

[0075] in, This represents the global model update in round t. The learning rate is used to control the update step size; through this step, the server combines the learning rate and the global update. For global model parameters Update.

[0076] Example 3

[0077] In this embodiment, a framework based on the horizontal federated learning described in Embodiments 1 and 2 (participants have the same data features but different users) is proposed to train the FaceNet face recognition model (the core of which is the Triplet Loss function).

[0078] In this embodiment, VGGFace2 (available for free), the most commonly used public dataset in the field of face recognition, is selected as the basic data for federated training. It is simulated that the dataset is split across 3 clients (corresponding to 3 stores), maintaining the framework of horizontal federated learning. The specific steps are as follows:

[0079] Step 1: Local data preprocessing (executed independently by each store)

[0080] Image reading: Use OpenCV to read local JPG format face images and convert them to RGB channels (to avoid grayscale image deviation).

[0081] Face cropping: Based on the labeled bounding box coordinates, crop out the region containing only the face (remove background interference) and uniformly scale it to 160×160 pixels (FaceNet input requirement).

[0082] Data normalization: Scale pixel values ​​from [0,255] to [-1,1], formula: pixel = (pixel / 255.0) * 2 - 1.

[0083] Data augmentation (optional): Random horizontal flip (50% probability), random brightness adjustment (±10%), to improve model generalization.

[0084] Dataset partitioning: Local data is divided into training and validation sets in an 8:2 ratio.

[0085] Step 2: Central server initializes global model

[0086] The server loads the pre-trained FaceNet weights (based on the publicly available face dataset VGGFace2).

[0087] Initialize global model parameters (such as weights for convolutional and fully connected layers) and send the model structure and initial parameters to all clients.

[0088] Step 3: Local model training (executed independently by each store)

[0089] The client receives global model parameters and loads them into the local FaceNet model.

[0090] Construct Triplet Loss training batches: Randomly select a batch of triples (Anchor: anchor face, Positive: face with the same ID, Negative: face with a different ID) from the local training set, with each batch containing 128 triples.

[0091] Local training:

[0092] Optimizer: Adam, learning rate 0.001;

[0093] Training rounds: 5 epochs of local training (i.e., traversing the local training set 5 times);

[0094] Loss calculation: Calculate the distance between the anchor point and the positive sample (the smaller the better) and the distance between the anchor point and the negative sample (the larger the better) using Triplet Loss.

[0095] Backpropagation: Only updates local model parameters, without transmitting any original data.

[0096] Local validation: Calculate the model accuracy using the local validation set (to determine whether two faces belong to the same person, with a threshold of 1.0), and record the local loss and accuracy.

[0097] Step 4: Parameter Upload and Global Aggregation (Server Execution)

[0098] Each client uploads the locally trained model parameters (such as convolutional layer weights and biases) to the central server (only parameters are uploaded, not data).

[0099] The server uses an aggregation algorithm to aggregate parameters.

[0100] The server updates the global model parameters and calculates the global validation loss (summarizing the validation results from each client).

[0101] Step 5: Iterative Training and Termination Judgment

[0102] The server then sends the aggregated global parameters back to all clients, repeating steps three through four.

[0103] Iteration termination condition:

[0104] The number of iterations reached 50 rounds;

[0105] Global validation accuracy remained stable (no improvement for 5 consecutive rounds).

[0106] Step 6: Save the model

[0107] The server saves the final aggregated global model parameters and generates a deployable face recognition model file.

[0108] In this embodiment, the trained model described above is used for face recognition. The specific steps are as follows:

[0109] Step 1: Obtain the image to be processed

[0110] Store cameras capture facial images in real time and transmit them to an edge server.

[0111] The OpenCV face detection model automatically detects face bounding boxes in images. If no face is detected, it returns "No valid face".

[0112] Step 2: Preprocessing the images to be processed

[0113] Based on the detected face bounding boxes, the face region is cropped out and scaled to a specific pixel size (consistent with training).

[0114] Normalization: Scale the pixel values ​​to [-1, 1] (same as the first step of training).

[0115] Dimensional adjustment: Convert a single image into the model input format, i.e. (1, 3, 160, 160) (batch_size=1, 3 channels, size 160×160).

[0116] Step 3: Model Inference and Feature Extraction

[0117] The preprocessed image is input into the trained FaceNet model, which outputs a 128-dimensional face feature vector (without an activation function, directly output) through forward propagation.

[0118] Feature normalization: Normalizes the feature vectors to unit vectors (L2 normalization), eliminating the influence of vector length.

[0119] Step 4: Face recognition matching

[0120] Calculate the Euclidean distance between the feature to be identified and all features in the registered user feature database.

[0121] Threshold judgment: If the minimum distance is ≤1.0 (the threshold determined during training), the match is successful and the corresponding user ID is returned; if the minimum distance is >1.0, the match fails and "unregistered user" is returned.

[0122] Example 4

[0123] This embodiment 4 provides a non-transitory computer-readable storage medium for storing computer instructions. When the computer instructions are executed by the processor, they implement the robust aggregation method of federated learning that integrates layer-by-layer dynamic clustering and statistical adaptive selection, as described above. This method includes:

[0124] Layer-by-layer dynamic switching of clustering algorithms for clustering model updates: After the server fully receives the updated models from all clients participating in the model update, it initiates a hierarchical clustering mechanism to accurately identify benign updates; in this process, a randomized clustering algorithm selection strategy is introduced, which dynamically determines the clustering algorithm for the current layer by generating random numbers, thereby enhancing the robustness of the clustering effect;

[0125] Randomly select statistics for benign model updates: After completing cluster screening, the server selects the calculation method of statistics for the current layer through a random number generator to construct a global model update;

[0126] Update global model parameters: The server uses the global update generated from the benign updates selected from the layer-wise clustering to update the global model parameters in round t according to the following rules. :

[0127] ;

[0128] in, This represents the global model update in round t. To control the learning rate for updating the step size.

[0129] Example 5

[0130] This embodiment 5 provides a computer device, including a memory and a processor. The processor and the memory communicate with each other. The memory stores program instructions that can be executed by the processor. The processor calls the program instructions to execute the robust aggregation method of federated learning that combines layer-by-layer dynamic clustering and statistical adaptive selection, as described above. The method includes:

[0131] Layer-by-layer dynamic switching of clustering algorithms for clustering model updates: After the server fully receives the updated models from all clients participating in the model update, it initiates a hierarchical clustering mechanism to accurately identify benign updates; in this process, a randomized clustering algorithm selection strategy is introduced, which dynamically determines the clustering algorithm for the current layer by generating random numbers, thereby enhancing the robustness of the clustering effect;

[0132] Randomly select statistics for benign model updates: After completing cluster screening, the server selects the calculation method of statistics for the current layer through a random number generator to construct a global model update;

[0133] Update global model parameters: The server uses the global update generated from the benign updates selected from the layer-wise clustering to update the global model parameters in round t according to the following rules. :

[0134] ;

[0135] in, This represents the global model update in round t. To control the learning rate for updating the step size.

[0136] Example 6

[0137] This embodiment 6 provides an electronic device, including: a processor, a memory, and a computer program; wherein, the processor is connected to the memory, and the computer program is stored in the memory. When the electronic device is running, the processor executes the computer program stored in the memory to cause the electronic device to execute instructions for implementing the robust aggregation method of federated learning that integrates layer-by-layer dynamic clustering and statistical adaptive selection as described above. The method includes:

[0138] Layer-by-layer dynamic switching of clustering algorithms for clustering model updates: After the server fully receives the updated models from all clients participating in the model update, it initiates a hierarchical clustering mechanism to accurately identify benign updates; in this process, a randomized clustering algorithm selection strategy is introduced, which dynamically determines the clustering algorithm for the current layer by generating random numbers, thereby enhancing the robustness of the clustering effect;

[0139] Randomly select statistics for benign model updates: After completing cluster screening, the server selects the calculation method of statistics for the current layer through a random number generator to construct a global model update;

[0140] Update global model parameters: The server uses the global update generated from the benign updates selected from the layer-wise clustering to update the global model parameters in round t according to the following rules. :

[0141] ;

[0142] in, This represents the global model update in round t. To control the learning rate for updating the step size.

[0143] In summary, traditional aggregation methods have static and fixed rule systems. Attackers can reverse engineer the fixed aggregation logic on the server side and construct malicious model updates that meet preset screening conditions, thus circumventing detection mechanisms. This invention dynamically switches between clustering algorithms and adaptive optimization strategies for statistical calculations, making the aggregation rules unpredictable and effectively blocking attackers from launching attacks through reverse analysis. Traditional methods suffer from significant inter-layer homogenization: using a uniform aggregation strategy ignores the differences in characteristics between model layers, easily leading to information decay in key feature layers or excessive fusion of redundant features. This method innovatively introduces a hierarchical dynamic mechanism, achieving precise adaptation of model layer characteristics by independently and randomly selecting an appropriate clustering algorithm for each network layer, effectively balancing the needs of feature preservation and noise suppression.

[0144] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0145] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0146] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0147] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment, whereby a series of operational steps are performed to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0148] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that, based on the technical solutions disclosed in the present invention, various modifications or variations that can be made by those skilled in the art without creative effort should be included within the scope of protection of the present invention.

Claims

1. A robust aggregation method for federated learning that integrates layer-by-layer dynamic clustering and adaptive statistical selection, characterized in that, include: Layer-by-layer dynamic switching of clustering algorithms for clustering model updates: After the server fully receives the updated models from all clients participating in the model update, it initiates a hierarchical clustering mechanism to accurately identify benign updates; in this process, a randomized clustering algorithm selection strategy is introduced, which dynamically determines the clustering algorithm for the current layer by generating random numbers, thereby enhancing the robustness of the clustering effect; Randomly select statistics for benign model updates: After completing cluster screening, the server selects the calculation method of statistics for the current layer through a random number generator to construct a global model update; Update global model parameters: The server uses the global update generated from the benign updates selected from the layer-wise clustering to update the global model parameters in round t according to the following rules. : ; in, This represents the global model update in round t. To control the learning rate for updating the step size.

2. The robust aggregation method of federated learning that integrates layer-by-layer dynamic clustering and adaptive statistical selection as described in claim 1, characterized in that, The hierarchical clustering process is formally represented as: ; in, This represents the total number of model updates received. This represents the model update accepted at layer j for the i-th client in round t. This is the clustering algorithm for the current layer.

3. The robust aggregation method of federated learning that integrates layer-by-layer dynamic clustering and adaptive statistical selection as described in claim 2, characterized in that, Build a global model update: ; In the formula, Let f(·) represent the aggregation result of the j-th layer of the global model in the t-th round, where f(·) is a configurable statistical function.

4. A robust aggregation system for federated learning that integrates hierarchical dynamic clustering and adaptive statistical selection, characterized in that, include: The dynamic switching unit is used to dynamically switch clustering algorithms and clustering model updates layer by layer: After the server fully receives the updated models from all clients participating in the model update, it starts the hierarchical clustering mechanism to accurately identify benign updates; in this process, a randomized clustering algorithm selection strategy is introduced, which dynamically determines the clustering algorithm of the current layer by generating random numbers, thereby enhancing the robustness of the clustering effect; The selection unit is used to randomly select statistics for benign model updates: after completing the clustering screening, the server selects the calculation method of statistics for the current layer through a random number generator to construct a global model update; The global update unit is used to update the global model parameters: The server uses the global update generated from the benign updates selected from the layer-by-layer clustering to update the global model parameters in round t according to the following rules. : ; in, This represents the global model update in round t. To control the learning rate for updating the step size.

5. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium is used to store computer instructions, which, when executed by a processor, implement the multi-target cross-view tracking alarm method for personnel in railway operation areas that integrates spatiotemporal features as described in any one of claims 1-3.

6. A computer device, characterized in that, The system includes a memory and a processor, which communicate with each other. The memory stores program instructions that can be executed by the processor. The processor calls the program instructions to execute the multi-target cross-view tracking alarm method for personnel in railway operation areas that integrates spatiotemporal features as described in any one of claims 1-3.

7. An electronic device, characterized in that, include: The device includes a processor, a memory, and a computer program; wherein the processor is connected to the memory, and the computer program is stored in the memory. When the electronic device is running, the processor executes the computer program stored in the memory to cause the electronic device to execute instructions to implement the multi-target cross-view tracking alarm method for railway operation areas that integrates spatiotemporal features as described in any one of claims 1-3.