Cloud model iteration updating method and device based on federal learning

Through the iterative update method of cloud model of federated learning, the problem of insufficient accuracy and real-time performance of image recognition models in different hospitals is solved, and high-precision and high-efficiency recognition in fundus injection surgery is achieved.

CN119207733APending Publication Date: 2024-12-27GUANGZHOU WEIMOU MEDICAL INSTR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411271790.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

In the prior art In fundus injection surgery, the data source of the image recognition model is single, resulting in poor generalization performance of the model, unable to maintain the best image recognition accuracy in different hospitals, and unable to meet the real-time and accuracy requirements of the surgery.

Method used

The iterative update method of cloud model based on federated learning is adopted. By receiving local models and training parameter data of each edge device, the model performance is evaluated, the model with the best performance is selected for updates, and the parameter updates are performed on the cloud server, and distributed training is synchronized. To improve model accuracy and generalization.

Benefits of technology

It ensures the synchronization and accuracy of local models in each edge device, meets surgical needs, and reduces the computational pressure of training a single edge device, ensuring real-time and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119207733A_ABST
    Figure CN119207733A_ABST
Patent Text Reader

Abstract

The invention discloses a federated learning-based cloud model iterative updating method and device. According to the method, the first local model and the corresponding first training parameter data sent by the edge device are received through the cloud server, and the second cloud model is selected from all the received first local models, so that global model updating is carried out in combination with the first training parameter data subsequently; the second cloud model is updated, the updated second cloud model is sent to each edge server, and after each edge server receives the second cloud model, local model updating is carried out according to the second cloud model to obtain the updated first local model and the first training parameter data. According to the invention, the precision of the local model in the edge device and the updating efficiency of the local model in each edge device can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of medical model training, and in particular to a cloud-based model iterative update method and device based on federated learning. Background Art

[0002] In current fundus injection surgeries, needle insertion is a crucial step. Doctors need to judge the safety of the insertion process based on the depth and status of the needle. Existing technologies assist doctors in performing needle insertion operations by combining image recognition technology.

[0003] However, the existing technology usually builds an image recognition model on a single device and collects image data in the current environment for further training, resulting in a single data source, poor model generalization performance, and low judgment accuracy. The specific reasons for the above defects are: due to the different performance of equipment in different hospitals, it is impossible to guarantee that the image recognition model can have the same real-time performance in different hospitals. For fundus surgery, which has high real-time requirements, the image recognition model often cannot maintain the best image recognition accuracy during the operation; in addition, due to the small number of surgeries in some hospitals or the overly single surgical target group, the amount of collected training data is too small or the type is too single, making it impossible for such hospitals to effectively maintain and update the image recognition model, which makes the generalization ability of the image recognition model weaker and weaker, and unable to meet surgical needs.

[0004] Therefore, how to meet the requirements of different hospitals for the accuracy of image recognition equipment during surgery and improve the recognition accuracy of the model are technical problems that need to be solved at present. Summary of the invention

[0005] The present application provides a method and device for iterative updating of a cloud-based model based on federated learning, in order to solve the technical problems that need to be solved at present, namely, how to meet the requirements of different hospitals for the accuracy of image recognition equipment during surgery and how to improve the recognition accuracy of the model.

[0006] In order to solve the above technical problems, in a first aspect, an embodiment of the present application provides a cloud model iterative update method based on federated learning, which is used in a cloud server, comprising:

[0007] Receive first local model data uploaded by each first edge device that sends a data upload request in the current round; wherein the first local model data includes: a first local model and corresponding first training parameter data;

[0008] According to a preset loss function, the performance of each of the first local models is evaluated, and the first local model with the best performance is selected as the first cloud model;

[0009] According to all the first training parameter data, update the parameters of the first cloud model to obtain a second cloud model;

[0010] The second cloud model is sent to all edge devices, and the first local model data sent by each of the first edge devices is received in the next round.

[0011] Compared with the prior art, the embodiments of the present application have the following beneficial effects: in order to ensure that the local models of the edge devices in each hospital are synchronized image recognition models, by receiving the local models of each edge device and the training parameter data of the corresponding local models, the training status of the corresponding local models can be obtained, so that the cloud server comprehensively considers the way of aggregating the local models of the remote model according to the training status of different models, and expands the influence of the local models with better training effects on the cloud model update, thereby improving the accuracy of the cloud model, and feeding back the cloud model with higher accuracy to the edge server, and finally always maintaining the accuracy of the local model in each edge device to meet the surgical requirements; in addition, since a single edge device requires a large amount of data for training in order to improve the accuracy of the local model, it cannot meet the real-time requirements of the surgery. Through the synchronous distributed training of multiple edge devices, the computing pressure of a single edge device when training the local model is reduced, and the accuracy of the local model is also guaranteed while ensuring the real-time requirements.

[0012] In some embodiments of the first aspect of the present application, updating parameters of the first cloud model according to all the first training parameter data includes:

[0013] The first training parameter data includes: the first training round, the first parameter update amount, and the first learning rate corresponding to the first local model when the first edge device communicates with the cloud server in this round;

[0014] Obtaining a first weight corresponding to the first local model according to the first training round and the first learning rate;

[0015] The parameters of the first cloud model are updated according to the first weight and the first parameter update amount.

[0016] Compared with the prior art, the above embodiment has the following beneficial effects: due to the different performances of different edge devices and the different data processed, there will be different training situations during the training process. Through the training rounds and the learning rate set in each round of training, the corresponding weights can be set for the parameter update amount corresponding to the local model uploaded by each edge device, so as to accurately evaluate the impact of the training effect of each edge device on the update of the cloud model parameters and improve the generalization of the cloud model.

[0017] In some embodiments of the first aspect of the present application, acquiring a first weight corresponding to the first local model according to the first training round and the first learning rate includes:

[0018]

[0019] Among them, γ k is the first weight of the first local model corresponding to the first edge device of the current kth group; η k is the first learning rate corresponding to the first edge device of the kth group in the current round; η k,t is the learning rate of the first edge device in the kth group during the tth round of training; T k It is the first training round of the first edge device in the kth group.

[0020] Compared with the prior art, the above embodiment has the following beneficial effects: by averaging the learning rates of all rounds and dividing the average by the learning rate of this round to obtain the weight, the total impact of each round of model update of the edge device from the beginning to the present on the cloud model parameters can be accurately evaluated. As the number of training rounds increases, it can be seen that this process is an iterative evaluation process of the update amount, thereby improving the accuracy of subsequent cloud models.

[0021] In some embodiments of the first aspect of the present application, updating the parameters of the first cloud model according to the first weight and the first parameter update amount includes:

[0022]

[0023] Among them, θ t+1 is the parameter of the second cloud model; θ t is the parameter of the first cloud model; N is the total number of edge devices that send the first training parameter data; γ k is the first weight of the first local model corresponding to the first edge device of the current k-th group; Δk is the first parameter update amount of the first local model corresponding to the first edge device of the k-th group.

[0024] Compared with the prior art, the above embodiment has the following beneficial effects: when obtaining the parameters of the second cloud model here, it is not based on the parameters of the second cloud model obtained on the cloud server in the previous round, but directly uses the local model with the best performance obtained from the edge server in this round as the first cloud model for obtaining the second cloud model, which not only ensures the real-time performance of the cloud model when updating, but also improves the accuracy of the cloud model.

[0025] In a second aspect, an embodiment of the present application provides a cloud model iterative update method based on federated learning, which is used in an edge device, including:

[0026] Receive the second cloud model sent by the cloud server in the current round, and initialize the first local model according to the second cloud model:

[0027] Collect and preprocess first sample data in a corresponding environment to obtain first training data, and train the first local model several times in combination with the first training data to obtain first parameters;

[0028] Calculate a first loss value according to a preset loss function, and when the first loss value is less than a second loss value obtained when training the first local model in the previous round, update the second parameter of the current round according to the second parameter determined by the edge device in the previous round and the first parameter;

[0029] According to the second parameter of the current round, the first local model data is obtained and uploaded to the cloud server, and waits for receiving the second cloud model sent by the cloud server in the next round.

[0030] Compared with the prior art, the embodiments of the present application have the following beneficial effects: when the edge device trains the local model, if the performance of the local model is improved, by combining the parameters of the current round with the previous round, the model parameters subsequently uploaded to the cloud server are smoother, thereby reducing the volatility of the cloud model and improving the generalization ability of the subsequent cloud model; in addition, by generating the local model data locally on the edge device, it is equivalent to generating different local model data in parallel at the same time, thereby reducing the amount of data calculation for the subsequent cloud server and improving the efficiency of the cloud server in aggregating the local model.

[0031] In some embodiments of the second aspect of the present application, updating the second parameter of the current round according to the second parameter determined by the edge device in the previous round and the first parameter includes:

[0032]

[0033] in, The second parameter obtained by the kth group of edge devices in the current round; The second parameter obtained by the kth group of edge devices in the previous round; is the first parameter obtained by the kth group of edge devices in the current round; b is the smoothing parameter.

[0034] Compared with the prior art, the above embodiment has the following beneficial effects: when the edge device completes training of the local model, the first parameter of the local model after being updated under the current edge device can be obtained. At this time, the parameter is obtained by introducing local data features with small batches and low sample diversity. If the first parameter obtained at this time is directly used as the parameter of the subsequent aggregated cloud model, the stability of the cloud model will be reduced. Therefore, by weighted smoothing with the second parameter obtained by the edge model in the previous round, the stability of the subsequent cloud model can be improved.

[0035] In some embodiments of the second aspect of the present application, when the first loss value is not less than the second loss value obtained when training the first local model in the previous round, the parameters of the second cloud model sent by the cloud server in the current round are used as the second parameters.

[0036] Compared with the prior art, the above embodiment has the following beneficial effects: when the training effect of the local model in this round is worse than that in the previous round, it means that the first parameter obtained at this time cannot be used for the subsequent acquisition of the second parameter. Therefore, the parameter of the second cloud model of the local model initialized this time is used as the second parameter for updating the second parameter in the next round, so as to avoid affecting the update stability of the cloud model in subsequent rounds when the training effect of the edge device in the current round is poor.

[0037] In some embodiments of the second aspect of the present application, collecting and preprocessing the first sample data in the corresponding environment to obtain the first training data includes:

[0038] Aligning the format and features of the first sample data to obtain second sample data;

[0039] Performing anomaly detection on the second sample data through the experimental sandbox, isolating the detected abnormal data, and obtaining third sample data;

[0040] The third sample data is screened through similarity analysis to obtain the first training data.

[0041] Compared with the prior art, the above embodiment has the following beneficial effects: through the experimental sandbox, the collected sample data is preliminarily screened, and invalid data that does not meet the requirements is excluded, thereby ensuring the quality of the data involved in the training, effectively improving the effectiveness of local model training, and improving the stability of the cloud model. At the same time, it can quickly locate the source of abnormal data and improve the efficiency of solving faulty equipment.

[0042] In a third aspect, an embodiment of the present application also provides a cloud model iteration update device based on federated learning, which is applied to a cloud server, including: a first data receiving module, a first cloud model acquisition module, a second cloud model acquisition module and a first data sending module;

[0043] The first data receiving module is used to receive the first local model data uploaded by each first edge device that sends a data upload request in the current round; wherein the first local model data includes: a first local model and corresponding first training parameter data;

[0044] The first cloud model acquisition module is used to evaluate the performance of each of the first local models according to a preset loss function, and select the first local model with the best performance as the first cloud model;

[0045] The second cloud model acquisition module is used to update the parameters of the first cloud model according to all the first training parameter data to obtain a second cloud model;

[0046] The first data sending module is used to send the second cloud model to all edge devices and wait for receiving the first local model data sent by each of the first edge devices in the next round.

[0047] In some embodiments of the third aspect of the present application, the second cloud model acquisition module is used to update the parameters of the first cloud model according to all the first training parameter data, including:

[0048] The first training parameter data includes: the first training round, the first parameter update amount, and the first learning rate corresponding to the first local model when the first edge device communicates with the cloud server in this round;

[0049] Obtaining a first weight corresponding to the first local model according to the first training round and the first learning rate;

[0050] The parameters of the first cloud model are updated according to the first weight and the first parameter update amount.

[0051] In some embodiments of the third aspect of the present application, acquiring a first weight corresponding to the first local model according to the first training round and the first learning rate includes:

[0052]

[0053] Among them, γ k is the first weight of the first local model corresponding to the first edge device of the current kth group; η k is the first learning rate corresponding to the first edge device of the kth group in the current round; η k,t is the learning rate of the first edge device in the kth group during the tth round of training; T k It is the first training round of the first edge device in the kth group.

[0054] In some embodiments of the third aspect of the present application, updating the parameters of the first cloud model according to the first weight and the first parameter update amount includes:

[0055]

[0056] Among them, θ t+1 is the parameter of the second cloud model; θ t is the parameter of the first cloud model; N is the total number of edge devices that send the first training parameter data; γ k is the first weight of the first local model corresponding to the first edge device of the current k-th group; Δk is the first parameter update amount of the first local model corresponding to the first edge device of the k-th group.

[0057] In a fourth aspect, an embodiment of the present application also provides a cloud-based model iterative update device based on federated learning, which is applied to an edge device, including: a second data receiving module, a first parameter acquisition module, a second parameter acquisition module, and a second data sending module;

[0058] The second data receiving module is used to receive the second cloud model sent by the cloud server in the current round, and initialize the first local model according to the second cloud model:

[0059] The first parameter acquisition module is used to collect and preprocess first sample data in a corresponding environment to obtain first training data, and train the first local model several times in combination with the first training data to obtain first parameters;

[0060] The second parameter acquisition module is used to calculate a first loss value according to a preset loss function, and when the first loss value is less than a second loss value obtained when training the first local model in the previous round, the second parameter of the current round is updated according to the second parameter determined by the edge device in the previous round and the first parameter;

[0061] The second data sending module is used to obtain and upload the first local model data to the cloud server according to the second parameter of the current round, and wait for receiving the second cloud model sent by the cloud server in the next round.

[0062] In some embodiments of the fourth aspect of the present application, the second parameter acquisition module is used to update the second parameter of the current round according to the second parameter determined by the edge device in the previous round and the first parameter, including:

[0063]

[0064] in, The second parameter obtained by the kth group of edge devices in the current round; The second parameter obtained by the kth group of edge devices in the previous round; is the first parameter obtained by the kth group of edge devices in the current round; b is the smoothing parameter.

[0065] In some embodiments of the fourth aspect of the present application, the second parameter acquisition module is also used to use the parameters of the second cloud model sent by the cloud server in the current round as the second parameters when the first loss value is not less than the second loss value obtained when training the first local model in the previous round.

[0066] In some embodiments of the fourth aspect of the present application, the first parameter acquisition module is used to collect and preprocess the first sample data in the corresponding environment to obtain the first training data, including:

[0067] Aligning the format and features of the first sample data to obtain second sample data;

[0068] Performing anomaly detection on the second sample data through the experimental sandbox, isolating the detected abnormal data, and obtaining third sample data;

[0069] The third sample data is screened through similarity analysis to obtain the first training data. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 A flowchart of a cloud model iterative update method based on federated learning applied to a cloud server provided in some embodiments of the present application;

[0071] Figure 2 A flowchart of a method for iteratively updating a cloud model based on federated learning and applied to an edge device provided in some embodiments of the present application;

[0072] Figure 3 A schematic diagram of the structure of a cloud model iterative update device based on federated learning applied to a cloud server provided in some embodiments of the present application;

[0073] Figure 4 This is a structural diagram of a cloud-based model iterative update device based on federated learning applied to an edge device provided in some embodiments of the present application. DETAILED DESCRIPTION

[0074] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0075] Embodiment 1

[0076] Please refer to Figure 1 , a cloud model iterative update method based on federated learning applied to a cloud server provided in an embodiment of the present application, including S10 to S40, specifically:

[0077] S10: Receive the first local model data uploaded by each first edge device that sends a data upload request in the current round; wherein the first local model data includes: a first local model and corresponding first training parameter data.

[0078] S20: Evaluate the performance of each of the first local models according to a preset loss function, and select the first local model with the best performance as the first cloud model.

[0079] Preferably, in some embodiments of the present application, the final loss value of the first local model at the end of the current round of training can also be uploaded directly to the cloud server through the edge server, so that the cloud server can directly evaluate the first local model as the first cloud model based on the obtained final loss value, thereby improving the data processing efficiency of the cloud server.

[0080] S30: Update the parameters of the first cloud model according to all the first training parameter data to obtain a second cloud model.

[0081] Furthermore, in some embodiments of the present application, updating the parameters of the first cloud model according to all the first training parameter data includes:

[0082] The first training parameter data includes: the first training round, the first parameter update amount, and the first learning rate corresponding to the first local model when the first edge device communicates with the cloud server in this round;

[0083] Obtaining a first weight corresponding to the first local model according to the first training round and the first learning rate;

[0084] The parameters of the first cloud model are updated according to the first weight and the first parameter update amount.

[0085] Due to the different performances of different edge devices and the different data they process, there will be different training situations during the training process. Through the training rounds and the learning rate set in each round of training, the corresponding weights can be set for the parameter update amount corresponding to the local model uploaded by each edge device. This can accurately evaluate the impact of the training effect of each edge device on the update of the cloud model parameters and improve the generalization of the cloud model.

[0086] Preferably, in some embodiments of the present application, the first weight may be determined by the following preferred implementations:

[0087]

[0088] Among them, γ k is the first weight of the first local model corresponding to the first edge device of the current kth group; η k is the first learning rate corresponding to the first edge device of the kth group in the current round; η k,t is the learning rate of the first edge device in the kth group during the tth round of training; T k It is the first training round of the first edge device in the kth group.

[0089] By averaging the learning rates of all rounds and dividing the average by the learning rate of this round to obtain the weight, we can accurately evaluate the total impact of each round of model update on the cloud model parameters from the beginning to the present. As the number of training rounds increases, this process can be seen as an iterative evaluation process of the update amount, thereby improving the accuracy of subsequent cloud models.

[0090] Preferably, after the first weight is determined, the parameters of the first cloud model may be updated by the following preferred implementation to obtain the parameters of the second cloud model:

[0091]

[0092] Among them, θ t+1 is the parameter of the second cloud model; θ t is the parameter of the first cloud model; N is the total number of edge devices that send the first training parameter data; γ k is the first weight of the first local model corresponding to the first edge device of the current k-th group; Δk is the first parameter update amount of the first local model corresponding to the first edge device of the k-th group.

[0093] When obtaining the parameters of the second cloud model here, it is not based on the parameters of the second cloud model obtained from the cloud server in the previous round, but directly uses the local model with the best performance obtained from the edge server in this round as the first cloud model for obtaining the second cloud model. This not only ensures the real-time performance of the cloud model update, but also improves the accuracy of the cloud model.

[0094] S40: Send the second cloud model to all edge devices, and wait to receive the first local model data sent by each of the first edge devices in the next round.

[0095] In summary, the cloud model iterative update method based on federated learning applied to a cloud server provided in an embodiment of the present application has the following beneficial effects: in order to ensure that the local model of the edge device in each hospital is a synchronized image recognition model, by receiving the local model of each edge device and the training parameter data of the corresponding local model, the training status of the corresponding local model can be obtained, so that the cloud server comprehensively considers the way of aggregating each local model of the remote model according to the training status of different models, expands the influence of the local model with better training effect on the cloud model update, thereby improving the accuracy of the cloud model, and feeds back the cloud model with higher accuracy to the edge server, and finally always keeps the accuracy of the local model in each edge device to meet the surgical requirements; in addition, since a single edge device requires a large amount of data for training in order to improve the accuracy of the local model, it cannot meet the real-time requirements of the surgery. Through the synchronous distributed training of multiple edge devices, the computing pressure of a single edge device when training the local model is reduced, and the accuracy of the local model is also guaranteed while ensuring the real-time requirements.

[0096] Embodiment 2

[0097] Please refer to Figure 2 , a cloud model iterative update method based on federated learning applied to an edge device provided in an embodiment of the present application, including S50 to S80, specifically:

[0098] S50: Receive a second cloud model sent by the cloud server in the current round, and initialize the first local model according to the second cloud model.

[0099] For example, in some embodiments of the present application, different edge devices are devices corresponding to different hospitals, and different edge devices do not directly communicate data with each other.

[0100] S60: Collect and preprocess first sample data in a corresponding environment to obtain first training data, and train the first local model several times in combination with the first training data to obtain first parameters.

[0101] Further, in some embodiments of the present application, the collecting and preprocessing the first sample data in the corresponding environment to obtain the first training data includes:

[0102] Aligning the format and features of the first sample data to obtain second sample data;

[0103] Performing anomaly detection on the second sample data through the experimental sandbox, isolating the detected abnormal data, and obtaining third sample data;

[0104] The third sample data is screened through similarity analysis to obtain the first training data.

[0105] Through the experimental sandbox, the collected sample data is preliminarily screened to exclude invalid data that does not meet the requirements, ensure the quality of the data involved in training, effectively improve the effectiveness of local model training, and improve the stability of the cloud model. At the same time, it can quickly locate the source of abnormal data and improve the efficiency of solving faulty equipment.

[0106] Preferably, in some embodiments of the present application, the second sample data can be obtained by the following preferred implementation method: by manually labeling or combining image recognition technology, the labels, locations and backgrounds of different image data generated by different fundus surgical instruments or fundus injection environments are aligned to obtain the second sample data.

[0107] Preferably, in some embodiments of the present application, the third sample data can be obtained through the following preferred implementation methods: first, perform anomaly detection on the sample data; isolate the data determined to be abnormal into a sandbox, and further judge and screen the abnormal data through the judgment logic in the sandbox, such as manually setting abnormal values, detecting the standard deviation deviation of the data, and performing logical identification of null values ​​and illegal characters; release the isolation operation of the data determined to be valid, and generate the third sample data thereby.

[0108] Preferably, in some embodiments of the present application, similarity analysis can be performed through the following preferred implementation: respectively counting the mean, variance, standard deviation, conventional statistical data of the category, and correlation analysis data between classes of the third sample data, and eliminating data in the third sample data that are obviously different from the above statistical data, thereby obtaining the first training data.

[0109] S70: Calculate a first loss value according to a preset loss function. When the first loss value is less than a second loss value obtained when training the first local model in the previous round, update the second parameter of the current round according to the second parameter determined by the edge device in the previous round and the first parameter.

[0110] Preferably, in some embodiments of the present application, the second parameter of the current round can be updated by the following preferred implementation:

[0111]

[0112] in, The second parameter obtained by the kth group of edge devices in the current round; The second parameter obtained by the kth group of edge devices in the previous round; is the first parameter obtained by the kth group of edge devices in the current round; b is the smoothing parameter.

[0113] Preferably, in some embodiments of the present application, parameter b is a real number in the range of [0, 1], which is used to control the weighted ratio of the first parameter after the first local model training in the current round is completed and the second parameter used to obtain the first local model data in the previous round. It should be noted here that the second parameter is actually and Therefore, it can be known that the second parameter used to obtain the first local model data in the previous round is not the same as the parameter after the first local model is trained in the previous round.

[0114] When the edge device completes training of the local model, it can obtain the first parameter of the local model after being updated under the current edge device. At this time, the parameter is obtained by introducing local data features with small batches and low sample diversity. If the first parameter obtained at this time is directly used as the parameter of the subsequent aggregated cloud model, the stability of the cloud model will be reduced. Therefore, by weighted smoothing with the second parameter obtained by the edge model in the previous round, the stability of the subsequent cloud model can be improved.

[0115] Preferably, in some embodiments of the present application, when the first loss value is less than the second loss value obtained in the previous round of training the first local model, the current second loss value is assigned to the first loss value to facilitate the next round of cloud server updating the second parameter.

[0116] Preferably, in some embodiments of the present application, the first parameter may be the first parameter corresponding to the optimal loss value of a training result after the first local model has been repeatedly trained for several times.

[0117] Furthermore, in some embodiments of the present application, when the first loss value is not less than the second loss value obtained when training the first local model in the previous round, the parameters of the second cloud model sent by the cloud server in the current round are used as the second parameters.

[0118] When the training effect of the local model in this round is worse than that of the previous round, it means that the first parameter obtained at this time cannot be used to obtain the second parameter subsequently. Therefore, the parameter of the second cloud model of the local model initialized this time is used as the second parameter for updating the second parameter in the next round to avoid affecting the update stability of the cloud model in subsequent rounds when the training effect of the edge device in the current round is poor.

[0119] S80: According to the second parameter of the current round, obtain and upload the first local model data to the cloud server, and wait to receive the second cloud model sent by the cloud server in the next round.

[0120] Preferably, in some embodiments of the present application, the first local model data may also include: the second parameter obtained in this round The third loss value corresponding to the first local model, or the final loss value corresponding to the end of the first local model training in this round, that is, the second loss value.

[0121] In summary, the cloud model iterative update method based on federated learning applied to edge devices provided in the embodiment of the present application has the following beneficial effects: when the edge device trains the local model, if the performance of the local model is improved, by combining the parameters of the current round with the previous round, the model parameters subsequently uploaded to the cloud server are smoother, thereby reducing the volatility of the cloud model and improving the generalization ability of the subsequent cloud model; in addition, by generating the local model data locally on the edge device, it is equivalent to generating different local model data in parallel and at the same time, thereby reducing the amount of data calculation on the subsequent cloud server and improving the efficiency of the cloud server in aggregating local models.

[0122] Embodiment 3

[0123] refer to Figure 3 , a cloud model iterative update device based on federated learning applied to a cloud server provided in an embodiment of the present application, includes: a first data receiving module 11, a first cloud model acquisition module 12, a second cloud model acquisition module 13 and a first data sending module 14.

[0124] In some embodiments of the present application, the first data receiving module 11 is used to receive the first local model data uploaded by each first edge device that sends a data upload request in the current round; wherein the first local model data includes: a first local model and corresponding first training parameter data; the first cloud model acquisition module 12 is used to evaluate the performance of each of the first local models according to a preset loss function, and select the first local model with the best performance as the first cloud model; the second cloud model acquisition module 13 is used to update the parameters of the first cloud model according to all the first training parameter data, and obtain the second cloud model; the first data sending module 14 is used to send the second cloud model to all edge devices, and wait to receive the first local model data sent by each of the first edge devices in the next round.

[0125] In some embodiments of the present application, the second cloud model acquisition module 13 is used to update the parameters of the first cloud model according to all the first training parameter data, including: wherein the first training parameter data includes: the first training round, the first parameter update amount and the first learning rate corresponding to the first local model when the first edge device communicates with the cloud server in this round; according to the first training round and the first learning rate, obtaining the first weight corresponding to the first local model; according to the first weight and the first parameter update amount, updating the parameters of the first cloud model.

[0126] In some embodiments of the present application, obtaining a first weight corresponding to the first local model according to the first training round and the first learning rate includes:

[0127]

[0128] Among them, γ k is the first weight of the first local model corresponding to the first edge device of the current kth group; η k is the first learning rate corresponding to the first edge device of the kth group in the current round; η k,t is the learning rate of the first edge device in the kth group during the tth round of training; T k It is the first training round of the first edge device in the kth group.

[0129] In some embodiments of the present application, updating the parameters of the first cloud model according to the first weight and the first parameter update amount includes:

[0130]

[0131] Among them, θ t+1 is the parameter of the second cloud model; θ t is the parameter of the first cloud model; N is the total number of edge devices that send the first training parameter data; γ k is the first weight of the first local model corresponding to the first edge device of the current k-th group; Δk is the first parameter update amount of the first local model corresponding to the first edge device of the k-th group.

[0132] In summary, the cloud model iterative update device based on federated learning applied to a cloud server provided in an embodiment of the present application has the following beneficial effects: in order to ensure that the local model of the edge device in each hospital is a synchronized image recognition model, by receiving the local model of each edge device and the training parameter data of the corresponding local model, the training status of the corresponding local model can be obtained, so that the cloud server comprehensively considers the way of aggregating each local model of the remote model according to the training status of different models, expands the influence of the local model with better training effect on the cloud model update, thereby improving the accuracy of the cloud model, and feeds back the cloud model with higher accuracy to the edge server, and finally always keeps the accuracy of the local model in each edge device to meet the surgical requirements; in addition, since a single edge device requires a large amount of data for training in order to improve the accuracy of the local model, it cannot meet the real-time requirements of the surgery. Through the synchronous distributed training of multiple edge devices, the computing pressure of a single edge device when training the local model is reduced, and the accuracy of the local model is also guaranteed while ensuring the real-time requirements.

[0133] Embodiment 4

[0134] refer to Figure 4 , a cloud-based model iterative update device based on federated learning applied to an edge device provided in an embodiment of the present application, includes: a second data receiving module 15, a first parameter acquisition module 16, a second parameter acquisition module 17 and a second data sending module 18.

[0135] In some embodiments of the present application, the second data receiving module 15 is used to receive the second cloud model sent by the cloud server in the current round, and initialize the first local model according to the second cloud model: the first parameter acquisition module 16 is used to collect and preprocess the first sample data in the corresponding environment, obtain the first training data, and train the first local model several times in combination with the first training data to obtain the first parameter; the second parameter acquisition module 17 is used to calculate the first loss value according to a preset loss function, and when the first loss value is less than the second loss value obtained when training the first local model in the previous round, the second parameter of the current round is updated according to the second parameter determined by the edge device in the previous round and the first parameter; the second data sending module 18 is used to obtain and upload the first local model data to the cloud server according to the second parameter of the current round, and wait to receive the second cloud model sent by the cloud server in the next round.

[0136] In some embodiments of the present application, the second parameter acquisition module 17 is used to update the second parameter of the current round according to the second parameter determined by the edge device in the previous round and the first parameter, including:

[0137]

[0138] in, The second parameter obtained by the kth group of edge devices in the current round; The second parameter obtained by the kth group of edge devices in the previous round; is the first parameter obtained by the kth group of edge devices in the current round; b is the smoothing parameter.

[0139] In some embodiments of the present application, the second parameter acquisition module 17 is also used to use the parameters of the second cloud model sent by the cloud server in the current round as the second parameters when the first loss value is not less than the second loss value obtained when training the first local model in the previous round.

[0140] In some embodiments of the present application, the first parameter acquisition module 16 is used to collect and preprocess the first sample data in the corresponding environment to obtain the first training data, including: aligning the format and features of the first sample data to obtain the second sample data; performing anomaly detection on the second sample data through an experimental sandbox, isolating the detected anomaly data, and obtaining the third sample data; screening the third sample data through similarity analysis to obtain the first training data.

[0141] In summary, the cloud model iterative update device based on federated learning applied to edge devices provided in the embodiment of the present application has the following beneficial effects: when the edge device trains the local model, if the performance of the local model is improved, by combining the parameters of the current round with the previous round, the model parameters subsequently uploaded to the cloud server are smoother, thereby reducing the volatility of the cloud model and improving the generalization ability of the subsequent cloud model; in addition, by generating the local model data locally on the edge device, it is equivalent to generating different local model data in parallel at the same time, thereby reducing the amount of data calculation on the subsequent cloud server and improving the efficiency of the cloud server in aggregating local models.

[0142] Embodiment 5

[0143] Based on the above-mentioned embodiment of the cloud-based model iterative update method based on federated learning, another embodiment of the present application provides a cloud-based model iterative update terminal device based on federated learning. The cloud-based model iterative update terminal device based on federated learning includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the cloud-based model iterative update method based on federated learning of any embodiment of the present application is implemented.

[0144] Exemplarily, in this embodiment, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the cloud-based model iterative update device based on federated learning.

[0145] The cloud-based model iteration and update device based on federated learning can be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The cloud-based model iteration and update terminal device based on federated learning can include, but is not limited to, a processor and a memory.

[0146] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the cloud-based model iteration update device based on federated learning, and uses various interfaces and lines to connect the various parts of the entire cloud-based model iteration update device based on federated learning. The memory may be used to store the computer program and / or module, and the processor implements various functions of the cloud-based model iteration update device based on federated learning by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the mobile phone, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMed i aCard, SMC), a secure digital (SecureDi gita l, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0147] Embodiment 6

[0148] Based on the above-mentioned embodiments of the cloud-based model iterative update method based on federated learning, another embodiment of the present application provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the cloud-based model iterative update method based on federated learning of any embodiment of the present application.

[0149] In this embodiment, the storage medium is a computer-readable storage medium, and the computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0150] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims

1. A cloud model iterative update method based on federated learning, characterized in that: Applied to cloud servers, including: Receive first local model data uploaded by each first edge device that sends a data upload request in the current round; wherein the first local model data includes: a first local model and corresponding first training parameter data; According to a preset loss function, the performance of each of the first local models is evaluated, and the first local model with the best performance is selected as the first cloud model; According to all the first training parameter data, update the parameters of the first cloud model to obtain a second cloud model; The second cloud model is sent to all edge devices, and the first local model data sent by each of the first edge devices is received in the next round.

2. A cloud model iterative updating method based on federated learning as claimed in claim 1, characterized in that: updating the parameters of the first cloud model according to all the first training parameter data, include: The first training parameter data includes: the first training round, the first parameter update amount, and the first learning rate corresponding to the first local model when the first edge device communicates with the cloud server in this round; Obtaining a first weight corresponding to the first local model according to the first training round and the first learning rate; The parameters of the first cloud model are updated according to the first weight and the first parameter update amount.

3. A cloud model iterative updating method based on federated learning as claimed in claim 2, characterized in that: The obtaining, according to the first training round and the first learning rate, a first weight corresponding to the first local model includes: Among them, γ k is the first weight of the first local model corresponding to the first edge device of the current kth group; η k is the first learning rate corresponding to the first edge device of the kth group in the current round; η k,t is the learning rate of the first edge device in the kth group during the tth round of training; T k It is the first training round of the first edge device in the kth group.

4. The cloud model iterative updating method based on federated learning as claimed in claim 2, characterized in that: The updating of the parameters of the first cloud model according to the first weight and the first parameter update amount includes: Among them, θ t+1 is the parameter of the second cloud model; θ t is the parameter of the first cloud model; N is the total number of edge devices that send the first training parameter data; γ k is the first weight of the first local model corresponding to the first edge device of the current k-th group; Δk is the first parameter update amount of the first local model corresponding to the first edge device of the k-th group.

5. A cloud model iterative update method based on federated learning, characterized in that: Applied to edge devices, including: Receive the second cloud model sent by the cloud server in the current round, and initialize the first local model according to the second cloud model: Collect and preprocess first sample data in a corresponding environment to obtain first training data, and train the first local model several times in combination with the first training data to obtain first parameters; Calculate a first loss value according to a preset loss function, and when the first loss value is less than a second loss value obtained when training the first local model in the previous round, update the second parameter of the current round according to the second parameter determined by the edge device in the previous round and the first parameter; According to the second parameter of the current round, the first local model data is obtained and uploaded to the cloud server, and waits for receiving the second cloud model sent by the cloud server in the next round.

6. A cloud model iterative updating method based on federated learning as claimed in claim 5, characterized in that: The updating of the second parameter of the current round according to the second parameter determined by the edge device in the previous round and the first parameter includes: in, The second parameter obtained by the kth group of edge devices in the current round; The second parameter obtained by the kth group of edge devices in the previous round; is the first parameter obtained by the kth group of edge devices in the current round; b is the smoothing parameter.

7. A cloud model iterative updating method based on federated learning as claimed in claim 5, characterized in that: When the first loss value is not less than the second loss value obtained when training the first local model in the previous round, the parameters of the second cloud model sent by the cloud server in the current round are used as the second parameters.

8. A cloud model iterative updating method based on federated learning as claimed in claim 5, characterized in that: The collecting and preprocessing of first sample data in a corresponding environment to obtain first training data includes: Aligning the format and features of the first sample data to obtain second sample data; Performing anomaly detection on the second sample data through the experimental sandbox, isolating the detected abnormal data, and obtaining third sample data; The third sample data is screened through similarity analysis to obtain the first training data.

9. A cloud-based model iterative update device based on federated learning, characterized in that: Applied to a cloud server, comprising: a first data receiving module, a first cloud model acquisition module, a second cloud model acquisition module and a first data sending module; The first data receiving module is used to receive the first local model data uploaded by each first edge device that sends a data upload request in the current round; wherein the first local model data includes: a first local model and corresponding first training parameter data; The first cloud model acquisition module is used to evaluate the performance of each of the first local models according to a preset loss function, and select the first local model with the best performance as the first cloud model; The second cloud model acquisition module is used to update the parameters of the first cloud model according to all the first training parameter data to obtain a second cloud model; The first data sending module is used to send the second cloud model to all edge devices and wait for receiving the first local model data sent by each of the first edge devices in the next round.

10. A cloud-based model iterative updating device based on federated learning as claimed in claim 9, characterized in that: The second cloud model acquisition module is used to update the parameters of the first cloud model according to all the first training parameter data. include: The first training parameter data includes: the first training round, the first parameter update amount, and the first learning rate corresponding to the first local model when the first edge device communicates with the cloud server in this round; Obtaining a first weight corresponding to the first local model according to the first training round and the first learning rate; The parameters of the first cloud model are updated according to the first weight and the first parameter update amount.

11. A cloud-based model iterative updating device based on federated learning as claimed in claim 10, characterized in that: The obtaining, according to the first training round and the first learning rate, a first weight corresponding to the first local model includes: Among them, γ k is the first weight of the first local model corresponding to the first edge device of the current kth group; η k is the first learning rate corresponding to the first edge device of the kth group in the current round; η k,t is the learning rate of the first edge device in the kth group during the tth round of training; T k It is the first training round of the first edge device in the kth group.

12. A cloud-based model iterative updating device based on federated learning as claimed in claim 10, characterized in that: The updating of the parameters of the first cloud model according to the first weight and the first parameter update amount includes: Among them, θ t+1 is the parameter of the second cloud model; θ t is the parameter of the first cloud model; N is the total number of edge devices that send the first training parameter data; γ k is the first weight of the first local model corresponding to the first edge device of the current k-th group; Δk is the first parameter update amount of the first local model corresponding to the first edge device of the k-th group.

13. A cloud-based model iterative update device based on federated learning, characterized in that: Applied to edge devices, comprising: a second data receiving module, a first parameter acquiring module, a second parameter acquiring module and a second data sending module; The second data receiving module is used to receive the second cloud model sent by the cloud server in the current round, and initialize the first local model according to the second cloud model: The first parameter acquisition module is used to collect and preprocess the first sample data in the corresponding environment, obtain the first training data, and train the first local model several times in combination with the first training data to obtain the first parameter; The second parameter acquisition module is used to calculate a first loss value according to a preset loss function, and when the first loss value is less than a second loss value obtained when training the first local model in the previous round, the second parameter of the current round is updated according to the second parameter determined by the edge device in the previous round and the first parameter; The second data sending module is used to obtain and upload the first local model data to the cloud server according to the second parameter of the current round, and wait for receiving the second cloud model sent by the cloud server in the next round.

14. A cloud-based model iterative updating device based on federated learning as claimed in claim 13, characterized in that: The second parameter acquisition module is used to update the second parameter of the current round according to the second parameter determined by the edge device in the previous round and the first parameter, including: in, The second parameter obtained by the kth group of edge devices in the current round; The second parameter obtained by the kth group of edge devices in the previous round; is the first parameter obtained by the kth group of edge devices in the current round; b is the smoothing parameter.

15. The cloud-based model iterative updating device based on federated learning according to claim 13, characterized in that: The second parameter acquisition module is also used to use the parameters of the second cloud model sent by the cloud server in the current round as the second parameters when the first loss value is not less than the second loss value obtained when training the first local model in the previous round.

16. A cloud-based model iterative updating device based on federated learning as claimed in claim 13, characterized in that: The first parameter acquisition module is used to collect and preprocess the first sample data in the corresponding environment to obtain the first training data, including: Aligning the format and features of the first sample data to obtain second sample data; Performing anomaly detection on the second sample data through the experimental sandbox, isolating the detected abnormal data, and obtaining third sample data; The third sample data is screened through similarity analysis to obtain the first training data.