A federated learning method, system, device and medium for vehicle networking data heterogeneity
Patent Information
- Application Number
- CN202410972857.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2044-07-19
AI Technical Summary
[0005]有鉴于此,本发明的目的在于提供一种面向车联网数据异构的联邦学习方法、系统、设备及介质,能够解决现有联邦学习方法存在的数据异构性导致模型精度降低和训练速度减慢的问题,以及个性化联邦学习中存在的通信拥塞问题
[0023]本发明提供了一种基于相似度的区域划分方法,其依据智能网联汽车采集数据的标签信息和位置信息,将智能网联汽车划分到多个区域,以使得同一个区域内的智能网联汽车采集到的数据分布相似,缓解数据异构对模型训练精度的影响;在区域划分的基础之上,本发明提供了一种基于超网络的分层个性化联邦学习方法,采用智能网联汽车-边缘服务器-云中心服务器三层通信架构,其能够为每一个智能网联汽车训练匹配的超网络模型,采用超网络模型预测个性化聚合权重,为每一个智能网联汽车聚合个性化车辆模型;通过分层,其能够为每一个区域的训练匹配的超网络模型,采用超网络模型预测个性化聚合权重,为每一个区域聚合个性区域模型,进而能够有效缓解通信拥塞,提高模型训练速度和模型的精确度;个性区域模型能够用于初始化车辆模型,进而使得智能网联汽车在本地数据集上进行微调模型实现快速个性化。
Smart Images

Figure CN118918554B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of vehicle networking technology and distributed machine learning technology, and relates to a federated learning method, system, device and medium for heterogeneous vehicle networking data. Background Technology
[0002] With the rapid development of vehicle-to-everything (V2X) technology, an increasing number of intelligent connected vehicles are being deployed in vehicle networks, linking physical and digital transportation to provide comprehensive services to traffic participants. In this context, each intelligent connected vehicle is a producer and owner of data, leading to a rapid increase in various multi-source spatiotemporal data. Driven by big data and high computing power, machine learning has become a crucial method for achieving intelligent driving. Machine learning plays a vital role in tasks such as all-around perception, deep scene understanding, and intelligent behavior decision-making. However, learning intelligent driving models from data scattered across various vehicle devices faces many challenges. To address the problem of distributed training, the mainstream solutions are centralized learning and federated learning. Centralized learning collects data generated by different onboard devices and sends it to a cloud server (or cloud server cluster) for model training, which may result in high data transmission costs and data privacy leaks. As a novel distributed machine learning technology, federated learning allows onboard computing devices to train local models on local datasets using gradient descent or stochastic gradient descent methods, and then send the local models to a cloud server. The cloud server aggregates the local models into a globally shared model, making this model contain all the experiential knowledge learned by the local models. This process makes the data available but not visible, technically protecting user privacy and fully leveraging the value of data collected in real time from a large number of vehicles.
[0003] Existing federated learning methods are mainly divided into two categories: single-model federated learning mechanisms and multi-model federated learning mechanisms. In single-model federated learning, all in-vehicle computing devices train local models on local datasets and then send these local models to a cloud server. The cloud server is responsible for aggregating all local models into a single global model. In multi-model federated learning, the cloud server collaborates with all in-vehicle computing devices to train multiple personalized local models, which can meet the user's personalized driving needs.
[0004] However, during the implementation of the above process, it was found that the multi-source data collected by different vehicle-mounted sensors exhibits complex data heterogeneity due to differences in collection time and location, manifesting as significant differences in the distribution of data collected by different vehicle-mounted sensors. The federated learning approach described above did not address the data heterogeneity issue in its design, and this complex data heterogeneity significantly reduces the performance of a single global model and slows down model training. Secondly, traditional personalized federated learning often employs a two-layer federated learning architecture: an on-board computing device-cloud central server architecture. In the context of large-scale vehicle-to-everything (V2X) federated learning, this two-layer architecture faces severe communication congestion problems. Vehicle network congestion increases the communication overhead of on-board computing devices uploading or downloading models, further slowing down model training and reducing model accuracy. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a federated learning method, system, device and medium for heterogeneous data in the Internet of Vehicles, which can solve the problems of reduced model accuracy and slowed training speed caused by data heterogeneity in existing federated learning methods, as well as the communication congestion problem in personalized federated learning.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] The federated learning method for heterogeneous data in the Internet of Vehicles provided by this invention includes two stages: the first stage is a region partitioning method based on similarity, and the second stage is a hierarchical personalized federated learning method based on hypernetworks.
[0008] Specifically, it includes:
[0009] The first aspect of this invention provides a similarity-based region segmentation method, which is applied to intelligent connected vehicles and cloud center servers, comprising:
[0010] Before starting federated learning training, the intelligent connected vehicle uses its onboard sensors to collect sample data, its onboard camera to collect image data, and its positioning sensor to collect location information. The image data collected by the onboard camera will be stored in a local storage device as the local training dataset for the intelligent connected vehicle. The intelligent connected vehicle uses a homomorphic encryption algorithm to calculate the tag information and vehicle location information of the encrypted image data, and then uploads the encrypted data to the cloud center server. After receiving the upload requests for tag information and location information from all intelligent connected vehicles, the cloud center server uses a region partitioning algorithm to divide each intelligent connected vehicle into a matching region.
[0011] After receiving all the tag information, location information, and other metadata information uploaded by the intelligent connected vehicles, the cloud center server executes the following partitioning algorithm to obtain the region partitioning result: The cloud center server creates a region partitioning process, decrypts the encrypted metadata information using a homomorphic encryption algorithm, and randomly selects the metadata information of K intelligent connected vehicles as K initial region centers; for the remaining unselected intelligent connected vehicles, the cloud center server's region partitioning process calculates the distance or similarity between the unselected intelligent connected vehicle and the metadata information of the K region centers, and assigns the unselected intelligent connected vehicle to the region represented by the region center with the smallest distance or the largest similarity; The cloud center server calculates the average value of the metadata information of the intelligent connected vehicles covered in each region, uses it as the new region center, and continues to repeat the above partitioning steps until the region centers no longer change or the specified stopping condition is reached; the region partitioning result includes K regions, each region being a subset of intelligent connected vehicles;
[0012] The cloud center server calculates the encrypted form of the region division result using a homomorphic encryption algorithm and sends the encrypted data to the intelligent connected vehicles. The division method groups intelligent connected vehicles with similar tag information or similar location information into the same geographical region. The collaborative region division between the intelligent connected vehicles and the cloud center server makes the data distribution of intelligent connected vehicles in the same region similar, effectively improving the model training accuracy and training speed.
[0013] The second aspect of this invention provides a hierarchical personalized federated learning method based on a hypernetwork, comprising: after region division, deploying an edge server and a personalized region model in each region; a cloud center server managing all edge servers and constructing a personalized region model for each region; each edge server scheduling intelligent connected vehicles within a region to collaboratively train vehicle models and constructing personalized vehicle models for intelligent connected vehicles within the region; intelligent connected vehicles downloading vehicle models from the edge servers and training the vehicle models on local training datasets. Each edge server transmits model parameters to the cloud center server via a communication terminal, and each intelligent connected vehicle transmits model parameters to the edge server of its respective region via a communication terminal; the hypernetwork is a multilayer perceptron network model, composed of trainable embedding vectors and network parameters, responsible for learning personalized model aggregation weights.
[0014] The third aspect of this invention provides a hierarchical personalized federated learning method based on hypernetworks, applied to intelligent connected vehicles, comprising: after the start of the current communication round, for each intelligent connected vehicle, the intelligent connected vehicle downloads the initialized personalized vehicle model of the current communication round from the edge server of its respective region; the onboard local computing device creates a training process, performing fixed k1 local training iterations on a full-batch training dataset or a random-batch training dataset; during each local training process, the computing device of the intelligent connected vehicle optimizes the local model using a pre-set optimization algorithm (including gradient descent or stochastic gradient descent, etc.); after the local training is completed, the intelligent connected vehicle calculates the local model update between the trained local model and the initialized personalized vehicle model, and uploads the local model update and the trained local model parameters to the edge server.
[0015] The fourth aspect of the present invention provides a hierarchical personalized federated learning method based on hypernetworks, which is applied to an edge server, comprising: before the start of the federated learning communication round, for each edge server, the edge server creates a scheduling process to schedule all intelligent connected vehicles in its region to collaboratively participate in federated learning training; the scheduling process creates a hypernetwork model for each intelligent connected vehicle managed by the edge server, and initializes the embedding vector and hypernetwork model parameters of the hypernetwork model; the scheduling process creates a vehicle model for each intelligent connected vehicle managed by the edge server, downloads a personalized region model from a cloud center server, and initializes the parameters of the vehicle model using the personalized region model parameters;
[0016] In the first round or initial communication round of federated learning, after receiving a request from each intelligent connected vehicle to download a personalized vehicle model, the scheduling process of the edge server inputs an embedding vector into the hypernetwork model that matches the intelligent connected vehicle; the hypernetwork model predicts and calculates a personalized aggregation weight vector; based on the personalized aggregation weight vector, the scheduling process aggregates the vehicle models of all intelligent connected vehicles within the area managed by the edge server to obtain a personalized vehicle model; the edge server then sends the personalized vehicle model to the intelligent connected vehicle.
[0017] Before starting the second and subsequent communication rounds of federated learning, the edge server receives and processes requests for local model updates and parameters uploaded by connected vehicles from the previous communication round. The scheduling process uses the local model updates as pseudo-gradient information and employs gradient descent to optimize the parameters and embedding vectors of the hypernetwork model matched to the connected vehicle. Once the scheduling process has responded to all requests for local model updates uploaded by connected vehicles and updated the parameters and embedding vectors of all hypernetwork models, a new communication round is initiated.
[0018] In the second and subsequent communication rounds of federated learning, after receiving a request from each intelligent connected vehicle to download a personalized vehicle model, the scheduling process inputs the updated embedding vector into the hypernetwork model matching the intelligent connected vehicle. The hypernetwork model predicts and calculates a personalized aggregation weight vector. Based on the personalized aggregation weight vector, the scheduling process aggregates the vehicle models of all intelligent connected vehicles within the area managed by the edge server to obtain a personalized vehicle model. The edge server then sends the personalized vehicle model to the intelligent connected vehicle.
[0019] During each k2-round communication cycle in federated learning, the scheduling process aggregates vehicle models within the region managed by the edge server according to a pre-configured aggregation strategy, obtaining a regional model. The scheduling process calculates the regional model update between the aggregated regional model and the most recently downloaded personalized regional model from the cloud center server, and sends the updated regional model along with its parameters to the cloud center server. Preferably, the edge server downloads the optimized personalized regional model from the cloud center server, reinitializes the vehicle model parameters, and begins the next round of training.
[0020] The fifth aspect of this invention provides a hierarchical personalized federated learning method based on a hypernetwork, applied to a cloud central server, comprising: before federated learning begins, the cloud central server creates a central scheduling process. The central scheduling process creates a hypernetwork model for each edge server and initializes the embedding vector and model parameters of the hypernetwork model. The central scheduling process creates a region model for each edge server and initializes the region model parameters. During every k2 communication rounds of federated learning, after the cloud central server receives a request from the edge server to upload a region model update and region model parameter, the central scheduling process uses the region model update as a pseudo-gradient and updates the embedding vector and model parameters of the hypernetwork model matched by the edge server using gradient descent. In the current communication round, after the cloud central server receives a download request for a personalized region model from the edge server, the central scheduling process inputs the embedding vector matched by the edge server into the hypernetwork model; the hypernetwork model predicts and calculates a personalized aggregation weight vector; the central scheduling process aggregates all the region models uploaded by the edge servers according to the personalized aggregation weight vector to obtain the personalized region model of the edge server; the central scheduling process sends the personalized region model to the edge server.
[0021] A sixth aspect of the present invention provides a computer device and a non-volatile readable storage medium, comprising: sensors, a processor, a memory, and a communication terminal in intelligent connected vehicles, edge servers, and cloud central servers; the sensors perceive the surrounding environment and collect local training datasets; the processor executes computer instructions stored in the memory; and the communication terminal includes any one of 2G, 3G, 4G, and 5G; preferably, selecting a 5G communication terminal can reduce communication costs and improve model training speed; the non-volatile readable storage medium includes computer programs and model parameters, and the computer processor can control the non-volatile readable storage medium to implement the similarity-based region segmentation method and the hierarchical personalized federated learning method based on hypernetworks described in the first to fifth aspects.
[0022] The beneficial effects of this invention are as follows:
[0023] This invention provides a similarity-based region segmentation method. Based on the label and location information of data collected by intelligent connected vehicles, it divides intelligent connected vehicles into multiple regions, ensuring similar data distribution within the same region and mitigating the impact of data heterogeneity on model training accuracy. Building upon region segmentation, this invention provides a hierarchical personalized federated learning method based on hypernetworks. It employs a three-layer communication architecture: intelligent connected vehicle – edge server – cloud center server. This architecture trains a matching hypernetwork model for each intelligent connected vehicle, predicts personalized aggregation weights using the hypernetwork model, and aggregates personalized vehicle models for each intelligent connected vehicle. Through hierarchical structure, it trains a matching hypernetwork model for each region, predicts personalized aggregation weights using the hypernetwork model, and aggregates personalized region models for each region. This effectively alleviates communication congestion and improves model training speed and accuracy. The personalized region models can be used to initialize vehicle models, enabling intelligent connected vehicles to rapidly personalize their models by fine-tuning them on local datasets.
[0024] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0025] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:
[0026] Figure 1 This is a flowchart illustrating a federated learning method for heterogeneous data in the Internet of Vehicles provided in Embodiment 1 of the present invention.
[0027] Figure 2 This is a system framework diagram of a federated learning system for heterogeneous data in the Internet of Vehicles provided in Embodiment 1 of the present invention;
[0028] Figure 3 This is a flowchart of a similarity-based region partitioning algorithm provided in Embodiment 2 of the present invention;
[0029] Figure 4 This is a schematic diagram of a region partitioning subsystem based on similarity provided in Embodiment 2 of the present invention;
[0030] Figure 5 This is a schematic diagram of a hierarchical personalized federated learning subsystem structure based on a hypernetwork, provided in Embodiments 3, 4 and 5 of the present invention. Detailed Implementation
[0031] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.
[0032] Example 1:
[0033] Reference Figure 1 This is a flowchart of a federated learning method for heterogeneous vehicle network data provided in Embodiment 1 of the present invention;
[0034] The federated learning method for heterogeneous data in the Internet of Vehicles provided in Embodiment 1 of this invention is applied to intelligent connected vehicles, edge servers, and cloud center servers, and includes steps S11 to S15:
[0035] In step S11, the intelligent connected vehicle uploads the tag information and vehicle location information of the data sample to the cloud center server. The cloud center server executes a regional division algorithm to divide the large area where all intelligent connected vehicles are located into several small areas, and intelligent connected vehicles with similar data distributions are clustered in the same area.
[0036] Step S12: The intelligent connected vehicle downloads a personalized vehicle model from the edge server of its region, performs k1 gradient descent operations on the local training dataset, and sends the local model update and local model parameters to the edge server.
[0037] Step S13: After the edge server receives the local model update uploaded by the intelligent connected vehicle, the scheduling process uses the local model update as a pseudo-gradient to update the embedding vector and model parameters of the super network model, uses the updated embedding vector as the input of the super network and predicts the personalized aggregation weight vector; the scheduling process uses the personalized aggregation weight vector to aggregate the local models uploaded by the other intelligent connected vehicles in this area to obtain the personalized vehicle model of the current intelligent connected vehicle.
[0038] In step S14, every k2 communication rounds, the scheduling process aggregates vehicle models within the area managed by the edge server according to a pre-configured aggregation strategy to obtain a regional model. The scheduling process then sends the updated regional model and its parameters to the cloud center server. Preferably, the edge server downloads the optimized personalized regional model from the cloud center server, reinitializes the vehicle model parameters, and starts the next round of training.
[0039] In step S15, after the cloud center server receives the regional model update uploaded from the edge server, the central scheduling process uses the regional model update as a pseudo-gradient to update the embedding vector and model parameters of the hypernetwork model, inputs the updated embedding vector into the hypernetwork model and predicts the personalized aggregated weight vector; the central scheduling process aggregates all the regional models uploaded by the edge servers according to the personalized aggregated weight vector to obtain the personalized regional model of the edge server.
[0040] Reference Figure 2 , Figure 2 This invention illustrates a framework diagram of a federated learning system for heterogeneous data in the Internet of Vehicles (IoV) provided in Embodiment 1 of the present invention. This system executes as follows: Figure 1 Steps S11 to S15; the system framework designed in this embodiment consists of three layers: intelligent connected vehicles, edge servers, and cloud central servers. Each intelligent connected vehicle is equipped with sensors to collect training datasets 208 and store the training data in local non-volatile memory. When the system starts, the edge server creates and runs scheduling process 205, vehicle model personalization process 206, and region model aggregation process 207, reads data from memory 204, and writes the program execution results into memory 204. The intelligent connected vehicle can communicate with the edge server via base station 209 to obtain neural network model parameters; the specific communication terminal can be one of 2G, 3G, 4G, or 5G. When the cloud central server starts, it creates and runs region partitioning process 201, central scheduling process 202, and region model personalization process 203, reads data from memory 204, and writes the program execution results into memory 204.
[0041] Example 2:
[0042] This second embodiment is a detailed supplement to step S11 of embodiment one. (Refer to...) Figure 3 This is a flowchart of a similarity-based region segmentation method provided in Embodiment 2 of the present invention. Embodiment 2 of the present invention provides a similarity-based region segmentation method, including steps S21 to S26:
[0043] Step S21, Intelligent connected vehicles collect sample tag information vectors and location information vector The encrypted tag information vector L is calculated using a homomorphic encryption algorithm. i The position information vector V i The encrypted data is sent to the cloud center server; among them, This represents the number of categories represented by the m-th label among all samples collected from the intelligent connected vehicle with ID i. and These represent the location coordinates of the intelligent connected vehicle;
[0044] Step S22, the cloud center server uses a homomorphic encryption algorithm to encrypt the tag information vector L. i The position information vector V i Decrypt the tag information vector L i Quantized into a label richness vector Where the label information vector L i The quantization method for the feature represented by the m-th dimension is as follows:
[0045]
[0046] in, All the intelligent connected vehicles are distributed across M cities, with the subscript j representing the j-th city among the M cities; This represents the number of categories represented by the m-th label among all samples collected from the intelligent connected vehicle with ID i; This represents the average number (number / vehicle) of the category represented by the m-th label in the samples collected from all intelligent connected vehicles in the j-th city; This represents the relative richness of the m-th category in the samples collected from the intelligent connected vehicle with ID i.
[0047] Step S23: The cloud center server randomly selects K tag richness vectors and location information vectors of intelligent connected vehicles as the initial region centers;
[0048] Step S24: The cloud center server calculates the distances between the remaining intelligent connected vehicles and the K regional centers, and assigns the intelligent connected vehicles to the region represented by the regional center with the smallest distance; wherein, the distance between the intelligent connected vehicle numbered i and the regional center numbered u is calculated as follows:
[0049] Dist(i,u)=||V i -V u ||2+γ||C i -C u ||2
[0050] Among them, λ can be set to [0, 1] depending on the specific task being performed;
[0051] Step S25: The cloud center server calculates the average value of the tag richness vector and location information vector of the intelligent connected vehicles covered in each region, and uses it as the new region center; repeat steps S24 to S25 until the region center is stable or the maximum number of iterations is reached.
[0052] Step S26: The cloud center server uses a homomorphic encryption algorithm to process the region partitioning results. Encryption is performed, and the encrypted data is broadcast to all intelligent connected vehicles; the intelligent connected vehicles then decrypt the encrypted region division results using a homomorphic encryption algorithm; among these... Let represent the set of all intelligent connected vehicles in the k-th region;
[0053] In practical implementation, step S23 can use the KMeans++ algorithm to select K region centers, avoiding the random selection algorithm from selecting outliers as region centers, thereby improving the effect of region division; the encryption algorithm can be Paillier encryption algorithm, etc.
[0054] Reference Figure 4 This is a schematic diagram of the subsystem framework of the similarity-based region segmentation method provided in Embodiment 2 of the present invention. The diagram illustrates a communication process between an intelligent connected vehicle and a cloud center server. Each intelligent connected vehicle collects sample data in a specific urban area, with circles representing sample points collected in that area. The dashed arrow pointing to the right indicates that the intelligent connected vehicle collects label information from all samples and calculates vehicle location information; the solid arrow pointing to the right indicates that the intelligent connected vehicle uploads encrypted label information and vehicle location information; the solid arrow pointing downwards indicates that the cloud center server executes a region segmentation algorithm based on the label information and vehicle location information, allocating the intelligent connected vehicle to multiple regions; the solid arrow pointing to the left indicates that the cloud center server broadcasts the region segmentation results. Through collaborative region segmentation between the intelligent connected vehicle and the cloud center server, intelligent connected vehicles with similar data distributions can cluster in the same region to perform federated learning training models, mitigating the impact of data heterogeneity on model accuracy.
[0055] Example 3:
[0056] This third embodiment is a detailed supplement to step S12 in embodiment one; the hierarchical personalized federated learning method based on hypernetworks provided in embodiment three of the present invention, applied to intelligent connected vehicles, includes steps S31 to S33:
[0057] Step S31: After the current communication round begins, for each of the intelligent connected vehicles, the intelligent connected vehicle numbered i downloads the initialized personalized vehicle model w for the current communication round from the edge server of its respective region. i
[0058] Step S32: The onboard local computing device creates a training process on the full batch training dataset. Perform a fixed number of k1 local training iterations and optimize the local training objective as follows:
[0059]
[0060] in, It is the size of the full batch training dataset, x (i,j) This is the j-th sample data of the intelligent connected vehicle with ID i, y (i,j) It is the sample label of the j-th sample data;
[0061] Step S33: During each local training process, the computing device of the intelligent connected vehicle uses gradient updates. Optimize the local model;
[0062] Step S34: After local training is completed, the intelligent connected vehicle calculates the local model update Δw between the trained local vehicle model and the initialized vehicle model. i And update Δw in the local model. i With the trained local model parameters w i Uploaded to the edge server.
[0063] In specific implementation, depending on the different training tasks of intelligent connected vehicles, the loss function l can be specified as cross-entropy loss, mean squared error loss, or other loss functions, etc.
[0064] Reference Figure 5 This is a schematic diagram of a hierarchical personalized federated learning subsystem based on hypernetworks. Figure 5 Subgraph (1) illustrates the process of training vehicle model 302 on local training dataset 301 for the intelligent connected vehicle.
[0065] Example 4:
[0066] This fourth embodiment is a detailed supplement to steps S13 and S14 in embodiment one. The hierarchical personalized federated learning method based on hypernetworks provided in embodiment four of the present invention, applied to edge servers, includes steps S41 to S44;
[0067] Step S41: Before the federated learning communication round begins, for each edge server, the edge server creates a scheduling process; the scheduling process creates a hypernetwork model h for each intelligent connected vehicle managed by the edge server (taking edge server number k as an example, for example, intelligent connected vehicle number i). i (v i ;ψ i), and initialize the embedding vector v of the hypernetwork model. i And hypernetwork model parameters ψ i The scheduling process creates a vehicle model for each intelligent connected vehicle managed by the edge server. Then download the personalized region model from the cloud center server and use the personalized region model parameters to initialize the vehicle model parameters;
[0068] In step S42, after receiving a request from each intelligent connected vehicle to download a personalized vehicle model, the edge server's scheduling process will embed a vector v. i Input into the hypernetwork model h that is matched with intelligent connected vehicles i (v i ;ψ i The hypernetwork model predicts and calculates personalized aggregation weight vectors. in The scheduling process, based on a personalized aggregation weight vector, aggregates vehicle models of all intelligent connected vehicles within the area managed by the edge server, integrating them to obtain a personalized vehicle model. The specific personalized aggregation method is as follows:
[0069]
[0070] in, This represents the set of vehicle models uploaded by intelligent connected vehicles within its local area, received by the edge server numbered k. The edge server then sends personalized vehicle models to the intelligent connected vehicles.
[0071] In step S43, the edge server receives and processes the local model update request uploaded by the intelligent connected vehicle in the previous communication round; the scheduling process updates Δw with the local model. i As pseudo-gradient information, gradient descent is used to optimize the parameters and embedding vectors of the hypernetwork model matched by the intelligent connected vehicle. Once the scheduling process responds to all requests for local model updates uploaded by intelligent connected vehicles and updates the parameters and embedding vectors of all hypernetwork models, a new communication round is initiated.
[0072] Step S44: During every k2 communication rounds of federated learning, the scheduling process aggregates the vehicle models within the region managed by the edge server (taking edge server number k as an example) according to the pre-configured aggregation strategy to obtain the region model. The aggregation strategy adopted is as follows:
[0073]
[0074] in, This represents the average model of vehicle models within the area managed by the edge server numbered k, g(·) = e -(·)This is a penalty function; the greater the norm distance between the vehicle model and the average model, the larger the penalty and the smaller the aggregation weight. The scheduling process calculates the regional model update between the aggregated regional model and the most recently downloaded personalized regional model from the cloud center server, and sends the regional model update and regional model parameters to the cloud center server. Preferably, the edge server downloads the optimized personalized regional model from the cloud center server, reinitializes the vehicle model parameters, and starts the next round of training.
[0075] In practice, other aggregation strategies can be used to replace the aggregation strategy in step S44, or other penalty functions can be used to replace the penalty function in step S44.
[0076] Reference Figure 5 This is a schematic diagram of a hierarchical personalized federated learning subsystem based on hypernetworks. Figure 5 Subgraph (2) illustrates the execution process of the edge server. The edge server updates the embedding vector 304 and the hypernetwork model parameters 303, and inputs the embedding vector 304 into the hypernetwork model 303. The edge server uses the hypernetwork model to predict personalized aggregation weights, and aggregates other vehicle models through the personalized aggregation weights to obtain personalized vehicle models.
[0077] Example 5:
[0078] This fifth embodiment is a detailed supplement to step S15 in embodiment one. The hierarchical personalized federated learning method based on hypernetworks provided in embodiment five of the present invention is applied to a cloud central server and includes steps S51 to S53;
[0079] Step S51: Before federated learning begins, the cloud center server creates a central scheduling process. The central scheduling process creates a hypernetwork model h for each edge server (taking edge server number k as an example). k (v k ;ψ k ), and initialize the embedding vector v of the hypernetwork model. k and model parameters ψ k The central scheduling process creates a region model for each edge server and initializes the region model parameters.
[0080] Step S52: In the current communication round, after the cloud center server receives a download request for a personalized regional model from the edge server, the central scheduling process will match the embedding vector v from the edge server. k Input into the hypernetwork model h k (v k ;ψ k The hypernetwork model predicts and calculates personalized aggregation weight vectors. in The central scheduling process aggregates the upload region models of all edge servers based on the personalized aggregation weight vector to obtain the personalized region model of the edge server, using the following method:
[0081]
[0082] in, This indicates that the cloud center server receives a set of regional models uploaded by K edge servers; the central scheduling process then sends the personalized regional models to the edge servers.
[0083] In step S53, during each k2 communication round of federated learning, the cloud center server receives a request from the edge server to upload regional model updates and regional model parameters. The central scheduling process then uses the regional model updates as pseudo-gradients and employs gradient descent to update the embedding vectors and model parameters of the hypernetwork model matched by the edge server.
[0084] Reference Figure 5 This is a schematic diagram of a hierarchical personalized federated learning subsystem based on hypernetworks. Figure 5 Subgraph (3) illustrates the execution process of the cloud center server.
[0085] Example 6:
[0086] Embodiment 6 of the present invention provides a computer device and a non-volatile readable storage medium. The computer device includes a sensor, a processor, a memory, and a communication terminal. The non-volatile storage medium includes a stored computer program.
[0087] The sensor is a detection device that can sense the measured information and transform the sensed information into an electrical signal or other required form of information output according to a certain rule, so as to meet the requirements of information transmission, processing, storage, display, recording and control. It can be a position sensor (GPS), an RGB camera, an inertial sensor (IMU sensor), or an odometer sensor, etc.
[0088] The processor may be a central processing unit (CPU), a graphics processing unit (GPU), or some other general-purpose processor; the processor is capable of executing the federated learning method for heterogeneous data in the Internet of Vehicles implemented by the computer program described in the above embodiments, for example... Figure 1 Steps S11 to S15 in the process.
[0089] The memory can be used to store the computer program, training data, and model parameters described in the above embodiments. The processor can execute the computer program in the memory and access the training data in the memory to perform the model training process. The memory includes a main memory and an auxiliary memory. The main memory can be RAM, flash memory, or other forms of storage media, and is mainly used to store the programs and data being executed by the processor during implementation. The auxiliary memory can be a disk, a removable hard disk, or other forms of storage, and is mainly used to store inactive programs and data during implementation, such as data collected by the corresponding sensor.
[0090] The non-volatile storage medium of the computer includes a stored computer program; the computer program may be a source code program, an executable file, or other form of machine instruction sequence; the non-volatile storage medium of the computer refers to any recording medium capable of carrying a computer program, such as a USB flash drive, an optical disc, or a computer memory, etc.
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications should be covered within the scope of the claims of the present invention.
Claims
1. A federated learning method for heterogeneous data in the Internet of Vehicles (IoV), involving intelligent connected vehicles, edge servers, and cloud central servers, characterized in that: This method comprises two stages: the first stage is a similarity-based region segmentation method, and the second stage is a hierarchical personalized federated learning method based on hypernetworks, specifically including the following steps: S1. Intelligent connected vehicles upload the tag information and vehicle location information of data samples to the cloud center server. The cloud center server executes a regional division algorithm to divide the large area where all intelligent connected vehicles are located into several smaller areas. The intelligent connected vehicle calculates the tag information and vehicle location information of the encrypted image data using a homomorphic encryption algorithm, and uploads the encrypted data to the cloud center server. The cloud center server will create a region partitioning process, decrypt the encrypted metadata information using a homomorphic encryption algorithm, and randomly select K metadata information of intelligent connected vehicles as K initialized region centers; For the remaining unselected intelligent connected vehicles, the cloud center server's region division process calculates the distance or similarity between the vehicle and the metadata information of the K region centers, and assigns the unselected intelligent connected vehicle to the region represented by the region center with the smallest distance or the largest similarity. S2. After regional division, deploy an edge server and a personalized regional model in each region; the cloud center server is responsible for managing all edge servers and building a personalized regional model for each region; each edge server schedules intelligent connected vehicles in a region to collaboratively train vehicle models and builds personalized vehicle models for intelligent connected vehicles in the region; intelligent connected vehicles download vehicle models from edge servers, train vehicle models on local training datasets, perform k1 gradient descent operations on local training datasets, and send local model updates and local model parameters to edge servers; S3. After the edge server receives the local model update uploaded from the intelligent connected vehicle, the scheduling process uses the local model update as a pseudo-gradient to update the embedding vector and model parameters of the super network model. The updated embedding vector is used as the input of the super network to predict the personalized aggregation weight vector. The scheduling process uses the personalized aggregation weight vector to aggregate the local models uploaded by other intelligent connected vehicles in this area to obtain the personalized vehicle model of the current intelligent connected vehicle. S4. Every k2 communication rounds, the scheduling process aggregates the vehicle models within the area managed by the edge server according to the pre-configured aggregation strategy to obtain the regional model; the scheduling process sends the regional model update and regional model parameters to the cloud center server. S5. After receiving the regional model update uploaded from the edge server, the cloud center server uses the regional model update as a pseudo-gradient to update the embedding vector and model parameters of the hypernetwork model. The updated embedding vector is then input into the hypernetwork model to predict the personalized aggregated weight vector. Based on the personalized aggregated weight vector, the central scheduling process aggregates all the regional models uploaded by the edge servers to obtain the personalized regional model of the edge server.
2. The federated learning method for heterogeneous data in the Internet of Vehicles (IoV) according to claim 1, characterized in that: In step S2, for each intelligent connected vehicle, the intelligent connected vehicle downloads the initial personalized vehicle model of the current communication wheel from the edge server of its region; the on-board local computing device creates a training process and performs a fixed number of local training sessions on the full batch training dataset or the random batch training dataset; During each local training process, the computing device of the intelligent connected vehicle uses a pre-set optimization algorithm to optimize the local model; after the local training is completed, the intelligent connected vehicle calculates the local model update between the trained local model and the initialized personalized vehicle model, and uploads the local model update and the trained local model parameters to the edge server.
3. The federated learning method for heterogeneous data in the Internet of Vehicles (IoV) according to claim 2, characterized in that: Before the federated learning communication round begins, for each edge server, the edge server creates a scheduling process to schedule all intelligent connected vehicles in its region to collaboratively participate in federated learning training; the scheduling process creates a hypernetwork model for each intelligent connected vehicle managed by the edge server and initializes the embedding vector and hypernetwork model parameters of the hypernetwork model; the scheduling process creates a vehicle model for each intelligent connected vehicle managed by the edge server and downloads a personalized regional model from the cloud center server, and initializes the parameters of the vehicle model using the personalized regional model parameters; After receiving a request from each intelligent connected vehicle to download a personalized vehicle model, the scheduling process of the edge server will embed a vector into the hypernetwork model that matches the intelligent connected vehicle; the hypernetwork model will predict and calculate a personalized aggregation weight vector; based on the personalized aggregation weight vector, the scheduling process will aggregate the vehicle models of all intelligent connected vehicles in the area managed by the edge server to obtain a personalized vehicle model. The edge server sends personalized vehicle models to the intelligent connected vehicle. The edge server receives and processes requests for local model updates and local model parameters uploaded by the intelligent connected vehicles in the previous communication round; the scheduling process uses the local model updates as pseudo-gradient information and optimizes the hypernetwork model parameters and embedding vectors matched by the intelligent connected vehicle using gradient descent; when the scheduling process responds to all requests for local model updates uploaded by intelligent connected vehicles and updates the parameters and embedding vectors of all hypernetwork models, a new communication round is started. During each k2 communication round of federated learning, the scheduling process aggregates vehicle models within the area managed by the edge server according to a pre-configured aggregation strategy to obtain a regional model. The scheduling process calculates the regional model update between the aggregated regional model and the personalized regional model recently downloaded from the cloud center server, and sends the regional model update and regional model parameters to the cloud center server.
4. The federated learning method for heterogeneous data in the Internet of Vehicles (IoV) according to claim 3, characterized in that: Before federated learning begins, the cloud center server creates a central scheduling process; the central scheduling process creates a hypernetwork model for each edge server and initializes the embedding vectors and model parameters of the hypernetwork model; the central scheduling process creates a region model for each edge server and initializes the region model parameters. During each k2 communication round of federated learning, the cloud center server receives a request from the edge server to upload regional model updates and regional model parameters. The central scheduling process then uses the regional model updates as pseudo-gradients and employs gradient descent to update the embedding vectors and model parameters of the hypernetwork model matched by the edge server. In the current communication round, after the cloud center server receives a download request for a personalized region model from the edge server, the central scheduling process inputs the embedding vector matched by the edge server into the hypernetwork model; the hypernetwork model predicts and calculates the personalized aggregation weight vector; the central scheduling process aggregates all the region models uploaded by the edge servers based on the personalized aggregation weight vector to obtain the personalized region model of the edge server. The central scheduling process sends personalized regional models to the edge servers.
5. A federated learning system for heterogeneous data in the Internet of Vehicles (IoV), characterized in that: The system employs the method described in any one of claims 1 to 4.
6. A federated learning device for heterogeneous data in the Internet of Vehicles (IoV), characterized in that: The device employs the method described in any one of claims 1 to 4.
7. A computer device and a non-volatile readable storage medium, characterized in that: The computer device includes sensors, processors, memory, and communication terminals in intelligent connected vehicles, edge servers, and cloud center servers; the sensors perceive the surrounding environment and collect local training datasets, and the processor executes computer instructions stored in the memory; the non-volatile readable storage medium includes computer programs and model parameters, and the computer processor can control the computer device where the non-volatile readable storage medium is located to execute the federated learning method for heterogeneous data in the Internet of Vehicles as described in any one of claims 1 to 4.