Internet of vehicles federal learning method based on vehicle client selection

By using the backpack model to select the vehicle client in the federated learning of the Internet of Vehicles, combining the importance of data samples and the upload time of model parameters, the model training efficiency and accuracy problems caused by data and equipment heterogeneity are solved, and a higher model convergence speed and accuracy are achieved.

CN119729547AActive Publication Date: 2025-03-28HENAN UNIV OF SCI & TECH
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411837491.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-03-28
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

In the Internet of Vehicles environment, data and device heterogeneity affects the accuracy and efficiency of the federated learning model. The method of randomly selecting clients cannot effectively reflect the global data distribution, resulting in a decrease in model training efficiency and accuracy.

Method used

The central server periodically collects the prior resource information of the vehicle client, calculates the importance of data samples and the upload time of model parameters, and uses a backpack model to select the vehicle client to ensure that the selected data has higher representation and value, thereby accelerating model convergence and improving accuracy.

Benefits of technology

This method considers the importance of data samples and upload time and selects the optimal vehicle client combination to participate in model training, which significantly improves the accuracy and training efficiency of the model and reduces resource consumption and training costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119729547A_ABST
    Figure CN119729547A_ABST
Patent Text Reader

Abstract

The invention discloses an Internet of Vehicles federated learning method based on vehicle client selection, and the method comprises the steps: a central server periodically collects the prior resource information of each vehicle client through a roadside base station, and in each round of federated learning, after each vehicle client completes local training, each vehicle client carries out the local training; data sample importance is obtained through calculation and uploaded to the central server, and the central server calculates the time of uploading model parameters by the vehicle client in the federated learning of this round according to the prior resource information; according to data sample importance and time, a backpack model is used for solving to obtain a selected vehicle client set, a selected identifier is sent to each vehicle client, and model parameters uploaded by each vehicle client receiving the selected identifier are aggregated by a central server. According to the method, it can be ensured that data selected in each round of federated learning has higher representativeness and value, the convergence process of the model is accelerated, and the accuracy of the model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of vehicle network federated learning, and more specifically, relates to a vehicle network federated learning method based on vehicle client selection. Background Art

[0002] The Internet of Vehicles (IoV) uses cellular vehicle-to-everything (C-V2X) and dedicated short-range vehicle-to-everything (DSRC-V2X) as the main protocol standards to achieve all-round connection and communication between vehicles (V2V), vehicles and pedestrians (V2P), and vehicles and traffic infrastructure (V2I). This all-round connection and communication enables vehicles to continuously detect the surrounding environment and obtain accurate perception results, thereby improving the vehicle's capabilities in blind spot detection, path planning, and speed limit warning, and achieving smarter and safer traffic management and driving experience. However, the massive amount of raw data generated by vehicles contains a large amount of user sensitive information, and there is a risk of privacy leakage during the upload process. To strengthen the protection of vehicle privacy, existing work generally adopts a learning framework based on client privacy protection - federated learning (FL). Federated learning allows vehicles to train models locally and upload updated model parameters to a central server for aggregation, reducing the risk of privacy leakage. However, in the IoV environment, considering the wide variety and heterogeneous distribution of data, data deviations of different vehicle nodes will greatly affect the accuracy of the global model. At the same time, due to the heterogeneity of devices between vehicles, such as network transmission latency, memory, computing power, and device availability, if a bad vehicle node is randomly selected, the model accuracy will decrease.

[0003] In terms of solving the problem of vehicle data and device heterogeneity, federated learning client selection (also known as participant selection or device sampling) is considered a feasible strategy. In federated learning, the selection of clients determines which devices participate in each round of training, which directly affects the quality of training samples and the performance of the global model. The method of randomly selecting clients is direct and simple, but it cannot fully reflect the characteristics of global data distribution, which significantly reduces the efficiency and accuracy of model training, especially in the case of heterogeneous data and devices. In addition, random selection may also lead to data skewness and instability in sample extraction, thereby hindering the global model from quickly acquiring unknown knowledge and slowing down its convergence. Therefore, an effective federated learning client selection scheme is crucial, which can significantly improve the accuracy of the model, enhance the fairness and robustness of the training process, and reduce training costs and resource consumption.

[0004] Existing research has alleviated the impact of data and device heterogeneity to a certain extent through client selection methods. However, the current client selection algorithm ignores the potential contribution of the client, resulting in low training efficiency and failure to fully utilize the data of different clients. At the same time, data bias seriously affects client selection, resulting in the selected client being unable to fully represent the overall client group, thus affecting the training effect. Summary of the invention

[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a vehicle network federated learning method based on vehicle client selection, which selects vehicle clients based on the importance of data samples and the upload time of model parameters to ensure that the data selected in each round of federated learning has higher representativeness and value, thereby accelerating the convergence process of the model and improving the accuracy of the model.

[0006] In order to achieve the above-mentioned invention object, the vehicle network federated learning method based on vehicle client selection of the present invention comprises the following steps:

[0007] S1: The central server periodically collects the prior resource information of each vehicle client k through the roadside base station, including transmission power, relative distance to the corresponding roadside base station, network bandwidth and channel status, k = 1, 2, ..., K, K represents the number of vehicle clients in the Internet of Vehicles;

[0008] S2: The central server initializes the parameters of the model to be learned and uses it as the initial model aggregation parameter W 0 , let the current iteration number t = 1;

[0009] S3: The central server aggregates the model parameters W through the roadside base station t-1 and the number of iterations t are forwarded to each vehicle client k;

[0010] S4: Each vehicle client k is based on the aggregation parameter W sent by the central server t-1 Initialize the local model parameters and then use the local training data set Train the local model and calculate the local training data set The loss function value of each sample training sample x in Then calculate the local loss And update the local model parameters At the same time, the importance of the data samples of the training samples in this round of training is calculated Then the data sample importance Upload to the central server through roadside base stations;

[0011] S5: The importance of the data samples uploaded by K vehicle clients received by the central server After that, the backpack model is used to select the vehicle client. The specific method is as follows:

[0012] Determine the transmission power P of each vehicle client k in the current round based on the prior resource information k , the relative distance d to the corresponding roadside base station k , network bandwidth B k and channel state S k , calculate the time for vehicle client k to upload model parameters for:

[0013]

[0014] Among them, σ represents the model parameter size, η0 represents the propagation factor, P n represents the power of Gaussian noise in the channel;

[0015] The knapsack model is used to solve the following optimization problem, and the selected vehicle client set S = {k1, k2, ..., k Q}:

[0016]

[0017] Among them, k q represents the original serial number of the selected qth vehicle client, t round Indicates the remaining time of the current round of federated learning, Indicates the time it takes to upload model parameters. The calculation formula is as follows:

[0018]

[0019] The central server sends a message to the selected vehicle client set S = {k1, k2, ..., k Q Each vehicle client in} sends a selected flag;

[0020] S6: Each vehicle client k that receives the selected identifier uploads the local model parameters to the central server through the roadside base station and local training dataset Size

[0021] S7: After all selected vehicle clients complete uploading local model parameters, the central server aggregates the local model parameters of multiple vehicle clients to generate a new global model parameter W t :

[0022]

[0023] in, represents the aggregation weight of vehicle client k, and the calculation formula is as follows:

[0024]

[0025] S8: Determine whether the federated learning reaches the end condition. If yes, the federated learning ends. Otherwise, proceed to step S9.

[0026] S9: Let the iteration round t=t+1, and return to step S3.

[0027] The present invention is based on the vehicle network federated learning method selected by vehicle clients. The central server periodically collects the prior resource information of each vehicle client through the roadside base station. In each round of federated learning, after each vehicle client completes local training, the importance of the data sample is calculated and uploaded to the central server. The central server calculates the time for the vehicle client to upload the model parameters in this round of federated learning according to the prior resource information, and uses the backpack model to solve the selected vehicle client set according to the importance and time of the data sample and sends a selection mark to each vehicle client therein. Each vehicle client that receives the selection mark uploads the model parameters, and the central server aggregates the model parameters.

[0028] The present invention comprehensively considers the importance of data samples in vehicle clients and the time to upload model parameters, and selects the optimal vehicle client combination to participate in model training, thereby accelerating model convergence and improving accuracy. This method provides a new perspective for client selection and helps data utilization and model performance in federated learning. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a flowchart of a specific implementation method of the vehicle network federated learning method based on vehicle client selection of the present invention;

[0030] Figure 2 is a timing diagram of a round of federated learning in the present invention;

[0031] Figure 3 This is a comparison chart of the polymerization accuracy of the present invention and the comparative method at different isomerization degrees in this embodiment;

[0032] Figure 4 This is a comparison chart of the aggregation accuracy of the present invention and the comparative method under different degrees of disconnection in this embodiment;

[0033] Figure 5 This is a comparison chart of the aggregation accuracy of the present invention and the comparative method under different local training rounds in this embodiment. DETAILED DESCRIPTION

[0034] The specific implementation of the present invention is described below in conjunction with the accompanying drawings so that those skilled in the art can better understand the present invention. It should be noted that in the following description, when the detailed description of known functions and designs may dilute the main content of the present invention, these descriptions will be omitted here.

[0035] In order to better illustrate the technical solution of the present invention, the principle of the present invention is first briefly described.

[0036] One of the goals of federated learning is to mine information from data to train models, and data quality is crucial to model training, directly affecting the accuracy and performance of the model. At the same time, selecting vehicle clients with faster training speeds shortens the convergence time of the entire model. The present invention has found through research that if the importance of data samples of vehicle clients and the training time of clients are used as the basis for client selection, there is no need to increase additional computing overhead and communication overhead. Therefore, in order to achieve high efficiency in client selection, the present invention analyzes the importance of data samples and training time of each vehicle client, and establishes a backpack model to select appropriate clients to participate in training.

[0037] In terms of data sample importance, the commonly used data sample importance R k The calculation formula is as follows:

[0038]

[0039] in, Denotes the local training dataset D of vehicle client k k The gradient of sample x in , || ||2 means to find the L2 norm.

[0040] Although the data sample importance calculated based on the gradient norm is optimal, the computational overhead is huge at the same time, because when using this method to select vehicle clients, it is necessary to calculate the gradient of each data sample in all possible combinations. Research has found that the local loss value obtained from vehicle client training reflects the predictive ability of the global model for the data uploaded by each vehicle client. The higher the loss value, the worse the predictive ability. Especially in the case of non-independent and identically distributed (Non-IID) data, a high loss value may mean that the training data of the vehicle client belongs to a minority category and accounts for a small proportion of the overall data, requiring enhanced learning. Therefore, in order to simplify the calculation of data sample importance, the local loss value can be used to replace the gradient norm, and the data sample importance R k The calculation formula is improved as follows:

[0041]

[0042] Since the loss of each data sample is available during local training, the computational overhead is greatly reduced. The above expression can be further simplified by calculating the cumulative loss of the data samples of vehicle client k. Therefore, the data sample importance R is finally adopted k The calculation formula is as follows:

[0043]

[0044] As for the training time, since the central server only initializes the global model in the first round and requests resource information from all clients, the time spent on initialization and resource request is negligible. For each client, the response time of the central server (including the time it takes for the server to send the global model and select the client) and the time to aggregate the global model are fixed constants, so the time spent on this is also negligible. Assume that the rate at which all clients train the model locally conforms to a uniform distribution. Let the number of vehicle clients in the Internet of Vehicles be K, and use f k represents the rate at which vehicle client k trains the model locally, k = 1, 2, ..., K, D k represents the amount of data for one local iteration, and E represents the number of local iterations. Then, the time for vehicle client k to train the model locally is It can be expressed by the following formula:

[0045]

[0046] Assume that the vehicle client uploads new model parameters serially after completing local training. Specifically, only one vehicle client can upload model parameters at the same time. After a vehicle client completes local model training, if no other vehicle client is uploading its model parameters, then the vehicle client starts uploading immediately. Assume that the channel state of each vehicle client is stable in each round. Using B k represents the channel bandwidth between the vehicle client and the base station, S represents the average power of the signal sent in the channel, and P n represents the power of Gaussian noise in the channel. According to Shannon's theorem, the communication transmission rate C of vehicle client k k It can be expressed as:

[0047]

[0048] Using P k represents the transmission power of vehicle client k, d k represents the relative distance between the vehicle client k and the corresponding roadside base station, η0 represents the propagation factor, and the signal-to-noise ratio It can be expressed as:

[0049]

[0050] Combining the above two formulas, the communication transmission rate C of vehicle client k is k It can be expressed as:

[0051]

[0052] In federated learning, the model parameter size σ of each vehicle client is consistent, so the time for vehicle client k to upload model parameters is for:

[0053]

[0054] In the present invention, each vehicle client first assigns the importance R k Uploaded to the central server, the central server receives the importance R of the data samples uploaded by each vehicle client k Finally, the vehicle clients are selected to accelerate the model convergence and improve the accuracy. The vehicle clients finally selected by the central server constitute the selected vehicle client set S = {k1, k2, ..., k Q}, where kq represents the original serial number of the qth selected vehicle client, q = 1, 2, ..., Q, Q represents the number of selected vehicle clients. Preset the time T for each round of federated learning round , then the total time spent by all clients in each round is T cost Less than each round of federated learning time T round ,The vehicle client selection algorithm can adopt the following problem description:

[0055]

[0056] tT cost ≤T round

[0057] Where T cost It can be expressed by the following formula:

[0058]

[0059] As a classic combinatorial optimization problem, the knapsack model is widely used in fields such as dynamic programming and greedy algorithms. The core of this model is to select items of different weights and values ​​in a knapsack with limited capacity to maximize the total value. The above problem is similar to the knapsack model, so the vehicle client can be regarded as the item in the knapsack problem, the importance of the data sample is regarded as the value of the item, the time for the client to upload the model parameters is equivalent to the weight of the item, and the time for each round of federated learning is set to be equivalent to the capacity of the knapsack. In federated learning, the knapsack model not only supports real-time updates, but also can effectively deal with unstable or interrupted network connections, so that the client can upload updated parameters after the connection is restored while keeping the model updated, thereby ensuring the stability and real-time performance of the system. In addition, the characteristics of the knapsack model enable the client selection process to consider multiple constraints, such as computing resources, network bandwidth, etc. This flexibility makes the client selection method more efficient and can optimize the resource allocation during the training process. In each round of training, the client downloads and updates the model within a preset time, and then the selected client continues to upload the updated model parameters to assist the server in efficiently completing the model aggregation process.

[0060] Based on the above analysis, the present invention proposes a federated learning method for Internet of Vehicles based on vehicle client selection. Figure 1 This is a flowchart of a specific implementation of the vehicle network federated learning method based on vehicle client selection in the present invention. Figure 1 As shown, the specific steps of the vehicle network federated learning method based on vehicle client selection of the present invention include:

[0061] S101: Collect prior resource information:

[0062] In the Internet of Vehicles environment, the federated learning system consists of intelligent connected vehicle clients, roadside base stations, and central servers. In the Internet of Vehicles, there are K intelligent connected vehicles as clients. Each intelligent connected vehicle is equipped with on-board sensors, which are used to collect local data sets, including data such as vehicle status, driving behavior, and traffic information. Intelligent connected vehicles train local models based on local data sets. K intelligent connected vehicles train local data sets through collaborative learning tasks, and the trained data is transmitted without transmitting the original data.

[0063] The central server periodically collects the prior resource information of each vehicle client k through the roadside base station, including transmission power, relative distance to the corresponding roadside base station, network bandwidth and channel status, k = 1, 2, ..., K, K represents the number of vehicle clients in the Internet of Vehicles. This information is crucial for optimizing distributed computing and model training, and can help the central server evaluate the available resource status of vehicle clients, so as to reasonably allocate tasks and improve overall training efficiency. In addition, the central server dynamically adjusts the training strategy by monitoring the changes of these resources in real time to adapt to the computing power and network conditions of different vehicle clients, ensuring the robustness of the model in various environments, thereby effectively improving the update frequency and accuracy of the model.

[0064] S102: Initialize federated learning data:

[0065] The central server initializes the parameters of the model to be learned and uses it as the initial model aggregation parameter W 0 , let the current iteration number t=1.

[0066] S103: Send model aggregation parameters:

[0067] The central server transmits the model aggregation parameter W through the roadside base station t-1 and the iteration number t are forwarded to each vehicle client k.

[0068] S104: Local Training:

[0069] Each vehicle client k is based on the aggregation parameter W sent by the central server. t-1 Initialize the local model parameters and then use the local training data set Train the local model and calculate the local training data set The loss function value of each sample training sample x in Then calculate the local loss And update the local model parameters At the same time, the importance of the data samples of the training samples in this round of training is calculated Then the data sample importance Upload to the central server through roadside base stations.

[0070] In this embodiment, the local loss The calculation formula is:

[0071]

[0072] in, Represents the local training dataset The size of the local training dataset The sum of the loss functions generated by all training samples in divided by the total data volume of vehicle client k |D k | is the average loss function of the local vehicle client. The stochastic gradient descent (SGD) method is used to update the local model parameters. The parameter update formula can be expressed as follows:

[0073]

[0074] Among them, η represents the learning rate.

[0075] In this embodiment, the importance of data samples The calculation formula is:

[0076]

[0077] S105: Select vehicle client:

[0078] After receiving the importance of data samples uploaded by K vehicle clients, the central server uses the knapsack model to select vehicle clients. The specific method is as follows:

[0079] Determine the computing power f of each vehicle client k in the current round based on prior resource information k , transmission power P k , the relative distance d to the corresponding roadside base station k , network bandwidth B k and channel state S k , calculate the time for vehicle client k to upload model parameters for:

[0080]

[0081] Among them, σ represents the model parameter size, η0 represents the propagation factor, P n represents the power of Gaussian noise in the channel;

[0082] The knapsack model is used to solve the following optimization problem, and the selected vehicle client set S = {k1, k2, ..., k Q}:

[0083]

[0084] Among them, k q represents the original serial number of the qth vehicle client selected, q = 1, 2, ..., Q, Q represents the number of selected vehicle clients, t round Indicates the remaining time of the current round of federated learning, Indicates the time it takes to upload model parameters. The calculation formula is as follows:

[0085]

[0086] Since each vehicle client has completed local training when the central server selects the vehicle client, only the remaining federated learning time and the time required to upload the model parameters are considered in the conditions of the knapsack model. The knapsack model is a commonly used dynamic programming model, and its specific solution process will not be repeated here.

[0087] The central server sends a message to the selected vehicle client set S = {k1, k2, ..., k Q Each vehicle client in} sends a selection mark.

[0088] S106: Upload model parameters:

[0089] Each vehicle client k that receives the selected identifier uploads the local model parameters to the central server through the roadside base station and local training dataset size.

[0090] S107: Model parameter aggregation:

[0091] After all selected vehicles have completed uploading their local model parameters, the central server aggregates the local model parameters of multiple vehicle clients to generate a new global model parameter W t :

[0092]

[0093] in, represents the aggregation weight of vehicle client k, and the calculation formula is as follows:

[0094]

[0095] S108: Determine whether the federated learning has reached the end condition. If so, the federated learning ends; otherwise, proceed to step S109.

[0096] The termination conditions of federated learning usually include model convergence, reaching the maximum number of iterations, and reaching the longest training time. In practical applications, they can be selected according to actual needs.

[0097] S109: Set the iteration round t=t+1, and return to step S103.

[0098] Figure 2 It is a timing diagram of a round of federated learning in the present invention. Figure 2As shown, in the present invention, during a round of federated learning, each vehicle client performs local training in parallel, and then uploads the importance of data samples according to the order in which the local training is completed. The central server selects the vehicle client according to the importance of the data sample and the time spent uploading the model parameters. The selected vehicle client uploads the local model parameters, the central server aggregates the model parameters, and then starts the next round of federated learning.

[0099] In order to better illustrate the technical effect of the present invention, a specific example is used to experimentally verify the present invention. This embodiment verifies the present invention on the Synthetic, Fashion-MINST and CIFAR-10 datasets. The Synthetic (α, β) dataset is a synthetic dataset. α controls the degree of dissimilarity of the local model, and β controls the degree of dissimilarity of the data on each device. The Fashion-MNIST dataset contains 70,000 image samples, divided into 10 categories of different items. The CIFAR-10 dataset is a dataset for identifying objects, containing 60,000 color images, representing different categories of objects such as airplanes, cars, and birds. In this embodiment, FedAvg, FedProx and Power-of-Choice are selected as comparison algorithms, and the aggregation accuracy of the present invention and the comparison method is evaluated from three aspects: different degrees of heterogeneity, different degrees of disconnection, and different local training rounds.

[0100] In order to control the dissimilarity between the local model and the data on each device, for the Synthetic dataset, two heterogeneous cases, Synthetic(0,0) and Synthetic(1,1), are set, and the degree of heterogeneity is gradually increased. The Dirichlet distribution is used to simulate the non-independent identically distributed (Non-IID) setting, and the degree of heterogeneity of the client data is controlled by adjusting the parameter α. For the Fashion-MNIST (FMNIST) dataset, two heterogeneous cases, α=5.0 and α=1.0, are set, and the degree of heterogeneity is gradually increased. For the CIFAR-10 dataset, two heterogeneous cases, α=5.0 and α=1.0, are set, and the degree of heterogeneity is gradually increased.

[0101] This embodiment uses probability_drop to define the probability of a vehicle becoming offline after being selected. This probability reflects the possibility that the vehicle cannot return data after being selected by the client. Based on the Synthetic dataset, when α=0 and β=0, probability_drop is set to 0, 0.05, and 0.2 for experimental verification. Under the condition of probability_drop=0, all vehicles will not be offline. Under the condition of probability_drop=0.05, the maximum offline probability of all vehicles does not exceed 5%. Under the condition of probability_drop=0.2, the maximum offline probability of all vehicles does not exceed 20%.

[0102] In order to construct training integrity heterogeneity, based on the Synthetic dataset under the conditions of α=0, β=0, it is assumed that the ratio of the vehicle integrity to the original training steps satisfies a Gaussian distribution with a mean of 1 and a variance of 1, and ensures that the minimum value of the ratio is not less than 0.01 and the maximum value does not exceed 2. In addition, the vehicle client has a fixed number of training steps.

[0103] Figure 3 : is a comparison chart of the polymerization accuracy of the present invention and the comparative method at different isomerization levels in this embodiment. Figure 3 As shown, based on the Synthetic dataset, when α=0, β=0, the model accuracy of the present invention is improved by 2.53% compared with the three comparison methods. When α=1, β=1, the model accuracy of the present invention is improved by 3.07% compared with the three comparison methods. These results show that under different α and β conditions, the present invention has certain advantages over FedAvg, FedProx and Power-of-Choice. Specifically, the present invention can select vehicle clients to participate in training according to the local losses and communication conditions of different vehicle clients, so that those clients with better communication conditions and faster convergence speeds are more important. By selecting these vehicle clients to participate in model training, the present invention can more effectively utilize the contribution of the vehicle clients, thereby improving the performance of the overall model.

[0104] Figure 4 : is a comparison chart of the aggregation accuracy of the present invention and the comparative method under different degrees of disconnection in this embodiment. Figure 4As shown, under the condition of probability_drop=0, that is, when all vehicles are not offline, for 200 rounds of training, the algorithm of the present invention improves the model accuracy by 1.89% compared with the three comparison methods. Under the condition of probability_drop=0.05, that is, when the maximum probability of all vehicles being offline does not exceed 5%, for 200 rounds of training, the model accuracy of the present invention is improved by 2.61% compared with the other three comparison methods. Under the condition of probability_drop=0.2, that is, when the maximum probability of all vehicles being offline does not exceed 20%, for 200 rounds of training, the model accuracy of the present invention is improved by 5.28% compared with the other three comparison methods.

[0105] Figure 5 : is a comparison chart of the aggregation accuracy of the present invention and the comparative method under different local training rounds in this embodiment. Figure 5 It can be seen that based on the model accuracy results of the Synthetic data set under the conditions of α=0, β=0, the model accuracy of the present invention is improved by 1.97% compared with FedAvg, the model accuracy of the present invention is improved by 10.12% compared with FedProx, and the model accuracy of the present invention is improved by 5.67% compared with Power-of-Choice.

[0106] Although the above describes the illustrative specific embodiments of the present invention to facilitate those skilled in the art to understand the present invention, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.

Claims

1. A method for federated learning of Internet of Vehicles based on vehicle client selection, characterized in that: The following steps are involved: S1: The central server periodically collects the prior resource information of each vehicle client k through the roadside base station, including transmission power, relative distance to the corresponding roadside base station, network bandwidth and channel status, k = 1, 2, ..., K, K represents the number of vehicle clients in the Internet of Vehicles; S2: The central server initializes the parameters of the model to be learned and uses it as the initial model aggregation parameter W 0 , let the current iteration number t = 1; S3: The central server aggregates the model parameters W through the roadside base station t-1 and the number of iterations t are forwarded to each vehicle client k; S4: Each vehicle client k is based on the aggregation parameter W sent by the central server t-1 Initialize the local model parameters and then use the local training data set Train the local model and calculate the local training data set The loss function value of each sample training sample x in Then calculate the local loss And update the local model parameters At the same time, the data sample importance of the training samples in this round of training is calculated Then the data sample importance Upload to the central server through roadside base stations; S5: The importance of the data samples uploaded by K vehicle clients received by the central server After that, the backpack model is used to select the vehicle client. The specific method is as follows: Determine the transmission power P of each vehicle client k in the current round based on the prior resource information k , the relative distance d to the corresponding roadside base station k , network bandwidth B k and channel state S k , calculate the time for vehicle client k to upload model parameters for: Among them, σ represents the model parameter size, η0 represents the propagation factor, P n represents the power of Gaussian noise in the channel; The knapsack model is used to solve the following optimization problem, and the selected vehicle client set S = {k1, k2, ..., k Q }: Among them, k q represents the original serial number of the qth vehicle client selected, q = 1, 2, ..., Q, Q represents the number of selected vehicle clients, t round Indicates the remaining time of the current round of federated learning, Indicates the time it takes to upload model parameters. The calculation formula is as follows: The central server sends a message to the selected vehicle client set S = {k1, k2, ..., k Q Each vehicle client in} sends a selected flag; S6: Each vehicle client k that receives the selected identifier uploads the local model parameters to the central server through the roadside base station and local training dataset Size S7: After all selected vehicle clients complete uploading local model parameters, the central server aggregates the local model parameters of multiple vehicle clients to generate a new global model parameter W t : in, represents the aggregation weight of vehicle client k, and the calculation formula is as follows: S8: Determine whether the federated learning reaches the end condition. If yes, the federated learning ends. Otherwise, proceed to step S9. S9: Let the iteration round t=t+1, and return to step S3.

2. The method for federated learning of Internet of Vehicles according to claim 1, characterized in that: The local loss in step S4 The calculation formula is: in, Represents the local training dataset size.

3. The method for federated learning of Internet of Vehicles according to claim 1, characterized in that: The importance of the data sample in step S4 The calculation formula is:

Citation Information

Patent Citations

  • Narrow-sense asynchronous personalized federated learning adaptive aggregation method

    CN115796274A

  • Asynchronous federated learning gradient dynamic compression method in Internet of Vehicles

    CN117440342A

  • Efficient joint calculation method in heterogeneous Internet of Vehicles

    CN118410243A

  • Adaptive asynchronous federated learning method and system based on deep reinforcement learning

    CN118586474A

  • Internet of vehicles intrusion detection model construction method based on federated learning

    CN118784305A