Semi-federated learning optimization method and semi-federated learning method
By integrating FL and SL in a semi-federal learning framework in wireless communication networks, optimizing resource allocation, solving the problems of waste of computing resources, data privacy leakage and communication overhead, and achieving efficient AI model training and low-energy semi-federal learning.
Patent Information
- Application Number
- CN202510483021.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-07-18
AI Technical Summary
The existing semi-federal learning framework has problems such as waste of computing resources, leakage of data privacy, large communication overhead and high energy consumption in wireless communication networks, and has failed to effectively optimize communication resources and data allocation.
The semi-federal learning framework that integrates FL and SL, optimizes the communication resource allocation, computing resource allocation and data allocation between equipment and base stations through the base station, and builds an optimization problem with the goal of minimizing total energy consumption, solving the problem of unbalanced resource allocation.
It improves the utilization rate of base station computing resources, protects the data privacy of the equipment, saves communication overhead, and reduces total energy consumption while meeting the delay requirements.
Smart Images

Figure CN120343582A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of wireless communication networks, and particularly relates to a semi-federated learning optimization method and a semi-federated learning method. Background Art
[0002] In a wireless communication network, a Federated Learning (FL) framework consists of a base station and multiple devices. The base station has only one global model, and each device has a local dataset and a copy of the global model respectively. The model training process of the FL framework can be divided into multiple rounds. The process in each round is as follows: First, each device calculates local gradients based on the local dataset and the copy of the global model; Subsequently, each device uploads the local gradients to the base station for aggregation to generate global gradients; Subsequently, the base station uses the global gradients to update the global model, completing one round of training of the global model; Finally, the base station broadcasts the updated global model to each device, and each device replaces its copy of the global model with the updated global model.
[0003] In a wireless communication network, a Centralized Learning (CL) framework also consists of a base station and multiple devices. The base station has only one global model, and each device has a local dataset and a copy of the global model respectively. The model training process of the CL framework is also divided into multiple rounds. The process in each round is as follows: First, the base station collects the local datasets of each device to form a CL dataset at the base station; Subsequently, the base station generates global gradients based on the CL dataset and the global model, and trains the global model with these gradients. After multiple training rounds, the base station completes the training of the global model and broadcasts the trained global model to all devices.
[0004] In a wireless communication network, the Split Learning (SL) framework also consists of a base station and a device. In the SL framework, the global model is divided into a shallow part and a deep part. The device has the shallow part of the global model and a local dataset, and the base station has the deep part of the global model. The model training process of the SL framework is also divided into multiple rounds, and the process in each round is as follows: First, the device inputs the local dataset into the shallow part of the global model to obtain intermediate output data; then, the device uploads the intermediate output data to the base station, and the base station constructs an intermediate output dataset; next, based on the intermediate output dataset and the deep part of the global model, the base station uses the backpropagation algorithm to obtain the gradient corresponding to the deep part of the global model and updates the global model with this; finally, the base station sends the intermediate output data of the backpropagation algorithm back to the device, and the device continues to use the backpropagation algorithm based on the intermediate output data of the backpropagation algorithm and the shallow part of the global model to obtain the gradient corresponding to the shallow part of the global model and further updates the shallow part of the global model with this gradient.
[0005] Multiple senders using Over-the-Air Computation (AirComp) technology concurrently transmit signals on the same time-frequency resources, and utilize the superposition characteristics of the wireless channel to complete signal-level calculations, enabling the receiver to directly receive the calculation results of the signals sent by each sender. In the FL framework, this AirComp technology is commonly used to aggregate local gradients from each device at the base station.
[0006] The gradient descent algorithm is a basic algorithm for training an Artificial Intelligence (AI) model. In this algorithm, first, the gradient is calculated using data samples and the AI model; then, the parameters of the AI model to be updated are subtracted by the product of the learning rate and the gradient to obtain the updated AI model. In the FL framework and the CL framework, the gradient descent algorithm is used to update the global model of the base station.
[0007] To achieve efficient AI model training, the existing semi-federated learning framework is a fusion of the FL framework and the CL framework, and the model training process is also divided into multiple rounds. In each training round of the semi-federated learning framework, first, each device divides its local dataset into an FL dataset and a CL dataset; then, each device calculates the FL local gradient based on the FL dataset and a copy of the global model; next, each device uploads the FL local gradient and the CL dataset to the base station; subsequently, the base station, on the one hand, aggregates the FL local gradients of each device to generate an FL gradient, and on the other hand, the base station calculates the CL gradient based on the CL dataset and the global model; then, the base station fuses the FL gradient and the CL gradient to obtain the global gradient, and updates the global model with the global gradient; finally, the base station broadcasts the updated global model to each device and deletes the CL dataset of the current round.
[0008] In the FL framework, the base station has rich computing resources but only undertakes simple local gradient aggregation tasks, resulting in a waste of its computing resources. Moreover, without the assistance of the CL framework in the FL framework, the model training effect is poor. At the same time, in the CL framework and the existing semi-federated learning framework, the local datasets of each device are directly uploaded to the base station, resulting in the leakage of device data privacy. In addition, in the existing SL framework, the base station needs to send the intermediate output data of the backpropagation algorithm back to the device to train the shallow part of the global model, which causes additional communication overhead and increases the process complexity of the SL framework. In the existing semi-federated learning framework, the joint optimization of the communication resources and data allocation ratio between the transceiver ends is not involved, resulting in a high delay and high energy consumption in the semi-federated learning framework. Summary of the Invention
[0009] To solve the problems existing in the prior art, the present invention provides a semi-federated learning optimization method and a semi-federated learning method. The present invention innovatively transforms the existing semi-federated learning framework that fuses FL and CL into a semi-federated learning framework that fuses FL and SL. By enabling the base station to undertake the model training task of SL, the utilization rate of the computing resources of the base station is improved, and a model training performance superior to that of the FL framework is achieved; by replacing CL in the semi-federated learning framework with SL, the base station is prevented from obtaining the original data of the device to protect user privacy; by omitting the training of the shallow part of the global model in the SL framework, communication overhead is saved; by jointly optimizing the communication resource allocation, computing resource allocation, and data allocation between each device and the base station, a low-energy semi-federated learning framework with guaranteed delay is realized.
[0010] The technical solutions adopted by the present invention to solve the technical problems are as follows:
[0011] A semi-federated learning optimization method provided by the present invention includes the following steps:
[0012] S301: Construct the first semi-federated learning optimization problem aiming to minimize the total energy consumption;
[0013] In each training round, the base station obtains the uplink channel gain vectors of the devices to the base station, the maximum transmit power of each device, and the maximum CPU frequency of each device. On the premise of satisfying the maximum transmit power constraint, the maximum CPU frequency constraint, the ratio constraint of the local federated learning dataset to the local partitioned learning dataset, the norm constraint of the base station beamforming vector, the maximum MSE constraint, the upper bound constraint of semi-federated learning optimality, and the latency constraint, construct the first semi-federated learning optimization problem aiming to minimize the total energy consumption, and the base station solves this optimization problem to obtain the semi-federated learning optimization result;
[0014] S302: Solve the first sub-optimization problem to obtain the transmit power allocation scheme for each device;
[0015] The mathematical expression of the first sub-optimization problem is:
[0016]
[0017] where, represents the data reception normalization factor of the base station for device k, represents the gradient aggregation normalization factor of the base station, represents a non-negative auxiliary variable, and are both non-negative constants, K represents the number of devices, represents the base station data reception noise intensity;
[0018] S303: Solve the second sub-optimization problem to obtain the CPU frequency allocation scheme for each device and the base station;
[0019] The mathematical expression of the second sub-optimization problem is:
[0020]
[0021] where, represents the CPU frequency of device k, represents the CPU frequency of the base station, represents a non-negative auxiliary variable, and are both constants;
[0022] S304: Solve the third sub-optimization problem to obtain the ratio of the local federated learning dataset to the local partitioned learning dataset for each device;
[0023] The mathematical expression of the third sub-optimization problem is:
[0024]
[0025] Among them, represents a non - negative auxiliary variable, is a constant, represents the ratio of the local federated learning dataset to the local split learning dataset of device k;
[0026] S305: Solve the fourth sub - optimization problem to obtain the beamforming vector configuration scheme of the base station;
[0027] The mathematical expression of the fourth sub - optimization problem is:
[0028]
[0029] Among them, represents an auxiliary matrix variable determined by the data reception beamforming vector of the base station, represents the data reception beamforming vector of the base station for device k, represents an auxiliary matrix variable determined by the gradient aggregation beamforming vector of the base station, b represents the gradient aggregation beamforming vector of the base station, represents the data reception uplink channel gain vector from device k to the base station The determined channel matrix, represents the gradient aggregation uplink channel gain vector from device k to the base station The determined channel matrix, represents the trace of the matrix, and are both constants;
[0030] S306: If convergence is not reached, continue to execute S302;
[0031] S307: If convergence is reached, end the semi - federated learning optimization process and output the semi - federated learning optimization result.
[0032] Furthermore, the condition of the maximum transmission power constraint is:
[0033]
[0034] Among them, represents the maximum transmission power of each device, represents the power for device k to send the local gradient, represents the power for device k to send the intermediate output data;
[0035] The condition of the maximum CPU frequency constraint is:
[0036]
[0037] Among them, represents the maximum CPU frequency of each device, represents the maximum CPU frequency of the base station;
[0038] The condition for the ratio constraint of the local federated learning dataset to the local split learning dataset is:
[0039]
[0040] Among them, represents this ratio 's minimum value;
[0041] The condition for the base station beamforming vector norm constraint is:
[0042]
[0043] Among them, represents the vector 2-norm;
[0044] The condition for the maximum MSE constraint is:
[0045]
[0046] Among them, represents the maximum allowable MSE value;
[0047] The upper bound of the semi-federated learning optimality is defined as: when t approaches positive infinity, the loss function of the t-th training round and the global optimal loss function the upper bound of the expectation of the difference:
[0048] lim t →∞ [ F ( w t ) − F ( w * ) ] ≤ L μ 1 4 μ − L ( A 2 + σ 2 Q 2 ν ) = ψ ( ν )
[0049] Among them, , and are all non-negative constants, represents the dimension of the global model, represents the upper bound of the semi-federated learning optimality;
[0050] The condition for the upper bound constraint of the semi-federated learning optimality is:
[0051]
[0052] Among them, represents the allowable upper bound value of the semi-federated learning optimality;
[0053] The condition for the delay constraint is:
[0054]
[0055] Among them, represents the maximum time delay allowed for one training round, represents the actual time delay of one training round;
[0056] Under the constraints of the above constraints, the mathematical expression of the first optimization problem of semi - federated learning constructed with the goal of minimizing the total energy consumption is:
[0057]
[0058] Among them, represents the total energy consumption of semi - federated learning.
[0059] Furthermore, in step S302, the constraint conditions of the first sub - optimization problem are:
[0060]
[0061] Among them, represents the maximum time delay allowed for one training round, , , , , , , are all constants, represents the time delay for the base station to calculate the split - learning gradient, represents the time delay for device k to calculate the local gradient, represents the time delay for each device to upload the local gradient, represents taking the maximum value, represents the set composed of each device, represents the gradient aggregation normalization factor of the base station;
[0062] The optimization variables of the first sub - optimization problem are: the transmission power allocation scheme and , solve the first sub - optimization problem to determine the transmission power allocation scheme for each device when sending the local gradient and the intermediate output data of the shallow part of the global model.
[0063] Furthermore, in step S303, the constraint conditions of the second sub - optimization problem are:
[0064]
[0065] Among them, represents the maximum time delay allowed for one training round, and are all constants, represents the time delay for device k to upload the intermediate output data of the shallow part of the global model, Denote the latency of each device uploading the local gradient. Denote the CPU frequency of device k. Denote the CPU frequency of the base station. Denote the maximum CPU frequency of each device. Denote the maximum CPU frequency of the base station. Denote the set composed of each device;
[0066] The optimization variables of the second sub-optimization problem are: the CPU frequency allocation schemes of each device and the base station and , solve the second sub-optimization problem, and determine the CPU frequency allocation schemes of each device when calculating the local gradient and splitting the learning gradient.
[0067] Furthermore, in step S304, the constraint conditions of the third sub-optimization problem are:
[0068]
[0069] Among them, Denote the maximum latency allowed in one training round, , , , are all constants, Denote device 's ratio of the local federated learning dataset to the local split learning dataset, Denote the latency of each device uploading the local gradient, Denote the set composed of each device;
[0070] The optimization variables of the third sub-optimization problem are the ratios of the local federated learning datasets to the local split learning datasets of each device , solve the third sub-optimization problem, and determine the ratios of the local federated learning datasets to the local split learning datasets of each device.
[0071] Furthermore, in step S305, the constraint conditions of the fourth sub-optimization problem are:
[0072]
[0073] Among them, Denote matrix positive semi-definite, Denote the rank of the matrix, Denote the set composed of each device;
[0074] The optimization variables of the fourth sub-optimization problem are the beamforming vector configuration scheme of the base station and the corresponding auxiliary matrix variable and , solve the fourth sub-optimization problem, and restore the auxiliary matrix variables and to the beamforming vectors of the base station and , and determine the beamforming vector configuration scheme for the base station to aggregate the local gradients and receive the intermediate output data of the shallow part of the global model.
[0075] A semi-federated learning method provided by the present invention is implemented by using the semi-federated learning optimization method described above, and includes the following steps:
[0076] Step S1: Construct a semi-federated learning framework that integrates the FL framework and the SL framework. The semi-federated learning framework includes 1 base station and K devices;
[0077] Step S2: When entering each training round, the base station obtains the uplink channel gain vectors from each device to the base station, the maximum transmission power of each device, and the maximum CPU frequency of each device;
[0078] Step S3: The base station executes the semi-federated learning optimization method to obtain the optimization result, and broadcasts the optimization result and the global model to each device;
[0079] Step S4: Each device calculates the local gradient according to the optimization result, using the local federated learning dataset and the global model, and uploads the local gradient to the base station using the same time-frequency resources;
[0080] Step S5: Based on split learning, each device divides the global model into a shallow part and a deep part, inputs the local split learning dataset into the shallow part to obtain intermediate output data, and uploads the intermediate output data to the base station using non-overlapping time-frequency resources;
[0081] Step S6: The base station uses air computing technology to aggregate the local gradients of each device to obtain the federated learning gradient;
[0082] Step S7: The base station inputs the intermediate output data of each device into the deep part of the global model to obtain the split learning gradient;
[0083] Step S8: The base station updates the shallow part of the global model using the shallow part of the federated learning gradient;
[0084] Step S9: The base station jointly updates the deep part of the global model using the deep part of the federated learning gradient and the split learning gradient.
[0085] Further, in step S4, the calculation formula of the local gradient is:
[0086]
[0087] Among them, represents the local gradient of device k, represents the local federated learning dataset of device k, represents the local federated learning dataset of device k The total number of data samples in it, n represents the nth data sample in the local dataset of device k, represents the global model, represents any data sample, represents the federated learning gradient corresponding to a data sample, represents the gradient operator, represents a data sample The corresponding loss function.
[0088] Furthermore, in step S6, the calculation formula of the federated learning gradient is:
[0089]
[0090] Among them, represents the gradient aggregation beamforming vector of the base station, satisfying , represents the vector 2-norm, and the superscript H represents the conjugate transpose, represents the gradient aggregation normalization factor of the base station, represents the gradient aggregation uplink channel gain vector from device k to the base station, represents the power of device k to send the local gradient, represents the gradient aggregation noise, represents the local gradient of device k;
[0091] The aggregation distortion of the federated learning gradient is measured by the mean square error calculation formula:
[0092]
[0093] Among them, MSE represents the mean square error, represents the base station gradient aggregation noise Intensity.
[0094] Furthermore, in step S7, the calculation formula of the intermediate output data is:
[0095]
[0096] Among them, represents the data reception beamforming vector of the base station, satisfying , represents the vector 2-norm, and the superscript H represents the conjugate transpose, Denote the data reception normalization factor of the base station, Denote the uplink channel gain vector of the data reception from device k to the base station, Denote the power of the intermediate output data transmitted by device k, is the transmission signal of the intermediate output data of device k, Denote the data reception noise;
[0097] The reception quality of the intermediate output data of the said device k is measured by the data rate calculation formula:
[0098]
[0099] wherein, Denote the data rate of device k, Denote the bandwidth used by device k to upload the intermediate output data, Denote the base station data reception noise intensity, Denote the natural logarithm.
[0100] Furthermore, in step S8, the base station divides the federated learning gradient into a shallow part and a deep part , and uses the shallow part of the federated learning gradient to update the shallow part of the global model by the following formula: :
[0101]
[0102] wherein, Denote the learning rate, Denote the th training round of the global model shallow part.
[0103] Furthermore, in step S9, the base station jointly uses the deep part of the federated learning gradient and the split learning gradient to update the deep part of the global model by the following formula:
[0104]
[0105] wherein, Denote the th training round of the global model deep part, Denote the federated learning weight, Indicates the split learning weights, satisfying .
[0106] The beneficial effects of the present invention are as follows:
[0107] (1) The semi-federated learning framework proposed by the present invention integrates the FL framework and the SL framework, can improve the utilization rate of the base station's computing resources while protecting data privacy, and achieve better AI model training effects than the existing FL framework.
[0108] (2) The semi-federated learning framework proposed by the present invention avoids the training of the shallow part of the global model using the backpropagation algorithm in the existing SL framework, saving communication overhead.
[0109] (3) The semi-federated learning optimization method proposed by the present invention is used to optimize the resource allocation scheme of the proposed semi-federated learning framework. By jointly optimizing the communication resource allocation, computing resource allocation, and data allocation of each device and the base station, the total energy consumption of the semi-federated learning framework can be saved while meeting the total delay requirements of the semi-federated learning framework. Description of the Drawings
[0110] Figure 1 It is a schematic diagram of the semi-federated learning framework in the present invention.
[0111] Figure 2 It is a schematic flowchart of a semi-federated learning method provided by the present invention.
[0112] Figure 3 It is a schematic flowchart of a semi-federated learning optimization method provided by the present invention. Detailed Embodiments
[0113] The following further describes the present invention in detail with reference to the accompanying drawings.
[0114] In the first aspect, the present invention aims to provide a semi-federated learning (Semi-Federated Learning, SemiFL) framework for efficiently training an AI model in a "centralized and distributed cooperation" manner in a wireless communication network. This framework integrates the FL framework and the SL framework, can improve the utilization rate of the base station's computing resources while protecting data privacy, and achieve better AI model training effects than the existing FL framework.
[0115] In a second aspect, the present invention aims to provide a semi-federated learning optimization method for optimizing the resource allocation scheme of the proposed semi-federated learning framework. On the premise of meeting the total delay requirement of the semi-federated learning framework, by jointly optimizing the transmission power allocation scheme of each device, the CPU frequency allocation scheme of each device and the base station, the ratio of the local FL dataset to the local SL dataset of each device, and the beamforming vector configuration scheme of the base station, the total energy consumption of the semi-federated learning framework is saved.
[0116] A semi-federated learning method provided by the present invention combines federated learning and split learning. As Figure 2 shown, its specific implementation process is as follows:
[0117] Step S1: Construct a semi-federated learning framework that combines the FL framework and the SL framework;
[0118] As Figure 1 shown, in a wireless communication network, the semi-federated learning framework mainly includes 1 base station and K devices. Among them, the number values of the K devices form a set ; at the t-th training round, each device has a local federated learning dataset and a local split learning dataset .
[0119] In the present invention, device k can use the local federated learning dataset and the global model to calculate the local gradient .
[0120] Based on split learning, each device divides the global model into a shallow part and a deep part . Each device inputs the local split learning dataset into the shallow part of the global model to obtain intermediate output data.
[0121] The present invention uses a total of K + 1 non-overlapping time-frequency resources; among them, each device shares 1 of the K + 1 time-frequency resources to upload the local gradient, and the base station aggregates the local gradients of each device based on air computing technology on this time-frequency resource to obtain the federated learning gradient; in addition, each device uses 1 of the remaining K non-overlapping time-frequency resources to upload the intermediate output data of the shallow part of its global model to the base station.
[0122] After receiving the local gradients and intermediate output data uploaded by each device, the base station updates the shallow part of the global model using the shallow part of the federated learning gradient; and the base station constructs an intermediate output dataset , calculate the split learning gradient accordingly, and jointly use the deep part of the federated learning gradient and the split learning gradient to update the deep part of the global model.
[0123] The semi-federated learning framework constructed in the present invention integrates the FL framework and the SL framework, can achieve a better model training effect than the FL framework, and can protect the data privacy of devices.
[0124] Step S2: When entering each training round, the base station obtains the uplink channel gain vectors from each device to the base station, the maximum transmission power of each device, and the maximum CPU (Central Processing Unit) frequency of each device;
[0125] Among them, the time length of the training round is related to the communication and computing capabilities of each device and needs to be set according to the actual usage scenario.
[0126] Step S3: The base station executes the semi-federated learning optimization method to obtain the optimization result, and broadcasts the optimization result and the global model to each device;
[0127] Specifically, the optimization results of the semi-federated learning optimization method mainly include: the transmission power allocation scheme for each device, the CPU frequency allocation scheme for each device, the ratio of the local federated learning dataset to the local split learning dataset for each device, and the beamforming vector configuration scheme for the base station.
[0128] As Figure 3 shown, its specific implementation process is as follows:
[0129] S301: Construct the first semi-federated learning optimization problem with the goal of minimizing the total energy consumption;
[0130] As Figure 3 shown, in each training round when this semi-federated learning optimization method is entered, the base station obtains the uplink channel gain vectors from each device to the base station, the maximum transmission power of each device, and the maximum CPU frequency of each device. On the premise of satisfying the maximum transmission power constraint, the maximum CPU frequency constraint, the ratio constraint of the local federated learning dataset to the local split learning dataset, the base station beamforming vector norm constraint, the maximum MSE constraint, the upper bound constraint of semi-federated learning optimality, and the delay constraint conditions, construct the first semi-federated learning optimization problem with the goal of minimizing the total energy consumption, and the base station solves this optimization problem to obtain the semi-federated learning optimization result.
[0131] In the present invention, the upper bound of semi-federated learning optimality is defined as: when t approaches positive infinity, the upper bound of the expectation of the difference between the loss function in the t-th training round and the global optimal loss function , and its specific mathematical expression is as follows:
[0132] lim t →∞ [ F ( w t ) − F ( w * ) ] ≤ L μ 1 4 μ − L ( A 2 + σ 2 Q 2 ν ) = ψ ( ν )
[0133] Among them, 、 and are all non - negative constants, represents the dimension of the global model, represents the gradient aggregation normalization factor of the base station, represents the base station gradient aggregation noise intensity. For ease of expression, t is omitted.
[0134] In the present invention, the maximum transmission power constraint condition is:
[0135]
[0136] Among them, represents the maximum transmission power of each device, represents the power for device k to send local gradients, represents the power for device k to send intermediate output data.
[0137] In the present invention, the maximum CPU frequency constraint condition is:
[0138]
[0139] Among them, represents the CPU frequency of device k, represents the CPU frequency of the base station, represents the maximum CPU frequency of each device, represents the maximum CPU frequency of the base station.
[0140] In the present invention, the ratio constraint condition of the local federated learning dataset to the local split learning dataset is:
[0141]
[0142] Among them, represents the ratio of the local federated learning dataset to the local split learning dataset of device k, represents this ratio minimum value.
[0143] In the present invention, the base station beamforming vector norm constraint condition is:
[0144]
[0145] Among them, represents the data reception beamforming vector of the base station for device k, b represents the gradient aggregation beamforming vector of the base station, represents the vector 2 - norm.
[0146] In the present invention, the maximum MSE constraint condition is:
[0147]
[0148] wherein, represents the maximum allowable MSE value.
[0149] In the present invention, the upper bound constraint condition of semi-federated learning optimality is:
[0150]
[0151] wherein, represents the upper bound value of the allowable semi-federated learning optimality, represents the upper bound of the semi-federated learning optimality.
[0152] In the present invention, the delay constraint condition is:
[0153]
[0154] wherein, represents the maximum allowable delay for one training round, represents the actual delay for one training round.
[0155] Under the constraints of the above constraint conditions, the mathematical expression of the first optimization problem of semi-federated learning constructed with the goal of minimizing the total energy consumption is:
[0156]
[0157] wherein, represents the total energy consumption of semi-federated learning, represents the data reception normalization factor of the base station for device k, represents the gradient aggregation normalization factor of the base station, b represents the gradient aggregation beamforming vector of the base station, represents the data reception beamforming vector of the base station for device k, represents the CPU frequency of device k, represents the CPU frequency of the base station, represents the ratio of the local federated learning dataset to the local split learning dataset of device k.
[0158] S302: Solve the first sub-optimization problem to obtain the transmission power allocation scheme for each device;
[0159] Specifically, to solve the transmission power allocation scheme for each device and the first sub-optimization problem is:
[0160] m i n { ζ k } , ν , τ 4 ∑ k = 1 K [ C 1 , k ζ k l o g ( 1 + ζ k σ 2 ) + C 2 , k v ]
[0161] Among them, represents the data reception normalization factor of the base station for device k, represents the gradient aggregation normalization factor of the base station, represents the base station data reception noise intensity, represents a non - negative auxiliary variable, and are both non - negative constants.
[0162] The constraint condition of the first sub - optimization problem is:
[0163]
[0164] Among them, represents a non - negative auxiliary variable, represents the maximum time delay allowed in one training round, , , , , , , are all constants, represents the time delay for the base station to calculate the split - learning gradient, represents the time delay for device k to calculate the local gradient, represents the time delay for each device to upload the local gradient, represents taking the maximum value, represents the base station data reception noise intensity, represents the set composed of each device, represents the data reception normalization factor of the base station for device k, represents the gradient aggregation normalization factor of the base station.
[0165] The optimization variables of the first sub - optimization problem are: the transmission power allocation scheme and . Solve the first sub - optimization problem to determine the transmission power allocation scheme for each device when sending local gradients and the intermediate output data of the shallow part of the global model.
[0166] Specifically, the transmission power allocation schemes and can be solved by the following formula:
[0167]
[0168] Among them, , , , , are all constants. represents the gradient aggregation beamforming vector of the base station, satisfying . represents the gradient aggregation uplink channel gain vector from device k to the base station. represents the data reception beamforming vector of the base station, satisfying . represents the data reception uplink channel gain vector from device k to the base station. represents the maximum delay allowed in one training round. represents the delay for the base station to calculate the split learning gradient. represents the base station data reception noise intensity, and the superscript H represents conjugate transpose.
[0169] S303: Solve the second sub-optimization problem to obtain the CPU frequency allocation schemes for each device and the base station;
[0170] Specifically, to solve the CPU frequency allocation schemes for each device and the base station and the second sub-optimization problem is:
[0171]
[0172] where represents a non-negative auxiliary variable, and are all constants.
[0173] The constraint conditions of the second sub-optimization problem are:
[0174]
[0175] where represents a non-negative auxiliary variable, represents the maximum delay allowed in one training round, and are all constants, represents the delay for device k to upload the intermediate output data of the shallow part of the global model, represents the delay for each device to upload the local gradient, represents the CPU frequency of device k, represents the CPU frequency of the base station, represents the maximum CPU frequency of each device, represents the maximum CPU frequency of the base station.
[0176] The optimization variables of the second sub-optimization problem are: the CPU frequency allocation schemes for each device and the base station and Solve the second sub-optimization problem to determine the CPU frequency allocation scheme for each device when calculating the local gradient and the split learning gradient.
[0177] Specifically, the CPU frequency allocation scheme for each device and the base station and can be solved by the following formula:
[0178]
[0179] where denotes taking the maximum value, and are both constants, denotes the delay for each device to upload the local gradient, denotes the delay for device k to upload the intermediate output data of the shallow part of the global model, denotes the maximum allowable delay in one training round.
[0180] S304: Solve the third sub-optimization problem to obtain the ratio of the local federated learning dataset to the local split learning dataset for each device;
[0181] Specifically, the third sub-optimization problem of solving the ratio of the local federated learning dataset to the local split learning dataset for each device is as follows:
[0182]
[0183] where denotes a non-negative auxiliary variable, is a constant, denotes the ratio of the local federated learning dataset to the local split learning dataset for device k.
[0184] The constraint conditions of the third sub-optimization problem are:
[0185]
[0186] where denotes a non-negative auxiliary variable, denotes the maximum allowable delay in one training round, , , , are all constants, denotes the ratio of the local federated learning dataset to the local split learning dataset for device k, denotes device 's ratio of the local federated learning dataset to the local split learning dataset, Indicates the latency of each device uploading the local gradient.
[0187] The optimization variable of the third sub-optimization problem is the ratio of the local federated learning dataset to the local split learning dataset of each device , solve the third sub-optimization problem, and determine the ratio of the local federated learning dataset to the local split learning dataset of each device.
[0188] S305: Solve the fourth sub-optimization problem to obtain the beamforming vector configuration scheme of the base station;
[0189] Specifically, solve the beamforming vector configuration scheme of the base station and The fourth sub-optimization problem is:
[0190]
[0191] where, represents the auxiliary matrix variable determined by the data reception beamforming vector of the base station, represents the auxiliary matrix variable determined by the gradient aggregation beamforming vector of the base station, represents the data reception uplink channel gain vector from device k to the base station the determined channel matrix, represents the gradient aggregation uplink channel gain vector from device k to the base station the determined channel matrix, represents the trace of the matrix, and are both constants.
[0192] The constraint conditions of the fourth sub-optimization problem are:
[0193]
[0194] where, represents that the matrix is positive semi-definite, represents the rank of the matrix.
[0195] The optimization variables of the fourth sub-optimization problem are: the beamforming vector configuration scheme of the base station and the corresponding auxiliary matrix variables and , solve the fourth sub-optimization problem, and restore the auxiliary matrix variables and into the beamforming vectors of the base station and , and determine the beamforming vector configuration scheme of the base station for aggregating the local gradient and receiving the intermediate output data of the shallow part of the global model.
[0196] Preferably, a method combining semi - definite programming and difference convex programming can be used to solve the beamforming vector configuration scheme of the base station. and .
[0197] S306: If convergence is not achieved, continue to execute S302;
[0198] Specifically, the judgment condition for not achieving convergence is that the change value of the total semi - federated energy consumption in two adjacent iteration processes is greater than a preset threshold.
[0199] S307: If convergence is achieved, end the semi - federated learning optimization process and output the semi - federated learning optimization result;
[0200] Specifically, the judgment condition for achieving convergence is that the change value of the total semi - federated energy consumption in two adjacent iteration processes is less than or equal to a preset threshold.
[0201] Step S4: Each device calculates the local gradient using the local federated learning dataset and the global model according to the optimization result, and uploads the local gradient to the base station using the same time - frequency resources;
[0202] In the t - th training round, each device obtains the local gradient through the following formula:
[0203]
[0204] where, represents the local gradient of device k, represents the local federated learning dataset of device k, represents the -th data sample in the local dataset of device k, represents the global model, represents any data sample, represents the federated learning gradient corresponding to a data sample, represents the gradient operator, represents a data sample corresponding to the loss function. Subsequently, each device uploads the local gradient to the base station dimension - by - dimension and concurrently on the same time - frequency resources.
[0205] Step S5: Each device divides the global model into a shallow part and a deep part based on split learning, inputs the local split - learning dataset into the shallow part to obtain intermediate output data, and uploads the intermediate output data to the base station using non - overlapping time - frequency resources;
[0206] In the t - th training round, each device divides the global model into a shallow part and a deep part . Further, device k will use the local split learning dataset as the input to the shallow part to obtain the intermediate output data. Subsequently, each device uploads the intermediate output data to the base station using different time-frequency resources.
[0207] Step S6: The base station uses air computing technology to aggregate the local gradients of each device to obtain the federated learning gradient;
[0208] In the present invention, the base station uses air computing technology to aggregate the local gradients of each device through the following formula to obtain the federated learning gradient :
[0209]
[0210] where, represents the gradient aggregation beamforming vector of the base station, satisfying , represents the vector 2-norm, and the superscript H represents the conjugate transpose, represents the gradient aggregation normalization factor of the base station, represents the gradient aggregation uplink channel gain vector from device k to the base station, represents the power of device k to send the local gradient, represents the gradient aggregation noise.
[0211] Further, the present invention measures the aggregation distortion of the federated learning gradient through the following mean square error (MSE) calculation formula:
[0212]
[0213] where, represents the intensity of the base station gradient aggregation noise .
[0214] Step S7: The base station inputs the intermediate output data of each device into the deep part of the global model to obtain the split learning gradient;
[0215] Specifically, the intermediate output data signal received by the base station from device k is represented by the following formula:
[0216]
[0217] where, represents the data reception beamforming vector of the base station for device k, satisfying , represents the vector 2-norm, and the superscript H represents the conjugate transpose, represents the data reception normalization factor of the base station, Denote the uplink channel gain vector of data received from device k to the base station, Denote the power of the intermediate output data transmitted by device k, Be the signal for transmitting the intermediate output data of device k, Denote the data reception noise.
[0218] Furthermore, the present invention measures the reception quality of the intermediate output data of device k through the following data rate calculation formula:
[0219]
[0220] Wherein, Denote the data rate of device k, Denote the bandwidth used by device k to upload the intermediate output data, Denote the base station data reception noise Intensity, Denote the natural logarithm.
[0221] The base station inputs the intermediate output data of each device into the deep part of the global model to obtain the split learning gradient; wherein, the split learning gradient Is calculated through the following formula:
[0222]
[0223] Wherein, Denote the intermediate output data set constructed by the base station, Denote the intermediate output data set The number of intermediate output data in, Denote the th intermediate output data in the intermediate output data set, Denote any intermediate output data, Denote the deep part of the global model.
[0224] Step S8: The base station uses the shallow part of the federated learning gradient to update the shallow part of the global model;
[0225] Specifically, the base station splits the federated learning gradient Into the shallow part And the deep part , And uses the shallow part Of the federated learning gradient To update the shallow part Of the global model :
[0226]
[0227] Wherein, represents the learning rate, represents the shallow part of the global model at the th training round.
[0228] Step S9: The base station jointly uses the deep part of the federated learning gradient and the split learning gradient to update the deep part of the global model;
[0229] Specifically, the base station jointly uses the deep part of the federated learning gradient and the split learning gradient through the following formula to update the deep part of the global model : of the global model :
[0230]
[0231] wherein, represents the deep part of the global model at the th training round, represents the federated learning weight, represents the split learning weight, satisfying .
[0232] It should be noted that Step S4, Step S6, and Step S8 form a set of serially working step groups; Step S5, Step S7, and Step S9 form another set of serially working step groups; the two step groups work in parallel.
[0233] The above is only the preferred embodiment of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A semi-federated learning optimization method, characterized in that, It includes the following steps: S301: Construct the first semi-federated learning optimization problem aiming to minimize the total energy consumption; In each training round, the base station obtains the uplink channel gain vectors from each device to the base station, the maximum transmission power of each device, and the maximum CPU frequency of each device. On the premise of satisfying the maximum transmission power constraint, the maximum CPU frequency constraint, the ratio constraint of the local federated learning dataset to the local split learning dataset, the base station beamforming vector norm constraint, the maximum MSE constraint, the semi-federated learning optimality upper bound constraint, and the delay constraint conditions, construct the first semi-federated learning optimization problem aiming to minimize the total energy consumption, and the base station solves this optimization problem to obtain the semi-federated learning optimization result; S303: Solve the first sub-optimization problem to obtain the transmission power allocation scheme for each device; The mathematical expression of the first sub-optimization problem is: , Among them, represents the data reception normalization factor of the base station for device k, represents the gradient aggregation normalization factor of the base station, represents a non - negative auxiliary variable, and are both non - negative constants, K represents the number of devices, represents the base station data reception noise intensity; S303: Solve the second sub-optimization problem to obtain the CPU frequency allocation scheme for each device and the base station; The mathematical expression of the second sub-optimization problem is: , Among them, represents the CPU frequency of device k, represents the CPU frequency of the base station, represents a non - negative auxiliary variable, and are both constants; S304: Solve the third sub-optimization problem to obtain the ratio of the local federated learning dataset to the local split learning dataset for each device; The mathematical expression of the third sub-optimization problem is: , Among them, represents a non - negative auxiliary variable, is a constant, represents the ratio of the local federated learning dataset to the local split learning dataset of device k; S305: Solve the fourth sub-optimization problem to obtain the beamforming vector configuration scheme for the base station; The mathematical expression of the fourth sub-optimization problem is: , Among them, represents an auxiliary matrix variable determined by the data reception beamforming vector of the base station, represents the data reception beamforming vector of the base station for device k, represents an auxiliary matrix variable determined by the gradient aggregation beamforming vector of the base station, where b represents the gradient aggregation beamforming vector of the base station, represents the data reception uplink channel gain vector from device k to the base station The determined channel matrix, represents the channel matrix determined by the gradient aggregation uplink channel gain vector from device k to the base station The determined channel matrix, represents the trace of the matrix, and are both constants; S306: If convergence is not achieved, continue to execute S302; S307: If convergence is achieved, end the semi-federated learning optimization process and output the semi-federated learning optimization result.
2. The semi-federated learning optimization method according to claim 1, wherein The condition of the maximum transmission power constraint is: , Among them, represents the maximum transmission power of each device, represents the power for device k to send local gradients, represents the power for device k to send intermediate output data; The condition of the maximum CPU frequency constraint is: , Among them, represents the maximum CPU frequency of each device, represents the maximum CPU frequency of the base station; The condition of the ratio constraint of the local federated learning dataset to the local split learning dataset is: , Among them, represents the minimum value of this ratio; The condition of the base station beamforming vector norm constraint is: , Among them, represents the vector 2-norm; The condition of the maximum MSE constraint is: , Among them, represents the maximum allowable MSE; The upper bound of the semi-federated learning optimality is defined as: when t approaches positive infinity, the upper bound of the expectation of the difference between the loss function of the t-th training round and the global optimal loss function is: , Among them, , and are all non - negative constants, represents the dimension of the global model, represents the upper bound of the optimality of semi - federated learning; The condition of the semi-federated learning optimality upper bound constraint is: , Among them, represents the upper bound value of the optimal semi-federated learning that is allowed; The condition of the delay constraint is: , Among them, represents the maximum time delay allowed for one training round, represents the actual time delay of one training round; Under the constraints of the above constraint conditions, the mathematical expression of the first semi-federated learning optimization problem constructed aiming to minimize the total energy consumption is: , Among them, represents the total energy consumption of semi-federated learning.
3. A semi-federated learning optimization method according to claim 1, characterized in that In step S302, the constraint conditions of the first sub-optimization problem are: , Among them, represents the maximum time delay allowed for one training round, , , , , , , are all constants, represents the time delay for the base station to calculate the split learning gradient, represents the time delay for device k to calculate the local gradient, represents the time delay for each device to upload the local gradient, represents taking the maximum value, represents the set composed of each device, represents the gradient aggregation normalization factor of the base station; The optimization variables of the first sub-optimization problem are: the transmission power allocation scheme and , solve the first sub-optimization problem, and determine the transmission power allocation scheme for each device to send the local gradient and the intermediate output data of the shallow part of the global model.
4. A semi-federated learning optimization method according to claim 1, characterized in that In step S303, the constraint conditions of the second sub-optimization problem are: , Among them, represents the maximum time delay allowed for one training round, and are both constants, represents the time delay of device k uploading the intermediate output data of the shallow part of the global model, represents the time delay of each device uploading local gradients, represents the CPU frequency of device k, represents the CPU frequency of the base station, represents the maximum CPU frequency of each device, represents the maximum CPU frequency of the base station, represents the set composed of each device; The optimization variables of the second sub-optimization problem are: the CPU frequency allocation schemes for each device and the base station and , solve the second sub-optimization problem, and determine the CPU frequency allocation schemes for each device when calculating the local gradient and the split learning gradient 5. A semi-federated learning optimization method according to claim 1, characterized in that In step S304, the constraint conditions of the third sub-optimization problem are: , Among them, represents the maximum time delay allowed for a training round, , , , are all constants, represents the ratio of the local federated learning dataset to the local segmentation learning dataset of device , represents the time delay for each device to upload the local gradient, represents the set composed of each device; The optimization variables of the third sub-optimization problem are the ratios of the local federated learning datasets and the local split learning datasets of each device , solve the third sub-optimization problem, and determine the ratios of the local federated learning datasets and the local split learning datasets of each device.
6. A semi-federated learning optimization method according to claim 1, characterized in that In step S305, the constraint conditions of the fourth sub-optimization problem are: , Among them, indicates that the matrix is positive semi-definite, represents the rank of the matrix, represents the set composed of each device; The optimization variables of the fourth sub-optimization problem are the beamforming vector configuration schemes of the base stations and the corresponding auxiliary matrix variables and . Solve the fourth sub-optimization problem, and restore the auxiliary matrix variables and to the beamforming vectors of the base stations and , and determine the beamforming vector configuration scheme of the base station for aggregating the local gradients and receiving the intermediate output data of the shallow part of the global model.
7. A semi-federated learning method, characterized in that, Implemented by using a semi-federated learning optimization method described in any one of claims 1-6, it includes the following steps: Step S1: Construct a semi-federated learning framework that integrates the FL framework and the SL framework, and the semi-federated learning framework includes 1 base station and K devices; Step S2: When entering each training round, the base station obtains the uplink channel gain vectors from each device to the base station, the maximum transmission power of each device, and the maximum CPU frequency of each device; Step S3: The base station executes the semi-federated learning optimization method to obtain the optimization result, and broadcasts the optimization result and the global model to each device; Step S4: Each device calculates the local gradient using the local federated learning dataset and the global model according to the optimization result, and uploads the local gradient to the base station using the same time-frequency resources; Step S5: Each device divides the global model into a shallow part and a deep part based on split learning, inputs the local split learning dataset into the shallow part to obtain intermediate output data, and uploads the intermediate output data to the base station using non-overlapping time-frequency resources; Step S6: The base station aggregates the local gradients of each device using air computing technology to obtain the federated learning gradient; Step S7: The base station inputs the intermediate output data of each device into the deep part of the global model to obtain the split learning gradient; Step S8: The base station updates the shallow part of the global model using the shallow part of the federated learning gradient; Step S9: The base station jointly updates the deep part of the global model using the deep part of the federated learning gradient and the split learning gradient.
8. A semi-federated learning method according to claim 7, characterized in that, In step S4, the calculation formula of the local gradient is: , Among them, represents the local gradient of device k, represents the local federated learning dataset of device k, represents the local federated learning dataset of device k the total number of data samples in it, n represents the nth data sample in the local dataset of device k, represents the global model, represents any data sample, represents the federated learning gradient corresponding to a data sample, represents the gradient operator, represents a data sample the corresponding loss function; In step S6, the calculation formula of the federated learning gradient is: , Among them, represents the gradient aggregation beamforming vector of the base station, satisfying , represents the vector 2-norm, and the superscript H represents the conjugate transpose, represents the gradient aggregation normalization factor of the base station, represents the gradient aggregation uplink channel gain vector from device k to the base station, represents the power of device k to send the local gradient, represents the gradient aggregation noise, represents the local gradient of device k; The aggregation distortion of the federated learning gradient is measured by the mean square error calculation formula: , where MSE represents the mean squared error, represents the intensity of the base station gradient aggregation noise .
9. A semi-federated learning method according to claim 7, characterized in that, In step S7, the calculation formula of the intermediate output data is: , Among them, represents the data reception beamforming vector of the base station, satisfying , represents the vector 2-norm, and the superscript H represents the conjugate transpose, represents the data reception normalization factor of the base station, represents the data reception uplink channel gain vector from device k to the base station, represents the power of the intermediate output data transmitted by device k, is the intermediate output data transmission signal of device k, represents the data reception noise; The reception quality of the intermediate output data of device k is measured by the data rate calculation formula: , wherein, represents the data rate of device k, represents the bandwidth used by device k to upload intermediate output data, represents the base station data reception noise intensity, represents the natural logarithm.
10. A semi-federated learning method according to claim 7, characterized in that, In step S8, the base station divides the federated learning gradient into a shallow part and a deep part , and uses the shallow part of the federated learning gradient to update the shallow part of the global model through the following formula : : , Among them, represents the learning rate, represents the shallow part of the global model at the th training round; In step S9, the base station jointly uses the federated learning gradient through the following formula for the deep part and the split learning gradient to update the deep part of the global model : , Among them, represents the deep part of the global model at the th training round, represents the federated learning weights, represents the split learning weights, satisfying .