Search

CN-122020483-A - Federal learning anomaly detection method and device based on adaptive communication optimization strategy

CN122020483ACN 122020483 ACN122020483 ACN 122020483ACN-122020483-A

Abstract

The invention discloses a federal learning anomaly detection method and device based on a self-adaptive communication optimization strategy, which belong to the technical field of federal learning, and comprise the steps of recompiling a global model by a server, setting super parameters required by federal learning training, setting a piecewise function, and confirming the number of clients participating in training Calculating real-time contribution degree of the client from three dimensions of data contribution amount, response rate and model accuracy contribution, calculating actual total contribution degree by combining historical contribution degree, and finally selecting the contribution with the largest contribution The method comprises the steps of enabling a client to participate in training, enabling a selected client to receive global model parameters issued by a server to conduct local model training, then sending the local model parameters back to the server, enabling the local model parameters aggregated by the server to update a global model, enabling the server to judge whether a current global model reaches a convergence condition or reaches an iteration upper limit T, completing global model training, and utilizing the trained global model to conduct anomaly detection.

Inventors

  • XU JIAN
  • LI ZENING
  • REN YI
  • YANG GENG

Assignees

  • 南京邮电大学

Dates

Publication Date
20260512
Application Date
20260208

Claims (10)

  1. 1. The federal learning anomaly detection method based on the adaptive communication optimization strategy is characterized by comprising the following steps of: s1, a server recompiles the global model and sets super parameters required by federal learning training; S2, setting a piecewise function based on super parameters required by federal learning training and the current iteration times t, and confirming the number of clients participating in training ; S3, calculating real-time contribution degree of the client from three dimensions of data contribution amount, response speed and model accuracy contribution according to information collected from the client, calculating actual total contribution degree by combining historical contribution degree of the client, and finally sorting all clients according to the actual total contribution degree to select the most contribution Large individual clients participate in training; s4, the selected client receives global model parameters issued by the server, local model training is carried out by utilizing respective local data sets, and the selected client local model parameters are sent back to the server after training is completed; s5, the server aggregates local model parameters and updates the global model, the server judges whether the current global model reaches a convergence condition or reaches an iteration upper limit T, if not, the S2 is returned, if so, the training is ended, and the trained global model is output; S6, performing anomaly detection by using the trained global model.
  2. 2. The method for detecting federal learning anomaly based on an adaptive communication optimization strategy according to claim 1, wherein the super-parameters required for federal learning training include an upper limit of the number of iterations, an initial training threshold, a period of reduced number of clients, and a lower limit of the number of clients participating in training.
  3. 3. The adaptive communication optimization strategy-based federal learning anomaly detection method of claim 1, wherein the piecewise function is: Wherein, the Representing the number of clients participating in the training, K is the total number of clients, For a set initial training threshold, all clients participate in model training before reaching the threshold, For periods of reduced number of clients, i.e. per pass The number of clients is reduced by 1 in the round, Is a lower limit on the number of clients participating in the training.
  4. 4. The federal learning anomaly detection method based on the adaptive communication optimization strategy according to claim 1, wherein the calculation formula of the real-time contribution degree is: Wherein, the Representing the real-time contribution of the kth client in the t-th iteration, wherein alpha, beta and gamma represent the real-time contribution calculated And (2) weight coefficient of ; The data contribution amount is used to calculate the data, Representing model accuracy contributions; Representing the size of the local data set it has, Representing the loss of the client in the previous iteration; representing response rate contribution degree provided by a kth client for the global model in a t-th round of iteration; representing the current delay; representing a historical delay; representing the standard deviation of the response time of the client in the past several rounds; representing the local gradient vector of client k in the t-th round of iteration, Representing the gradient vector of the global model in the t-th iteration.
  5. 5. The method for detecting federal learning anomalies based on adaptive communication optimization strategies according to claim 4, wherein the actual contribution is calculated according to the formula: Wherein, the Representing the actual contribution of the kth client at the t-th round, Representing the historical contribution of the kth client in the previous t-1 round of iterations, A weighting parameter between contributions from the current run and the historical run; to control the super-parameters of the decay rate.
  6. 6. The adaptive communication optimization strategy based federal learning anomaly detection method of claim 1, wherein the anomaly detection process comprises: Preprocessing a data set, including slicing the data set to reserve a characteristic column, normalizing the data set, and reorganizing one-dimensional data into a three-dimensional array suitable for time sequence analysis; And inputting the preprocessed data set into the trained global model for classification detection.
  7. 7. Federal learning anomaly detection device based on an adaptive communication optimization strategy, performing the method of any one of claims 1-6, comprising: the initialization module is used for recompiling the global model by the server and setting super parameters required by federal learning training; The client number confirming module is used for setting a piecewise function based on super parameters required by federal learning training and the current iteration number t to confirm the number of clients participating in training ; The contribution evaluation screening module calculates real-time contribution of the client from three dimensions of data contribution, response speed and model accuracy contribution according to information collected from the client, calculates actual total contribution by combining historical contribution of the client, sorts all clients according to the actual total contribution, and selects the largest contribution The individual clients participate in training; the local model training module is used for receiving global model parameters issued by the server by the selected client, carrying out local model training by utilizing respective local data sets, and sending the selected local model parameters of the client back to the server after the training is finished; the system comprises a global model aggregation module, a server, a client number confirmation module, a global model training module and a global model training module, wherein the global model aggregation module is used for updating local model parameters aggregated by the server; And the abnormality detection module is used for detecting the abnormality by using the trained global model.
  8. 8. A computer storage medium storing a readable program, wherein the program, when executed, is capable of instructing a computing device to execute the federal learning anomaly detection method based on the adaptive communication optimization strategy of any one of claims 1 to 6.
  9. 9. An electronic device is characterized by comprising a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus; The memory is configured to store at least one executable instruction that causes the processor to perform operations corresponding to the federal learning anomaly detection method based on the adaptive communication optimization strategy according to any one of claims 1-6.
  10. 10. A computer program product comprising computer instructions for instructing a computing device to perform operations corresponding to the federal learning anomaly detection method based on an adaptive communication optimization strategy according to any one of claims 1-6.

Description

Federal learning anomaly detection method and device based on adaptive communication optimization strategy Technical Field The invention belongs to the technical field of federal learning, and particularly relates to a federal learning anomaly detection method and device based on a self-adaptive communication optimization strategy. Background In recent years, machine learning has shown a profound potential by virtue of itself in processing massive data, so that it is widely used in society. In order to solve two problems of privacy disclosure and data barriers faced by machine learning in the development process, a federal learning (FEDERATED LEARNING, FL) concept is proposed. The method has the core ideas that distributed global model training is realized through multiple rounds of local training and model aggregation, and meanwhile, the aggregation is transmitted in a gradient parameter mode, so that the protection of the data privacy of the client can be realized to a certain extent. Although federal learning has considerable advantages, two main problems still exist, namely, gradient transmission still faces attack forms such as gradient reverse pushing attack and reconstruction attack, research shows that sensitive information existing in gradient can be acquired through reverse pushing, and in the training process, because a client needs to communicate frequently with a server, the server needs to wait for the clients participating in training to complete training, and two reasons commonly lead to the existence of a large amount of overhead and time delay in the aspect of communication in federal learning. In the federal learning system, a client selection mechanism is a core link for balancing model training efficiency and quality. The traditional method is often based on monotonic evaluation indexes, such as local data volume or client response rate, and neglects deep influences of equipment isomerism, dynamic network environment, historical contribution and the like on global model training. Particularly, in a large-scale collaboration task of cross-equipment and cross-scene, a low-efficiency client selection scheme may cause problems such as slow convergence speed, model performance lag, and contributor exit. Therefore, a set of dynamic evaluation system which combines real-time performance and historical contribution is constructed, and the dynamic evaluation system has important significance for optimizing the FL framework Disclosure of Invention Aiming at the defects of the prior art, the invention aims to provide a federal learning anomaly detection method and a federal learning anomaly detection device based on a self-adaptive communication optimization strategy, which solve the problems in the prior art. The aim of the invention can be achieved by the following technical scheme: the federal learning anomaly detection method based on the adaptive communication optimization strategy comprises the following steps: s1, a server recompiles the global model and sets super parameters required by federal learning training; S2, setting a piecewise function based on super parameters required by federal learning training and the current iteration times t, and confirming the number of clients participating in training ; S3, calculating real-time contribution degree of the client from three dimensions of data contribution amount, response speed and model accuracy contribution according to information collected from the client, calculating actual total contribution degree by combining historical contribution degree of the client, and finally sorting all clients according to the actual total contribution degree to select the most contributionLarge individual clients participate in training; s4, the selected client receives global model parameters issued by the server, local model training is carried out by utilizing respective local data sets, and the selected client local model parameters are sent back to the server after training is completed; s5, the server aggregates local model parameters and updates the global model, the server judges whether the current global model reaches a convergence condition or reaches an iteration upper limit T, if not, the S2 is returned, if so, the training is ended, and the trained global model is output; S6, performing anomaly detection by using the trained global model. Further, the super-parameters required for the federal learning training include an upper limit of iteration times, an initial training threshold, a period of reduced number of clients, and a lower limit of the number of clients participating in the training. Further, the piecewise function is: Wherein, the Representing the number of clients participating in the training, K is the total number of clients,For a set initial training threshold, all clients participate in model training before reaching the threshold,For periods of reduced number of clients, i.e. per passThe number of clients is reduced by 1