The invention belongs to the technical field of distributed
machine learning, and discloses a hierarchical compression
federated learning method and device based on self-adaption and a medium, and the method comprises the steps that a
server side selects a
client based on a dynamically calculated
client participation rate and sparse rate and distributes
global model parameters; after local training, the
client calculates gradient change, sequentially performs layering, dynamic sparsification and sparse threshold recording, ternary quantization and 1-bit
compressed sensing processing, and uploads an obtained compression value, a sparse threshold and training loss to the
server; after the
server side receives data, on one hand, the participation rate and the sparse rate of the next round are calculated and updated through a self-adaptive participation rate
algorithm and a dynamic sparse rate
algorithm based on training losses uploaded by all the client sides, and on the other hand, the received compression parameters are subjected to reconstruction and weighted aggregation to update a
global model. According to the method, the communication overhead is remarkably reduced, and meanwhile, the model performance almost the same as that of a lossless transmission scheme is kept.