User selection and resource optimization method under unmanned aerial vehicle assisted federated learning architecture

By using the ant colony algorithm and clustering thinking in federated learning to optimize user equipment scheduling and resource block allocation, the problems of equipment heterogeneity and limited communication resources are solved, training efficiency is improved and the impact of stragglers is reduced.

CN118607660APending Publication Date: 2024-09-06BEIJING UNIV OF TECH

Patent Information

Application Number
CN202410657695.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-26
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

In federated learning, due to device heterogeneity and limited communication resources, training efficiency is low, especially when laggards exist, which affects the overall training efficiency, and model transmission delay greatly reduces training efficiency.

Method used

This paper proposes a user selection and resource optimization design method for drone-assisted federated learning. It uses ant colony algorithm and clustering thinking to optimize user equipment scheduling and resource block allocation, reduce the impact of stragglers, and improve training and transmission efficiency.

Benefits of technology

By optimizing user device selection and resource allocation, training delays are reduced, the overall training efficiency of federated learning is improved, all user devices have equal opportunities to participate in training, and training efficiency is improved through reasonable resource management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118607660A
    Figure CN118607660A
Patent Text Reader

Abstract

The invention discloses a user selection and resource optimization method for federated learning assisted by an unmanned aerial vehicle, and the method comprises the steps: building a target function for improving the training efficiency in consideration of the problem that the training efficiency of federated learning is low in actual deployment due to the heterogeneity of participating equipment in a network and limited communication resources; wherein the objective function is composed of communication time delay and calculation time delay when the user participates in training in each training round. An objective function is divided into two sub-problems of user scheduling and wireless resource block allocation, firstly, an ant colony algorithm combined with a clustering thought is adopted to generate a user scheduling scheme, then a second sub-problem in the optimization problem is solved according to the user scheduling scheme, and a wireless resource block allocation scheme is obtained. According to the method, the training efficiency in the unmanned aerial vehicle assisted federated learning scene is remarkably improved while the federated learning training performance is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of UAV-assisted federated learning, and in particular to a user selection and resource optimization design method in UAV-assisted federated learning. Background Art

[0002] In recent years, with the continuous improvement of computing power, algorithms and data volume, machine learning methods in the field of artificial intelligence have ushered in rapid development, from face recognition to accurate prediction, and are widely used in daily life. However, machine learning is a training method that requires a lot of data support, so data privacy and protection have become issues of great concern, resulting in the emergence of Federated Learning (FL) technology. Federated learning allows users to collaboratively train a shared learning model without sharing their original data. They only upload the trained model parameters, and the main server aggregates the uploaded model parameters to update the global model, and feeds back the parameters of the global model to the participants. The participants update the global model according to their own data sets, effectively ensuring the security and privacy of the sensitive data of each participant. Compared with traditional machine learning, federated learning can protect the client's data and prevent the leakage of local data privacy. Therefore, federated learning has been widely used.

[0003] However, due to the synchronous distributed training characteristics of federated learning, it has encountered several core challenges in actual deployment. The first is the heterogeneity of devices from users. Generally, in most cases, federated learning involves many devices to cover a large amount of data. These heterogeneous devices participating in the training usually have different computing capabilities, among which devices with weaker computing capabilities take longer to perform local training than devices with stronger computing capabilities. Due to the synchronization of federated learning training, the base station must receive the models of all users before it can perform model aggregation. In this case, the efficiency of each distributed training depends on the slowest user among the users participating in the training, called the stragglers. The existence of stragglers will affect the overall training efficiency of federated learning. In addition, the training efficiency of federated learning is also constrained by limited communication resources. Generally, mainstream DNN models have millions of floating-point parameters. During training, these model weights are constantly transferred between the base station and the user. Therefore, the delay in model transmission greatly affects the training efficiency of federated learning.

[0004] With the rapid deployment of fifth-generation (5G) and more advanced wireless networks, unmanned aerial vehicles (UAVs) have become a promising candidate paradigm to provide communication and computing services to ground mobile devices in stadiums, outdoor activities, hotspots, and remote areas. Aerial base stations (BSs) or servers can be installed on UAVs. Given the advantages of UAVs such as agility, flexibility, mobility, and favorable line-of-sight (LoS) propagation, UAV networks have been widely used in areas such as fast-response wireless communications, data collection, machine learning (ML) model training, and enhanced coverage. Similarly, deploying UAVs as flying base stations can flexibly collect data for ground devices and implement ML model training. However, due to the priority of data transmission and limited communication resources, it is unrealistic for a large number of devices to transmit raw data to UAV servers. Therefore, UAVs have begun to be combined with federated learning as aerial base stations to quickly build regional wireless networks. Compared with the scenario of fixed base stations, UAVs can provide users with line-of-sight (LoS) communication to reduce user communication pressure and alleviate the competition for wireless resources among users to a certain extent. At the same time, a reasonable resource allocation scheme can effectively reduce user latency and improve the efficiency of federated learning. Summary of the invention

[0005] The purpose of the present invention is to propose a user selection and resource optimization design method in UAV-assisted federated learning. The method takes into account the impact of user device scheduling and resource allocation on the overall training time and performance of federated learning, optimizes the user device selection and the communication resource block allocation problem of the user device, constructs an optimization problem P that minimizes the total objective function, and divides the optimization problem P into two sub-problems. First, the user device selection is determined according to the state of the user device to solve the first sub-problem, and then the resource block allocation method is determined according to the user device selection to solve the second sub-problem, further reducing the impact of stragglers, thereby improving the overall training efficiency of federated learning in both training and transmission.

[0006] To achieve the above functions, the present invention designs a user selection and resource optimization design method in UAV-assisted federated learning, which is characterized in that the method is applied to a UAV-assisted federated learning network scenario, and the method includes the following steps:

[0007] S1: The drone (represented by U) sends resource information requests (including computing power, transmission power, etc.) to all user devices participating in federated learning;

[0008] S2: Each user device returns its information to the drone. Based on the resource information uploaded by all user devices, the training delay required by all user devices in one round of global training is obtained. The communication delay of global training of each user device is calculated based on the spatial path loss model between the user device and the drone, and the optimization problem P is constructed based on the communication delay and calculation delay.

[0009] S3: For the optimization problem P, it is divided into two sub-problems: user equipment scheduling and wireless resource block allocation. The drone first uses the ant colony algorithm combined with clustering ideas to generate the user equipment set;

[0010] S4: The UAV determines the hovering position when calling each user device set according to the generated user device set, determines the shortest flight distance according to the hovering position of the UAV, and further determines the scheduling order of the user device set;

[0011] S5: The UAV solves the second sub-problem in the optimization problem P according to the generated user equipment scheduling decision and obtains the wireless resource block allocation method;

[0012] S6: The UAV assigns the global model to the scheduled user device set based on the user device scheduling decision. Each scheduled user device performs federated learning training and uses the allocated resource blocks to upload the model until the preset number of training times is reached.

[0013] In the UAV-assisted federated learning network scenario, there is a UAV equipped with an edge computing server and K user devices randomly distributed on the ground. The user device set is represented by K = {1, 2, 3…K} and the UAV is represented by U. Each user device has a local dataset D k To perform local model training, its size is defined as D k , so the total data set size for all user devices is: The position of the k-th user equipment in the horizontal two-dimensional coordinate system is recorded as q[k]=[x k ,y k ]. Set the total running time of federated learning to T and divide it into T time slots, each of which is represented by t∈T={1,2,…,T}, where Assume that the UAV always flies at a fixed height H above the ground, and record the fixed position of the UAV in its horizontal two-dimensional coordinate system in the tth communication time slot as q[t] = [x t ,y t ,H]; The origin of the horizontal two-dimensional coordinate system where all user devices are located is on the same vertical line as the horizontal two-dimensional coordinate system where the drone is located, and the X-axis and Y-axis point in the same direction.

[0014] In some embodiments, the step S2, constructing an optimization problem P for minimizing an objective function, includes:

[0015] S2.1 For the user equipment set K = {1, 2, 3 ... K}, where C k represents the number of CPU cycles required for the kth user device to process one bit of data sample, f kis the CPU frequency of the kth user device, L is the number of local training iterations, and the time required for each user device to complete local training in each round is:

[0016] S2.2 The distance between user device k and drone U can be calculated as:

[0017] The communication channel link from drone to device or device to drone is modeled by a probabilistic path loss model, where both LoS and non-LoS (NLoS) links are taken into account. The LoS and NLoS path losses in dB from the drone server to the kth user device are given by the following formula:

[0018] The LoS path loss is:

[0019] The NLoS path loss is:

[0020] where f c represents the carrier frequency, c represents the speed of light, η LoS and η NLoS Represent the additional path loss factors of LOS link and NLOS link respectively.

[0021] In the communication model, the probability of LoS connection between the drone server and the kth device is expressed as:

[0022] Then the probability of NLoS connection is expressed as

[0023] Among them, X and Y are constant parameters determined by the geographical environment.

[0024] θ U,k is the launch elevation angle between user equipment k and drone U:

[0025]

[0026] Therefore, the path loss from user equipment k to drone U is expressed as:

[0027] According to the above path loss, the signal-to-noise ratio during uplink transmission between the UAV and the user equipment k can be obtained as follows:

[0028]

[0029] where p k represents the transmission power of user equipment k, σ 2 Represents Gaussian additive white noise in the information transmission process.

[0030] Therefore, according to Shannon's formula, the communication delay of user device k uploading model parameters to the drone is expressed as:

[0031]

[0032] Where B is the total bandwidth, μ k represents the resource block allocated to each user equipment k, and M is the size of the uploaded model parameters.

[0033] S2.3 The overall optimization function is expressed as:

[0034] P:

[0035] The constraints are:

[0036] C1:

[0037] C2:

[0038] C3:

[0039] C4:

[0040] C5:

[0041] C6:x min ≤x t ≤x max

[0042] C7:y min ≤y t ≤y max

[0043] Among them, f min and f max Indicates the minimum and maximum CPU computing frequency of the user device, p min and p max represents the minimum and maximum transmission power of the user equipment, T max is the total budget for the completion time of each round of federated learning user devices, x min and x max Indicates the nearest and farthest coordinates that the drone can reach in the horizontal direction, y min and max Indicates the nearest and farthest coordinates that the drone can reach in the vertical direction.

[0044] The optimization target P is minimized by selecting user devices and allocating communication resources; constraints C1 and C2 indicate that the sum of the bandwidth allocated to all user devices within the coverage area of ​​the drone cannot exceed the total bandwidth B; constraints C3 and C4 indicate the constraints on the calculation frequency and transmission power of user devices; constraint C5 indicates that the total delay of each round of user devices participating in federated learning cannot exceed the preset maximum value; constraints C6 and C7 represent the flight range of the drone.

[0045] In some embodiments, the S3 divides the optimization problem P into two sub-problems: user equipment scheduling P1 and wireless resource block allocation P2, and only focuses on the first sub-problem: user equipment scheduling, while ignoring the influence of resource block allocation, so it is assumed that the communication delay is constant;

[0046] S3 combines the ant colony intelligence algorithm and clustering ideas to solve the first sub-problem. The ant colony algorithm is used to select the most suitable device as the collection center, perform the collection operation, and obtain the final user device scheduling decision.

[0047] Divide according to the training delay of each user equipment. For a given sample The obtained clustering solution can minimize the clustering error E, that is, select the user devices with the smallest difference in training delay to form a group, thereby reducing the waiting time of other devices to shorten the overall training delay and reduce the impact of stragglers.

[0048] Therefore, the sub-problem P1 about user equipment scheduling can be restated as:

[0049] P1:

[0050] The constraints become:

[0051] C4:

[0052] where Θ n represents the obtained set, c n represents the data center of each collection, and N represents the number of collections.

[0053] The specific process of S3 is as follows:

[0054] S3.1: First, initialize the parameters: construct the difference matrix distance_graph[i][j] according to the training delay difference of the user equipment, the total number of ants A and number them, the pheromone concentration factor ∝, the heuristic information strength factor β, the taboo table table, the evaporation coefficient RHO of the pheromone concentration, the pheromone matrix pheromone_graph, the pheromone volatility coefficient RHO, the pheromone strength Q, the minimum number of user equipment S in the set, the number of sets N and the maximum number of iterations iter.

[0055] The difference matrix The initial pheromone matrix pheromone_graph[i]=1.

[0056] The initial taboo table table[i]=false, indicating whether the current user equipment has been selected, if so, it is modified to true.

[0057] S3.2: Randomly select A user devices as the starting point of A ants, that is, the collection center of the first collection of each ant, and its training delay as the first data center, and set the taboo table value corresponding to the user device to true.

[0058] The transition probability formula for other user equipment to be selected is:

[0059]

[0060] Where pheromone_graph[i] is the pheromone concentration of the i-th user device, and total_prob is the total probability.

[0061] distance_graph[i][j] is the training time difference between the i-th user device and the current user device, that is, the inspiration information.

[0062] Ants use the transfer probability formula in a roulette way to select one of the user devices from the unselected user devices as the collection center. The specific selection process is as follows:

[0063] A value between 0 and 1 is randomly generated. If there is a user device with a transfer probability greater than the random number, the user device is selected as the next user device and the taboo table is modified. Otherwise, a user device is randomly selected from the user devices that have never been selected as the next user device until the required number of sets N is reached, and the path taken by the ant is recorded.

[0064] S3.3 assigns the remaining devices to the nearest collection center according to the training time difference matrix.

[0065] After the initial diversity is completed, it is checked whether the number of user equipments included in each user equipment set is less than the minimum capacity S.

[0066] If yes, the pheromone value of the center of the set is reduced, the user devices in the set are assigned to the nearest set, and the selected user device corresponding to the center is deleted from the ant path, and the set is deleted at the same time.

[0067] S3.4: Determine whether the number of sets is less than N at this time. If so, recalculate the mean of the data of each set:

[0068] The diversity operation is performed in the order of the number of user equipments in the set from large to small according to the principle of minimum variance in the set until the number of sets is equal to N.

[0069] At this time, the user equipment closest to the collection center in each collection and its calculation delay are obtained as the new collection center and data center, and the ant's path is updated to the obtained new collection center.

[0070] The longest training time of the user devices in each set is calculated to update the pheromone matrix.

[0071] If the number of sets is equal to N at this time, the longest training time of the user equipment in each set is directly calculated to update the pheromone matrix.

[0072] The set of solutions with the shortest total longest training time is selected as the optimal solution for this round, and the number of iterations is increased by one.

[0073] The calculation formula of the pheromone renewal mechanism is:

[0074]

[0075] Wherein, i represents the obtained set center, and maxtime[i] represents the longest training time of the user equipment in the set where the set center is located.

[0076] S3.5: Determine whether the maximum number of iterations has been reached. If so, output the optimal path, user equipment diversity results and the longest training delay of each set. Otherwise, reselect A ants and continue to execute S3.2 until the maximum number of iterations iter is reached.

[0077] In S3, N non-overlapping scheduled user equipment sets are generated, denoted as {Θ 1 , Θ 2 ,…,Θ N}, used for multiple rounds of training in federated learning.

[0078] In S4, the drone first collects the location coordinate information of the user devices in each user device set, selects the center coordinate position as the hovering position of the drone when the user device set participates in the federated learning training, and forms a drone hovering position set:

[0079] Q U =[{x 1 ,y 1 ,H},{x 2 ,y 2 ,H},…,{x N ,y N ,H}]

[0080] Considering the limited energy of the UAV, the flight distance between each hovering position of the UAV is calculated, and the motion trajectory with the shortest flight distance of the UAV is further obtained. The user device set is called in sequence according to the motion trajectory to participate in multiple rounds of federated learning training.

[0081] The user equipment sets are reordered according to the user equipment set calling order generated in S4.

[0082] For each user device set Θ n , generate the resource block allocation vector {μ 1 , μ 2 , …μ N},in

[0083] S5 aims to solve the second sub-problem, which is to allocate wireless resource blocks given the user equipment scheduling scheme. At this time, the second sub-problem can be expressed as follows:

[0084] P2:

[0085] The corresponding constraints are:

[0086] C1:

[0087] C2:

[0088] C3:

[0089] C5:

[0090] C6:x min ≤x t ≤x max

[0091] C7:y min ≤y t ≤y max

[0092] C8:

[0093] Among them, μ n,k Represents the resource block allocated to the user equipment in the nth set. Constraints C1 and C2 indicate that the sum of the bandwidth allocated to the participating user equipment within the coverage area of ​​the drone in each round cannot exceed the total bandwidth B.

[0094] Constraint C3 represents the transmission power range of the user equipment set.

[0095] Constraint C5 represents the time constraint of each round of the user equipment.

[0096] Constraints C6 and C7 represent the range of the drone's flight.

[0097] Constraint C8 indicates that each user equipment set is a subset of all user equipment sets K.

[0098] For the tth round of training, since the set of scheduled user devices is fixed, the optimization objective is is a constant, then for the optimization variable μ n,k For n,k Convex function of .

[0099] Therefore, the optimal wireless resource block allocation solution for each user equipment set can be obtained by using the CVX optimizer in MATLAB.

[0100] In step S6: in the tth round of training, the (t mod N)th user equipment set is scheduled to participate in this round of federated learning training process, and the drone sends the model parameters to the user equipment in the user equipment set.

[0101] The scheduled user devices use their own datasets to train local models in parallel through SGD:

[0102]

[0103] in represents the local model of user device k in round t, α is the learning rate of user device k, Represents the sample (x k,j ,y k,j ) is the loss function of .

[0104] Each scheduled user device k uses the allocated resource blocks to train its local training model Upload to the drone to perform model aggregation operations.

[0105] After receiving the model parameters uploaded by all user devices, the drone aggregates the model through FedAvg to update the global model:

[0106]

[0107] Where W t Represents the global model at round t.

[0108] Repeat the model training and aggregation work until the preset number of training times is reached.

[0109] Compared with the prior art, the advantages of the present invention are:

[0110] 1. The present invention is aimed at the wireless network scenario of UAV-assisted federated learning. Taking into account the heterogeneity of participating devices in the network and limited communication resources, federated learning encounters the problem of low training efficiency in actual deployment. The present invention constructs an objective function with the goal of improving training efficiency, where the objective function is composed of the communication delay and computing delay of the user device participating in the training in each training round.

[0111] 2. The present invention comprehensively considers the training delay and communication delay in federated learning. First, user devices with similar computing capabilities are grouped together through user device scheduling optimization, thereby reducing the problem of low training efficiency caused by stragglers. In addition, this scheduling method enables all user devices to have equal opportunities to participate in the training process of federated learning.

[0112] 3. Considering the limited energy of drones, the user device set is called in sequence according to the order of the drone's shortest flight trajectory to participate in multiple rounds of federated learning training; and by analyzing the characteristics of the optimal resource management solution, a resource management strategy based on convex optimization is further proposed to reasonably allocate resource blocks, thereby further improving training efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0113] Figure 1 Schematic diagram of the UAV-assisted federated learning network scenario;

[0114] Figure 2 It is a general implementation block diagram of the method of the present invention;

[0115] Figure 3 is a curve of the total delay obtained under different user equipment participation rates, i.e., different diversity set numbers, according to the present invention;

[0116] Figure 4 The training accuracy curve of the present invention under different user equipment participation rates, that is, different diversity set numbers;

[0117] Figure 5 It is the total delay of all scheduled user equipments to achieve the same preset accuracy under five different optimization schemes and different user equipment participation ratios. DETAILED DESCRIPTION

[0118] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.

[0119] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0120] The present invention proposes a joint optimization method for user selection and resource allocation under a UAV-assisted federated learning architecture, and its overall implementation block diagram is as follows: Figure 2 As shown in the figure, this method is applied to the UAV-assisted federated learning network scenario.

[0121] In the UAV-assisted federated learning network scenario, there is a UAV equipped with an edge computing server and K user devices randomly distributed on the ground, such as Figure 1 As shown in Figure 2, the user device set is represented by K = {1, 2, 3…K} and the drone is represented by U. Each user device has a local data set D k To perform local model training, its size is defined as D k , so the total data set size for all user devices is: The position of the k-th user equipment in the horizontal two-dimensional coordinate system is recorded as q[k]=[x k ,y k ]. Set the total running time of federated learning to T and divide it into T time slots, each of which is represented by t∈T={1,2,…,T}. Assume that the UAV always flies at a fixed height H above the ground, and record the fixed position of the UAV in its horizontal two-dimensional coordinate system in the tth communication time slot as q[t] = [x t ,y t ,H]; The origin of the horizontal two-dimensional coordinate system where all user devices are located is on the same vertical line as the horizontal two-dimensional coordinate system where the drone is located, and the X-axis points in the same direction and the Y-axis points in the same direction. In this embodiment, the number of user devices is set to K = 50, and the data set size D k The value range is [2×10 6 , 1×10 7 ]bits, the coverage of the drone is 100m×100m, and the flight altitude of the drone is H=20m.

[0122] The method comprises the following steps:

[0123] S1: The drone (represented by U) sends a resource information request (including computing power, transmission power, etc.) to the set K of user devices participating in federated learning;

[0124] S2: Each user device returns its information to the drone. Based on the resource information uploaded by all user devices, the training delay required by the user device in one round of global training is obtained. The communication delay of the global training of each user device is calculated based on the spatial path loss model between the user device and the drone, and the optimization problem P is constructed based on the communication delay and the calculation delay.

[0125] In this embodiment, the specific process of step 2 is:

[0126] S2.1 For a user equipment set K = {1, 2, 3 ... K}, the time required for each user equipment to complete local training in each round is:

[0127]

[0128] Among them, C k represents the number of CPU cycles required for the kth user device to process one data sample per bit, D k represents the data sample size of the kth user device, f k is the CPU frequency of the kth user device, L is the number of local training iterations, in this example, C k The value is 1000 cycles / bit.

[0129] S2.2 The distance between user device k and drone U can be calculated as:

[0130] The communication channel link from UAV to UE or UE to UAV is modeled by a probabilistic path loss model, where both LoS and non-LoS (NLoS) links are taken into account. The LoS and NLoS path losses in dB from the UAV server to the kth UE are given by the following formula:

[0131] The LoS path loss is:

[0132] The NLoS path loss is:

[0133] where f c represents the carrier frequency, which is 2 GHZ in this example, and c represents the speed of light, which is 3×10 8 , η LoS and η NLoS They represent the additional path loss factors of the LOS link and NLOS link, and their values ​​are 3 and 23 respectively.

[0134] In the communication model, the probability of LoS connection between the drone server and the kth user device is expressed as:

[0135] Then the probability of NLoS connection is expressed as

[0136] Among them, X and Y are constant parameters determined by the geographical environment. In this example, X=7.14 and Y=6.70.

[0137] θ U,k is the launch elevation angle between user equipment k and UAV U.

[0138]

[0139] Therefore, the path loss from user equipment k to drone U is expressed as:

[0140] According to the above path loss, the signal-to-noise ratio of user equipment k during uplink transmission can be obtained as follows:

[0141]

[0142] where p k represents the transmission power of user equipment k, σ 2 Represents the Gaussian additive white noise during information transmission. In this example, the value is -174dBm / Hz.

[0143] Therefore, according to Shannon's formula, the communication delay of user device k uploading model parameters to the drone is expressed as:

[0144]

[0145] Where B represents the total bandwidth, which is 5MHz in this example, μ k represents the resource block allocated to each user device k, and M is the size of the uploaded model parameters, which is 1.2×10 in this example. 7 bits.

[0146] S2.3 The overall optimization function is expressed as:

[0147] P:

[0148] The constraints are:

[0149] C1:

[0150] C2:

[0151] C3:

[0152] C4:

[0153] C5:

[0154] C6:x min ≤x t ≤x max

[0155] C7:y min ≤y t ≤y max

[0156] Among them, f min and f max Indicates the minimum and maximum calculation frequencies of the user equipment. In this example, f min =2GHz and f max =4GHz, p min and p max represents the minimum and maximum transmission power of the user equipment, in this example, p min = 0.5w and p max =1.5w, T max is the total time budget for each round of federated learning. In this example, the value is 30s. min and x max In this example, the nearest and farthest coordinates that the drone can reach in the horizontal direction are x and y, respectively. min =0 and x max =100,y min and max Indicates the nearest and farthest coordinates that the drone can reach in the vertical direction. In this example, y min =0 and y max =100.

[0157] The optimization target P is minimized by selecting user devices and allocating communication resources; constraints C1 and C2 indicate that the sum of the bandwidth allocated to all user devices within the coverage area of ​​the drone cannot exceed the total bandwidth B; constraints C3 and C4 indicate the constraints on the calculation frequency and transmission power of user devices; constraint C5 indicates that the total delay of user devices participating in federated learning cannot exceed the preset maximum value; constraints C6 and C7 represent the flight range of the drone.

[0158] S3: The optimization problem P is divided into two sub-problems: user equipment scheduling and wireless resource block allocation. The drone first uses the ant colony algorithm combined with clustering ideas to generate a user equipment scheduling solution;

[0159] In S3, the training delay of each user device is divided. For a given sample The obtained clustering solution can minimize the clustering error E, that is, select the user devices with the smallest difference in training delay to form a group, thereby reducing the waiting time of other user devices to shorten the overall training delay and reduce the impact of stragglers.

[0159] Therefore, the sub-problem P1 about user equipment scheduling can be restated as:

[0160] P1:

[0161] The constraints become:

[0162] C4:

[0163] Among them, Θ n represents the obtained set, c n represents the data center of each set, and N represents the number of sets.

[0164] In this embodiment, the specific process of S3 is as follows:

[0165] S3.1: First, initialize the parameters: construct the difference matrix distance_graph[i][j] according to the training delay difference of the user device, the total number of ants A and number them, the pheromone concentration factor ∝, the heuristic information strength factor β, the taboo table table, and the evaporation coefficient RHO of the pheromone concentration. Pheromone matrix pheromone_graph, pheromone evaporation coefficient RHO, pheromone strength Q, the minimum number of user devices in the set S, the number of sets N, and the maximum number of iterations iter. In this embodiment, A is 20, ∝ is 1.0, β is 2.0, RHO is 0.5, Q is 100, the number of sets N is {1, 3, 5, 10}, and the minimum number of user devices in the corresponding sets is {50, 7, 12, 3}, and the maximum number of iterations iter is 5000.

[0166] The difference matrix The initial pheromone matrix pheromone_graph[i]=1.

[0167] The initial taboo table table[i]=false, indicating whether the current user equipment has been selected, if so, it is modified to true.

[0168] S3.2: Randomly select A user devices as the starting points of A ants, that is, the collection center of the first collection of each ant and its training delay as the first data center, and set the taboo table value corresponding to the user device to true.

[0169] The transition probability formula for other user equipment to be selected is:

[0170]

[0171] Where pheromone_graph[i] is the pheromone concentration of the i-th user device, and total_prob is the total probability.

[0172] distance_graph[i][j] is the training time difference between the i-th user device and the current user device, that is, the inspiration information.

[0173] Ants use the transfer probability formula in a roulette way to select user devices as the collection center from the user devices that have not been selected. The specific selection process is as follows:

[0174] A value between 0 and 1 is randomly generated. If there is a user device with a transfer probability greater than the random number, the user device is selected as the next user device and the taboo table is modified. Otherwise, a user device is randomly selected from the user devices that have never been selected as the next user device until the required number of sets N is reached, and the path taken by the ant is recorded.

[0175] S3.3 assigns the remaining devices to the nearest collection center according to the training time difference matrix.

[0176] After the initial diversity is completed, it is checked whether the number of user equipments included in each user equipment set is less than the minimum user equipment capacity S.

[0177] If yes, the pheromone value of the center of the set is reduced, the user devices in the set are assigned to the nearest set, and the selected user device corresponding to the center is deleted from the ant path and the set is deleted at the same time.

[0178] S3.4: Determine whether the number of sets is less than N at this time. If so, recalculate the mean of the data of each set:

[0179] The diversity operation is performed in descending order of the number of user equipments in the set according to the principle of minimum square error in the set until the number of sets is equal to N.

[0180] At this time, the user equipment closest to the collection center in each collection and its calculation delay are obtained as the new collection center and data center, and the ant's path is updated to the obtained new collection center.

[0181] The longest training time of the user devices in each set is calculated to update the pheromone matrix.

[0182] If the number of sets is equal to N at this time, the longest training time of the user equipment in each set is directly calculated to update the pheromone matrix.

[0183] The set of solutions with the shortest total longest training time is selected as the optimal solution for this round, and the number of iterations is increased by one.

[0184] The calculation formula of the pheromone renewal mechanism is:

[0185]

[0186] Wherein, i represents the obtained set center, and maxtime[i] represents the longest training time of the user equipment in the set where the set center is located.

[0187] S3.5: Determine whether the maximum number of iterations has been reached. If so, output the optimal path, user equipment diversity results and the longest training delay of each set. Otherwise, reselect A ants and continue to execute S3.2 until the maximum number of iterations iter is reached.

[0188] In S3, N non-overlapping scheduled user equipment sets are generated, denoted as {Θ 1 , Θ 2 ,…,Θ N}, for multiple rounds of training.

[0189] S4: The UAV determines the hovering position when calling each user device set according to the generated user device scheduling plan, determines the shortest flight distance according to the hovering position, and further determines the scheduling order of the user device set;

[0190] Q U =[{x 1 ,y 1 ,H},{x 2 ,y 2 ,H},…,{x N ,y N ,H}]

[0191] Considering the limited energy of the UAV, the flight distance between each hovering position of the UAV is calculated, and the motion trajectory with the shortest flight distance of the UAV is further obtained. The user device set is called in sequence according to the motion trajectory to participate in multiple rounds of federated learning training.

[0192] The user equipment sets are reordered according to the user equipment set calling order generated in S4.

[0193] For each user device set Θ n , generate the resource block allocation vector {μ 1 ,μ 2 ,…,μ N},in

[0194] S5: The UAV solves the second sub-problem in the optimization problem P according to the generated user equipment scheduling scheme and obtains the wireless resource block allocation decision. The specific process is as follows:

[0195] S5 aims to solve the second sub-problem P2, which is to allocate wireless resource blocks given the user equipment scheduling scheme. At this time, the second sub-problem can be expressed as follows:

[0196] P2:

[0197] The corresponding constraints are:

[0198] C1:

[0199] C2:

[0200] C3:

[0196] C5:

[0201] C6:x min ≤x t ≤x max

[0202] C7:y min ≤y t ≤y max

[0203] C8:

[0205] Among them, μ n,k Represents the resource block allocated to the user equipment in the nth set. Constraints C1 and C2 indicate that the sum of the bandwidth allocated to the participating user equipment within the coverage area of ​​the drone in each round cannot exceed the total bandwidth B.

[0206] Constraint C3 represents the transmission power range of the user equipment set.

[0207] Constraint C5 represents the time constraint of each round of the user equipment.

[0208] Constraints C6 and C7 represent the range of the drone's flight.

[0209] Constraint C8 indicates that each user equipment set is a subset of all user equipment sets K.

[0210] For the tth round of training, since the set of scheduled user devices is fixed, the optimization objective is is a constant, then for the optimization variable μ n,k For n,k Convex function of .

[0211] Therefore, the optimal wireless resource block allocation solution for each user equipment set can be obtained by using the CVX optimizer in MATLAB.

[0212] S6: The drone allocates the global model to the scheduled user device set according to the user device scheduling scheme. Each scheduled user device performs federated learning training and uses the allocated resource blocks to upload the model until the preset number of training times is reached. The specific process is as follows:

[0213] In step S6: in the tth round of training, the (t modN)th user device set is scheduled to participate in this round of federated learning training process, and the drone sends the model parameters to the user devices in the device set.

[0214] The scheduled user devices use their own datasets to train local models in parallel through SGD:

[0215]

[0216] in, represents the local model of user device k in round t, α is the learning rate of user device k, which is 0.01 in this example, Represents the sample (x k,j ,y k,j ), in this example, the cross entropy loss function is used.

[0217] Each scheduled user device k uses the allocated resource blocks to train its local training model Upload to the drone to perform model aggregation operations.

[0218] After receiving the model parameters uploaded by all user devices, the drone aggregates the model through FedAvg to update the global model:

[0219]

[0220] Where W t Represents the global model at round t.

[0221] The model training and aggregation work are repeated until the maximum number of training rounds is reached. In this example, the maximum number of training rounds T is set to 300.

[0222] In order to verify the feasibility and effectiveness of the method of the present invention, a simulation test is carried out on the method of the present invention, as follows:

[0223] Take a drone to provide services for K = 50 user devices. The service range of the drone is limited to a square area of ​​[100,100]m. The initial fixed position of the drone is q[0] = (0, 0, H). The height of the drone is fixed at H = 20m. The user devices are randomly and evenly distributed within the service range of the drone. The noise power density is σ 2 = -174 dBm / Hz, the transmit power of the kth user equipment ranges from [0.5, 1.5] W, the CPU frequency range of the user equipment is [2.0, 4.0] GHz, the total uplink transmission bandwidth B = 10 MHz, and the model parameter size is M = 1.2 × 10 7 bits, the total number of communication rounds is 300, and the learning rate of local training of user equipment is α=0.01.

[0224] During the simulation, the CIFAR10 dataset is loaded, which contains 50,000 training images and 10,000 test images. Each image is a 32×32 pixel color image belonging to 10 different categories. The dataset is divided into different data blocks according to the number of user devices and the dataset conditions, and allocated to different user devices.

[0225] Figure 3 The curve of the total delay of all scheduling devices obtained by the method of the present invention under different numbers of diversity sets is given. The results show that as the number of training rounds increases, when the number of diversity sets decreases from 10 to 1, the delay required to complete the federated learning training increases. This is because when the number of diversity sets decreases, that is, the number of user devices participating in each round increases, the transmission time becomes longer due to limited communication resources and the possibility of stragglers in each round increases.

[0226] exist Figure 4 The training accuracy curve of the present invention under different user device participation rates, i.e., different numbers of subsets, is given in the figure. When the user device participation rate decreases, the final accuracy will decrease. This is because when the user device participation rate decreases, the amount of data information contained in each round of training decreases, affecting the final model training effect.

[0227] Figure 5The relationship between the total latency of all scheduled user devices and the global target accuracy under different optimization schemes is shown to achieve the prediction accuracy of the CIFAR-10 dataset. The four different optimization schemes are fixed transmission bandwidth, random algorithm to select user devices, clustering algorithm to select user devices, and greedy algorithm to select user devices. In this scenario, we set the expected accuracy to 70%, 75%, and 80%, respectively, and use NAN to indicate that a strategy cannot achieve the expected accuracy. Obviously, when the expected accuracy is 80%, our method can reduce the training time by 27%, 22.8%, and 36.4% on average compared with the other three comparison optimization schemes, respectively. When the expected accuracy is 70%, the training time of the greedy algorithm is slightly shorter than that of our proposed method, because the greedy algorithm only selects user devices with strong computing power to participate in the federated learning training process. However, this also leads to the inability to achieve higher accuracy during training due to the lack of data from other user devices.

Claims

1. A method for user selection and resource optimization in a UAV-assisted federated learning architecture, wherein the UAV provides auxiliary communication and computing services to users in the ground area, characterized in that: The specific steps include: S1: The drone is represented by U and sends a resource information request to all user devices participating in federated learning; the resource information request includes computing power and transmission power; S2: Each user device returns its information to the drone. Based on the resource information uploaded by all user devices, the training delay required by all user devices in one round of global training is obtained. The communication delay of the global training of each user device is calculated based on the spatial path loss model between the user device and the drone, and the optimization problem P is constructed based on the communication delay and the calculation delay. S3: The optimization problem P is divided into two sub-problems: user equipment scheduling and wireless resource block allocation. The drone first uses the ant colony algorithm combined with clustering ideas to generate the user equipment scheduling set; S4: The UAV determines the hovering position when calling each user device set according to the generated user device scheduling set, determines the shortest flight distance according to the hovering position, and determines the scheduling order of the user device set; S5: The UAV solves the second sub-problem in the optimization problem P according to the generated user equipment scheduling scheme and obtains the wireless resource block allocation decision; S6: The UAV allocates the global model to the scheduled user device set according to the user device scheduling scheme. Each scheduled user device performs federated learning training and uses the allocated resource blocks to upload the model until the preset number of training times is reached.

2. The method for user selection and resource optimization under the UAV-assisted federated learning architecture according to claim 1, characterized in that: The local training delay The specific calculation process is: Among them, C k represents the number of CPU cycles required by the k-th user device to process each bit of data sample, D k represents the data sample size of the kth user device, f k is the CPU frequency of the kth user device, and L is the number of local training iterations.

3. The method for user selection and resource optimization under the UAV-assisted federated learning architecture according to claim 1, characterized in that: The communication delay The specific calculation process is: Among them, M is the model parameter size, μ k represents the ratio of resource blocks allocated to each user equipment, B is the total resource block size, and p k is the transmit power of each user equipment, and Represent the average path loss and LoS transmission probability of LoS transmission, and They represent the average path loss and NLoS transmission probability of NLoS transmission, loss represents the average path transmission loss, σ 2 Represents the additive white Gaussian noise during transmission.

4. The method for user selection and resource optimization under the UAV-assisted federated learning architecture according to claim 1, characterized in that: The optimization problem P is defined as: The constraints are: C1:μ k ∈[0,1] C2:∑μ k ≤1 C6:x min ≤x t ≤x max C7:y min ≤y t ≤y max where f min and f max Indicates the minimum and maximum CPU computing frequency of the user device, p min and p max represents the minimum and maximum transmission power of the user equipment, T max The budget for each round of federated learning, x min and x max Indicates the nearest and farthest coordinates that the drone can reach in the horizontal direction, y min and max Indicates the nearest and farthest coordinates that the drone can reach in the vertical direction, and minimizes the optimization target P by selecting user equipment and allocating communication resources; Constraints C1 and C2 indicate that the total bandwidth allocated to all user devices within the coverage of the drone cannot exceed the total bandwidth B; constraints C3 and C4 indicate the constraints on the calculation frequency and transmission power of user devices; constraint C5 indicates that the delay of each round of training of user devices participating in federated learning cannot exceed the preset maximum value; constraints C6 and C7 represent the flight range of the drone.

5. The method for user selection and resource optimization under the UAV-assisted federated learning architecture according to claim 1, characterized in that: The optimization problem P is divided into two sub-problems: user equipment scheduling and wireless resource block allocation. S3 only focuses on the first sub-problem: user equipment scheduling, and ignores the impact of resource block allocation. Therefore, it is assumed that the communication delay is constant. The user equipment scheduling algorithm in S3 is as follows: According to the training delay of each user equipment, for a given sample The obtained clustering solution can minimize the clustering error E, that is, select the user equipment with the smallest difference in training delay to form a set, thereby reducing the waiting time of other user equipment to achieve the purpose of shortening the overall training delay. The optimization goal is formally expressed as: The constraints become: where Θ i represents the obtained set, c n Represents the data center of each collection, and N represents the number of collections to be divided.

6. The method for user selection and resource optimization under the UAV-assisted federated learning architecture according to claim 1, characterized in that: In the user equipment scheduling algorithm, the ant colony intelligence algorithm and the clustering idea are combined to select the most suitable user equipment as the collection center through the ant colony algorithm, perform the collection operation, and obtain the final equipment scheduling plan. The specific process is as follows: S3.1: Build a difference matrix based on the training delay difference of the user equipment, initialize the parameters, select A ants and number them; S3.2: Each ant selects the next node as the center of the set by using the transition probability formula until the required number of sets is reached, and the path taken by the ant is recorded; S3.3: Assign the remaining devices to the nearest collection center according to the training time difference matrix, check whether the size of each data set is less than the minimum user device capacity S, if so, reduce the pheromone value of the collection center, assign the user devices in the collection to the nearest collection, delete the selected corresponding user devices from the ant path, and delete the collection at the same time; S3.4: Determine whether the number of sets is less than N at this time. If so, recalculate the mean of the data of each set: And perform the diversity operation in the order of the number of user devices in the set from large to small according to the minimum variance principle in the set, until the number of sets is equal to N. At this time, find the user device closest to the set center in each set and its calculation delay as the new set center and data center, and update the ant's path to the new set center. At the same time, find the longest training time of the user devices in each set at this time to update the pheromone matrix, select the set solution with the shortest total longest training time as the optimal solution for this round, and increase the number of iterations by one. If the number of sets is equal to N at this time, then directly find the longest training time of the user devices in each set at this time to update the pheromone matrix, select the set solution with the shortest total training time as the optimal solution for this round, and increase the number of iterations by one; S3.5: Determine whether the maximum number of iterations has been reached. If so, output the optimal path, user equipment diversity results and training delay of each set. Otherwise, reselect A ants and continue to execute S3.

2.

7. The method for user selection and resource optimization under the UAV-assisted federated learning architecture according to claim 6, characterized in that: In the user equipment scheduling algorithm, The parameters initialized in S3.1 include the difference matrix distance_graph constructed according to the training delay of the user device, the total number of ants A, the pheromone concentration factor ∝, the heuristic information strength factor β, the pheromone matrix pheromone_graph, the pheromone volatility coefficient RHO, the pheromone strength Q, the minimum number of user devices in the set S, the number of sets N and the maximum number of iterations iter; The transition probability formula in S3.2 is: Where pheromone_graph[i] is the pheromone concentration of the i-th user device, distance_graph[i][j] is the training time difference between the i-th user device and the current user device, that is, the heuristic information, and total_prob is the total probability; The calculation formula of the pheromone renewal mechanism in S3.4 is:

8. The method for user selection and resource optimization under the UAV-assisted federated learning architecture according to claim 1, characterized in that: In step S4, the drone first collects the location coordinate information of the user devices in each set, selects the center coordinate position as the hovering position of the drone when the user device set participates in the federated learning training, and forms the drone hovering position set: Q U =[{x1,y1,H},{x2,y2,H},…,{x N ,y N ,H}].

9. The method for user selection and resource optimization under the UAV-assisted federated learning architecture according to claim 1, characterized in that: Considering the limited energy of the drone, the flight distance between each hovering position of the drone is calculated, and the motion trajectory with the shortest flight distance of the drone is further obtained. The user device set is reordered according to the drone's motion trajectory, and the user device set is scheduled in turn to participate in multiple rounds of federated learning training.

10. The method for user selection and resource optimization under the UAV-assisted federated learning architecture according to claim 4, characterized in that: In the optimization problem P, the second sub-problem in step S5 is to allocate wireless resource blocks under a given user equipment scheduling scheme. At this time, the second sub-problem is expressed as the following convex optimization problem: The constraints become: C6:x min ≤x t ≤x max C7:y min ≤y t ≤y max Among them, μ n,k represents the resource block allocated to the user equipment in the nth set. Constraints C1 and C2 indicate that the total bandwidth allocated to the participating user equipment in each round within the coverage of the drone cannot exceed the total bandwidth B. Constraint C5 represents the time constraint of each round of the user equipment. Constraints C6 and C7 represent the flight range of the drone. Constraint C8 indicates that the user equipment set participating in each round of training is a subset of all user equipment sets. Since the second subproblem is a convex optimization problem, the formulated resource block allocation problem is solved by using the CVX optimizer in MATLAB. In step S6, in the tth round of training, the (tmodN)th user device set is scheduled to participate in this round of federated learning training process. The drone sends model parameters to the user devices in the user device set. The scheduled user devices use their own data sets to train local models in parallel through SGD, and use the allocated resource blocks to upload their local training models to the drone to perform model aggregation operations. The model training and aggregation work are repeated until the maximum number of iterations is reached.

Citation Information

Patent Citations

  • Maritime search and rescue resource selection method and device

    CN115310577A

  • Unmanned aerial vehicle deployment optimization method based on multi-agent federal reinforcement learning

    CN116436781A

  • Training and resource joint optimization design method in unmanned aerial vehicle assisted federal learning

    CN117521847A

  • Expense optimization scheduling method for deadline constraint under cloud scientific workflow

    WO2020186872A1

Cited By

  • Heterogeneous perception federated learning method through unmanned aerial vehicle sampling and D2D communication

    CN120034883A

  • Heterogeneous Sensing Federated Learning Method via UAV Sampling and D2D Communication

    CN120034883B

  • Unmanned aerial vehicle communication method, system and equipment based on federal learning

    CN121887257A