General calculation collaborative mixed multi-learning mode selection method
By selecting the optimal segmentation layer and learning mode in hybrid segmentation and federated learning, and optimizing the terminal learning mode, the problem of insufficient learning performance is solved, and faster and more efficient model training is achieved, which is suitable for privacy protection scenarios.
Patent Information
- Application Number
- CN202411135502.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-08-19
AI Technical Summary
The learning performance of hybrid segmentation and federated learning is insufficient, resulting in increased training time and imbalanced computing resources.
By selecting the optimal segmentation layer and learning mode in the terminal learning mode, combining the Gibbs sampling algorithm to optimize the terminal learning mode, and dynamically adjusting the terminals participating in federated learning and segmentation learning to minimize the global loss function and training delay.
It significantly improves the training effect and efficiency, reduces the computing load and communication load, and achieves faster model training, which is suitable for privacy protection scenarios such as hospital medical record diagnosis.
Smart Images

Figure CN118863016A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine learning, and in particular to a hybrid multi-learning mode selection method with general computing collaboration. Background Art
[0002] The popularity of mobile terminals has led to an unprecedented surge in data generation, which has promoted the development of wireless distributed intelligence. Federated learning (FL) is a well-known distributed learning model that has received increasing attention in wireless networks. In the federated learning model, mobile terminals simultaneously download the global deep neural network (DNN) model from the central server, train the local model with their own data, and upload the model updates back to the server. The server summarizes these updates and creates a new global model. This process is repeated for multiple rounds until convergence. Federated learning can achieve parallel and efficient DNN model training on many mobile terminals. However, a major limitation of federated learning is that it requires the terminal to have sufficient computing resources to train the entire model locally, which may be a limitation for terminals with limited processing power.
[0003] To alleviate these problems, split learning (SL Split Learning) was introduced and studied in wireless networks. Split learning innovatively splits the complete DNN model into two independent parts: the edge model and the local model, which are trained on the server and the terminal respectively. The terminals in split learning train the models sequentially. Specifically, the first terminal downloads the local model from the server, performs forward propagation and backward propagation with the server to complete the entire model training, and uploads the updated local model to the server. This process is performed sequentially by subsequent terminals. Although split learning effectively reduces the computational load of the terminal by offloading part of the model training and improves the learning performance by overcoming the negative impact of non-IID data sets between terminals, it does significantly increase the training time due to its sequential nature.
[0004] In order to fully utilize the advantages of these two learning modes, a large number of researchers are committed to integrating federated learning and split learning. Hybrid Split and Federated Learning (HSFL) means that some terminals participate in federated learning training, while other terminals participate in split learning training.
[0005] Therefore, technicians in this field are committed to developing a hybrid multi-learning mode selection method with comprehensive and collaborative computing, which provides more flexible learning mode selection and further improves learning performance. Summary of the invention
[0006] In view of the above-mentioned defects in the prior art, the technical problem to be solved by the present invention is to improve the learning performance of hybrid segmentation and federated learning.
[0007] To achieve the above object, the present invention provides a hybrid multi-learning mode selection method with general computing collaboration, comprising the following steps:
[0008] Step 1: The learning mode of the terminal is divided into federated learning and segmented learning;
[0009] Step 2: Select the optimal segmentation layer;
[0010] Step 3: Change the terminal learning mode, continue with step 2, and select the optimal terminal learning mode.
[0011] Furthermore, each round of training makes a decision on the terminal learning mode.
[0012] Furthermore, a learning mode of the terminal is selected according to the training effect and the training delay.
[0013] Furthermore, the objective function of the terminal learning mode selection is:
[0014]
[0015] Among them, ρ is a hyperparameter, is the training delay, is the number of split learning terminals in the tth communication round.
[0016] Further, ρ=0.002.
[0017] Further, the objective function is minimized.
[0018] Furthermore, in step 1, the learning mode of the terminal is randomly initialized to be divided into a user cluster participating in federated learning and a user cluster participating in segmented learning.
[0019] Furthermore, in step 2, the delay of the terminal selecting different partitioning layers is calculated, and the optimal partitioning layer is selected therefrom.
[0020] Furthermore, in step 3, the terminal learning mode is changed by using a Gibbs sampling algorithm.
[0021] Furthermore, the goal of the terminal learning is to minimize the global loss function.
[0022] Some existing studies have only changed the architecture, but have not considered the internal connection of the new architecture after the change of the architecture. For example, compared with split learning, split learning has a higher communication load, so the terminal may need more communication capabilities, while the local training load of federated learning is too high, so the terminal may need higher computing power. At the same time, the selection of the split layer for split learning will affect the delay, so how to choose the split layer will be a problem. On the basis of the hybrid split and federated learning architecture, the present invention considers the selection of the split layer in split learning, because the split layer will cause the amount of data of the transmitted activation value and gradient to change, thereby bringing about the difference in delay, so a good split layer selection can make the training faster. On the basis of the above split layer optimization, since different terminals in hybrid split and federated learning participate in different learning modes, which will have different effects on the delay and convergence effect, the optimization of terminal learning mode selection is introduced. In the proposed architecture, terminals with weak computing power can choose to participate in split learning to reduce local computing load, and terminals with strong computing power can participate in federated learning to reduce communication load. For the selection of the split layer of split learning, since the number of model layers is relatively limited, an exhaustive search method is selected to find an optimal split layer. Then switch to different terminal selection combinations and continue the above optimization process until the delay change is determined to be the optimal solution within a very small range.
[0023] Compared with the prior art, the present invention has the following obvious substantial features and significant advantages:
[0024] 1. The training effect of the present invention is the best, and its advantage is very significant under the gain of the optimization algorithm.
[0025] 2. This invention can accelerate training and help machine learning models be implemented more quickly.
[0026] 3. The present invention is applied to the medical record diagnosis model of the hospital, which can make a quick pre-diagnosis of the patient's disease and improve the efficiency of medical treatment.
[0027] The concept, specific structure and technical effects of the present invention will be further described below in conjunction with the accompanying drawings to fully understand the purpose, characteristics and effects of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 is the test accuracy of different training architectures for the CIFAR-10 dataset;
[0029] Figure 2 is the loss function value of different training architectures of the CIFAR-10 dataset;
[0030] Figure 3 It is a hybrid segmentation and federated learning training flow chart;
[0031] Figure 4 This is a comparison chart of the training effects of different ρ values. DETAILED DESCRIPTION
[0032] The following describes several preferred embodiments of the present invention with reference to the drawings in the specification, so that the technical content is clearer and easier to understand. The present invention can be embodied in many different forms of embodiments, and the protection scope of the present invention is not limited to the embodiments mentioned in the text.
[0033] In the drawings, components with the same structure are indicated by the same numerical reference numerals, and components with similar structures or functions are indicated by similar numerical reference numerals. The size and thickness of each component shown in the drawings are arbitrarily shown, and the present invention does not limit the size and thickness of each component. In order to make the illustration clearer, the thickness of the components is appropriately exaggerated in some places in the drawings.
[0034] Machine learning: The goal is to allow computers to automatically learn patterns and rules so that they can make predictions or decisions about unknown data. For example, a learning task for house price prediction can be solved by constructing a polynomial (i.e., a mathematical term similar to Ax n +Bx n -1…+Cx+D) (this is the machine learning model, but different task models have different settings, and the complexity will also increase, but overall it can be regarded as a polynomial form), but because it is difficult to directly conceive of the coefficients, a computer is used to predict the current house price by giving feature values such as room area, room location, and room floor (forward propagation: a forward calculation process), and the difference is calculated by comparing it with the actual data of the house price, using E=(yt) 2 The loss function calculation formula is used to get the loss function value. Then, the inverse of the loss function with respect to y is 2(yt), so the gradient value is calculated by the predicted value and the actual value, which is used to update the coefficients and other parameters of the model (backward propagation: the predicted value obtained by forward calculation is compared with the actual value, and then the model is updated in the reverse direction through derivation). One forward propagation and one backward propagation can be regarded as one round.
[0035] Deep learning: Machine learning assumes that there is only one polynomial, but there can be many polynomials. Each polynomial calculates multiple results in parallel by setting different parameters, and then gives these multiple results to the next separate polynomial. This will form a two-layer model for machine learning. Of course, through this type of reuse, a multi-layer model can be constructed. The meaning of deep learning is to build more layers based on machine learning, which can be used to solve more complex problems. It is a subset of machine learning.
[0036] Loss function: A formula used to measure the difference between a machine learning model's predictions and actual values.
[0037] Federated Learning: FL (Federated Learning). Ordinary machine learning requires that the current training server can obtain all training data on the local machine. Because some data may involve privacy, or the data on some terminals is updated and iterated quickly, if all data is transmitted to the server, the communication load will be relatively large. Therefore, distributed machine learning is proposed, that is, the model is sent to the terminal for training. After the terminal is trained, the model will be uploaded to the server. The server only needs to aggregate the model (parameter averaging and other operations), which retains privacy and can reduce the communication load to a certain extent.
[0038] The learning steps are as follows:
[0039] 1. At the beginning of each global round (one round is when the server aggregates the model once), the terminal downloads the latest machine learning model from the server;
[0040] 2. The terminal uses its own data for training (forward propagation and backward propagation). The terminal may perform forward propagation and backward propagation locally for multiple times, which is called multiple local rounds (one forward propagation and one backward propagation).
[0041] 3. The terminal uploads the model updated in the current global round to the server;
[0042] 4. The server aggregates the model for the next global round of training;
[0043] This process is parallel between terminals, and multiple terminals download models, train models, and upload models at the same time.
[0044] Split learning: SL (Split Learning mode). Since each terminal of federated learning needs to fully train the model once (a complete forward propagation and back propagation), there are certain requirements for the computing power of the terminal (otherwise some terminals will train too slowly, which will slow down the entire training process). Some terminals have a lot of high-quality data. If they are trained by themselves, the process is difficult. Therefore, split learning is proposed, which is to split a complete model into two parts. For example, assuming that the current deep learning model is divided into 4 fully connected layers (that is, a multi-layer polynomial set, each layer has multiple polynomials, and the result of each layer of polynomial calculation is used as the input data of the next layer of polynomials. The first layer uses basic information such as housing prices as input data), that is, the complete model has 4 layers. For the split learning mode, if the third layer is used as the split layer of the current model, then layers 1 to 3 will be trained on the client side (training means forward propagation and back propagation), and the fourth layer will be calculated on the server. In this way, the complete computing load is split into two parts (or even multiple parts), which can reduce the computing time of the terminal and increase the speed (because the computing power of general servers is very strong). However, because each data on the terminal side must transmit a result value calculated by the split layer to the server, the communication load will increase.
[0045] The learning steps are as follows:
[0046] 1. At the beginning of each global round, the terminal downloads the latest terminal-side machine learning model from the server;
[0047] 2. The terminal uses its own data for forward propagation;
[0048] 3. The terminal uploads the calculation results of the segmentation layer (such as the calculation results of the third-layer polynomial above) to the server;
[0049] 4. The server uses the calculated results as the input of the server-side model, forward propagates the results, and calculates the loss function value;
[0050] 5. Then, the server-side model is back-propagated, the server-side model is updated, and the gradient value is obtained (this gradient is all the way to the next layer of the segmentation layer. For example, in the above case, the server only needs to calculate the gradient of the fourth layer, and the rest is calculated by the terminal), and this gradient will be transmitted to the terminal side;
[0051] 6. After the terminal side obtains the gradient, it will continue the back propagation of the terminal side model and update the terminal side model;
[0052] 7. The terminal uploads the updated model to the server;
[0053] 8. The server saves the terminal side model and waits for the next terminal to download it;
[0054] This process is serial between different terminals. After one terminal is trained, the next terminal will continue training.
[0055] HSFL (Hybrid Split and Federated Learning): The terminals participating in the training are divided into two parts, one for federated learning and the other for split learning, so it is a hybrid.
[0056] like Figure 3 As shown, the left side of the flowchart represents the flowchart of terminals participating in federated learning. Each terminal first downloads the global model, and then performs local forward propagation and back propagation to obtain updated data for model training. At the end of a round, the local model is uploaded. This operation is processed in parallel between different terminals participating in federated learning.
[0057] The right side of the flowchart shows the flowchart of terminals participating in segmentation learning. The first terminal first downloads the terminal side model and then performs training. The training process includes: 1. Forward transmission of the terminal side model, 2. Upload activation value, 3. Forward transmission of the server side model, 4. Backward transmission of the server side model, 5. Download gradient value, 6. Backward transmission of the terminal side model; after the training is completed, the terminal side model is uploaded to the server, and the next terminal continues to execute the above steps until all terminals participate in the training in series.
[0058] Split layer: From Figure 3 You can see the dotted line. Figure 3 The complete four-layer model on the right side is split into two parts, the third layer is used as the segmentation layer of the current model, that is, terminals 3 and 4 will train to the third layer locally, and upload the activation value of the third layer to the server as the output. After receiving the activation value, the server uses the activation value as the input of the fourth layer to continue training. Back propagation is a similar operation. The server only performs back propagation on the fourth layer and transmits the gradient value obtained from the back propagation of the fourth layer to terminals 3 and 4. Terminals c and d will use the obtained gradients to continue the calculation of the gradient back propagation of the first three layers. The meaning of segmented learning is to divide the model into multiple parts and train them by different terminals. Note: the forward and backward training of terminals 3 and 4 above are serial, not simultaneous. Only Figure 3 The FL section on the middle left is parallel.
[0059] Wireless distributed learning, which includes K terminals (terminals: such as mobile phones, computers, and various mobile devices can be called terminals) and an edge server (edge server: a high-performance computer). k = 1, ..., K represents the kth terminal. The data set of the kth terminal is composed of D k data samples, where the i-th data sample is represented by (x is the sample feature value, such as the room area, floor, etc. required for house price prediction, and y is the model label, which is the value to be predicted, such as the actual house price of a specific room data). The goal of distributed learning is for the terminal to find the optimal global model ω after multiple rounds of data or model interaction with the server. * , minimize the global loss function L(ω), that is:
[0060]
[0061] In the formula, the global loss function L(ω) can be expressed as a single sample loss function The average form is:
[0062]
[0063] Usually, the optimal global model ω can be obtained by gradient descent * Therefore, in the t+1th communication round, the federated learning terminal is updated as follows:
[0064] ω k,t+1 =ω t -ηg k,t (ω t ) (3)
[0065] Where η represents the learning rate (learning rate: the magnitude of each update of gradient descent), and the segmentation learning terminal is updated as follows:
[0066]
[0067] In the formula, is the number of split learning users in the tth communication round, where is the set of all users, x k,t is the training model for the kth user, x k,t =1 means participating in federated learning, x k,t = 0 means participating in segmentation learning. Because segmentation learning is serialized, the model parameter updates of subsequent users participating in segmentation learning are based on the updates of the previous user.
[0068] For the FL terminal, the delay of a single round (delay: the delay caused by time expenditure, which means time expenditure) is
[0069]
[0070] in is the number of split learning users in the tth communication round, is the download latency of the global model (global model: complete machine learning model) of the federated learning terminal (FL model download), is the model training latency of the federated learning terminal (FL model training), It is the model upload delay (FL model upload) of the federated learning terminal. Since federated learning downloads, calculates, and uploads in parallel, the total delay is the maximum value.
[0071] For SL terminals, the delay of a single round is:
[0072]
[0073] in is the global model download latency (SL model download) of the segmentation learning terminal, including the download of the segmentation learning terminal side model and the download of the back-transmitted gradient. It is the model training latency of the segmentation learning terminal (SLmodel training), including the model training latency on the terminal side (server-side model: if the model has a total of L layers, l is the segmentation layer, then [l+1,L] belongs to the server training, so this part is called the server-side model, terminal-side model: the remaining [1,l] is the terminal-side model) and the server-side model training latency. It is the model upload latency (SL modelupload) of the segmentation learning terminal, including the upload of the terminal-side model and the upload of the activation value (activation value: the output of the current layer of the machine learning model). Because segmentation learning is executed serially, the total latency is the sum value.
[0074] Therefore, the latency for a single round of training for hybrid segmentation and federated learning is:
[0075]
[0076] Assuming l-smooth, μ-strongly convex and Under the condition that the three assumptions are true (these three assumptions are common assumptions in machine learning analysis, l-smooth means that above a function, you can always find a quadratic function, and its value in any domain is greater than this function, which defines the upper bound of the quadratic function and the maximum rate of change of the gradient, where l is the coefficient of the quadratic function, μ-strongly convex is the opposite, which means that below a function, you can always find a quadratic function, and its value in any domain is less than this function, which defines the lower bound of the quadratic function and the minimum rate of change of the gradient, where μ is the coefficient of the quadratic function, and the third assumption means that the gradient calculated for each update will not be too large, that is, this update will not cause too large a change in the model parameters, and the model is relatively stable), the upper bound of the convergence of hybrid segmentation and federated learning can be obtained (indicating the difference between the final convergence effect of the model and the theoretical optimal model parameters. Usually, the theoretical optimal model parameters indicate that the machine learning model will make 100% accurate predictions every time, which is the most ideal and cannot appear in real life).
[0077]
[0078] in Φ is a constant that represents the heterogeneity of data between terminals (usually represents the distribution of data labels. The greater the distribution difference, the higher the heterogeneity). If the terminal data is independent and identically distributed (that is, the data label distribution of each terminal can be regarded as exactly the same), then this value will tend to 0.
[0079] From the above convergence upper bound, we can see that as the number of segmentation learning users increases, the convergence upper bound shows a downward trend, which shows that more segmentation learning users can bring better convergence results (the difference between the model parameters obtained by training and the optimal model parameters is smaller, and closer to the ideal situation). Because segmentation learning is serialized, the more users participate in segmentation learning, the more convergence times the overall model can bring, making the training effect better. However, because segmentation learning is serialized, the more terminals participate in segmentation learning, the greater the delay. In order to achieve a better convergence effect faster, it is necessary to choose the number of segmentation learning terminals to balance the single-round training effect and the single-round training delay.
[0080] In order to balance the relationship between the two, an optimized objective function is proposed:
[0081]
[0082] Among them, ρ is a hyperparameter. Different ρ values will bring different training effects. Purpose of the objective function: We want to continuously reduce the objective function value. There are two ways: 1. Reduce the training delay of a single round (single round training is faster); 2. Increase the number of SL users in a single round (single round training effect is better). Both will improve the training effect of a single round, so we want to get the minimum value of the objective function, so that the training effect of each round is the best. The subsequent operation of the Gibbs algorithm optimization is to follow this principle and minimize the objective function.
[0083] like Figure 4 As shown in the figure, it is a comparison chart of the impact of changing only the weight hyperparameters of the objective function on the training effect when the joint algorithm is effective. This delay is statistically obtained under the premise of achieving the same training accuracy each time. Figure 4 It can be seen that the hyperparameter ρ has a significant impact on the training delay and user choice. The single-round training delay shows a monotonically increasing trend with the increase of ρ value (as shown in the column 4 in the figure. Note that Figure 4 The horizontal axis in the figure is the inverse of ρ, that is, ρ increases from right to left), which is consistent with the objective function. The characteristic of the objective function is that as the ρ value increases, more emphasis will be placed on the number of SL users in a single round, while the training delay of a single round will be weakened. More SL users will bring more training delays due to the nature of serialization, that is, the training delay of a single round and the number of SL users in a single round basically show the same trend.
[0084] Because under the premise of a large ρ, increasing the number of SL users will bring more gains to the reduction of the objective function value. Under the premise of a small ρ, reducing the single-round delay will bring more gains to the reduction of the objective function value. Therefore, in the continuous optimization process, it is more inclined to optimize this parameter.
[0085] Conclusion: The total training delay shows a trend of decreasing first and then increasing (not monotonous). Therefore, if you want to achieve the same training faster, it is not the case that the more split learning users, the better. When the number of split learning users reaches a certain threshold, continuing to increase the number of split learning users may increase the training delay and worsen the effect. Therefore, it is necessary to optimize the user training mode. Under the premise of different environmental data, the number of SL users will also be different, so it is necessary to make a decision on the user training mode in each round of training.
[0086] from Figure 4 The optimal point can be found at ρ=0.002.
[0087] In the case of the terminal learning mode selection above, it is necessary to select the split learning split layer, which will not change the convergence effect of the model, but only change the delay (because different split layers have different numbers of training layers on the terminal side and the server side, and the computing power of the two is different, so it will affect the single-round training delay. At the same time, the number of activation values of each layer is different. Because all activation values and corresponding gradients need to be transmitted, different communication data volumes will be brought, resulting in different single-round communication delays. That is, the choice of split layer will have a significant impact on the training delay (because the communication and computing power of each terminal will change in different rounds, so it is necessary to make a decision every round). Regardless of which split layer is used, the training is complete overall, so it will not affect the training effect. We need to compare the cost of each layer and select an optimal solution). Since it is more complicated to directly optimize these two problems, a multi-stage algorithm is proposed to jointly optimize these two problems:
[0088] 1. In the first step, the learning mode of each terminal is randomly initialized and divided into two clusters, namely the user cluster participating in federated learning and the user cluster participating in split learning. If the current total number of users is 10, then each cluster is an array of length 10 (array: a structure that can store multiple values, such as an array of length 3 represented by [0,0,0], where each value is 0), and all users are numbered from 1 to 10. If the current user k participates in federated learning, then the value of the kth position of this user in the federated learning user cluster is 1, and the value of the kth position in the split learning user cluster is 0, and vice versa. Therefore, the number of 1s in each cluster represents the number of users participating in this learning mode.
[0089] 2. For each user participating in segmentation learning:
[0090] 2.1. Calculate the amount of computation for forward propagation and backward propagation of each layer (calculation method: can be calculated using python's torchstat package), and calculate the computational latency of each layer on different terminals by dividing the computing power of the current terminal and the computing power of the server.
[0091] 2.2. Calculate the amount of output data generated by each layer. You can use tools such as python's torchstat package to get it. This amount of output data is generated for each data point (such as the individual information of each house price). Therefore, the amount of data generated by the current layer of the current terminal should be multiplied by the total amount of data of the current terminal, and then multiplied by 2, because in addition to uploading the output data, each layer also needs to download the corresponding gradient value of back propagation. Then divide it by the communication rate of the current terminal to calculate the communication delay required for each layer as a segmentation layer.
[0092] 2.3. Iteratively select each layer l as the partition layer, calculate the terminal side computing delay of [0, l], add the server side computing delay of [l+1, L], plus the communication delay generated by layer l (because l is the partition layer, the first l layers are calculated on the terminal side, and the subsequent l+1 to the total number of layers L in the model are calculated on the server side), and select the layer with the smallest delay among all the layers as the partition layer as the partition layer for the current user.
[0093] 3. From the above calculation, we can get the single-round calculation and communication delay of each user participating in the segmentation learning (the communication delay here is not only the data generated by the segmentation layer above, but also the communication delay caused by the upload and download of the user layer model). The two can be accumulated to get the training delay of each user currently participating in the segmentation learning. Since the segmentation learning is serialized (serialization: after one user's training is completed, the next user will start training), the training delay of the segmentation learning is the accumulation of the delays of all users participating in the segmentation learning, and we get
[0094] 3.1. Calculate the computation time (computation delay of the complete model training in the terminal) and communication delay (delay of downloading and uploading the complete model) of each user participating in federated learning in a similar way as above. Add the two together to get the training delay of each user participating in federated learning. Since federated learning is parallelized (parallelization: all users participating in federated learning participate in training at the same time), the federated learning delay is the maximum delay of all users participating in federated learning.
[0095] 3.2. Pass The total delay of a single round of training can be calculated. Because the learning between the two clusters of split learning and federated learning is parallel, the delay of a single round of training is the maximum of the two.
[0096] 3.3, at this time there is The number of users participating in segmentation learning We can calculate the objective function u(t), where we set ρ = 0.002, and we have Figure 4 Compare and select the optimal value.
[0097] 4. In the initial learning mode, the learning mode is changed through the Gibbs sampling algorithm. The process is as follows:
[0098] 4.1. Randomly select a user from all users and exchange the values of the same position of this user in different clusters. For example, if the second user is selected, the value of the second position in the federated learning cluster is exchanged with the second position in the split learning cluster. In this way, if the value of the corresponding position of this user in the federated learning cluster is 1, and the value of the corresponding position in the split learning user cluster is 0, then the number of users participating in the split learning will increase by 1 after the exchange (this conclusion can be drawn from the definition of the corresponding positions in the two clusters above). Of course, it is also possible that the number of split learning users increases by 1. Of course, if the value of this user in the two clusters is the same, this exchange is invalid and a new selection is made.
[0099] 4.2. Because the distribution of users has changed, we can get a new objective function value through step 2
[0100] 4.3. Substituting the two objective function values into formula (10) can obtain a value ∈, which represents the probability of this update being adopted. The random number will be generated. If the random number is greater than this value, then this update will be adopted. If the random number is less than this value, this update will not be adopted.
[0101] 4.4. If the new objective function value becomes larger, it means that this choice will bring a relatively bad result: either the time of a single round becomes longer (slower training), or the number of users in a single round of segmentation learning becomes smaller (worse training effect). Either of these two will make the training effect worse, so this update should be avoided as much as possible. In formula (10), if the new target value is greater than the old target value, the exponent of e will be a positive value. The larger the value, the larger the exponent, and the denominator The larger it is, the smaller the probability value ∈ will be, so the probability of updating will be smaller.
[0102] 4.5. On the contrary, a better result is obtained, so the probability of updating will increase.
[0103] 4.7. Since a relatively bad result may bring a better result next time, the non-updating strategy will not be used directly to avoid falling into the local optimal solution.
[0104] Then, as this update continues to advance, it will continue to move towards a better solution (better training results in a shorter time), and eventually obtain a theoretically optimal solution for the current global round.
[0105]
[0106] In the above formula, e is the natural logarithm value. and u t They represent the objective function values calculated by the new strategy and the objective function values calculated by the old strategy, respectively. δ is a hyperparameter used to control the size of the update probability. Here we set δ to a relatively small value of 0.00075. Because when δ is relatively small, no matter the numerator Is it a positive or negative number? will produce a relatively large absolute value, so if is a positive number, indicating that the new objective function value is larger, which is a bad strategy (this conclusion can be drawn from 4.4 of the optimization algorithm above). The calculation result will cause the denominator of formula (10) to be large overall, that is, the update probability value ∈ is small overall and tends to 0, in order to maintain the current learning mode. On the contrary, if is a negative number, indicating that the new objective function is very small, which is a better strategy. The calculation will result in the denominator of formula (10) being large overall, that is, the update probability value ∈ is large overall and tends to 1, in order to adopt a new strategy. On the contrary, if δ is relatively large, then The absolute value of will be relatively small, and will tend to 0 regardless of whether it is positive or negative, which will cause the denominator of formula (10) to tend to 2 (assuming that in the extreme case δ tends to infinity, which will lead to Equal to 0, denominator 1+e 0 That is 2), so the probability of each update tends to 0.5, which makes it difficult to update to a better result.
[0107] Figure 1 is the test accuracy of different training architectures for the CIFAR-10 dataset; Figure 2 is the loss function value of different training architectures of the CIFAR-10 dataset; is a comparison chart of the training effects of hybrid segmentation and federated learning under different optimization algorithms and ordinary hybrid segmentation and federated learning without optimization, segmentation learning, and federated learning. Figure 1 and Figure 2 It can be seen that ordinary HSFL can bring certain gains to training, and if the selection of training mode is added, it will bring more obvious gains to the training effect. If the selection of terminal training mode is added, it can be seen that the training effect is optimal. Therefore, the architecture proposed in the present invention has a very significant advantage under the gain of the optimization algorithm.
[0108] The present invention can be used to accelerate some machine learning scenarios with privacy protection considerations: such as the hospital's medical record diagnosis model, which can improve the efficiency of medical treatment by training a machine learning model to make a quick diagnosis of the patient's illness. Since the patient information in the hospital is private and cannot be globally centralized on the same server, it is possible to consider using a distributed learning method, and the present invention can accelerate training and help the machine learning model to land more quickly. It can also be applied to some other scenarios where it is not convenient to upload local data.
[0109] The preferred specific embodiments of the present invention are described in detail above. It should be understood that ordinary technicians in the field can make many modifications and changes based on the concept of the present invention without creative work. Therefore, all technical solutions that can be obtained by technicians in the technical field based on the concept of the present invention through logical analysis, reasoning or limited experiments on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A hybrid multi-learning mode selection method with general computing collaboration, characterized in that: The following steps are involved: Step 1: The learning mode of the terminal is divided into federated learning and segmented learning; Step 2: Select the optimal segmentation layer; Step 3: Change the terminal learning mode, continue with step 2, and select the optimal terminal learning mode.
2. The hybrid multi-learning mode selection method of claim 1, characterized in that: Each round of training makes a decision on the terminal learning mode.
3. The hybrid multi-learning mode selection method of claim 2, characterized in that: A learning mode of the terminal is selected according to the training effect and the training delay.
4. The hybrid multi-learning mode selection method of claim 2, characterized in that: The objective function of the terminal learning mode selection is: Among them, ρ is a hyperparameter, is the training delay, is the number of split learning terminals in the tth communication round.
5. The hybrid multi-learning mode selection method of claim 4, characterized in that: ρ=0.
002.
6. The hybrid multi-learning mode selection method of claim 4, characterized in that: The objective function is minimized.
7. The hybrid multi-learning mode selection method of claim 1, characterized in that: The step 1 randomly initializes the learning mode of the terminal, which is divided into a user cluster participating in federated learning and a user cluster participating in segmented learning.
8. The hybrid multi-learning mode selection method of claim 1, characterized in that: The step 2 is to calculate the delay of the terminal selecting different segmentation layers, and select the optimal segmentation layer therefrom.
9. The hybrid multi-learning mode selection method of claim 1, characterized in that: The step 3 is to change the terminal learning mode by using the Gibbs sampling algorithm.
10. The hybrid multi-learning mode selection method of claim 1, characterized in that: The goal of the terminal learning is to minimize the global loss function.
Citation Information
Patent Citations
Federal learning acceleration method based on model segmentation
CN114492746A
Federal learning method oriented to participation of weak computing power terminal and related equipment
CN117521855A
Federated learning with partitioned and dynamically-shuffled model updates
US20220374763A1
Adaptive and evolutionary federated learning system
US20230259812A1
