Model training method and device and related equipment
By constructing a collaboration graph and using a meta-learning strategy in a cloud-edge-device environment, fine-grained fusion of the global and local models is achieved, solving the problem of balancing model generalization and personalization in traditional methods, and improving the model's adaptability and robustness in heterogeneous data environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2026-01-21
- Publication Date
- 2026-05-01
AI Technical Summary
Traditional deep learning training methods struggle to effectively capture data heterogeneity in cloud-edge-device network environments, making it difficult for models to balance generalization and personalization, thus affecting their effectiveness and stability in practical applications.
By constructing a collaboration graph, fine-grained fusion of the global and local models is achieved using weight and hierarchical parameters. Combined with meta-learning strategies, the weight and hierarchical parameters of the aggregation module are dynamically adjusted to improve the model's adaptability and robustness in heterogeneous data environments.
It enables efficient training of models in heterogeneous data environments, improves the generalization and personalized adaptability of models, and enhances inference performance and stability in large-scale distributed scenarios in cloud, edge, and device environments.
Smart Images

Figure CN121960657A_ABST
Abstract
Description
Model training methods, devices and related equipment Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a model training method, apparatus and related equipment. Background Technology
[0002] With the increasing scale and complexity of data center distribution, building deep learning models for cloud-edge-device environments that address the differences in data center distribution has become a key research direction. Traditional deep learning training typically relies on centralized datasets, while in cloud-edge-device network environments, data from different data centers often exhibit significant non-independent and non-identically distributed (Non-IID) characteristics.
[0003] Therefore, it is necessary to construct a deep learning method for cloud-edge-device environments that addresses the differences in data center distribution. Traditional distributed training methods are difficult to effectively capture the heterogeneity of data, making it difficult for a single trained model to meet the inference needs of all data centers. In other words, there are still shortcomings in dealing with the heterogeneity of data in different data centers or edge nodes, which affects the overall performance and generalization of the model. This makes it difficult for the model to balance generalization and personalization, thus affecting its effectiveness and stability in practical applications. Summary of the Invention
[0004] This application provides a model training method, apparatus, and related equipment, which can solve the technical problem in related technologies that models have difficulty in balancing generalization and personalization, affecting their effectiveness and stability in practical applications.
[0005] In a first aspect, embodiments of this application provide a model training method applied to a first client, the method comprising:
[0006] Receive model parameters of the global model, which are obtained by aggregating model parameters of K local models of K clients, including the first client, where K is a positive integer greater than 1;
[0007] Based on the weight parameter, the hierarchy parameter, the model parameters of the global model, and the model parameters of the local model of the first client, the local model of the first client is updated; the weight parameter is used to aggregate the model parameters of the global model and the model parameters of the local model of the first client, and the hierarchy parameter is used to indicate the hierarchy range of aggregating the global model and the local model of the first client.
[0008] Based on the data from the data center corresponding to the first client, the updated local model of the first client is trained.
[0009] Secondly, embodiments of this application provide a model training method applied to a server, the method comprising:
[0010] Receive model parameters of K local models sent by K clients, wherein the K clients include the first client, and each local model is trained based on data from the data center corresponding to each client, and K is a positive integer greater than 1;
[0011] The global model is obtained by aggregating the model parameters of the K local models.
[0012] The global model is sent to the K clients respectively. The global model is used by the first client to update the local model of the first client based on the weight parameter, the level parameter, the model parameter of the global model and the model parameter of the local model of the first client. The weight parameter is used to aggregate the model parameter of the global model and the model parameter of the local model of the first client. The level parameter is used to indicate the level range of aggregating the global model and the local model of the first client.
[0013] Thirdly, embodiments of this application provide a model training apparatus applied to a first client, the apparatus comprising:
[0014] The first receiving module is used to receive the model parameters of the global model. The model parameters of the global model are obtained by aggregating the model parameters of the local models of K clients. The K clients include the first client, and K is a positive integer greater than 1.
[0015] The first update module is used to update the local model of the first client based on the weight parameter, the level parameter, the model parameters of the global model and the model parameters of the local model of the first client; the weight parameter is used to aggregate the model parameters of the global model and the model parameters of the local model of the first client, and the level parameter is used to indicate the level range of aggregating the global model and the local model of the first client.
[0016] The training module is used to train the updated local model of the first client based on the data from the data center corresponding to the first client.
[0017] Fourthly, embodiments of this application provide a model training apparatus applied to a server, the apparatus comprising:
[0018] The second receiving module is used to receive model parameters of K local models sent by K clients, wherein the K clients include the first client, and each local model is trained based on data from the data center corresponding to each client, and K is a positive integer greater than 1.
[0019] The aggregation module is used to aggregate the model parameters of the K local models to obtain a global model;
[0020] The sending module is used to send the global model to the K clients respectively. The global model is used by the first client to update the local model of the first client based on the weight parameter, the level parameter, the model parameter of the global model and the model parameter of the local model of the first client. The weight parameter is used to aggregate the model parameter of the global model and the model parameter of the local model of the first client. The level parameter is used to indicate the level range of aggregating the global model and the local model of the first client.
[0021] Fifthly, embodiments of this application provide a client, including: a first processor, a first memory, and a program stored in the first memory and executable on the first processor, wherein when the program is executed by the first processor, it implements the steps of the model training method as described in the first aspect.
[0022] In a sixth aspect, embodiments of this application provide a server, including: a second processor, a second memory, and a program stored in the second memory and executable on the second processor, wherein the program, when executed by the second processor, implements the steps of the model training method as described in the second aspect.
[0023] In a seventh aspect, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the model training method as described in the first aspect, or the steps of the model training method as described in the second aspect.
[0024] Eighthly, embodiments of this application provide a computer program product, including computer instructions that, when executed by a processor, implement the steps of the model training method as described in the first aspect, or the steps of the model training method as described in the second aspect.
[0025] In this embodiment, the server receives model parameters of K local models from K clients, including a first client. The server aggregates the model parameters of the K local models to obtain a global model. The global model is then sent to each of the K clients. Each client, such as the first client, receives the model parameters of the global model from the server and updates its local model based on weight parameters, hierarchical parameters, the model parameters of the global model, and the model parameters of its own local model. The weight parameters are used to aggregate the model parameters of the global model and the local model of the first client, and the hierarchical parameters indicate the hierarchical range of aggregating the global model and the local model of the first client. The updated local model of the first client is trained based on data from the data center corresponding to the first client. This allows for fine-grained fusion of the global and local models at the hierarchical and element levels through weight parameters and hierarchical parameters. This balances the generalization and personalization of the model and effectively improves the adaptability, robustness, and inference performance of deep learning models in heterogeneous data environments, promoting efficient training in large-scale distributed scenarios across cloud, edge, and device. Attached Figure Description
[0026] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 is a flowchart of one of the model training methods provided in an embodiment of this application;
[0028] Figure 2 is a second flowchart of a model training method provided in an embodiment of this application;
[0029] Figure 3 is an implementation architecture diagram of a specific example of a model training method in an embodiment of this application;
[0030] Figure 4 is a schematic diagram of one of the structures of a model training device provided in an embodiment of this application;
[0031] Figure 5 is a second schematic diagram of the structure of a model training device provided in an embodiment of this application;
[0032] Figure 6 is a schematic diagram of the structure of a client provided in an embodiment of this application;
[0033] Figure 7 is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0034] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0035] With the increasing scale and complexity of data center distribution, building deep learning models for cloud-edge-device environments that address the differences in data center distribution has become a key research direction. Traditional deep learning training typically relies on centralized datasets. However, in cloud-edge-device network environments, data from different data centers often exhibit significant non-IID characteristics. Traditional distributed training methods struggle to effectively capture these data heterogeneity differences, making it difficult for a single trained model to meet the inference needs of all data centers, thus affecting the overall performance and generalization ability of the model. Therefore, it is necessary to construct deep learning methods for cloud-edge-device environments that address the differences in data center distribution. This includes designing flexible model fusion strategies and training algorithms, fully leveraging the data heterogeneity of each data center while taking into full account the limitations and latency of cloud-edge-device network communication, and improving the model's generalization ability.
[0036] In related technologies, some progress has been made in distributed training, task scheduling, and resource management in cloud-edge-device environments. However, when dealing with the heterogeneity of data in various data centers or edge nodes, the following shortcomings still exist, making it difficult for the model to balance generalization and personalization, thus affecting its effectiveness and stability in practical applications.
[0037] Specifically, the relevant technologies have the following technical problems.
[0038] 1. Lack of fine-grained modeling and control of client-side collaborative relationships.
[0039] The related technologies generally adopt a unified aggregation strategy, which makes it difficult to clearly distinguish the importance and reliability of models uploaded by different clients, and cannot dynamically adjust the collaboration strength and aggregation weight according to data heterogeneity. This not only reduces the model's ability to generalize to heterogeneous data, but may also introduce security risks in the presence of malicious clients, further weakening the model's performance and robustness.
[0040] 2. The ability to integrate the global model with the local model (i.e., the client's local model) is insufficient, making it difficult to balance generalization and personalization requirements.
[0041] Related technologies typically use a unified global model to directly overwrite the local model, and then perform local fine-tuning, ignoring the personalized data features already captured by the local model. This approach fails to effectively integrate the advantages of global and local models, making it difficult for the model to adapt to the data characteristics of different clients, severely impacting terminal-side inference performance and user experience.
[0042] 3. Failed to effectively explore and utilize the correlations and collaborations between clients.
[0043] There may be similarities in data distribution or business needs among different clients, but related technologies generally lack the ability to identify and utilize such potential correlations, and cannot build effective collaboration mechanisms to promote knowledge sharing and personalized improvement, thus limiting the optimization space and generalization performance of the overall model.
[0044] To address the aforementioned technical problems, this application proposes a model training method, the core idea of which is:
[0045] 1. Fully explore and utilize the data distribution correlation and collaboration relationships between clients, construct a collaboration graph through collaboration relationships, and use dynamic aggregation strategies based on the collaboration graph to integrate local models and improve the knowledge sharing efficiency between nodes with similar data characteristics.
[0046] 2. Fine-grained fusion of global and local models at the hierarchical and element levels can be achieved through weight parameters and hierarchical parameters. By using an element- and hierarchical adjustable aggregation mechanism, as well as learning and optimization of weight and hierarchical parameters, the generalization and personalization of the model can be balanced.
[0047] This effectively improves the adaptability, robustness, and inference performance of deep learning models in heterogeneous data environments, and promotes efficient training in large-scale distributed scenarios involving cloud, edge, and device.
[0048] It should be noted that the model training method in this application embodiment is applied to a model training system and involves technical fields such as artificial intelligence, cloud computing, big data, and edge computing. The model training system may include K clients and servers. The clients and servers can interact multiple times to implement the model training method in this application embodiment in an iterative manner.
[0049] Referring to Figure 1, which is a flowchart of one of the model training methods provided in this application embodiment, the method is applied to a first client, which can be any one of K clients. As shown in Figure 1, the method includes the following steps:
[0050] Step 101: Receive the model parameters of the global model sent by the server. The model parameters of the global model are obtained by aggregating the model parameters of the K local models sent by K clients. The K clients include the first client, and K is a positive integer greater than 1.
[0051] Step 102: Update the local model of the first client based on the weight parameter, the hierarchical parameter, the model parameters of the global model, and the model parameters of the local model of the first client; the weight parameter is used to aggregate the model parameters of the global model and the model parameters of the local model of the first client, and the hierarchical parameter is used to indicate the hierarchical range of aggregating the global model and the local model of the first client.
[0052] Step 103: Based on the data from the data center corresponding to the first client, train the updated local model of the first client.
[0053] It should be noted that there are two models in this application embodiment: a global model of the server and a local model of the client. Each client trains a local model based on the data of the corresponding data center and uploads the model parameters of the trained local model to the server. The server can aggregate the model parameters of the local model to obtain the global model and send the global model to each client. Accordingly, the client can update the local model based on the global model and start the next round of model training.
[0054] In step 101, each local model is trained based on data from the data center corresponding to each client. The data center data may include text, images, audio, and other data.
[0055] It's important to note that data from different data centers can exhibit non-independent and identically distributed (Non-IID) characteristics. Non-IID refers to a set of random variables that does not satisfy the conditions for independence or identical distribution, typically manifesting as dependencies between samples or samples from different probability distributions. Specifically, it means that in a dataset, samples do not meet the conditions for independent and identical distribution; that is, the samples are not independently sampled from the same distribution. This situation is very common in many practical applications, especially in time series data, social network data, and sensor data.
[0056] The characteristics of non-independent identically distributed (Non-IID) data are as follows:
[0057] 1. Dependency: There is some kind of dependency between samples that are not independent and identically distributed. For example, the current value in time series data may be related to past values. In this case, the joint probability distribution between samples cannot be simply represented as the product of their respective marginal distributions.
[0058] 2. Different distributions: The samples may come from different probability distributions. For example, in a multi-stage stochastic process, the random variables in different stages may follow different distributions.
[0059] 3. Heterogeneity: Non-independent and identically distributed can be regarded as a manifestation of heterogeneity. Heterogeneity usually refers to the presence of multiple different types, attributes or characteristics of elements in a system or group.
[0060] Assuming the model training system has Each client, for the client For example, the first client, set This is its local dataset, which is the data from the data center corresponding to the client, and the dataset size can be... , These are the local personalized model parameters, i.e., the model parameters of the local model. Let be its local empirical loss function, where This refers to a predefined loss function based on a specific task. Each client can train a local model using data from its corresponding data center and the predefined loss function, and then send the trained local model parameters to the server.
[0061] Correspondingly, the server can aggregate the model parameters of K local models. In some embodiments, the model parameters of the K local models can be weighted and summed to aggregate the model parameters of the K local models. Specifically, a unified aggregation method can be used, directly using fixed weights or average aggregation, to uniformly distribute the global model. However, this method is difficult to distinguish the differences in client data characteristics, cannot cope with the heterogeneity of data distribution, has insufficient model generalization and robustness, and cannot improve the adaptability to heterogeneous data.
[0062] In some embodiments, a global model can be obtained by parameter weighting aggregation based on the relative size of the dataset. However, since the data distribution of data centers among clients is heterogeneous and exhibits non-independent and identically distributed characteristics, the global model obtained by parameter weighting aggregation based on the relative size of the dataset will hinder knowledge sharing among clients with similar data distributions, thereby weakening the model's generalization ability.
[0063] In some embodiments, the collaborative relationships between clients can be leveraged to increase the weights of model parameters from clients with similar data distributions, thereby achieving the fusion of global knowledge.
[0064] In some embodiments, a global model is obtained by aggregating the model parameters of the K local models, including:
[0065] Based on the collaboration strength between the first client and each of the K clients, the K local models are weighted and summed to obtain the global model corresponding to the first client. The collaboration strength between the first client and the target client among the K clients is determined based on the similarity between the model parameters of the local model of the first client and the model parameters of the local model of the target client.
[0066] Then, for each client, the global model corresponding to that client is sent to that client.
[0067] In some embodiments, a collaboration graph of the K clients can be constructed based on the similarity between the model parameters of the local models of every two clients. The collaboration graph is used to represent the collaboration relationships and collaboration strength between different clients.
[0068] Specifically, it can build collaboration graphs. To express the collaborative relationship between different clients, where the node set Includes all One client, adjacency matrix elements Reflects the client and client There is a collaborative relationship between them, and the value represents the strength of the collaboration between the two clients.
[0069] Since client data distribution is not readily available in practice, it's difficult to directly determine client collaboration relationships. The server can infer these relationships from the model parameters of a local model. The principle is that two clients with similar data distributions should also have similar model parameters, indicating a high degree of collaboration.
[0070] In some implementations, self-attention networks can be used to calculate the similarity between the model parameters of local models on different clients, thereby constructing a collaboration graph. .
[0071] The similarity between local models on the client side is calculated as follows:
[0072] Similarity can be calculated by introducing an attention mechanism. First, two learnable linear transformation matrices are used. and The model parameters of the local model for each client. Convert to query vector and key vector , represented as It can obtain the query vector and key vector corresponding to the model parameters of the local model for each client, and can use the dot product to calculate the client. The query vector corresponding to the model parameters of the local model (which can be the first client). With the client The key vector corresponding to the model parameters of the local model (which can be the target client). similarity between , represented as .
[0073] in, It is the dimension of the query vector and the key vector. The dot product operation can reflect the correlation of the model parameters of the local models of two clients in the transformed space, and can dynamically evaluate the similarity between the model parameters of the local models of different clients.
[0074] In some embodiments, collaboration graph optimization can be performed, the optimization objective of which is to minimize the collaboration loss of the network while maximizing the collaboration strength of similar clients.
[0075] The server can construct a collaboration graph of the K clients based on the similarity between the model parameters of the local models of every two clients. Then, based on the similarity between the model parameters of the local models of different clients and the relative size of the data used by each client to train its local model, the server updates the collaboration strength between different clients in the collaboration graph, with the optimization objective of maximizing the collaboration strength of similar clients. The collaboration strength between the first client and the target client is kept consistent with the relative size of the data used by the target client to train its local model. Afterwards, based on the updated collaboration strength between the first client and each of the K clients in the collaboration graph, the server performs a weighted summation of the K local models to obtain the global model corresponding to the first client. The first client can be any of the K clients, and the global model corresponding to each client is calculated in the same way.
[0076] Due to the large dataset size and communication resource consumption, the server cannot obtain the local dataset of each client, thus making it impossible to directly evaluate the loss of the client's local model. It is assumed that clients with larger datasets are generally more reliable. To satisfy this assumption, the cooperation strength... Should be with the client The data used to train the local model should be of a relatively consistent size. Therefore, the optimization objective of the collaboration graph can be expressed as follows:
[0077]
[0078] in, Can be used for each client The relative size of the data used to train the local model. This is a hyperparameter used to balance the weighted collaboration based on the relative size of the data with the weighted collaboration based on the similarity of the model parameters. For the client and client The similarity between the model parameters of the local models. The constraints of the collaboration graph optimization objective are: .
[0079] After completing the optimization task, the server can use the optimized collaboration graph. Calculate each client Aggregation model ,use This is indicated and sent to the corresponding client.
[0080] In this way, the server analyzes the model parameters of the local models uploaded by the clients, uses an attention mechanism to calculate the similarity between the model parameters of the local models of each client, and dynamically constructs a collaboration graph that reflects the collaboration intensity of different clients, taking into account the dataset size factor. This graph is used to guide subsequent model aggregation strategies. In this way, the correlation and collaboration between the data distribution of clients can be fully explored and utilized, and the generation effect of the subsequent personalized global model can be effectively optimized by using the collaboration graph. This solves the core problem of insufficient collaboration efficiency and generalization ability in heterogeneous data environments, and improves the knowledge sharing efficiency between nodes with similar data features.
[0081] Furthermore, based on the collaboration intensity reflected in the collaboration graph, personalized global models are generated for different clients, avoiding the forced overriding of local models by a unified model and improving the adaptability and effectiveness of the model on local data. The aggregation mechanism of the personalized global model based on the collaboration graph proposed in this application is used in conjunction with the construction of the collaboration graph. This can solve the technical problems of related technologies that use overall model replacement or uniform proportion fusion, lack the distinction of importance of different levels and parameters, and cannot finely balance the information fusion relationship between global and local models. The embodiments of this application can ensure the effect of personalized model generation and improve the adaptability and robustness of the model in heterogeneous data environments.
[0082] Correspondingly, the server can send the global model corresponding to each client to the respective client.
[0083] The client, such as the first client, can receive the model parameters of the global model sent by the server.
[0084] In related technologies, a fixed-level or global coverage approach can be adopted, abandoning dynamic fusion of different levels and parameter granularities, and reverting to a uniform ratio or overall replacement of the fusion method. However, this method cannot retain the local model's personalized features with fine granularity, and forced uniformity can easily lead to the degradation of local model performance, failing to achieve the effect of balancing global generalization and local adaptation.
[0085] In step 102, because the aggregated global model contains highly general knowledge, directly applying it to local clients often fails to achieve good generalization performance. Different clients have varying data distributions and personalized needs, meaning that fine-tuning the global model on local datasets alone often fails to achieve optimal performance. Therefore, to better meet the personalized needs of various clients, an element-level model parameter aggregation mechanism is proposed. This mechanism performs fine-grained fusion of the global model's parameters and the local model's parameters at the element level to achieve personalized optimization.
[0086] Because the server will serve different clients Send different global models, so you can use Indicates iteration Rounds are sent to the client The global model, using Indicates client In iteration A local model of the rounds. In related technologies, the server iterates... Global model in rounds Send to client It uses a global model. Directly overwrite the client Old local model To initialize the new local model ,Right now
[0087] This approach often loses the information learned from the local dataset in the previous training rounds. Therefore, element-wise aggregation methods can be used to update the local model. This involves weighted summation of each corresponding parameter between the global and local models based on weight parameters, rather than simply overwriting them. The update formula for the local model uses... It indicates. Among them, This represents the Hadamard product (i.e., element-wise multiplication between matrices). It is for the client. The aggregate weights are the weight parameters. This refers to the update difference between the global model and the local model. To ensure that... The value is in Within the range, all elements in the weight parameters also need to be regularized using... express.
[0088] Furthermore, hierarchical parameters can be introduced to perform fine-grained element-level and hierarchical cascading fusion of the global and local models. Considering that the lower layers of deep neural networks learn more general information than the higher layers, hierarchical parameters can be introduced. The hierarchy parameter is used to indicate the hierarchy range of the aggregation of the global model and the local model of the first client. The hierarchy range refers to the range of the aggregation hierarchy of the global model and the local model. The hierarchy parameter can be used to control the range of the aggregation hierarchy of the global model and the local model, such as the model parameters of the aggregation model from the 4th to the 10th level.
[0089] In some embodiments, a dynamic adaptive aggregation strategy can be applied to levels higher than the level parameter. For example, if the level parameter is 4 and there are a total of 10 levels in the model, a dynamic adaptive aggregation strategy can be applied to levels 5-10.
[0090] In some embodiments, a dynamic adaptive aggregation strategy can be applied to the higher p levels. For example, if the level parameter is 6 and the model has a total of 10 levels, the dynamic adaptive aggregation strategy can be applied to the higher 6 levels, i.e., levels 5-10. Step 102 specifically includes:
[0091] The model parameters of the first level of the local model of the first client remain unchanged. The first level includes levels that are lower than or equal to the target level. The target level is obtained by subtracting the level parameters from the number of levels of the local model of the first client.
[0092] Based on the weight parameters and the level parameters, each model parameter of the second level of the global model is weighted and summed with each model parameter of the second level of the local model of the first client to update the local model of the first client. The second level includes levels higher than the target level.
[0093] That is, for higher Dynamic adaptive aggregation strategies can be applied to the first few layers, while lower layers of the network can be directly covered by local model parameters. The specific formula is... It indicates. Among them, It is a model The number of floors, It has the same Constant vectors of the same shape in the lower and middle layers, while With the remainder The upper floors all have the same shape.
[0094] In the case of aggregating the global model to obtain the local model, in step 103, the first client can train the updated local model of the first client based on the data of the data center corresponding to the first client, in order to complete the first step. Rounds of model training.
[0095] In this embodiment, fine-grained element-level and hierarchical cascading fusion of the global model and the local model is performed. The fusion ratio is dynamically adjusted based on the features of different model levels, preserving local data features and personalized knowledge. This mechanism further refines personalization capabilities, improves local inference performance and robustness, and provides support for differentiated data environments. It enables finer-grained and more dynamic model fusion, fully preserving local personalized features while effectively introducing global knowledge, improving inference performance and data adaptability. This solves the problems of information loss or conflict caused by coarse-grained aggregation in existing technologies, and the weak ability to balance personalization and generalization.
[0096] In some embodiments, the weight parameters and layer parameters can be fixed, and the training of the local model only updates the model parameters. Specifically, fixed weight parameters and layer parameters can be preset manually or empirically. However, fixed strategies are difficult to cope with dynamic changes in data, are prone to getting trapped in local optima or degradation, and cannot achieve the dynamic robustness and long-term stability provided by this application, thus greatly reducing their practical engineering value.
[0097] In some embodiments, due to data heterogeneity issues between different clients, the weight parameters and layer parameters can be designed as learnable hyperparameters, which can dynamically adjust which layers perform adaptive aggregation at different training stages on different clients. To enable each client to dynamically update model parameters according to its own data distribution and improve the model's local inference capability, a meta-learning strategy can be used to dynamically adjust the weight parameters of the aggregation module. and hierarchy parameters .
[0098] While related technologies primarily optimize for fixed data distributions, they lack the ability to handle data heterogeneity and dynamic changes. Meta-learning, on the other hand, enables models to automatically adjust parameters to adapt to different data distributions through self-learning. Furthermore, meta-learning can achieve better performance in fewer training epochs by learning optimization strategies during training, thereby reducing computational and communication overhead.
[0099] In some embodiments, the data in the data center corresponding to the first client includes a training set and a validation set, and step 103 specifically includes:
[0100] Based on the training set, the model parameters of the local model of the first client are updated;
[0101] When the model parameters of the local model of the first client are updated, the validation loss of the local model of the first client on the validation set is determined, and the weight parameters and the hierarchical parameters are updated according to the validation loss.
[0102] Specifically, in each client Internally, optimization is achieved through meta-learning. and This enables the local model trained locally. It can achieve minimal loss on local datasets. To achieve meta-learning, it is first necessary to process the local datasets of each client. Divided into training set and verification set The partition ratio can be 8:2. Construct the objective function using... express.
[0103] in: It is a client The training set, It is a client The validation set This indicates the training process of the local model on the local client.
[0104] The meta-learning process consists of an inner loop and an outer loop. The inner loop updates the model parameters of the local model, while the outer loop updates the client-side model. and hierarchy parameters Update the process to stabilize the optimization. The specific implementation process is as follows: First, copy the model parameters in the inner loop. For temporary models, the training set is used. right Perform one or more gradient descent updates. For the learning rate, use express.
[0105] Next, the outer loop calculates the temporary model. In the validation set The verification loss on, and based on the verification loss, the following are applied: and Perform one or more gradient descent updates to update the meta-parameters. and , respectively ; ; express.
[0106] in, It is the learning rate of meta-learning. Used for regularization Furthermore, due to These are discrete layer parameters, which can be treated as continuous variables for optimization. After training, they are rounded or otherwise discretized. express.
[0107] To facilitate rapid convergence of the local model, Initially initialized as a matrix of all ones, this means that initially the global model completely covers the local model. The initial model is initialized to half the total number of layers in the local model. In subsequent training epochs t, after the client receives the global model from the server, it will use the model parameters from the end of training epoch t-1. and After the local model is trained, the updated local model is obtained. It is then uploaded to the server for aggregation.
[0108] While weight and hierarchy parameters can be statically set or adjusted empirically, they lack the ability to automatically optimize in response to dynamic data changes, making them prone to getting stuck in local optima or degenerate. This embodiment, however, enables adaptive optimization of weight and hierarchy parameters on a meta-learning-based client. By introducing a meta-learning framework and optimizing weight and hierarchy parameters through internal and external loops based on local training and validation sets, the aggregation strategy is dynamically adjusted according to data distribution. This improves long-term robustness and convergence efficiency, enhances the system's long-term stability and efficiency, and reduces manual adjustments and communication costs.
[0109] Referring to Figure 2, which is a second flowchart of a model training method provided in an embodiment of this application, applied to a server, the method includes the following steps:
[0110] Step 201: Receive model parameters of K local models sent by K clients, wherein the K clients include the first client, and each local model is trained based on data from the data center corresponding to each client, and K is a positive integer greater than 1;
[0111] Step 202: Aggregate the model parameters of the K local models to obtain the global model;
[0112] Step 203: Send the global model to the K clients respectively. The global model is used by the first client to update the local model of the first client based on the weight parameter, the level parameter, the model parameter of the global model and the model parameter of the local model of the first client. The weight parameter is used to aggregate the model parameter of the global model and the model parameter of the local model of the first client. The level parameter is used to indicate the level range of aggregating the global model and the local model of the first client.
[0113] Optionally, step 202 specifically includes:
[0114] Based on the collaboration strength between the first client and each of the K clients, the K local models are weighted and summed to obtain the global model corresponding to the first client. The collaboration strength between the first client and the target client among the K clients is determined based on the similarity between the model parameters of the local model of the first client and the model parameters of the local model of the target client.
[0115] Sending the global model to the K clients respectively includes:
[0116] For each client, the global model corresponding to that client is sent to that client.
[0117] Optionally, before performing a weighted summation of the K local models based on the collaboration strength between the first client and each of the K clients to obtain the global model corresponding to the first client, the method further includes:
[0118] Based on the similarity between the model parameters of the local models of every two clients among the K clients, a collaboration graph of the K clients is constructed, which is used to represent the collaboration relationship and collaboration strength between different clients;
[0119] Based on the similarity between model parameters of local models of different clients and the relative size of data used by each client to train the local model, with the optimization objective of maximizing the collaboration strength of similar clients, the collaboration strength between different clients in the collaboration graph is updated, and the collaboration strength between the first client and the target client is kept consistent with the relative size of data used by the target client to train the local model;
[0120] The step of performing a weighted summation of the K local models based on the collaboration strength between the first client and each of the K clients to obtain the global model corresponding to the first client includes:
[0121] Based on the collaboration strength between the first client and each of the K clients in the updated collaboration graph, the K local models are weighted and summed to obtain the global model corresponding to the first client.
[0122] Optionally, the method further includes:
[0123] Convert the model parameters of each client's local model into query vectors and key vectors;
[0124] The similarity between the model parameters of the local model of the first client and the model parameters of the local model of the target client is obtained by performing a dot product operation on the query vector corresponding to the first client and the key vector corresponding to the target client.
[0125] It should be noted that the specific process of the model training method on the server side has been described in detail in the above embodiments, and will not be repeated here.
[0126] The following is a detailed explanation of the model training method provided in the embodiments of this application using a specific example.
[0127] This application addresses the challenges of heterogeneous data distribution and personalized modeling in cloud-edge-device environments, aiming to improve the generalization, personalization adaptability, and robustness of deep learning models in multi-data center and multi-edge node environments. Figure 3 is an implementation architecture diagram of a specific example of the model training method in this application. As shown in Figure 3, this application involves one server and multiple clients. The server is responsible for receiving model parameters of local models uploaded from different clients, calculating the similarity between model parameters of different clients through an attention network, constructing a client collaboration graph, and then optimizing the collaboration graph according to the similarity between model parameters and the relative size of the data used to train the local models, according to the optimization objective. Finally, the server performs weighted summation processing according to the collaboration strength between the first client and each client in the collaboration graph, and sends a dedicated global model to each client.
[0128] The client is responsible for receiving the global model sent by the server and adaptively aggregating the model through the dynamic adaptive aggregation module to fuse the global model with the local model. While updating the local model through fusion, the client can further utilize the meta-learning mechanism to continuously optimize the model parameters using gradient calculation in the inner loop based on the training set, and continuously optimize the weight parameters and layer parameters using gradient calculation in the outer loop based on the validation set, thereby minimizing the loss of the local model. Finally, the trained local model is uploaded to the server.
[0129] Compared with related technologies, the technical advantages of the embodiments of this application are reflected in the following aspects:
[0130] 1. This paper proposes a model parameter aggregation method based on a global model of collaboration strength. This method can analyze and identify the similarity of data distribution among different clients in real time, and automatically establish and adjust collaborative connections between clients. This dynamic identification capability not only ensures the accuracy and real-time nature of collaborative relationships, but also adapts to the dynamic changes in client data distribution in cloud-edge-device environments. By assigning a more personalized global model to each client that meets its specific needs, the adaptability and performance of each client model are greatly improved, effectively addressing the problem of data heterogeneity among clients and ensuring the robustness and generalization of the model in different geographical regions and data environments.
[0131] 2. An adaptive fusion strategy is proposed to dynamically fuse high-level model parameters from the received global and local models. This strategy automatically adjusts weight and layer parameters based on the data distribution and personalized needs of each client. By maintaining global knowledge sharing, this adaptive parameter fusion strategy fully leverages the personalized features of the local model, achieving a balance between general knowledge and personalized capabilities, thus improving the overall model's adaptability and generalization performance.
[0132] 3. An adaptive learning strategy based on a meta-learning mechanism is proposed. By analyzing the changes in data distribution in each data center, the weight parameters and layer number parameters are automatically learned and adjusted to improve the robustness of the model in heterogeneous data environments. This method can significantly reduce the communication frequency between the client and the server, greatly reducing network load and latency. Furthermore, it has the ability to quickly adapt to new data distributions, effectively reducing the number of training iterations, further mitigating communication overhead, and enhancing the overall efficiency and response speed of the system.
[0133] This application's embodiments possess broad commercial value. Addressing the challenges of heterogeneous and personalized modeling in cloud-edge-device environments, it proposes a deep learning method featuring dynamic collaboration and adaptive aggregation. This aligns with the trend of Artificial Intelligence (AI) moving from the center to the edge, and has broad market application prospects. It effectively improves the model's generalization and personalization capabilities in heterogeneous data environments, enhances inference performance and robustness, and is applicable to fields such as smart finance, healthcare, manufacturing, and transportation. It meets data privacy and compliance requirements, facilitating the implementation of distributed intelligent modeling. Through dynamic collaboration and meta-learning optimization, it reduces communication and training costs, minimizes system energy consumption and risks, and possesses good engineering feasibility and promotional value. In the future, it can bring significant economic benefits and competitive advantages to enterprises.
[0134] Referring to Figure 4, which is a schematic diagram of one of the structures of a model training device provided in an embodiment of this application, applied to a first client, the model training device 400 includes:
[0135] The first receiving module 401 is used to receive model parameters of the global model. The model parameters of the global model are obtained by aggregating the model parameters of K local models of K clients. The K clients include the first client, and K is a positive integer greater than 1.
[0136] The first update module 402 is used to update the local model of the first client based on the weight parameter, the level parameter, the model parameters of the global model and the model parameters of the local model of the first client; the weight parameter is used to aggregate the model parameters of the global model and the model parameters of the local model of the first client, and the level parameter is used to indicate the level range of aggregating the global model and the local model of the first client.
[0137] Training module 403 is used to train an updated local model of the first client based on data from the data center corresponding to the first client.
[0138] Optionally, the data in the data center corresponding to the first client includes a training set and a validation set, and the training module 403 is specifically used for:
[0139] Based on the training set, the model parameters of the local model of the first client are updated;
[0140] When the model parameters of the local model of the first client are updated, the validation loss of the local model of the first client on the validation set is determined, and the weight parameters and the hierarchical parameters are updated according to the validation loss.
[0141] Optionally, the first update module 402 is specifically used for:
[0142] The model parameters of the first level of the local model of the first client remain unchanged. The first level includes levels that are lower than or equal to the target level. The target level is obtained by subtracting the level parameters from the number of levels of the local model of the first client.
[0143] Based on the weight parameters and the level parameters, each model parameter of the second level of the global model is weighted and summed with each model parameter of the second level of the local model of the first client to update the local model of the first client. The second level includes levels higher than the target level.
[0144] The model training device 400 can implement all the processes implemented in the model training method embodiment shown in Figure 1 above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0145] Referring to Figure 5, which is a second structural schematic diagram of a model training device provided in an embodiment of this application, applied to a server, the model training device 500 includes:
[0146] The second receiving module 501 is used to receive model parameters of K local models sent by K clients, wherein the K clients include the first client, and each local model is trained based on data from the data center corresponding to each client, and K is a positive integer greater than 1.
[0147] The aggregation module 502 is used to aggregate the model parameters of the K local models to obtain a global model;
[0148] The sending module 503 is used to send the global model to the K clients respectively. The global model is used by the first client to update the local model of the first client based on the weight parameter, the level parameter, the model parameter of the global model and the model parameter of the local model of the first client. The weight parameter is used to aggregate the model parameter of the global model and the model parameter of the local model of the first client. The level parameter is used to indicate the level range of aggregating the global model and the local model of the first client.
[0149] Optionally, the aggregation module 502 is specifically used for:
[0150] Based on the collaboration strength between the first client and each of the K clients, the K local models are weighted and summed to obtain the global model corresponding to the first client. The collaboration strength between the first client and the target client among the K clients is determined based on the similarity between the model parameters of the local model of the first client and the model parameters of the local model of the target client.
[0151] The sending module 503 is specifically used for:
[0152] For each client, the global model corresponding to that client is sent to that client.
[0153] Optionally, the device further includes:
[0154] A construction module is used to construct a collaboration graph of the K clients based on the similarity between the model parameters of the local models of every two clients. The collaboration graph is used to represent the collaboration relationship and collaboration strength between different clients.
[0155] The second update module is used to update the collaboration strength between different clients in the collaboration graph based on the similarity between the model parameters of the local models of different clients and the relative size of the data used by each client to train the local model, with the optimization goal of maximizing the collaboration strength of similar clients. The collaboration strength between the first client and the target client is consistent with the relative size of the data used by the target client to train the local model.
[0156] The aggregation module 502 is specifically used for:
[0157] Based on the collaboration strength between the first client and each of the K clients in the updated collaboration graph, the K local models are weighted and summed to obtain the global model corresponding to the first client.
[0158] Optionally, the device further includes:
[0159] The transformation module is used to convert the model parameters of the local model of each client into query vectors and key vectors;
[0160] The dot product operation module is used to perform a dot product operation on the query vector corresponding to the first client and the key vector corresponding to the target client to obtain the similarity between the model parameters of the local model of the first client and the model parameters of the local model of the target client.
[0161] The model training device 500 can implement all the processes implemented in the model training method embodiment shown in Figure 2 above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0162] Referring to Figure 6, a schematic diagram of the structure of the client provided in an embodiment of the present invention is shown. As shown in Figure 6, the client 600 includes: a first processor 601, a first memory 602, a first user interface 603, and a first bus interface 604.
[0163] The first processor 601 is used to read the program from the first memory 602 and execute the following procedures:
[0164] Receive model parameters of the global model, which are obtained by aggregating model parameters of K local models of K clients, including the first client, where K is a positive integer greater than 1;
[0165] Based on the weight parameter, the hierarchy parameter, the model parameters of the global model, and the model parameters of the local model of the first client, the local model of the first client is updated; the weight parameter is used to aggregate the model parameters of the global model and the model parameters of the local model of the first client, and the hierarchy parameter is used to indicate the hierarchy range of aggregating the global model and the local model of the first client.
[0166] Based on the data from the data center corresponding to the first client, the updated local model of the first client is trained.
[0167] In Figure 6, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by the first processor 601 and the memory represented by the first memory 602. The bus architecture may also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The first bus interface 604 provides an interface. For different user devices, the first user interface 603 may also be an interface capable of connecting external or internal devices, including but not limited to keypads, displays, speakers, microphones, joysticks, etc.
[0168] The first processor 601 is responsible for managing the bus architecture and general processing, and the first memory 602 can store the data used by the first processor 601 when performing operations.
[0169] In some embodiments, the data in the data center corresponding to the first client includes a training set and a validation set, and the first processor 601 is further configured to:
[0170] Based on the training set, the model parameters of the local model of the first client are updated;
[0171] When the model parameters of the local model of the first client are updated, the validation loss of the local model of the first client on the validation set is determined, and the weight parameters and the hierarchical parameters are updated according to the validation loss.
[0172] In some embodiments, the first processor 601 is further configured to:
[0173] The model parameters of the first level of the local model of the first client remain unchanged. The first level includes levels that are lower than or equal to the target level. The target level is obtained by subtracting the level parameters from the number of levels of the local model of the first client.
[0174] Based on the weight parameters and the level parameters, each model parameter of the second level of the global model is weighted and summed with each model parameter of the second level of the local model of the first client to update the local model of the first client. The second level includes levels higher than the target level.
[0175] Preferably, the present invention also provides a client 600, including a first processor 601, a first memory 602, and a computer program stored in the first memory 602 and executable on the first processor 601. When the computer program is executed by the first processor 601, it implements the various processes of the model training method embodiment shown in FIG1 above and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0176] Referring to Figure 7, a schematic diagram of the server structure provided in an embodiment of the present invention is shown. As shown in Figure 7, the server 700 includes: a second processor 701, a second memory 702, a second user interface 703, and a second bus interface 704.
[0177] The second processor 701 is used to read the program from the second memory 702 and execute the following procedures:
[0178] Receive model parameters of K local models sent by K clients, wherein the K clients include the first client, and each local model is trained based on data from the data center corresponding to each client, and K is a positive integer greater than 1;
[0179] The global model is obtained by aggregating the model parameters of the K local models.
[0180] The global model is sent to the K clients respectively. The global model is used by the first client to update the local model of the first client based on the weight parameter, the level parameter, the model parameter of the global model and the model parameter of the local model of the first client. The weight parameter is used to aggregate the model parameter of the global model and the model parameter of the local model of the first client. The level parameter is used to indicate the level range of aggregating the global model and the local model of the first client.
[0181] In Figure 7, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by the second processor 701 and the memory represented by the second memory 702. The bus architecture may also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The second bus interface 704 provides an interface. For different devices, the second user interface 703 may also be an interface capable of connecting external or internal devices, including but not limited to keypads, displays, speakers, microphones, joysticks, etc.
[0182] The second processor 701 is responsible for managing the bus architecture and general processing, while the second memory 702 can store the data used by the second processor 701 when performing operations.
[0183] In some embodiments, the second processor 701 is further configured to:
[0184] Based on the collaboration strength between the first client and each of the K clients, the K local models are weighted and summed to obtain the global model corresponding to the first client. The collaboration strength between the first client and the target client among the K clients is determined based on the similarity between the model parameters of the local model of the first client and the model parameters of the local model of the target client.
[0185] For each client, the global model corresponding to that client is sent to that client.
[0186] In some embodiments, the second processor 701 is further configured to:
[0187] Based on the similarity between the model parameters of the local models of every two clients among the K clients, a collaboration graph of the K clients is constructed, which is used to represent the collaboration relationship and collaboration strength between different clients;
[0188] Based on the similarity between model parameters of local models of different clients and the relative size of data used by each client to train the local model, with the optimization objective of maximizing the collaboration strength of similar clients, the collaboration strength between different clients in the collaboration graph is updated, and the collaboration strength between the first client and the target client is kept consistent with the relative size of data used by the target client to train the local model;
[0189] Based on the collaboration strength between the first client and each of the K clients in the updated collaboration graph, the K local models are weighted and summed to obtain the global model corresponding to the first client.
[0190] Optionally, the second processor 701 is also used for:
[0191] Convert the model parameters of each client's local model into query vectors and key vectors;
[0192] The similarity between the model parameters of the local model of the first client and the model parameters of the local model of the target client is obtained by performing a dot product operation on the query vector corresponding to the first client and the key vector corresponding to the target client.
[0193] Preferably, the present invention also provides a server 700, including a second processor 701, a second memory 702, and a computer program stored in the second memory 702 and executable on the second processor 701. When the computer program is executed by the second processor 701, it implements the various processes of the model training method embodiment shown in FIG2 above and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0194] This invention also provides a readable storage medium storing a computer program. When executed by a processor, this computer program implements the various processes of the model training method embodiments shown in Figure 1 or Figure 2, achieving the same technical effects. To avoid repetition, these will not be described again here. The readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0195] This application also provides a computer program product, including computer instructions. When executed by a processor, the computer instructions implement the various processes of the model training method embodiments shown in FIG1 or FIG2 above, and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0196] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0197] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0198] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0199] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention, depending on actual needs.
[0200] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0201] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0202] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A model training method, characterized in that, Applied to a first client, the method includes: receiving model parameters of a global model, the model parameters of the global model being obtained by aggregating model parameters of K local models of K clients, the K clients including the first client, where K is a positive integer greater than 1; updating a local model of the first client based on weight parameters, a hierarchy parameter, the model parameters of the global model, and the model parameters of the local models of the first client; the weight parameters being used to aggregate the model parameters of the global model and the model parameters of the local models of the first client, the hierarchy parameter being used to indicate the hierarchy range of aggregating the global model and the local models of the first client; and training the updated local model of the first client based on data from the data center corresponding to the first client.
2. The method according to claim 1, characterized in that, The data in the data center corresponding to the first client includes a training set and a validation set. The step of training the updated local model of the first client based on the data in the data center corresponding to the first client includes: updating the model parameters of the local model of the first client based on the training set; determining the validation loss of the local model of the first client on the validation set when the model parameters of the local model of the first client are updated, and updating the weight parameters and the hierarchical parameters according to the validation loss.
3. The method according to claim 1, characterized in that, The step of updating the local model of the first client based on weight parameters, level parameters, model parameters of the global model, and model parameters of the local model of the first client includes: keeping the model parameters of the first level of the local model of the first client unchanged, the first level including levels lower than or equal to the target level, the target level being obtained by subtracting the level parameters from the number of levels of the local model of the first client; and performing a weighted summation of each model parameter of the second level of the global model and each model parameter of the second level of the local model of the first client based on the weight parameters and level parameters to update the local model of the first client, the second level including levels higher than the target level.
4. A model training method, characterized in that, The method, applied to a server, includes: receiving model parameters of K local models sent by K clients, the K clients including a first client, each local model being trained based on data from a data center corresponding to each client, where K is a positive integer greater than 1; aggregating the model parameters of the K local models to obtain a global model; and sending the global model to each of the K clients, wherein the global model is used by the first client to update the local models of the first client based on weight parameters, hierarchical parameters, the model parameters of the global model, and the model parameters of the local models of the first client, the weight parameters being used to aggregate the model parameters of the global model and the model parameters of the local models of the first client, and the hierarchical parameters being used to indicate the hierarchical range of aggregating the global model and the local models of the first client.
5. The method according to claim 4, characterized in that, The step of aggregating the model parameters of the K local models to obtain a global model includes: performing a weighted summation of the K local models based on the collaboration strength between the first client and each of the K clients to obtain a global model corresponding to the first client. The collaboration strength between the first client and the target client among the K clients is determined based on the similarity between the model parameters of the local model of the first client and the model parameters of the local model of the target client. The step of sending the global model to the K clients includes: sending the global model corresponding to each client to the client.
6. The method according to claim 5, characterized in that, Before performing a weighted summation of the K local models based on the collaboration strength between the first client and each of the K clients to obtain the global model corresponding to the first client, the method further includes: constructing a collaboration graph of the K clients based on the similarity between the model parameters of the local models of every two clients, the collaboration graph representing the collaboration relationships and collaboration strengths between different clients; updating the collaboration strength between different clients in the collaboration graph based on the similarity between the model parameters of the local models of different clients and the relative size of the data used by each client to train the local model, with the optimization objective of maximizing the collaboration strength of similar clients, ensuring that the collaboration strength between the first client and the target client remains consistent with the relative size of the data used by the target client to train the local model; the step of performing a weighted summation of the K local models based on the collaboration strength between the first client and each of the K clients to obtain the global model corresponding to the first client includes: performing a weighted summation of the K local models based on the updated collaboration strength between the first client and each of the K clients in the collaboration graph to obtain the global model corresponding to the first client.
7. The method according to claim 5 or 6, characterized in that, The method further includes: converting the model parameters of the local model of each client into query vectors and key vectors; performing a dot product operation on the query vector corresponding to the first client and the key vector corresponding to the target client to obtain the similarity between the model parameters of the local model of the first client and the model parameters of the local model of the target client.
8. A model training device, characterized in that, The device, applied to a first client, includes: a first receiving module for receiving model parameters of a global model, wherein the model parameters of the global model are obtained by aggregating model parameters of K local models of K clients, wherein the K clients include the first client and K is a positive integer greater than 1; a first updating module for updating the local model of the first client based on weight parameters, a level parameter, the model parameters of the global model, and the model parameters of the local models of the first client; wherein the weight parameters are used to aggregate the model parameters of the global model and the model parameters of the local models of the first client, and the level parameter is used to indicate the level range of aggregating the global model and the local models of the first client; and a training module for training the updated local model of the first client based on data from the data center corresponding to the first client.
9. A model training device, characterized in that, The device, applied to a server, includes: a second receiving module for receiving model parameters of K local models sent by K clients, the K clients including a first client, each local model being trained based on data from a data center corresponding to each client, where K is a positive integer greater than 1; an aggregation module for aggregating the model parameters of the K local models to obtain a global model; and a sending module for sending the global model to each of the K clients, wherein the global model is used by the first client to update the local models of the first client based on weight parameters, hierarchical parameters, the model parameters of the global model, and the model parameters of the local models of the first client, the weight parameters being used to aggregate the model parameters of the global model and the model parameters of the local models of the first client, and the hierarchical parameters being used to indicate the hierarchical range of aggregating the global model and the local models of the first client.
10. A client, characterized in that, include: A first processor, a first memory, and a program stored in the first memory and executable on the first processor, wherein the program, when executed by the first processor, implements the steps of the model training method as described in any one of claims 1 to 3.
11. A server, characterized in that, include: A second processor, a second memory, and a program stored in the second memory and executable on the second processor, wherein the program, when executed by the second processor, implements the steps of the model training method as described in any one of claims 4 to 7.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the model training method as described in any one of claims 1 to 7.
13. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the steps of the model training method as described in any one of claims 1 to 7.