Model training method and apparatus, device, medium, and program product

By selecting edge devices with high contribution levels from edge servers for global model training, the problem of high wireless resource consumption in federated learning is solved, and efficient and accurate model training is achieved.

CN116187483BActive Publication Date: 2026-07-24TSINGHUA UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TSINGHUA UNIVERSITY
Filing Date
2023-02-10
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing federated learning suffers from high wireless resource consumption as the number of edge devices increases during global model training, leading to increased communication latency and resource consumption, resulting in poor performance.

Method used

The edge server receives quality information from edge devices, selects target devices with high contribution levels to upload gradient information of the local model for global model training, and optimizes device selection through drift penalty function and constraints to reduce invalid communication.

Benefits of technology

It improves the efficiency and accuracy of global model training, reduces communication latency and resource consumption, and enhances performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116187483B_ABST
    Figure CN116187483B_ABST
Patent Text Reader

Abstract

The application relates to a model training method and device, equipment, medium and program product. The method is applied to a federal learning system, the federal learning system comprises an edge server and a plurality of edge devices in communication connection with the edge server, and the method comprises the following steps: in the process of training a global model deployed in the edge server, first, receiving quality information sent by each edge device and representing the contribution degree of gradient information of a local model deployed in the edge device to the global model training, then, determining a target edge device from the plurality of edge devices according to the quality information sent by each edge device, and instructing the target edge device to upload gradient information of the local model deployed by the target edge device; and finally, training the global model based on the gradient information uploaded by the target edge device. The method can improve the efficiency and accuracy of the global model training, and has higher performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a model training method, apparatus, device, medium, and program product. Background Technology

[0002] With the development of mobile internet technology, the explosive growth of smart applications, and the massive amounts of data generated at the network edge, computationally intensive tasks have incurred significant latency and bandwidth burdens in data transmission and model computation, while also posing privacy and security issues. Federated learning is a distributed machine learning technique that enables distributed model training across multiple data sources with local data. It constructs a global model based on virtual fused data without requiring the exchange of local individual or sample data, solely by exchanging model parameters or their gradients. This achieves a balance between data privacy protection and shared computation.

[0003] However, current federated learning requires more wireless resources to train global models as the number of edge devices increases, resulting in significant communication latency and resource consumption, leading to poor performance. Summary of the Invention

[0004] Therefore, it is necessary to provide a higher-performance model training method, apparatus, device, medium, and program product to address the aforementioned technical problems.

[0005] Firstly, this application provides a model training method applied to an edge server in a federated learning system. The federated learning system includes an edge server and multiple edge devices that have established communication connections with the edge server. The method includes:

[0006] During the training of the global model deployed on the edge server, quality information sent by each edge device is received. The quality information is used to characterize the contribution of the gradient information of the local model deployed on the edge device to the training of the global model. Based on the quality information sent by each edge device, the target edge device is determined from multiple edge devices, and the target edge device is instructed to upload the gradient information of the local model deployed on the target edge device. The global model is trained based on the gradient information uploaded by the target edge device.

[0007] In one embodiment, determining a target edge device from multiple edge devices based on quality information sent by each edge device includes: determining the target edge device from multiple edge devices based on the convergence speed of federated learning and the quality information sent by each edge device.

[0008] In one embodiment, determining a target edge device from multiple edge devices based on the convergence speed of federated learning and the quality information sent by each edge device includes: obtaining a drift penalty function, which is constructed based on the convergence speed of federated learning and the quality information sent by each edge device; obtaining constraints, which are constructed based on the transmission energy information of each edge device; solving the drift penalty function based on the constraints, with the goal of minimizing the value of the drift penalty function, to obtain device quantity information; and determining the target edge device from multiple edge devices based on the device quantity information.

[0009] In one embodiment, determining a target edge device from multiple edge devices based on device quantity information includes: determining the number of edge devices that meet preset quality requirements among the multiple edge devices as the target edge device based on the quality information sent by each edge device.

[0010] In one embodiment, the method further includes: obtaining the current global model parameters of the global model; sending the current global model parameters to each edge device, wherein the current global model parameters are used by each edge device to train its own deployed local model based on the current global model parameters to obtain the gradient information of the local model.

[0011] Secondly, this application also provides a model training method applied to edge devices in a federated learning system. The federated learning system includes multiple edge devices and an edge server with communication connections established with each edge device. The method includes: sending quality information to the edge server, the quality information being used to characterize the contribution of the gradient information of the local model deployed in the edge device to the training of the global model deployed in the edge server; if an instruction is received from the edge server, sending the gradient information of the local model deployed in the edge device to the edge server, the gradient information being used by the edge server to train the global model deployed in the edge server based on the gradient information, the instruction being determined by the edge server from the multiple edge devices based on the quality information sent by each edge device, and then sent to the target edge device.

[0012] In one embodiment, the gradient information of the local model deployed in the edge device is sent to the edge server for training of the global model deployed in the edge server, including: determining whether the edge device received an instruction sent by the edge server in the previous round; and based on the determination result, obtaining the gradient information of the local model deployed in the edge device and sending the gradient information to the edge server.

[0013] In one embodiment, based on the determination result, the gradient information of the local model deployed in the edge device is obtained, including: if it is determined that the edge device received an instruction sent by the edge server in the previous round, the gradient of the local model deployed in the edge device calculated in the current round is used as the gradient information.

[0014] In one embodiment, based on the determination result, the gradient information of the local model deployed in the edge device is obtained, including: if it is determined that the edge device did not receive the instruction sent by the edge server in the previous round, the gradient of the local model deployed in the edge device calculated in this round and the sum of the unsent cumulative gradients are used as the gradient information.

[0015] In one embodiment, the method further includes: receiving the current global model parameters of the global model deployed in the edge server; and training the local model deployed in the edge device in this round based on the current global model parameters to obtain the gradient information of the local model.

[0016] Thirdly, this application also provides a model training device for use on an edge server in a federated learning system. The federated learning system includes multiple edge devices and an edge server that has established communication connections with each edge device. The device includes:

[0017] The receiving module is used to receive quality information sent by each edge device during the training of the global model deployed on the edge server. The quality information is used to characterize the contribution of the gradient information of the local model deployed on the edge device to the training of the global model.

[0018] The determination module is used to determine the target edge device from multiple edge devices based on the quality information sent by each edge device, and instruct the target edge device to upload the gradient information of the local model deployed on the target edge device;

[0019] The training module is used to train the global model based on the gradient information uploaded by the target edge device.

[0020] Fourthly, this application also provides a model training device for use on edge devices in a federated learning system. The federated learning system includes multiple edge devices and an edge server with communication connections established with each edge device. The device includes:

[0021] The first sending module is used to send quality information to the edge server. The quality information is used to characterize the contribution of the gradient information of the local model deployed in the edge device to the training of the global model deployed in the edge server.

[0022] The second sending module is used to send the gradient information of the local model deployed in the edge device to the edge server for training of the global model deployed in the edge server if it receives an instruction from the edge server. The instruction is determined by the edge server based on the quality information sent by each edge device.

[0023] Fifthly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the model training method described in either the first or second aspect above.

[0024] Sixthly, this application also provides a computer-readable storage medium. This computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the model training method described in either the first or second aspect above.

[0025] In a seventh aspect, this application also provides a computer program product. This computer program product includes a computer program that, when executed by a processor, implements the model training method described in either the first or second aspect above.

[0026] The aforementioned model training method, apparatus, device, medium, and program products are applied to a federated learning system. This federated learning system includes an edge server and multiple edge devices communicating with the edge server. During the training of the global model deployed on the edge server, the edge server first receives quality information from each edge device, representing the contribution of the gradient information of the local models deployed on the edge devices to the global model training. Then, based on the quality information sent by each edge device, a target edge device is determined from the multiple edge devices, and the target edge device is instructed to upload the gradient information of its local model. Finally, the global model is trained based on the gradient information uploaded by the target edge device. In this way, during the training of the global model on the edge server, an appropriate number and quality of edge devices are selected based on the quality information sent by the edge devices, and the global model is trained based on the gradient information of the local models uploaded by the selected target edge devices. Since it is not necessary to upload the gradient information of the local models of all edge devices to participate in the global model training process, the efficiency and accuracy of the global model training are improved, resulting in higher performance. Attached Figure Description

[0027] Figure 1 This is a diagram illustrating the application environment of a model training method in one embodiment;

[0028] Figure 2 This is a flowchart illustrating a model training method in one embodiment;

[0029] Figure 3 This is a flowchart illustrating the model training method in another embodiment;

[0030] Figure 4 This is a flowchart illustrating the model training method in another embodiment;

[0031] Figure 5 This is a flowchart illustrating the model training method in another embodiment;

[0032] Figure 6 This is a flowchart illustrating the model training method in another embodiment;

[0033] Figure 7 This is a flowchart illustrating the model training method in another embodiment;

[0034] Figure 8 This is a flowchart illustrating the model training method in another embodiment;

[0035] Figure 9 This is a schematic diagram of a model training method in another embodiment;

[0036] Figure 10 This is a structural block diagram of the model training device in another embodiment;

[0037] Figure 11 This is a structural block diagram of the model training device in another embodiment;

[0038] Figure 12 This is an internal structural diagram of a computer device in one embodiment;

[0039] Figure 13 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0040] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0041] The model training method provided in this application embodiment can be applied to, for example... Figure 1The federated learning system shown includes an edge server 101 and multiple edge devices 102, with communication connections established between the edge server 101 and the edge devices 102. The edge server 101 can be implemented using a standalone server or a server cluster consisting of multiple servers. The edge devices 102 can be, but are not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc.

[0042] A global model is deployed on edge server 101, and a local model and local dataset are deployed on edge device 102.

[0043] In one embodiment, such as Figure 2 As shown, a model training method is provided, which can be applied to... Figure 1 Taking the edge server in the example, the following steps are included:

[0044] Step 201: During the training of the global model deployed on the edge server, the edge server receives quality information sent by each edge device.

[0045] Quality information is used to characterize the contribution of the gradient information of the local model deployed in the edge device to the training of the global model. Federated learning is a distributed machine learning technique that trains a global model based on virtual fused data by distributing model training among multiple data sources with local data, without exchanging local individual or sample data, but only by exchanging model parameters or their gradients. In other words, the global model training in the edge server requires the gradient information of the local models in the edge devices. To reduce communication latency and resource overhead, only an appropriate number of edge devices are selected to participate in aggregation and global model updates in each training round. Since different edge devices contribute differently to improving the accuracy and convergence of the global model in the edge server, the edge server needs to receive quality information sent by the edge devices as a selection criterion.

[0046] Step 202: The edge server determines the target edge device from multiple edge devices based on the quality information sent by each edge device, and instructs the target edge device to upload the gradient information of the local model deployed on the target edge device.

[0047] The target edge device is a selected edge device from multiple edge devices that meets the quality requirements and is used to participate in aggregation and global model updates. There can be multiple target edge devices. After the target edge device is determined, the edge server instructs the target edge device to upload the gradient information of the local model on the target edge device for the training of the global model.

[0048] Step 203: The edge server trains the global model based on the gradient information uploaded by the target edge device.

[0049] Optionally, the federated learning system of this application consists of an edge server and It consists of a distributed single-antenna edge device. Each edge device Data sets collected or generated locally are Define one global model update as one communication round. For index, where The total number of communication rounds for training the global model. Indicates the first The set of edge devices selected by the wheel, the number of which is ,in, Indicates edge device In the A binary variable indicating whether a wheel is selected. =1 indicates that it has been selected. =0 indicates that it was not selected.

[0050] The gradient information uploaded by edge devices is aggregated through an uplink based on over-the-air computation. Over-the-air computation is performed during transmission. In each training round, the target edge device transmits its local model gradient information in parallel through a shared public radio resource block, resulting in the aggregated signal shown below:

[0051] (1)

[0052] in, For edge devices In the The gradient information sent by the round, , This indicates that preprocessing and normalization operations are performed to ensure... It has zero mean and zero variance ; For edge devices In the Gradient information of the local model during training rounds. For the first Wheel edge device Quasi-static channel gain between the edge server and the edge server Represents the set of complex numbers. With a mean of 0 and a variance of Additive white Gaussian noise.

[0053] The edge server receives the aggregated signal Post-processing and denormalization are performed, followed by a global model update. This completes one training round. The above steps are repeated until the global model converges or the preset number of training rounds is reached. The edge server updates the global model according to the following formula:

[0054] (2)

[0055] in, For the first The current global model parameters at the start of each training round; It is the learning rate of the federated learning system; This indicates the post-processing and denormalization operations performed on the edge server; This represents the power spread factor, also known as the noise reduction factor, which determines the signal-to-noise ratio (SNR) at the server receiver. .

[0056] The aforementioned model training method is applied to a federated learning system, which includes an edge server and multiple edge devices connected to it. During the training of the global model deployed on the edge server, the system first receives quality information from each edge device, representing the contribution of the gradient information of the local models deployed on those edge devices to the global model training. Then, based on the quality information from each edge device, a target edge device is selected from the multiple edge devices, and this target edge device is instructed to upload the gradient information of its local model. Finally, the global model is trained based on the gradient information uploaded by the target edge device. In this way, during the training of the global model on the edge server, an appropriate number and quality of edge devices are selected based on the quality information sent by the edge devices, and the global model is trained based on the gradient information of the local models uploaded by the selected target edge devices. Since it is not necessary to upload the gradient information of the local models of all edge devices to participate in the global model training process, the efficiency and accuracy of the global model training are improved, resulting in higher performance.

[0057] like Figure 3 As shown, the steps for determining the target edge device from multiple edge devices based on the convergence speed of federated learning and the quality information sent by each edge device include:

[0058] Step 301: The edge server obtains the drift penalty term function.

[0059] The drift penalty function is constructed based on the convergence speed of federated learning and the quality information sent by each edge device.

[0060] Step 302: The edge server obtains the constraints.

[0061] The constraints are constructed based on the transmitted energy information of each edge device. For example, [the constraints are...]. Edge devices in round training The average transmission energy constraint is .

[0062] Step 303: Based on the constraints, the edge server solves the drift penalty term function to obtain the device quantity information with the goal of minimizing the drift penalty term function value.

[0063] The specific calculation process described above is shown below. Considering that different edge devices collect datasets independently, this application assumes that when hour, Therefore, measuring the overall dataset The global loss function is:

[0064] (3)

[0065] in, The global loss function obtained by formula (3) is used to measure the average fit of the global model to the entire dataset, while the goal of federated learning is to find the optimal model parameters. To minimize the global loss function or its expected value, i.e.:

[0066] (4)

[0067] Applying the scaling and sum rules, the optimization problem for edge device selection can be formulated as follows:

[0068]

[0069] (5)

[0070]

[0071] Among them, expectations This is addressed for channel noise and the randomness of data sampling based on local stochastic gradient descent; the first constraint indicates... Edge devices in round training The average transmission energy constraint is Observe the problem As can be seen from the form, due to the unpredictability of model parameters in neural network architecture, The closed-form expression is difficult to represent. To address this problem, this application utilizes convergence analysis to obtain... The closed upper bound is approximated, and the analysis comprehensively considers transmit power, channel noise, average cumulative residual upper bound, and stochastic gradient. Given the first... Wheel scheduling equipment set and small batch size The convergence rate of a single round of federated learning is given by the following formula:

[0072]

[0073] (6)

[0074] in, It is a smoothing constant. It is the learning rate. It is the estimated average of the global gradient. It is the global model gradient. Indicates the first The average probability that a device in the wheel is not selected. It is the upper bound of the variance of the local stochastic gradient. It is the estimated variance of the global gradient.

[0075] As can be seen from formula (6), the number of edge devices selected in each round is... It plays a crucial role in resisting the effects of channel noise. Therefore, an efficient edge device scheduling mechanism needs to optimize the edge device selection strategy based on the channel noise level in each round. Upon further observation of formula (6), the first three terms are all unrelated to the scheduling strategy and can be treated as constants. Therefore, the constant term is ignored. ,make:

[0076] (7)

[0077] Furthermore, optimize the problem. It can be converted into Solve

[0078] (8)

[0079] As mentioned above, the number and quality of selected edge devices are two key elements in the scheduling mechanism. Therefore, the edge device scheduling mechanism of this application can determine the number of selected edge devices, thereby effectively reducing channel noise interference during communication, and ensuring that, under limited resource conditions, the quality of all selected edge devices is as high as possible to fully utilize their training performance. Inspired by the drift-penalty algorithm in Lyapunov optimization theory, the optimization problem of the edge device scheduling mechanism can be derived from... Given:

[0080] (9)

[0081] in It is an adjustable term for the upper bound of equilibrium convergence. and equipment quality The sum of Lyapunov factors.

[0082] Edge servers solve problems Obtain edge device scheduling decisions Edge servers from =1 to =N Iterate through the possible number of selected edge devices and calculate the corresponding drift penalty term. , making The smallest corresponding The value represents the optimal number of selected edge devices.

[0083] Step 304: The edge server determines the target edge device from multiple edge devices based on the device quantity information.

[0084] Optionally, based on the quality information sent by each edge device, the target edge devices are selected from a number of edge devices that meet the preset quality requirements. After determining the number of selected edge devices, the edge server sorts the quality information of all edge devices from highest to lowest and selects the devices with the highest quality information. The corresponding edge device is the target edge device.

[0085] In one embodiment, when training the local model on the edge device to obtain the gradient of the local model, the global model parameters of the global model on the edge server are required, such as... Figure 4 As shown, the method also includes:

[0086] Step 401: The edge server obtains the current global model parameters of the global model.

[0087] The current global model parameters are the model parameters of the global model in the current training round. At the beginning of each training round, the edge server obtains the current global model parameters of the global model.

[0088] Step 402: The edge server sends the current global model parameters to each edge device.

[0089] Optionally, the edge server broadcasts the current global model parameters to all edge devices. These parameters are used by each edge device to train its local model and obtain gradient information.

[0090] In one embodiment, such as Figure 5As shown, a model training method is provided. Taking the application of this method to edge device 102 in the figure as an example, the method includes the following steps:

[0091] Step 501: The edge device sends quality information to the edge server.

[0092] Quality information is used to characterize the contribution of the gradient information of the local model deployed in the edge device to the training of the global model deployed in the edge server. Each edge device sends its quality information to the edge server via a control channel, and the edge server selects the edge devices to participate in the global model training based on the quality information of each edge device. Optionally, the quality information of each edge device can be calculated by the edge device according to an algorithm, for example, it can be determined based on a neural network model.

[0093] Step 502: If the edge device receives an instruction from the edge server, it sends the gradient information of the local model deployed in the edge device to the edge server.

[0094] Gradient information is used by the edge server to train the global model deployed on the edge server. The indication is sent by the edge server to the target edge device, which is determined from multiple edge devices based on the quality information sent by each edge device. Upon receiving the indication from the edge server—that is, the target edge device is selected to participate in the global model update—the target edge device sends its local model's gradient information to the edge server to participate in the global model training process.

[0095] In one embodiment, after the edge server broadcasts the current global model parameters to all edge devices, such as Figure 6 The method further includes:

[0096] Step 601: The edge device receives the current global model parameters of the global model deployed in the edge server.

[0097] At the start of each training round, the edge server broadcasts the current global model parameters to all edge devices, as described in the above embodiments. This allows edge devices to train local models.

[0098] Step 602: The edge device trains the local model deployed on the edge device in this round based on the current global model parameters to obtain the gradient information of the local model.

[0099] Among them, the definition For data samples The loss function of the edge device In local dataset The local loss function on is:

[0100] (10)

[0101] in, Represents the dataset Size.

[0102] Upon receiving global model parameters Then, each edge device performs small-batch local processing. Then, run the mini-batch stochastic gradient descent algorithm to compute the gradient of the local model, i.e.:

[0103] (11)

[0104] In one embodiment of this application, to more comprehensively utilize the dataset to improve the stability and accuracy of model training, a dynamic cumulative residual feedback mechanism is proposed. This mechanism allows edge devices to transmit accumulated local gradients that were not previously sent, while unselected edge devices locally store the gradient information of their local model during the current training round and wait to be selected again for transmission. Figure 7 As shown, the steps for sending the gradient information of the local model deployed on the edge device to the edge server for training of the global model deployed on the edge server include:

[0105] Step 701: The edge device determines whether it received an instruction from the edge server in the previous round.

[0106] When an edge device determines the gradient information of the local model in the current round, it needs to first determine whether the edge device received an instruction from the edge server in the previous round, that is, whether the edge device was selected to send the gradient information of the local model in the previous round.

[0107] Step 702: Based on the determined result, the edge device obtains the gradient information of the local model deployed in the edge device and sends the gradient information to the edge server.

[0108] The determined result includes the following two cases:

[0109] In the first case, if it is determined that the edge device received the instruction sent by the edge server in the previous round, then the gradient of the local model deployed in the edge device calculated in this round is used as the gradient information.

[0110] In the second scenario, if it is determined that the edge device did not receive the instruction sent by the edge server in the previous round, then the gradient of the local model deployed in the edge device calculated in this round and the sum of the unsent cumulative gradients are used as the gradient information.

[0111] For example, defining the selected edge device In the Gradient information of the local model of the wheel Gradient of the current communication round With cumulative residuals The combination. Specifically, , They are given by the following formulas respectively:

[0112]

[0113] (12)

[0114] in This reflects the importance of the cumulative residual for the current training. Indicates the first The set of edge devices selected by the wheel, that is, if Wheel edge device If selected, the cumulative residual is 0. The gradient of the local model deployed in the edge device calculated in this round is used as the gradient information. If the edge device in the previous round... If not selected, the cumulative residual is: The gradient of the local model calculated in this round and the sum of the cumulative residuals are used as gradient information.

[0115] In the above embodiments, the dynamic cumulative residual feedback mechanism allows edge devices to transmit accumulated local gradients that were not previously sent, while unselected devices save the current model gradient locally and wait for the next transmission. This enables more comprehensive utilization of the dataset to improve the stability and accuracy of model training.

[0116] In the above embodiments, due to the diversity of different edge devices in terms of local datasets, channel conditions, and energy status, the contributions of different edge devices to the global model are different. Therefore, the quality information of the edge devices is determined by comprehensively considering the importance of update information, channel conditions, and energy consumption levels. The selection of edge devices is determined by the quality information, thereby achieving high communication efficiency, high accuracy, and high energy efficiency.

[0117] In the embodiments of this application, please refer to Figure 8 The diagram illustrates a flowchart of a model training method provided in an embodiment of this application, which includes the following steps:

[0118] Step 801: The edge server obtains the current global model parameters of the global model.

[0119] Step 802: The edge server sends the current global model parameters to each edge device.

[0120] Step 803: The edge device receives the current global model parameters of the global model deployed in the edge server.

[0121] Step 804: The edge device trains the local model deployed on the edge device in this round based on the current global model parameters to obtain the gradient information of the local model.

[0122] Step 805: The edge device sends quality information to the edge server.

[0123] Step 806: The edge server determines the target edge device from multiple edge devices based on the quality information sent by each edge device, and instructs the target edge device to upload the gradient information of the local model deployed on the target edge device.

[0124] Step 807: The edge server trains the global model based on the gradient information uploaded by the target edge device.

[0125] To facilitate readers' understanding of the technical solutions provided in the embodiments of this application, the application of the model training method of this application is described below. Please refer to... Figure 9 The system comprises an edge server and N edge devices. The edge server deploys the global model, while the edge devices deploy local models and local datasets. At the start of training, the edge server broadcasts the global model parameters to the N edge devices via a broadcast channel. The N edge devices transmit their device quality data to the edge server via a control channel. The edge server calculates and selects an appropriate number of edge devices with high device quality to participate in aggregation and global model updates based on the convergence speed of federated learning and the device quality uploaded by the N edge devices. For example, ... Figure 9 As shown, edge device 1 is not selected, while edge device 2 and edge device n are selected. Edge device 2 and edge device n transmit the gradient information of the local model to the edge server through a noisy channel based on over-the-air computation to update the global model.

[0126] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0127] Based on the same inventive concept, this application also provides a model training apparatus for implementing the model training method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more model training apparatus embodiments provided below can be found in the limitations of the model training method described above, and will not be repeated here.

[0128] In one embodiment, such as Figure 10 As shown, a model training device 1000 is provided, applied to an edge server in a federated learning system. The federated learning system includes an edge server and multiple edge devices that have established communication connections with the edge server, including: a receiving module 1001, a determining module 1002, and a training module 1003, wherein:

[0129] The receiving module 1001 is used to receive quality information sent by each edge device during the training of the global model deployed on the edge server. The quality information is used to characterize the contribution of the gradient information of the local model deployed on the edge device to the training of the global model.

[0130] The determining module 1002 is used to determine the target edge device from multiple edge devices based on the quality information sent by each edge device, and instruct the target edge device to upload the gradient information of the local model deployed on the target edge device;

[0131] The training module 1003 is used to train the global model based on the gradient information uploaded by the target edge device.

[0132] In an optional embodiment of this application, the determining module 1002 is specifically used to determine the target edge device from multiple edge devices based on the convergence speed of federated learning and the quality information sent by each edge device.

[0133] In an optional embodiment of this application, the determining module is specifically used to obtain the drift penalty term function, which is constructed based on the convergence speed of federated learning and the quality information sent by each edge device; obtain the constraint conditions, which are constructed based on the transmission energy information of each edge device; based on the constraint conditions, with the goal of minimizing the value of the drift penalty term function, solve the drift penalty term function to obtain the device quantity information; and determine the target edge device from multiple edge devices based on the device quantity information.

[0134] In an optional embodiment of this application, the determining module 1002 is specifically used to determine, based on the quality information sent by each edge device, the number of edge devices that meet the preset quality requirements among multiple edge devices as target edge devices.

[0135] In an optional embodiment of this application, a parameter sending module is further included, which is used to obtain the current global model parameters of the global model; send the current global model parameters to each edge device, and the current global model parameters are used by each edge device to train its own deployed local model based on the current global model parameters in order to obtain the gradient information of the local model.

[0136] In one embodiment, such as Figure 11 As shown, a model training device 1100 is provided, applied to edge devices in a federated learning system. The federated learning system includes multiple edge devices and an edge server with communication connections established with each edge device. The device includes: a first sending module 1101 and a second sending module 1102, wherein:

[0137] The first sending module 1101 is used to send quality information to the edge server. The quality information is used to characterize the contribution of the gradient information of the local model deployed in the edge device to the training of the global model deployed in the edge server.

[0138] The second sending module 1102 is used to send the gradient information of the local model deployed in the edge device to the edge server for training of the global model deployed in the edge server if it receives an instruction from the edge server. The instruction is determined by the edge server based on the quality information sent by each edge device.

[0139] In an optional embodiment of this application, the second sending module 1102 is specifically used to determine whether the edge device received an instruction sent by the edge server in the previous round; based on the determination result, to obtain the gradient information of the local model deployed in the edge device, and to send the gradient information to the edge server.

[0140] In an optional embodiment of this application, the second sending module 1102 is specifically used to take the gradient of the local model deployed in the edge device in the current round as gradient information if it is determined that the edge device received the instruction sent by the edge server in the previous round.

[0141] In an optional embodiment of this application, the second sending module 1102 is specifically used to, if it is determined that the edge device did not receive an instruction sent by the edge server in the previous round, use the gradient of the local model deployed in the edge device calculated in the current round and the sum of the unsent cumulative gradients as gradient information.

[0142] In an optional embodiment of this application, a parameter receiving module is further included. This parameter receiving module is used to receive the current global model parameters of the global model deployed in the edge server; and to perform the current round of training on the local model deployed in the edge device based on the current global model parameters to obtain the gradient information of the local model.

[0143] Each module in the aforementioned model training device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0144] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 12 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores data from edge devices. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a model training method.

[0145] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 13 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a model training method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0146] Those skilled in the art will understand that Figure 12 and Figure 13 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0147] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the model training methods provided in the above-described method embodiments.

[0148] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the model training methods provided in the above-described method embodiments.

[0149] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the model training methods provided in the above-described method embodiments.

[0150] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0151] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0152] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0153] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A model training method, characterized in that, An edge server applied in a federated learning system, the federated learning system including the edge server and multiple edge devices having established communication connections with the edge server, the method comprising: During the training of the global model deployed on the edge server, quality information sent by each edge device is received. The quality information is used to characterize the contribution of the gradient information of the local model deployed on the edge device to the training of the global model. Based on the convergence speed of federated learning and the quality information sent by each edge device, a target edge device is determined from the plurality of edge devices, and the target edge device is instructed to upload the gradient information of the local model deployed on the target edge device. The global model is trained based on the gradient information uploaded by the target edge device; The step of determining the target edge device from the plurality of edge devices based on the convergence speed of federated learning and the quality information sent by each edge device includes: Obtain a drift penalty function, which is constructed based on the convergence speed of federated learning and the quality information sent by each edge device; Obtain constraints, which are constructed based on the transmission energy information of each of the edge devices; Based on the aforementioned constraints, and with the objective of minimizing the drift penalty term function, the drift penalty term function is solved to obtain the equipment quantity information; Based on the quality information sent by each edge device, the number of edge devices that meet the preset quality requirements among the plurality of edge devices is determined as the target edge device.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the current global model parameters of the global model; The current global model parameters are sent to each of the edge devices. The current global model parameters are used by each edge device to train its local model based on the current global model parameters in order to obtain the gradient information of the local model.

3. A model training method, characterized in that, An edge device applied in a federated learning system, the federated learning system including multiple edge devices and an edge server with communication connections established with each of the edge devices, the method comprising: Quality information is sent to the edge server, the quality information being used to characterize the contribution of the gradient information of the local model deployed in the edge device to the training of the global model deployed in the edge server; If an instruction is received from the edge server, the gradient information of the local model deployed in the edge device is sent to the edge server. This gradient information is used by the edge server to train the global model deployed in the edge server. The instruction is given by the edge server based on the convergence speed of federated learning and the quality information sent by each edge device, determining the target edge device from among the multiple edge devices, and sending it to the target edge device. The determination of the target edge device includes: obtaining a drift penalty function, which is constructed based on the convergence speed of federated learning and the quality information sent by each edge device; obtaining constraints, which are constructed based on the transmission energy information of each edge device; solving the drift penalty function based on the constraints, with the goal of minimizing the drift penalty function value, to obtain the number of devices; and determining the number of edge devices among the multiple edge devices that meet the preset quality requirements as the target edge device, based on the quality information sent by each edge device.

4. The method according to claim 3, characterized in that, The step of sending the gradient information of the local model deployed in the edge device to the edge server for training of the global model deployed in the edge server includes: Determine whether the edge device received an instruction sent by the edge server in the previous round; Based on the determined results, the gradient information of the local model deployed in the edge device is obtained, and the gradient information is sent to the edge server; The step of obtaining gradient information of the local model deployed in the edge device based on the determination result includes: If it is determined that the edge device received the instruction sent by the edge server in the previous round, then the gradient of the local model deployed in the edge device calculated in this round is used as the gradient information. The step of obtaining gradient information of the local model deployed in the edge device based on the determination result further includes: If it is determined that the edge device did not receive the instruction sent by the edge server in the previous round, then the gradient of the local model deployed in the edge device calculated in this round and the sum of the unsent cumulative gradients are used as the gradient information.

5. The method according to claim 4, characterized in that, The method further includes: Receive the current global model parameters of the global model deployed in the edge server; The local model deployed in the edge device is trained in this round based on the current global model parameters to obtain the gradient information of the local model.

6. A model training device, characterized in that, An edge server used in a federated learning system, the federated learning system including the edge server and multiple edge devices communicating with the edge server, the device comprising: The receiving module is used to receive quality information sent by each of the edge devices during the training of the global model deployed in the edge server. The quality information is used to characterize the contribution of the gradient information of the local model deployed in the edge device to the training of the global model. The determination module is used to determine a target edge device from the plurality of edge devices based on the convergence speed of federated learning and the quality information sent by each edge device, and to instruct the target edge device to upload the gradient information of the local model deployed on the target edge device; The training module is used to train the global model based on the gradient information uploaded by the target edge device; The determining module is specifically used to obtain a drift penalty function, which is constructed based on the convergence speed of federated learning and the quality information sent by each edge device; obtain constraints, which are constructed based on the transmission energy information of each edge device; based on the constraints, with the goal of minimizing the drift penalty function, solve the drift penalty function to obtain the number of devices; and determine the edge devices that meet the preset quality requirements among the multiple edge devices as the target edge devices based on the quality information sent by each edge device.

7. A model training device, characterized in that, An edge device applied in a federated learning system, the federated learning system including multiple edge devices and an edge server with communication connections established with each of the edge devices, the device comprising: The first sending module is used to send quality information to the edge server, wherein the quality information is used to characterize the contribution of the gradient information of the local model deployed in the edge device to the training of the global model deployed in the edge server; The second sending module is configured to, upon receiving an instruction from the edge server, send the gradient information of the local model deployed in the edge device to the edge server for training of the global model deployed in the edge server. The instruction is sent by the edge server to the target edge device after determining the target edge device from among the multiple edge devices based on the convergence speed of federated learning and the quality information sent by each edge device. The determination step of the target edge device includes: obtaining a drift penalty function, which is constructed based on the convergence speed of federated learning and the quality information sent by each edge device; obtaining constraints, which are constructed based on the transmission energy information of each edge device; solving the drift penalty function based on the constraints, with the goal of minimizing the value of the drift penalty function, to obtain the number of devices; and determining the edge devices among the multiple edge devices that meet the preset quality requirements as the target edge devices based on the quality information sent by each edge device.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 2 or 3 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 2 or 3 to 5.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 2 or 3 to 5.