CN116719607A - Model updating method and system based on federal learning - Google Patents

Model updating method and system based on federal learning Download PDF

Info

Publication number
CN116719607A
CN116719607A CN202310706337.3A CN202310706337A CN116719607A CN 116719607 A CN116719607 A CN 116719607A CN 202310706337 A CN202310706337 A CN 202310706337A CN 116719607 A CN116719607 A CN 116719607A
Authority
CN
China
Prior art keywords
model
cluster
target
target client
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310706337.3A
Other languages
Chinese (zh)
Inventor
孙玉砚
印君男
孙嘉伟
朱红松
孙利民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute of Information Engineering of CAS
Original Assignee
Institute of Information Engineering of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Institute of Information Engineering of CAS filed Critical Institute of Information Engineering of CAS
Priority to CN202310706337.3A priority Critical patent/CN116719607A/en
Publication of CN116719607A publication Critical patent/CN116719607A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a model updating method and system based on federal learning, wherein the method comprises the following steps: updating clusters to which the target client belongs according to synthetic data of the target client participating in federal learning until the initialized K clusters reach a stable distribution state, and sending a target cluster model in each cluster to the target client, wherein the synthetic data is obtained according to the received data distribution information of the target client, the stable distribution state is that the cluster to which the target client belongs is not changed any more, and the target cluster model is determined according to the cluster model in each cluster in which the initialized K clusters reach the stable distribution state; a first loop process is performed until the candidate models in the target client converge. The invention can fully utilize the data of all clients in the data heterogeneous environment, and provides an optimal personalized model for each client under the conditions of limited network communication resources, limited computing resources and limited storage resources of the clients.

Description

基于联邦学习的模型更新方法及系统Model update method and system based on federated learning

技术领域Technical field

本发明涉及联邦学习技术领域,尤其涉及一种基于联邦学习的模型更新方法及系统。The present invention relates to the technical field of federated learning, and in particular to a model update method and system based on federated learning.

背景技术Background technique

随着边缘设备在现代社会中越来越普遍,分布式私人数据快速增长。这些数据为人工智能应用提供了巨大的机会。然而,这些数据以孤岛的形式存储在终端用户自己的设备中,如手机和个人电脑,大多具有高度敏感性。随着数据隐私保护法的出台,如一般数据保护条例(General Data Protection Regulation,GDPR),人工智能中保护隐私的需求越来越大,所以这些数据通常不会被公开。近年来,人工智能(Artificial Intelligence,AI)仍在快速发展,随之而来的是越来越庞大的AI模型,这些模型对于训练数据量的需求也越来越大。为了在保护数据隐私的前提下利用多个机构或个人的数据,实现信息融合,联邦学习成为一种有效的方法来训练AI模型。这种方法允许在保持数据机密性的同时利用大量数据进行模型训练。As edge devices become more common in modern society, distributed private data is growing rapidly. This data offers huge opportunities for artificial intelligence applications. However, these data are stored in silos on end users’ own devices, such as mobile phones and personal computers, and are mostly highly sensitive. With the introduction of data privacy protection laws, such as the General Data Protection Regulation (GDPR), there is an increasing need to protect privacy in artificial intelligence, so this data is usually not made public. In recent years, Artificial Intelligence (AI) is still developing rapidly, followed by increasingly larger AI models, and these models also require an increasing amount of training data. In order to utilize data from multiple institutions or individuals and achieve information fusion while protecting data privacy, federated learning has become an effective method to train AI models. This approach allows leveraging large amounts of data for model training while maintaining data confidentiality.

联合学习(Federated Learning,FL)是最近几年提出的一种机器学习范式,其采用“客户端-服务器”的架构模式,旨在解决上述问题,图1是现有技术提供的联邦学习的架构示意图,如图1。联邦学习训练模型通过迭代三步直到收敛:(1)服务器通过网络发送全局模型到本轮参与训练的客户端;(2)客户端接收全局模型后,覆盖旧的本地模型,然后结合客户端本地的私有数据进行训练;(3)训练完成后,客户端通过网络上传训练后的本地模型到服务器;服务器收到满足设定个数的客户端上传的训练后的本地模型后执行模型聚合,生成新的全局模型。可以看出,联合学习以保护隐私的方式,促进多个数据仓的客户进行协作训练,在训练过程中,客户的私人数据存储在本地,不直接共享,这样客户可以在保护隐私的同时实现比单独工作更好的性能。Federated Learning (FL) is a machine learning paradigm proposed in recent years. It adopts a "client-server" architecture model and aims to solve the above problems. Figure 1 is the architecture of federated learning provided by existing technology. Schematic diagram, as shown in Figure 1. The federated learning training model iterates through three steps until convergence: (1) The server sends the global model through the network to the clients participating in this round of training; (2) After the client receives the global model, it overwrites the old local model and then combines the client's local Private data for training; (3) After the training is completed, the client uploads the trained local model to the server through the network; the server performs model aggregation after receiving the trained local model uploaded by the client that meets the set number, and generates New global model. It can be seen that federated learning promotes collaborative training among customers in multiple data warehouses in a way that protects privacy. During the training process, customers' private data is stored locally and is not shared directly, so that customers can achieve comparison while protecting privacy. Works alone for better performance.

然而,由于数据源和计算节点是终端用户的个人设备,每个客户都有自己独立的数据,没有独立和识别性分布(Independent and Identically Distributed,IID)的训练数据,即参与训练客户的私人数据可能在规模、分布都不一样,从而导致传统联邦学习所产生的单一的全局模型对于一些客户来说表现并不好,甚至不如简单地使用各自的本地数据(即使它很小)来训练一个本地模型的效果。However, since the data sources and computing nodes are the end-user's personal devices, each customer has his or her own independent data, and there is no Independent and Identically Distributed (IID) training data, that is, the private data of the customers involved in training. The scale and distribution may be different, which leads to the single global model generated by traditional federated learning not performing well for some customers. It is even worse than simply using their own local data (even if it is small) to train a local model. model effect.

个性化联邦学习旨在利用联邦学习过程弥补客户端本地数据量不足的问题,为每个客户端学习一个适用于本地数据集的模型,提高个性化联邦学习模型训练效果。Personalized federated learning aims to use the federated learning process to make up for the problem of insufficient local data on the client, learn a model suitable for local data sets for each client, and improve the training effect of the personalized federated learning model.

在个性化联邦学习领域,一些联合学习方法试图通过在全局模型训练后进行局部微调来解决这个问题,但这一方法的个性化性能依然取决于全局模型的泛化性能,并没有解决本质问题。另一些联合学习算法探索分布式聚类集群技术来更好地模拟非IID数据,使用多次迭代聚类方案,但这一方法对于通信带宽、计算资源有限的客户端很不友好。In the field of personalized federated learning, some federated learning methods try to solve this problem by performing local fine-tuning after the global model is trained. However, the personalized performance of this method still depends on the generalization performance of the global model and does not solve the essential problem. Other federated learning algorithms explore distributed clustering technology to better simulate non-IID data and use multiple iterative clustering schemes, but this method is very unfriendly to clients with limited communication bandwidth and computing resources.

因此,能够充分利用数据异构环境中所有客户的数据,在有限的网络通信资源,客户端的有限计算资源和有限存储资源的情况下,为每一个客户端学习一个最优的个性化模型,达到更高的性能,是联邦学习技术的关键问题之一。Therefore, it is possible to make full use of the data of all customers in a heterogeneous data environment, and learn an optimal personalized model for each client under the condition of limited network communication resources, limited computing resources and limited storage resources of the client, to achieve Higher performance is one of the key issues of federated learning technology.

发明内容Contents of the invention

本发明提供的基于联邦学习的模型更新方法及系统,用于解决现有技术中存在的上述问题。The model update method and system based on federated learning provided by the present invention are used to solve the above problems existing in the existing technology.

本发明提供的一种基于联邦学习的模型更新方法,应用于参与联邦学习的服务器,包括:The invention provides a model update method based on federated learning, which is applied to servers participating in federated learning, including:

根据参与所述联邦学习的目标客户端的合成数据,对所述目标客户端所属集群进行更新,直至初始化的K个集群达到稳定分布状态,并将每个集群内的目标聚类模型发送给所述目标客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标客户端包括N个客户端,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;According to the synthetic data of the target clients participating in the federated learning, the cluster to which the target client belongs is updated until the initialized K clusters reach a stable distribution state, and the target clustering model in each cluster is sent to the Target client, the synthetic data is obtained based on the received data distribution information of the target client, the stable distribution state means that the cluster to which the target client belongs does not change, and the target client includes N clients end, the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state;

执行如下第一循环过程,直至所述目标客户端中的候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;Execute the following first loop process until the candidate model in the target client converges, the candidate model is obtained after the target client updates the received target clustering model in each cluster;

所述第一循环过程,包括:The first cycle process includes:

接收目标客户端发送的候选模型,并对所述候选模型进行更新;Receive the candidate model sent by the target client and update the candidate model;

将更新后的候选模型发送给所述目标客户端,以使所述目标客户端对所述候选模型进行更新。The updated candidate model is sent to the target client, so that the target client updates the candidate model.

根据本发明提供的一种基于联邦学习的模型更新方法,应用于参与联邦学习的服务器,所述根据所述目标客户端的合成数据,对所述目标客户端所属集群进行更新,包括:According to a model update method based on federated learning provided by the present invention, which is applied to servers participating in federated learning, updating the cluster to which the target client belongs based on the synthetic data of the target client includes:

初始化目标客户端所属集群;Initialize the cluster to which the target client belongs;

根据每个集群内的聚类模型的经验损失函数,获取每个客户端的合成数据在每个集群内的聚类模型的经验损失值;According to the empirical loss function of the clustering model in each cluster, obtain the empirical loss value of the clustering model in each cluster for the synthetic data of each client;

根据所述每个客户端的合成数据在每个集群内的聚类模型的经验损失值,对所述目标客户端所属集群进行更新,以确定所述K个集群达到稳定分布状态时,每个集群内包含的客户端,所述每个集群内包含的客户端为所述目标客户端中满足合成数据在每个集群内的聚类模型的经验损失值达到最小值的客户端。According to the empirical loss value of the clustering model of the synthetic data of each client in each cluster, the cluster to which the target client belongs is updated to determine when the K clusters reach a stable distribution state. The clients included in each cluster are the clients among the target clients that satisfy the experience loss value of the clustering model of the synthetic data in each cluster reaching the minimum value.

根据本发明提供的一种基于联邦学习的模型更新方法,应用于参与联邦学习的服务器,所述根据所述每个客户端的合成数据在每个集群内的聚类模型的经验损失值,对所述目标客户端所属集群进行更新,包括:According to a model update method based on federated learning provided by the present invention, it is applied to servers participating in federated learning. According to the empirical loss value of the clustering model of the synthetic data of each client in each cluster, the Update the cluster to which the target client belongs, including:

执行如下第二循环过程,直至所述K个集群达到稳定分布状态;Execute the following second loop process until the K clusters reach a stable distribution state;

所述第二循环过程,包括:The second cycle process includes:

基于梯度下降法对每个集群内的聚类模型进行更新;Update the clustering model within each cluster based on the gradient descent method;

基于每个集群包含的客户端的合成数据,更新每个集群内的包含的客户端在集群内的更新后的聚类模型的经验损失值;Based on the synthetic data of the clients included in each cluster, update the empirical loss value of the updated clustering model of the clients included in each cluster within the cluster;

根据所述每个集群内的包含的客户端在集群内的更新后的聚类模型的经验损失值,对所述目标客户端所属集群进行更新。The cluster to which the target client belongs is updated according to the empirical loss value of the updated clustering model of the clients contained in each cluster in the cluster.

根据本发明提供的一种基于联邦学习的模型更新方法,应用于参与联邦学习的服务器,所述接收目标客户端发送的所述候选模型,并对所述候选模型进行更新,包括:According to a model update method based on federated learning provided by the present invention, which is applied to servers participating in federated learning, receiving the candidate model sent by the target client and updating the candidate model includes:

根据第一优化目标函数与第二优化目标函数之和,确定所述候选模型的优化目标函数,所述第一优化目标函数为所述目标客户端的候选模型的损失函数之和,所述第二优化目标函数为任一客户端的接收到的目标聚类模型与所述目标客户端中的其余客户端接收到的目标聚类模型之间差异的非线性函数之和;The optimization objective function of the candidate model is determined according to the sum of the first optimization objective function and the second optimization objective function. The first optimization objective function is the sum of the loss functions of the candidate models of the target client. The second optimization objective function is the sum of the loss functions of the candidate models of the target client. The optimization objective function is the sum of nonlinear functions of differences between the target clustering model received by any client and the target clustering model received by the remaining clients in the target client;

基于梯度下降法对所述第一优化目标函数进行优化;Optimize the first optimization objective function based on the gradient descent method;

基于近似点法对第二优化目标函数进行优化;Optimize the second optimization objective function based on the approximate point method;

根据所述优化目标函数取最小值时的候选模型,对所述候选模型进行更新。The candidate model is updated according to the candidate model when the optimization objective function takes the minimum value.

本发明还提供一种基于联邦学习的模型更新方法,应用于参与联邦学习的目标客户端,包括:The present invention also provides a model update method based on federated learning, which is applied to target clients participating in federated learning, including:

将所述目标客户端的数据分布信息发送给参与所述联邦学习的服务器,以使所述服务器根据所述目标客户端的合成数据,对所述目标客户端所属集群进行更新,所述目标客户端包括N个客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的;Send the data distribution information of the target client to the server participating in the federated learning, so that the server updates the cluster to which the target client belongs based on the synthetic data of the target client, where the target client includes N clients, the synthetic data is obtained according to the received data distribution information of the target client;

在所述服务器确定初始化的K个集群达到稳定分布状态的情况下,接收所述服务器发送的每个集群内的目标聚类模型,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;When the server determines that the initialized K clusters have reached a stable distribution state, receive the target clustering model in each cluster sent by the server, and the stable distribution state means that the cluster to which the target client belongs does not change. , the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state;

执行如下第一循环过程,直至候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;Execute the following first loop process until the candidate model converges, the candidate model is obtained after the target client updates the received target clustering model in each cluster;

所述第一循环过程,包括:The first cycle process includes:

向所述服务器发送候选模型,以使所述服务器对接收到的所述候选模型进行更新;Send the candidate model to the server so that the server updates the received candidate model;

接收所述服务器发送的更新后的候选模型,并对所述更新后的候选模型进行更新。Receive the updated candidate model sent by the server, and update the updated candidate model.

根据本发明提供的一种基于联邦学习的模型更新方法,应用于参与联邦学习的目标客户端,所述目标客户端的数据分布信息的获取方式,包括:According to a model update method based on federated learning provided by the present invention, it is applied to a target client participating in federated learning. The method for obtaining the data distribution information of the target client includes:

基于知识蒸馏技术,预训练教师网络;Based on knowledge distillation technology, pre-train teacher network;

将训练好的教师网络作为生成式对抗网络的判别器,所述生成式对抗网络部署在所述目标客户端;Use the trained teacher network as the discriminator of a generative adversarial network, which is deployed on the target client;

基于所述判别器训练所述生成式对抗网络中的生成器,直至所述生成式对抗网络的损失函数的取值小于预设值;Train the generator in the generative adversarial network based on the discriminator until the value of the loss function of the generative adversarial network is less than a preset value;

根据所述训练好的生成器,确定所述目标客户端的数据分布信息。According to the trained generator, the data distribution information of the target client is determined.

本发明还提供一种基于联邦学习的模型更新系统,应用于参与联邦学习的服务器,包括:第一发送模块以及第一更新模块;The present invention also provides a model update system based on federated learning, applied to servers participating in federated learning, including: a first sending module and a first update module;

所述第一发送模块,用于根据参与所述联邦学习的目标客户端的合成数据,对所述目标客户端所属集群进行更新,直至初始化的K个集群达到稳定分布状态,并将每个集群内的目标聚类模型发送给所述目标客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标客户端包括N个客户端,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;The first sending module is used to update the cluster to which the target client belongs based on the synthetic data of the target client participating in the federated learning until the initialized K clusters reach a stable distribution state, and update the clusters within each cluster. The target clustering model is sent to the target client, the synthetic data is obtained according to the received data distribution information of the target client, and the stable distribution state means that the cluster to which the target client belongs does not change, The target clients include N clients, and the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state;

所述第一更新模块,用于执行如下第一循环过程,直至所述目标客户端中的候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;The first update module is configured to perform the following first loop process until the candidate model in the target client converges. The candidate model is the target cluster within each cluster received by the target client. Obtained after the model is updated;

所述第一循环过程,包括:The first cycle process includes:

接收目标客户端发送的候选模型,并对所述候选模型进行更新;Receive the candidate model sent by the target client and update the candidate model;

所述第二发送模块,用于将更新后的候选模型发送给所述目标客户端,以使所述目标客户端对所述候选模型进行更新。The second sending module is used to send the updated candidate model to the target client, so that the target client updates the candidate model.

本发明还提供一种基于联邦学习的模型更新系统,应用于参与联邦学习的目标客户端,包括:第二发送模块、接收模块以及第二更新模块;The present invention also provides a model update system based on federated learning, applied to target clients participating in federated learning, including: a second sending module, a receiving module and a second update module;

所述第二发送模块,用于将所述目标客户端的数据分布信息发送给参与所述联邦学习的服务器,以使所述服务器根据所述目标客户端的合成数据,对所述目标客户端所属集群进行更新,所述目标客户端包括N个客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的;The second sending module is used to send the data distribution information of the target client to the server participating in the federated learning, so that the server can analyze the cluster to which the target client belongs based on the synthetic data of the target client. Update is performed, the target client includes N clients, and the synthetic data is obtained according to the received data distribution information of the target client;

所述接收模块,用于在所述服务器确定初始化的K个集群达到稳定分布状态的情况下,接收所述服务器发送的每个集群内的目标聚类模型,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;The receiving module is configured to receive the target clustering model in each cluster sent by the server when the server determines that the initialized K clusters have reached a stable distribution state, and the stable distribution state is the target The cluster to which the client belongs no longer changes, and the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state;

所述第二更新模块,用于执行如下第一循环过程,直至候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;The second update module is used to perform the following first loop process until the candidate model converges. The candidate model is obtained after the target client updates the received target clustering model in each cluster;

所述第一循环过程,包括:The first cycle process includes:

向所述服务器发送候选模型,以使所述服务器对接收到的所述候选模型进行更新;Send the candidate model to the server so that the server updates the received candidate model;

所述第二接收模块,用于接收所述服务器发送的更新后的候选模型,并对所述更新后的候选模型进行更新。The second receiving module is configured to receive the updated candidate model sent by the server, and update the updated candidate model.

本发明还提供一种电子设备,包括处理器和存储有计算机程序的存储器,所述处理器执行所述程序时实现如上述任一种所述基于联邦学习的模型更新方法。The present invention also provides an electronic device, including a processor and a memory storing a computer program. When the processor executes the program, it implements any one of the above federated learning-based model update methods.

本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述基于联邦学习的模型更新方法。The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements any of the above federated learning-based model update methods.

本发明还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述任一种所述基于联邦学习的模型更新方法。The present invention also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the computer program implements any one of the above federated learning-based model updating methods.

本发明提供的基于联邦学习的模型更新方法及系统,参与协作训练的目标客户端将数据分布信息上传至服务器,服务器根据其上传的数据分布信息,对目标客户端进行聚类划分,得到目标客户端所属集群,节省了目标客户端的计算资源和存储资源,减轻了目标客户端与服务器之间的通信开销,为每一个客户端学习一个最优的个性化模型(即收敛的候选模型)。In the federated learning-based model update method and system provided by the present invention, target clients participating in collaborative training upload data distribution information to the server. The server clusters and divides the target clients based on the uploaded data distribution information to obtain the target clients. The cluster to which the client belongs saves the computing resources and storage resources of the target client, reduces the communication overhead between the target client and the server, and learns an optimal personalized model (i.e., a converged candidate model) for each client.

附图说明Description of the drawings

为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the present invention or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are of the present invention. For some embodiments of the invention, those of ordinary skill in the art can also obtain other drawings based on these drawings without exerting creative efforts.

图1是现有技术提供的联邦学习的架构示意图;Figure 1 is a schematic diagram of the architecture of federated learning provided by existing technology;

图2是本发明提供的基于联邦学习的模型更新方法的流程示意图之一;Figure 2 is one of the flow diagrams of the model update method based on federated learning provided by the present invention;

图3是本发明提供的服务器对目标客户端所属集群进行更新的流程示意图;Figure 3 is a schematic flow chart of the server provided by the present invention updating the cluster to which the target client belongs;

图4是本发明提供的生成个性化模型的示意图;Figure 4 is a schematic diagram of generating a personalized model provided by the present invention;

图5是本发明提供的基于联邦学习的模型更新方法的流程示意图之二;Figure 5 is the second schematic flow chart of the model update method based on federated learning provided by the present invention;

图6是本发明提供的带有生成式对抗网络的生成数据分布的示意图;Figure 6 is a schematic diagram of the distribution of generated data with a generative adversarial network provided by the present invention;

图7是本发明提供的联邦学习的模型更新方法的流程示意图之三;Figure 7 is the third schematic flow chart of the federated learning model update method provided by the present invention;

图8是本发明提供的基于联邦学习的模型更新系统的结构示意图之一;Figure 8 is one of the structural schematic diagrams of the model update system based on federated learning provided by the present invention;

图9是本发明提供的基于联邦学习的模型更新系统的结构示意图之二;Figure 9 is the second structural schematic diagram of the model update system based on federated learning provided by the present invention;

图10是本发明提供的电子设备的实体结构示意图。Figure 10 is a schematic diagram of the physical structure of the electronic device provided by the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention more clear, the technical solutions in the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention. , not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the scope of protection of the present invention.

本发明提供的基于联邦学习的模型更新方法,通过学习客户端的数据分布、基于数据分布在服务器端完成客户端的聚类划分工作,减轻客户端与服务器之间的通信开销,节省客户端的计算资源和存储资源,以及在聚类集群内学习客户端的高性能个性化模型,解决在联邦学习中底层客户端的数据异构分布的情况下,所导致协作学习的全局模型的效果不佳,模型训练收敛慢的问题,包括以下步骤:客户端利用生成式对抗网络技术学习底层客户的不同数据分布,并通过通信信道将这些数据分布发送到服务器;服务器利用这些数据分布信息对参与的客户端进行相似性聚类,使得分布相似的客户端聚在一起;在每一个聚类内,充分利用客户端之间的相似性,为一个客户协作训练属于每个客户的个性化模型。本发明能够利用客户机的数据分布信息,在服务器端完成聚类工作,有效减少通信负载,提高通信效率,减轻通信带宽压力,节约了本地客户端的计算资源和存储资源,显著提升个性化模型的效果,具体实现如下:The model update method based on federated learning provided by the present invention learns the data distribution of the client and completes the clustering work of the client on the server based on the data distribution, thereby reducing the communication overhead between the client and the server and saving the client's computing resources and Storage resources, as well as high-performance personalized models for learning clients within clustering clusters, solve the problem of the heterogeneous distribution of underlying client data in federated learning, which results in poor results in the global model of collaborative learning and slow convergence of model training. The problem includes the following steps: the client uses generative adversarial network technology to learn the different data distributions of the underlying customers, and sends these data distributions to the server through the communication channel; the server uses these data distribution information to perform similarity aggregation on the participating clients. Classes allow clients with similar distributions to be gathered together; within each cluster, the similarity between clients is fully utilized to collaboratively train a personalized model belonging to each client for one client. The present invention can use the data distribution information of the client to complete the clustering work on the server side, effectively reduce the communication load, improve communication efficiency, reduce communication bandwidth pressure, save the computing resources and storage resources of the local client, and significantly improve the performance of the personalized model. The specific effect is as follows:

图2是本发明提供的基于联邦学习的模型更新方法的流程示意图之一,如图2所示,方法包括:Figure 2 is one of the flow diagrams of the model update method based on federated learning provided by the present invention. As shown in Figure 2, the method includes:

步骤110,根据参与所述联邦学习的目标客户端的合成数据,对所述目标客户端所属集群进行更新,直至初始化的K个集群达到稳定分布状态,并将每个集群内的目标聚类模型发送给所述目标客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标客户端包括N个客户端,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;Step 110: Update the cluster to which the target client belongs based on the synthetic data of the target clients participating in the federated learning until the initialized K clusters reach a stable distribution state, and send the target clustering model in each cluster. For the target client, the synthetic data is obtained according to the received data distribution information of the target client, the stable distribution state means that the cluster to which the target client belongs does not change, and the target client includes N clients, the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state;

步骤120,执行如下第一循环过程,直至所述目标客户端中的候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;Step 120: Execute the following first loop process until the candidate model in the target client converges. The candidate model is obtained after the target client updates the received target clustering model in each cluster. ;

所述第一循环过程,包括:The first cycle process includes:

接收目标客户端发送的候选模型,并对所述候选模型进行更新;Receive the candidate model sent by the target client and update the candidate model;

将更新后的候选模型发送给所述目标客户端,以使所述目标客户端对所述候选模型进行更新。The updated candidate model is sent to the target client, so that the target client updates the candidate model.

需要说明的是,上述方法的执行主体可以是计算机设备,也可以应用于参与联邦学习的服务器。It should be noted that the execution subject of the above method can be a computer device or can be applied to a server participating in federated learning.

可选地,该目标客户端可以具体是由参与联邦学习的服务器随机从参与联邦学习的客户端中随机选择的N个客户端,N为正整数。Optionally, the target client may specifically be N clients randomly selected by the server participating in federated learning from the clients participating in federated learning, where N is a positive integer.

该N个客户端的合成数据可以具体是N个客户端的数据分布信息得到的,该数据分布信息即为每个客户端中的生成器,该生成器可以具体是通过对部署在目标客户端的初始的本地模型(对抗式生成网络)进行训练后得到。The synthetic data of the N clients can be obtained specifically from the data distribution information of the N clients. The data distribution information is the generator in each client. The generator can be specifically obtained by initializing the data deployed on the target client. Obtained after training the local model (adversarial generative network).

服务器通过接收该N个客户端的数据发布信息,在服务器端进行聚类划分,根据不同客户端上传的数据分布信息(即训练好的生成器)生成对应于各个客户端的合成数据,例如,服务器将噪声数据输入到训练好的生成器生成各个客户端的合成数据。The server receives the data publishing information of the N clients, performs clustering on the server side, and generates synthetic data corresponding to each client based on the data distribution information uploaded by different clients (i.e., the trained generator). For example, the server will The noisy data is input to the trained generator to generate synthetic data for each client.

服务器接收到编号为1,2,…,i…,N的客户端C1C2...Ci...Cn的数据分布信息G1G2...Gi...Gn,基于数据分布信息G1G2...Gi...Gn生成对应于每个客户端的合成数据,将第i个客户信息在服务器的合成数据记为D′i;将合成数据集大小记为|D′i|。The server receives the data distribution information G 1 G 2...G i...G n of the client C 1 C 2 ...C i ...C n numbered 1, 2, ..., i ..., N. , based on the data distribution information G 1 G 2 ...G i ...G n , generate synthetic data corresponding to each client. The synthetic data of the i-th client information on the server is recorded as D′ i ; the synthetic data set The size is recorded as |D′ i |.

并根据该N个客户端分别对应的合成数据,对目标客户端所属集群进行更新。And based on the synthetic data corresponding to the N clients, the cluster to which the target client belongs is updated.

该集群可以具体是根据服务器初始化的K个集群中的任一集群,每个集群对应一个聚类模型,聚类模型的参数为其中,/>表示第j个聚类模型的参数,K为正整数。The cluster can specifically be any cluster among the K clusters initialized by the server. Each cluster corresponds to a clustering model. The parameters of the clustering model are: Among them,/> Represents the parameters of the jth clustering model, K is a positive integer.

服务器基于目标客户端对应的合成数据在服务器端进行多次迭代,并根据K个集群中聚类模型的经验损失函数计算出的最小损失来估计每个客户端所属集群,直到初始化的K个集群达到稳定分布状态,该稳定分布状态具体指目标客户端中的每个客户端所属集群不再变化,即每个集群内包含的客户端不再变化。The server performs multiple iterations on the server side based on the synthetic data corresponding to the target client, and estimates the cluster to which each client belongs based on the minimum loss calculated by the empirical loss function of the clustering model in the K clusters until the initialized K clusters A stable distribution state is reached. The stable distribution state specifically means that the cluster to which each client in the target client belongs will no longer change, that is, the clients included in each cluster will no longer change.

服务器在确定初始化的K个集群达到稳定分布状态的情况下,根据N个客户端中的每个客户端所属集群,将每个集群内的目标聚类模型发送给该集群内的客户端。After determining that the initialized K clusters have reached a stable distribution state, the server sends the target clustering model in each cluster to the clients in the cluster according to the cluster to which each of the N clients belongs.

目标客户端接收到的服务器发送的目标聚类模型后,采用梯度下降法对其进行更新。After the target client receives the target clustering model sent by the server, it updates it using the gradient descent method.

执行如下第一循环过程,直至目标客户端中的候选模型收敛。The following first loop process is executed until the candidate model in the target client converges.

该第一循环过程,包括:The first cycle process includes:

目标客户端将更新后的目标聚类模型(即候选模型)发送给服务器。The target client sends the updated target clustering model (i.e., candidate model) to the server.

服务器对接收到的候选模型中的参数进行更新,并将更新后的候选模型发送给目标客户端。The server updates the parameters in the received candidate model and sends the updated candidate model to the target client.

目标客户端采用第一下降法对接收到的服务器发送的更新后的候选模型进行更新,直至候选模型收敛,将收敛的候选模型作为目标客户端的个性化模型。The target client uses the first descent method to update the updated candidate model sent by the received server until the candidate model converges, and uses the converged candidate model as the personalized model of the target client.

本发明提供的基于联邦学习的模型更新方法,参与协作训练的目标客户端将数据分布信息上传至服务器,服务器根据其上传的数据分布信息,对目标客户端进行聚类划分,得到目标客户端所属集群,节省了目标客户端的计算资源和存储资源,减轻了目标客户端与服务器之间的通信开销,为每一个客户端学习一个最优的个性化模型(即收敛的候选模型)。In the model update method based on federated learning provided by the present invention, the target client participating in collaborative training uploads the data distribution information to the server. The server clusters the target client based on the data distribution information uploaded by it, and obtains the target client's membership. The cluster saves the computing resources and storage resources of the target client, reduces the communication overhead between the target client and the server, and learns an optimal personalized model (i.e., a converged candidate model) for each client.

进一步地,在一个实施例中,所述根据所述目标客户端的合成数据,对所述目标客户端所属集群进行更新,可以具体包括:Further, in one embodiment, updating the cluster to which the target client belongs based on the synthetic data of the target client may specifically include:

初始化目标客户端所属集群;Initialize the cluster to which the target client belongs;

根据每个集群内的聚类模型的经验损失函数,获取每个客户端的合成数据在每个集群内的聚类模型的经验损失值;According to the empirical loss function of the clustering model in each cluster, obtain the empirical loss value of the clustering model in each cluster for the synthetic data of each client;

根据所述每个客户端的合成数据在每个集群内的聚类模型的经验损失值,对所述目标客户端所属集群进行更新,以确定所述K个集群达到稳定分布状态时,每个集群内包含的客户端,所述每个集群内包含的客户端为所述目标客户端中满足合成数据在每个集群内的聚类模型的经验损失值达到最小值的客户端。According to the empirical loss value of the clustering model of the synthetic data of each client in each cluster, the cluster to which the target client belongs is updated to determine when the K clusters reach a stable distribution state. The clients included in each cluster are the clients among the target clients that satisfy the experience loss value of the clustering model of the synthetic data in each cluster reaching the minimum value.

进一步地,在一个实施例中,所述根据所述每个客户端的合成数据在每个集群内的聚类模型的经验损失值,对所述目标客户端所属集群进行更新,可以具体包括:Further, in one embodiment, updating the cluster to which the target client belongs based on the empirical loss value of the clustering model of each client's synthetic data in each cluster may specifically include:

执行如下第二循环过程,直至所述K个集群达到稳定分布状态;Execute the following second loop process until the K clusters reach a stable distribution state;

所述第二循环过程,包括:The second cycle process includes:

基于梯度下降法对每个集群内的聚类模型进行更新;Update the clustering model within each cluster based on the gradient descent method;

基于每个集群包含的客户端的合成数据,更新每个集群内的包含的客户端在集群内的更新后的聚类模型的经验损失值;Based on the synthetic data of the clients included in each cluster, update the empirical loss value of the updated clustering model of the clients included in each cluster within the cluster;

根据所述每个集群内的包含的客户端在集群内的更新后的聚类模型的经验损失值,对所述目标客户端所属集群进行更新。The cluster to which the target client belongs is updated according to the empirical loss value of the updated clustering model of the clients contained in each cluster in the cluster.

可选地,图3是本发明提供的服务器对目标客户端所属集群进行更新的流程示意图,如图3所示,服务器为目标客户端中的每个客户端分配集群身份,该集群身份用于表征客户端所属集群,假设第i个客户端Ci的集群身份为 Optionally, Figure 3 is a schematic flow chart of the server provided by the present invention updating the cluster to which the target client belongs. As shown in Figure 3, the server assigns a cluster identity to each client in the target client, and the cluster identity is used to Characterizes the cluster to which the client belongs. Assume that the cluster identity of the i-th client C i is

在服务器端初始化K个集群模型,将第K个聚类模型标记为θK,将聚类模型的层数记为|θK|,将第K个聚类模型的权重参数记为其中p表示聚类模型的倒数第p层上;将第K个聚类模型初始化标记为/>将聚类模型的经验损失函数记为FKK);Initialize K cluster models on the server side, mark the Kth clustering model as θ K , mark the number of layers of the clustering model as |θ K |, and mark the weight parameters of the Kth clustering model as where p represents the p-th layer from the bottom of the clustering model; initialize the K-th clustering model and mark it as/> Denote the empirical loss function of the clustering model as F KK );

确定聚类模型的经验损失函数FKK):FKK)=argmin{FKK1),FkK2),...FKKn)}Determine the empirical loss function F KK ) of the clustering model: F KK ) = argmin{F KK1 ), F kK2 ),...F KKn )}

服务器就是那客户端Ci的合成数据Gi在K个聚类模型的经验损失值:F(θ1),F(θ2)...F(θK)The server is the empirical loss value of the synthetic data G i of the client C i in K clustering models: F(θ 1 ), F(θ 2 )...F(θ K )

寻找合成数据Gi在K个模型的最小损失,来更新每个客户端的集群身份直至K个集群达到稳定分布状态。Find the minimum loss of synthetic data G i among K models to update the cluster identity of each client Right now Until K clusters reach a stable distribution state.

服务器在确定K个集群达到稳定分布状态的情况下,确定每个集群内包含的客户端,该每个集群内包含的客户端为目标客户端中满足合成数据在每个集群内的聚类模型的经验损失值达到最小值(即最小损失)的客户端。When the server determines that the K clusters have reached a stable distribution state, it determines the clients included in each cluster. The clients included in each cluster are the clustering models of the target clients that satisfy the synthetic data in each cluster. The client whose experience loss value reaches the minimum value (that is, the minimum loss).

可选地,在每次迭代确认集群身份后,在每一个集群内,结合集群内的客户端的合成数据更新第K个聚类模型的经验损失值。Optionally, after confirming the cluster identity in each iteration, within each cluster, the empirical loss value of the Kth clustering model is updated based on the synthetic data of the clients in the cluster.

具体地,服务器通过执行如下第二循环过程,直至K个集群达到稳定分布状态:Specifically, the server executes the following second loop process until K clusters reach a stable distribution state:

假设经过上述过程对目标客户端所属集群进行一次更新后,第K个集群内包含的m个客户端分别为C1 C2...CmAssume that after the cluster to which the target client belongs is updated through the above process, the m clients included in the Kth cluster are C 1 C 2 ...C m respectively.

服务器采用梯度下降的方式对集群内的聚类模型进行更新。The server uses gradient descent to update the clustering model in the cluster.

在第K个集群内,基于集群内的客户端C1 C2...Cm的合成数据G1G2...Gi更新第K个集群内的更新后的聚类模型的经验损失值F(θk),其中,γ为聚类模型权重训练的学习率。Within the Kth cluster, update the empirical loss of the updated clustering model within the Kth cluster based on the synthetic data G 1 G 2 ... G i of the clients C 1 C 2 ...C m within the cluster. value F(θ k ), where, γ is the learning rate of clustering model weight training.

服务器根据每个集群内的包含的客户端在集群内的更新后的聚类模型的经验损失值,对目标客户端所属集群进行更新,直至K个集群达到稳定的分布状态。The server updates the cluster to which the target client belongs based on the empirical loss value of the updated clustering model of the clients included in each cluster until the K clusters reach a stable distribution state.

本发明提供的基于联邦学习的模型更新方法,客户端的聚类工作是由服务器完成的,参与协作训练的目标客户端将数据分布信息上传至服务器,服务器根据其上传的数据分布信息,利用最小化损失的聚类策略对客户端进行划分,相比于其他的迭代式聚类联邦技术,本发明具有更低的通信成本,减轻了客户端的计算资源和存储资源,同时利用本发明提供的聚类方法可以将目标客户端正确划分,特别是参与联邦训练的客户端的数据呈现明显异构设置的条件下,客户端将会被划分为多个不同的聚类。In the model update method based on federated learning provided by the present invention, the clustering work of the client is completed by the server. The target client participating in the collaborative training uploads the data distribution information to the server. The server utilizes minimization according to the uploaded data distribution information. The lossy clustering strategy divides the client. Compared with other iterative clustering federation technologies, the present invention has lower communication costs, reduces the computing resources and storage resources of the client, and at the same time utilizes the clustering provided by the present invention. This method can correctly divide the target clients, especially when the data of clients participating in federated training presents obviously heterogeneous settings, the clients will be divided into multiple different clusters.

进一步地,在一个实施例中,所述接收目标客户端发送的所述候选模型,并对所述候选模型进行更新,可以具体包括:Further, in one embodiment, receiving the candidate model sent by the target client and updating the candidate model may specifically include:

根据第一优化目标函数与第二优化目标函数之和,确定所述候选模型的优化目标函数,所述第一优化目标函数为所述目标客户端的候选模型的损失函数之和,所述第二优化目标函数为任一客户端的接收到的目标聚类模型与所述目标客户端中的其余客户端接收到的目标聚类模型之间差异的非线性函数之和;The optimization objective function of the candidate model is determined according to the sum of the first optimization objective function and the second optimization objective function. The first optimization objective function is the sum of the loss functions of the candidate models of the target client. The second optimization objective function is the sum of the loss functions of the candidate models of the target client. The optimization objective function is the sum of nonlinear functions of differences between the target clustering model received by any client and the target clustering model received by the remaining clients in the target client;

基于梯度下降法对所述第一优化目标函数进行优化;Optimize the first optimization objective function based on the gradient descent method;

基于近似点法对第二优化目标函数进行优化;Optimize the second optimization objective function based on the approximate point method;

根据所述优化目标函数取最小值时的候选模型,对所述候选模型进行更新。The candidate model is updated according to the candidate model when the optimization objective function takes the minimum value.

可选地,在各个达到稳定分布状态的集群内,得到每个集群的聚类模型,将不同的聚类模型下发至各个对应的客户端,具体地:Optionally, in each cluster that reaches a stable distribution state, obtain the clustering model of each cluster, and combine different clustering models into Distributed to each corresponding client, specifically:

聚类达到稳定状态,客户端C1 C2...Ci...Cn被划分为K个聚类,将第K个聚类模型θk下发至属于该集群的客户端。When the clustering reaches a stable state, the clients C 1 C 2 ...C i ...C n are divided into K clusters, and the Kth clustering model θ k is delivered to the clients belonging to the cluster.

步骤11,客户端Ci采用梯度下降的方式更新接收到的服务器发送的目标聚类模型,并将更新后的目标聚类模型(即候选模型)发送到服务器,具体地:Step 11: Client Ci uses gradient descent to update the target clustering model received from the server, and sends the updated target clustering model (i.e. candidate model) to the server. Specifically:

步骤111,客户端C1 C2...Ci...Cn接收服务器下发对应于客户端的集群身份的目标聚类模型;Step 111: The client C 1 C 2 ...C i ...C n receives the target clustering model corresponding to the client's cluster identity issued by the server;

步骤112,将第i个客户端Ci接收到的目标聚类模型标记为wi;将目标聚类模型的层数记为|wi|,将目标聚类模型的权重记为其中p表示只应用本地聚合在目标聚类模型的倒数第p层上;将目标聚类模型的损失函数记为F(wi);Step 112: Mark the target clustering model received by the i-th client C i as w i ; mark the number of layers of the target clustering model as |w i |, and mark the weight of the target clustering model as |w i | Where p means that only local aggregation is applied on the penultimate p-th layer of the target clustering model; the loss function of the target clustering model is recorded as F( wi );

步骤113,确定目标聚类模型的目标函数F(wi):F(wi)=argmin{F(w1),F(w2),...F(wn)}Step 113, determine the objective function F( wi ) of the target clustering model: F( wi )=argmin{F(w 1 ), F(w 2 ),...F(w n )}

步骤114,确定目标聚类模型的更新方式,利用接收到的目标聚类模型覆盖旧的本地模型,然后结合本地私有数据采用梯度下降的方式更新目标聚类模型:其中,η为本地更新模型的学习率,/>为客户端Ci对目标聚类模型进行更新后得到的候选模型;Step 114: Determine the update method of the target clustering model, use the received target clustering model to overwrite the old local model, and then combine the local private data to update the target clustering model using gradient descent: Among them, eta is the learning rate of the local update model,/> The candidate model obtained after updating the target clustering model for client C i ;

步骤115,将更新后的目标聚类模型(即候选模型)通过网络上传至服务器。Step 115: Upload the updated target clustering model (ie, candidate model) to the server through the network.

步骤21,服务器根据接收到的属于不同集群的客户端的发送的候选模型,在集群内利用消息传递机制生成每个客户端的个性化模型Ui,将其下发给对应的客户端Ci;具体地,Step 21: The server uses the message passing mechanism within the cluster to generate a personalized model U i for each client based on the received candidate models sent by clients belonging to different clusters, and sends it to the corresponding client C i ; specifically land,

步骤211,服务器接收属于不同集群的客户端C1 C2...Ci...Cn发送的候选模型;Step 211, the server receives candidate models sent by clients C 1 C 2 ...C i ...C n belonging to different clusters;

步骤212,确定客户端的个性化云模型,将第i个客户端Ci上的个性化云模型标记为Ui;将个性化云模型的层数记为|Ui|,将个性化云模型的权重记为其中p表示只应用本地聚合在本地模型的倒数第p层上;/>表示属于第K个集群内第i个客户端的个性化云模型的参数;Step 212, determine the personalized cloud model of the client, mark the personalized cloud model on the i-th client C i as U i ; mark the number of layers of the personalized cloud model as |U i |, mark the personalized cloud model The weight of is recorded as Where p means that only local aggregation is applied on the penultimate p layer of the local model;/> Represents the parameters of the personalized cloud model belonging to the i-th client in the K-th cluster;

步骤213,定确定整体的优化目标函数:Step 213, determine the overall optimization objective function:

其中,公式的前半部分代表第一优化目标函数,其是集群内所有客户端的目标聚类模型的损失函数之和公式后半部分代表第二优化目标函数,其是注意力机制部分/> 其中A(||wi-wi||2)是度量客户端Ci接收到的目标聚类模型wi和其余客户端Cj接收到的目标聚类模型wj的参数差异的非线性函数,满足从0开始递增且可微等条件。Among them, the first half of the formula represents the first optimization objective function, which is the sum of the loss functions of the target clustering models of all clients in the cluster. The second half of the formula represents the second optimization objective function, which is the attention mechanism part/> where A(||w i -w i || 2 ) is a nonlinearity measuring the parameter difference between the target clustering model w i received by client C i and the target clustering model w j received by the remaining clients C j A function that satisfies the conditions of increasing from 0 and being differentiable.

基于上述分析,将优化目标函数简化为:Based on the above analysis, the optimization objective function is simplified as:

步骤214,基于上述简化公式,确定优化方式。将优化步骤分为两部分:首先是通过梯度下降优化得到中间值Uk,然后再通过近似点步骤进一步优化/>根据优化目标函数取最小值时的候选模型,对候选模型进行更新,得到更新后的候选模型,即个性化模型;Step 214: Determine the optimization method based on the above simplified formula. Divide the optimization step into two parts: first is optimization via gradient descent Get the intermediate value U k and then further optimize it through the approximate point step/> According to the candidate model when the optimization objective function takes the minimum value, the candidate model is updated to obtain the updated candidate model, which is the personalized model;

步骤215,服务器计算每一个集群内客户端的个性化云模型的参数 是/>对应的参数集的线性组合,如下所示:Step 215: The server calculates the parameters of the personalized cloud model of each client in the cluster. Yes/> The corresponding linear combination of parameter sets is as follows:

其中,是客户端Ci上传的目标聚类模型的参数集,其是通过使用客户端本地私有数据进行计算,ξi,1,...,ξi,m对应/>的权重。(ξi,1+…+ξi,m=1)。ξi,j表示为集群内的客户端Cj对客户端Ci的个性化模型的贡献权重。/>和/>之间的相似性越高,对彼此的贡献度越大。in, is the parameter set of the target clustering model uploaded by client C i , which is calculated by using the client's local private data, ξ i, 1 ,..., ξ i, m corresponding to/> the weight of. (ξ i, 1 +...+ξ i, m = 1). ξ i,j represents the contribution weight of client C j in the cluster to the personalized model of client C i . /> and/> The higher the similarity between them, the greater their contribution to each other.

步骤215,将生成的个性化云模型下发给各个客户端C1 C2...Ci,..CnStep 215: Send the generated personalized cloud model to each client C 1 C 2 ...C i , ..C n .

步骤31,重复步骤11和步骤21,执行T轮训练,直至每个客户端的候选模型(即个性化模型)收敛,T可以根据实际情况灵活设置,具体如图4所示。Step 31: Repeat steps 11 and 21 to perform T rounds of training until each client's candidate model (i.e., personalized model) converges. T can be flexibly set according to the actual situation, as shown in Figure 4.

本发明提供的基于联邦学习的模型更新方法,对于同一聚类内的相似客户端,充分利用客户端之间的相似性,为客户端协作训练属于每个客户端的个性化模型,相比于其余聚类个性化联邦学习方法可以得到更好的模型性能。The model update method based on federated learning provided by the present invention makes full use of the similarity between clients for similar clients in the same cluster, and collaboratively trains personalized models belonging to each client for the clients. Compared with other The clustering personalized federated learning method can achieve better model performance.

图5是本发明提供的基于联邦学习的模型更新方法的流程示意图之二,如图5所示,包括:Figure 5 is the second schematic flow chart of the model update method based on federated learning provided by the present invention. As shown in Figure 5, it includes:

步骤210,将所述目标客户端的数据分布信息发送给参与所述联邦学习的服务器,以使所述服务器根据所述目标客户端的合成数据,对所述目标客户端所属集群进行更新,所述目标客户端包括N个客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的;Step 210: Send the data distribution information of the target client to the server participating in the federated learning, so that the server updates the cluster to which the target client belongs based on the synthetic data of the target client. The client includes N clients, and the synthetic data is obtained according to the received data distribution information of the target client;

步骤220,在所述服务器确定初始化的K个集群达到稳定分布状态的情况下,接收所述服务器发送的每个集群内的目标聚类模型,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;Step 220: When the server determines that the initialized K clusters have reached a stable distribution state, receive the target clustering model in each cluster sent by the server, and the stable distribution state is the cluster to which the target client belongs. No longer changes, the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state;

步骤230,执行如下第一循环过程,直至候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;Step 230: Execute the following first loop process until the candidate model converges. The candidate model is obtained after the target client updates the received target clustering model in each cluster;

所述第一循环过程,包括:The first cycle process includes:

向所述服务器发送候选模型,以使所述服务器对接收到的所述候选模型进行更新;Send the candidate model to the server so that the server updates the received candidate model;

接收所述服务器发送的更新后的候选模型,并对所述更新后的候选模型进行更新。Receive the updated candidate model sent by the server, and update the updated candidate model.

可选地,需要说明的是,上述方法的执行主体可以是计算机设备,也可以应用于参与联邦学习的目标客户端。Optionally, it should be noted that the execution subject of the above method may be a computer device, or may be applied to a target client participating in federated learning.

可选地,该目标客户端可以具体是由参与联邦学习的服务器随机从参与联邦学习的客户端中随机选择的N个客户端,N为正整数。Optionally, the target client may specifically be N clients randomly selected by the server participating in federated learning from the clients participating in federated learning, where N is a positive integer.

该N个客户端的合成数据可以具体是N个客户端的数据分布信息得到的,该数据分布信息即为每个客户端中的生成器,该生成器可以具体是通过对部署在目标客户端的初始的本地模型(对抗式生成网络)进行训练后得到。The synthetic data of the N clients can be obtained specifically from the data distribution information of the N clients. The data distribution information is the generator in each client. The generator can be specifically obtained by initializing the data deployed on the target client. Obtained after training the local model (adversarial generative network).

N个客户端将其对应的数据发布信息发送给参与联邦学习的服务器,在服务器端进行聚类划分。N clients send their corresponding data release information to the server participating in federated learning, and clustering is performed on the server side.

服务器根据接收到的不同客户端上传的数据分布信息(即训练好的生成器)生成对应于各个客户端的合成数据,例如,服务器将噪声数据输入到训练好的生成器生成各个客户端的合成数据。The server generates synthetic data corresponding to each client based on the received data distribution information uploaded by different clients (i.e., the trained generator). For example, the server inputs noise data into the trained generator to generate synthetic data for each client.

服务器接收到编号为1,2,...,i...,N的客户端C1 C2...Ci...Cn的数据分布信息G1G2...Gi...Gn,基于数据分布信息G1 G2...Gi...Gn生成对应于每个客户端的合成数据,将第i个客户信息在服务器的合成数据记为D′i;将合成数据集大小记为|D′i|。The server receives the data distribution information G 1 G 2 ...G i of the client C 1 C 2 ...C i ...C n numbered 1, 2,...,i..., N . ..G n , based on the data distribution information G 1 G 2 ...G i ...G n , generate synthetic data corresponding to each client, and record the synthetic data of the i-th client information on the server as D′ i ; Denote the synthetic data set size as |D′ i |.

服务器根据该N个客户端分别对应的合成数据,对目标客户端所属集群进行更新。The server updates the cluster to which the target client belongs based on the synthetic data corresponding to the N clients.

该集群可以具体是根据服务器初始化的K个集群中的任一集群,每个集群对应一个聚类模型,聚类模型的参数为其中,/>表示第j个聚类模型的参数,K为正整数。The cluster can specifically be any cluster among the K clusters initialized by the server. Each cluster corresponds to a clustering model. The parameters of the clustering model are: Among them,/> Represents the parameters of the jth clustering model, K is a positive integer.

服务器基于目标客户端对应的合成数据在服务器端进行多次迭代,并根据K个集群中聚类模型的经验损失函数计算出的最小损失来估计每个客户端所属集群,直到初始化的K个集群达到稳定分布状态,该稳定分布状态具体指目标客户端中的每个客户端所属集群不再变化,即每个集群内包含的客户端不再变化。The server performs multiple iterations on the server side based on the synthetic data corresponding to the target client, and estimates the cluster to which each client belongs based on the minimum loss calculated by the empirical loss function of the clustering model in the K clusters until the initialized K clusters A stable distribution state is reached. The stable distribution state specifically means that the cluster to which each client in the target client belongs will no longer change, that is, the clients included in each cluster will no longer change.

在服务器确定初始化的K个集群达到稳定分布状态的情况下,N个客户端接收服务器发送的目标聚类模型,该目标聚类模型是服务器根据初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的。When the server determines that the initialized K clusters have reached a stable distribution state, N clients receive the target clustering model sent by the server. The target clustering model is based on the initialization of K clusters and each cluster reaches a stable distribution state. The clustering model within the cluster is determined.

目标客户端接收到的服务器发送的目标聚类模型后,采用梯度下降法对其进行更新。After the target client receives the target clustering model sent by the server, it updates it using the gradient descent method.

执行如下第一循环过程,直至候选模型收敛。The following first loop process is executed until the candidate model converges.

该第一循环过程,包括:The first cycle process includes:

目标客户端将更新后的目标聚类模型(即候选模型)发送给服务器。The target client sends the updated target clustering model (i.e., candidate model) to the server.

服务器对接收到的候选模型中的参数进行更新,并将更新后的候选模型发送给目标客户端。The server updates the parameters in the received candidate model and sends the updated candidate model to the target client.

目标客户端采用第一下降法对接收到的服务器发送的更新后的候选模型进行更新,直至候选模型收敛,将收敛的候选模型作为目标客户端的个性化模型。The target client uses the first descent method to update the updated candidate model sent by the received server until the candidate model converges, and uses the converged candidate model as the personalized model of the target client.

本发明提供的基于联邦学习的模型更新方法,参与协作训练的目标客户端将数据分布信息上传至服务器,服务器根据其上传的数据分布信息,对目标客户端进行聚类划分,得到目标客户端所属集群,节省了目标客户端的计算资源和存储资源,减轻了目标客户端与服务器之间的通信开销,为每一个客户端学习一个最优的个性化模型(即收敛的候选模型)。In the model update method based on federated learning provided by the present invention, the target client participating in collaborative training uploads the data distribution information to the server. The server clusters the target client based on the data distribution information uploaded by it, and obtains the target client's membership. The cluster saves the computing resources and storage resources of the target client, reduces the communication overhead between the target client and the server, and learns an optimal personalized model (i.e., a converged candidate model) for each client.

进一步地,在一个实施例中,所述目标客户端的数据分布信息的获取方式,可以具体包括:Further, in one embodiment, the method of obtaining the data distribution information of the target client may specifically include:

基于知识蒸馏技术,预训练教师网络;Based on knowledge distillation technology, pre-train teacher network;

将训练好的教师网络作为生成式对抗网络的判别器,所述生成式对抗网络部署在所述目标客户端;Use the trained teacher network as the discriminator of a generative adversarial network, which is deployed on the target client;

基于所述判别器训练所述生成式对抗网络中的生成器,直至所述生成式对抗网络的损失函数的取值小于预设值;Train the generator in the generative adversarial network based on the discriminator until the value of the loss function of the generative adversarial network is less than a preset value;

根据所述训练好的生成器,确定所述目标客户端的数据分布信息。According to the trained generator, the data distribution information of the target client is determined.

可选地,目标客户端训练生成式对抗网络,学习本地的数据分布信息,将所学数据分布信息上传至服务器,具体地:Optionally, the target client trains a generative adversarial network, learns local data distribution information, and uploads the learned data distribution information to the server. Specifically:

将参与联邦学习的N个客户端编号为C1 C2...Ci...Cn;将第i个客户机上的数据集记为Di;将该数据集包括的样本数记为|Di|;将第i个客户机上的本地生成模型(即生成器)标记为Gi;将本地生成模型的层数记为|Gi|,将第i个客户机上的本地判别模型(即判别器)标记为将本地判别模型的层数记为/>将本地生成模型的权重记为/>其中p表示只应用本地聚合在本地模型(生成式对抗网络)的倒数第p层上;将第i个客户端上的初始化本地生成模型记为/>将生成式对抗网络的损失函数记为/> Number the N clients participating in federated learning as C 1 C 2 ...C i ...C n ; record the data set on the i-th client as D i ; record the number of samples included in the data set as |D i |; mark the local generation model (i.e. generator) on the i-th client as G i ; mark the number of layers of the local generation model as |G i |, mark the local discriminant model (i.e. generator) on the i-th client as |G i | i.e. discriminator) marked as Denote the number of layers of the local discriminant model as/> Record the weight of the locally generated model as/> where p indicates that only local aggregation is applied on the penultimate p layer of the local model (generative adversarial network); the initialized local generative model on the i-th client is recorded as/> Mark the loss function of the generative adversarial network as/>

引入知识蒸馏技术,预训练教师网络,将第i个客户机上的教师网络标记为Ti,将教师网络的层数记为|Ti|,将教师网络的权重记为其根据真实数据训练教师网络出来的,将训练好的教师网络固定为生成式对抗网络的判别器/>即将生成式对抗网络中的判别器初始化为训练好的教师模型Ti,即/> Introduce knowledge distillation technology and pre-train the teacher network. Mark the teacher network on the i-th client as Ti , record the number of layers of the teacher network as |T i |, and record the weight of the teacher network as It is trained on the teacher network based on real data, and the trained teacher network is fixed as the discriminator of the generative adversarial network/> That is, the discriminator in the generative adversarial network is initialized to the trained teacher model Ti , that is,/>

确定生成式对抗网络的目标函数 Determine the objective function of the generative adversarial network

其中,是交叉熵损失函数,yT是教师网络对于生成图像得到的其属于每个类别的概率,t是取了概率最大的类别,并用one-hot向量表示,交叉熵/>来衡量/>和ti的相似度。教师网络提取的特征表示为/>对应于全连接层之前的输出,L1范数用来衡量激活神经元的个数。/>表示p所拥有的信息量,其中,k代表系数,可以灵活设置,p′代表给定的概率向量,p′={p′1,p′2,...,p′o},o代表概率向量p′包括的概率个数。in, is the cross entropy loss function, y T is the probability that the generated image belongs to each category obtained by the teacher network, t is the category with the highest probability, and is represented by a one-hot vector, cross entropy/> To measure/> Similarity to t i . The features extracted by the teacher network are expressed as/> Corresponding to the output before the fully connected layer, the L1 norm is used to measure the number of activated neurons. /> Indicates the amount of information possessed by p, where k represents the coefficient, which can be set flexibly, p′ represents a given probability vector, p′={p′ 1 , p′ 2 ,..., p′ o }, and o represents The number of probabilities included in probability vector p′.

根据目标函数以及固定好的判别器/>训练生成器Gi,即根据训练好的生成器得到数据分布信息。According to the objective function And a fixed discriminator/> Train the generator G i , that is, obtain the data distribution information based on the trained generator.

客户端Ci将所学的数据分布信息上传至服务器。Client Ci uploads the learned data distribution information to the server.

服务器接收到客户端上传的数据分布信息Gi,在服务器端进行聚类划分,根据不同客户端上传的数据分布生成对应于各个客户端的合成数据,经过上述过程生成的数据分布信息的示意图如图6所示。The server receives the data distribution information G i uploaded by the client, performs clustering on the server side, and generates synthetic data corresponding to each client based on the data distribution uploaded by different clients. The schematic diagram of the data distribution information generated through the above process is as follows: 6 shown.

图7是本发明提供的联邦学习的模型更新方法的流程示意图之三,如图7所示,包括:Figure 7 is the third flow diagram of the federated learning model update method provided by the present invention. As shown in Figure 7, it includes:

步骤1,目标客户端训练生成式对抗网络,学习本地数据分布信息,将所学数据分布信息上传至服务器;Step 1: The target client trains a generative adversarial network, learns local data distribution information, and uploads the learned data distribution information to the server;

步骤2,服务器接收到客户端上传的数据分布信息,在服务器端进行聚类划分,根据不同客户端上传的数据分布信息生成对应于各个客户端的合成数据;Step 2: The server receives the data distribution information uploaded by the client, performs clustering on the server side, and generates synthetic data corresponding to each client based on the data distribution information uploaded by different clients;

步骤3,服务器初始化K个集群 Step 3: The server initializes K clusters

步骤4,基于目标客户端的合成数据在服务器端进行多次迭代。根据K个集群模型中经验损失函数计算出的最小损失来估计每个客户端的集群身份。Step 4: Perform multiple iterations on the server side based on the synthetic data of the target client. The cluster identity of each client is estimated based on the minimum loss calculated by the empirical loss function among the K cluster models.

步骤5,在每次迭代确认集群身份后,在每一个集群内,结合集群内的客户端的合成数据更新第K个聚类模型的参数。Step 5: After confirming the cluster identity in each iteration, in each cluster, update the parameters of the Kth clustering model based on the synthetic data of the clients in the cluster.

步骤6,重复步骤4和步骤5,直至K个集群达到稳定分布状态;Step 6: Repeat steps 4 and 5 until K clusters reach a stable distribution state;

步骤7,在达到稳定分布状态的各个集群内,得到每个集群的聚类模型,即目标聚类模型,根据客户端所属集群,将不同的目标聚类模型下发至各个对应的客户端;Step 7: In each cluster that reaches a stable distribution state, obtain the clustering model of each cluster, that is, the target clustering model. According to the cluster to which the client belongs, different target clustering models are delivered to each corresponding client;

步骤8,客户端采用梯度下降的方式更新接收到服务器发送的目标聚类模型,并将更新后的目标聚类模型(即候选模型)发送到服务器;Step 8: The client uses gradient descent to update the target clustering model received from the server, and sends the updated target clustering model (i.e., candidate model) to the server;

步骤9,服务器根据接收到的属于不同集群的客户端的候选模型,在集群内利用消息传递机制生成每个客户端的个性化模型,将其下发给对应的客户端;Step 9: Based on the received candidate models of clients belonging to different clusters, the server uses the message passing mechanism to generate a personalized model for each client within the cluster, and sends it to the corresponding client;

步骤10,重复步骤8和步骤9,执行T轮训练,直至每个客户端的个性化模型训练收敛。Step 10: Repeat steps 8 and 9 to perform T rounds of training until the personalized model training of each client converges.

本发明提供的基于联邦学习的模型更新方法,通过生成式对抗网络和知识蒸馏技术学习本地客户端的数据分布,能够准确学习本地数据分布信息,加快生成模型的学习和收敛,节省客户端的资源。The model update method based on federated learning provided by the present invention learns the data distribution of the local client through the generative adversarial network and knowledge distillation technology, can accurately learn the local data distribution information, accelerate the learning and convergence of the generated model, and save the resources of the client.

下面对本发明提供的基于联邦学习的模型更新系统进行描述,下文描述的基于联邦学习的模型更新系统与上文描述的基于联邦学习的模型更新方法可相互对应参照。The model update system based on federated learning provided by the present invention is described below. The model update system based on federated learning described below and the model update method based on federated learning described above can correspond to each other.

图8是本发明提供的基于联邦学习的模型更新系统的结构示意图之一,如图8所示,应用于参与联邦学习的服务器,包括:Figure 8 is one of the structural schematic diagrams of the model update system based on federated learning provided by the present invention. As shown in Figure 8, it is applied to servers participating in federated learning, including:

第一发送模块810以及第一更新模块811;The first sending module 810 and the first update module 811;

所述第一发送模块810,用于根据参与所述联邦学习的目标客户端的合成数据,对所述目标客户端所属集群进行更新,直至初始化的K个集群达到稳定分布状态,并将每个集群内的目标聚类模型发送给所述目标客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标客户端包括N个客户端,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;The first sending module 810 is used to update the cluster to which the target client belongs based on the synthetic data of the target client participating in the federated learning until the initialized K clusters reach a stable distribution state, and assign each cluster to The target clustering model within is sent to the target client. The synthetic data is obtained based on the received data distribution information of the target client. The stable distribution state means that the cluster to which the target client belongs does not change. , the target client includes N clients, and the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state;

所述第一更新模块811,用于执行如下第一循环过程,直至所述目标客户端中的候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;The first update module 811 is configured to perform the following first loop process until the candidate model in the target client converges. The candidate model is the target cluster in each cluster received by the target client. Obtained after updating the class model;

所述第一循环过程,包括:The first cycle process includes:

接收目标客户端发送的候选模型,并对所述候选模型进行更新;Receive the candidate model sent by the target client and update the candidate model;

所述第二发送模块,用于将更新后的候选模型发送给所述目标客户端,以使所述目标客户端对所述候选模型进行更新。The second sending module is used to send the updated candidate model to the target client, so that the target client updates the candidate model.

本发明提供的基于联邦学习的模型更新系统,参与协作训练的目标客户端将数据分布信息上传至服务器,服务器根据其上传的数据分布信息,对目标客户端进行聚类划分,得到目标客户端所属集群,节省了目标客户端的计算资源和存储资源,减轻了目标客户端与服务器之间的通信开销,为每一个客户端学习一个最优的个性化模型(即收敛的候选模型)。In the federated learning-based model update system provided by the present invention, target clients participating in collaborative training upload data distribution information to the server. The server clusters the target clients based on the uploaded data distribution information to obtain the target client's location. The cluster saves the computing resources and storage resources of the target client, reduces the communication overhead between the target client and the server, and learns an optimal personalized model (i.e., a converged candidate model) for each client.

图9是本发明提供的基于联邦学习的模型更新系统的结构示意图之二,如图9所示,应用于参与联邦学习的目标客户端,包括:Figure 9 is the second structural schematic diagram of the model update system based on federated learning provided by the present invention. As shown in Figure 9, it is applied to target clients participating in federated learning, including:

第二发送模块910、接收模块911以及第二更新模块912;the second sending module 910, the receiving module 911 and the second update module 912;

所述第二发送模块910,用于将所述目标客户端的数据分布信息发送给参与所述联邦学习的服务器,以使所述服务器根据所述目标客户端的合成数据,对所述目标客户端所属集群进行更新,所述目标客户端包括N个客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的;The second sending module 910 is used to send the data distribution information of the target client to the server participating in the federated learning, so that the server can analyze the data distribution information of the target client according to the synthetic data of the target client. The cluster is updated, the target client includes N clients, and the synthetic data is obtained according to the received data distribution information of the target client;

所述接收模块911,用于在所述服务器确定初始化的K个集群达到稳定分布状态的情况下,接收所述服务器发送的每个集群内的目标聚类模型,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;The receiving module 911 is configured to receive the target clustering model in each cluster sent by the server when the server determines that the initialized K clusters have reached a stable distribution state, and the stable distribution state is the The cluster to which the target client belongs no longer changes, and the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state;

所述第二更新模块912,用于执行如下第一循环过程,直至候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;The second update module 912 is used to perform the following first loop process until the candidate model converges. The candidate model is obtained after the target client updates the received target clustering model in each cluster. ;

所述第一循环过程,包括:The first cycle process includes:

向所述服务器发送候选模型,以使所述服务器对接收到的所述候选模型进行更新;Send the candidate model to the server so that the server updates the received candidate model;

所述第二接收模块,用于接收所述服务器发送的更新后的候选模型,并对所述更新后的候选模型进行更新。The second receiving module is configured to receive the updated candidate model sent by the server, and update the updated candidate model.

本发明提供的基于联邦学习的模型更新系统,参与协作训练的目标客户端将数据分布信息上传至服务器,服务器根据其上传的数据分布信息,对目标客户端进行聚类划分,得到目标客户端所属集群,节省了目标客户端的计算资源和存储资源,减轻了目标客户端与服务器之间的通信开销,为每一个客户端学习一个最优的个性化模型(即收敛的候选模型)。In the federated learning-based model update system provided by the present invention, target clients participating in collaborative training upload data distribution information to the server. The server clusters the target clients based on the uploaded data distribution information to obtain the target client's location. The cluster saves the computing resources and storage resources of the target client, reduces the communication overhead between the target client and the server, and learns an optimal personalized model (i.e., a converged candidate model) for each client.

图10是本发明提供的一种电子设备的实体结构示意图,如图10所示,该电子设备可以包括:处理器(processor)1010、通信接口(communication interface)1011、存储器(memory)1012和总线(bus)513,其中,处理器510,通信接口1011,存储器1012通过总线1013完成相互间的通信。处理器1010可以调用存储器1012中的逻辑指令,以执行如下方法:Figure 10 is a schematic diagram of the physical structure of an electronic device provided by the present invention. As shown in Figure 10, the electronic device may include: a processor (processor) 1010, a communication interface (communication interface) 1011, a memory (memory) 1012 and a bus. (bus) 513, in which the processor 510, the communication interface 1011, and the memory 1012 complete communication with each other through the bus 1013. Processor 1010 can call logic instructions in memory 1012 to perform the following methods:

根据参与所述联邦学习的目标客户端的合成数据,对所述目标客户端所属集群进行更新,直至初始化的K个集群达到稳定分布状态,并将每个集群内的目标聚类模型发送给所述目标客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标客户端包括N个客户端,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;According to the synthetic data of the target clients participating in the federated learning, the cluster to which the target client belongs is updated until the initialized K clusters reach a stable distribution state, and the target clustering model in each cluster is sent to the Target client, the synthetic data is obtained based on the received data distribution information of the target client, the stable distribution state means that the cluster to which the target client belongs does not change, and the target client includes N clients end, the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state;

执行如下第一循环过程,直至所述目标客户端中的候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;Execute the following first loop process until the candidate model in the target client converges, the candidate model is obtained after the target client updates the received target clustering model in each cluster;

所述第一循环过程,包括:The first cycle process includes:

接收目标客户端发送的候选模型,并对所述候选模型进行更新;Receive the candidate model sent by the target client and update the candidate model;

将更新后的候选模型发送给所述目标客户端,以使所述目标客户端对所述候选模型进行更新。The updated candidate model is sent to the target client, so that the target client updates the candidate model.

或,or,

将所述目标客户端的数据分布信息发送给参与所述联邦学习的服务器,以使所述服务器根据所述目标客户端的合成数据,对所述目标客户端所属集群进行更新,所述目标客户端包括N个客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的;Send the data distribution information of the target client to the server participating in the federated learning, so that the server updates the cluster to which the target client belongs based on the synthetic data of the target client, where the target client includes N clients, the synthetic data is obtained according to the received data distribution information of the target client;

在所述服务器确定初始化的K个集群达到稳定分布状态的情况下,接收所述服务器发送的每个集群内的目标聚类模型,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;When the server determines that the initialized K clusters have reached a stable distribution state, receive the target clustering model in each cluster sent by the server, and the stable distribution state means that the cluster to which the target client belongs does not change. , the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state;

执行如下第一循环过程,直至候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;Execute the following first loop process until the candidate model converges, the candidate model is obtained after the target client updates the received target clustering model in each cluster;

所述第一循环过程,包括:The first cycle process includes:

向所述服务器发送候选模型,以使所述服务器对接收到的所述候选模型进行更新;Send the candidate model to the server so that the server updates the received candidate model;

接收所述服务器发送的更新后的候选模型,并对所述更新后的候选模型进行更新。Receive the updated candidate model sent by the server, and update the updated candidate model.

此外,上述的存储器中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机电源屏(可以是个人计算机,服务器,或者网络电源屏等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logical instructions in the memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer power panel (which can be a personal computer, a server, or a network power panel, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code. .

进一步地,本发明公开一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各方法实施例所提供的基于联邦学习的模型更新方法,例如包括:Further, the present invention discloses a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer , the computer can execute the federated learning-based model update method provided by each of the above method embodiments, including, for example:

根据参与所述联邦学习的目标客户端的合成数据,对所述目标客户端所属集群进行更新,直至初始化的K个集群达到稳定分布状态,并将每个集群内的目标聚类模型发送给所述目标客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标客户端包括N个客户端,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;According to the synthetic data of the target clients participating in the federated learning, the cluster to which the target client belongs is updated until the initialized K clusters reach a stable distribution state, and the target clustering model in each cluster is sent to the Target client, the synthetic data is obtained based on the received data distribution information of the target client, the stable distribution state means that the cluster to which the target client belongs does not change, and the target client includes N clients end, the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state;

执行如下第一循环过程,直至所述目标客户端中的候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;Execute the following first loop process until the candidate model in the target client converges, the candidate model is obtained after the target client updates the received target clustering model in each cluster;

所述第一循环过程,包括:The first cycle process includes:

接收目标客户端发送的候选模型,并对所述候选模型进行更新;Receive the candidate model sent by the target client and update the candidate model;

将更新后的候选模型发送给所述目标客户端,以使所述目标客户端对所述候选模型进行更新。The updated candidate model is sent to the target client, so that the target client updates the candidate model.

或,or,

将所述目标客户端的数据分布信息发送给参与所述联邦学习的服务器,以使所述服务器根据所述目标客户端的合成数据,对所述目标客户端所属集群进行更新,所述目标客户端包括N个客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的;Send the data distribution information of the target client to the server participating in the federated learning, so that the server updates the cluster to which the target client belongs based on the synthetic data of the target client, where the target client includes N clients, the synthetic data is obtained according to the received data distribution information of the target client;

在所述服务器确定初始化的K个集群达到稳定分布状态的情况下,接收所述服务器发送的每个集群内的目标聚类模型,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;When the server determines that the initialized K clusters have reached a stable distribution state, receive the target clustering model in each cluster sent by the server, and the stable distribution state means that the cluster to which the target client belongs does not change. , the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state;

执行如下第一循环过程,直至候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;Execute the following first loop process until the candidate model converges, the candidate model is obtained after the target client updates the received target clustering model in each cluster;

所述第一循环过程,包括:The first cycle process includes:

向所述服务器发送候选模型,以使所述服务器对接收到的所述候选模型进行更新;Send the candidate model to the server so that the server updates the received candidate model;

接收所述服务器发送的更新后的候选模型,并对所述更新后的候选模型进行更新。Receive the updated candidate model sent by the server, and update the updated candidate model.

另一方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各实施例提供的基于联邦学习的模型更新方法,例如包括:On the other hand, the present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. The computer program is implemented when executed by a processor to perform the federated learning-based model update method provided by the above embodiments. , including for example:

根据参与所述联邦学习的目标客户端的合成数据,对所述目标客户端所属集群进行更新,直至初始化的K个集群达到稳定分布状态,并将每个集群内的目标聚类模型发送给所述目标客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标客户端包括N个客户端,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;According to the synthetic data of the target clients participating in the federated learning, the cluster to which the target client belongs is updated until the initialized K clusters reach a stable distribution state, and the target clustering model in each cluster is sent to the Target client, the synthetic data is obtained based on the received data distribution information of the target client, the stable distribution state means that the cluster to which the target client belongs does not change, and the target client includes N clients end, the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state;

执行如下第一循环过程,直至所述目标客户端中的候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;Execute the following first loop process until the candidate model in the target client converges, the candidate model is obtained after the target client updates the received target clustering model in each cluster;

所述第一循环过程,包括:The first cycle process includes:

接收目标客户端发送的候选模型,并对所述候选模型进行更新;Receive the candidate model sent by the target client and update the candidate model;

将更新后的候选模型发送给所述目标客户端,以使所述目标客户端对所述候选模型进行更新。The updated candidate model is sent to the target client, so that the target client updates the candidate model.

或,or,

将所述目标客户端的数据分布信息发送给参与所述联邦学习的服务器,以使所述服务器根据所述目标客户端的合成数据,对所述目标客户端所属集群进行更新,所述目标客户端包括N个客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的;Send the data distribution information of the target client to the server participating in the federated learning, so that the server updates the cluster to which the target client belongs based on the synthetic data of the target client, where the target client includes N clients, the synthetic data is obtained according to the received data distribution information of the target client;

在所述服务器确定初始化的K个集群达到稳定分布状态的情况下,接收所述服务器发送的每个集群内的目标聚类模型,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;When the server determines that the initialized K clusters have reached a stable distribution state, receive the target clustering model in each cluster sent by the server, and the stable distribution state means that the cluster to which the target client belongs does not change. , the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state;

执行如下第一循环过程,直至候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;Execute the following first loop process until the candidate model converges, the candidate model is obtained after the target client updates the received target clustering model in each cluster;

所述第一循环过程,包括:The first cycle process includes:

向所述服务器发送候选模型,以使所述服务器对接收到的所述候选模型进行更新;Send the candidate model to the server so that the server updates the received candidate model;

接收所述服务器发送的更新后的候选模型,并对所述更新后的候选模型进行更新。Receive the updated candidate model sent by the server, and update the updated candidate model.

以上所描述的系统实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The system embodiments described above are only illustrative. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in One location, or it can be distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Persons of ordinary skill in the art can understand and implement the method without any creative effort.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机电源屏(可以是个人计算机,服务器,或者网络电源屏等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the part of the above technical solution that essentially contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., including a number of instructions to cause a computer power panel (which can be a personal computer, a server, or a network power panel, etc.) to execute the methods described in various embodiments or certain parts of the embodiments.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still be used Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent substitutions are made to some of the technical features; however, these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1.一种基于联邦学习的模型更新方法,应用于参与联邦学习的服务器,其特征在于,包括:1. A model update method based on federated learning, applied to servers participating in federated learning, which is characterized by: 根据参与所述联邦学习的目标客户端的合成数据,对所述目标客户端所属集群进行更新,直至初始化的K个集群达到稳定分布状态,并将每个集群内的目标聚类模型发送给所述目标客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标客户端包括N个客户端,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;According to the synthetic data of the target clients participating in the federated learning, the cluster to which the target client belongs is updated until the initialized K clusters reach a stable distribution state, and the target clustering model in each cluster is sent to the Target client, the synthetic data is obtained based on the received data distribution information of the target client, the stable distribution state means that the cluster to which the target client belongs does not change, and the target client includes N clients end, the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state; 执行如下第一循环过程,直至所述目标客户端中的候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;Execute the following first loop process until the candidate model in the target client converges, the candidate model is obtained after the target client updates the received target clustering model in each cluster; 所述第一循环过程,包括:The first cycle process includes: 接收目标客户端发送的候选模型,并对所述候选模型进行更新;Receive the candidate model sent by the target client and update the candidate model; 将更新后的候选模型发送给所述目标客户端,以使所述目标客户端对所述候选模型进行更新。The updated candidate model is sent to the target client, so that the target client updates the candidate model. 2.根据权利要求1所述的基于联邦学习的模型更新方法,应用于参与联邦学习的服务器,其特征在于,所述根据所述目标客户端的合成数据,对所述目标客户端所属集群进行更新,包括:2. The model update method based on federated learning according to claim 1, applied to servers participating in federated learning, characterized in that the cluster to which the target client belongs is updated based on the synthetic data of the target client. ,include: 初始化目标客户端所属集群;Initialize the cluster to which the target client belongs; 根据每个集群内的聚类模型的经验损失函数,获取每个客户端的合成数据在每个集群内的聚类模型的经验损失值;According to the empirical loss function of the clustering model in each cluster, obtain the empirical loss value of the clustering model in each cluster for the synthetic data of each client; 根据所述每个客户端的合成数据在每个集群内的聚类模型的经验损失值,对所述目标客户端所属集群进行更新,以确定所述K个集群达到稳定分布状态时,每个集群内包含的客户端,所述每个集群内包含的客户端为所述目标客户端中满足合成数据在每个集群内的聚类模型的经验损失值达到最小值的客户端。According to the empirical loss value of the clustering model of the synthetic data of each client in each cluster, the cluster to which the target client belongs is updated to determine when the K clusters reach a stable distribution state. The clients included in each cluster are the clients among the target clients that satisfy the experience loss value of the clustering model of the synthetic data in each cluster reaching the minimum value. 3.根据权利要求2所述的基于联邦学习的模型更新方法,应用于参与联邦学习的服务器,其特征在于,所述根据所述每个客户端的合成数据在每个集群内的聚类模型的经验损失值,对所述目标客户端所属集群进行更新,包括:3. The model update method based on federated learning according to claim 2, applied to servers participating in federated learning, characterized in that the clustering model in each cluster according to the synthetic data of each client The experience loss value is updated for the cluster to which the target client belongs, including: 执行如下第二循环过程,直至所述K个集群达到稳定分布状态;Execute the following second loop process until the K clusters reach a stable distribution state; 所述第二循环过程,包括:The second cycle process includes: 基于梯度下降法对每个集群内的聚类模型进行更新;Update the clustering model within each cluster based on the gradient descent method; 基于每个集群包含的客户端的合成数据,更新每个集群内的包含的客户端在集群内的更新后的聚类模型的经验损失值;Based on the synthetic data of the clients included in each cluster, update the empirical loss value of the updated clustering model of the clients included in each cluster within the cluster; 根据所述每个集群内的包含的客户端在集群内的更新后的聚类模型的经验损失值,对所述目标客户端所属集群进行更新。The cluster to which the target client belongs is updated according to the empirical loss value of the updated clustering model of the clients contained in each cluster in the cluster. 4.根据权利要求1所述的基于联邦学习的模型更新方法,应用于参与联邦学习的服务器,其特征在于,所述接收目标客户端发送的所述候选模型,并对所述候选模型进行更新,包括:4. The model update method based on federated learning according to claim 1, applied to servers participating in federated learning, characterized in that: receiving the candidate model sent by the target client and updating the candidate model ,include: 根据第一优化目标函数与第二优化目标函数之和,确定所述候选模型的优化目标函数,所述第一优化目标函数为所述目标客户端的候选模型的损失函数之和,所述第二优化目标函数为任一客户端的接收到的目标聚类模型与所述目标客户端中的其余客户端接收到的目标聚类模型之间差异的非线性函数之和;The optimization objective function of the candidate model is determined according to the sum of the first optimization objective function and the second optimization objective function. The first optimization objective function is the sum of the loss functions of the candidate models of the target client. The second optimization objective function is the sum of the loss functions of the candidate models of the target client. The optimization objective function is the sum of nonlinear functions of differences between the target clustering model received by any client and the target clustering model received by the remaining clients in the target client; 基于梯度下降法对所述第一优化目标函数进行优化;Optimize the first optimization objective function based on the gradient descent method; 基于近似点法对第二优化目标函数进行优化;Optimize the second optimization objective function based on the approximate point method; 根据所述优化目标函数取最小值时的候选模型,对所述候选模型进行更新。The candidate model is updated according to the candidate model when the optimization objective function takes the minimum value. 5.一种基于联邦学习的模型更新方法,应用于参与联邦学习的目标客户端,其特征在于,包括:5. A model update method based on federated learning, applied to target clients participating in federated learning, characterized by: 将所述目标客户端的数据分布信息发送给参与所述联邦学习的服务器,以使所述服务器根据所述目标客户端的合成数据,对所述目标客户端所属集群进行更新,所述目标客户端包括N个客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的;Send the data distribution information of the target client to the server participating in the federated learning, so that the server updates the cluster to which the target client belongs based on the synthetic data of the target client, where the target client includes N clients, the synthetic data is obtained according to the received data distribution information of the target client; 在所述服务器确定初始化的K个集群达到稳定分布状态的情况下,接收所述服务器发送的每个集群内的目标聚类模型,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;When the server determines that the initialized K clusters have reached a stable distribution state, receive the target clustering model in each cluster sent by the server, and the stable distribution state means that the cluster to which the target client belongs does not change. , the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state; 执行如下第一循环过程,直至候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;Execute the following first loop process until the candidate model converges, the candidate model is obtained after the target client updates the received target clustering model in each cluster; 所述第一循环过程,包括:The first cycle process includes: 向所述服务器发送候选模型,以使所述服务器对接收到的所述候选模型进行更新;Send the candidate model to the server so that the server updates the received candidate model; 接收所述服务器发送的更新后的候选模型,并对所述更新后的候选模型进行更新。Receive the updated candidate model sent by the server, and update the updated candidate model. 6.根据权利要求5所述的基于联邦学习的模型更新方法,应用于参与联邦学习的目标客户端,其特征在于,所述目标客户端的数据分布信息的获取方式,包括:6. The model update method based on federated learning according to claim 5, applied to target clients participating in federated learning, characterized in that the method of obtaining data distribution information of the target client includes: 基于知识蒸馏技术,预训练教师网络;Based on knowledge distillation technology, pre-train teacher network; 将训练好的教师网络作为生成式对抗网络的判别器,所述生成式对抗网络部署在所述目标客户端;Use the trained teacher network as the discriminator of a generative adversarial network, which is deployed on the target client; 基于所述判别器训练所述生成式对抗网络中的生成器,直至所述生成式对抗网络的损失函数的取值小于预设值;Train the generator in the generative adversarial network based on the discriminator until the value of the loss function of the generative adversarial network is less than a preset value; 根据所述训练好的生成器,确定所述目标客户端的数据分布信息。According to the trained generator, the data distribution information of the target client is determined. 7.一种基于联邦学习的模型更新系统,应用于参与联邦学习的服务器,其特征在于,包括:第一发送模块以及第一更新模块;7. A model update system based on federated learning, applied to servers participating in federated learning, characterized by including: a first sending module and a first update module; 所述第一发送模块,用于根据参与所述联邦学习的目标客户端的合成数据,对所述目标客户端所属集群进行更新,直至初始化的K个集群达到稳定分布状态,并将每个集群内的目标聚类模型发送给所述目标客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标客户端包括N个客户端,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;The first sending module is used to update the cluster to which the target client belongs based on the synthetic data of the target client participating in the federated learning until the initialized K clusters reach a stable distribution state, and update the clusters within each cluster. The target clustering model is sent to the target client, the synthetic data is obtained according to the received data distribution information of the target client, and the stable distribution state means that the cluster to which the target client belongs does not change, The target clients include N clients, and the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state; 所述第一更新模块,用于执行如下第一循环过程,直至所述目标客户端中的候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;The first update module is configured to perform the following first loop process until the candidate model in the target client converges. The candidate model is the target cluster within each cluster received by the target client. Obtained after the model is updated; 所述第一循环过程,包括:The first cycle process includes: 接收目标客户端发送的候选模型,并对所述候选模型进行更新;Receive the candidate model sent by the target client and update the candidate model; 所述第二发送模块,用于将更新后的候选模型发送给所述目标客户端,以使所述目标客户端对所述候选模型进行更新。The second sending module is used to send the updated candidate model to the target client, so that the target client updates the candidate model. 8.一种基于联邦学习的模型更新系统,应用于参与联邦学习的目标客户端,其特征在于,包括:第二发送模块、接收模块以及第二更新模块;8. A model update system based on federated learning, applied to target clients participating in federated learning, characterized by including: a second sending module, a receiving module and a second update module; 所述第二发送模块,用于将所述目标客户端的数据分布信息发送给参与所述联邦学习的服务器,以使所述服务器根据所述目标客户端的合成数据,对所述目标客户端所属集群进行更新,所述目标客户端包括N个客户端,所述合成数据是根据接收到的所述目标客户端的数据分布信息得到的;The second sending module is used to send the data distribution information of the target client to the server participating in the federated learning, so that the server can analyze the cluster to which the target client belongs based on the synthetic data of the target client. Update is performed, the target client includes N clients, and the synthetic data is obtained according to the received data distribution information of the target client; 所述接收模块,用于在所述服务器确定初始化的K个集群达到稳定分布状态的情况下,接收所述服务器发送的每个集群内的目标聚类模型,所述稳定分布状态为所述目标客户端所属集群不再变化,所述目标聚类模型是根据所述初始化的K个集群达到稳定分布状态下的每个集群内的聚类模型确定的;The receiving module is configured to receive the target clustering model in each cluster sent by the server when the server determines that the initialized K clusters have reached a stable distribution state, and the stable distribution state is the target The cluster to which the client belongs no longer changes, and the target clustering model is determined based on the clustering model in each cluster when the initialized K clusters reach a stable distribution state; 所述第二更新模块,用于执行如下第一循环过程,直至候选模型收敛,所述候选模型是所述目标客户端对接收到的每个集群内的目标聚类模型进行更新后得到的;The second update module is used to perform the following first loop process until the candidate model converges. The candidate model is obtained after the target client updates the received target clustering model in each cluster; 所述第一循环过程,包括:The first cycle process includes: 向所述服务器发送候选模型,以使所述服务器对接收到的所述候选模型进行更新;Send the candidate model to the server so that the server updates the received candidate model; 所述第二接收模块,用于接收所述服务器发送的更新后的候选模型,并对所述更新后的候选模型进行更新。The second receiving module is configured to receive the updated candidate model sent by the server, and update the updated candidate model. 9.一种电子设备,包括处理器和存储有计算机程序的存储器,其特征在于,所述处理器执行所述计算机程序时实现权利要求1-4或5-6任一项所述基于联邦学习的模型更新方法。9. An electronic device, comprising a processor and a memory storing a computer program, characterized in that when the processor executes the computer program, the federated learning-based method of any one of claims 1-4 or 5-6 is implemented. model update method. 10.一种非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,该计算机程序被处理器执行时实现如权利要求1-4或5-6任一项所述基于联邦学习的模型更新方法。10. A non-transitory computer-readable storage medium with a computer program stored thereon, characterized in that when the computer program is executed by a processor, the federation-based storage medium as described in any one of claims 1-4 or 5-6 is implemented. Learned model update methods.
CN202310706337.3A 2023-06-14 2023-06-14 Model updating method and system based on federal learning Pending CN116719607A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310706337.3A CN116719607A (en) 2023-06-14 2023-06-14 Model updating method and system based on federal learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310706337.3A CN116719607A (en) 2023-06-14 2023-06-14 Model updating method and system based on federal learning

Publications (1)

Publication Number Publication Date
CN116719607A true CN116719607A (en) 2023-09-08

Family

ID=87869338

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310706337.3A Pending CN116719607A (en) 2023-06-14 2023-06-14 Model updating method and system based on federal learning

Country Status (1)

Country Link
CN (1) CN116719607A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117892805A (en) * 2024-03-18 2024-04-16 清华大学 Personalized federated learning method based on hypernetwork and layer-level collaborative graph aggregation

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117892805A (en) * 2024-03-18 2024-04-16 清华大学 Personalized federated learning method based on hypernetwork and layer-level collaborative graph aggregation
CN117892805B (en) * 2024-03-18 2024-05-28 清华大学 Personalized federated learning method based on hypernetwork and layer-level collaborative graph aggregation

Similar Documents

Publication Publication Date Title
WO2020108474A1 (en) Picture classification method, classification identification model generation method and apparatus, device, and medium
CN113361694A (en) Layered federated learning method and system applying differential privacy protection
WO2022057433A1 (en) Machine learning model training method and related device
CN113128701A (en) Sample sparsity-oriented federal learning method and system
CN113822315B (en) Property graph processing method, device, electronic device and readable storage medium
CN115587633A (en) A Personalized Federated Learning Method Based on Parameter Hierarchy
CN114091667A (en) A federated mutual learning model training method for non-IID data
CN115344883A (en) A personalized federated learning method and device for dealing with imbalanced data
CN117236421B (en) Large model training method based on federal knowledge distillation
CN115495771A (en) Data privacy protection method and system based on adaptive weight adjustment
CN116563587A (en) Method and system for embedded clustering of depth of graph convolution structure based on slimed-Wasserstein distance
Matsuda et al. Benchmark for personalized federated learning
CN118674015A (en) Personalized federal learning method based on prototype alignment learning
CN117371555A (en) Federal learning model training method based on domain generalization technology and unsupervised clustering algorithm
CN114861917A (en) Knowledge graph inference model, system and inference method for Bayesian small sample learning
CN117038053A (en) Semi-supervised longitudinal federal learning method for collaborative perception of metadata and image features
CN116719607A (en) Model updating method and system based on federal learning
CN115686868A (en) A Cross-Node Multimodal Retrieval Method Based on Federated Hash Learning
CN115470520A (en) A Differential Privacy and Denoising Data Protection Method under the Vertical Federation Framework
CN115880723A (en) A method for person re-identification based on unsupervised multi-source domain adaptation based on sample weighting
CN113377990B (en) Video/picture-text cross-modal matching training method based on meta-self-paced learning
CN116259057A (en) A Method to Solve Data Heterogeneity in Federated Learning Based on Alliance Game
Pan et al. Privacy-preserving heterogeneous Personalized federated learning with knowledge
CN115312158A (en) Metadata and image feature double-perception personalized federal learning method
Jin et al. Decentralized Two-Stage Federated Learning with Knowledge Transfer

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination