Federated learning dynamic aggregation method, system, device, medium and product
By constructing a twin layer on a central server and dynamically allocating clients using the K-means algorithm, the model aggregation strategy of air-ground federated learning is optimized, solving the problems of slow model convergence speed and high communication cost in traditional methods, and achieving more efficient and accurate model training.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NO 15 INST OF CHINA ELECTRONICS TECH GRP
- Filing Date
- 2025-08-06
- Publication Date
- 2026-04-21
AI Technical Summary
Traditional federated learning methods struggle to adapt to the dynamically changing computing power and network conditions of clients in air-to-ground federated learning scenarios. This results in slow model convergence, low accuracy, high communication latency and energy consumption, an inability to effectively handle differences in the quality and quantity of client data, and a lack of flexible aggregation and optimization mechanisms.
By introducing digital twin technology, a twin layer is built on a central server. Clients are dynamically assigned to target clusters using the K-means clustering algorithm. The optimal aggregation strategy is evaluated based on state information and model parameters to optimize the model aggregation process within and between clusters, thereby reducing ineffective participation and resource consumption.
It improves the training efficiency and accuracy of federated learning models, reduces communication costs and computing resource consumption, adapts to client heterogeneity and data distribution characteristics, and enhances the convergence speed and aggregation efficiency of models.
Smart Images

Figure CN121235144B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of artificial intelligence technology, and in particular relates to a method, system, device, medium and product for dynamic aggregation of federated learning. Background Technology
[0002] In recent years, air-to-ground federated learning, comprised of drone swarms and ground terminal equipment, has become a focus of attention in both academia and industry. These systems have demonstrated unique advantages in scenarios such as smart city monitoring and emergency communications. Drones can be rapidly deployed in complex terrains to collect edge data in real time, while ground equipment provides distributed computing support or supplements model parameters for local data training. However, the heterogeneity and dynamism of the participants in air-to-ground federated learning scenarios pose significant challenges. The high dynamism of numerous participating devices makes it difficult to maintain link stability using traditional model parameter aggregation strategies based on fixed topologies. The significant differences in resource distribution among heterogeneous devices often result in a large number of low-quality participants during training, affecting the convergence speed and final performance of the entire federated training model.
[0003] Traditional federated learning methods typically employ fixed client selection methods and model aggregation algorithms, making it difficult to adapt to dynamically changing client computing power and network conditions. In federated learning environments with highly heterogeneous data distributions, models trained on different clients may differ significantly, and different aggregation methods exhibit substantial performance variations under different data distributions and model structures. Choosing an inappropriate aggregation method can lead to problems such as slow model convergence and low accuracy. Summary of the Invention
[0004] This application provides a federated learning dynamic aggregation method, system, device, medium, and product to at least solve the problem of reduced model aggregation performance caused by heterogeneity of client data in related technologies.
[0005] In a first aspect, embodiments of this application provide a federated learning dynamic aggregation method, applied to a physical layer consisting of a central server, a drone cluster, and multiple client devices of ground terminals. A twin layer is constructed on the central server, and each of the client devices creates a corresponding digital twin model.
[0006] The method includes iteratively executing the following steps until a first preset stopping condition is met:
[0007] The central server broadcasts the initial global model parameters;
[0008] Multiple client devices respectively map their own state information and local model parameters to the twin layer. The state information includes dataset size, total latency, and total energy consumption.
[0009] The twin layer determines the target number of target clusters by calculating the average of the contour coefficients of multiple client devices based on the state information and local model parameters.
[0010] The twin layer uses the K-means clustering algorithm to assign multiple client devices to the corresponding target clusters;
[0011] For the assigned target clusters, the twin layer determines the optimal cluster aggregation strategy for intra-cluster aggregation and the optimal global aggregation strategy for inter-cluster aggregation based on the aggregation strategy performance evaluation index corresponding to the pre-aggregation strategy of multiple assigned target clusters, and sends the optimal cluster aggregation strategy and the optimal global aggregation strategy to the central server.
[0012] The central server performs aggregation according to the optimal cluster aggregation strategy to obtain a cluster model, and performs aggregation according to the optimal global aggregation strategy to obtain a global model, so that the total latency and total energy consumption of cluster model aggregation and global model aggregation are minimized.
[0013] The central server aggregates and updates the local model parameters based on the cluster model and the global model to obtain the updated global model parameters, and then broadcasts the updated global model parameters.
[0014] Secondly, this application provides a federated learning dynamic aggregation system, which includes a physical layer consisting of a central server, a drone cluster, and multiple client devices such as ground terminals. A twin layer is constructed on the central server, and each client device creates a corresponding digital twin model.
[0015] The federated learning dynamic aggregation system runs iteratively through the physical layer and the twin layer until a first preset stopping condition is met:
[0016] The central server is used to broadcast the global model parameters for initialization.
[0017] Multiple client devices are used to map their own state information and local model parameters to the twin layer, respectively. The state information includes dataset size, total latency, and total energy consumption.
[0018] The twin layer is used to determine the target number of target clusters by calculating the average of the contour coefficients of multiple client devices based on the state information and local model parameters; to allocate multiple client devices to corresponding target clusters using the K-means clustering algorithm; and to determine the optimal cluster aggregation strategy for intra-cluster aggregation and the optimal global aggregation strategy for inter-cluster aggregation based on the aggregation strategy performance evaluation index corresponding to the pre-aggregation strategy of multiple allocated target clusters, and to send the optimal cluster aggregation strategy and the optimal global aggregation strategy to the central server.
[0019] The central server is further configured to perform aggregation to obtain a cluster model based on the optimal cluster aggregation strategy, and perform aggregation to obtain a global model based on the optimal global aggregation strategy, so that the total latency and total energy consumption of cluster model aggregation and global model aggregation are minimized; and to perform aggregation and update of local model parameters based on the cluster model and global model to obtain updated global model parameters, and broadcast the updated global model parameters.
[0020] Thirdly, embodiments of this application provide an electronic device, which includes: a processor and a memory storing computer program instructions; the processor executes the computer program instructions to implement the steps of the federated learning dynamic aggregation method as described in any embodiment of the first aspect.
[0021] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement the steps of the federated learning dynamic aggregation method as described in any embodiment of the first aspect.
[0022] Fifthly, embodiments of this application provide a computer program product stored in a storage medium, the program product being executed by at least one processor to implement the steps of the federated learning dynamic aggregation method provided in the first aspect of embodiments of this application.
[0023] This application presents a federated learning dynamic aggregation method, system, device, medium, and product that introduces digital twin technology. It proposes a digital twin-based federated learning dynamic aggregation method, constructing a twin layer on the server for pre-aggregation performance evaluation. By pre-performing model aggregation simulation in a virtual environment, it dynamically selects the client and the optimal model aggregation method in each round of iterative training, improving the efficiency and accuracy of federated learning model training and reducing the participation of invalid clients, thereby lowering communication costs and computational resource consumption. Furthermore, the use of digital twin technology enables dynamic adjustment of the aggregation process, adapting to client heterogeneity and data distribution characteristics, improving model convergence speed and accuracy. Attached Figure Description
[0024] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a flowchart illustrating a federated learning dynamic aggregation method provided in an embodiment of this application;
[0026] Figure 2 This is a flowchart illustrating another federated learning dynamic aggregation method provided in an embodiment of this application;
[0027] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0028] Figure label:
[0029] Electronic device 300, processor 301, memory 302, communication interface 303, bus 310. Detailed Implementation
[0030] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0031] It should be noted that, in this document, relational 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 such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0032] In recent years, air-to-ground federated learning, comprised of drone swarms and ground terminal equipment, has become a focus of attention in both academia and industry. These systems have demonstrated unique advantages in scenarios such as smart city monitoring and emergency communications. Drones can be rapidly deployed in complex terrains to collect edge data in real time, while ground equipment provides distributed computing support or supplements model parameters for local data training. However, the heterogeneity and dynamism of the participants in air-to-ground federated learning scenarios pose significant challenges. The high dynamism of numerous participating devices makes it difficult to maintain link stability using traditional model parameter aggregation strategies based on fixed topologies. The significant differences in resource distribution among heterogeneous devices often result in a large number of low-quality participants during training, affecting the convergence speed and final performance of the entire federated training model.
[0033] Traditional federated learning methods typically employ fixed client selection methods and model aggregation algorithms, making it difficult to adapt to dynamically changing client computing power and network conditions. In federated learning environments with highly heterogeneous data distributions, models trained on different clients may differ significantly, and different aggregation methods exhibit substantial performance variations under different data distributions and model structures. Choosing an inappropriate aggregation method can lead to problems such as slow model convergence and low accuracy.
[0034] Specifically, federated learning, as an emerging distributed machine learning paradigm, enables collaborative training of data from multiple parties while protecting data privacy. Its core idea is that client devices (such as mobile terminals and IoT nodes) train the model locally using their own data, uploading only the model parameters, not the raw data, to the server. The server then performs aggregation operations on the collected client model parameters, generating a new global model, which is then distributed to the clients for use in the next round of training.
[0035] However, existing federated learning methods struggle to adapt to client heterogeneity through client selection strategies. They typically employ fixed methods, such as random selection or fixed rule selection, failing to comprehensively consider multi-dimensional characteristics like client computing power, data distribution, and network conditions. This results in low training efficiency, slow model convergence, and insufficient accuracy. Furthermore, existing federated learning methods suffer from high communication latency and energy consumption in large-scale client participation and complex network environments, failing to effectively reduce communication costs and computational resource consumption, thus limiting their application in large-scale federated learning scenarios. Moreover, existing methods are ill-suited to dynamically changing network environments, lacking effective mechanisms to handle abnormal situations such as client disconnections or network fluctuations. This compromises the stability and efficiency of federated learning, potentially leading to model training interruptions or performance degradation.
[0036] Traditional model aggregation methods cannot effectively handle differences in the quality and quantity of client data. They employ fixed aggregation strategies, such as simple averaging or weighted averaging, which are ill-suited for non-identically identically distributed (Non-IID) data environments, easily leading to model bias and affecting convergence speed and accuracy. Furthermore, related technologies lack flexible optimization mechanisms for the model aggregation process, failing to dynamically adjust clustering strategies and aggregation weights based on changes in client status. This limits the framework's flexibility and practicality, making it difficult to address complex real-world application scenarios.
[0037] To address the problems in related technologies, embodiments of this application provide a method, system, device, medium, and product for dynamic aggregation in federated learning. This method dynamically selects the client and model aggregation method in each round of iterative training, improving the efficiency and accuracy of federated learning model training. It solves the problems of low model aggregation efficiency and high communication costs caused by client heterogeneity in federated learning.
[0038] The federated learning dynamic aggregation method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0039] It should be noted that the federated learning dynamic aggregation method in this application embodiment is applied to the physical layer consisting of a central server, a drone cluster, and multiple client devices such as ground terminals. A twin layer is constructed on the central server, and each of the client devices creates a corresponding digital twin model.
[0040] In other words, the overall architecture is divided into a physical layer and a twin layer. Specifically, the physical layer mainly consists of a central server and multiple client devices (including drone swarms and ground terminals), responsible for the actual model training and parameter transmission tasks. The central server acts as a coordination center, managing the initialization, distribution, and aggregation of the global model, and communicating with the clients. The clients use local data to train the global model, update local model parameters, and upload these parameters back to the server. The twin layer is built on the central server, leveraging its high computing power to perform pre-aggregation strategy evaluation. This layer creates a corresponding digital twin for each physical client, mapping the client's state information in real time, including key parameters such as dataset size, total latency, and total energy consumption. The twin layer dynamically simulates and evaluates different aggregation strategies to select the optimal client combination and aggregation method, providing guidance for model aggregation in the physical layer.
[0041] Digital twins are a technological framework that uses digital technology to construct a virtual mapping of a physical entity and enables real-time interaction between the physical and virtual worlds. They possess five key characteristics: data-driven, model-supported, software-defined, precise mapping, and real-time feedback. The core idea is to use technologies such as sensors, the Internet of Things (IoT), big data, and artificial intelligence (AI) to synchronize the state, behavior, and environmental data of a physical entity to a virtual model in real time, thereby enabling the monitoring, prediction, optimization, and control of the physical entity. The core value of digital twins lies in achieving full lifecycle management of physical entities through virtual-physical integration, thereby improving efficiency, reducing costs, and mitigating risks.
[0042] Figure 1 A flowchart illustrating a federated learning dynamic aggregation method according to an embodiment of this application is shown.
[0043] It should be noted that this federated learning dynamic aggregation method includes iterative execution. Figure 1 The steps shown herein continue until a first preset stopping condition is met. Specifically, the first preset stopping condition includes: the parameters of the trained federated learning model converge, or the number of training iterations reaches a first preset threshold.
[0044] like Figure 1 As shown, this federated learning dynamic aggregation method may specifically include the following steps:
[0045] S101, The central server broadcasts the initial global model parameters;
[0046] S102. Multiple client devices respectively map their own state information and local model parameters to the twin layer. The state information includes dataset size, total latency, and total energy consumption.
[0047] S103. The twin layer determines the target number of target clusters by calculating the average of the contour coefficients of multiple client devices based on the state information and local model parameters.
[0048] S104. The twin layer uses the K-means clustering algorithm to assign multiple client devices to the corresponding target clusters;
[0049] S105. For the allocated target clusters, the twin layer determines the optimal cluster aggregation strategy for intra-cluster aggregation and the optimal global aggregation strategy for inter-cluster aggregation based on the aggregation strategy performance evaluation index corresponding to the pre-aggregation strategy of multiple allocated target clusters, and sends the optimal cluster aggregation strategy and the optimal global aggregation strategy to the central server.
[0050] S106. The central server performs aggregation according to the optimal cluster aggregation strategy to obtain a cluster model, and performs aggregation according to the optimal global aggregation strategy to obtain a global model, so that the total latency and total energy consumption of cluster model aggregation and the total latency and total energy consumption of global model aggregation are minimized.
[0051] S107. The central server aggregates and updates the local model parameters based on the cluster model and the global model to obtain the updated global model parameters, and broadcasts the updated global model parameters.
[0052] Therefore, this paper introduces digital twin technology and proposes a dynamic aggregation method for federated learning based on digital twins. A twin layer is constructed on the server for pre-aggregation performance evaluation of the model. By pre-simulating model aggregation in a virtual environment, the optimal model aggregation method is dynamically selected for each round of training iterations. This improves the efficiency and accuracy of federated learning model training and reduces the participation of invalid clients, thereby lowering communication costs and computational resource consumption. Furthermore, the use of digital twin technology enables dynamic adjustment of the aggregation process to adapt to client heterogeneity and data distribution characteristics, improving the model's convergence speed and accuracy.
[0053] The specific implementation methods for each of the above steps are described below.
[0054] In some embodiments, in S101, the central server broadcasts the training task and initializes the global model parameters. It requests all terminal devices and edge servers participating in the training task to report their local information; and the central server determines the channel environment of the terminal devices based on the latency and error rate when broadcasting parameters.
[0055] Optionally, the training task broadcast by the central server is: to train the target model of federated learning using the data, i.e., to minimize the global loss function.
[0056] ;
[0057] in, Indicates the target model parameters. This represents the theoretically optimal model parameters for federated learning training. This represents the global loss function across the dataset for all devices.
[0058] Optionally, local information for the terminal device may include, but is not limited to: device geographic location, mobility speed, communication resources, computing resources, and local data volume and distribution.
[0059] In some embodiments, in S103, for each client device, a feature vector is defined based on the dataset size, total latency, and total energy consumption of the client device; based on the feature vector, the Euclidean distance between the client devices in the twin layer is calculated; the range of values for the number of clusters is set, and the clustering method corresponding to each value of the number of clusters is calculated using the K-means clustering algorithm; for each clustering method, the average value of the silhouette coefficients of all client devices is calculated; the number of clusters corresponding to the clustering method with the maximum value of the average value is determined as the target number of clusters.
[0060] K-means is a classic unsupervised clustering algorithm widely used in data mining, pattern recognition, machine learning, and other fields. Its main goal is to divide samples in a dataset into clusters such that samples within each cluster are as similar as possible, while samples between different clusters are as different as possible. The basic idea of K-means is to iteratively optimize the cluster division, maximizing the similarity between samples within a cluster and its cluster center, while minimizing the similarity between samples between different clusters and their respective cluster centers.
[0061] In practice, for each clustering method, the average profile coefficient of all client devices is calculated according to the following formula:
[0062] ;
[0063] ;
[0064] ;
[0065] ;
[0066] in, This represents the average value of the profile coefficients; Indicates the total number of client devices; The range of values is Furthermore, the closer the clustering result is to 1, the better the clustering effect. Indicates client device The contour coefficient, with a value range of The closer the value is to 1, the more reasonable the client-side clustering is and the better the clustering effect. Indicates the cluster where the client device belongs. Intra-cluster distance; Cluster Number of client devices within; Indicates client device With client devices The Euclidean distance between them; This represents the average distance between a client device and its nearest cluster. A larger value indicates a higher degree of separation between the client and other clusters, and a better clustering effect. Indicates except Other clusters besides; Indicates client device With client devices The Euclidean distance between them.
[0067] In some embodiments, in S104, a target number of initial cluster centers are randomly selected in the twin layer; a client-cluster center Euclidean distance matrix is constructed, where each element of the Euclidean distance matrix represents the Euclidean distance between any client device and any initial cluster center; for each client device, the initial cluster center corresponding to the element with the minimum Euclidean distance in the Euclidean distance matrix is determined as the cluster matching the client device; for each cluster, the average value of the feature vectors of multiple client devices within the cluster is calculated to obtain the updated cluster center; the process returns to the step of constructing the client-cluster center Euclidean distance matrix until a second preset stopping condition is met, resulting in target clusters matching each client device.
[0068] In practice, for each cluster, the average value of the feature vectors of multiple client devices within the cluster is calculated according to the following formula to obtain the updated cluster center:
[0069] ;
[0070] in, Indicates the first twin layer The updated cluster centers of each cluster. I represents the number of targets; Indicates the first The number of client devices within a cluster; This indicates the round in which cluster centers are updated during the clustering process; Indicates client device eigenvectors.
[0071] As an optional embodiment, the second preset stopping condition includes: the change in all cluster centers is less than a second preset threshold, or the number of iterations reaches a third preset threshold. That is, if the second preset stopping condition is met, the algorithm in S104 converges and stops iterating.
[0072] In some embodiments, in S105, the target cluster is calculated for each target cluster. Efficiency rating of client devices: Sort multiple client devices from highest to lowest according to the efficiency rating, and then select the top-ranked devices. Generate a client list for each client device. According to the client list An aggregation strategy matrix is constructed using the model aggregation algorithm space. Each element in the aggregation strategy matrix represents a pre-aggregation strategy. The model aggregation algorithm space includes four model aggregation algorithms: simple averaging, weighted averaging, model performance weighting, and model difference weighting. The pre-aggregation strategy corresponding to the maximum value of the aggregation strategy performance evaluation index in the aggregation strategy matrix is determined as the optimal cluster aggregation strategy for intra-cluster aggregation.
[0073] In practice, for each target cluster, the target cluster is calculated according to the following formula. Efficiency rating of client devices within the system:
[0074] ;
[0075] ;
[0076] ;
[0077] in, Indicates efficiency rating; All represent weighting coefficients; This represents the total power consumption of the client device. This indicates the communication power consumption of the client device. This indicates the computing power consumption of the client device; This represents the total latency of the client device. Indicates the communication latency of the client device. This represents the computation latency of the client device; k represents the training round.
[0078] In this embodiment, to address the model bias problem caused by client heterogeneity, the K-means algorithm is introduced to dynamically cluster clients. Different model aggregation strategies are formulated for each cluster, including a list of participating clients and a model aggregation method. Through a hierarchical aggregation evaluation strategy, the optimal model aggregation strategy is selected for intra-cluster and inter-cluster aggregation, thereby significantly improving the efficiency and accuracy of model aggregation. To address the low communication efficiency and resource waste caused by inefficient clients, digital twin technology is introduced into federated learning. By constructing digital twin models of clients, model aggregation strategies are evaluated in a virtual environment, thereby selecting the most suitable clients and aggregation methods. This not only significantly improves the efficiency and accuracy of model aggregation but also dynamically optimizes the aggregation strategy based on the pre-aggregation evaluation results, greatly enhancing the flexibility and intelligence of the model training process.
[0079] In addition, this application also provides another dynamic aggregation method for federated learning, which considers multiple key constraints such as latency and energy consumption in the communication, computation, and aggregation processes of federated learning networks involving heterogeneous devices in edge computing scenarios. This method enables an efficient federated learning model aggregation mechanism, dynamically selecting the client and model aggregation method in each round of iterative training, thereby improving the efficiency and accuracy of federated learning model training.
[0080] refer to Figure 2 This is a flowchart illustrating another federated learning dynamic aggregation method according to an embodiment of this application. Figure 2 As shown, its specific implementation method can be described as follows, that is, the following steps S1 to S7 are executed:
[0081] Step S1: For edge federated learning scenarios, the central server broadcasts the training task and initializes the global model parameters, and requests all terminal devices and edge servers participating in the training task to report their local information.
[0082] The specific process of step S1 is as follows:
[0083] The training task and global model parameter initialization are broadcast by the central server. Specifically, the training task refers to using data to train the target model of federated learning, that is, minimizing the global loss function.
[0084] That is, the target model depends on the optimization problem:
[0085] ;
[0086] in, Indicates the target model parameters. This represents the theoretically optimal model parameters for federated learning training. This represents the global loss function across the dataset for all devices.
[0087] Furthermore, the local information mentioned in step S1 may include information such as the device's geographical location, movement speed, communication resources, computing resources, and local data volume and distribution. At the same time, the central server will determine the channel environment of the terminal device based on the latency and error rate when broadcasting parameters.
[0088] Step S2: Based on their respective training data and local model parameters, the terminal devices iteratively optimize the initial model parameters broadcast by the central server to obtain the optimized local model parameters for each target user.
[0089] Step S3: Based on the model broadcast feedback from the central server to all participating devices, determine the optimal number of clusters using the silhouette coefficient method. .
[0090] The specific steps of step S3 include the following steps S3.1 to S3.3:
[0091] Step S3.1: From the dataset size Total latency Total energy consumption Three dimensions define the client's feature vector Ideally, the features of the twin layer are exactly the same as those of the physical layer, therefore the feature vector can be represented as:
[0092] ;
[0093] The total energy consumption of the client includes communication energy consumption and computing energy consumption, namely: The delay takes into account both communication and computation delays, so in the first... The total client latency in each iteration is: .
[0094] Step S3.2: The silhouette coefficient method is a metric used to evaluate cluster quality and helps determine the optimal number of clusters. The silhouette coefficient is used to evaluate clustering performance by measuring the cluster tightness and separation of each sample.
[0095] Optional, profile coefficients for each client. Defined as:
[0096] ;
[0097] ;
[0098] ;
[0099] in, This represents the average value of the profile coefficients; Indicates the total number of client devices; The range of values is Furthermore, the closer the clustering result is to 1, the better the clustering effect. Indicates client device The contour coefficient, with a value range of The closer the value is to 1, the more reasonable the client-side clustering is and the better the clustering effect. Indicates the cluster where the client device belongs. Intra-cluster distance; Cluster Number of client devices within; Indicates client device With client devices The Euclidean distance between them; This represents the average distance between a client device and its nearest cluster. A larger value indicates a higher degree of separation between the client and other clusters, and a better clustering effect. Indicates except Other clusters besides; Indicates client device With client devices The Euclidean distance between them.
[0100] As an optional implementation, the Euclidean distance between clients in the Siamese layers, i.e., the cluster, can be calculated using the defined feature vectors according to the following formula. Client devices within With client devices Euclidean distance between them:
[0101] .
[0102] Step S3.3: First, set the number of clusters. The range of values Then for each The K-means algorithm is executed to obtain clustering results, and then the silhouette coefficient for each client is calculated. and the average profile coefficient of all clients Choose the largest Corresponding The value is used as the optimal number of clusters (number of sub-clusters).
[0103] Optionally, the average of all client silhouette coefficients can be calculated using the following formula to evaluate the clustering effect of the entire client set:
[0104] ;
[0105] in, Indicates the total number of clients; The range of values is The closer the value is to 1, the better the clustering effect of the client.
[0106] Step S4: Construct an effective cluster topology for federated learning using a clustering algorithm. Clustering refers to the process of dividing a given set of objects into multiple disjoint clusters according to predefined clustering criteria, making objects in the same cluster more similar to objects in different clusters. Specifically, this embodiment uses a client-side clustering algorithm based on K-means to... One client and corresponding The cluster centers are matched. The specific steps include steps S4.1 to S4.4 as follows:
[0107] Step S4.1: Initialize cluster centers, randomly select Feature vectors of each client As the initial cluster center :
[0108] ;
[0109] in, Indicates the first twin layer The initial center of each cluster.
[0110] Step S4.2: To optimize computational efficiency, pre-calculate the Euclidean distance between clients, and then create a [process / system] based on the Euclidean distance. Client-Cluster Center Euclidean Distance Matrix of Rank As shown in Table 1 below.
[0111] Table 1
[0112]
[0113] It is understandable that in the matrix In, each element This represents the distance between the corresponding client and the cluster center. and Therefore, through the matrix Search Different rows and Given the values of each distinct column, find the minimum Euclidean distance (excluding 0) between the client and all cluster centers. Assign the client to the corresponding cluster.
[0114] Step S4.3: For each cluster, calculate the mean of all client feature vectors within that cluster using the following formula to update the cluster centers:
[0115] ;
[0116] in, Indicates the first The number of clients per cluster; This indicates the round in which cluster centers are updated during the clustering process.
[0117] Step S4.4: Repeat steps S4.2 and S4.3 until the change in all cluster centers is less than a preset threshold. Or reach the preset number of iterations If the algorithm converges, the iteration stops.
[0118] Step S5: Evaluate the aggregation performance of different clusters using a hierarchical strategy and derive the optimal aggregation strategy. Specifically, through hierarchical aggregation evaluation, after completing dynamic clustering, each cluster... Include There are 10 client-side clusters. To optimize the model aggregation effect, different combinations of pre-aggregation evaluations are performed on the client-side models within each cluster and the cluster models obtained from aggregation of each cluster.
[0119] The specific steps include the following steps S5.1 to S5.5:
[0120] Step S5.1: Calculate the client's efficiency score based on latency and energy consumption using the following formula. :
[0121] ;
[0122] ;
[0123] ;
[0124] in, This represents the weighting coefficient.
[0125] Then, the clusters are ranked from largest to smallest according to their efficiency scores. Sort the clients within the list to obtain the client list. It includes the top performers in the efficiency score ranking from largest to smallest. One client.
[0126] Step S5.2: Based on the client list and model aggregation algorithm space Construct an aggregation strategy matrix, where each element represents an aggregation strategy.
[0127] Optional, aggregation strategy matrix Represented as:
[0128] ;
[0129] in, This represents the list of clients participating in the aggregation within the cluster. Indicates the aggregation strategy, This represents the algorithms in the model aggregation algorithm space.
[0130] Optionally, the model aggregation algorithm space includes four types of model aggregation algorithms: simple averaging, weighted averaging, model performance weighting, and model difference weighting, which can be represented as:
[0131] ;
[0132] in, This represents the simple averaging algorithm. This indicates the weighted average algorithm. This represents the performance-weighted algorithm for the model. This represents the model difference weighting algorithm.
[0133] Step S5.3: Evaluate the aggregation strategy. The objective defined in this invention is to select a subset of clients and models participating in the aggregation in each round, so that the aggregation method... To minimize the total latency and total energy consumption after rounds of iterative training, the iteration latency of intra-cluster training is chosen. Iteration energy consumption Accuracy of the aggregated model on the validation set As a metric for evaluating the performance of aggregation strategies.
[0134] Optionally, the aggregation strategy evaluation calculation formula is as follows:
[0135] ;
[0136] ;
[0137] ;
[0138] in, This represents the weighting factor, used to measure the contribution of different evaluation indicators to the evaluation results; This represents the overall latency when a certain aggregation strategy is used in the k-th round of training, including communication latency, computation latency, and aggregation latency; This represents the overall energy consumption when a certain aggregation strategy is adopted, including communication energy consumption, computing energy consumption, and aggregation energy consumption; Cluster The accuracy of the cluster model obtained by aggregation.
[0139] Step S5.4: Aggregate models for all clusters Constructing the aggregation strategy matrix Different cluster model combinations and aggregation methods were explored, and the performance of the aggregated cluster models was calculated. The aggregation effects of different combinations were compared, and the strategy with the lowest evaluation score was selected. As the optimal strategy for global model aggregation This strategy includes a list of cluster models participating in global aggregation and the aggregation method.
[0140] Step S5.5: The twin layer applies the optimal cluster aggregation strategy. With the optimal global aggregation strategy The data is sent to a central server, which performs aggregation at the physical layer, initially based on the optimal cluster aggregation strategy. Aggregation yields cluster model Then, based on the optimal global aggregation strategy Perform aggregation to obtain the global model During the global aggregation process, a personalized client aggregation strategy is adopted for the aggregation of cluster models, dynamically selecting clients and model aggregation methods to minimize the total latency and energy consumption of the cluster model aggregation. Secondly, when performing global aggregation of cluster models, the pre-aggregation strategy is evaluated again to determine the cluster models and global aggregation methods participating in the global aggregation, minimizing the total latency and energy consumption of the global model aggregation.
[0141] Step S6: Based on the global round aggregation relay selection strategy, aggregate and upload all optimized local model parameters. The central server and edge servers aggregate and update the uploaded model parameters to obtain global model parameters, and then broadcast them to the terminal devices participating in training.
[0142] Step S7: Continue the edge federated learning model iterative training in the manner of steps S1 to S6 until the model parameters converge or the total number of iterations J preset for the task is reached.
[0143] Therefore, a federated learning dynamic aggregation method based on K-means and hierarchical evaluation constructs a twin layer on a central server. By establishing digital twin models of clients, model aggregation is pre-simulated in a virtual environment to select the optimal aggregation strategy. In each iteration, the client maps its own state information and local model parameters to the twin layer. The twin layer uses the K-means dynamic clustering algorithm to cluster the clients and evaluates the aggregation effect of different cluster combinations, selecting the optimal aggregation strategy, which includes the client list and aggregation method, for pre-aggregation. Subsequently, the edge server performs global aggregation of the client models according to the strategy provided by the twin layer. This significantly improves the model convergence speed and accuracy of federated learning while reducing communication latency and energy consumption, effectively adapting to client heterogeneity, and providing an efficient and flexible solution for distributed machine learning.
[0144] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0145] Based on the same technical concept, corresponding to any of the above embodiments, this application also provides a federated learning dynamic aggregation system.
[0146] The federated learning dynamic aggregation system may include: a physical layer consisting of a central server and multiple client devices such as drone clusters and ground terminals; a twin layer is constructed on the central server; and each client device creates a corresponding digital twin model.
[0147] In other words, the overall system architecture is divided into a physical layer and a twin layer. Specifically, the physical layer mainly consists of a central server and multiple client devices (including drone swarms and ground terminals), responsible for the actual model training and parameter transmission tasks. The central server acts as a coordination center, managing the initialization, distribution, and aggregation of the global model, and communicating with the clients. The clients use local data to train the global model, update local model parameters, and upload these parameters back to the server. The twin layer is built on the central server, leveraging its high computing power to perform pre-aggregation strategy evaluation. This layer creates a corresponding digital twin for each physical client, mapping the client's state information in real time, including key parameters such as dataset size, total latency, and total energy consumption. The twin layer dynamically simulates and evaluates different aggregation strategies to select the optimal client combination and aggregation method, providing guidance for model aggregation in the physical layer.
[0148] It should be noted that this application describes the city's federated learning dynamic aggregation system as iteratively running through the physical layer and twin layer until the first preset stopping condition is met.
[0149] Specifically, the central server is used to broadcast the global model parameters for initialization;
[0150] Multiple client devices are used to map their own state information and local model parameters to the twin layer, respectively. The state information includes dataset size, total latency, and total energy consumption.
[0151] The twin layer is used to determine the target number of target clusters by calculating the average of the contour coefficients of multiple client devices based on the state information and local model parameters; to allocate multiple client devices to corresponding target clusters using the K-means clustering algorithm; and to determine the optimal cluster aggregation strategy for intra-cluster aggregation and the optimal global aggregation strategy for inter-cluster aggregation based on the aggregation strategy performance evaluation index corresponding to the pre-aggregation strategy of multiple allocated target clusters, and to send the optimal cluster aggregation strategy and the optimal global aggregation strategy to the central server.
[0152] The central server is further configured to perform aggregation to obtain a cluster model based on the optimal cluster aggregation strategy, and perform aggregation to obtain a global model based on the optimal global aggregation strategy, so that the total latency and total energy consumption of cluster model aggregation and global model aggregation are minimized; and to perform aggregation and update of local model parameters based on the cluster model and global model to obtain updated global model parameters, and broadcast the updated global model parameters.
[0153] In some optional embodiments, the twin layer determines the target number of clusters by calculating the average of the silhouette coefficients of multiple client devices based on the state information and local model parameters. This includes: defining a feature vector for each client device based on its dataset size, total latency, and total energy consumption; calculating the Euclidean distance between client devices in the twin layer based on the feature vectors; setting a range for the number of clusters and using the K-means clustering algorithm to calculate the clustering method corresponding to each value of the number of clusters; calculating the average of the silhouette coefficients of all client devices for each clustering method; and determining the number of clusters in the clustering method corresponding to the maximum value of the average as the target number of clusters.
[0154] In some optional embodiments, calculating the average silhouette coefficient of all client devices for each clustering method includes: calculating the average silhouette coefficient of all client devices for each clustering method according to the following formula: ; ;
[0155] ; ;in, This represents the average value of the profile coefficients; Indicates the total number of client devices; The range of values is Furthermore, the closer the clustering result is to 1, the better the clustering effect. Indicates client device The contour coefficient, with a value range of The closer the value is to 1, the more reasonable the client-side clustering is and the better the clustering effect. Indicates the cluster where the client device belongs. Intra-cluster distance; Cluster Number of client devices within; Indicates client device With client devices The Euclidean distance between them; This represents the average distance between a client device and its nearest cluster. A larger value indicates a higher degree of separation between the client and other clusters, and a better clustering effect. Indicates except Other clusters besides; Indicates client device With client devices The Euclidean distance between them.
[0156] In some optional embodiments, the twin layer uses the K-means clustering algorithm to assign multiple client devices to corresponding target clusters, including: randomly selecting an initial number of cluster centers in the twin layer; constructing a client-cluster center Euclidean distance matrix, where each element of the Euclidean distance matrix represents the Euclidean distance between any client device and any initial cluster center; for each client device, determining the initial cluster center corresponding to the element with the minimum Euclidean distance in the Euclidean distance matrix as the cluster matching the client device; and for each cluster, calculating the average of the feature vectors of multiple client devices within the cluster according to the following formula to obtain the updated cluster center: ;in, Indicates the first twin layer The updated cluster centers of each cluster. I represents the number of targets; Indicates the first The number of client devices within a cluster; This indicates the round in which cluster centers are updated during the clustering process; Indicates client device The feature vectors are then returned to the step of constructing the client-cluster center Euclidean distance matrix until the second preset stopping condition is met, resulting in target clusters that match each client device.
[0157] In some optional embodiments, for the assigned target clusters, the Siamese layer determines the optimal cluster aggregation strategy for intra-cluster aggregation based on the aggregation strategy performance evaluation index corresponding to the pre-aggregation strategies of multiple assigned target clusters, including: for each target cluster, calculating the target cluster... Efficiency rating of client devices: Sort multiple client devices from highest to lowest according to the efficiency rating, and then select the top-ranked devices. Generate a client list for each client device. According to the client list An aggregation strategy matrix is constructed using the model aggregation algorithm space. Each element in the aggregation strategy matrix represents a pre-aggregation strategy. The model aggregation algorithm space includes four model aggregation algorithms: simple averaging, weighted averaging, model performance weighting, and model difference weighting. The pre-aggregation strategy corresponding to the maximum value of the aggregation strategy performance evaluation index in the aggregation strategy matrix is determined as the optimal cluster aggregation strategy for intra-cluster aggregation.
[0158] In some optional embodiments, the step of calculating the target cluster for each target cluster is... The efficiency score for client devices within the cluster includes: for each target cluster, the following formula is used to calculate the target cluster's performance. Efficiency rating of client devices within the system: ; ; ;in, Indicates efficiency rating; All represent weighting coefficients; This represents the total power consumption of the client device. This indicates the communication power consumption of the client device. This indicates the computing power consumption of the client device; This represents the total latency of the client device. Indicates the communication latency of the client device. This represents the computation latency of the client device; k represents the training round.
[0159] It should be noted that, for ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.
[0160] The apparatus of the above embodiments is used to implement the corresponding federated learning dynamic aggregation method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0161] Based on the same technical concept, corresponding to any of the above embodiments, this application also provides an electronic device.
[0162] Figure 3 A schematic diagram of a more specific electronic device hardware structure provided in this embodiment is shown.
[0163] The electronic device 300 may include a processor 301 and a memory 302 storing computer program instructions.
[0164] Specifically, the processor 301 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0165] Memory 302 may include mass storage for data or instructions. For example, and not limitingly, memory 302 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 302 may include removable or non-removable (or fixed) media. Where appropriate, memory 302 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 302 is non-volatile solid-state memory.
[0166] In certain embodiments, the memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Thus, generally, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this application.
[0167] The processor 301 implements any of the federated learning dynamic aggregation methods in the above embodiments by reading and executing computer program instructions stored in the memory 302.
[0168] In some examples, the electronic device 300 may also include a communication interface 303 and a bus 310. For example, Figure 3 As shown, the processor 301, memory 302, and communication interface 303 are connected through bus 310 and complete communication with each other.
[0169] The communication interface 303 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0170] Bus 310 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not as a limitation, bus 310 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 310 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0171] For example, the electronic device 300 can be a mobile phone, tablet computer, laptop computer, handheld computer, in-vehicle electronic device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc.
[0172] Based on the same technical concept, corresponding to any of the methods in the above embodiments, this application also provides a non-transitory computer-readable storage medium. This computer-readable storage medium stores computer program instructions; when executed by a processor, these computer program instructions implement any of the federated learning dynamic aggregation methods in the above embodiments. Examples of computer-readable storage media include non-transitory computer-readable storage media, such as portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, etc.
[0173] Based on the same technical concept, corresponding to any of the above embodiments, this application also provides a computer program product, which includes computer program instructions. In some embodiments, the computer program instructions can be executed by one or more processors of a computer to cause the computer and / or the processors to perform the federated learning dynamic aggregation method. Corresponding to the execution entity for each step in each embodiment of the federated learning dynamic aggregation method, the processor executing the corresponding step can belong to the corresponding execution entity.
[0174] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0175] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0176] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0177] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block in 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, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0178] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A federated learning dynamic aggregation method, characterized in that, It is applied to the physical layer consisting of a central server, a drone cluster, and multiple client devices, including ground terminals. A twin layer is built on the central server, and each client device has a corresponding digital twin model. The method includes iteratively executing the following steps until a first preset stopping condition is met: The central server broadcasts the initial global model parameters; Multiple client devices respectively map their own state information and local model parameters to the twin layer. The state information includes dataset size, total latency, and total energy consumption. The twin layer determines the target number of target clusters by calculating the average of the contour coefficients of multiple client devices based on the state information and local model parameters. The twin layer uses the K-means clustering algorithm to assign multiple client devices to the corresponding target clusters; For the assigned target clusters, the twin layer determines the optimal cluster aggregation strategy for intra-cluster aggregation and the optimal global aggregation strategy for inter-cluster aggregation based on the aggregation strategy performance evaluation index corresponding to the pre-aggregation strategy of multiple assigned target clusters, and sends the optimal cluster aggregation strategy and the optimal global aggregation strategy to the central server. The central server performs aggregation according to the optimal cluster aggregation strategy to obtain a cluster model, and performs aggregation according to the optimal global aggregation strategy to obtain a global model, so that the total latency and total energy consumption of cluster model aggregation and global model aggregation are minimized. The central server aggregates and updates the local model parameters based on the cluster model and the global model to obtain the updated global model parameters, and then broadcasts the updated global model parameters.
2. The method according to claim 1, characterized in that, The twin layer determines the target number of target clusters by calculating the average of the contour coefficients of multiple client devices based on the state information and local model parameters, including: For each client device, a feature vector is defined based on the client device's dataset size, total latency, and total energy consumption. Based on the feature vector, calculate the Euclidean distance between the client devices in the twin layer; Define the range of values for the number of clusters, and use the K-means clustering algorithm to calculate the clustering method corresponding to each value of the number of clusters. For each clustering method, calculate the average profile coefficient of all client devices; The number of clusters corresponding to the maximum value of the average value is determined as the target number of clusters.
3. The method according to claim 2, characterized in that, The step of calculating the average silhouette coefficient of all client devices for each clustering method includes: For each clustering method, the average silhouette coefficient of all client devices is calculated according to the following formula: ; ; ; ; in, This represents the average value of the profile coefficients; Indicates the total number of client devices; The range of values is Furthermore, the closer the clustering result is to 1, the better the clustering effect. Indicates client device The contour coefficient, with a value range of The closer the value is to 1, the more reasonable the client-side clustering is and the better the clustering effect. Indicates the cluster where the client device belongs. Intra-cluster distance; Cluster Number of client devices within; Indicates client device With client devices The Euclidean distance between them; This represents the average distance between a client device and its nearest cluster. A larger value indicates a higher degree of separation between the client and other clusters, and a better clustering effect. Indicates except Other clusters besides; Indicates client device With client devices The Euclidean distance between them.
4. The method according to claim 3, characterized in that, The twin layer uses the K-means clustering algorithm to assign multiple client devices to corresponding target clusters, including: Randomly select the initial cluster centers of the target number in the twin layer; Construct a client-cluster center Euclidean distance matrix, where each element of the Euclidean distance matrix represents the Euclidean distance between any client device and any initial cluster center; For each client device, the initial cluster center of the element corresponding to the minimum Euclidean distance in the Euclidean distance matrix is determined as the cluster that matches the client device; For each cluster, the average of the feature vectors of multiple client devices within the cluster is calculated according to the following formula to obtain the updated cluster centers: ; in, Indicates the first twin layer The updated cluster centers of each cluster. I represents the number of targets; Indicates the first The number of client devices within a cluster; This indicates the round in which cluster centers are updated during the clustering process; Indicates client device eigenvectors; Return to the step of constructing the client-cluster center Euclidean distance matrix until the second preset stopping condition is met, and obtain the target clusters that match each client device.
5. The method according to claim 1, characterized in that, For the assigned target clusters, the twin layer determines the optimal cluster aggregation strategy for intra-cluster aggregation based on the aggregation strategy performance evaluation metrics corresponding to the pre-aggregation strategies of multiple assigned target clusters, including: For each target cluster, calculate the target cluster. Efficiency rating of client devices within the system; Sort multiple client devices according to their efficiency scores from highest to lowest, and then select the top-ranked devices. Generate a client list for each client device. ; According to the client list An aggregation strategy matrix is constructed using the model aggregation algorithm space. Each element in the aggregation strategy matrix represents a pre-aggregation strategy. The model aggregation algorithm space includes four model aggregation algorithms: simple average, weighted average, model performance weighted, and model difference weighted. The pre-aggregation strategy corresponding to the maximum value of the aggregation strategy performance evaluation index in the aggregation strategy matrix is determined as the optimal cluster aggregation strategy for intra-cluster aggregation.
6. The method according to claim 5, characterized in that, For each target cluster, the target cluster is calculated. The efficiency score of the client devices within the system includes: For each target cluster, the target cluster is calculated according to the following formula. Efficiency rating of client devices within the system: ; ; ; in, Indicates efficiency rating; All represent weighting coefficients; This represents the total power consumption of the client device. This indicates the communication power consumption of the client device. This indicates the computing power consumption of the client device; This represents the total latency of the client device. Indicates the communication latency of the client device. This represents the computation latency of the client device; k represents the training round.
7. A federated learning dynamic aggregation system, characterized in that, The system includes a physical layer consisting of a central server, a cluster of drones, and multiple client devices such as ground terminals. A twin layer is built on the central server, and each client device creates a corresponding digital twin model. The federated learning dynamic aggregation system runs iteratively through the physical layer and twin layer until the first preset stopping condition is met; The central server is used to broadcast the global model parameters for initialization. Multiple client devices are used to map their own state information and local model parameters to the twin layer, respectively. The state information includes dataset size, total latency, and total energy consumption. The twin layer is used to determine the target number of target clusters by calculating the average of the contour coefficients of multiple client devices based on the state information and local model parameters. Using the K-means clustering algorithm, multiple client devices are assigned to corresponding target clusters. For each assigned target cluster, the optimal cluster aggregation strategy for intra-cluster aggregation and the optimal global aggregation strategy for inter-cluster aggregation are determined based on the aggregation strategy performance evaluation index corresponding to the pre-aggregation strategy of the multiple assigned target clusters. The optimal cluster aggregation strategy and the optimal global aggregation strategy are then sent to the central server. The central server is further configured to perform aggregation to obtain a cluster model based on the optimal cluster aggregation strategy, and perform aggregation to obtain a global model based on the optimal global aggregation strategy, so that the total latency and total energy consumption of cluster model aggregation and global model aggregation are minimized; and to perform aggregation and update of local model parameters based on the cluster model and global model to obtain updated global model parameters, and broadcast the updated global model parameters.
8. An electronic device, characterized in that, The device includes: a processor and a memory storing computer program instructions; the processor, when invoking the computer program instructions, implements the federated learning dynamic aggregation method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when invoked by a processor, implement the federated learning dynamic aggregation method as described in any one of claims 1-6.
10. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device performs the federated learning dynamic aggregation method as described in any one of claims 1-6.
Citation Information
Patent Citations
Excitation method for federated learning driven by digital twinning in air-ground network
CN112367109A
Digital twin factory data communication and privacy protection method
CN119254803A