A D2D-assisted two-stage aerial computation model aggregation method
By employing a D2D-assisted two-stage over-the-air computation method, devices with poor channel quality send model data to multiple devices with good channel quality and the base station in the first stage. In the second stage, the devices with good channel quality aggregate the data and send it to the base station. This solves the problems of model aggregation error and low communication efficiency in federated learning, and achieves efficient model training and prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DALIAN UNIV OF TECH
- Filing Date
- 2023-12-28
- Publication Date
- 2026-05-26
AI Technical Summary
In wireless communication systems, during the model aggregation process of federated learning, existing technical solutions suffer from drawbacks such as reduced training data, inability to effectively utilize relay networks for collaborative diversity, and large model aggregation delays due to errors caused by devices with poor channel quality and low communication efficiency.
A two-stage over-the-air computation method with D2D assistance is adopted. In the first stage, the device with poor channel quality sends model data to multiple devices with good channel quality and the base station. In the second stage, the devices with good channel quality aggregate the data and send it to the base station. The base station finally aggregates the model data and combines it with an alternating optimization algorithm to optimize the operating parameters of the device and the base station to reduce errors.
It significantly reduces model aggregation error, improves the prediction accuracy and communication efficiency of federated learning, converges quickly, and does not require the deployment of new equipment.
Smart Images

Figure CN117858123B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of wireless communication technology and relates to a D2D-assisted two-stage airborne computing model aggregation method. Background Technology
[0002] The ever-increasing volume of data has fueled a wide range of artificial intelligence applications, such as image recognition and natural language processing, thanks to recent breakthroughs in machine learning, particularly deep learning, and unprecedented computing power. Currently, typical machine learning processes, including training and inference, are supported by cloud computing, which provides extensive computing, storage, and accessibility to the entire dataset through a centralized cloud data center. However, emerging smart mobile devices and high-risk applications, such as drones, smart cars, and augmented reality, have critical requirements for low latency and privacy protection, rendering cloud-based machine learning methods unsuitable. Therefore, the approach of using edge devices directly to train and infer data from local sources is becoming increasingly attractive, eliminating the need to send data to the cloud or network. This emerging technology, known as edge machine learning, is supported by mobile edge computing, achieved by pushing cloud computing services to the network edge. While mobile edge intelligence services offer numerous advantages, their main bottleneck is limited computing, storage, energy, and bandwidth resources. To address this, recent research has increasingly focused on reducing storage overhead, time, and power consumption during inference through hardware and software co-design and model compression methods. Furthermore, researchers have proposed various advanced distributed optimization algorithms that leverage data and computing power distributed across multiple devices to accelerate the training process.
[0003] Federated learning is a distributed machine learning approach that allows multiple participants to collaboratively build a global model while protecting data privacy. By training the model on local devices, participants can effectively collaborate, fully utilizing each other's data resources to improve model performance while protecting sensitive data. When implementing federated learning in wireless communication systems, model interaction between base stations and devices is achieved through wireless links; therefore, limited wireless resources become a bottleneck for this large-scale model sharing. Federated learning includes a model aggregation stage, which involves weighted averaging of parameters trained on different devices. Considering this operation is similar to over-the-air computation utilizing the waveform superposition characteristics of multiple access channels, over-the-air computation is an efficient communication method for achieving federated learning model aggregation in wireless networks. The bandwidth and communication latency required for over-the-air computation are independent of the number of devices, significantly enhancing system scalability and improving communication efficiency. However, over-the-air computation is inevitably affected by distortion caused by noise and wireless channel fading. To ensure that uploaded local model updates are aligned at the receiver, devices with better channels must reduce their transmit power, causing model aggregation errors to be dominated by devices with the worst channels (see: Lin Z, Liu H, Zhang YJ A. Relay-assisted cooperative federated learning[J].IEEE Transactions on Wireless Communications,2022,21(9):7148-7164.). Therefore, how to design a model aggregation scheme based on over-the-air computation to improve federated learning performance deserves in-depth research.
[0004] To reduce the model aggregation error in over-the-air computation federated learning, one approach is to discard models trained by devices with poor channel quality: (1) A channel condition-based scheduling scheme to exclude devices with the worst channel conditions (see: Ma X, Sun H, Wang Q, et al. User scheduling for federated learning through over-the-air computation [C] / / 2021IEEE 94th Vehicular Technology Conference (VTC2021-Fall).IEEE,2021:1-5.). (2) Considering joint device selection and beamforming design, to maximize the number of selected devices under the constraint of target mean square error (MSE) (see: Yang K, Jiang T, Shi Y, et al. Federated learning via over-the-air computation [J].IEEE transactions on wireless communications,2020,19(3):2022-2035.). (2) A truncation-based power control method to discard devices with deep fading channels (see: Zhu G, Wang Y, Huang K. Broadband analogaggregation for low-latency federated edge learning[J]. IEEE Transactions on Wireless Communications, 2019, 19(1): 491-506.). Although these schemes can effectively control the error of over-the-air computation by discarding devices with poor channel quality during model uploading, discarding devices from training often reduces the amount of data participating in model training, which inevitably reduces the convergence speed of federated learning and the inference performance of the resulting model (see: Liu H, Yuan X, Zhang YJ A. Reconfigurable intelligent surface enabled federated learning: A unified communication-learning design approach[J]. IEEE Transactions on Wireless Communications, 2021, 20(11): 7595-7609.).Another approach is to improve the communication quality of devices with poor channel quality through advanced communication technologies: (1) A two-layer relay-assisted federated learning framework, in which the local model is uploaded to the relay node via over-the-air computation, and the relay node then uploads the received model to the base station via over-the-air computation (see reference: Qu Z, Guo S, Wang H, et al. Partial synchronization to accelerate federated learning over relay-assisted edgenetworks[J].IEEE Transactions on Mobile Computing,2021,21(12):4502-4516.). However, the proposed scheme assumes that each device is connected to only one relay node, and cannot take advantage of the cooperative diversity of the relay network. (2) The authors deployed multiple half-duplex relays to collaboratively assist devices in uploading local model updates to the edge server and proposed an algorithm based on alternating optimization to optimize the transmit and receive parameters of the receiver, relays, and devices to minimize model distortion (see: Lin Z, Liu H, Zhang YJ A. Relay-assisted cooperative federated learning[J].IEEE Transactions on Wireless Communications,2022,21(9):7148-7164.). However, introducing relay devices increases network complexity and requires additional equipment and installation and maintenance costs, especially the number and layout of relay devices, which require careful planning and management. (3) Construct a device-to-device (D2D) network to improve the efficiency of federated learning (see reference: Feng S, Niyato D, Wang P, et al. Joint service pricing and cooperative relay communication for federated learning[C] / / 2019 International Conference on Internet of Things (iThings) and IEEE GreenComputing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData). IEEE, 2019: 815-820.).In this system, mobile devices collaborate to form a D2D network, helping each other upload model updates to the base station. However, each device only transmits data to one D2D device, failing to effectively utilize the collaborative diversity advantage of the D2D network. This results in significant communication latency and base station model aggregation latency, limiting the convergence speed of federated learning. The above scheme suffers from disadvantages such as reduced training data, inability to leverage the collaborative diversity advantage of relay networks, high relay network complexity, and large model aggregation latency.
[0005] Based on this, this invention proposes a novel D2D-assisted over-the-air federated learning scheme. First, in the initial stage, users with poor channel quality simultaneously send model data to multiple users with good channel quality and the base station. In the second stage, devices with good channel quality aggregate their own model data and the received model data, then send it to the base station. The base station aggregates the model data received in both stages to obtain the aggregated model for this round of federated learning. This scheme fully utilizes the collaborative diversity of wireless federated learning systems, improving communication efficiency and the training speed of federated learning models. To reduce the model aggregation error in over-the-air federated learning, the key factors affecting the minimum mean square error (MSE) are analyzed, forming an optimization problem of minimizing MSE. An alternating optimization algorithm is proposed, alternately optimizing the device transmit coefficients, weighting factors, and the base station's noise-reducing receive coefficients to effectively reduce the model aggregation error. Reducing the model aggregation error improves the prediction accuracy of federated learning. Summary of the Invention
[0006] In federated learning within the field of wireless communication technology, the varying channel quality of devices at different locations leads to the model aggregation error in federated learning based on over-the-air computation being dominated by the device with the worst channel quality. To address this, this invention proposes a Device-to-Device (D2D) assisted over-the-air computation federated learning scheme, where a near-end device with good channel quality is selected to assist edge devices in updating their local models to the server. This results in an optimization problem minimizing the mean squared error. An alternating optimization algorithm is proposed to optimize the operating parameters of all devices and the base station with low complexity. The proposed algorithm converges quickly, and this scheme significantly reduces model aggregation error and improves the prediction accuracy of federated learning.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0008] A D2D-assisted two-stage aerial computation model aggregation method includes the following five components:
[0009] The first step is global model distribution, where the base station broadcasts the current global model to all devices via a wireless link.
[0010] The second step is local model update. Based on the received global model, each device runs a local update algorithm, such as stochastic gradient descent, to train and obtain the updated local model using the local dataset (the data that each device has).
[0011] The third step involves D2D-assisted two-stage over-the-air computation model aggregation of the local models. In the first stage, users with poor channel quality simultaneously send local model data to multiple users with good channel quality and the base station. In the second stage, devices with good channel quality aggregate their own local model data and the local model data received from users with poor channel quality, and then send them to the base station. Finally, the base station aggregates the local model data received in both stages to obtain the aggregated model for this round of federated learning.
[0012] The fourth step is global model update, where the base station uses the current aggregated model as the new global model.
[0013] Fifth, stop training when the predetermined termination conditions for federal learning training are met. Otherwise, repeat steps one through four to begin the next round of training.
[0014] The following will provide a detailed step-by-step explanation.
[0015] Step 1: Global model distribution.
[0016] Step 1.1 Global Model Initialization: Skip this step if not in the first round of training. First, determine the structure of the fully connected neural network model, i.e., determine the number of hidden layers, the number of nodes in each hidden layer, the number of nodes in the input layer, the number of nodes in the output layer, the activation functions of the hidden layers, and the form of the output layer, and randomly generate and initialize the global model w. [0] .
[0017] Step 1.2 Global Model Distribution: Federated learning based on over-the-air computation requires multiple rounds of iterative operations. Assuming the current round is r (r = 1, 2, 3...), the base station distributes the current global model w. [r-1] Broadcast to all devices via wireless link Since cellular systems have abundant downlink resources, it is assumed that downlink transmission is always successful, meaning that all devices can receive global model parameters without errors for local training.
[0018] Step 2: Local model update.
[0019] Upon receiving the global model w [r-1] Based on this, each device Run the stochastic gradient descent algorithm to generate an updated local model using the local dataset available to each device. The specific process is as follows:
[0020] Step 2.1 Perform forward propagation to obtain the prediction results of the current fully connected neural network.
[0021] Step 2.2 yields the loss function.
[0022] Step 2.3 Perform backpropagation to calculate the gradient of the loss function with respect to the local model.
[0023] Step 2.4 Update the local model based on the gradient.
[0024] Step 3: Perform D2D-assisted two-stage aerial computation model aggregation on the local model.
[0025] Step 3.1 Local model normalization: In reality, each device needs to adjust its transmit power to resist path loss and small-scale fading; therefore, a linear function is first used to normalize the local model. Normalized to have zero mean and unit variance Right now in, Let represent the normalized local model of device m in the r-th round; Ψ represents the linear normalization function; Let I represent the local model of device m in the r-th round; I represents the identity matrix; Let m' be the normalized local model of device m' in the r-th round; This indicates the expectation; m represents device m; m' represents device m';
[0026] The specific steps of normalization are as follows:
[0027] Step 3.1.1 Local statistical estimation of the devices: Each device estimates the mean and variance of the local model parameters, and then transmits the mean and variance of the local estimates to the base station.
[0028] Step 3.1.2 Global statistical estimation of the base station: The base station performs a weighted average of the mean and variance of each device to obtain the mean, variance and standard deviation of the global statistical estimate, and then broadcasts the global mean and standard deviation to each device.
[0029] Step 3.1.3 Local model normalization of the device: The local model of each device is normalized by subtracting the global mean and then dividing by the global standard deviation.
[0030] In each round, assuming each parameter A time slot is required for transmission, and the objective function for calculating the link in the air within each time slot is:
[0031]
[0032] in, This represents the weight of device m. Let m represent the dataset in device m, and d represent the normalized local model. The number of parameters. For ease of analysis, the round number and time index are omitted. and Simplify to x and s respectively m .
[0033] Step 3.2 The base station divides the M devices into two categories based on their channel quality: N devices with relatively good channel quality and K devices with relatively poor channel quality. The following formula is used to select the N devices with relatively good channel quality for this category.
[0034]
[0035] Where, {h1,...,h M Let} be the channel coefficients from each device to the base station. Assume a set of devices with relatively good channel quality. Xinhedao's equipment sets are of relatively poor quality. These are respectively the near-end device set and the edge device set, and Assume all devices are half-duplex.
[0036] Step 3.3 The base station collects current network information and solves for system parameters, as shown below.
[0037] Step 3.3.1 The base station collects relevant channel information of the current wireless network, among which... Indicates edge device Channel coefficients between the base station and the base station Indicates edge device With near-end devices The channel coefficients between them Indicates near-end device Channel coefficients between the base station and the base station P0 represents the weight of device m, and P0 represents the maximum transmit power of each device.
[0038] Step 3.3.2 Establish the optimization problem as follows: Solve for the system parameters.
[0039]
[0040]
[0041]
[0042] Among them, a k b represents the emission coefficient of the first-stage edge device; n Indicates the emission coefficient of the second-stage near-end device; d n P0 represents the weighting factor for the near-end equipment in the first stage; g represents the maximum transmit power of the equipment. k,n Indicates edge device With near-end devices The channel coefficients between them; MSE represents the mean square error between the aggregated model x′ obtained by the D2D-assisted two-stage air computing model aggregation method and the objective function x of the air computing link, as shown in the following formula:
[0043]
[0044] Where c1 represents the first-stage noise reduction reception coefficient of the base station; c2 represents the second-stage noise reduction reception coefficient; h k f represents the channel coefficient between edge device k and the base station; n ρ represents the channel coefficient between the near-end device n and the base station; k This represents the weight of edge device k;
[0045] Step 3.3.3 Solve the optimization problem, alternately optimizing the emission coefficient {a} of the edge device in the first stage. k} and the emission coefficient of the second-stage near-end device {b n The weighting factor for the first-stage near-end device {d} n The first-stage noise reduction receiving coefficient {c1} and the second-stage noise reduction receiving coefficient {c2} of the base station decouple the coupled variables. The specific steps are as follows.
[0046] Step 3.3.3.1 Initialize the maximum number of iterations J max (take positive integers) and algorithm threshold ε (take real numbers between 0 and 1).
[0047] Step 3.3.3.2 Initialization
[0048] Step 3.3.3.3 Calculate the MSE at this time. (0) .
[0049] Step 3.3.3.4 Initialize the iteration count variable j = 0.
[0050] Step 3.3.3.5 For a given Optimize the emission coefficient on edge devices in the first phase Signal weighting factor of near-end devices In this case, the MSE minimization problem simplifies to:
[0051]
[0052]
[0053]
[0054] The question is about {a} k ,dn A convex quadratic constrained quadratic programming (QCQP) problem can be solved using standard convex optimization tools such as CVX.
[0055] Step 3.3.3.6 For a given The emission coefficients on the second-stage near-end device are optimized by solving the following simplified MSE minimization problem:
[0056]
[0057]
[0058] This problem is a convex quadratic constrained quadratic programming (QCQP) problem, which can be solved using CVX.
[0059] Step 3.3.3.7 For a given The first and second stage denoising receiver coefficients of the base station are optimized by solving the following simplified MSE minimization problem.
[0060]
[0061] This problem is a bivariate unconstrained quadratic programming (QP) problem. The optimal solution is obtained when the gradient with respect to {c1, c2} is 0, i.e.:
[0062]
[0063]
[0064] in, h k Conjugate; f n Conjugate; b n Conjugate; d n Conjugate; G represents k,n Conjugate; Indicates a k The conjugate of . Solving the system of two linear equations in two variables formed by the above two equations will yield . and
[0065] Step 3.3.3.8 Calculate the MSE at this time. (j) .
[0066] Step 3.3.3.9 If Or j≥J maxThe optimization ends, and the loop exits. The system parameter 'a' is then output. k , b n ,d n , c1, c2.
[0067] Step 3.3.3.10: Iterate the counter variable j++, enter the next loop, and repeat steps 3.3.3.5 to 3.3.3.10.
[0068] Step 3.4 In the first stage, all edge devices send their signals s k After adjusting the transmission power, it is simultaneously transmitted to all near-end devices and base stations. Given the complex-valued transmission coefficient at device k in the first stage, the mixed signal of the received signal and the self-signal at the near-end device n is:
[0069]
[0070] Where, d n The scaling factor is the native signal at point n of the near-end device. It is additive white Gaussian noise at point n of the near-end device; s k Represents the normalized local model of device k; s n This represents the normalized local model of device n. At this point, the signal received by the base station in the first stage is:
[0071]
[0072] in, It is the first stage of additive white Gaussian noise.
[0073] Step 3.5 In the second stage, each near-end device n will mix the signal r n Multiply by complex value coefficient After amplification, the signal is sent to the base station. The received signal at the base station in the first stage is:
[0074]
[0075] in, It is the second stage of additive white Gaussian noise.
[0076] Step 3.6 The signals received by the base station in the first and second stages are superimposed. After receiving the signals y1 and y2 from the two stages, the base station applies noise reduction receiving coefficients to y1 and y2 respectively. and The weighted sum of x is estimated as follows Represented as:
[0077]
[0078] Then we can obtain the estimate of x as x'.
[0079] Step 4: The base station updates the global model to w' [r] =Ψ -1 (x' [r] ), Ψ -1 (·) indicates denormalization, which involves multiplying the local model by the global standard deviation and then adding the global mean.
[0080] Step 5: When the training reaches the preset fixed number of rounds, stop training. Otherwise, r = r + 1, and repeat steps one through five to enter the next round of the loop, finally obtaining the federated learning model.
[0081] The beneficial effects of this invention are as follows:
[0082] (1) The D2D-assisted two-stage air computing model aggregation method proposed in this invention can effectively reduce model aggregation error and significantly improve the wireless communication efficiency of federated learning while ensuring the prediction accuracy of federated learning models in wireless networks.
[0083] (2) This invention makes full use of the collaborative diversity of wireless federated learning systems, thereby improving communication efficiency and training speed of federated learning models.
[0084] (3) At the same time, the present invention is based on existing equipment in the network and does not require the deployment of new equipment.
[0085] (4) In addition, the algorithm used in this invention can converge quickly, effectively improving the training efficiency of federated learning. Attached Figure Description
[0086] Figure 1 This is a schematic diagram of the system structure of the present invention.
[0087] Figure 2 This is a schematic diagram of the base station and equipment distribution of the present invention.
[0088] Figure 3 This is a comparison of the model prediction accuracy of the present invention with other reference schemes. Detailed Implementation
[0089] The present invention will be further described below with reference to specific implementation examples.
[0090] Considering the Rayleigh fading channel model, the small-scale fading coefficients between any two nodes i and j follow an independent and identically distributed complex Gaussian distribution on different links, i.e. Path loss is Where d i,j The distance between nodes i and j is represented by α, the path loss exponent is represented by h, and the channel coefficient is represented by h. m ,hk ,g k,n ,f n Represented as The default values for system parameters are shown in Table 1.
[0091] Table 1 System Parameter Settings
[0092] parameter meaning numerical values K Number of edge devices 20 N Number of near-end devices 20 <![CDATA[P0]]> Maximum transmission power of the device 1W <![CDATA[σ 2 ]]> Noise power -100dBW α Path loss index 4 ε Algorithm threshold <![CDATA[10 -4 ]]> <![CDATA[J max ]]> Maximum number of iterations 100
[0093] Consider a 1000m × 1000m two-dimensional plane, with the base station at coordinates (0,0). All devices are randomly distributed across an area with an outer diameter of R. d On a ring with an inner diameter of 1m, such as Figure 2 As shown, a federated learning task based on aerial computation is constructed using the MNIST dataset. This dataset contains 60,000 training and 10,000 test handwritten samples across 10 categories, from the digits "0" to "9". The number of data samples is set to be the same for all devices.
[0094] A D2D-assisted two-stage aerial computation model aggregation method includes the following steps:
[0095] Step 1: Global model distribution.
[0096] Step 1.1 Global Model Initialization: Skip this step if not in the first round of training. First, determine the structure of the fully connected neural network model. Use a 3-layer fully connected neural network to train the model. The input layer of the network is a 784-pixel value, the hidden layer is a fully connected layer with 100 units activated by Tanh, and the output layer is the probability corresponding to the 10 classes determined by softmax. Randomly generate and initialize the global model w[ 0 ].
[0097] Step 1.2 Global Model Distribution: Federated learning based on over-the-air computation requires multiple rounds of iterative operations. Assuming the current round is r, the base station distributes the current global model w. [r-1] Broadcast to all devices via wireless link Since cellular systems have abundant downlink resources, it is assumed that downlink transmission is always successful, meaning that all devices can receive global model parameters without errors for local training.
[0098] Step 2: Local model update.
[0099] Upon receiving the global model w [r-1] Based on this, each device Run the stochastic gradient descent algorithm to generate an updated local model using the local dataset available to each device. The specific process is as follows.
[0100] Step 2.1 Perform forward propagation to obtain the prediction results of the current fully connected neural network.
[0101] Step 2.2 yields the loss function.
[0102] Step 2.3 Perform backpropagation to calculate the gradient of the loss function with respect to the local model.
[0103] Step 2.4 Update the local model based on the gradient.
[0104] Step 3: Perform D2D-assisted two-stage aerial computation model aggregation on the local model.
[0105] Step 3.1 Local model normalization: In reality, each device needs to adjust its transmit power to resist path loss and small-scale fading; therefore, a linear function is first used to normalize the local model. Normalized to have zero mean and unit variance Right now in, Let represent the normalized local model of device m in the r-th round; Ψ represents the linear normalization function; Let I represent the local model of device m in the r-th round; I represents the identity matrix; Let m' be the normalized local model of device m' in the r-th round; This indicates the expectation; m represents device m; m' represents device m';
[0106] The specific steps of normalization are as follows:
[0107] Step 3.1.1 Local statistical estimation of the devices: Each device estimates the mean and variance of the local model parameters, and then transmits the mean and variance of the local estimates to the base station.
[0108] Step 3.1.2 Global statistical estimation of the base station: The base station performs a weighted average of the mean and variance of each device to obtain the mean, variance and standard deviation of the global statistical estimate, and then broadcasts the global mean and standard deviation to each device.
[0109] Step 3.1.3 Local model normalization of the device: The local model of each device is normalized by subtracting the global mean and then dividing by the global standard deviation.
[0110] In each round, assuming each parameter A time slot is required for transmission, and the objective function for calculating the link in the air within each time slot is:
[0111]
[0112] in This represents the weight of device m. Let m represent the dataset in device m, and d represent the normalized local model. For ease of analysis, the number of rounds and time index are omitted. and Simplify to x and s respectively m .
[0113] Step 3.2 The base station divides the M devices into two categories based on their channel quality: N devices with relatively good channel quality and K devices with relatively poor channel quality. The following formula is used to select the N devices with relatively good channel quality for this category.
[0114]
[0115] Where {h1,...,h M Let} be the channel coefficients from each device to the base station. Assume a set of devices with relatively good channel quality. Xinhedao's equipment sets are of relatively poor quality. These are respectively the near-end device set and the edge device set, and Assume all devices are half-duplex.
[0116] Step 3.3 The base station collects relevant channel information of the current wireless network and solves for system parameters, as shown below.
[0117] Step 3.3.1 The base station collects the current network h k ,g k,n ,f n , ρ m P0, where Indicates edge device Channel coefficients between the base station and the base station Indicates edge device With near-end devices The channel coefficients between them Indicates near-end device Channel coefficients between the base station and the base station P0 represents the weight of device m, and P0 represents the maximum transmit power of the device.
[0118] Step 3.3.2 Establish the optimization problem as follows: Solve for system parameter a k , b n ,d n , c1, c2, where The complex emission coefficient at point k in the first-stage device. Let d be the complex emission coefficient at point n of the second-stage device. n Let n be the scaling factor of the native signal at point n of the near-end device. and These are the noise reduction reception coefficients for the two stages of the base station, respectively.
[0119]
[0120]
[0121]
[0122] Among them, a k b represents the emission coefficient of the first-stage edge device; n Indicates the emission coefficient of the second-stage near-end device; d n P0 represents the weighting factor for the near-end equipment in the first stage; g represents the maximum transmit power of the equipment. k,n Indicates edge device With near-end devices The channel coefficients between them; MSE represents the mean square error between the aggregated model x′ obtained by the D2D-assisted two-stage air computing model aggregation method and the objective function x of the air computing link, as shown in the following formula:
[0123]
[0124] Where c1 represents the first-stage noise reduction reception coefficient of the base station; c2 represents the second-stage noise reduction reception coefficient; h k f represents the channel coefficient between edge device k and the base station; n ρ represents the channel coefficient between the near-end device n and the base station; k This represents the weight of edge device k;
[0125] Step 3.3.3 Solve the optimization problem, alternately optimizing the emission coefficient {a} of the edge device in the first stage. k} and the emission coefficient of the second-stage near-end device {b n The weighting factor for the first-stage near-end device is {d}. n The first-stage noise reduction receiving coefficient {c1} and the second-stage noise reduction receiving coefficient {c2} of the base station achieve decoupling of coupled variables. The specific steps are as follows.
[0126] Step 3.3.3.1 Initialize the maximum number of iterations J max =100 and algorithm threshold ε=10 -4 .
[0127] Step 3.3.3.2 Initialization
[0128] Step 3.3.3.3 Calculate the MSE at this time. (0) .
[0129] Step 3.3.3.4 Initialize the iteration count variable j = 0.
[0130] Step 3.3.3.5 For a given Optimize the emission coefficient on edge devices in the first phase Signal weighting factor of near-end devices In this case, the MSE minimization problem simplifies to:
[0131]
[0132]
[0133]
[0134] The question is about {a} k ,d n A convex quadratic constrained quadratic programming (QCQP) problem can be solved using standard convex optimization tools such as CVX.
[0135] Step 3.3.3.6 For a given The emission coefficients on the second-stage near-end device are optimized by solving the following simplified MSE minimization problem:
[0136]
[0137]
[0138] This problem is a convex quadratic constrained quadratic programming (QCQP) problem, which can be solved using CVX.
[0139] Step 3.3.3.7 For a given The first and second stage denoising receiver coefficients of the base station are optimized by solving the following simplified MSE minimization problem.
[0140]
[0141] This problem is a bivariate unconstrained quadratic programming (QP) problem. The optimal solution is obtained when the gradient with respect to {c1, c2} is 0, i.e.
[0142]
[0143]
[0144] in, h k Conjugate; f n Conjugate; bn Conjugate; d n Conjugate; G represents k,n Conjugate; Indicates a k The conjugate of . Solving the system of two linear equations in two variables formed by the above two equations will yield . and
[0145] Step 3.3.3.8 Calculate the MSE at this time. (j) .
[0146] Step 3.3.3.9 If Or j≥J max The optimization ends, and the loop exits. The system parameter 'a' is then output. k , b n ,d n , c1, c2.
[0147] Step 3.3.3.10: Iterate the counter variable j++, enter the next loop, and repeat steps 3.3.3.5 to 3.3.3.10.
[0148] Step 3.4 In the first stage, all edge devices send their signals s k After adjusting the transmission power, the signal is simultaneously transmitted to all near-end devices and the base station. The mixed signal of the received signal and its own signal at near-end device n is:
[0149]
[0150] Where, d n The scaling factor is the native signal at point n of the near-end device. It is additive white Gaussian noise at point n of the near-end device; s k Represents the normalized local model of device k; s n This represents the normalized local model of device n. At this point, the signal received by the base station in the first stage is:
[0151]
[0152] in, It is the first stage of additive white Gaussian noise.
[0153] Step 3.5 In the second stage, each near-end device n will mix the signal r n Multiply by complex value coefficient After amplification, the signal is sent to the base station. The received signal at the base station in the first stage is:
[0154]
[0155] in, It is the second stage of additive white Gaussian noise.
[0156] Step 3.6 The signals received by the base station in the first and second stages are superimposed. After receiving the signals y1 and y2 from the two stages, the base station applies noise reduction receiving coefficients to y1 and y2 respectively. and The weighted sum of x is estimated as follows Represented as:
[0157]
[0158] Then we can obtain the estimate of x as x'.
[0159] Step 4: The base station updates the global model to w' [r] =Ψ -1 (x' [r] ), Ψ -1 (·) indicates denormalization, which involves multiplying the local value by the global standard deviation and then adding the global mean.
[0160] Step 5: When the training reaches the preset fixed number of rounds, 20, stop the training. Otherwise, r = r + 1, and repeat steps one through five to enter the next cycle.
[0161] The federated learning model is obtained.
[0162] This example uses the prediction accuracy of the federated learning model to measure performance. The model is tested using a test dataset. A correct prediction is defined as when the model's output matches the labels of the received test data. A prediction failure is defined as when the model's output does not match the labels. Prediction accuracy is the ratio of the number of correctly predicted test data points to the total number of test data points.
[0163]
[0164] Where N right N is the number of times the prediction is correct. total This represents the total number of test data.
[0165] In this example, the model prediction accuracy of the proposed scheme is compared with that of other reference schemes. The comparisons are made between traditional over-the-air federated learning, relay schemes (see reference: Lin Z, Liu H, Zhang YJ A. Relay-assisted cooperative federated learning[J]. IEEE Transactions on Wireless Communications, 2022, 21(9):7148-7164.) and scheduling schemes (see reference: Ma X, Sun H, Wang Q, et al. User scheduling for federated learning through over-the-air computation[C] / / 2021 IEEE 94th Vehicular Technology Conference(VTC2021-Fall). IEEE, 2021:1-5.) and their changes in model prediction accuracy during the training process. Figure 3 As shown, the relay scheme deploys multiple half-duplex relays to collaboratively assist devices in uploading local model updates to the edge server. In the experiment, four relay devices were deployed evenly distributed on a circle with a radius of 250m. The scheduling scheme, based on channel conditions, excluded devices with the worst channel conditions. Three-quarters of the devices were scheduled to participate in federated learning. Traditional over-the-air computation schemes generate significant model aggregation errors. As training progresses, the accumulated aggregation error leads to increasingly inaccurate global models, thus reducing prediction accuracy. Considering network complexity and installation / maintenance costs, the number of relay devices is generally small, resulting in fewer forwarding attempts by edge devices and lower diversity gain, leading to a decrease in the prediction accuracy of the federated learning model obtained by the relay scheme. Discarding devices during training often reduces the amount of data participating in model training, further decreasing the prediction accuracy of the model obtained by the scheduling scheme. Due to the D2D mechanism, the D2D-assisted over-the-air computation scheme has smaller aggregation errors and achieves a significant accuracy improvement compared to direct over-the-air computation. Furthermore, the final model's prediction accuracy is very close to that of the error-free ideal model aggregation federated learning.
[0166] As can be seen from the above description, the D2D-assisted two-stage airborne computation model aggregation method proposed in this invention differs significantly from existing wireless network federated learning schemes. The proposed scheme first involves users with poor channel quality simultaneously sending model data to multiple users with good channel quality and the base station in the first stage. In the second stage, devices with good channel quality aggregate their own model data and the received model data, then send it to the base station. The base station aggregates the model data received in both stages to obtain the aggregated model for this round of federated learning. This effectively reduces model aggregation errors while maintaining the prediction accuracy of the federated learning model in the wireless network, significantly improving the wireless communication efficiency of federated learning. This scheme fully utilizes the collaborative diversity of wireless federated learning systems, improving communication efficiency and the training speed of federated learning models. Furthermore, this scheme is based on existing equipment in the network, eliminating the need to deploy new equipment. In addition, the proposed algorithm converges quickly.
[0167] The above-described embodiments are merely illustrative of the implementation methods of the present invention, but should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the protection scope of the present invention.
Claims
1. A D2D-assisted two-stage aerial computation model aggregation method, characterized in that, The method includes the following steps: The first step is global model distribution, where the base station broadcasts the current global model to all devices via a wireless link; The specific steps are as follows: Step 1: Global Model Distribution Step 1.1 Global Model Initialization: Skip this step if not in the first round of training; First, determine the structure of the fully connected neural network model, i.e., determine the number of hidden layers, the number of nodes in each hidden layer, the number of nodes in the input layer, the number of nodes in the output layer, the activation functions of the hidden layers, and the form of the output layer, and randomly generate and initialize the global model. ; Step 1.2 Global Model Distribution: Federated learning based on over-the-air computation requires multiple rounds of iterative operations. Assume the current round is the [number of rounds]. wheel( The base station will use the current global model. Broadcast to all devices via wireless link It is assumed that downlink transmission is always successful, meaning that all devices can receive the global model parameters without errors for local training. Step 2: Local Model Update Upon receiving the global model Based on this, each device Run the stochastic gradient descent algorithm to generate an updated local model using the local dataset available to each device. The specific process is as follows: Step 2.1 Perform forward propagation to obtain the prediction results of the current fully connected neural network; Step 2.2 yields the loss function; Step 2.3 Perform backpropagation to calculate the gradient of the loss function with respect to the local model; Step 2.4 Update the local model based on the gradient; Step 3: Perform D2D-assisted two-stage aerial computation model aggregation on the local model; Step 3.1 Local model normalization: In reality, each device needs to adjust its transmit power to resist path loss and small-scale fading; therefore, a linear function is first used to normalize the local model. Normalized to have zero mean and unit variance , Right now , , , ,in, Indicates equipment No. The normalized local model of the wheel; Represents a linear normalization function; Indicates equipment No. A local model of the wheel; Represents the identity matrix; Indicates equipment m' No. r The normalized local model of the wheel; This indicates a demand for expectation; Indicates equipment ; Indicates equipment ; Step 3.2 The base station will determine the channel quality of each device. The equipment is divided into two categories, namely Devices with relatively good channel quality and For devices with relatively poor channel quality, the following formula is used for selection. The devices with relatively good channel quality are classified as follows: in, Given the channel coefficients from each device to the base station; assuming a set of devices with relatively good channel quality. Xinhedao's equipment sets are of relatively poor quality. These are respectively the near-end device set and the edge device set, and Assuming all devices are half-duplex; Step 3.3 The base station collects current network information and solves for system parameters, as detailed below: Step 3.3.1 The base station collects relevant channel information of the current wireless network, among which... Indicates edge device Channel coefficients between the base station and the base station Indicates edge device With near-end devices Channel coefficients between Indicates near-end device Channel coefficients between the base station and the base station Indicates equipment The weight, This indicates the maximum transmit power of each device; Step 3.3.2 Establish the optimization problem as follows: Solve for the system parameters. in, This represents the emission coefficient of the first-stage edge device; This indicates the emission coefficient of the second-stage near-end equipment; This represents the weighting factor for the near-end devices in the first stage; Indicates the device's maximum transmission power; Indicates edge device With near-end devices Channel coefficients between; The aggregated model obtained by the D2D-assisted two-stage aerial computation model aggregation method represents the aggregated model. Objective function of airborne computing link The mean square error is calculated using the following formula: in, This represents the first-stage noise reduction receiver coefficient of the base station; This indicates the receiving coefficient of the second stage noise reduction; Indicates edge device Channel coefficients between the base station and the station; Indicates near-end device Channel coefficients between the base station and the station; Indicates edge device The weights; Step 3.3.3 Solve the optimization problem, alternately optimizing the emission coefficients of the edge devices in the first stage. Emission coefficient of the second-stage near-end device Weighting factor for near-end devices in the first stage The first-stage noise reduction receiver coefficient of the base station With the second stage of noise reduction receiver coefficient This achieves decoupling of coupled variables; Step 3.4 In the first stage, all edge devices send their signals After adjusting the transmission power, it is simultaneously transmitted to all near-end devices and base stations. For the first phase of equipment The complex emission coefficient at the near-end device The mixed signal of the received signal and the self-generated signal at the location is: in, For near-end devices The scaling factor of the signal itself; It is a near-end device Additive white Gaussian noise at the location; Indicates equipment Normalized local model; Indicates equipment The normalized local model; at this time, the signal received by the base station in the first stage is: in, It is the first stage of additive white Gaussian noise; Step 3.5 In the second phase, each near-end device Mixed signals Multiply by complex value coefficient After amplification, the signal is sent to the base station. The received signal at the base station in the first stage is: in, It is the second stage of additive white Gaussian noise; Step 3.6 The signals received by the base station in the first and second stages are superimposed, and the signals from both stages are received. and Afterwards, the base station... and Apply denoising receiver coefficients separately and , to obtain weighted sum The estimate is , represented as: Then we can obtain The estimate is ; Step 4: The base station updates the global model to... , This indicates denormalization, specifically by multiplying the local model by the global standard deviation and then adding the global mean. Step 5: Stop training when the preset fixed number of rounds has been reached; otherwise, Repeat steps one through five to enter the next cycle, and finally obtain the federated learning model; The second step is local model update. Based on the received global model, each device runs a local update algorithm, which is a stochastic gradient descent algorithm. The updated local model is trained using a local dataset. The third step involves D2D-assisted two-stage over-the-air computation model aggregation of the local models. In the first stage, users with poor channel quality simultaneously send local model data to multiple users with good channel quality and the base station. In the second stage, devices with good channel quality aggregate their own local model data and the local model data received from users with poor channel quality, and then send them to the base station. Finally, the base station aggregates the local model data received in both stages to obtain the aggregated model for this round of federated learning. The fourth step is global model update, where the base station uses the current aggregated model as the new global model; Fifth, when the predetermined conditions for terminating federal learning training are met, training is stopped; otherwise, steps one through four are repeated to begin the next round of training.
2. The method for D2D-assisted two-stage aerial computation model aggregation according to claim 1, characterized in that, In step 3.1, the specific steps of normalization are as follows: Step 3.1.1 Local statistical estimation of the devices: Each device estimates the mean and variance of the local model parameters, and then transmits the mean and variance of the local estimates to the base station; Step 3.1.2 Global statistical estimation of the base station: The base station performs a weighted average of the mean and variance of each device to obtain the mean, variance and standard deviation of the global statistical estimate, and then broadcasts the global mean and standard deviation to each device. Step 3.1.3 Local model normalization for each device: The local model of each device is normalized by subtracting the global mean and then dividing by the global standard deviation; in each round, it is assumed that each parameter... A time slot is required for transmission, and the objective function for calculating the link in the air within each time slot is: in, Indicates equipment The weight, Indicates equipment The dataset in d Represents the normalized local model The number of parameters; for ease of analysis, the round number and time index are omitted. and Simplified to and .
3. The method for D2D-assisted two-stage aerial computation model aggregation according to claim 1, characterized in that, In step 3.3.3, the solution steps are as follows; Step 3.3.3.1 Initialize the maximum number of iterations , Take a positive integer, and the algorithm threshold ε. Take a real number between 0 and 1; Step 3.3.3.2 Initialization ; Step 3.3.3.3 Calculate the value at this time. ; Step 3.3.3.4 Initialize the iteration count variable ; Step 3.3.3.5 For a given Optimize the emission coefficient on edge devices in the first phase Signal weighting factor of near-end devices In this case, the MSE minimization problem simplifies to: The question is about A convex quadratic constrained quadratic programming (QCQP) problem can be solved using a standard convex optimization solver, namely CVX. Step 3.3.3.6 For a given The emission coefficients on the second-stage near-end device are optimized by solving the following simplified MSE minimization problem: : This problem is a convex quadratic constrained quadratic programming (QCQP) problem, which can be solved using CVX. Step 3.3.3.7 For a given The first and second stage denoising receiver coefficients of the base station are optimized by solving the following simplified MSE minimization problem. : This problem is a bivariate unconstrained quadratic programming (QP) problem; when regarding When the gradient is 0, the optimal solution is obtained, that is: in, express Conjugate; express Conjugate; express Conjugate; express Conjugate; express Conjugate; express The conjugate of the equations; solving the system of two linear equations in two variables formed by the above two equations will yield the result. and ; Step 3.3.3.8 Calculate the value at this time. ; Step 3.3.3.9 If or The optimization ends, the loop exits; the system parameters at this point are output. ; Step 3.3.3.10 Iteration Count Variable Then proceed to the next cycle and repeat steps 3.3.3.5 to 3.3.3.10.