Byzantine robust learning method and system based on model segmentation, medium and equipment

By splitting the weight parameters of the business model in a distributed learning system and training locally, and performing gradient sorting and weighted average updates in the second device, the performance degradation caused by Byzantine failure in the distributed learning system is solved, and the model training efficiency and adaptability are improved.

CN119831002AActive Publication Date: 2025-04-15QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510307444.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-04-15
Estimated Expiration
2045-03-17

AI Technical Summary

Technical Problem

In distributed learning systems, some client devices may fail or be maliciously attacked, resulting in errors in calculation results or tampering, affecting the update of the global model and causing system performance to decline.

Method used

By dividing and assigning the weight parameters of the current business model to each first device, the model is trained using local data, and after receiving the gradients of each device in the second device, the extreme values ​​are sorted, removed, and the weighted average values ​​are calculated to update the model.

Benefits of technology

The computational burden caused by uneven weight allocation is reduced, and the model training efficiency and adaptability of Byzantine robust learning systems are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119831002A_ABST
    Figure CN119831002A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, distributed systems and information security, and provides a Byzantine robust learning method and system based on model segmentation, a medium and equipment. The Byzantine robust learning method based on model segmentation comprises the following steps: sending a current service model and partial weight parameters equally divided by all weight parameters of the current service model to each first device, so that the first device uses the partial weight parameters to train the current service model by using local data; the gradient after the training of the current business model is finished is received from each first device, and after all the gradients are sorted, the weighted average value of all the gradients after the extreme values are removed is calculated and used for updating the current business model; the updated service model is used as the current service model in the next round of model training process. According to the invention, the overweight calculation burden of the first equipment caused by uneven weight distribution can be reduced, so that the model training efficiency of the Byzantine robust learning system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence, distributed systems and information security technology, and in particular to a Byzantine robust learning method, system, medium and device based on model segmentation. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] Model segmentation technology can be performed based on the hierarchical structure of the model. Some studies have proposed dividing the neural network model into different layers and assigning different layers to the client devices below for calculation. Each client device is responsible for calculating part of the model. Some studies have also proposed to segment the model by module. This method should be divided according to different model structures. For example, the ResNet-50 model has 16 residual modules. These 16 residual modules are assigned to different client devices. The gradient parameter information calculated by the previous client is passed to the next client until the last layer is output. Some studies have also proposed to divide by channel. This type of segmentation method is mainly applicable to convolutional neural networks, especially convolutional layers. According to the different channels of the convolutional layer, these channels are then assigned to different client nodes. The client only calculates the channels it is responsible for. After each layer is calculated, it shares data with other nodes to complete the forward propagation and back propagation of the model.

[0004] Because multiple client devices participate in distributed learning, some client nodes may fail, be maliciously attacked or for other reasons, resulting in erroneous, false or even maliciously tampered calculation results, thereby affecting the update of the global model and causing the overall performance of the system to deteriorate. This type of problem is called "Byzantine failure".

[0005] There are many studies devoted to the Byzantine problem. (1) Secure aggregation algorithms based on cryptographic technology: Encryption and decryption operations usually require high computing resources, which may bring significant performance burden to resource-constrained devices (such as sensors and mobile terminals). At the same time, the data transmission of ciphertext may be more lengthy than plaintext, which increases the communication overhead. Moreover, such algorithms require the pre-allocation and regular update of keys. (2) Node selection strategies based on trust models: Trust models usually rely on historical behavior data or interaction records between nodes to calculate trust values. Malicious nodes can manipulate trust models by forging multiple identities, making them appear more reliable than they actually are, thereby mixing into the network and destroying the aggregation results. Building and maintaining trust models requires real-time monitoring and data statistics of node behavior, which increases the computational complexity of the system. Summary of the invention

[0006] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides a Byzantine robust learning method, system, medium and device based on model partitioning, which uses local data to train the current business model by using part of the weight parameters equally divided by all weight parameters of the current business model through each first device; the second device receives the gradients of each current business model after the training is completed from each first device, sorts all the gradients, calculates the weighted average of all the gradients after removing the extreme values, and updates the current business model, which can reduce the excessive computational burden of the first device caused by uneven weight distribution, thereby improving the model training efficiency of the Byzantine robust learning system, and improving the adaptability of the Byzantine robust learning system.

[0007] In order to achieve the above object, the present invention adopts the following technical solution: A first aspect of the present invention provides a Byzantine robust learning method based on model segmentation.

[0008] A Byzantine robust learning method based on model segmentation includes: a second device and at least two first devices train a business model, each first device has local data, and the second device maintains the trained business model. The method is applied to the second device, and the method includes: sending the current business model and part of the weight parameters equally divided by all the weight parameters of the current business model to each first device, so that the first device uses part of the weight parameters and uses local data to train the current business model; receiving the gradient of each current business model after training is completed from each first device, sorting all the gradients, and calculating the weighted average of all the gradients after removing extreme values, which is used to update the current business model; the updated business model is used as the current business model of the next round of model training process.

[0009] Optionally, in an example of the above aspect, the partial weight parameters equally divided by all weight parameters of the current business model include: converting all weight parameters of the current business model into one-dimensional vectors, merging them after arranging them according to training, to obtain a total weight vector; dividing the total weight vector into several parts on average, restoring each part of the weight vector, and obtaining partial weight parameters.

[0010] Optionally, in an example of the above aspect, the calculation is to obtain an average value of all gradients after removing extreme values, using the following formula:

[0011] in, represents the average value of all gradients after removing extreme values, n represents the number of first devices, f represents the number of Byzantine first devices, represents the model gradient of the i-th first device.

[0012] A second aspect of the present invention provides a Byzantine robust learning system based on model segmentation.

[0013] A Byzantine robust learning system based on model segmentation comprises: a second device and at least two first devices for training a business model, each of the first devices having local data, the second device maintaining the trained business model, the system being applied to the second device, the system comprising: a sending unit for sending a current business model and part of the weight parameters equally divided by all the weight parameters of the current business model to each of the first devices, so that the first devices can use part of the weight parameters and use local data to train the current business model; a model updating unit for receiving the gradients of the current business models after training from each of the first devices, sorting all the gradients, and calculating the weighted average of all the gradients after removing extreme values, for updating the current business model; the updated business model is used as the current business model for the next round of model training process.

[0014] Optionally, in an example of the above aspect, the sending unit includes: converting all weight parameters of the current business model into one-dimensional vectors, merging them according to training arrangement, and obtaining a total weight vector; dividing the total weight vector into several parts on average, restoring each part of the weight vector, and obtaining partial weight parameters.

[0015] Optionally, in an example of the above aspect, the calculation is to obtain an average value of all gradients after removing extreme values, using the following formula:

[0016] in, represents the average value of all gradients after removing extreme values, n represents the number of first devices, f represents the number of Byzantine first devices, represents the model gradient of the i-th first device.

[0017] The third aspect of the present invention provides a Byzantine robust learning method based on model segmentation.

[0018] A Byzantine robust learning method based on model partitioning includes: a second device and at least two first devices train a business model, each of the first devices has local data, and the second device maintains the trained business model. The method is applied to the first device, and the method includes: receiving a current business model and part of the weight parameters equally divided by all the weight parameters of the current business model from the second device; using the received part of the weight parameters to train the received current business model using local data; providing the gradient of the model parameters in the locally trained business model to the second device, so that the second device can sort all the gradients and calculate the weighted average of all the gradients after removing extreme values, which is used to update the business model.

[0019] A fourth aspect of the present invention provides a Byzantine robust learning system based on model segmentation.

[0020] A Byzantine robust learning system based on model partitioning includes: at least two first devices and a second device for training a business model, each of the first devices has local data, and the second device maintains the trained business model. The device is applied to the first device, and the system includes: a receiving unit, receiving a current business model and a part of weight parameters equally divided by all weight parameters of the current business model from the second device; a model training unit, using the received part of the weight parameters to train the received current business model using local data; a model parameter providing unit, providing the gradient of the model parameters in the locally trained business model to the second device, so that the second device can sort all the gradients and calculate the weighted average of all the gradients after removing extreme values, which is used to update the business model.

[0021] A fifth aspect of the present invention provides a computer-readable storage medium.

[0022] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the Byzantine robust learning method based on model segmentation as described in the first aspect or the third aspect above.

[0023] A sixth aspect of the present invention provides a computer device.

[0024] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the Byzantine robust learning method based on model segmentation as described in the first aspect or the third aspect are implemented.

[0025] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a Byzantine robust learning method, system, medium and device based on model segmentation, which uses local data to train the current business model by using part of the weight parameters equally divided by all the weight parameters of the current business model through each first device; the second device receives the gradients of the current business model after the training of each first device, sorts all the gradients, calculates the weighted average of all the gradients after removing the extreme values, and updates the current business model, which can reduce the excessive computing burden of the first device caused by uneven weight distribution, thereby improving the model training efficiency of the Byzantine robust learning system and improving the adaptability of the Byzantine robust learning system.

[0026] The weight-based partitioning of the present invention does not depend on the specific network structure, is more adaptable, can be applied to different types of networks, and does not need to care about the input and output dimensions of each layer. It only needs to be simply flattened and divided, which greatly reduces the complexity of cutting. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0028] Figure 1 A schematic diagram of the architecture of the Byzantine robust learning system based on model partitioning is shown.

[0029] Figure 2 A flow chart of a Byzantine robust learning method based on model segmentation on a second device side is shown; Figure 3 A structural diagram of a Byzantine robust learning system based on model segmentation on a second device side is shown; Figure 4 A flow chart of a Byzantine robust learning method based on model segmentation on a first device side is shown; Figure 5 A structural diagram of a Byzantine robust learning system based on model partitioning on a first device side is shown. DETAILED DESCRIPTION

[0030] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0031] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0032] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0033] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the methods and systems according to various embodiments of the present disclosure. It should be noted that each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code may include one or more executable instructions for implementing the logical functions specified in each embodiment. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the flowchart and / or block diagram, and the combination of boxes in the flowchart and / or block diagram can be implemented using a dedicated hardware-based system that performs a specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.

[0034] The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that the discussion of these embodiments is only to enable those skilled in the art to better understand and implement the subject matter described herein, and is not a limitation of the scope of protection, applicability or examples set forth in the claims. The functions and arrangements of the elements discussed can be changed without departing from the scope of protection of the contents of this specification. Various examples can omit, replace or add various processes or components as needed. For example, the described method can be performed in an order different from the described order, and various steps can be added, omitted or combined. In addition, the features described relative to some examples can also be combined in other examples.

[0035] As used herein, the term "including" and its variations represent open terms, meaning "including but not limited to". The term "based on" means "based at least in part on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other definitions may be included below, whether explicit or implicit. Unless the context clearly indicates otherwise, the definition of a term is consistent throughout the specification.

[0036] In this specification, the term "business model" refers to a machine learning model that is applied to business scenarios to provide business prediction services, such as a machine learning model for classification prediction, business risk prediction, etc. Examples of machine learning models may include, but are not limited to: linear regression model, logistic regression model, neural network model, decision tree model, support vector machine, etc. Examples of neural network models may include, but are not limited to, deep neural network (DNN, Deep Neural Network) model, convolutional neural network (CNN, Convolutional Neural Network) model, ResNet-50 model, BP neural network, etc. The specific implementation form of the business model depends on the business scenario in which it is applied. For example, in an application scenario where the business model is applied to classify users, the business model is implemented as a user classification model. Accordingly, user classification prediction can be performed on the user feature data of the classified users according to the business model. In an application scenario where the business model is applied to predict the business risk of business transactions occurring on the business system, the business model is implemented as a business risk prediction model. Accordingly, business risk prediction can be performed on the business transaction feature data of the business transaction according to the business model.

[0037] With the development of artificial intelligence technology, machine learning technology has been widely used as a business model in various business application scenarios to provide various business prediction services, such as classification prediction, business risk prediction, etc. For example, business models are widely used in financial fraud, recommendation systems, image recognition and other fields. In order to achieve better model performance, more training data is needed to train business models. In application fields such as medicine and finance, different companies or institutions have different data samples. Once these data are jointly trained, the model accuracy of the business model will be greatly improved, thereby bringing huge economic benefits to the company.

[0038] In view of the above, the embodiments of the present specification provide a Byzantine robust learning method, system, medium and device based on model partitioning, which uses local data to train the current business model by using part of the weight parameters equally divided by all weight parameters of the current business model through each first device; the second device receives the gradients of the current business model after the training of each first device, sorts all the gradients, calculates the weighted average of all the gradients after removing the extreme values, and updates the current business model, which can reduce the excessive computational burden of the first device caused by uneven weight distribution, thereby improving the model training efficiency of the Byzantine robust learning system, and improving the adaptability of the Byzantine robust learning system.

[0039] The model segmentation-based Byzantine robust learning method, system, medium, and device for training a business model according to an embodiment of this specification will be described in detail below in conjunction with the accompanying drawings.

[0040] Figure 1 A schematic diagram of the architecture of a Byzantine robust learning system based on model segmentation for training a business model according to an embodiment of the present specification is shown.

[0041] like Figure 1 As shown, the Byzantine robust learning system based on model segmentation includes at least two first devices and a second device. Figure 1 N first devices are shown in FIG. At least two first devices and the second device can communicate with each other through a network such as, but not limited to, the Internet or a local area network.

[0042] In the embodiments of this specification, the first device may be a device or device party for locally collecting data samples, such as a smart terminal device, a server device, an edge device, etc. The business model to be trained is maintained on the second device. For example, the second device may be a terminal device at a model provider. The business model maintained on the second device may also be referred to as a global business model.

[0043] In an embodiment of the present specification, the local data of the first device may include business data collected locally by each member device. Business data may include feature data of business objects. Examples of business objects may include, but are not limited to, users, commodities, events, or relationships. Accordingly, business data may, for example, include, but are not limited to, user feature data, commodity feature data, event feature data, or relationship feature data collected locally, such as user feature data, business processing data, financial transaction data, commodity transaction data, medical health data, and the like. Business data may, for example, be applied to business models for model prediction, model training, and other suitable multi-party data joint processing.

[0044] In this specification, business data may include business data based on text data, image data and / or voice data. Accordingly, the business model may be applied to business risk identification, business classification or business decision-making based on text data, image data and / or voice data, etc. For example, local data may be medical data collected by a hospital, and the business model may be used to perform disease examination or disease diagnosis. Alternatively, the collected local data may include user feature data. Accordingly, the business model may be applied to business risk identification, business classification, business recommendation or business decision-making based on user feature data, etc. Examples of business models may include, but are not limited to, face recognition models, disease diagnosis models, business risk prediction models, service recommendation models, etc.

[0045] In this specification, the local data possessed by each first device constitutes the training sample data of the business model, and the local data possessed by each first device is a secret of the second device and cannot be known or completely known by other first devices.

[0046] In an actual application example, each first device may be, for example, a smart terminal device of a service application party or a service application associated party, such as a smart terminal device of different financial institutions or medical institutions. The second device may be, for example, a server of a service provider or service operator.

[0047] Figure 2 A flowchart of a Byzantine robust learning method based on model segmentation for training a business model according to an embodiment of the present specification, which is applied to a second device, is shown. Figure 2 The flowchart shown in FIG. 1 is a processing flow of a one-cycle training process in the Byzantine robust learning process.

[0048] like Figure 2 As shown, the second device sends the current business model and part of the weight parameters equally divided by all the weight parameters of the current business model to each first device, and the first device uses the part of the weight parameters to train the current business model using local data; the second device receives the gradients of the current business model after training from each first device, sorts all the gradients, calculates the weighted average of all the gradients after removing the extreme values, and updates the current business model. Here, the current business model is the updated business model obtained by the previous cycle processing process executed at the second device.

[0049] In one example, a model segmentation-based Byzantine robust learning method for training a business model performs the following steps: Step (1) Initialize and split the model: Assume that the weight of the initial business model is ω 0, the second device divides it into p The weight of each part is =( + +...+ ) / p , that is, the initial weight of each sub-model is the average value of the initial model.

[0050] Step (2) assigning the model to the first device: Different parts of the model are dynamically allocated based on the computing power and historical performance of the first device. The first devices with high computing power will receive more complex parts of the model, thus accelerating the learning process. All first devices receive the split parts of the model through the random number generator and start training.

[0051] Assumptions Representative k The local data held by the first device, During training, the second device will select some users from all customers to participate in each round of training, so as to obtain model parameters and minimize the loss function. Finally, the second device collects the parameters of each participating customer for weighted averaging, and the formula is as follows:

[0052] in, It is k The model parameters trained on the first device, w is the model parameter after aggregation on the second device, , D is the total amount of data samples of all first devices, Indicates k The weight of the first device among all the first devices is used to measure the k The proportion of the first device in the global aggregation. If the amount of local data of the first device is very different, the difference in the training and update model will also be very large, so in order to balance this difference, there needs to be Parameters are used for weighting. The optimization process of the loss function can be expressed by the following formula:

[0053] in, represents the optimal business model parameters, Indicates i The weight factor of the first device in the global optimization, L (·) is the i The loss function of the first device, w represents the weighted average of all the first devices, Indicates i The data sample size of the first device.

[0054] Step (3) Local training and updating: Each first device performs a local update process and trains with local data and model parameters. During the local training process, in order to improve stability and accelerate convergence, the first device uses the adaptive learning rate algorithm Adam to adjust the learning rate to ensure that each round of training is updated more smoothly. Then the first device calculates the current gradient according to the formula , and update the local model parameters according to the adaptive learning rate: .in, Indicates the first device k exist t The first update during the training round p The model parameters of each business sub-model, Indicates the first devicek exist t -1st round of training updated p The model parameters of each business sub-model, Indicates the first device k In the t -1 round of training for the sub-model p The loss gradient is Represents the adaptive learning rate, which is used to adjust the update step size of the model parameters in each round of training.

[0055] Step (4) Upload the gradient to the second device: Each first device calculates the update gradient of the local model and upload these gradients to the second device.

[0056] Step (5) Current business model update: The second device receives the gradients from all the first devices , and first sort the received gradients. In order to ensure the stability of the current business model, a confidence-based weighted average strategy is used to process the gradients.

[0057] In the t In the round of communication, the second device sends the parameter Distribute to the first device. Each first device i Perform multiple local training on local data to obtain updated local parameters Then, the first device i Calculate the local gradient , as shown below, and sends it to the second device.

[0058]

[0059] in, Indicates t Parameters of the round business model.

[0060] Finally, the second device collects local gradients and updates the traffic model using the average gradient.

[0061]

[0062]

[0063] in, Indicates t The gradient of the training round is not device specific.

[0064] During the entire federated learning training process, n first devices collaborate to learn the machine learning model, and with the help of the second device, they finally optimize equation (2) to converge to the global optimal solution of the model.

[0065] The received gradients are weighted, and a credibility weight is assigned to the gradient of each first device. The historical performance of the first device and the confidence of the current gradient will determine the weight of its uploaded gradient in the business model update. In this way, the gradient of the first device with higher credibility will receive more attention.

[0066] Byzantine Threat Model: Malicious First Devices Some first devices may launch Byzantine attacks, use their private data, or send arbitrary local model parameters to attempt to tamper with the local training phase, thereby destroying the current business model or stealing the privacy information of other first devices. In this scheme, it is assumed that the number of malicious first devices is limited, and the total number is n Among the first device groups, there are f is identified as the Byzantine first device. This embodiment adopts the set B⊆[ n ] to identify these Byzantine first devices, and the collection M = [ n ]\ B is used to refer to the remaining honest first devices. In the case of the existence of the Byzantine first device, t During the round of communication, the first device i The submitted gradient information can be expressed as:

[0067] in, For Byzantine equipment, M For the remaining non-Byzantine devices, Indicated as the first device i In the t Gradient information updated in round training, Indicates t Parameters of the round business model, Indicates the first device i exist t Parameters generated after a round of local training (for the next round of updates).

[0068] Eliminate abnormal gradients (such as extremely unreasonable gradients), and then calculate the weighted average of the remaining gradients:

[0069] in, represents the average value of all gradients after removing extreme values, n represents the number of first devices, f represents the number of Byzantine first devices, represents the model parameters of the i-th first device.

[0070] The FedAvg aggregation algorithm is commonly used to eliminate abnormal gradients, but it may not achieve the best effect for the global model due to individual extreme abnormal gradients. f After f The extreme gradients are averaged in the middle to eliminate the influence of the largest outlier. This can aggregate high-quality gradients and reduce the interference of invalid gradients on model updates. At the same time, it can also make the global model update more balanced and converge faster to a certain extent, and the final performance can be more stable. The choice of f requires multiple debugging.

[0071] Step (6) Update the current business model: The updated gradient is used to update the current business model. Based on the calculated global gradient, the second device updates the model parameters To update:

[0072] in, α Represents the learning rate.

[0073] The above scheme can also be interpreted as: the present invention can adopt the ResNet-50 model, and the Byzantine robust learning method based on model segmentation is mainly embodied in the second device. Before the second device sends the model to the first device, the model is first divided. Because the ResNet-50 model is relatively complex, a weight division method is adopted. First, all weight parameters of the ResNet-50 model are obtained. The weights of the ResNet-50 model include parameters of all layers such as convolutional layers, fully connected layers, and batch normalization layers. The weights of each layer of the ResNet-50 model are usually high-dimensional. In order to perform average cutting, all weights need to be flattened into a one-dimensional vector first. The flattened weight vectors of all layers are merged to obtain a large long vector. This vector contains all parameters of all layers of ResNet-50, arranged in layer order. Then it is evenly divided into P parts according to the number of first devices, and each divided part is still a one-dimensional vector. In order to enable each part to be used in the model, the present invention needs to restore the weight of each part to its original shape. The weight of each part will be restored to the weight shape of the corresponding convolutional layer, fully connected layer, etc. (this process will be performed on each first device, and the first device will use its own weight part for training and upload the gradient). Distribute each weight part after segmentation to different first devices. Each first device will only receive a part of the weights of the ResNet-50 model and use these parts for local training. After each first device completes training and uploads its gradient, the second device will aggregate the gradients uploaded by all first devices. To prevent Byzantine attacks, the second device will sort the gradients, remove extreme values, and calculate the average of the remaining parts to update the weights of the business model. Then, the second device will redistribute the updated weights to the first device. In each iteration, the first device will continue local training with the updated part of the weights. After each update, the second device will re-merge and distribute the weights until the model converges.

[0074] Among them, the weight of each part is restored to its original shape. This process can use existing methods such as reshape function and view function. Specifically, when flattening for the first time, record the starting position, end position, length, offset and other information corresponding to each layer. When restoring and reconstructing, according to the previously recorded offset and shape information, use reshape function or view function to reshape and restore the one-dimensional vector to the multi-dimensional tensor of the corresponding layer.

[0075] The present invention utilizes the above-mentioned Byzantine robust learning method based on model segmentation. By evenly dividing the weight vector, the weight amount obtained by each first device is close to equal, thereby avoiding excessive computational burden of some first devices due to uneven weight distribution. Moreover, unlike the division by layer or module, the weight division based on the present invention does not depend on the specific network structure, is more adaptable, can be applied to different types of networks, and does not need to care about the input and output dimensions of each layer. It only needs to be simply flattened and divided, which greatly reduces the complexity of cutting.

[0076] Figure 3 FIG. 1 shows a block diagram of a Byzantine robust learning system based on model segmentation on a second device side according to an embodiment of the present specification. Figure 3 As shown, the Byzantine robust learning system based on model segmentation includes: a sending unit and a model updating unit.

[0077] The sending unit is configured to send the current business model and part of the weight parameters equally divided by all the weight parameters of the current business model to each first device, so that the first device uses the part of the weight parameters to train the current business model using local data.

[0078] The model updating unit is configured to receive the gradients of the current business model after training from each first device, sort all the gradients, calculate the weighted average of all the gradients after removing extreme values, and use them to update the current business model; the updated business model is used as the current business model for the next round of model training process.

[0079] In some embodiments, the sending unit includes: converting all weight parameters of the current business model into one-dimensional vectors, merging them after training arrangement to obtain a total weight vector; dividing the total weight vector into several parts on average, restoring each part of the weight vector, and obtaining partial weight parameters.

[0080] In some embodiments, the calculation of the average value of all gradients after removing extreme values ​​uses the following formula:

[0081] in, represents the average value of all gradients after removing extreme values, n represents the number of first devices, f represents the number of Byzantine first devices, represents the model gradient of the i-th first device.

[0082] Figure 4 A flowchart of a Byzantine robust learning method based on model segmentation for training a business model according to an embodiment of the present specification, which is applied to a first device, is shown. Figure 4 The flowchart shown in FIG. 1 is a processing flow of a one-cycle training process in the Byzantine robust learning process.

[0083] like Figure 4 As shown, the current business model and part of the weight parameters equally divided by all the weight parameters of the current business model are received from the second device; the received part of the weight parameters are used to train the received current business model using local data; the gradient of the model parameters in the locally trained business model is provided to the second device, so that the second device sorts all the gradients and calculates the weighted average of all the gradients after removing extreme values, which is used to update the business model.

[0084] In one example, a model segmentation-based Byzantine robust learning method for training a business model performs the following steps: Step (1) Receive the sub-model: The first device receives its assigned model sub-portion from the second device , and start local training.

[0085] Step (2) Local training process: The first device is trained on local data, and performs multiple rounds of optimization using gradient descent and adaptive learning rate algorithms (such as Adam) to gradually reduce the model loss. The first device updates the model after each round of training:

[0086] in, Indicates the first device k exist t The first update during the training round p The model parameters of each business sub-model, Indicates the first device k exist t -1st round of training updated p The model parameters of each business sub-model, Indicates the first device k In the t -1 round of training for the sub-model p The loss gradient is Represents the adaptive learning rate, which is used to adjust the update step size of the model parameters in each round of training.

[0087] Step (3) Upload local gradients: After each round of training, the first device will calculate the gradient Upload to the second device for use in updating the current business model.

[0088] Step (4) collects all gradients uploaded by the first device: The second device receives the uploaded gradients from all the first devices and calculates the weighted gradients based on the historical performance and credibility of the first devices. This stage not only eliminates malicious first devices, but also considers the effectiveness of the first devices and their contribution to the current business model.

[0089] Step (5) Weighted Aggregation Gradient: The weighted average method is used in combination with the gradients of each first device to further improve the stability of the current business model and avoid interference caused by malicious or abnormal first devices.

[0090] Step (6) Update the business model: The second device updates the current business model according to the weighted aggregated gradient, thereby ensuring that the training process of all first devices is optimized toward a consistent goal and is not affected by Byzantine attacks.

[0091] Figure 5 FIG. 1 shows a block diagram of a Byzantine robust learning system based on model segmentation on a first device side according to an embodiment of the present specification. Figure 3 As shown, the Byzantine robust learning system based on model segmentation includes: a receiving unit, a model training unit and a model parameter providing unit.

[0092] like Figure 5 As shown, the receiving unit is configured to receive from the second device the current business model and a portion of weight parameters equally divided by all weight parameters of the current business model; The model training unit is configured to train the received current business model using the received partial weight parameters and the local data; The model parameter providing unit is configured to provide the gradients of the model parameters in the locally trained business model to the second device, so that the second device sorts all the gradients and calculates the weighted average of all the gradients after removing extreme values ​​for updating the business model.

[0093] According to one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the steps in the above-mentioned Byzantine robust learning method based on model segmentation are implemented.

[0094] According to one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the above-mentioned Byzantine robust learning method based on model segmentation are implemented.

[0095] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0096] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0097] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0098] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0099] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0100] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. Byzantine robust learning method based on model segmentation, including: The second device and at least two first devices train a business model, each of the first devices has local data, and the second device maintains the trained business model. The method is applied to the second device, and is characterized in that the method includes: Sending the current business model and part of the weight parameters equally divided by all the weight parameters of the current business model to each first device, so that the first device uses the part of the weight parameters to train the current business model using local data; Receive the gradients of the current business model after training from each first device, sort all the gradients, calculate the weighted average of all the gradients after removing extreme values, and use them to update the current business model; the updated business model is used as the current business model for the next round of model training process.

2. The Byzantine robust learning method based on model segmentation according to claim 1, characterized in that: The partial weight parameters equally divided by all weight parameters of the current business model include: Convert all weight parameters of the current business model into one-dimensional vectors, arrange them according to the training, and merge them to obtain the total weight vector; The total weight vector is evenly divided into several parts, and each part of the weight vector is restored to obtain partial weight parameters.

3. The Byzantine robust learning method based on model segmentation according to claim 2, characterized in that: The calculation is to remove the extreme values ​​and average the gradients using the following formula: in, represents the average value of all gradients after removing extreme values, n represents the number of first devices, f represents the number of Byzantine first devices, represents the model gradient of the ith first device. 4.Byzantine robust learning system based on model segmentation, including: The second device and at least two first devices train a business model, each of the first devices has local data, and the second device maintains the trained business model. The system is applied to the second device, and is characterized in that the system includes: A sending unit, which sends the current business model and a part of the weight parameters equally divided by all the weight parameters of the current business model to each first device, so that the first device uses the part of the weight parameters to train the current business model using local data; The model updating unit receives the gradients of the current business model after training from each first device, sorts all the gradients, and calculates the weighted average of all the gradients after removing extreme values, which is used to update the current business model; the updated business model is used as the current business model of the next round of model training process.

5. The Byzantine robust learning system based on model segmentation according to claim 4, characterized in that: The sending unit comprises: Convert all weight parameters of the current business model into one-dimensional vectors, arrange them according to the training, and merge them to obtain the total weight vector; The total weight vector is evenly divided into several parts, and each part of the weight vector is restored to obtain partial weight parameters.

6. The Byzantine robust learning system based on model segmentation according to claim 4, characterized in that: The calculation is to remove the extreme values ​​and average the gradients using the following formula: in, represents the average value of all gradients after removing extreme values, n represents the number of first devices, f represents the number of Byzantine first devices, represents the model gradient of the ith first device. 7.Byzantine robust learning method based on model segmentation, including: The second device and at least two first devices train a business model, each of the first devices has local data, and the second device maintains the trained business model. The method is applied to the first device, and is characterized in that the method includes: receiving, from the second device, a current business model and a portion of weight parameters equally divided by all weight parameters of the current business model; Using the received partial weight parameters, training the received current business model using local data; The gradients of the model parameters in the locally trained business model are provided to the second device, so that the second device sorts all the gradients and calculates the weighted average of all the gradients after removing extreme values, which is used to update the business model. 8.Byzantine robust learning system based on model segmentation, including: At least two first devices and a second device train a business model, each first device has local data, and the second device maintains the trained business model. The device is applied to the first device, and is characterized in that the system includes: A receiving unit receives, from a second device, a current business model and a portion of weight parameters equally divided by all weight parameters of the current business model; A model training unit, using the received partial weight parameters and local data to train the received current business model; The model parameter providing unit provides the gradients of the model parameters in the locally trained business model to the second device, so that the second device sorts all the gradients and calculates the weighted average of all the gradients after removing extreme values ​​for updating the business model.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the Byzantine robust learning method based on model segmentation as described in any one of claims 1 to 3 or the Byzantine robust learning method based on model segmentation as described in claim 7 are implemented.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the Byzantine robust learning method based on model segmentation as described in any one of claims 1 to 3 or the Byzantine robust learning method based on model segmentation as described in claim 7 are implemented.

Citation Information

Patent Citations

  • Federal learning method, federal learning device and federal learning system

    CN115169451A

  • Federal learning method, device and system considering Byzantine fault tolerance

    CN118277891A

  • Federal learning method for Byzantine fault tolerance, electronic equipment and storage medium

    CN118312960A

  • Byzantine-robust federated learning method for realizing privacy protection based on block chain

    CN119129703A