A vehicle end model training method and device, a terminal, a vehicle, and a storage medium
Patent Information
- Application Number
- CN202611364998.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-04
- Publication Date
- 2026-10-09
AI Technical Summary
(2)不同车辆因行驶区域(城市/乡村/高速)、驾驶时段(白天/夜间/雨雪天)及个人驾驶习惯的差异,采集的数据在类别分布和场景覆盖上呈现高度非独立同分布,导致传统联邦学习在此类场景下模型收敛缓慢、全局精度受限
客户端通过获取云端发送的全局模型参数和全局温度向量,可以将本地数据中的样本输入车端模型进行前向计算,得到样本的初始打分,其中,车端模型本身的参数值使用全局模型参数;从而基于样本的标签,确定全局温度向量中标签对应的温度;进而基于温度,对初始打分进行温度缩放,得到优化打分,并将优化打分转换为概率;基于样本的概率以及样本的标签,优化车端模型本身的参数值。在每个通信轮次,客户端均从云端获取全局温度向量对初始打分进行温度缩放,可以随训练进程和学习进度进行适配调整,有效提升了模型训练效用。
Smart Images

Figure CN122886837A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle technology, specifically to a vehicle-side model training method, device, terminal, vehicle, and storage medium. Background Technology
[0002] With the rapid development of intelligent connected vehicles, onboard sensors (cameras, LiDAR, millimeter-wave radar, etc.) continuously collect massive amounts of driving environment data. Using this data to train deep learning models enables key functions such as road object detection, lane line recognition, and driver intent prediction, providing core technological support for advanced driver assistance systems (ADAS) and autonomous driving. However, the direct aggregation of vehicle data faces two major bottlenecks: (1) Uploading raw video streams, point cloud data, etc. to the cloud for centralized training not only consumes huge communication bandwidth, but also seriously violates the legal red line of user location privacy and travel behavior privacy; (2) Due to differences in driving areas (city / country / highway), driving time (daytime / nighttime / rainy / snowy days) and personal driving habits, the data collected by different vehicles exhibits a high degree of non-independent and identical distribution in terms of category distribution and scene coverage, which leads to slow model convergence and limited global accuracy of traditional federated learning in such scenarios.
[0003] In federated learning training of massive amounts of vehicle-side data, differential privacy techniques are typically used to introduce noise into the local training process to protect data privacy. However, the introduction of noise, coupled with the highly non-independent and identically distributed nature of the vehicle-side data, leads to low signal-to-noise ratio and poor training performance in each round. Existing solutions introduce knowledge distillation frameworks or employ fixed temperature scaling strategies to alleviate this problem. However, distillation schemes rely on additional teacher models and incur significant computational and communication overhead, making them unsuitable for resource-constrained in-vehicle environments. Traditional temperature scaling strategies only initialize the temperature once before training begins and cannot be adjusted adaptively as the training progresses and learning progresses, thus having limited effect on improving model performance. Summary of the Invention
[0004] To address at least one technical problem in the existing technology, the present invention adopts the following technical solution: In a first aspect, this invention proposes a vehicle-side model training method for application on a client side, the method comprising: Obtain the global model parameters and global temperature vector sent from the cloud; The samples from the local data are input into the vehicle-side model for forward computation to obtain the initial score of the samples. The parameter values of the vehicle-side model itself use the global model parameters. Based on the labels of the samples, the temperature corresponding to the label in the global temperature vector is determined, with different labels corresponding to different temperatures; Based on temperature, the initial score is scaled to obtain an optimized score, and the optimized score is converted into a probability. Based on the probability and label of the sample, optimize the parameter values of the vehicle-side model itself; Based on the mean cross-entropy loss of each sample, the global temperature vector is adjusted to obtain the locally optimized temperature vector; Send the locally optimized temperature vector to the cloud to obtain the dynamically adjusted global temperature vector sent by the cloud.
[0005] In some embodiments, the global temperature vector is the global category temperature vector; the initial score is the category initial score; the label is the category label; the temperature corresponding to the label is the category temperature corresponding to the category label; the optimized score is the category optimization; the probability is the category probability; the mean cross-entropy loss of the samples is the mean cross-entropy loss of the sample categories; and the local optimized temperature vector is the local category optimized temperature vector.
[0006] In some embodiments, if the current communication round is the first round, the temperature of each category in the global category temperature vector is a preset baseline temperature in the cloud. The method also includes: setting initial temperatures for different sample categories in the local dataset based on a baseline temperature to obtain local category initial temperature vectors; Determine the temperature corresponding to the label in the global temperature vector, including: determining the category temperature corresponding to the category label in the local category initial temperature vector.
[0007] In some embodiments, initial temperatures are set for different sample categories in the local dataset based on a baseline temperature, including: Count the number of samples in each category in the local dataset; An initial temperature is set for each sample category based on the baseline temperature and the number of samples in each category.
[0008] In some embodiments, an initial temperature is set for each sample category based on a reference temperature and the number of samples in each sample category, including: Based on the number of samples in each sample category, determine the sample percentage of each sample category; If the sample proportion is less than the first threshold, the initial temperature of the sample category is set to the first temperature. If the sample proportion is greater than the second threshold, the initial temperature of the sample category is set to the second temperature. If the sample proportion is greater than or equal to the first threshold and less than or equal to the second threshold, then the initial temperature of the sample category is set to the third temperature. Among them, the first temperature is less than the reference temperature, the second temperature is greater than the third temperature, and the third temperature is greater than or equal to the reference temperature.
[0009] In some embodiments, the optimized score is the ratio of the initial score to the temperature corresponding to the label.
[0010] In some embodiments, the parameter values of the vehicle-side model are optimized based on the probability and label of the sample, including: Calculate the cross-entropy loss based on the sample's probability and label; Based on cross-entropy loss and noise vector, the parameter values of the vehicle-side model are optimized through backpropagation, where the noise vector remains unchanged in each round of optimization.
[0011] In some embodiments, the parameter values of the vehicle-side model are optimized through backpropagation based on cross-entropy loss and noise vector, including: Based on cross-entropy loss, the gradients corresponding to the parameter values included in the vehicle-side model are determined, and the first gradient vector is obtained. The first gradient vector is clipped to obtain the second gradient vector; The third gradient vector is obtained by summing the second gradient vectors of multiple samples. Summing the third gradient vector with the noise vector yields the target gradient vector; Based on the target gradient vector, optimize the parameter values of the vehicle-side model itself.
[0012] In some embodiments, clipping the first gradient vector to obtain the second gradient vector includes: The clipping factor is determined based on the preset clipping norm and the norm of the first gradient vector; The clipping factor is multiplied by each gradient in the first gradient vector by a scalar to obtain the second gradient vector.
[0013] In some embodiments, the method further includes: After optimizing the parameter values of the vehicle-side model itself, determine the parameter update amount of the vehicle-side model; Send the parameter update amount of the vehicle model to the cloud.
[0014] In some embodiments, the global model parameters are obtained by updating the parameters of the global model itself based on the parameter update amount of the global model in the cloud. The parameter update amount of the global model is obtained by weighted averaging of the parameter update amounts of the vehicle-side model sent by different clients in the previous communication round in the cloud.
[0015] In some embodiments, the mean cross-entropy loss for each sample class is determined as follows: Maintain a loss sliding window of a preset length for each sample category; After training is completed in multiple batches, the mean cross-entropy loss for each sample category is determined. Each batch includes a preset number of samples, and the number of batches is equal to the preset length.
[0016] In some embodiments, the global temperature vector is adjusted based on the mean cross-entropy loss of each sample, including: The difficulty ratio for each sample class is determined based on the mean cross-entropy loss for each sample class. Adjust the class temperature of each sample class in the global class temperature vector based on the difficulty ratio of each sample class.
[0017] In some embodiments, the difficulty ratio for each sample class is determined based on the mean cross-entropy loss for each sample class, including: Based on the mean cross-entropy loss of each sample class, determine the mean cross-entropy loss of all sample classes; The difficulty ratio for each sample class is determined based on the mean cross-entropy loss for each sample class and the mean cross-entropy loss for all sample classes.
[0018] In some embodiments, adjusting the class temperature of each sample class in the global class temperature vector based on the difficulty ratio of each sample class includes: For any sample category: If the difficulty ratio of a sample category is greater than the first ratio, then the category temperature of the sample category will be lowered to the first optimization temperature. If the difficulty ratio of a sample category is less than the second ratio, then the category temperature of the sample category will be increased to the second optimization temperature. If the difficulty ratio of a sample category is greater than or equal to the second ratio and less than or equal to the first ratio, then the category temperature of the sample category will be maintained at the preset baseline temperature. The first optimized temperature is lower than the reference temperature, and the second optimized temperature is higher than the reference temperature.
[0019] In some embodiments, the global temperature vector is obtained by weighted averaging of the locally optimized temperature vectors sent by different clients in the previous communication round in the cloud.
[0020] In some embodiments, the method further includes: When the number of communication rounds reaches the preset number, or when the performance metrics of the global model converge on the validation set, the vehicle-side model training is complete. The global model is the model deployed in the cloud.
[0021] Secondly, the present invention also proposes a vehicle-end model training device for use on a client side, the device comprising: The acquisition unit is used to acquire global model parameters and global temperature vectors sent from the cloud. The scoring unit is used to input samples from local data into the vehicle-side model for forward calculation to obtain the initial score of the sample. The parameter values of the vehicle-side model itself use the global model parameters. The determination unit is used to determine the temperature corresponding to the label in the global temperature vector based on the label of the sample; different labels correspond to different temperatures. The scaling unit is used to perform temperature scaling on the initial score based on the temperature corresponding to the label, to obtain an optimized score, and then convert the optimized score into a probability. The first optimization unit is used to optimize the parameter values of the vehicle-side model itself based on the probability and label of the sample. The second optimization unit is used to adjust the global temperature vector based on the mean cross-entropy loss of each sample to obtain the local optimized temperature vector. The sending unit is used to send a locally optimized temperature vector to the cloud so that the acquisition unit can obtain the dynamically adjusted global temperature vector sent by the cloud.
[0022] Thirdly, the present invention provides a terminal, which includes: a memory, a transceiver, and a processor; Memory is used to store computer programs; transceiver is used to send and receive data under the control of the processor; processor is used to read the computer program from memory and execute it. Obtain the global model parameters and global temperature vector sent from the cloud; The samples from the local data are input into the vehicle-side model for forward computation to obtain the initial score of the samples. The parameter values of the vehicle-side model itself use the global model parameters. Based on the labels of the samples, the temperature corresponding to the label in the global temperature vector is determined, with different labels corresponding to different temperatures; Based on the temperature corresponding to the label, the initial score is temperature-scaled to obtain an optimized score, and the optimized score is converted into a probability. Based on the probability and label of the sample, optimize the parameter values of the vehicle-side model itself; Based on the mean cross-entropy loss of each sample, the global temperature vector is adjusted to obtain the locally optimized temperature vector; Send the locally optimized temperature vector to the cloud to obtain the dynamically adjusted global temperature vector sent by the cloud.
[0023] Fourthly, the present invention proposes a vehicle, the vehicle including the terminal as described in the third aspect.
[0024] Fifthly, the present invention proposes a processor-readable storage medium storing a program for causing the processor to execute the vehicle-end model training method as described in the first aspect.
[0025] The beneficial effects of this invention are: The client obtains global model parameters and a global temperature vector sent from the cloud. It can then input samples from local data into the vehicle-side model for forward computation, obtaining an initial score for each sample. The vehicle-side model's own parameter values use the global model parameters. Based on the sample's label, the client determines the temperature corresponding to that label in the global temperature vector. Then, based on the temperature, it performs temperature scaling on the initial score to obtain an optimized score, which is then converted into a probability. Based on the sample's probability and label, the client optimizes the vehicle-side model's own parameter values. In each communication round, the client obtains the global temperature vector from the cloud to perform temperature scaling on the initial score, allowing for adaptive adjustments as the training process and learning progress, effectively improving model training efficiency. Attached Figure Description
[0026] Figure 1 This is a schematic diagram of a vehicle-side model training method provided by the present invention; Figure 2 This is a schematic diagram of another vehicle-side model training method proposed in this invention; Figure 3 This embodiment provides a schematic diagram of the flow of vehicle-to-everything (V2X) infrastructure; Figure 4 This is a schematic diagram of a vehicle-end model training device provided by the present invention; Figure 5 This is a schematic diagram of a terminal provided by the present invention. Detailed Implementation
[0027] The embodiments of the present invention will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention and not for limiting the scope of protection of the present invention.
[0028] It should be noted that in this article, relational terms such as “first” and “second” are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0029] Currently, to address data privacy challenges, differential privacy mechanisms have been introduced into federated learning in vehicle-to-everything (V2X) systems. These mechanisms inject controlled Gaussian noise into the local model update computation process, making it difficult for attackers to infer information about any single sample from the uploaded gradients or parameter changes. However, the introduction of noise inevitably reduces model utility, especially when the client's data volume is limited and skewed. The gradient signal itself already contains significant variance, and the signal-to-noise ratio deteriorates sharply after noise is added. To mitigate the local model bias caused by non-independent and identically distributed (i.i.d.) models, knowledge distillation techniques have been proposed. These techniques utilize an additional teacher model or a public proxy dataset to generate soft labels to guide local training. However, the computing power and storage of in-vehicle terminals are severely limited. Maintaining an additional teacher model or generative adversarial network not only increases computational overhead but also burdens communication due to the need to exchange distillation outputs, making deployment in real-world vehicle environments difficult.
[0030] Temperature scaling offers a lightweight solution. In deep learning image classification tasks, the model calculates a "raw score" for each input image and for every possible category; a higher score indicates the model is more likely to classify the image as belonging to that category. Subsequently, the model needs to perform a mathematical transformation step to convert these raw scores into a set of probability values that sum to 1, representing the model's confidence in predicting each category. The temperature parameter T acts as the "adjustment knob" for this transformation step. Specifically, before converting the raw scores into probabilities, all scores are first divided by the temperature T before the transformation: (1) When T>1, it is equivalent to narrowing the gap between the scores, and the transformed probability distribution will be more uniform. The model tends to be conservative in its judgment of each option, which helps to prevent the model from being too confident about a certain answer too early. (2) When T<1, it is equivalent to amplifying the gap between the scores, and the transformed probability distribution will be more acute. The model will show extremely high confidence in the category with the highest score.
[0031] By adjusting the temperature T, the "decisiveness" of the model's output predictions can be flexibly controlled without adding extra models or complex calculations. This characteristic gives it a unique advantage in scenarios where a balance between learning efficiency and anti-interference capability is required. The temperature parameter not only directly affects the geometry of the loss landscape but also indirectly changes the gradient's sensitivity to subsequently injected differential privacy noise—at high temperatures, the gradient magnitude is compressed overall, the loss surface tends to be flatter, and the disturbance of the parameter update direction by the same level of Gaussian noise is relatively weakened. This "temperature" The coupling effect of "privacy" makes collaborative optimization possible.
[0032] Existing technologies have the following problems in federated learning scenarios for connected vehicles: (1) The fundamental dilemma of differential privacy federated learning in the vehicle scenario.
[0033] In federated learning for connected vehicles, to meet compliance requirements for vehicle driving data, sample-level differential privacy protection must be applied during local training on the client side. For example, if a model is trained using an image showing the vehicle's location, before differential privacy protection, an attacker could reverse engineer the image to retrieve the vehicle's location information using the model parameters. However, after adding differential privacy noise, the attacker can only reconstruct a blurry image. However, the essence of differential privacy is to mask the contribution of single samples by injecting Gaussian noise into the gradient, and the noise intensity is positively correlated with the level of privacy protection. Vehicle-side data exhibits a highly non-independent and identically distributed nature due to differences in driving areas, time periods, and weather conditions. Local data volume is limited and the class distribution is skewed, and the gradient signal itself already contains significant variance. The superposition of differential privacy noise further submerges the already weak effective gradient signal, leading to a sharp decrease in the signal-to-noise ratio in each training round. This results in low model productivity with the same communication investment, severely restricting the balance between privacy protection and model usability.
[0034] (2) The inherent defects of knowledge distillation scheme in vehicle environment.
[0035] To mitigate the local model bias caused by non-independent and identically distributed models, knowledge distillation has been introduced into federated learning. It generates soft labels through additional teacher models or generative adversarial networks to transfer inter-category similarity knowledge and smooth local training objectives. However, this approach has fundamental drawbacks when deployed in vehicles: First, it consumes significant computational resources—the vehicle domain controller needs to perform additional forward inference of the teacher model, consuming already limited GPU / CPU computing power and memory bandwidth, affecting the responsiveness of real-time driving tasks such as navigation and voice commands. Second, it increases communication overhead—the distillation scheme requires additional transmission of teacher model parameters or soft labels, increasing the load on the vehicle-to-cloud communication link and leading to higher over-the-air (OTA) data costs for automakers. Third, it increases system complexity—maintaining a synchronization mechanism between teacher and student models increases the complexity of engineering deployment and long-term operation and maintenance. These drawbacks make it difficult to promote knowledge distillation solutions on resource-constrained, large-scale in-vehicle terminals.
[0036] (3) The temperature parameter is not adaptive in the existing scheme.
[0037] Temperature scaling of the activation function (Softmax) is a lightweight probability distribution adjustment method that can change the smoothness of predictions without additional models, and theoretically can replace some of the functions of distillation. However, the temperature parameter in existing solutions is usually set to a fixed value or a simple preset empirical value, which has the following drawbacks: First, it lacks differentiated initialization: it does not make personalized initial settings according to the differences in the local data category distribution of each vehicle terminal, and a fixed temperature cannot apply appropriate learning strategies for minority and majority classes respectively; Second, it lacks dynamic adjustment: it does not adaptively adjust according to the real-time feedback of the loss of each class during training, and the temperature cannot flexibly change with the model convergence process and the class-level learning progress; Third, it lacks co-design with differential privacy: temperature directly affects the Softmax output and gradient magnitude, thereby changing the geometry of the loss surface, but existing solutions do not utilize temperature as a means to resist differential privacy noise, resulting in a consistently low signal-to-noise ratio throughout the training process.
[0038] (4) Technical obstacles that dynamic temperature mechanisms have not been directly adopted.
[0039] Despite the aforementioned potential of temperature scaling, current technologies lack effective solutions for directly introducing dynamic temperature mechanisms into sample-level differential privacy federated training. The main technical obstacles are: First, a misconception about the direction of adjustment—common annealing strategies follow the "high temperature first, then low temperature" paradigm, continuously cooling down in the later stages of training. However, in scenarios where vehicle-side data is not independently and identically distributed, some difficult categories continuously require high gradient signals, and indiscriminate cooling is actually detrimental to their learning. Second, a technical gap in granularity selection—scalar temperature cannot take into account the learning needs of different categories, and there are no mature solutions for category-level temperature adjustment rules and coordination mechanisms with global aggregation.
[0040] This invention relates to intelligent connected vehicles and privacy-preserving machine learning technology, specifically to a model training method and system based on dynamic temperature regulation and differential privacy collaboration in a vehicle-to-everything (V2X) federated learning scenario. This method is particularly suitable for situations where in-vehicle terminal data exhibits strong heterogeneity, communication bandwidth is limited, and sample-level differential privacy protection of vehicle driving data is required. It can be applied to privacy-preserving training of in-vehicle deep learning models such as autonomous driving perception models, driving behavior prediction models, and road environment recognition models.
[0041] The core innovation of this invention is the proposal of a category-level dynamic temperature adjustment mechanism that continuously operates during training. Traditional methods only perform a one-time global temperature preset before training, and this adjustment is uniform across all training results. The dynamic adjustment mechanism of this patent mainly includes two aspects: (1) During the initialization phase, the temperature of each category label is set differently based on the number of local samples. The basic rule is: the more samples a category has locally, the higher its initial temperature setting; the fewer samples, the lower the initial temperature setting. Assume there are a total of 10 categories, and the baseline temperature is set to 1.0. If a client's local data contains as many as 400 samples of the "cat" category, accounting for 40%, its initial temperature may be increased to 1.3; the "dog" category has 350 samples, accounting for 35%, and its initial temperature is increased to around 1.3; while the "bird" category has only 30 samples, accounting for 3%, its initial temperature is decreased to 0.7; the initial temperature of the remaining categories not found locally is set slightly higher than the baseline of 1.1, to reserve appropriate learning flexibility for unseen categories that may be encountered later.
[0042] (2) During the training phase, after the backpropagation of each batch, the difficulty ratio of each category is calculated in real time by statistically analyzing the recent loss sliding window of each category. When the recent loss of a certain category is significantly higher than the global average, a cooling operation is triggered to amplify gradient reinforcement learning; when the recent loss of a certain category is significantly lower than the global average, a warming operation is triggered to smooth prediction and prevent overfitting. This mechanism runs continuously throughout the training process (except for the warm-up round, during which the temperature value does not change to prevent excessive temperature changes in the initial stage), so that the temperature parameter is always adaptively and dynamically optimized according to the category-level learning feedback, thereby effectively improving the gradient signal-to-noise ratio and model utility of each training round under the same differential privacy budget and communication investment.
[0043] Figure 1 This is a flowchart illustrating a vehicle-side model training method provided by the present invention. This method is applied to a client-side application, such as... Figure 1 As shown, the vehicle-side model training method includes steps 101 to 107: 101. Obtain the global model parameters and global temperature vector sent from the cloud.
[0044] The global temperature vector can be a global category temperature vector. If the current communication round is the first round, the temperature of each category in the global category temperature vector is a preset baseline temperature in the cloud. The client can set the initial temperature for different sample categories in the local dataset based on the baseline temperature, and obtain the local category initial temperature vector.
[0045] 102. Input the samples from the local data into the vehicle-side model for forward computation to obtain the initial scores (logits) of the samples. The parameter values of the vehicle-side model itself use the global model parameters.
[0046] The initial score is the category initial score.
[0047] 103. Based on the labels of the samples, determine the temperature corresponding to the labels in the global temperature vector. Different labels correspond to different temperatures.
[0048] Here, the label is the category label. Based on the category label of the sample, the category temperature corresponding to the category label in the global category temperature vector can be determined. Different category labels correspond to different category temperatures.
[0049] In this embodiment, if the current communication round is the first round, the client determines the temperature corresponding to the label in the local initial temperature vector.
[0050] 104. Based on the temperature corresponding to the label, perform temperature scaling on the initial score to obtain an optimized score, and convert the optimized score into a probability.
[0051] The optimization score is the ratio of the initial score to the temperature.
[0052] For example, based on the category temperature corresponding to the category label, the initial category score is temperature-scaled to obtain an optimized category score, which is then converted into a category probability. Temperature scaling is used to change the category probability of the sample.
[0053] 105. Optimize the parameter values of the vehicle-side model based on the probability and label of the sample.
[0054] For example, the parameter values of the vehicle-side model can be optimized based on the class probability and class label of the sample.
[0055] 106. Based on the mean cross-entropy loss of each sample, the global temperature vector is adjusted to obtain the locally optimized temperature vector.
[0056] For example, the global category temperature vector can be adjusted based on the mean cross-entropy loss of each sample category to obtain the local category optimized temperature vector.
[0057] 107. Send the local optimized temperature vector to the cloud to obtain the dynamically adjusted global temperature vector sent by the cloud.
[0058] For example, a local category-optimized temperature vector is sent to the cloud to obtain a dynamically adjusted global category temperature vector and global model parameters sent from the cloud. Then, the terminal repeats steps 102 to 107.
[0059] In this embodiment, temperature scaling affects the model's learning speed, convergence stability, and generalization ability by changing the probability distribution shape, thereby influencing the loss value, gradient magnitude, and loss landscape geometry.
[0060] As can be seen, this embodiment provides a model training framework based on dynamic temperature regulation and federated learning by introducing dynamic temperature regulation, which can dynamically adjust the global model parameters and global temperature vector as the training process progresses, thereby improving the model training efficiency.
[0061] In some embodiments, the client sets an initial temperature for different sample categories in the local dataset based on a baseline temperature, including: counting the number of samples in each sample category in the local dataset; and setting an initial temperature for each sample category based on the baseline temperature and the number of samples in each sample category.
[0062] Among them, based on the reference temperature and the number of samples per sample, an initial temperature is set for each sample, including the following (1.1) to (1.4): (1.1) Determine the sample percentage of each sample based on the sample size of each sample.
[0063] (1.2) If the sample proportion is less than the first threshold, the initial temperature of the sample is set to the first temperature.
[0064] (1.3) If the sample proportion is greater than the second threshold, the initial temperature of the sample is set to the second temperature.
[0065] (1.4) If the sample proportion is greater than or equal to the first threshold and less than or equal to the second threshold, the initial temperature of the sample is set to the third temperature.
[0066] Among them, the first temperature is less than the reference temperature, the second temperature is greater than the third temperature, and the third temperature is greater than or equal to the reference temperature.
[0067] In some embodiments, in step 105, the parameter values of the vehicle-side model itself are optimized based on the probability and label of the sample, including (2.1) and (2.2): (2.1) Calculate the cross-entropy loss based on the probability and label of the sample.
[0068] (2.2) Based on cross-entropy loss and noise vector, the parameter values of the vehicle-side model are optimized through backpropagation, including: Based on cross-entropy loss, the gradients corresponding to each parameter value in the vehicle-side model are determined, resulting in the first gradient vector. The first gradient vector is then pruned to obtain the second gradient vector. The second gradient vectors from multiple samples are summed to obtain the third gradient vector. This third gradient vector is then summed with the noise vector to obtain the target gradient vector. Based on the target gradient vector, the parameter values of the vehicle-side model are optimized. The noise vector remains unchanged in each optimization round.
[0069] The first gradient vector is clipped to obtain the second gradient vector, which includes: Based on the preset clipping norm and the norm of the first gradient vector, the clipping factor is determined; the clipping factor is then multiplied by each gradient in the first gradient vector by a scalar to obtain the second gradient vector.
[0070] In this disclosure, the effect of temperature on gradient magnitude is closely coupled with the pruning and noise-adding mechanism of differential privacy, so that the gradient signal of the high temperature category is more completely preserved after differential privacy processing, thereby improving the model training efficiency without increasing the privacy budget or communication overhead.
[0071] In some embodiments, the client may also perform the following (3.1) and (3.2): (3.1) After optimizing the parameter values of the vehicle-side model itself, determine the parameter update amount of the vehicle-side model.
[0072] (3.2) Send the parameter update of the vehicle model to the cloud.
[0073] As can be seen, the global model parameters are obtained by updating the parameters of the global model itself based on the parameter update amount of the global model in the cloud. The parameter update amount of the global model is obtained by weighted averaging of the parameter update amounts of the vehicle-side model sent by different clients in the previous communication round in the cloud.
[0074] In some embodiments, the client may also perform the following (4.1) to (4.4): (4.1) Maintain a loss sliding window of a preset length for each sample category.
[0075] (4.2) After training is completed in multiple batches, the mean cross-entropy loss of each sample category is determined, wherein each batch includes a preset number of samples, and the number of multiple batches is equal to the preset length.
[0076] (4.3) Based on the mean cross-entropy loss of each sample category, the global category temperature vector is adjusted to obtain the local category optimized temperature vector.
[0077] For example: Based on the mean cross-entropy loss of each sample class, determine the mean cross-entropy loss of all sample classes; based on the mean cross-entropy loss of each sample class and the mean cross-entropy loss of all sample classes, determine the difficulty ratio of each sample class; based on the difficulty ratio of each sample class, adjust the class temperature of each sample class in the global class temperature vector, including: For any sample category: If the difficulty ratio of a sample category is greater than the first ratio, then the category temperature of the sample category will be lowered to the first optimization temperature. If the difficulty ratio of a sample category is less than the second ratio, then the category temperature of the sample category will be increased to the second optimization temperature. If the difficulty ratio of a sample category is greater than or equal to the second ratio and less than or equal to the first ratio, then the category temperature of the sample category will be maintained at the preset baseline temperature. The first optimized temperature is lower than the reference temperature, and the second optimized temperature is higher than the reference temperature.
[0078] (4.4) Send the local category-optimized temperature vector to the cloud.
[0079] As can be seen, the global category temperature vector is obtained by weighted averaging of the local category-optimized temperature vectors sent by different clients in the previous communication round in the cloud.
[0080] When the number of communication rounds reaches the preset number, or when the performance metrics of the global model converge on the validation set, the vehicle-side model training is complete. The global model is the model deployed in the cloud.
[0081] Based on the foregoing description, the process of vehicle-side model training will be described in detail below through Examples 1 to 5.
[0082] Example 1: Figure 2 This is a schematic diagram of another vehicle-side model training method proposed in this invention, as shown below. Figure 2 As shown, the vehicle-side model training method includes steps 201 to 205: 201. Initial Temperature Differentiation Setting: Each client obtains the local sample quantity distribution for each category and calculates an initial temperature Tc for each category c. Categories with a larger sample quantity are assigned a temperature higher than the baseline temperature. The initial temperature (e.g., 1.3 × 10⁻⁶) Categories with fewer samples were assigned a lower score. The initial temperature (e.g., 0.7×) The initial temperature of categories not appearing locally was slightly higher than (e.g., 1.1×) This differentiation setting allows the majority class to output a smoother probability distribution in the early stages of training, reducing the risk of premature overfitting; while the minority class obtains sharper predictions, enhancing the model's ability to learn from a small number of samples, thus achieving more reasonable initial bias compensation in scenarios where the data are not independent and identically distributed.
[0083] 202. Local Model Temperature Training: The server distributes the current global model parameters to each client and broadcasts the globally aggregated category temperature vector. When the client performs model training locally, it uses its local category temperature vector Tc to scale logits sample-by-sample during forward propagation: for samples belonging to category c, its logits are divided by Tc, and the softmax probability p = Softmax(logits / Tc) is calculated. Based on this softened probability and the true label, the cross-entropy loss is calculated, and the local model parameters are updated via backpropagation. When Tc > 1, the model's output probability in category c is more uniform, the loss landscape is smoother, and the subsequent gradients are less sensitive to Gaussian noise injected via differential privacy. When Tc < 1, the model outputs more confidently for this category, the gradient magnitude is enhanced, which is beneficial for accelerating the learning of this category's features.
[0084] 203. Dynamic Temperature Feedback Adjustment: After each training batch, the client records the average cross-entropy loss for each category and uses a sliding window to calculate recent losses. For each category, the ratio of its recent loss to the average loss of all categories is calculated. If the recent loss of a category is significantly higher than the average, it indicates that the current model has not learned enough for that category, so its temperature is lowered to amplify the gradient and enhance the learning intensity. If the recent loss of a category is significantly lower than the average, it indicates that the model has fitted well, so its temperature is raised to smooth the prediction and suppress overfitting. Temperature adjustment uses an exponential moving average method for a slow transition and is constrained by preset minimum / maximum temperature limits. A warm-up phase (the first few communication rounds) is also included where no dynamic adjustments are made to ensure stability in the early stages of training.
[0085] 204. Global Temperature Federated Aggregation: After each round of federated training, participating clients upload their local category temperature vectors and the number of samples in each category to the server. The server uses the number of samples in each category from each client as the weight to perform a weighted average of the category temperatures from all clients, obtaining the global category temperature vector for this round, and broadcasts it to all clients. The global temperature vector is also used for logits scaling during testing and evaluation to ensure consistency in inference.
[0086] 205. Differential Privacy Noise Injection and Aggregation: Sample-level differential privacy noise is applied to local model updates (gradient or parameter changes), for example, by pruning the gradient of each sample and injecting Gaussian noise using a differential privacy engine such as Opacus. The noisy update is then uploaded to the server, where federated averaging aggregation is performed to update the global model parameters.
[0087] The above steps are repeated iteratively until the global model converges.
[0088] Example 2: This invention proposes an adaptive sample-level differential privacy dynamic temperature scaling optimization system for vehicle-side model training, comprising a cloud aggregation server and multiple in-vehicle clients. Cloud aggregation servers, including: The global model aggregation module is used to receive the model update data uploaded by each client, perform federated averaging, and update the global model parameters. The global temperature aggregation module is used to perform a weighted average of the category temperature vectors uploaded by each client, with the number of samples of each category as the weight, to obtain the global category temperature vector; The parameter distribution module is used to broadcast the current global model parameters and global category temperature vector to the selected clients in this round.
[0089] Each in-vehicle client: The local data statistics module is used to count the number of samples in each category of the vehicle's private dataset; The initial temperature calculation module calculates the differentiated initial temperature for each category based on the sample proportion of each category and the preset baseline temperature. The temperature scaling training module selects the corresponding category temperature based on the true category of the sample during forward propagation, scales and softens the logits, and calculates the cross-entropy loss. The dynamic temperature adjustment module maintains the recent loss of each category in a sliding window during training, calculates the difficulty ratio and adjusts the temperature of each category accordingly, and updates it smoothly through exponential moving average. The differential privacy training module has a built-in sample-level differential privacy optimizer that prunes the gradient of a single sample and injects Gaussian noise during each backpropagation to achieve local differential privacy protection. The model update upload module is used to calculate the changes in model parameters before and after local training, and upload the updated values, along with the local category temperature vectors and the number of samples in each category, to the cloud aggregation server.
[0090] The aforementioned cloud aggregation server is connected to each vehicle client via a wireless communication network, and iteratively executes the method steps of Embodiment 1 until the global model converges.
[0091] Example 3: Figure 3 This embodiment provides a schematic diagram of the flow of vehicle-to-everything (V2X) infrastructure. Figure 3In this context, the vehicle-to-everything (V2X) infrastructure includes: cloud servers, communication networks, and vehicle-mounted sensors (such as cameras, LiDAR, and millimeter-wave radar). Data from the vehicle-mounted sensors is trained using a privacy-preserving model before being uploaded. The system in this embodiment consists of a cloud aggregation server and K in-vehicle clients. The cloud aggregation server is deployed in a central or edge cloud and includes a global model aggregation module, a global temperature aggregation module, and a parameter distribution module. Each in-vehicle client is embedded in the domain controller of the intelligent connected vehicle, integrating data statistics, initial temperature calculation, temperature scaling training, dynamic temperature adjustment, differential privacy training, and update / upload modules.
[0092] In this embodiment, after the system starts, the cloud aggregation server first selects the initial model and temperature hyperparameters, and the parameter distribution module distributes the global model parameters and the initial global category temperature vector to several selected vehicle clients via wireless links such as 5G / Wi-Fi. The local data statistics module on each vehicle scans the private dataset, counts the number of samples in each category, and calculates the sample proportion; the initial temperature calculation module generates a local differentiated initial temperature vector according to preset rules. In subsequent local training, the temperature scaling training module reads the current category temperature and performs logarithmic-temperature-Softmax forward calculation for each mini-batch of samples; the differential privacy training module simultaneously performs sample-by-sample gradient clipping and noise addition operations; the dynamic temperature adjustment module adjusts the temperature vector based on the loss feedback of each category after several batches. After one round of local training is completed, the model update upload module reports the noisy model changes, the local category temperature vector, and the sample counts of each category to the cloud. The global model aggregation module and the global temperature aggregation module in the cloud aggregation server perform weighted aggregation of the model update and temperature vector, respectively, updating the global model and global temperature, and then the parameter distribution module proceeds to the next iteration.
[0093] Example 4: This embodiment provides a method flow for training a vehicle-side model, including the following steps S1 to S4: Step S1: Cloud server system initialization and parameter distribution.
[0094] The cloud selects a specific model and initial model temperature hyperparameters. After selecting the specific parameters, a global training epoch is defined. In each training epoch, a specified number of clients are randomly selected to participate in the training.
[0095] Step S2: Local model training and update on the client side.
[0096] In a specific round, the selected client obtains the model parameters and temperature from the cloud, updates the local model information, and uses the local data to perform model update training. Specifically, this includes the following steps S21 to S25: Step S21: Initial temperature differentiation setting.
[0097] Client k retrieves local dataset Count the number of samples in each category c. Let the reference temperature be... (like =2.0), and calculate the initial temperature for each category based on the sample distribution of each category. Where c represents the category. This represents the initial temperature of sample class c in the local dataset of client k.
[0098] If the proportion of samples of a certain category c in the local sample is lower than the first threshold (e.g., 5%), it is considered a minority class, and the initial temperature is set to... × ( (∈(0,1), typical value 0.7). If the proportion of samples of a certain category c in the local sample is higher than the second threshold (e.g., 30%), then it is considered the majority class, and the initial temperature is set to... × ( >1, typical value 1.3). For the remaining categories, including those not present in the local dataset, the initial temperature is set to... Or slightly higher (e.g.) ×1.1), to preserve moderate smoothness for learning a class of unseen classes.
[0099] After the above adjustments are completed, all temperature categories will be cropped to... interval (e.g.) Taking the Canadian Institute for Advanced Study (CIFAR-10) image dataset as an example, if a client mainly contains "cats" (40%), "dogs" (35%), and a small number of "birds" (3%), then the initial temperature for the "cats" and "dogs" classes is approximately 2.6, for the "birds" class approximately 1.4, and for the remaining unseen classes approximately 2.2. This differentiated setting allows the majority class to obtain smoother predictions, reducing the risk of overfitting; the minority class obtains sharper predictions, enhancing the model's learning strength for sparse samples, thus adapting to the non-independent and identically distributed characteristics of the data from the beginning of training.
[0100] Step S22: Local model temperature scaling training.
[0101] At the start of communication round t, the server will send the current global model parameters. Distribute to each client, and simultaneously broadcast the global category temperature vector obtained from the previous aggregation round. (The initial temperature of step S1 is used in the first round). Let be the global temperature and be the category. After receiving the data, client k can combine local history with the global temperature to generate the local category temperature vector for this round. (For example, using global temperature directly, or softly integrating it with local temperature). Let represent the temperature of sample category c in the local dataset of client k in round t.
[0102] For each local mini-batch sample (x, y), first compute the unscaled logits. Where logits is the initial score for each category. Here, x represents the global model parameters corresponding to communication round t, and x represents the sample set. This is the initial score set for the categories corresponding to the sample set x. Then, based on the true category y of the sample, the corresponding category temperature is selected. After scaling with logits, the softening prediction probabilities are obtained as follows: .
[0103] in, The initial class score is assigned to the i-th sample in the sample set x, i.e., the initial class score set. The initial score for the i-th category in the data. This represents the sample size. Different samples within the same batch may use different temperature values. The cross-entropy loss is calculated using this probability distribution and the one-heat encoding of the true label. ,in, Let c be the true class of sample c. Let c be the softening prediction probability for sample c. During loss backpropagation, the gradient flowing through temperature scaling will produce approximately... Scaling factor: when When the gradient magnitude is compressed, the loss surface becomes smoother, and the relative interference of subsequently added differential privacy noise on parameter updates decreases; when When the gradient is amplified, the model's learning power for that category is enhanced.
[0104] This step uses only the local model and category temperature vectors, without requiring an additional teacher model, thus avoiding the communication and computational overhead of the knowledge distillation framework.
[0105] Step S23: Dynamic temperature feedback adjustment.
[0106] After completing a certain number of batches of training, the client calculates the recent loss for each category. Note that this step sets a warm-up threshold; within this threshold, fluctuations in loss do not affect temperature changes, thus ensuring normal training of the model in the early stages. Specifically, a loss sliding window of length W (e.g., W=20) is maintained for each category c, recording the average cross-entropy loss of that category in the most recent batches. Let the average loss of all categories within the current window be... The recent average loss of category c is The difficulty ratio is calculated as follows: .
[0107] in, Difficulty ratio To prevent extremely small positive numbers from being divided by zero. Based on The temperature was adjusted as follows: like (If this type of loss is significantly higher than average, it indicates insufficient learning), then the target temperature will be lowered to [a lower value]. × 0.8, to amplify the gradient and enhance learning; like (If this type of loss is significantly lower than the average, it has already been well fitted), then the target temperature will be increased to... ×1.2, to smooth the prediction and prevent overfitting; like If the value is between [0.8, 1.2], the target temperature is maintained. .
[0108] To ensure stable training, the actual temperature is updated using an exponential moving average: .
[0109] in, Indicates the first Local datasets for each client, As a category, This represents the actual temperature of sample class c in the local dataset. This represents the old temperature of sample class c in the local dataset. Indicates the target temperature. (Crop) to ( Typical value 0.85). When the historical window length is insufficient, the temperature... Slow regression. In addition, the first basic communication rounds (e.g., set to Warmup=10) are not dynamically adjusted, allowing the model to initially converge at a stable initial temperature.
[0110] Step S24: Differential privacy model training.
[0111] During local training, the client directly implements sample-level differential privacy: for each mini-batch, a differential privacy optimizer (such as Opacus's PrivacyEngine) automatically performs sample-by-sample gradient pruning and noise injection. Specifically, the gradient of each sample is calculated. Cut according to the preset cutting norm C ( hour, ),in, The clipping factor is used to sum the clipped gradients and add Gaussian noise N(0, σ²C²I), where σ is the noise multiplier, C is the clipping norm, and I is the identity matrix. This represents the independent and equal-intensity injection of noise into each dimension of the gradient vector before parameter updates are performed. The noise multiplier σ is determined in advance based on a pre-defined privacy budget (ε,δ), where ε is the upper limit constant for privacy loss and δ is the allowed failure probability. This budget is calculated using the RDP (Rényi Differential Privacy) time-mapping method and the cumulative privacy loss is tracked throughout the training process.
[0112] Because category temperature scaling is applied during training, when a certain category temperature... When the value is greater than 1, the effective magnitude of the gradient for this type of sample is compressed (approximately 1 / ). The loss surface becomes smoother, allowing more gradients to remain intact and unpruned under a fixed pruning threshold C, thus preserving more of the signal. Simultaneously, the smoother gradient direction reduces the impact of random noise on the model's update direction. Conversely, moderately reducing the temperature for difficult classes can amplify gradients to accelerate learning, but this increases the pruning probability. Therefore, the dynamic temperature mechanism balances signal preservation and learning efficiency at the global level, achieving a higher signal-to-noise ratio under the same privacy budget.
[0113] Step S25: Calculate the local model and temperature update.
[0114] After local training is complete, client k obtains the noisy local model parameters. The model update amount (i.e., the parameter update amount of the vehicle-side model) is then calculated as follows: .
[0115] in, These are the global model parameters corresponding to communication round t. Simultaneously, the clients participating in this training round will provide their local temperature vectors for each category. The number of samples in each category is uploaded to the server.
[0116] Step S3: Server aggregates local updates.
[0117] The server performs a weighted average of the temperature vectors uploaded by each client to obtain a new round (i.e., communication round t+1) of global category temperature vector. This aggregation mechanism ensures the coordinated evolution of the global model and the temperature strategy.
[0118] The server performs an average aggregation of the update volume uploaded by the client: .
[0119] Where S represents the subset of clients participating in this round. The aggregation step no longer adds additional noise because differential privacy is already embedded during the local training process on the client.
[0120] Step S4: Iterative convergence.
[0121] Repeat steps S2 to S5 until the preset number of communication rounds is reached or the performance of the global model on the validation set tends to stabilize.
[0122] This method achieves adaptive training for data heterogeneity without requiring any knowledge distillation framework, relying solely on native category-level Softmax temperature dynamic adjustment, and effectively suppresses the detrimental effect of differential privacy noise on model utility. Since the smoothing effect of temperature on gradients occurs during training, it is tightly coupled with the sample-level differential privacy pruning and noise-adding steps, forming a "temperature-based" approach. Privacy" collaborative optimization.
[0123] Example 5: Taking the CIFAR-10 image classification benchmark task as an example, a convolutional neural network (CNN) is used as the training model. Under the condition that the data of the federated learning client is not independent and identically distributed and sample-level differential privacy protection is applied, the performance of the method of the present invention and the fixed temperature differential privacy baseline method are compared.
[0124] The federated learning system consists of a parameter server and K=10 clients. The training data is divided into non-independent and identically distributed categories using a Dirichlet distribution (α=0.5), which makes the data held by each client significantly different in terms of category distribution. Some clients are missing certain categories, and a few categories have extremely scarce samples, thus simulating the data heterogeneity of intelligent connected vehicles caused by different driving areas and times.
[0125] The task employs sample-level differential privacy protection. A differential privacy optimizer (such as the Opacus PrivacyEngine) is used to perform sample-by-sample gradient pruning and noise addition during local training on the client side, achieving sample-level privacy protection. The noise multiplier σ is fixed at 1.0, and the privacy loss is tracked using the RDP accounting method. All experiments are repeated with the same random seed and client-selected sequence to ensure comparability.
[0126] Reference temperature = 2.0, minimum temperature T_min = 1.0, maximum temperature limit T_max_bound = 3.0. Warmup rounds = 10, meaning no dynamic temperature adjustment is performed in the first 10 rounds of federated training, maintaining the initial temperature. Loss sliding window length W = 20, used to calculate the recent average loss for each category. Temperature exponential moving average coefficient β = 0.85. Difficulty ratio threshold is set as follows: when the recent loss of a certain category is higher than 1.2 times the average loss of all categories, the target temperature is set to 2.0. × 0.8 (cooling); when the temperature drops below 0.8 times the average loss, the target temperature is set to... × 1.2 (heating); otherwise, maintain target temperature. During the initialization phase, differentiated initial category temperatures are set based on the sample proportion of each category on the client's local system: the temperature for minority categories with a sample proportion of less than 5% is set to a lower temperature. × 0.7, the majority class temperature with a sample share higher than 30% is × 1.3, the temperature for the remaining categories (including those not yet appearing) is × 1.1. All temperatures were clipped to the range [T_min, T_max_bound].
[0127] At the start of communication round t, the server sends the global model parameters and the global category temperature vector. Broadcast to the selected clients, where Let 'c' represent the global temperature and 'c' represent the category. Each client loads the global model parameters and global temperature as local initialization and resets the optimizer state.
[0128] Client k performs local training: (a) For each batch of data (x, y), select the corresponding category temperature based on the true label y of each sample. A sample-by-sample temperature vector is generated. Unscaled logits z = f(Θ; x) are calculated, along with the cross-entropy loss. Here, logits are the initial class scores, Θ are the global model parameters, and x is the sample set. This is the initial score set for the category corresponding to the sample set x.
[0129] (b) Differential privacy optimizers (such as Opacus PrivacyEngine) automatically calculate the gradient for each sample, clip it according to a preset clipping norm C, sum the results, inject Gaussian noise N(0, σ²C²I), and then perform parameter updates. Here, σ is the noise multiplier, C is the clipping norm, and I is the identity matrix, representing the independent and equal-intensity injection of noise into each dimension of the gradient vector.
[0130] (c) After each batch of training is completed, the temperature manager is invoked to record the average loss of each category in this batch and update the sliding window; then the temperature adjustment method is invoked to update the local category temperature vector based on the recent loss ratio of each category. This adjustment step is skipped during the warm-up period.
[0131] (d) After all local rounds are completed, calculate the model update amount and upload it to the server along with the local final category temperature vector and the number of samples in each category.
[0132] After the server receives the information uploaded by each client: (a) Average the model update amounts and update the global model parameters.
[0133] (b) Using the number of samples in each category from each client as the weight, the uploaded category temperature vectors are weighted and averaged to obtain a new global category temperature vector.
[0134] (c) Evaluate the aggregated global model on the test set using the global category temperature vector.
[0135] Repeat the above process until T=100 rounds.
[0136] The baseline method is differential privacy federated averaging (DP-FedAvg) at a fixed temperature T=1.0, meaning no scaling is applied to logits, equivalent to standard differential privacy federated learning. Except for the temperature policy, all training configurations, privacy parameters, and client selection sequences are identical to the method of this invention to ensure a fair comparison.
[0137] In training on the experimental dataset, the overall effectiveness improvement reached 7%.
[0138] More importantly, this significant improvement was achieved without increasing the number of communication rounds, reducing the strength of differential privacy protection, or introducing additional auxiliary models. The traffic overhead and computational load of each communication round were exactly the same as the baseline, but the model utility produced in each training round was higher, resulting in a significant improvement in the final model accuracy. This fully verifies the ability of this invention to improve the effectiveness of differential privacy federated learning through a dynamic temperature adjustment mechanism, and also lays the technical foundation for achieving considerable economic benefits in resource-constrained and privacy-sensitive deployment scenarios such as connected vehicles.
[0139] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) Core technology effect: model accuracy gain under the same investment.
[0140] This invention employs a dynamic temperature adjustment mechanism to achieve a higher signal-to-noise ratio in each round of local training model updates without increasing the number of communication rounds or reducing the intensity of differential privacy noise. Under the same privacy budget, this method can achieve a 6% to 10% improvement in test accuracy compared to a fixed-temperature differential privacy baseline.
[0141] (2) Quantification of direct economic benefits.
[0142] a. Reduced cost of invalid traffic from single-bike shadow mode data collection.
[0143] In the deployment of L4 autonomous driving shadow mode, vehicles need to periodically upload local training updates. When the model accuracy of the fixed-temperature scheme fails to meet the standard due to privacy noise, the data collected during that period does not actually generate effective training value, and the corresponding traffic costs are ineffective expenditures.
[0144] This invention improves the effectiveness of each training round by 6% to 10%, meaning that with the same traffic consumption, the effective training output increases by 6% to 10%. In terms of cost savings: the model accuracy that previously required 100% traffic consumption to achieve can now be obtained with 106% to 110% accuracy with the same traffic consumption. Based on a fleet of 500,000 connected vehicles, the annual OTA traffic pool cost can be reduced by several million yuan.
[0145] b. Reduced unnecessary consumption of aggregated computing power of cloud GPUs.
[0146] Global model aggregation on the federated training server requires access to a cloud-based GPU cluster. When model updates uploaded by clients are of low quality due to privacy noise contamination, although cloud-based aggregation computing runs normally, it processes low-value updates, effectively wasting computing power.
[0147] This invention improves the effectiveness of each update round by 2% to 4%, meaning that the global model achieves higher accuracy gains with the same number of aggregation calculations. Each training cycle avoids inefficient computing power consumption of approximately 4–16 yuan. Based on a deployment scale of 500,000 vehicles, annual cloud GPU leasing costs can be reduced by tens of millions of yuan.
[0148] c. Implicit savings in iteration frequency resulting from improved model accuracy.
[0149] In engineering practice, when a single federated training cycle fails to reach the expected accuracy threshold, additional training rounds or a restart of training are often required. Fixed-temperature solutions suffer from lower accuracy rates due to noise interference, necessitating more iterations to meet deployment standards.
[0150] Based on the total cost of training a single vehicle per training session (including vehicle-side traffic, cloud computing power, and storage maintenance), each deployment of a single vehicle can save 20-100 yuan, and each model update of a fleet of 500,000 vehicles can avoid tens of millions of yuan in inefficient iteration expenses.
[0151] d. Reduced cloud storage and maintenance costs.
[0152] Each round of federated training generates intermediate parameters, gradient snapshots, and runtime logs, which need to be persistently stored in the cloud. Currently, the automotive data acquisition industry generally faces the challenge of cloud storage costs accounting for a large and rapidly increasing proportion of total costs. Fixed-temperature solutions, due to unstable model convergence, often require retaining more historical checkpoints and debugging logs, further increasing the storage burden.
[0153] This invention uses dynamic temperature regulation to make the training process more stable and the accuracy curve smoother, reducing the need to save intermediate states and diagnostic data due to training anomalies. Data processing and storage costs per vehicle can be reduced by approximately 10% to 20%. Maintenance costs per vehicle can be reduced by 10,000 to 100,000 yuan, and with large-scale deployment of multiple vehicle models, annual cumulative savings can reach hundreds of thousands to millions of yuan.
[0154] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art will understand that the embodiments of this disclosure are not limited to the described order of actions, because according to the embodiments of this disclosure, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art will understand that the embodiments described in the specification are all optional embodiments.
[0155] Figure 4 This is a schematic diagram of a vehicle-side model training device provided by the present invention. This device is applied to a client-side application, such as... Figure 4 As shown, the device includes: Acquisition unit 41 is used to acquire global model parameters and global temperature vector sent from the cloud; Scoring unit 42 is used to input samples from local data into the vehicle-end model for forward calculation to obtain the initial score of the sample. The parameter values of the vehicle-end model itself use global model parameters. The determination unit 43 is used to determine the temperature corresponding to the label in the global temperature vector based on the label of the sample; different labels correspond to different temperatures. Scaling unit 44 is used to perform temperature scaling on the initial score based on the temperature corresponding to the label to obtain an optimized score, and convert the optimized score into a probability; The first optimization unit 45 is used to optimize the parameter values of the vehicle-side model itself based on the probability and label of the sample. The second optimization unit 46 is used to adjust the global temperature vector based on the mean cross-entropy loss of each sample to obtain a locally optimized temperature vector. The sending unit 47 is used to send a locally optimized temperature vector to the cloud so that the acquisition unit can acquire the dynamically adjusted global temperature vector sent by the cloud.
[0156] In some embodiments, the global temperature vector is the global category temperature vector; the initial score is the category initial score; the label is the category label; the temperature corresponding to the label is the category temperature corresponding to the category label; the optimized score is the category optimization; the probability is the category probability; the mean cross-entropy loss of the samples is the mean cross-entropy loss of the sample categories; and the local optimized temperature vector is the local category optimized temperature vector.
[0157] In some embodiments, if the current communication round is the first round, the temperature of each category in the global category temperature vector is a preset baseline temperature in the cloud. The device also includes a setting unit for setting initial temperatures for different sample categories in the local dataset based on a reference temperature, thereby obtaining a local category initial temperature vector. The determination unit 43 is used to: determine the category temperature corresponding to the category label in the local category initial temperature vector.
[0158] In some embodiments, the setting unit sets an initial temperature for different sample categories in the local dataset based on a reference temperature, including: Count the number of samples in each category in the local dataset; An initial temperature is set for each sample category based on the baseline temperature and the number of samples in each category.
[0159] In some embodiments, the setting unit sets an initial temperature for each sample category based on a reference temperature and the number of samples in each sample category, including: Based on the number of samples in each sample category, determine the sample percentage of each sample category; If the sample proportion is less than the first threshold, the initial temperature of the sample category is set to the first temperature. If the sample proportion is greater than the second threshold, the initial temperature of the sample category is set to the second temperature. If the sample proportion is greater than or equal to the first threshold and less than or equal to the second threshold, then the initial temperature of the sample category is set to the third temperature. Among them, the first temperature is less than the reference temperature, the second temperature is greater than the third temperature, and the third temperature is greater than or equal to the reference temperature.
[0160] In some embodiments, the optimized score is the ratio of the initial score to the temperature corresponding to the label.
[0161] In some embodiments, the first optimization unit 45 is used to: Calculate the cross-entropy loss based on the sample's probability and label; Based on cross-entropy loss and noise vector, the parameter values of the vehicle-side model are optimized through backpropagation, where the noise vector remains unchanged in each round of optimization.
[0162] In some embodiments, the first optimization unit 45 optimizes the parameter values of the vehicle-side model itself through backpropagation based on cross-entropy loss and noise vector, including: Based on cross-entropy loss, the gradients corresponding to the parameter values included in the vehicle-side model are determined, and the first gradient vector is obtained. The first gradient vector is clipped to obtain the second gradient vector; The third gradient vector is obtained by summing the second gradient vectors of multiple samples. Summing the third gradient vector with the noise vector yields the target gradient vector; Based on the target gradient vector, optimize the parameter values of the vehicle-side model itself.
[0163] In some embodiments, the first optimization unit 45 trims the first gradient vector to obtain a second gradient vector, including: The clipping factor is determined based on the preset clipping norm and the norm of the first gradient vector; The clipping factor is multiplied by each gradient in the first gradient vector by a scalar to obtain the second gradient vector.
[0164] In some embodiments, the determining unit 43 is further configured to: determine the parameter update amount of the vehicle-side model after optimizing the parameter values of the vehicle-side model itself; The device also includes a first sending unit for sending parameter updates of the vehicle-side model to the cloud.
[0165] In some embodiments, the global model parameters are obtained by updating the parameters of the global model itself based on the parameter update amount of the global model in the cloud. The parameter update amount of the global model is obtained by weighted averaging of the parameter update amounts of the vehicle-side model sent by different clients in the previous communication round in the cloud.
[0166] In some embodiments, the device further includes: The maintenance unit is used to maintain a loss sliding window of a preset length for each sample category; The second determining unit is used to determine the mean cross-entropy loss of each sample category after training is completed in multiple batches, wherein each batch includes a preset number of samples, and the number of multiple batches is equal to the value of a preset length. The second optimization unit 46 is used to adjust the global category temperature vector based on the mean cross-entropy loss of each sample category to obtain the local category optimized temperature vector. Sending unit 47 is used to send the local category-optimized temperature vector to the cloud.
[0167] In some embodiments, the second optimization unit 46 is used for: The difficulty ratio for each sample class is determined based on the mean cross-entropy loss for each sample class. Adjust the class temperature of each sample class in the global class temperature vector based on the difficulty ratio of each sample class.
[0168] In some embodiments, the adjustment unit determines the difficulty ratio for each sample class based on the mean cross-entropy loss for each sample class, including: Based on the mean cross-entropy loss of each sample class, determine the mean cross-entropy loss of all sample classes; The difficulty ratio for each sample class is determined based on the mean cross-entropy loss for each sample class and the mean cross-entropy loss for all sample classes.
[0169] In some embodiments, the second optimization unit 46 adjusts the class temperature of each sample class in the global class temperature vector based on the difficulty ratio of each sample class, including: For any sample category: If the difficulty ratio of a sample category is greater than the first ratio, then the category temperature of the sample category will be lowered to the first optimization temperature. If the difficulty ratio of a sample category is less than the second ratio, then the category temperature of the sample category will be increased to the second optimization temperature. If the difficulty ratio of a sample category is greater than or equal to the second ratio and less than or equal to the first ratio, then the category temperature of the sample category will be maintained at the preset baseline temperature. The first optimized temperature is lower than the reference temperature, and the second optimized temperature is higher than the reference temperature.
[0170] In some embodiments, the global temperature vector is obtained by weighted averaging of the locally optimized temperature vectors sent by different clients in the previous communication round in the cloud.
[0171] In some embodiments, the apparatus further includes a training termination unit for: When the number of communication rounds reaches the preset number, or when the performance metrics of the global model converge on the validation set, the vehicle-side model training is complete. The global model is the model deployed in the cloud.
[0172] Figure 4 For details of the various embodiments of the vehicle-mounted model training device shown, please refer to [link / reference]. Figure 1The various embodiments of the vehicle-side model training method shown are not described again to avoid repetition.
[0173] This disclosure also provides a processor-readable storage medium storing a program for causing a processor to execute the steps of various embodiments of the vehicle-side model training method. The processor-readable storage medium can be any available medium or data storage device accessible to the processor, including but not limited to magnetic memory (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.), optical memory (e.g., CD, DVD, BD, HVD, etc.), and semiconductor memory (e.g., ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)).
[0174] Figure 5 This is a schematic diagram of a terminal provided by the present invention. (See diagram below.) Figure 5 As shown, the terminal provided by the present invention includes a memory 51, a transceiver 52, and a processor 53. Memory 51 is used to store computer programs; transceiver 52 is used to send and receive data under the control of processor 53; processor 53 is used to read the computer program from memory 51 and execute it. Obtain the global model parameters and global temperature vector sent from the cloud; The samples from the local data are input into the vehicle-side model for forward computation to obtain the initial score of the samples. The parameter values of the vehicle-side model itself use the global model parameters. Based on the labels of the samples, the temperature corresponding to the label in the global temperature vector is determined, with different labels corresponding to different temperatures; Based on the temperature corresponding to the label, the initial score is temperature-scaled to obtain an optimized score, and the optimized score is converted into a probability. Based on the probability and label of the sample, optimize the parameter values of the vehicle-side model itself; Based on the mean cross-entropy loss of each sample, the global temperature vector is adjusted to obtain the locally optimized temperature vector; Send the locally optimized temperature vector to the cloud to obtain the dynamically adjusted global temperature vector sent by the cloud.
[0175] In some embodiments, the global temperature vector is the global category temperature vector; the initial score is the category initial score; the label is the category label; the temperature corresponding to the label is the category temperature corresponding to the category label; the optimized score is the category optimization; the probability is the category probability; the mean cross-entropy loss of the samples is the mean cross-entropy loss of the sample categories; and the local optimized temperature vector is the local category optimized temperature vector.
[0176] In some embodiments, if the current communication round is the first round, the temperature of each category in the global category temperature vector is a preset baseline temperature in the cloud. Processor 53 is also used to: set initial temperatures for different sample categories in the local dataset based on a reference temperature, and obtain local category initial temperature vectors; Determine the temperature corresponding to the label in the global temperature vector, including: determining the category temperature corresponding to the category label in the local category initial temperature vector.
[0177] In some embodiments, initial temperatures are set for different sample categories in the local dataset based on a baseline temperature, including: Count the number of samples in each category in the local dataset; An initial temperature is set for each sample category based on the baseline temperature and the number of samples in each category.
[0178] In some embodiments, an initial temperature is set for each sample category based on a reference temperature and the number of samples in each sample category, including: Based on the number of samples in each sample category, determine the sample percentage of each sample category; If the sample proportion is less than the first threshold, the initial temperature of the sample category is set to the first temperature. If the sample proportion is greater than the second threshold, the initial temperature of the sample category is set to the second temperature. If the sample proportion is greater than or equal to the first threshold and less than or equal to the second threshold, then the initial temperature of the sample category is set to the third temperature. Among them, the first temperature is less than the reference temperature, the second temperature is greater than the third temperature, and the third temperature is greater than or equal to the reference temperature.
[0179] In some embodiments, the optimized score is the ratio of the initial score to the temperature corresponding to the label.
[0180] In some embodiments, the parameter values of the vehicle-side model are optimized based on the probability and label of the sample, including: Calculate the cross-entropy loss based on the sample's probability and label; Based on cross-entropy loss and noise vector, the parameter values of the vehicle-side model are optimized through backpropagation, where the noise vector remains unchanged in each round of optimization.
[0181] In some embodiments, the parameter values of the vehicle-side model are optimized through backpropagation based on cross-entropy loss and noise vector, including: Based on cross-entropy loss, the gradients corresponding to the parameter values included in the vehicle-side model are determined, and the first gradient vector is obtained. The first gradient vector is clipped to obtain the second gradient vector; The third gradient vector is obtained by summing the second gradient vectors of multiple samples. Summing the third gradient vector with the noise vector yields the target gradient vector; Based on the target gradient vector, optimize the parameter values of the vehicle-side model itself.
[0182] In some embodiments, clipping the first gradient vector to obtain the second gradient vector includes: The clipping factor is determined based on the preset clipping norm and the norm of the first gradient vector; The clipping factor is multiplied by each gradient in the first gradient vector by a scalar to obtain the second gradient vector.
[0183] In some embodiments, the processor 53 is further configured to: After optimizing the parameter values of the vehicle-side model itself, determine the parameter update amount of the vehicle-side model; Send the parameter update amount of the vehicle model to the cloud.
[0184] In some embodiments, the global model parameters are obtained by updating the parameters of the global model itself based on the parameter update amount of the global model in the cloud. The parameter update amount of the global model is obtained by weighted averaging of the parameter update amounts of the vehicle-side model sent by different clients in the previous communication round in the cloud.
[0185] In some embodiments, the mean cross-entropy loss of sample classes is determined in the following manner: Maintain a loss sliding window of a preset length for each sample category; After training is completed in multiple batches, the mean cross-entropy loss for each sample category is determined. Each batch includes a preset number of samples, and the number of batches is equal to the preset length.
[0186] In some embodiments, the global temperature vector is adjusted based on the mean cross-entropy loss of each sample, including: The difficulty ratio for each sample class is determined based on the mean cross-entropy loss for each sample class. Adjust the class temperature of each sample class in the global class temperature vector based on the difficulty ratio of each sample class.
[0187] In some embodiments, the difficulty ratio for each sample class is determined based on the mean cross-entropy loss for each sample class, including: Based on the mean cross-entropy loss of each sample class, determine the mean cross-entropy loss of all sample classes; The difficulty ratio for each sample class is determined based on the mean cross-entropy loss for each sample class and the mean cross-entropy loss for all sample classes.
[0188] In some embodiments, adjusting the class temperature of each sample class in the global class temperature vector based on the difficulty ratio of each sample class includes: For any sample category: If the difficulty ratio of a sample category is greater than the first ratio, then the category temperature of the sample category will be lowered to the first optimization temperature. If the difficulty ratio of a sample category is less than the second ratio, then the category temperature of the sample category will be increased to the second optimization temperature. If the difficulty ratio of a sample category is greater than or equal to the second ratio and less than or equal to the first ratio, then the category temperature of the sample category will be maintained at the preset baseline temperature. The first optimized temperature is lower than the reference temperature, and the second optimized temperature is higher than the reference temperature.
[0189] In some embodiments, the global temperature vector is obtained by weighted averaging of the locally optimized temperature vectors sent by different clients in the previous communication round in the cloud.
[0190] In some embodiments, the processor 53 is further configured to: When the number of communication rounds reaches the preset number, or when the performance metrics of the global model converge on the validation set, the vehicle-side model training is complete. The global model is the model deployed in the cloud. Figure 5 For details of the various embodiments of the terminal shown, please refer to Figure 1 The various embodiments of the vehicle-side model training method shown are not described again to avoid repetition.
[0191] The present invention also proposes a vehicle, including as follows: Figure 5 The terminals provided in each embodiment.
[0192] Based on the inventive concept disclosed in this application, namely, dynamically adjusting the softmax temperature by sensing loss feedback of various categories to form a synergistic optimization with sample-level differential privacy, any person skilled in the art, without inventive effort, could easily modify, substitute, or improve the specific embodiments of this application by making simple modifications, equivalent substitutions, or improvements (such as conventional adjustments to parameters like temperature adjustment thresholds, exponential moving average coefficients, and preheating cycles, equivalent variations to the initial temperature differentiation setting rules, or modifications to the temperature...) All other embodiments obtained by recombination of noise association methods, as long as they fall within the scope defined by the claims of this application, shall be considered as the subject matter of protection of this application and fall within the protection scope of this application. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.
[0193] The above embodiments are merely preferred embodiments provided to fully illustrate the present invention, and the scope of protection of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the present invention are all within the scope of protection of the present invention.
Claims
1. A method for training a vehicle-side model, characterized in that, Applied to a client, the method includes: Obtain the global model parameters and global temperature vector sent from the cloud; The samples from the local data are input into the vehicle-side model for forward computation to obtain the initial score of the samples. The parameter values of the vehicle-side model itself use the global model parameters. Based on the labels of the samples, the temperatures corresponding to the labels in the global temperature vector are determined, with different labels corresponding to different temperatures; Based on the temperature corresponding to the label, the initial score is temperature scaled to obtain an optimized score, and the optimized score is converted into a probability. Based on the probability and label of the sample, optimize the parameter values of the vehicle-side model itself; Based on the mean cross-entropy loss of each sample, the global temperature vector is adjusted to obtain a locally optimized temperature vector; Send the locally optimized temperature vector to the cloud to obtain the dynamically adjusted global temperature vector sent by the cloud.
2. The method according to claim 1, characterized in that, The global temperature vector is a global category temperature vector; the initial score is a category initial score; the label is a category label; the temperature corresponding to the label is the category temperature corresponding to the category label; the optimized score is a category optimization; the probability is a category probability; the mean cross-entropy loss of the sample is the mean cross-entropy loss of the sample category; the local optimized temperature vector is a local category optimized temperature vector.
3. The method according to claim 2, characterized in that, If the current communication round is the first round, the temperature of each category in the global category temperature vector is the preset reference temperature in the cloud. The method further includes: setting initial temperatures for different sample categories in the local dataset based on the baseline temperature, to obtain local category initial temperature vectors; Determining the temperature corresponding to the label in the global temperature vector includes: determining the category temperature corresponding to the category label in the local category initial temperature vector.
4. The method according to claim 3, characterized in that, The step of setting initial temperatures for different sample categories in the local dataset based on the baseline temperature includes: Count the number of samples in each sample category in the local dataset; An initial temperature is set for each sample category based on the baseline temperature and the number of samples in each sample category.
5. The method according to claim 4, characterized in that, The step of setting an initial temperature for each sample category based on the reference temperature and the number of samples in each sample category includes: Based on the number of samples in each sample category, determine the sample percentage of each sample category; If the proportion of the sample is less than the first threshold, the initial temperature of the sample category is set to the first temperature; If the proportion of the sample is greater than the second threshold, the initial temperature of the sample category is set to the second temperature; If the sample proportion is greater than or equal to the first threshold and less than or equal to the second threshold, then the initial temperature of the sample category is set to the third temperature; Wherein, the first temperature is less than the reference temperature, the second temperature is greater than the third temperature, and the third temperature is greater than or equal to the reference temperature.
6. The method according to claim 1, characterized in that, The optimized score is the ratio of the initial score to the temperature corresponding to the label.
7. The method according to claim 2, characterized in that, The optimization of the vehicle-side model's parameter values based on the sample's probability and label includes: Calculate the cross-entropy loss based on the probability and label of the sample; Based on the cross-entropy loss and the noise vector, the parameter values of the vehicle-side model are optimized through backpropagation, wherein the noise vector remains unchanged in each round of optimization.
8. The method according to claim 7, characterized in that, The optimization of the vehicle-side model's parameter values via backpropagation based on the cross-entropy loss and noise vector includes: Based on the cross-entropy loss, the gradients corresponding to the parameter values included in the vehicle-end model are determined, and the first gradient vector is obtained. The first gradient vector is clipped to obtain the second gradient vector; The third gradient vector is obtained by summing the second gradient vectors of multiple samples. The target gradient vector is obtained by summing the third gradient vector with the noise vector. Based on the target gradient vector, the parameter values of the vehicle-side model itself are optimized.
9. The method according to claim 8, characterized in that, The step of trimming the first gradient vector to obtain the second gradient vector includes: The clipping factor is determined based on the preset clipping norm and the norm of the first gradient vector; The clipping factor is multiplied by each gradient in the first gradient vector by a scalar to obtain the second gradient vector.
10. The method according to claim 1, characterized in that, The method further includes: After optimizing the parameter values of the vehicle-side model itself, the parameter update amount of the vehicle-side model is determined; Send the parameter update amount of the vehicle-side model to the cloud.
11. The method according to claim 10, characterized in that, The global model parameters are obtained by updating the parameters of the global model itself based on the parameter update amount of the global model in the cloud. The parameter update amount of the global model is obtained by weighted averaging the parameter update amounts of the vehicle-side model sent by different clients in the previous communication round in the cloud.
12. The method according to claim 2, characterized in that, The mean cross-entropy loss of the sample categories is determined in the following way: Maintain a loss sliding window of a preset length for each sample category; After training is completed in multiple batches, the mean cross-entropy loss for each sample category is determined, wherein each batch includes a preset number of samples, and the number of the multiple batches is equal to the preset length.
13. The method according to claim 12, characterized in that, The adjustment of the global temperature vector based on the mean cross-entropy loss of each sample includes: Based on the mean cross-entropy loss of each sample category, the difficulty ratio of each sample category is determined; Based on the difficulty ratio of each sample category, the category temperature of each sample category in the global category temperature vector is adjusted.
14. The method according to claim 13, characterized in that, Determining the difficulty ratio for each sample category based on the mean cross-entropy loss of each sample category includes: Based on the mean cross-entropy loss of each sample category, determine the mean cross-entropy loss of all sample categories; The difficulty ratio of each sample category is determined based on the mean cross-entropy loss of each sample category and the mean cross-entropy loss of all sample categories.
15. The method according to claim 13, characterized in that, The step of adjusting the category temperature of each sample category in the global category temperature vector based on the difficulty ratio of each sample category includes: For any sample category: If the difficulty ratio of the sample category is greater than the first ratio, then the category temperature of the sample category is lowered to the first optimization temperature; If the difficulty ratio of the sample category is less than the second ratio, then the category temperature of the sample category is increased to the second optimization temperature. If the difficulty ratio of the sample category is greater than or equal to the second ratio and less than or equal to the first ratio, then the category temperature of the sample category will be maintained at a preset reference temperature. Wherein, the first optimized temperature is lower than the reference temperature, and the second optimized temperature is higher than the reference temperature.
16. The method according to claim 1, characterized in that, The global temperature vector is obtained by weighted averaging of the locally optimized temperature vectors sent by different clients in the previous communication round in the cloud.
17. The method according to claim 1, characterized in that, The method further includes: When the number of communication rounds reaches a preset number, or when the performance metrics of the global model converge on the validation set, the vehicle-side model training is complete. The global model is a model deployed in the cloud.
18. A vehicle-end model training device, characterized in that, Applied to a client, the device includes: The acquisition unit is used to acquire global model parameters and global temperature vectors sent from the cloud. The scoring unit is used to input samples from local data into the vehicle-side model for forward calculation to obtain the initial score of the sample, wherein the parameter values of the vehicle-side model itself use the global model parameters; The determining unit is used to determine the temperature corresponding to the label in the global temperature vector based on the label of the sample, wherein different labels correspond to different temperatures; The scaling unit is used to perform temperature scaling on the initial score based on the temperature corresponding to the label to obtain an optimized score, and to convert the optimized score into a probability. The first optimization unit is used to optimize the parameter values of the vehicle-side model itself based on the probability of the sample and the label of the sample. The second optimization unit is used to adjust the global temperature vector based on the mean cross-entropy loss of each sample to obtain a locally optimized temperature vector. The sending unit is used to send the locally optimized temperature vector to the cloud so that the acquiring unit can acquire the dynamically adjusted global temperature vector sent by the cloud.
19. A terminal, characterized in that, The terminal includes: a memory, a transceiver, and a processor; The memory is used to store computer programs; the transceiver is used to send and receive data under the control of the processor; the processor is used to read the computer programs in the memory and execute them. Obtain the global model parameters and global temperature vector sent from the cloud; The samples from the local data are input into the vehicle-side model for forward computation to obtain the initial score of the samples. The parameter values of the vehicle-side model itself use the global model parameters. Based on the labels of the samples, the temperatures corresponding to the labels in the global temperature vector are determined, with different labels corresponding to different temperatures; Based on the temperature corresponding to the label, the initial score is temperature scaled to obtain an optimized score, and the optimized score is converted into a probability. Based on the probability and label of the sample, optimize the parameter values of the vehicle-side model itself; Based on the mean cross-entropy loss of each sample, the global temperature vector is adjusted to obtain a locally optimized temperature vector; Send the locally optimized temperature vector to the cloud to obtain the dynamically adjusted global temperature vector sent by the cloud.
20. A vehicle, characterized in that, The vehicle includes the terminal as described in claim 19.
21. A processor-readable storage medium, characterized in that, The processor-readable storage medium stores a program for causing the processor to execute the vehicle-end model training method as described in any one of claims 1 to 17.