The invention relates to a
federated learning algorithm for bearing fault diagnosis, which is characterized in that the
algorithm runs on a plurality of local nodes and an aggregation node, and comprises the following steps of: 1, converging data of a sensor network by each local node, the data of the sensor are preprocessed in a time-sharing, partitioning, sampling and normalizing manner; 2, training the preprocessed data by adopting a
convolutional neural network model; 3, after training is completed, whether the aggregation condition is met or not is judged according to the improved aggregation strategy, and if yes, the round of training is ended; then, calculating an F1
score of the local model; finally, performing
homomorphic encryption on the
model parameters, the F1
score and the total number of samples, and sending to an aggregation node; and 4, after receiving the information sent by all the local nodes, the aggregation node decrypts the information, then weights and aggregates all the local models according to an F1
score weighting strategy to obtain a new initial model, and sends the new initial model to the local nodes.