Federal learning-based model training method and device, equipment and medium

By conducting model training and aggregation on the client in federated learning, a highly adaptable aggregation hypernetwork model is formed, which solves the shortcomings of traditional federated learning methods in model training efficiency, data heterogeneity adaptability and training cost, and achieves efficient and personalized federated learning effects.

CN119578513AInactive Publication Date: 2025-03-07CRYPTOZOOLOGY & CYBERSPACE SECURITY (HUANGPU) RES INST
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411756005.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-03-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional federated learning methods have shortcomings in model training efficiency, data heterogeneity adaptability and training cost. Especially in smart Internet of Vehicles scenarios, the real-time and reliability of data are crucial.

Method used

A model training method based on federated learning is proposed. By using the objective function to train the model on the client, it generates the local hypernetwork model and personalization layer, and aggregates it with the non-local hypernetwork model of other clients to form the aggregated hypernetwork model. The model is then mapped as a basic parameter layer and merged with the personalization layer to form a new local target network model, and is continuously trained until the preset stop condition is reached.

Benefits of technology

This method improves the efficiency of model training in federated learning, adapts to the data heterogeneity of different clients, and reduces training costs, realizes the purpose of personalized federated learning, and is suitable for scenarios such as smart Internet of Vehicles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119578513A_ABST
    Figure CN119578513A_ABST
Patent Text Reader

Abstract

The invention discloses a federated learning-based model training method and device, equipment and a medium, relates to the technical field of computers, is applied to a current client, and comprises the following steps: performing model training of a current training round on a current local target network model by using a target function, obtaining a next local target network model containing the local super network model and the personalized layer; and aggregating the local super-network model and non-local super-network models of other clients, mapping the local super-network model and the non-local super-network models into a basic parameter layer, combining the basic parameter layer and the personalized layer to obtain a new current local target network model, and performing model training until a preset training stopping condition is met to obtain a final target network model. And processing the detection task of the intelligent Internet of Vehicles by using the final target network model. Through the scheme, the efficiency of model training in federal learning is improved, the method adapts to data isomerism of different clients, and the training cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a model training method, device, equipment and medium based on federated learning. Background Art

[0002] With the development of network technology, how to build a new generation of trustworthy information management system has become a necessary requirement. Blockchain technology provides a decentralized, transparent, and tamper-proof trusted distributed foundation. With the development of artificial intelligence technology, data island problems have emerged in the field of network data computing. The lack of trust between developers makes it difficult to jointly use data from all parties for collaborative training. Although federated learning provides data privacy protection, there are still hidden dangers in the security of the server side. With the rapid development of intelligent vehicle networking technology, data sharing and collaborative operation between vehicles and surrounding infrastructure have become increasingly important. The traditional central server model has many limitations in processing large-scale data, ensuring privacy, and improving system robustness. Especially in application scenarios such as traffic monitoring and management, real-time road condition monitoring, and autonomous driving, the real-time and reliability of data are crucial.

[0003] Although traditional federated learning methods can protect data privacy to a certain extent, the security of the server side is still worrying. There are problems such as high communication costs. User behavior, regional differences, and differences in data between individuals and organizations also bring challenges of data heterogeneity.

[0004] In summary, how to improve the efficiency of model training in federated learning, adapt to the data heterogeneity of different clients, and reduce training costs are issues to be solved in this field. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a model training method, device, equipment and medium based on federated learning, improve the efficiency of model training in federated learning, adapt to the data heterogeneity of different clients, and reduce the training cost. The specific scheme is as follows:

[0006] In a first aspect, the present application discloses a model training method based on federated learning, which is applied to the current client, including:

[0007] Performing model training of the current training round on the current local target network model using the objective function to obtain a next local target network model including a local super network model and a personalized layer;

[0008] Aggregating the local hypernetwork model and non-local hypernetwork models of other clients to obtain an aggregated hypernetwork model;

[0009] Mapping the aggregated super network model into a basic parameter layer, merging the basic parameter layer and the personalized layer, and determining the obtained merged local target network as a new current local target network model;

[0010] If the preset stop training condition is not met at present, jump back to the step of using the objective function to perform model training of the current training round on the current local target network model;

[0011] If the preset stop training condition is currently met, the current local target network model is determined as the final target network model, so as to use the final target network model to process the detection task of the intelligent vehicle network.

[0012] Optionally, aggregating the local hypernetwork model with non-local hypernetwork models of other clients includes:

[0013] Receive a first non-local super network model of a trusted client using a Gossip protocol; wherein the trusted client belongs to a trusted client group of the current client;

[0014] Downloading a second non-local hypernetwork model of an untrusted client from the blockchain system; wherein the untrusted client does not belong to the trusted client group of the current client;

[0015] The local hypernetwork model, the first non-local hypernetwork model, and the second non-local hypernetwork model are aggregated.

[0016] Optionally, aggregating the local super network model, the first non-local super network model, and the second non-local super network model includes:

[0017] A normalization parameter and each aggregation weight parameter are determined to aggregate the local hypernetwork model, the first non-local hypernetwork model, and the second non-local hypernetwork model using an aggregation formula constructed based on the normalization parameter and each aggregation weight parameter.

[0018] Optionally, determine various weight parameters, including:

[0019] Inferring the first non-local hypernetwork model and the second non-local hypernetwork model using local data sets respectively to determine a first loss function weight parameter of the first non-local hypernetwork model and a second loss function weight parameter of the second non-local hypernetwork model;

[0020] A first delayed round compensation weight parameter and a second delayed round compensation weight parameter are determined according to round differences between the current training round and a first training round of the first non-local hypernetwork model and a second training round of the second non-local hypernetwork model.

[0021] Optionally, the aggregation formula is:

[0022] ;

[0023] in, is the hyper-network model after aggregation, is the local hypernetwork model, is the first non-local super network model, is the second non-local super network model, is the normalization parameter, is the client weight parameter of the local hypernetwork model, is the weight parameter of the loss function of the local hypernetwork model, is the first client weight parameter, is the weight parameter of the first loss function, is the compensation weight parameter for the first delay round, is the second client weight parameter, is the weight parameter of the second loss function, is the second delay round compensation weight parameter, For trusted clients, For untrusted clients, The trusted client group for the current client.

[0024] Optionally, the model training method based on federated learning further includes:

[0025] Uploading the local hypernetwork model to the blockchain system;

[0026] Transmitting the parameters of the local hypernetwork model to the untrusted client through the upload block of the current client in the blockchain system, so that the untrusted client performs model training using the parameters of the local hypernetwork model;

[0027] Accordingly, the process of downloading the second non-local super network model of the untrusted client from the blockchain system also includes:

[0028] The downloading behavior of the current client downloading the second non-local super network model is recorded through the download block in the blockchain system.

[0029] Optionally, the next local target network model further includes a set of embedding vectors;

[0030] Mapping the aggregated hypernetwork model into a basic parameter layer includes:

[0031] Performing a convolution operation on the set of embedding vectors and each set of parameter matrices of the hidden layer in the aggregated hypernetwork model to obtain a first mapping result;

[0032] Processing the first mapping result using the second output layer in the aggregated hypernetwork model to obtain a second mapping result;

[0033] The second mapping results are concatenated to obtain a basic parameter layer.

[0034] In a second aspect, the present application discloses a model training device based on federated learning, which is applied to the current client and includes:

[0035] A model training module, used to perform model training of a current training round on a current local target network model using an objective function to obtain a next local target network model including a local super network model and a personalized layer;

[0036] A model aggregation module, used for aggregating the local hypernetwork model and non-local hypernetwork models of other clients to obtain an aggregated hypernetwork model;

[0037] A model merging module, used to map the aggregated super network model into a basic parameter layer, merge the basic parameter layer and the personalized layer, and determine the obtained merged local target network as a new current local target network model;

[0038] A training jump module, used for jumping back to the step of performing model training of the current training round on the current local target network model using the objective function if the preset stop training condition is not met at present;

[0039] The training stop module is used to determine the current local target network model as the final target network model if the preset training stop condition is currently met, so as to use the final target network model to process the detection task of the intelligent vehicle network.

[0040] In a third aspect, the present application discloses an electronic device, comprising:

[0041] Memory, used to store computer programs;

[0042] A processor is used to execute the computer program to implement the steps of the aforementioned disclosed model training method based on federated learning.

[0043] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed model training method based on federated learning are implemented.

[0044] The beneficial effects of the present application are as follows: the present application is applied to the current client, including: using the objective function to perform model training for the current local target network model in the current training round to obtain the next local target network model including the local super network model and the personalized layer; aggregating the local super network model and the non-local super network models of other clients to obtain the aggregated super network model; mapping the aggregated super network model to a basic parameter layer, merging the basic parameter layer and the personalized layer, and determining the obtained merged local target network as the new current local target network model; if the preset stop training condition is not met at present, jumping back to the step of performing model training for the current local target network model in the current training round using the objective function; if the preset stop training condition is met at present, determining the current local target network model as the final target network model, so as to use the final target network model to process the detection task of the intelligent vehicle network. It can be seen that when the present application performs federated learning training, when each client trains a large local target network model, a small local super network model can also be obtained. In the process of model training for each client, the current client aggregates the local super network model and the non-local super network model of other clients, and then uses the aggregated super network model to map to the basic parameter layer. It can be understood that each super network model is heterogeneous data of different clients, and then the aggregated super network model is mapped to the basic parameter layer, the basic parameter layer and the personalized layer are merged, and the obtained merged local target network is determined as the current local target network model for the next round of model training. That is to say, in each model training, the heterogeneous data of different clients can be integrated, that is, the final target network model can adapt to the data heterogeneity of different clients, and because only the non-local super network model of other clients is needed during the training process, that is, there is no need to transmit large target network models between clients, so the required data transmission time is greatly reduced, which improves the efficiency of model training in federated learning, saves communication costs, and achieves the purpose of personalized federated learning. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0046] Figure 1 A flow chart of a model training method based on federated learning disclosed in this application;

[0047] Figure 2 A specific client group schematic diagram disclosed in this application;

[0048] Figure 3 A specific hypernetwork mapping schematic diagram disclosed in this application;

[0049] Figure 4 This is a schematic diagram of the structure of a model training device based on federated learning disclosed in this application;

[0050] Figure 5 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0052] With the development of network technology, how to build a new generation of trustworthy information management system has become a necessary requirement. Blockchain technology provides a decentralized, transparent, and tamper-proof trusted distributed foundation. With the development of artificial intelligence technology, data island problems have emerged in the field of network data computing. The lack of trust between developers makes it difficult to jointly use data from all parties for collaborative training. Although federated learning provides data privacy protection, there are still hidden dangers in the security of the server side. With the rapid development of intelligent vehicle networking technology, data sharing and collaborative operation between vehicles and surrounding infrastructure have become increasingly important. The traditional central server model has many limitations in processing large-scale data, ensuring privacy, and improving system robustness. Especially in application scenarios such as traffic monitoring and management, real-time road condition monitoring, and autonomous driving, the real-time and reliability of data are crucial.

[0053] Although traditional federated learning methods can protect data privacy to a certain extent, the security of the server side is still worrying. There are problems such as high communication costs. User behavior, regional differences, and differences in data between individuals and organizations also bring challenges of data heterogeneity.

[0054] To this end, this application provides a model training solution based on federated learning to improve the efficiency of model training in federated learning, adapt to the data heterogeneity of different clients, and reduce training costs.

[0055] See also Figure 1 As shown, the embodiment of the present application discloses a model training method based on federated learning, which is applied to the current client and includes:

[0056] Step S11: Perform model training of the current training round on the current local target network model using the objective function to obtain the next local target network model including the local super network model and the personalized layer.

[0057] For example Figure 2 A specific client group diagram is shown. Before model training, each client and the trusted client group of each client and the corresponding untrusted client in the blockchain system are determined. During model training, each client can participate in the model training of federated learning. When the client participates in model training for the first time, the local client and blockchain related parameters are initialized, and the total training rounds, super network learning rate, and data set are determined. .

[0058] In the intelligent Internet of Vehicles, participating nodes include vehicle nodes, road camera nodes, and roadside unit (RSU) nodes; in the vehicle nodes, each vehicle in the intelligent Internet of Vehicles participates in federated learning as a client node. These vehicles include ordinary passenger cars, public transportation vehicles, logistics transportation vehicles, etc. The vehicle nodes are responsible for collecting image data during driving, such as traffic signs, weather conditions, pedestrians, road conditions, etc. In the road camera nodes, cameras installed along the highway are responsible for monitoring traffic conditions and road conditions. These cameras collect video data in real time, perform local data processing, and participate in federated learning. In the roadside unit nodes, the roadside unit is a computing and communication unit installed in the road infrastructure, responsible for communicating with the vehicle and collecting road environment data. The trust groups of nodes are divided into the following categories: 1) Fleet trust group: composed of mutually trusted vehicles, such as vehicles in the same fleet. Vehicles in the fleet can share locally trained model parameters through vehicle-to-vehicle communication protocols to reduce the load on the blockchain; 2) Highway infrastructure group: composed of road cameras and RSUs. These infrastructure devices share and aggregate locally trained model parameters through wired or wireless communications to ensure the comprehensiveness and consistency of data and reduce the load on the blockchain; 3) Scattered nodes: including vehicles and equipment that do not belong to any trust group. These nodes directly upload locally trained model parameters to the blockchain, and obtain and distribute model parameters through the blockchain.

[0059] In this embodiment, the next local target network model also includes an embedding vector. That is, the current client uses the objective function to perform model training on the current local target network model for the current training round, and can obtain a local super network model and an embedding vector and a new local target network model including a personalized layer and a basic parameter layer, a personalized layer, and a next local target network model of the embedding vector. The client can perform personalized training and adjustment based on the personalized layer and the embedding vector, which helps to improve the adaptability and performance of the model and better adapt to the characteristics of heterogeneous data; the embedding vector is a synchronous learning vector, which participates in each round of local model training of the client and is also back-propagated with the model parameters. The size of the embedding vector can be flexibly adjusted, and a larger embedding vector can capture more feature information and provide richer input information for the super network. It should be noted that increasing the size of the embedding vector will also lead to an increase in the number of super network parameters, which increases the communication overhead; the super network has the ability to generate parameters, and can complete the generation of the basic parameter layer of the local target network model of different clients through the embedding vector provided by the adaptive client.

[0060] Step S12: Aggregate the local hypernetwork model and non-local hypernetwork models of other clients to obtain an aggregated hypernetwork model.

[0061] In this embodiment, the local supernetwork model and the non-local supernetwork models of other clients are aggregated, including: using the Gossip protocol to receive a first non-local supernetwork model of a trusted client; wherein the trusted client belongs to the trusted client group of the current client; downloading a second non-local supernetwork model of an untrusted client from a blockchain system; wherein the untrusted client does not belong to the trusted client group of the current client; and aggregating the local supernetwork model, the first non-local supernetwork model, and the second non-local supernetwork model.

[0062] Trusted clients trust each other and can exchange model parameters without using a server or third-party information exchange mechanism. Within a trusted client group, clients use the Gossip protocol (a decentralized communication protocol that allows sharing of states in a distributed system) to communicate with each other, reducing communication costs. That is, when the current client receives the first non-local hypernetwork model of other clients in its own trusted client group, it can use the Gossip protocol to receive it. Clients that do not belong to the current client's trusted client group are untrusted clients. Untrusted clients will register on the blockchain and interact with the current client through the blockchain. That is, the current client downloads the second non-local hypernetwork model of the untrusted client from the blockchain system to collaborate on federated learning. In this way, the super network models of each client can be aggregated, that is, the local super network model, the first non-local super network model and the second non-local super network model can be aggregated. In this process, the system adopts a decentralized parameter sharing method within the local group to improve the transmission efficiency of federated learning and reduce the amount of calculation on the blockchain. At the same time, the introduction of blockchain provides high credibility, security and decentralized connectivity that are superior to traditional servers, which is more conducive to improving the accuracy of federated learning training and solving the problem of data islands. This has a better effect on dealing with problems such as data heterogeneity, communication limitations and computing bottlenecks in real scenarios.

[0063] In this embodiment, the aggregating the local supernetwork model, the first non-local supernetwork model and the second non-local supernetwork model includes: determining a normalization parameter and each aggregation weight parameter, so as to aggregate the local supernetwork model, the first non-local supernetwork model and the second non-local supernetwork model using an aggregation formula constructed based on the normalization parameter and each aggregation weight parameter. Determine normalization parameters and various weight parameters, the weight parameters are divided into local-related weight parameters, weight parameters of trusted clients and weight parameters of untrusted clients, wherein the local-related weight parameters specifically include the loss function weight parameters and delay round compensation weight parameters of the local hypernetwork model, the weight parameters of the trusted clients specifically include the first loss function weight parameters and the first delay round compensation weight parameters, and the weight parameters of the untrusted clients specifically include the second loss function weight parameters and the second delay round compensation weight parameters. In this way, an aggregation formula is constructed based on the normalization parameters and the various weight parameters, and then the aggregation formula is used to aggregate the hypernetwork models of the local, trusted clients and untrusted clients, that is, the local hypernetwork model, the first non-local hypernetwork model and the second non-local hypernetwork model are aggregated using the aggregation formula.

[0064] In this embodiment, determining each weight parameter includes: using a local data set to infer the first non-local hypernetwork model and the second non-local hypernetwork model respectively to determine a first loss function weight parameter of the first non-local hypernetwork model and a second loss function weight parameter of the second non-local hypernetwork model; determining a first delayed round compensation weight parameter and a second delayed round compensation weight parameter according to the round difference between the current training round and the first training round of the first non-local hypernetwork model and the second training round of the second non-local hypernetwork model.

[0065] Considering the inconsistency of data distribution between clients, the aggregation weight adjustment part based on the loss function is designed. The first non-local hypernetwork model and the second non-local hypernetwork model are inferred using the local data set respectively. The loss function can be used as a criterion for judging the quality of the model and the loss function is included in the weight definition. That is to say, a batch of data is randomly selected from the client data set for model inference to obtain the loss function on the approximate global data set, and the weight parameters of the first loss function of the first non-local hypernetwork model and the second loss function of the second non-local hypernetwork model are determined. The specific formula is as follows:

[0066] ;

[0067] In the formula, is the weight parameter of the first loss function, is the weight parameter of the second loss function, is the first non-local super network model, is the second non-local super network model, For local datasets.

[0068] Due to differences in computing hardware and environment, there are inconsistencies in computing power between different clients, resulting in different training time costs. Although the client executes the aggregation scheme and Gossip protocol separately to reduce the waiting time between clients, it may cause the models in the aggregation process to be in different rounds, that is:

[0069] ;

[0070] Where t represents the current training round of the current client, represents the first training round of the first non-local hypernetwork model, represents a second training round of a second non-local hypernetwork model;

[0071] In order to compensate and adjust the model parameters of the current client that are behind in the training round, the first delayed round compensation weight parameter and the second delayed round compensation weight parameter are determined according to the round difference between the current training round and the first training round of the first non-local super network model and the second training round of the second non-local super network model. The specific formula is as follows:

[0072] ;

[0073] In the formula, is the compensation weight parameter for the first delay round, is the second delay round compensation weight parameter, represents the first training round of the first non-local hypernetwork model, Represents the second training round of the second non-local hypernetwork model.

[0074] In this embodiment, the aggregation formula is:

[0075] ;

[0076] in, is the hyper-network model after aggregation, is the local hypernetwork model, is the first non-local super network model, is the second non-local super network model, is the normalization parameter, is the client weight parameter of the local hypernetwork model, is the weight parameter of the loss function of the local hypernetwork model, is the first client weight parameter, is the weight parameter of the first loss function, is the compensation weight parameter for the first delay round, is the second client weight parameter, is the weight parameter of the second loss function, is the second delay round compensation weight parameter, For trusted clients, For untrusted clients, The trusted client group for the current client.

[0077] Furthermore, the normalized parameters Satisfy the following formula:

[0078] .

[0079] In this embodiment, it also includes: uploading the local hypernetwork model to the blockchain system; transmitting the parameters of the local hypernetwork model to the untrusted client through the upload block of the current client in the blockchain system, so that the untrusted client uses the parameters of the local hypernetwork model to perform model training.

[0080] The basic structural design of all blocks in the blockchain system includes block header information, model information, and verification information. The block header information mainly records the information required for the history and traceability of the blockchain. This part consists of three fixed information, namely, block ID (Identity document), timestamp, and block type. Among them, the block ID provides a unique identifier for the current block so that other blocks can distinguish and call it; the timestamp records the operation time of the block on the chain, which is convenient for subsequent tracing and building an abnormal review timeline; the block type is responsible for indicating whether the block is a download, evaluation, or upload block, which helps to process block-specific information later. The block model information part contains the information and attributes required for the federated learning training process, which is closely related to the block type. The block verification information contains key data to verify the accuracy of the blockchain content. By recording the previous hash value of the parent block and the hash value of the current block, it ensures the tamper-proof characteristics of the blockchain and prevents attackers from destroying the integrity of the blockchain by changing a single block.

[0081] It is understandable that the current client will also upload the local hypernetwork model to the blockchain system, and the upload block in the blockchain system will transmit the parameters of the local hypernetwork model to the untrusted client. In this way, the untrusted client also uses the parameters of the local hypernetwork model of the current client for model training.

[0082] In this embodiment, the process of downloading the second non-local hypernetwork model of the untrusted client from the blockchain system also includes: recording the download behavior of the current client downloading the second non-local hypernetwork model through a download block in the blockchain system.

[0083] When each block in the blockchain is separated by function, it can be divided into three types of blocks, namely download blocks, evaluation blocks, and upload blocks. Among them, the download block records the model parameters downloaded by the client from the blockchain system, which enables the system to update the contribution score of the model uploader or provide rewards based on intellectual property rights. In addition, assuming that the client's local model encounters security issues or errors, the download record can be tracked to determine whether the problem originates from the model stored in the blockchain system, thereby ensuring traceability. In the header information of the download block, the client ID records the client that performs the download operation for easy traceability. The model information part records the client that performs the upload operation and specifically points out the block ID where the model parameters are located. Recording the block ID instead of the model parameters can effectively reduce the storage space required for this block. The task of the evaluation block is to record the client's evaluation of the model parameters within the blockchain system. They record the loss function value derived from the model reasoning on this client, enabling the system to track and record the quality and reliability of specific model parameters. This tracking can provide incentives for clients who upload high-quality model parameters, thereby encouraging high-quality training. In the header information, the client ID of the evaluation block identifies the client that performs the evaluation operation, thereby enhancing traceability. The model information section records the upload block that performs the evaluation model parameters, including the block ID and the corresponding score. The upload block is used to store a new round of local aggregated model parameters from the client. They are essential for providing reliable model parameters for aggregation to other clients, aiming to improve the accuracy and universality of local models across clients. The client ID of the upload block indicates the client that performs the upload model parameter operation, ensuring traceability. The model information section records all model parameters uploaded during this operation. These specialized block designs are essential to maintaining the functionality, security, and efficiency of the federated learning system integrated with blockchain technology. Each type of block plays a strategic role in the overall process, from initiating updates to verifying and consolidating learning results, thereby ensuring the robustness and integrity of the federated learning process.

[0084] Step S13: Mapping the aggregated super network model to a basic parameter layer, merging the basic parameter layer and the personalized layer, and determining the obtained merged local target network as a new current local target network model.

[0085] In this embodiment, the next local target network model also includes a set of embedding vectors; mapping the aggregated super network model into a basic parameter layer includes: performing a convolution operation on the set of embedding vectors and each parameter matrix set of the hidden layer in the aggregated super network model to obtain a first mapping result; processing the first mapping result using the second output layer in the aggregated super network model to obtain a second mapping result; and splicing the second mapping results to obtain a basic parameter layer.

[0086] For example Figure 3 A specific hypernetwork mapping diagram is shown, with the embedding vector As input, it is fed into the hypernetwork to generate the basic layer parameters of the corresponding client target network ,use It represents the process of hypernetwork mapping into base layer parameters, such as Figure 3 As shown, each filter in the target network contains convolution kernels, each of which has a size of ,filter Parameters used It means that for each , using a hypernetwork to receive an embedding vector , and predict the output The value of is the length of the embedding vector, Represents a real number. For example, a two-layer linear network is used as a hypernetwork. The hypernetwork model process is as follows Figure 3 As shown, the embedding vector is linearly mapped to Different matrices , ,in is the size of the hidden layer in the hypernetwork. The input size of the second layer is , using the coefficient matrix Finally, the above mapping results are concatenated into the parameters of the basic filters of the convolution target neural network in a certain order. The dimensions of the filters used for convolution operations in different convolution groups may be different, but they are usually integer multiples of the number of basic filters. For example, using an embedding vector to represent a 16×16 basic filter If you want to express , the hypernetwork outputs corresponding to multiple embedding vectors can be connected as the parameters of a single filter. Specifically, a 32×64-dimensional filter can be used, which consists of 8 16×16 Putting them together, we get the following matrix:

[0087] ;

[0088] Can be used To represent the client All parameters of the convolutional layer require all embedding vectors .

[0089] Personalized federated learning allows each user to build a personalized model to adapt to local data characteristics. Represents the client A set of embedding vectors for all features, combined and Can generate base layer parameters , ;

[0090] Furthermore, the local target network model Personalization layer With basic parameter layer The basic parameter layer and the personalized layer are merged, and the obtained merged local target network is determined as the current local target network model.

[0091] Step S14: If the preset stop training condition is not met at present, jump back to the step of performing model training of the current training round on the current local target network model using the objective function.

[0092] For the traditional federated learning process, including the client , a server responsible for aggregating parameters. Each client Have a private sample dataset , collaborative optimization objective function:

[0093] ;

[0094] In the formula, represents the global model parameters, Indicates the client participating in the aggregation The weight is usually based on the client The ratio of data size in training is determined by, Represents the client The local optimization objective function.

[0095] The objective function of personalized federated learning in this embodiment is adjusted to:

[0096] ;

[0097] In the formula, is a set of embedding vectors that all users can learn, The personalization layer parameter set for all clients, Represents a hypernetwork model.

[0098] In this embodiment, the preset training stop condition may be that the current training round reaches a first preset threshold or the convergence degree of the current local target network model is less than a second preset threshold.

[0099] Step S15: If the preset stop training condition is currently met, the current local target network model is determined as the final target network model, so as to use the final target network model to process the detection task of the intelligent vehicle network.

[0100] If the current training round reaches the first preset threshold or the convergence degree of the current local target network model is less than the second preset threshold, it is determined that the preset stop training condition is currently met, and the current local target network model is determined as the final convolution target network model, so as to use the final convolution target network model to process the detection task of the intelligent vehicle network, that is, the final target network model is used to realize a variety of intelligent vehicle network applications, such as road environment modeling, traffic anomaly detection, road condition monitoring and assisted intelligent driving. Among them, in terms of road environment modeling, through multi-source data modeling, real-time road environment information is provided to provide support for vehicle navigation and path planning; in terms of traffic anomaly detection, real-time monitoring and detection of traffic anomalies, such as traffic accidents, illegal parking and traffic congestion, improves the efficiency and response speed of traffic management; in terms of road condition monitoring, road conditions, such as road damage, water accumulation and ice, are monitored, and early warning information is provided to ensure driving safety; in terms of assisted intelligent driving, through multi-angle and multi-time period data collection, comprehensive road condition evaluation is provided to support the automatic driving system to optimize path selection and driving strategy.

[0101] The beneficial effects of the present application are as follows: the present application is applied to the current client, including: using the objective function to perform model training of the current training round on the current local target network model to obtain the next local target network model including the local super network model and the personalized layer; aggregating the local super network model and the non-local super network models of other clients to transmit the obtained aggregated super network model to the other clients; mapping the aggregated super network model to a basic parameter layer, merging the basic parameter layer and the personalized layer, and determining the obtained merged local target network as the current local target network model; if the preset stop training condition is not met at present, jumping back to the step of training the current local target network model using the objective function; if the preset stop training condition is met at present, determining the current local target network model as the final target network model. It can be seen that when the present application performs federated learning training, when each client trains a large local target network model, a small local super network model can also be obtained. In the process of model training for each client, the current client aggregates the local super network model and the non-local super network model of other clients, and then uses the aggregated super network model to map to the basic parameter layer. It can be understood that each super network model is heterogeneous data of different clients, and then the aggregated super network model is mapped to the basic parameter layer, the basic parameter layer and the personalized layer are merged, and the obtained merged local target network is determined as the current local target network model for the next round of model training. That is to say, in each model training, the heterogeneous data of different clients can be integrated, that is, the final target network model can adapt to the data heterogeneity of different clients, and because only the non-local super network model of other clients is needed during the training process, that is, there is no need to transmit large target network models between clients, so the required data transmission time is greatly reduced, which improves the efficiency of model training in federated learning, saves communication costs, and achieves the purpose of personalized federated learning assisted by blockchain and super network.

[0102] See also Figure 4 As shown, the embodiment of the present application discloses a model training device based on federated learning, which is applied to the current client and includes:

[0103] A model training module 11 is used to perform model training of a current training round on a current local target network model using an objective function to obtain a next local target network model including a local super network model and a personalized layer;

[0104] A model aggregation module 12, used for aggregating the local hypernetwork model and non-local hypernetwork models of other clients to obtain an aggregated hypernetwork model;

[0105] A model merging module 13, configured to map the aggregated super network model into a basic parameter layer, merge the basic parameter layer and the personalized layer, and determine the obtained merged local target network as a new current local target network model;

[0106] The training jump module 14 is used to jump back to the step of training the current local target network model using the objective function if the preset stop training condition is not met at present;

[0107] The training stop module 15 is used to determine the current local target network model as the final target network model if the preset training stop condition is currently met.

[0108] The beneficial effects of the present application are as follows: the present application is applied to the current client, including: using the objective function to perform model training of the current training round on the current local target network model to obtain the next local target network model including the local super network model and the personalized layer; aggregating the local super network model and the non-local super network models of other clients to transmit the obtained aggregated super network model to the other clients; mapping the aggregated super network model to a basic parameter layer, merging the basic parameter layer and the personalized layer, and determining the obtained merged local target network as the new current local target network model; if the preset stop training condition is not met at present, jumping back to the step of training the current local target network model using the objective function; if the preset stop training condition is met at present, determining the current local target network model as the final target network model. It can be seen that when the present application performs federated learning training, when each client trains a large local target network model, a small local super network model can also be obtained. In the process of model training for each client, the current client aggregates the local super network model and the non-local super network model of other clients, and then uses the aggregated super network model to map to the basic parameter layer. It can be understood that each super network model is heterogeneous data of different clients, and then the aggregated super network model is mapped to the basic parameter layer, the basic parameter layer and the personalized layer are merged, and the obtained merged local target network is determined as the current local target network model for the next round of model training. That is to say, in each model training, the heterogeneous data of different clients can be integrated, that is, the final target network model can adapt to the data heterogeneity of different clients, and because only the non-local super network model of other clients is needed during the training process, that is, there is no need to transmit large target network models between clients, so the required data transmission time is greatly reduced, which improves the efficiency of model training in federated learning, saves communication costs, and achieves the purpose of personalized federated learning.

[0109] Furthermore, an embodiment of the present application also provides an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0110] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the model training method based on federated learning performed by the electronic device disclosed in any of the aforementioned embodiments.

[0111] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0112] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0113] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.

[0114] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the model training method based on federated learning performed by the electronic device disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data received by the electronic device and transmitted from an external device, the data 223 can also include data collected by its own input and output interface 25, etc.

[0115] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the model training method based on federated learning disclosed above is implemented. The specific steps of the method can refer to the corresponding contents disclosed in the above embodiments, and will not be repeated here.

[0116] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0117] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. The steps of the method or algorithm described in conjunction with the embodiments disclosed herein can be implemented directly with hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), memory, read-only memory (ROM), electrically programmable EPROM (Erasable Programmable Read Only Memory), electrically erasable programmable EEPROM (Electrically Erasable Programmable read only memory), register, hard disk, removable disk, CD-ROM (Compact Disc Read-Only Memory), or any other form of storage medium known in the technical field.

[0118] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0119] The above is a detailed introduction to the model training method, device, equipment and medium based on federated learning provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A model training method based on federated learning, characterized in that: Applied to the current client, including: Performing model training of the current training round on the current local target network model using the objective function to obtain a next local target network model including a local super network model and a personalized layer; Aggregating the local hypernetwork model and non-local hypernetwork models of other clients to obtain an aggregated hypernetwork model; Mapping the aggregated super network model into a basic parameter layer, merging the basic parameter layer and the personalized layer, and determining the obtained merged local target network as a new current local target network model; If the preset stop training condition is not met at present, jump back to the step of using the objective function to perform model training of the current training round on the current local target network model; If the preset stop training condition is currently met, the current local target network model is determined as the final target network model, so as to use the final target network model to process the detection task of the intelligent vehicle network.

2. The model training method based on federated learning according to claim 1, characterized in that: Aggregating the local hypernetwork model and non-local hypernetwork models of other clients includes: Receive a first non-local super network model of a trusted client using a Gossip protocol; wherein the trusted client belongs to a trusted client group of the current client; Downloading a second non-local hypernetwork model of an untrusted client from the blockchain system; wherein the untrusted client does not belong to the trusted client group of the current client; The local hypernetwork model, the first non-local hypernetwork model, and the second non-local hypernetwork model are aggregated.

3. The model training method based on federated learning according to claim 2, characterized in that: The aggregating the local super network model, the first non-local super network model and the second non-local super network model includes: A normalization parameter and each aggregation weight parameter are determined to aggregate the local hypernetwork model, the first non-local hypernetwork model, and the second non-local hypernetwork model using an aggregation formula constructed based on the normalization parameter and each aggregation weight parameter.

4. The model training method based on federated learning according to claim 3, characterized in that: Determine various weight parameters, including: Inferring the first non-local hypernetwork model and the second non-local hypernetwork model using local data sets respectively to determine a first loss function weight parameter of the first non-local hypernetwork model and a second loss function weight parameter of the second non-local hypernetwork model; A first delayed round compensation weight parameter and a second delayed round compensation weight parameter are determined according to round differences between the current training round and a first training round of the first non-local hypernetwork model and a second training round of the second non-local hypernetwork model.

5. The model training method based on federated learning according to claim 4, characterized in that: The aggregation formula is: ; in, is the hyper-network model after aggregation, is the local hypernetwork model, is the first non-local super network model, is the second non-local super network model, is the normalization parameter, is the client weight parameter of the local hypernetwork model, is the weight parameter of the loss function of the local hypernetwork model, is the first client weight parameter, is the weight parameter of the first loss function, is the compensation weight parameter for the first delay round, is the second client weight parameter, is the weight parameter of the second loss function, is the second delay round compensation weight parameter, For trusted clients, For untrusted clients, The trusted client group for the current client.

6. The model training method based on federated learning according to claim 2, characterized in that: Also includes: Uploading the local hypernetwork model to the blockchain system; Transmitting the parameters of the local hypernetwork model to the untrusted client through the upload block of the current client in the blockchain system, so that the untrusted client performs model training using the parameters of the local hypernetwork model; Accordingly, the process of downloading the second non-local super network model of the untrusted client from the blockchain system also includes: The downloading behavior of the current client downloading the second non-local super network model is recorded through the download block in the blockchain system.

7. The model training method based on federated learning according to any one of claims 1 to 6, characterized in that: The next local target network model also includes a set of embedding vectors; Mapping the aggregated hypernetwork model into a basic parameter layer includes: Performing a convolution operation on the set of embedding vectors and each set of parameter matrices of the hidden layer in the aggregated hypernetwork model to obtain a first mapping result; Processing the first mapping result using the second output layer in the aggregated hypernetwork model to obtain a second mapping result; The second mapping results are concatenated to obtain a basic parameter layer.

8. A model training device based on federated learning, characterized in that: Applied to the current client, including: A model training module, used to perform model training of a current training round on a current local target network model using an objective function to obtain a next local target network model including a local super network model and a personalized layer; A model aggregation module, used for aggregating the local hypernetwork model and non-local hypernetwork models of other clients to obtain an aggregated hypernetwork model; A model merging module, used to map the aggregated super network model into a basic parameter layer, merge the basic parameter layer and the personalized layer, and determine the obtained merged local target network as a new current local target network model; A training jump module, used for jumping back to the step of performing model training of the current training round on the current local target network model using the objective function if the preset stop training condition is not met at present; The training stop module is used to determine the current local target network model as the final target network model if the preset training stop condition is currently met, so as to use the final target network model to process the detection task of the intelligent vehicle network.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the model training method based on federated learning as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the model training method based on federated learning as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Self-adaptive personalized federal learning method and device based on hardware perception and multi-dimensional heterogeneous model aggregation

    CN118886481A