Personalized federated learning method and apparatus, electronic device, and storage medium

CN123031818APending Publication Date: 2026-11-03CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611451614.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-18
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

In intelligent connected vehicles, traditional centralized training leads to high risks of privacy leaks and heavy communication loads, and the limited wireless communication resources of in-vehicle terminals make it difficult to achieve efficient machine learning.

Method used

A personalized federated learning approach is adopted, which freezes the local classifier head parameters, reparameterizes and sparsifies the local feature extractor parameters, combines differential privacy processing, and compresses the model parameters before uploading them to the server.

Benefits of technology

While ensuring privacy and security, it significantly reduces communication load, improves model adaptability, adapts to the data distribution of individual vehicles, and reduces communication volume.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123031818A_ABST
    Figure CN123031818A_ABST
Patent Text Reader

Abstract

The application relates to a personalized federated learning method and device, electronic equipment and a storage medium. The personalized federated learning method comprises the following steps: obtaining first feature extractor parameters of a local feature extractor and second classifier head parameters of a local classifier head; the second classifier head parameters are frozen, the first feature extractor parameters are trained, the first feature extractor parameters are reparameterized during the training process, and second feature extractor parameters are obtained; the difference between the second feature extractor parameters and the first feature extractor parameters is sparsified to obtain sparse update information; the sparse update information is subjected to differential privacy processing to obtain differential update information, and the differential update information is uploaded to a server. According to the application, the feature extractor parameters are reparameterized, and the change amount of the extractor parameters is sparsified, so that the obtained sparse update information has high sparseness, the data amount of the uploaded data is compressed, and the communication load is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the interdisciplinary fields of vehicle network security and artificial intelligence privacy computing, and in particular to a personalized federated learning method, device, electronic device and storage medium. Background Technology

[0002] With the deep penetration of artificial intelligence (AI) technology into the field of intelligent connected vehicles (ICVs), machine learning models based on massive amounts of driving data have become a key support for core functions such as environmental perception, behavioral decision-making, and path planning. Traditional centralized training requires the collection of raw data scattered across various vehicles and roadside units (RSUs) to a cloud platform for unified modeling. This not only poses a serious risk of privacy leaks due to the exposure of sensitive information such as vehicle trajectories, driving behavior, and sensor data, but also puts enormous pressure on the bandwidth of vehicle networks and cloud storage costs due to the long-distance transmission of massive amounts of data.

[0003] In addition, the wireless communication resources of vehicle terminals (such as cellular vehicle-to-everything (C-V2X) and dedicated short-range communication (DSRC) bandwidth) are extremely limited, and the frequent and complete interaction of model parameters during machine learning will bring high communication load, which may even lead to system unavailability in severe cases.

[0004] Therefore, there is a need to provide a machine learning method that can reduce the communication load of vehicles while ensuring privacy and security. Summary of the Invention

[0005] To address, or at least partially address, the aforementioned technical problems, this application provides a personalized federated learning method, apparatus, electronic device, and storage medium.

[0006] Firstly, this application provides a personalized federated learning method applied to a client, the method comprising: Obtain the first feature extractor parameters of the local feature extractor and the second classifier head parameters of the local classifier head; Freeze the second classifier head parameters, train the first feature extractor parameters, and reparameterize the first feature extractor parameters during the training process to obtain the second feature extractor parameters; The difference between the parameters of the second feature extractor and the parameters of the first feature extractor is sparsified to obtain sparse update information, which is obtained by masking the difference. Differential privacy processing is performed on the sparse update information to obtain differential update information, which is then uploaded to the server.

[0007] Optionally, the first feature extractor parameters of the local feature extractor and the second classifier head parameters of the local classifier head are obtained, including: Receive global feature extractor parameters and first classifier header parameters from the server; Freeze the parameters of the first feature extractor, train the parameters of the first classifier head to obtain the parameters of the second classifier head; Obtain the interval feature extractor parameters to serve as the first feature extractor parameters of the local feature extractor; Obtain the second classifier head parameter as the second classifier head parameter of the local classifier head.

[0008] Optionally, the parameters of the first feature extractor are frozen, and the parameters of the first classifier head are trained to obtain the parameters of the second classifier head, including: Freeze the parameters of the first feature extractor; The first data is obtained by randomly sampling from the local dataset; The first data is input into the local feature extractor so that the local feature extractor outputs a feature representation; The feature representation is input into the local classifier head to obtain the prediction result. In the first iteration, the current classifier head parameters of the local classifier head are determined according to the first classifier head parameters. Determine the loss value between the prediction result and the training label, wherein the training label corresponds to the first data; The gradient of the current classifier head parameter of the local classifier head is updated according to the loss value to obtain intermediate classifier head parameters, which are used as the current classifier head parameters in the next round of local training. The step of randomly sampling from the local dataset to obtain the first data is repeated until the preset local iteration round is completed to obtain the second classifier head parameter.

[0009] Optionally, the parameters of the first feature extractor are trained, and during the training process, the parameters of the first feature extractor are reparameterized to obtain the parameters of the second feature extractor, including: In each round of local training, obtain the current layer threshold of the local feature extractor and the current sparsity rate; The sparsity parameters used in this round of forward propagation are determined based on the current layering threshold and the current sparsity rate. The regularization term is determined based on the current feature extractor parameters and the first feature extractor parameters; Forward propagation is performed using the local dataset based on the sparse parameters, and the task loss is determined based on a preset loss function, which includes the regularization term. Based on the preset loss function, backpropagation is performed to obtain the intermediate feature extractor parameters, which are used as the current feature extractor parameters in the next round of local training. Repeat the above steps until the preset local training rounds are reached to obtain the parameters of the second feature extractor.

[0010] Optionally, the sparsity parameters used in this round of forward propagation are determined based on the current layering threshold and the current sparsity rate, including: Obtain the current sparsity rate, the current parameters of each layer of the local feature extractor, and the current layer threshold; Determine the binary mask matrix based on the current layer parameters and the sparsity rate; The sparse parameters used in this round of forward propagation are determined based on the current layer threshold, the binary mask matrix, and the current layer parameters.

[0011] Optionally, obtaining the current sparsity rate includes: Obtain current channel quality data, calculate resource load factor, preset minimum sparsity rate, and preset maximum sparsity rate; Determine the channel quality factor based on the channel quality data; The load factor is determined based on the aforementioned computational resource load factor; The current sparsity rate is determined based on the channel quality factor, the load factor, the preset minimum sparsity rate, and the preset maximum sparsity rate.

[0012] Optionally, the current hierarchical threshold of the local feature extractor is obtained, including: Obtain current driving scenario data; Obtain the threshold adjustment strategy corresponding to the driving scenario data; The initial stratification threshold is adjusted according to the threshold adjustment strategy to obtain the current stratification threshold.

[0013] Optionally, a regularization term is determined based on the current feature extractor parameters and the first feature extractor parameters, including: Determine the L2 norm of the difference between the current feature extractor parameters and the first feature extractor parameters; Obtain the clipping threshold; The regularization term is determined based on the L2 norm and the pruning threshold.

[0014] Optionally, differential privacy processing is performed on the sparse update information to obtain differential update information, including: The sparse update information is pruned based on a pruning threshold to obtain pruning information. Add Gaussian noise that satisfies differential privacy to the clipping information to obtain the differential update information.

[0015] Optionally, Gaussian noise satisfying differential privacy is added to the cropping information to obtain the differential update information, including: Obtain the level of autonomous driving; The differential privacy strength is determined based on the autonomous driving level; The sensitivity of the model to update data is determined based on the differential privacy strength. Based on the sensitivity, Gaussian noise that satisfies differential privacy is added to the cropping information to obtain the differential update information.

[0016] Secondly, this application provides a personalized federated learning method applied to the server side, the method comprising: During each round of global training, differential update information is received from multiple clients; The differential update information from multiple clients is aggregated to obtain aggregated update information; The current global feature extractor parameters are updated based on the aggregated update information to obtain the updated global feature extractor parameters. The updated global feature extractor parameters are obtained by multiplying the aggregated update information by a preset global learning rate and then adding the current global feature extractor parameters. Repeat the above steps until the preset number of global training rounds is reached, and the global feature extractor parameters of the global feature extractor are obtained.

[0017] Optionally, the aggregation of differential update information from multiple clients to obtain aggregated update information includes: The differential update information from multiple clients is aggregated by a weighted average, wherein the weight of each client is related to the number of samples in the local dataset in which that client participated in training; Before aggregation, the differential update information of each client is truncated to limit the L2 norm of each differential update information to not exceed a preset threshold. The aggregated update information is a truncated and weighted averaged gradient update tensor; the aggregated update information does not undergo any server-side differential privacy processing.

[0018] Optionally, updating the current global feature extractor parameters based on the aggregated update information includes: The updated global feature extractor parameters are determined based on the aggregated update information and the global feature extractor parameters of the current round. The updated global feature extractor parameters do not include any noise generated by the server.

[0019] Optionally, before aggregating the differential update information from multiple clients, the method further includes: Anomaly detection is performed on the differential update information received from all clients to determine the mean vector and covariance matrix of all differential update information. Differential update information with Mahalanobis distance exceeding a preset quantile is removed, and only the differential update information that has not been removed is used for subsequent aggregation.

[0020] Optionally, after updating the current global feature extractor parameters based on the aggregated update information, the method further includes: When the L2 norm change of the aggregated update information in consecutive preset rounds is lower than the preset stopping threshold, global training is terminated early, and the current global feature extractor parameters are output as the final parameters, and subsequent rounds are not executed.

[0021] Thirdly, this application provides a personalized federated learning device for use on a client side, the device comprising: The first acquisition module is configured to acquire the first feature extractor parameters of the local feature extractor and the second classifier head parameters of the local classifier head. The first training module is configured to freeze the second classifier head parameters, train the first feature extractor parameters, and reparameterize the first feature extractor parameters during the training process to obtain the second feature extractor parameters. The first sparse processing module is configured to perform sparsification processing on the difference between the second feature extractor parameters and the first feature extractor parameters to obtain sparse update information, wherein the sparse update information is obtained by masking the difference. The differential privacy processing module is configured to perform differential privacy processing on the sparse update information to obtain differential update information, and then upload the differential update information to the server.

[0022] Fourthly, this application provides a personalized federated learning device for use on a server, the device comprising: The first receiving module is configured to receive differential update information from multiple clients during each round of global training. The aggregation module is configured to aggregate the differential update information from multiple clients to obtain aggregated update information; The first update module is configured to update the current global feature extractor parameters based on the aggregated update information to obtain the updated global feature extractor parameters. The updated global feature extractor parameters are obtained by multiplying the aggregated update information by a preset global learning rate and then adding the current global feature extractor parameters. The repeat execution module is configured to repeat the above steps until the preset global training rounds are reached, and the global feature extractor parameters of the global feature extractor are obtained.

[0023] Fifthly, this application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor, when executing a program stored in memory, implements the personalized federated learning method described in either the first or second aspect.

[0024] In a sixth aspect, this application provides a computer-readable storage medium storing a program for a personalized federated learning method, wherein when the program for the personalized federated learning method is executed by a processor, it implements the steps of the personalized federated learning method described in either the first or second aspect.

[0025] The beneficial effects of this invention are: This application embodiment reparameterizes the first feature extractor parameters of the local feature extractor and sparsifies the changes in the extractor parameters, making the obtained sparse update information highly sparsity. Combined with subsequent differential privacy processing, the amount of model parameter data uploaded to the server is compressed to the maximum extent while ensuring privacy and security, thus reducing the communication load. Attached Figure Description

[0026] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 A flowchart illustrating a personalized federated learning method provided in this application embodiment; Figure 2 for Figure 1 Flowchart of step S101; Figure 3 for Figure 2 Flowchart of step S202; Figure 4 for Figure 1 Flowchart of step S102; Figure 5 for Figure 4 Flowchart of step S401; Figure 6 for Figure 5The flowchart for obtaining the current sparsity rate in step S501; Figure 7 for Figure 5 The flowchart for obtaining the current hierarchical threshold of the local feature extractor in step S501; Figure 8 for Figure 4 Flowchart of step S402; Figure 9 for Figure 1 Flowchart of step S104; Figure 10 for Figure 9 Flowchart of step S902; Figure 11 A flowchart illustrating another personalized federated learning method provided in this application embodiment; Figure 12 A structural diagram of a personalized federated learning device provided in an embodiment of this application; Figure 13 A structural diagram of another personalized federated learning device provided in the embodiments of this application; Figure 14 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0030] Currently, federated learning (FL) has been introduced into the Internet of Vehicles (IoV) scenario as a distributed collaborative training paradigm. It allows each intelligent vehicle's onboard unit (OBU) to train a model locally using its own collected data, and only uploads the model parameters or gradient updates to the mobile edge computing node (MEC) or TSP platform for aggregation, thereby achieving multi-vehicle collaborative modeling without sharing the original data.

[0031] In real-world vehicle-to-everything (V2X) environments, the geographical environment, driving habits, and onboard sensor configurations (such as cameras, LiDAR, and millimeter-wave radar) of different vehicles often vary significantly, resulting in a typical non-independent and identically distributed (Non-IID) distribution of local data across different clients. Traditional federated learning uses a unified global model to aggregate parameters uploaded by each vehicle, which struggles to simultaneously adapt to the local data characteristics of all vehicles, leading to a significant performance drop in personalized tasks (such as recognizing lane-changing intentions of specific drivers). Therefore, Personalized Federated Learning (PFL) has become an important direction for improving the local adaptability of onboard models. The personalized federated learning method in the embodiments of this specification can customize a unique model for each client while protecting data privacy. In some embodiments, the personalized federated learning in the embodiments of this specification can solve the performance degradation problem of traditional federated learning when data distribution varies greatly. In some embodiments, the personalized federated learning in the embodiments of this specification allows clients to collaboratively train while retaining the uniqueness of their respective models, thereby better adapting to local data. Its goal is to enable the model to accurately fit the data distribution of individual vehicles while preserving cross-vehicle common knowledge.

[0032] On the other hand, due to the extremely limited wireless communication resources of vehicle terminals (such as cellular vehicle-to-everything (C-V2X) and dedicated short-range communication (DSRC) bandwidth), the frequent and complete interaction of model parameters during federated learning can lead to high communication loads, and in severe cases, even system unavailability. Therefore, this application provides a personalized federated learning method, apparatus, electronic device, and storage medium. Through a collaborative mechanism of dynamic reparameterization and adaptive norm constraints, it efficiently integrates multi-source sensor data (such as camera, LiDAR, and millimeter-wave radar perception data) and behavioral characteristics of the vehicle controller area network (CAN bus). Under strict differential privacy (DP) protection, it achieves an efficient balance between privacy and utility for personalized vehicle models, while significantly reducing communication load.

[0033] This application provides a personalized federated learning method applied to a client. The client can transmit data with a server, and the server constructs a federated learning system containing N clients. In some embodiments, the client is an intelligent connected vehicle equipped with an onboard computing unit. Each vehicle possesses locally collected driving data, including but not limited to environmental perception images, radar point clouds, GPS trajectories, and driving behavior data. The local dataset of each client is represented as follows: The data samples exhibit non-independent identical distribution characteristics, meaning that the differences in geographical environment, driving habits, and sensor configuration of different vehicles lead to significantly different data distributions.

[0034] The server initializes global model parameters and decouples the global model into two functionally independent components: global feature extractor parameters. and the first classifier head parameters The model as a whole can be represented as ,in `h` is the global feature extractor, used to map input data from different distributions to a common feature space; `h` is the classifier head, used to convert the data in the feature space into specific label outputs. Through this decoupled design, the global feature extractor is responsible for extracting common features across vehicles, while the classifier head is used to adapt to the local personalized needs of each vehicle.

[0035] The server will initialize the global feature extractor parameters. and the first classifier head parameters Distributed to the client set participating in this round of training via the vehicle-to-everything (V2X) communication module. Where the client sampling probability is q, i.e. .

[0036] Based on this, such as Figure 1 As shown, personalized federated learning methods applied to the client include: Step S101: Obtain the first feature extractor parameters of the local feature extractor and the second classifier head parameters of the local classifier head; In this embodiment, the first feature extractor parameter is a set of trainable weight values ​​set in each layer of the local feature extractor network on the client, and the second classifier head parameter is a set of trainable weight values ​​in each layer of the local classifier head network. The local feature extractor is used to map input data with different distributions to a common feature space, and the local classifier head is used to convert the data in the feature space into specific label outputs. The first feature extractor parameter is the initialized global feature extractor parameter received by the client from the server, and the second classifier head parameter is the classifier head parameter trained locally on the client.

[0037] In this step, the client receives the initialized global feature extractor parameters from the server as the first feature extractor parameters, and obtains the second classifier head parameters obtained after local personalized training of the local classifier head.

[0038] Step S102: Freeze the second classifier head parameters, train the first feature extractor parameters, and reparameterize the first feature extractor parameters during the training process to obtain the second feature extractor parameters. In this embodiment, freezing refers to keeping the parameters unchanged and not participating in gradient calculation. Reparameterization refers to dynamically selecting important parameters and generating a binary mask matrix based on the parameter values ​​in each round of local training, so that forward propagation is calculated only based on the selected sparse parameters, thereby reducing communication overhead and reducing the risk of insufficient model update effectiveness due to the use of differential privacy mechanisms in the later stages. The second feature extractor parameters are the feature extractor parameters finally obtained by the client after multiple rounds of local iterative training.

[0039] In this step, after client i completes the personalized training of the classifier head, it enters the second stage of local training: sparse update of the local feature extractor. During this stage, the client maintains the parameters of the second classifier head. If the parameters remain unchanged, freeze these parameters so that they do not participate in gradient calculation in subsequent updates. The client then enters the local feature extractor training phase, updates only the parameters of the first feature extractor, and introduces a reparameterization sparsity mechanism.

[0040] Step S103: The difference between the second feature extractor parameters and the first feature extractor parameters is sparsified to obtain sparse update information, which is obtained by masking the difference. In this embodiment, the sparse update information is a set of information containing only non-zero value positions in the difference between the second feature extractor parameters after training and the first feature extractor parameters initially received. The non-zero value positions are marked by the binary mask matrix determined in the final round of training.

[0041] In this step, the client calculates the difference between the parameters of the second feature extractor and the parameters of the first feature extractor, and applies the mask matrix of the final round to sparsify the difference. The difference corresponding to the position marked as zero in the mask matrix is ​​set to zero, while the difference corresponding to the position marked as one is retained, thus obtaining sparse update information.

[0042] Specifically, the local update information is calculated as the difference between the trained parameters and the initial received parameters, and the mask matrix of the final round is applied. Perform sparsification:

[0043] in, This represents the sparse update information finally calculated by client i in the t-th round of global training. This represents the feature extractor parameters (i.e., the parameters after training, which are the second feature extractor parameters) obtained by client i after τ rounds of local iterative training in the t-th round of global training. This represents the initial feature extractor parameters (i.e., the first feature extractor parameters) received by client i from the server at the start of the t-th round of global training. This is the final binary mask matrix determined after the τth round of local training.

[0044] The sparse update information has the following characteristics: (1) It only contains the sparse parameter positions retained after τ rounds of training, and the remaining positions are zero, which significantly reduces the amount of communication; (2) It uploads the difference form instead of the complete parameters, which further reduces the amount of information; (3) The mask matrix This reflects the final distribution of parameter importance after τ rounds of training.

[0045] Step S104: Perform differential privacy processing on the sparse update information to obtain differential update information, and upload the differential update information to the server.

[0046] In this embodiment, differential privacy processing includes pruning and noise addition operations. Pruning is used to limit the L2 norm of the updated information to a pruning threshold range, and noise addition is used to add Gaussian noise that satisfies differential privacy to the pruned updated information.

[0047] In this step, the client prunes the sparse update information, limiting its L2 norm to within the pruning threshold range. Gaussian noise that satisfies differential privacy is added to the pruned update information, with the noise only added to the parameter positions retained after sparsification, thus obtaining differential update information. After the client completes the model update perturbation, it uploads the differential update information to the server through the vehicle-to-everything (V2X) communication module for subsequent updates.

[0048] This application embodiment reparameterizes the first feature extractor parameters of the local feature extractor and sparsifies the changes in the extractor parameters, making the obtained sparse update information highly sparsity. Combined with subsequent differential privacy processing, the amount of model parameter data uploaded to the server is compressed to the maximum extent while ensuring privacy and security, thus reducing the communication load.

[0049] In another embodiment of this application, step S101 obtains the first feature extractor parameters of the local feature extractor and the second classifier head parameters of the local classifier head, such as... Figure 2 As shown, it includes: Step S201: Receive global feature extractor parameters and first classifier header parameters from the server; In this embodiment of the application, the first classifier header parameter is the classifier header parameter initialized by the server.

[0050] In this step, the client receives the first feature extractor parameters and the first classifier header parameters broadcast by the server through the vehicle network communication module, and loads the received parameters into the local model.

[0051] Step S202: Freeze the parameters of the first feature extractor, train the parameters of the first classifier head to obtain the parameters of the second classifier head; In this embodiment, the first feature extractor parameters are frozen and remain fixed during training and do not participate in gradient calculation. The training of the first classifier head parameters mainly includes forward propagation and loss calculation, backpropagation and gradient update, which are used to adapt the classifier head to the local data label distribution.

[0052] In this step, client i freezes the parameters of the first feature extractor. Preserve feature extractor parameters The parameters remain unchanged, are frozen, and do not participate in gradient calculation in subsequent updates. The first classifier head parameters are trained using only the local dataset to obtain the second classifier head parameters, so that the classifier head can better adapt to the label distribution of the local data. The second classifier head parameters are obtained after completing the preset local iteration rounds.

[0053] Step S203: Obtain the global feature extractor parameters to serve as the first feature extractor parameters of the local feature extractor; In this embodiment, the first feature extractor parameter is the initial feature extractor parameter received by the client from the server, which is frozen and unchanged during the classifier head training phase.

[0054] In this step, the client directly reads the first feature extractor parameters from the local model, which are the initial values ​​received from the server in step S201.

[0055] Step S204: Obtain the second classifier head parameter as the second classifier head parameter of the local classifier head.

[0056] In this embodiment of the application, the second classifier header parameter is the classifier header parameter obtained by the client after local training in step S202, and this parameter has been adapted to the local data distribution.

[0057] In this step, the client reads the classifier header parameters obtained after training in step S202 and uses them as the second classifier header parameters.

[0058] This embodiment of the application freezes the parameters of the first feature extractor and performs local training on the local classifier head. Then, the global feature extractor parameters and the trained classifier head parameters are used as the first feature extractor parameters and the second classifier head parameters, respectively. This achieves personalized adaptation of the classifier head parameters before training, providing a fixed personalized evaluation standard for subsequent feature extractor training. This ensures that the local feature extractor is optimized under the fixed Benley classifier head parameter evaluation standard, avoiding training direction deviation caused by mutual interference between the local feature extractor and the local classifier head.

[0059] In another embodiment of this application, step S202 freezes the first feature extractor parameters, trains the first classifier head parameters, and obtains the second classifier head parameters, such as... Figure 3 As shown, it includes: Step S301: Freeze the parameters of the first feature extractor; In this embodiment, freezing refers to setting the parameters to a state where they do not participate in gradient calculation. During backpropagation, the gradient of this part is truncated, and the parameter value remains unchanged.

[0060] In this step, the client sets the requires_grad attribute of the first feature extractor parameter to False, so that the feature extractor parameter is not updated in subsequent gradient calculations.

[0061] Step S302: Randomly sample from the local dataset to obtain the first data; In this embodiment of the application, the local dataset This is a set of labeled training samples stored locally on the client side. The first data is a mini-batch of data B obtained by random sampling from this dataset.

[0062] In this step, the client retrieves data from the local dataset. Randomly sample a small batch of data B to obtain a set containing multiple input samples x and their corresponding labels as the first data.

[0063] Step S303: Input the first data into the local feature extractor so that the local feature extractor outputs a feature representation; In this embodiment, the local feature extractor is used to map the input data to a common feature space, and the feature is represented as a high-dimensional feature vector output by the feature extractor after the input data passes through it.

[0064] In this step, the client inputs the input sample x from the first dataset into the feature extractor. The feature extractor uses the parameters of the first feature extractor to perform forward computation and outputs the corresponding feature representation.

[0065] Step S304: Input the feature representation into the local classifier head to obtain the prediction result. In the first iteration, the current classifier head parameters of the local classifier head are determined according to the first classifier head parameters. In this embodiment of the application, the local classifier head It is used to convert data in the feature space into specific category outputs, and the prediction result is the model's inference of the category to which the input sample belongs.

[0066] In this step, the client inputs the feature representation output by the feature extractor into the local classifier head. The classifier head uses the current classifier head parameters to perform forward calculations and outputs the corresponding prediction results.

[0067] Step S305: Determine the loss value between the prediction result and the training label, wherein the training label corresponds to the first data; In this embodiment, the training label is the true category label corresponding to the input sample in the first data, and the loss value is the difference between the prediction result calculated using the cross-entropy loss function and the training label.

[0068] In this step, the client uses the cross-entropy loss function to calculate the loss value between the predicted result and the corresponding training label y in the first data. This loss value measures the gap between the model prediction and the true answer.

[0069]

[0070] in, Let B be the loss function, x be the input sample, y be the training label, and B be the current batch of data. For feature extractors, For the classifier head, For initializing the feature extractor parameters, This refers to the current classifier header parameters for client i.

[0071] Step S306: Update the gradient of the current classifier head parameters of the local classifier head according to the loss value to obtain intermediate classifier head parameters, which are used as the current classifier head parameters in the next round of local training. Repeat the step of randomly sampling from the local dataset to obtain the first data until the preset local iteration round is completed to obtain the second classifier head parameters.

[0072] In this embodiment, gradient update refers to the process of calculating the gradient based on the loss value and adjusting the parameters along the gradient descent direction. The preset local iteration rounds are the preset number of local training rounds for the local classifier head.

[0073] In this step, the client adjusts the classifier header parameters based on the loss value. Perform gradient updates, with the update formula as follows:

[0074] in, For the classifier head learning rate, Represents the loss function for the classifier head. Calculate the gradient, and repeat steps S302 to S306 until the preset local iteration rounds are completed to obtain the second classifier head parameters.

[0075] This embodiment of the application freezes the parameters of the local feature extractor, randomly samples data from the local dataset, and sequentially performs forward propagation calculations on the local feature extractor and the local classifier head to calculate the prediction results. Then, it calculates the loss value between the prediction results and the labels and updates the gradient of the local classifier head until the preset local iteration rounds are completed. This achieves accurate adaptation of the local classifier head to the local data distribution without interference from the local feature extractor, and enables the local classifier head to fully fit the local personalized features.

[0076] In another embodiment of this application, step S102 trains the first feature extractor parameters. During the training process, the first feature extractor parameters are reparameterized to obtain the second feature extractor parameters, such as... Figure 4 As shown, it includes: Step S401: In each round of local training, obtain the current layer threshold of the feature extractor and obtain the current sparsity rate; In this embodiment, the current sparsity rate is used to indicate the proportion of non-zero parameters in the feature extractor, and the layer threshold is the boundary of network layer numbers used to distinguish between shallow and deep layers of the feature extractor.

[0077] In this step, the client obtains the current sparsity rate S, which is dynamically calculated based on the channel state and computing resources, and obtains the current layering threshold, which is dynamically adjusted based on the current driving scenario.

[0078] Step S402: Determine the sparsity parameters used in this round of forward propagation based on the current layering threshold and the current sparsity rate; In this embodiment, the sparse parameters used in forward propagation are a set of weights that have been reparameterized, retaining only the positions of important parameters, while the positions of non-important parameters are set to zero and do not participate in the forward calculation.

[0079] In this step, the client determines a binary mask matrix based on the current feature extractor parameters in each round of local training. The mask matrix is ​​then applied to the current complete parameter tensor to obtain a sparse parameter set containing only the retained important parameters, which is used for the calculation of the forward propagation in this round.

[0080] Step S403: Determine the regularization term based on the current feature extractor parameters and the first feature extractor parameters; In this embodiment, the regularization term is a dynamic adaptive norm constraint regularization term, which is used to control the L2 norm of the difference between the current parameter and the initial parameter to approach the pruning threshold.

[0081] In this step, the client calculates the difference between the current feature extractor parameters and the first feature extractor parameters, calculates the difference between the L2 norm of this difference and the pruning threshold, and uses this difference as a regularization term. The regularization term causes the norm of the updated information to dynamically remain near the pruning threshold.

[0082] Step S404: Perform forward propagation using the local dataset based on the sparse parameters, and calculate the task loss according to a preset loss function, wherein the preset loss function includes the regularization term; In this embodiment, the task loss is the classification loss between the model prediction result and the true label, and the preset loss function is composed of the task loss and the regularization term.

[0083] In this step, the client uses the sparse parameters obtained in step S401 as the parameters of the feature extractor for forward propagation, calculates the classification loss between the model prediction result and the training label as the task loss, and then adds the task loss to the regularization term determined in step S402 to obtain the preset loss function value.

[0084] A dynamic adaptive norm constraint regularization term is introduced. After introducing the regularization term, the model's loss function is as follows:

[0085] in, This is the total loss value. For the entire local dataset of client i, For the loss function, For feature extractors, For the classifier head, For the first Input data for each sample, Let i be the current feature extractor parameters during the t-th round of global training and the s-th round of local training. Let C be the initial feature extractor parameters received by client i from the server, λ be the preset pruning threshold, λ be the regularization coefficient, and B be the current batch of data. The loss function consists of two parts: the first part is the task loss, ensuring the model's classification performance on local data; the second part is the regularization term, which calculates the difference between the L2 norm of the difference between the current parameters and the initial parameters and the pruning threshold C. This regularization term keeps the norm of the updated information dynamically close to C: when the update norm is too large, the regularization term penalizes it, forcing the model to converge towards a direction that reduces the update norm; when the update norm is too small, the regularization term also penalizes it, encouraging the model to perform updates over a wider range. This dynamic adjustment mechanism allows the norm of the updated information to naturally adapt to the pruning threshold, thereby reducing information loss caused by subsequent forced pruning.

[0086] This scheme uses a sparsity-based approach to train the model. Therefore, directly approximating the difference between the model parameters in each round and the initial model parameters with the pruning threshold is unreasonable. To address this, this scheme utilizes the dynamic mask of the current round when calculating the difference. Further calculations are performed, and the pruning threshold is approximated using the model parameters actually used in each round of training. The loss function of the model is then as follows:

[0087] Step S405: Perform backpropagation according to the preset loss function to obtain the intermediate feature extractor parameters, which will be used as the current feature extractor parameters in the next round of local training. In this embodiment, the intermediate feature extractor parameters are the feature extractor parameters updated after backpropagation in the current round. These parameters are updated on the complete parameter tensor rather than just on the sparse subset.

[0088] In this step, the client performs backpropagation based on a preset loss function, calculates the gradient, updates the parameters on the complete feature extractor parameter tensor, and obtains intermediate feature extractor parameters, which are used as the current feature extractor parameters in the next round of local training.

[0089] The updated formula is:

[0090] in, Let be the updated feature extractor parameters for client i during the t-th round of global training and the (s+1)-th round of local training. Let i be the current feature extractor parameters during the t-th round of global training and the s-th round of local training. The learning rate for the feature extractor. For loss function Regarding feature extractor parameters The gradient. It is worth noting that although the gradient calculation is based on the sparsified parameters... However, parameter updates are performed on the complete parameter tensor, and the mask matrix only affects the path of gradient backpropagation.

[0091] Step S406: Repeat the above steps until the preset local training rounds are reached to obtain the parameters of the second feature extractor.

[0092] In this embodiment of the application, the preset local training rounds are the number of local training iterations of the local feature extractor.

[0093] In this step, the client repeats steps S401 to S404 until the preset local training rounds τ are completed. The client i then obtains the final feature extractor parameters. As a parameter of the second feature extractor.

[0094] This application embodiment obtains sparse parameters and determines regularization terms in each round of local training, then combines the sparse parameters to perform forward propagation to calculate the task loss containing the regularization terms and performs backpropagation to update the complete parameter tensor. This achieves dynamic reparameterization training that filters important parameters while training and updates the magnitude to match the pruning threshold, enabling the training process to proactively adapt to subsequent differential privacy pruning requirements and reduce information loss.

[0095] In another embodiment of this application, step S402 determines the sparsity parameters used in the current forward propagation based on the current layering threshold and the current sparsity rate, such as... Figure 5 As shown, it includes: Step S501: Obtain the current parameters of each layer of the local feature extractor; In this embodiment, the current parameters of each layer are the set of weight values ​​of each layer of the local feature extractor network.

[0096] In this step, the client reads the current parameter values ​​of each layer of the local feature extractor network.

[0097] Step S502: Determine the binary mask matrix based on the current layer parameters and the sparsity rate; In this embodiment, the binary mask matrix is ​​a binary tensor of the same type as the feature extractor parameters, with each element having a value of one or zero, used to mark whether the parameters are retained for forward propagation.

[0098] In this step, for each layer of the local feature extractor, the client sorts the parameters of each layer by absolute value, selects the parameter with the largest absolute value and the current sparsity ratio S, marks it as 1 as the reserved parameter, and marks the remaining positions as 0, resulting in a binary mask matrix M^(s), where s represents the local training epoch, and its elements are defined as follows:

[0099] Where t represents the global training round, Let be all the current parameters of the feature extractor at the t-th round of global training, s represent the local training round, and Topk represent the operation of selecting the top k parameters after sorting by their absolute values. This mechanism ensures that the parameters retained in each training round are those that contribute the most to the model at that time.

[0100] Step S503: Determine the sparse parameters used in this round of forward propagation based on the current layer threshold, the binary mask matrix, and the current layer parameters.

[0101] In this embodiment, the sparse parameters are the set of parameters used for forward propagation after the parameters of each layer have undergone hierarchical differential sparsification processing. Shallow layer parameters are fully retained, while deep layer parameters are retained after being filtered by a binary mask matrix.

[0102] In this step, the client retains all parameters of the current layer in the first layer threshold layer of the local feature extractor without sparsification. For the deep network above the layer threshold, the current layer parameters are multiplied element-wise with the binary mask matrix, and the parameters marked as zero are set to zero to obtain the sparse parameters used in this round of forward propagation.

[0103] The sparse parameters used in actual forward propagation are represented as follows:

[0104] in, For client i, these are the sparse parameters actually used for forward propagation in round t of global training and round s of local training. This represents the parameters of the local feature extractor at layer j for the i-th client. The elements of the mask matrix for the corresponding layer are represented by ⊙, which indicates element-wise multiplication. This layered processing preserves the ability of the local feature extractor to extract general features at the shallow level while achieving efficient sparsity of deep parameters, effectively reducing communication overhead. Furthermore, when adding noise using differential privacy later, it effectively reduces noise levels, thus ensuring the validity of the model parameters.

[0105] This application embodiment obtains the sparsity rate, current layer parameters, and layer threshold, then determines a binary mask matrix for each layer and retains the deep layer application mask in full for the shallow layer according to the layer threshold. This achieves layer-specific sparsity processing, which retains the general feature extraction capability of the shallow layer while reducing the communication volume of the deep layer.

[0106] In another embodiment of this application, step S501, which involves obtaining the current sparsity rate, is as follows: Figure 6 As shown, it includes: Step S601: Obtain the current channel quality data, calculate the resource load factor, preset minimum sparsity rate, and preset maximum sparsity rate; In this embodiment, the channel quality data is a measurement value reflecting the current quality of the vehicle network communication link, the computing resource load factor is a normalized value reflecting the current load level of the vehicle computing unit, and the preset minimum sparsity rate and preset maximum sparsity rate are pre-set boundary values ​​of the allowable range of sparsity rate.

[0107] In this step, to ensure the algorithm adapts to the complex scenarios on the vehicle side and thus efficiently implements the federated learning algorithm, the client (intelligent connected vehicle) obtains current channel quality data (such as RSRP, CQI, signal strength, bandwidth fluctuation, etc.) in real time through the vehicle network communication module before each round of local training. It also monitors the current computing resource load through the vehicle operating system and normalizes it into a load factor (such as CPU / GPU utilization, remaining battery power, etc.), and reads the pre-set minimum sparsity rate and maximum sparsity rate.

[0108] Step S602: Determine the channel quality factor based on the channel quality data; In this embodiment, the channel quality factor is a normalized value that maps channel quality data to the interval between zero and one. The larger the value, the better the communication conditions.

[0109] In this step, the client transforms the real-time acquired channel quality data to the [0, 1] interval using a mapping function to obtain the channel quality factor. Channel quality factor The value increases as signal strength increases and bandwidth fluctuation decreases.

[0110] Step S603: Determine the load factor based on the computational resource load factor; In this embodiment of the application, the load factor is the factor that normalizes the load of the computing unit to a certain value. The larger the value in the interval [0,1], the more scarce the computing resources are.

[0111] In this step, the client normalizes the current computing unit load to obtain a load factor, which changes with CPU utilization and remaining power.

[0112] Step S604: Determine the current sparsity rate based on the channel quality factor, the load factor, the preset minimum sparsity rate, and the preset maximum sparsity rate.

[0113] In this embodiment, the current sparsity rate is obtained by linearly mapping the combined score of the channel quality factor and the load factor to a preset minimum sparsity rate and a preset maximum sparsity rate.

[0114] In this step, the client calculates the current sparsification rate S for the current round of training using the following formula:

[0115] where, and are the preset minimum and maximum sparsification rates (e.g., 0.01 and 0.9), respectively, ∈[0,1] is the weight coefficient affected by the load, which can be calibrated according to actual scenarios. In this formula, directly reflects the positive incentive of channel quality, represents the negative suppression of computational load, the two are multiplied to obtain a comprehensive score, and finally the sparsification rate is linearly mapped to the allowable range. When the channel quality is excellent and computational resources are sufficient, S approaches , retaining more model parameters to improve accuracy; when the channel deteriorates or the computational load is too high, S adaptively decreases to close to , significantly reducing the number of uploaded parameters, so as to achieve a dynamic balance between communication efficiency and model performance.

[0116] This mechanism enables vehicles to automatically reduce the sparsification rate to lower the number of uploaded parameters when communication conditions are harsh or resources are limited, and appropriately increase the sparsification rate to retain more model information when the channel is good and computing power is sufficient, thereby realizing adaptive optimization of communication load and computational load on the premise of ensuring model convergence performance and privacy protection strength.

[0117] The embodiments of the present application determine the channel quality factor and the load factor respectively by acquiring channel quality data and computational resource load factors, and then determine the current sparsification rate in combination with the preset minimum and maximum sparsification rates, realizing dynamic adaptive adjustment of the sparsification rate according to real-time communication conditions and computational load, so that the number of uploaded parameters matches the current Internet of Vehicles environment.

[0118] Considering the inherent characteristics of deep neural networks, shallow networks are mainly responsible for extracting general low-level features such as edges and textures, which have high commonality among different vehicles; deep networks are responsible for extracting high-level features such as semantics and object categories, which better reflect personalized information. Based on this analysis, the present invention adopts a differentiated sparsification strategy for different layers of the local feature extractor, so as to maximize personalized features while retaining global commonality.

[0119] Assume that the local feature extractor has a total of L layers, and a layer threshold k (0<k<L) is set. For the first k layers (shallow layers), which are considered to contain more global common information, all parameter information is retained without sparsification; for the k-th layer and above (deep layers), a mask matrix is applied for parameter selection, and only the parts most important to the local task are retained.

[0120] Specifically, in another embodiment of this application, step S501 obtains the current hierarchical threshold of the local feature extractor, such as... Figure 7 As shown, it includes: Step S701: Obtain the current driving scenario data; In this embodiment of the application, the driving scenario data is category information reflecting the current driving environment of the vehicle, including highway scenarios, complex urban road scenarios, and tunnel scenarios.

[0121] In this step, the client perceives the current driving environment and driving status in real time through onboard sensors and navigation information, and obtains driving scenario data by identifying the category of the scene.

[0122] Step S702: Obtain the threshold adjustment strategy corresponding to the driving scenario data; In this embodiment, the threshold adjustment strategy is a predefined sparsity adjustment rule for different driving scenarios, used to determine the retention ratio of the shallow network during the sparsification process.

[0123] In this step, the client matches the corresponding threshold adjustment strategy based on the identified driving scenario data, and different driving scenarios correspond to different degrees of shallow network sparsity.

[0124] Step S703: Adjust the initial stratification threshold according to the threshold adjustment strategy to obtain the current stratification threshold.

[0125] In this embodiment of the application, the initial stratification threshold is a preset default stratification limit value, and the current stratification threshold is a stratification limit value adjusted according to the driving scenario.

[0126] In this step, the client dynamically adjusts the initial layering threshold according to the threshold adjustment strategy. When the scene is identified as a highway with strong commonality, the layering threshold is reduced to increase the shallow sparsity. When the scene is identified as a complex urban road with prominent personalized needs, the layering threshold is increased to retain more low-level feature extraction capabilities.

[0127] The hierarchical sparsity strategy in this application breaks through the traditional static setting and innovatively introduces a dynamic adaptive mechanism based on vehicle driving scenarios. Specifically, the client perceives the current driving environment and driving status in real time, and identifies the scene category, such as highway, complex urban roads, or tunnels, through onboard sensors (such as cameras and radar) and navigation information (such as high-precision maps and GNSS). Based on this, the hierarchical sparsity threshold of the local feature extractor is adaptively adjusted: when the scene is identified as a highway or other common scene, the system automatically increases the sparsity of the shallow network and compresses the parameters of the general feature extraction layer to maximize communication efficiency because the driving modes and environmental perception tasks between vehicles are highly similar. When the scene is identified as a complex urban road or other scene with prominent personalized needs, the system reduces the sparsity of the shallow network and retains more low-level feature extraction capabilities to enhance the model's generalization performance in complex environments. Through this scene-driven dynamic adjustment of hierarchical sparsity, this invention achieves an adaptive balance between communication efficiency and personalized modeling capabilities under different driving environments.

[0128] This application embodiment adjusts the initial layering threshold by acquiring driving scenario data and matching the corresponding threshold adjustment strategy. This achieves dynamic adaptation of the layering sparsity strategy according to the driving scenario, maximizing communication efficiency in common scenarios and enhancing model generalization performance in individual scenarios.

[0129] To control the norm space of the model update, adapt it to subsequent differential privacy pruning operations, and reduce information loss caused by pruning, in another embodiment of this application, step S402 determines a regularization term based on the current feature extractor parameters and the first feature extractor parameters, such as... Figure 8 As shown, it includes: Step S801: Determine the L2 norm of the difference between the current feature extractor parameters and the first feature extractor parameters; In this embodiment, the L2 norm is the square root of the sum of squares of the elements of the vector, used to measure the Euclidean distance between the current parameters and the initial parameters.

[0130] In this step, the client calculates the difference between the current feature extractor parameters and the first feature extractor parameters, and then calculates the L2 norm of the difference, which reflects the magnitude of the update of the current parameters relative to the initial parameters.

[0131] Step S802: Obtain the clipping threshold; In this embodiment, the pruning threshold is a preset value used to limit the upper bound of the L2 norm of the updated information, which is used for subsequent differential privacy pruning operations.

[0132] In this step, the client reads the preset clipping threshold C, which is set during system initialization.

[0133] Step S803: Determine the regularization term based on the L2 norm and the pruning threshold.

[0134] In this embodiment, the regularization term is the absolute value of the difference between the L2 norm and the pruning threshold, which is used to encourage the updated norm to move closer to the pruning threshold during training.

[0135] In this step, the client calculates the difference between the L2 norm obtained in step S801 and the clipping threshold obtained in step S802 and takes the absolute value. This difference value is used as a regularization term. When the update norm is too large or too small, this regularization term will be penalized.

[0136] This application embodiment calculates the L2 norm of the difference between the current parameter and the initial parameter, obtains the pruning threshold, and then calculates the difference between the two as a regularization term. This realizes dynamic constraint on the update norm during training, so that the update magnitude is adapted to the pruning threshold in advance, reducing the information loss caused by subsequent differential privacy pruning.

[0137] To ensure privacy and security during the upload process, the client performs differential privacy processing on the sparsed update information. In another embodiment of this application, step S104 performs differential privacy processing on the sparse update information to obtain differential update information, such as... Figure 9 As shown, it includes: Step S901: Prune the sparse update information based on the pruning threshold to obtain pruning information; In this embodiment, the pruning information is the information obtained by limiting the L2 norm of the sparse update information to within the pruning threshold range. The pruning operation is used to control the sensitivity of a single update to the final result.

[0138] In this step, the client calculates the L2 norm of the sparse update information. If the norm is greater than the pruning threshold, the sparse update information is scaled proportionally so that its L2 norm equals the pruning threshold. If the norm is not greater than the pruning threshold, the original value is retained, and the pruned information is obtained.

[0139] In practical applications, sparse information can be updated. Perform cropping to restrict its L2 norm to within the cropping threshold C. The specific formula is as follows:

[0140] in, This represents the pruned update information (pruning information) for client i during the t-th round of global training.

[0141] Step S902: Add Gaussian noise that satisfies differential privacy to the clipping information to obtain the differential update information.

[0142] In this embodiment, Gaussian noise is random noise that follows a Gaussian distribution. Gaussian noise is added to protect the privacy content in the updated information.

[0143] In this step, the client determines the noise scale based on the privacy budget, generates Gaussian noise based on the noise scale, and adds it to the pruning information to obtain differential update information.

[0144] Traditional differential privacy applied to federated learning introduces excessive noise, potentially causing the final model to fail to converge. To address this, this method introduces the more adaptive Rayleigh differential privacy, given a real number... ∈(1,∞) and privacy parameters ≥0. If any adjacent dataset D, With only one distinct record, the random algorithm M satisfies Then Ruili divergence and satisfy:

[0145] in, The order of the Rayleigh divergence is used to measure the difference between two probability distributions. This method adds noise to the model output, which depends on the sensitivity of the model to the updated data; therefore, the local update information is pruned before adding noise. The sensitivity involved here is defined as follows: if F is a function, its sensitivity is... The maximization is performed on all adjacent dataset pairs.

[0146] Update information after cropping Add Gaussian noise that satisfies Renyi differential privacy to obtain the final uploaded update information:

[0147] in, For client i, after cropping and adding noise during the t-th round of global training, the differential update information is finally uploaded to the server. Indicates the Gaussian noise distribution. To update the dimension of the vector, Let q be the noise scale, N be the client sampling probability, N be the total number of clients, and C be the pruning threshold. Noise is only added to the parameter positions retained after sparsification (i.e., the mask matrix). (corresponding position), further reducing the impact of noise on model performance.

[0148] This application embodiment achieves differential privacy protection by pruning sparse update information using a pruning threshold and then adding Gaussian noise. Pruning limits the sensitivity of a single update, and adding noise further obscures individual contributions in the update information, effectively resisting member inference attacks and gradient leakage attacks.

[0149] Recent studies have shown that attackers can back-infer the original data by analyzing model gradients, thus launching Membership Inference (MIA) or Gradient Leakage (GL) attacks. This necessitates the introduction of strong privacy protection mechanisms such as Differential Privacy (DP) before parameter uploading. However, existing Differential Privacy Federated Learning methods typically add random noise (such as Gaussian noise) to the gradients to provide privacy guarantees, which inevitably reduces model accuracy. In another embodiment of this application, step S902 adds Gaussian noise that satisfies differential privacy to the pruning information to obtain the differential update information, such as... Figure 10 As shown, it includes: Step S1001: Obtain the autonomous driving level; In this embodiment of the application, the autonomous driving level is a classification of the autonomous driving capabilities of the vehicle, including Level 2 assisted driving vehicles, Level 3 conditional autonomous driving vehicles, and Level 4 highly autonomous driving vehicles.

[0150] In this step, the client reads the autonomous driving level label stored in the vehicle system, which is set when the vehicle leaves the factory or when the system is configured.

[0151] Step S1002: Determine the differential privacy strength based on the autonomous driving level; In this embodiment, differential privacy strength is the magnitude of privacy protection, characterized by the privacy budget epsilon; the smaller the privacy budget, the greater the protection strength.

[0152] In this step, the client obtains the corresponding privacy budget from the preset privacy budget range according to the level of autonomous driving. Level 4 highly automated vehicles are allocated a smaller privacy budget, which means adding stronger noise, while Level 2 assisted driving vehicles are allocated a larger privacy budget, which means adding weaker noise.

[0153] Step S1003: Determine the sensitivity of the model update data based on the differential privacy strength; In this embodiment, the sensitivity is the upper bound of the output difference of the function on all adjacent dataset pairs, used to determine the scale of adding noise.

[0154] In this step, the client determines the sensitivity based on the differential privacy strength, and the sensitivity, together with the privacy budget, determines the scale parameter of the Gaussian noise.

[0155] Step S1004: Based on the sensitivity, add Gaussian noise that satisfies differential privacy to the cropping information to obtain the differential update information.

[0156] In this embodiment, the scale of the Gaussian noise is determined by both the clipping threshold and the sensitivity, and the noise is only added to the parameter positions retained after sparsification.

[0157] In this step, the client determines the scale of the Gaussian noise based on the sensitivity, generates Gaussian noise and adds it to the clipping information to obtain differential update information. The differential update information after adding noise meets the differential privacy protection requirements.

[0158] This application introduces a differentiated privacy budget allocation mechanism that uses the vehicle's autonomous driving level (L2, L3, L4) as a crucial basis for dynamically adjusting the strength of differential privacy. Specifically, the system pre-sets different privacy budget ranges for vehicles with different safety levels: for L4 highly automated vehicles, the collected data involves more complex driving decisions and high-precision environmental perception, facing stricter data security regulations. Therefore, a smaller privacy budget ε (i.e., adding stronger noise) is allocated to ensure that individual driving behavior cannot be reconstructed even under extreme attacks. For L2 assisted driving vehicles, the data sensitivity is relatively low, so the privacy budget ε can be appropriately relaxed to reduce noise injection, thereby retaining more effective gradient information to improve the convergence speed and final accuracy of the federated learning model. In each round of local updates, the vehicle automatically loads the corresponding pruning threshold and noise scale parameters according to its own safety level label, achieving an adaptive balance between privacy protection strength and model performance while meeting compliance requirements.

[0159] This application embodiment obtains the autonomous driving level and determines the differential privacy strength based on the level, then determines the sensitivity, and adds Gaussian noise based on the sensitivity to achieve differentiated privacy budget allocation, enabling vehicles of different safety levels to achieve an adaptive balance between privacy protection strength and model performance while meeting compliance requirements.

[0160] In another embodiment of this application, a personalized federated learning method is also provided, applied to the server side, such as... Figure 11 As shown, the method includes: Step S1101: During each round of global training, receive differential update information from multiple clients; In this embodiment, the differential update information is the sparse update information of the local feature extractor of the client after differential privacy protection, and the multiple clients are the set of clients sampled by the server to participate in training in the current round.

[0161] In this step, the server receives differential update information uploaded by each client in the set of clients participating in training during the current global training round t.

[0162] Step S1102: Aggregate the differential update information from multiple clients to obtain aggregated update information; In this embodiment of the application, the aggregated update information is the comprehensive update information obtained by weighted averaging of the differential update information from multiple clients.

[0163] In this step, the server performs a weighted average aggregation of the differential update information received from all clients to obtain aggregated update information.

[0164] Each client will update the sparse information after differential privacy protection. Uploaded to the server. The server aggregates update information from all participating clients in this round, obtaining aggregated update information.

[0165] Step S1103: Update the current global feature extractor parameters based on the aggregated update information to obtain the updated global feature extractor parameters. The updated global feature extractor parameters are obtained by multiplying the aggregated update information by a preset global learning rate and then superimposing the current global feature extractor parameters. In this embodiment, the global feature extractor parameters are feature extractor parameters maintained on the server side and updated by aggregating update information.

[0166] In this step, the server superimposes the current global feature extractor parameters with the aggregated update information according to the global learning rate to obtain the updated global feature extractor parameters.

[0167] The server updates the global feature extractor parameters based on the aggregated update information according to the following formula:

[0168] in, These are the parameters of the global feature extractor after the t-th round of global training. These are the parameters of the global feature extractor after the (t-1)th round of global training. The global learning rate, This refers to the set of clients participating in this round of training. This refers to the differential update information uploaded by client i during the t-th round of global training.

[0169] Step S1104: Repeat the above steps until the preset global training rounds are reached to obtain the global feature extractor parameters.

[0170] In this embodiment of the application, the preset global training rounds are the upper limit of the number of communication rounds between the server and the client.

[0171] In this step, the server repeatedly executes steps S1101 to S1103 until the preset global training round T is reached, and finally obtains the global feature extractor parameters. Each client can complete local inference tasks based on the global feature extractor parameters and the local personalized classifier parameters.

[0172] This application embodiment receives differential update information from multiple clients in each round of global training, aggregates it, and then updates the parameters of the global feature extractor until a preset number of global training rounds are reached. This realizes the aggregation of sparse update information with differential privacy protection uploaded by the client on the server side. While summarizing common knowledge across vehicles, it ensures the privacy and security of each client. The final global feature extractor can be combined with the classifier head stored locally by each client to complete the local inference task.

[0173] In another embodiment of this application, the aggregation of differential update information from multiple clients to obtain aggregated update information includes: The differential update information from multiple clients is aggregated by weighted average to obtain the aggregated update information. The aggregation weight of each client is proportional to the number of samples in the local dataset in which the client participated in training. The aggregated update information does not undergo any server-side differential privacy processing.

[0174] In this step, the server obtains the differential update information uploaded by each client participating in the training round, reads the number of samples in the local dataset corresponding to each client, determines the aggregation weight of each client based on the proportion of samples in the dataset, multiplies the differential update information of each client by its corresponding aggregation weight, and sums the results to obtain a weighted average aggregation result as the aggregation update information. After completing the weighted average aggregation, the server directly uses the aggregation update information to update the global feature extractor parameters, without adding any noise generated by the server or performing any other differential privacy processing on the aggregation update information.

[0175] This application embodiment uses weighted average aggregation based on aggregation weights, enabling clients with larger local data volumes to contribute more to global model updates. At the same time, the aggregated update information does not undergo server-side differential privacy processing, avoiding additional damage to model accuracy caused by secondary noise addition on the server side. This achieves effective aggregation of the global model while maintaining the differential privacy protection strength of each client.

[0176] In another embodiment of this application, the updated global feature extractor parameters do not include any noise generated by the server.

[0177] In this step, the server uses the aggregated update information as the update direction for the global feature extractor parameters, and directly multiplies the aggregated update information by the global learning rate and adds the global feature extractor parameters of the current round to obtain the updated global feature extractor parameters.

[0178] This embodiment of the application multiplies the aggregated update information by the global learning rate and then adds it to the current global feature extractor parameters without adding any server-side noise. The privacy protection of each client relies entirely on the differential privacy processing performed by each client before uploading, avoiding the additional damage to the model accuracy caused by the server-side secondary noise addition. This allows the global feature extractor to maintain the model's utility without being interfered with by server-side noise while aggregating the effective update information from each client.

[0179] In another embodiment of this application, before aggregating the differential update information from multiple clients, the method further includes: Anomaly detection is performed on the differential update information received from all clients. The mean vector and covariance matrix of all differential update information are calculated. Differential update information with Mahalanobis distance exceeding a preset quantile is removed. Only the differential update information that has not been removed is used for subsequent aggregation.

[0180] In this step, before aggregation, the server performs anomaly detection on all received differential update information uploaded by clients. First, it calculates the mean vector and covariance matrix of all differential update information. Then, it calculates the Mahalanobis distance of each client's differential update information relative to these mean vector and covariance matrix. Differential update information with a Mahalanobis distance exceeding a preset quantile is identified as anomaly and removed. After completing anomaly detection and removal, the server only uses the non-removed differential update information for subsequent weighted average aggregation; differential update information from removed clients does not participate in this round of aggregation.

[0181] This application embodiment performs anomaly detection based on Mahalanobis distance on the differential update information uploaded by the client, uses the mean vector and covariance matrix to capture the complex correlation between update information and removes abnormal update information whose Mahalanobis distance exceeds a preset quantile, effectively resisting the negative impact of malicious client poisoning attacks and poor-quality updates uploaded by abnormal clients on the global model, and enhancing the robustness and security of the federated learning system.

[0182] In another embodiment of this application, after updating the current global feature extractor parameters based on the aggregated update information, the method further includes: When the L2 norm change of the aggregated update information in consecutive preset rounds is lower than the preset stopping threshold, global training is terminated early, and the current global feature extractor parameters are output as the final parameters, and subsequent rounds are not executed.

[0183] In this step, after the server completes the global feature extractor parameter update in each round, it calculates the L2 norm of the aggregated update information in this round and compares it with the L2 norm of the aggregated update information in the previous round to obtain the change. When the change in consecutive preset rounds is lower than the preset stopping threshold, it is determined that the model has converged and the global training is terminated in advance.

[0184] This application embodiment monitors the change in the L2 norm of the aggregated update information after each round of updates. When the change in the L2 norm is lower than a preset stopping threshold for a consecutive preset number of rounds, the training is terminated in advance. This avoids the communication load and computational resource waste caused by continuing meaningless iterations after the model has converged in fixed rounds of training.

[0185] The following are implementation examples of the present invention with specific experimental settings to further illustrate the feasibility and effectiveness of the present invention.

[0186] Datasets and Models This embodiment uses three public datasets: EMNIST (handwritten character recognition) and CIFAR-10 (10-class color images). The model uniformly adopts the ResNet20 architecture, decoupled into a feature extractor and a classifier head. The partitioning of each dataset is as follows: EMNIST: Divided into 20 clients, each client has samples of different categories, simulating a non-independent and identically distributed scenario.

[0187] CIFAR-10: Divided into 20 clients, with each client's data distributed according to a Dirichlet distribution (…). =0.5) generated.

[0188] Baseline methods: The following four representative methods were selected for comparison: DP-FedAvg-fb: A variant of the traditional DP-FedAvg, where the client locally fine-tunes the classifier head using data.

[0189] PPSGD: Enhances the personalization performance of local models through additive models.

[0190] PMTL-FT: A multi-task learning method based on differential privacy, which achieves personalization through fine-tuning.

[0191] CENTAUR: A Differential Privacy Personalized Federated Learning Method Based on FedRep.

[0192] The execution process, taking the CIFAR-10 dataset as an example, involves the following specific steps: Initialization: The server initializes the ResNet20 model parameters. and Set the global round number T=100, and set the other parameters as described above. The server will broadcast the initial parameters to all 20 clients.

[0193] Training round t: The server randomly samples 20% of the clients (i.e., 4 clients) to participate in this round of training.

[0194] Each participating client i executes: a) Classifier head fine-tuning: Freeze the local feature extractor, train the classifier head for 15 rounds using local data, and update... .

[0195] b) Sparsification training of the local feature extractor: Freeze the classifier head and perform 5 rounds of sparsification training on the local feature extractor. After training, generate sparse update information. .

[0196] c) Differential privacy protection: for The image is cropped and Gaussian noise (noise scale σ=1.0) is added to obtain the final uploaded image. .

[0197] The client will The data is uploaded to the server. The server receives the model update uploaded by the selected client and completes the aggregation. Step 2 is repeated until 100 rounds of training are completed.

[0198] Model distribution: The server will distribute the final global feature extractor. Distribute to all clients. Each client combines it with its locally stored classifier head for its local image classification task.

[0199] Experimental Results and Analysis: Table 1

[0200] Table 1 shows the comparison of the test accuracy of the method of this invention with various baseline methods under different datasets and data partitions. The method of this invention achieves the best performance in all scenarios, with an accuracy improvement of up to 2.9% compared to the best baseline methods (CENTAUR or PPSGD) (CIFAR-10, s=2 scenario). This verifies the effectiveness of the present invention in combining dynamic sparse updates and differential privacy mechanisms.

[0201] Different baseline methods perform differently under various data distributions. For example, on the CIFAR-10 dataset, CENTAUR outperforms PPSGD when s=2 (highly heterogeneous); however, when s=10 (nearly homogeneous), PPSGD surpasses CENTAUR. The method of this invention consistently outperforms across all data distributions, demonstrating its good adaptability.

[0202] Under the condition of strictly limited privacy budget (ε=1), the method of this invention can still maintain high accuracy, proving that dynamic adaptive norm constraint and hierarchical sparsity strategy can effectively reduce the negative impact of noise on model performance while protecting privacy.

[0203] In terms of communication load, the method of this invention adopts sparse updates (S=0.05), and the number of parameters uploaded in each round is only 5% of the original model parameters, which is much lower than the baseline method (which usually uploads the complete model), thus significantly reducing the communication load.

[0204] Furthermore, compared to all baseline schemes in terms of convergence, this invention (DP-pFedDRA) consistently maintains a low training loss and exhibits the fastest decrease in training loss. In practical training scenarios, this effectively reduces the number of training epochs, enabling the model to converge quickly and significantly saving local training time, computing power, and communication load.

[0205] In another embodiment of this application, a personalized federated learning device is also provided, applied to a client, such as... Figure 12 As shown, the device includes: The first acquisition module 11 is configured to acquire the first feature extractor parameters of the local feature extractor and the second classifier head parameters of the local classifier head. The first training module 12 is configured to freeze the second classifier head parameters, train the first feature extractor parameters, and reparameterize the first feature extractor parameters during the training process to obtain the second feature extractor parameters. The first sparse processing module 13 is configured to perform sparsification processing on the difference between the second feature extractor parameters and the first feature extractor parameters to obtain sparse update information, wherein the sparse update information is obtained by masking the difference. The differential privacy processing module 14 is configured to perform differential privacy processing on the sparse update information to obtain differential update information, and upload the differential update information to the server.

[0206] In another embodiment of this application, a personalized federated learning device is also provided, applied to the server side, such as... Figure 13 As shown, the device includes: The first receiving module 21 is configured to receive differential update information from multiple clients during each round of global training. Aggregation module 22 is configured to aggregate the differential update information from multiple clients to obtain aggregated update information; The first update module 23 is configured to update the current global feature extractor parameters based on the aggregated update information to obtain the updated global feature extractor parameters. The updated global feature extractor parameters are obtained by multiplying the aggregated update information by a preset global learning rate and then adding the current global feature extractor parameters. The repeat execution module 24 is configured to repeat the above steps until the preset global training rounds are reached, and the global feature extractor parameters of the global feature extractor are obtained.

[0207] In another embodiment of this application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus. Memory, used to store computer programs; When the processor executes a program stored in memory, it implements the personalized federated learning method described in any of the foregoing method embodiments.

[0208] The electronic device provided in this embodiment of the invention has a processor that executes a program stored in the memory to reparameterize the first feature extractor parameters of the local feature extractor and sparsify the changes in the extractor parameters, so that the obtained sparse update information has high sparsity. Combined with subsequent differential privacy processing, the amount of model parameter data uploaded to the server is compressed to the maximum extent while ensuring privacy and security, thereby reducing the communication load.

[0209] The communication bus 1140 mentioned in the above-mentioned electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus 1140 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 14 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0210] The communication interface 1120 is used for communication between the above-mentioned electronic device and other devices.

[0211] The memory 1130 may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0212] The processor 1110 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0213] In another embodiment of this application, a computer-readable storage medium is provided, on which a program for a personalized federated learning method is stored. When the program for the personalized federated learning method is executed by a processor, it implements the steps of the personalized federated learning method described in any of the foregoing method embodiments.

[0214] It should be noted that, in this document, relational terms such as "first" and "second" are used merely 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. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0215] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A personalized federated learning method, characterized in that, Applied to a client, the method includes: Obtain the first feature extractor parameters of the local feature extractor and the second classifier head parameters of the local classifier head; Freeze the second classifier head parameters, train the first feature extractor parameters, and reparameterize the first feature extractor parameters during the training process to obtain the second feature extractor parameters. The difference between the parameters of the second feature extractor and the parameters of the first feature extractor is sparsified to obtain sparse update information, which is obtained by masking the difference. Differential privacy processing is performed on the sparse update information to obtain differential update information, which is then uploaded to the server.

2. The personalized federated learning method according to claim 1, characterized in that, The process of obtaining the first feature extractor parameters of the local feature extractor and the second classifier head parameters of the local classifier head includes: Receive global feature extractor parameters and first classifier header parameters from the server; Freeze the parameters of the first feature extractor, train the parameters of the first classifier head to obtain the parameters of the second classifier head; Obtain the global feature extractor parameters to serve as the first feature extractor parameters of the local feature extractor; Obtain the second classifier head parameter as the second classifier head parameter of the local classifier head.

3. The personalized federated learning method according to claim 2, characterized in that, The process of freezing the parameters of the first feature extractor and training the parameters of the first classifier head to obtain the parameters of the second classifier head includes: Freeze the parameters of the first feature extractor; The first data is obtained by randomly sampling from the local dataset; The first data is input into the local feature extractor so that the local feature extractor outputs a feature representation; The feature representation is input into the local classifier head to obtain the prediction result. In the first iteration, the current classifier head parameters of the local classifier head are determined according to the first classifier head parameters. Determine the loss value between the prediction result and the training label, wherein the training label corresponds to the first data; The gradient of the current classifier head parameter of the local classifier head is updated according to the loss value to obtain intermediate classifier head parameters, which are used as the current classifier head parameters in the next round of local training. The step of randomly sampling from the local dataset to obtain the first data is repeated until the preset local iteration round is completed to obtain the second classifier head parameter.

4. The personalized federated learning method according to claim 1, characterized in that, The process of training the first feature extractor parameters, including reparameterizing the first feature extractor parameters during training to obtain the second feature extractor parameters, includes: In each round of local training, obtain the current layer threshold of the local feature extractor and the current sparsity rate; The sparsity parameters used in this round of forward propagation are determined based on the current layering threshold and the current sparsity rate. The regularization term is determined based on the current feature extractor parameters and the first feature extractor parameters; Forward propagation is performed using the local dataset based on the sparse parameters, and the task loss is determined based on a preset loss function, which includes the regularization term. Based on the preset loss function, backpropagation is performed to obtain intermediate feature extractor parameters, which are then used as the current feature extractor parameters in the next round of local training. Repeat the above steps until the preset local training rounds are reached to obtain the parameters of the second feature extractor.

5. The personalized federated learning method according to claim 4, characterized in that, The step of determining the sparse parameters used in this round of forward propagation based on the current layering threshold and the current sparsity rate includes: Obtain the current layer parameters of the local feature extractor; Determine the binary mask matrix based on the current layer parameters and the sparsity rate; The sparse parameters used in this round of forward propagation are determined based on the current layer threshold, the binary mask matrix, and the current layer parameters.

6. The personalized federated learning method according to claim 4, characterized in that, The step of obtaining the current sparsity rate includes: Obtain current channel quality data, calculate resource load factor, preset minimum sparsity rate, and preset maximum sparsity rate; Determine the channel quality factor based on the channel quality data; Determine the load factor based on the aforementioned computational resource load factor; The current sparsity rate is determined based on the channel quality factor, the load factor, the preset minimum sparsity rate, and the preset maximum sparsity rate.

7. The personalized federated learning method according to claim 4, characterized in that, Obtaining the current hierarchical threshold of the local feature extractor includes: Obtain current driving scenario data; Obtain the threshold adjustment strategy corresponding to the driving scenario data; The initial stratification threshold is adjusted according to the threshold adjustment strategy to obtain the current stratification threshold.

8. The personalized federated learning method according to claim 4, characterized in that, The step of determining the regularization term based on the current feature extractor parameters and the first feature extractor parameters includes: Determine the L2 norm of the difference between the current feature extractor parameters and the first feature extractor parameters; Obtain the clipping threshold; The regularization term is determined based on the L2 norm and the pruning threshold.

9. The personalized federated learning method according to claim 1, characterized in that, The differential privacy processing of the sparse update information to obtain differential update information includes: The sparse update information is pruned based on a pruning threshold to obtain pruning information. Add Gaussian noise that satisfies differential privacy to the clipping information to obtain the differential update information.

10. The personalized federated learning method according to claim 9, characterized in that, The step of adding Gaussian noise that satisfies differential privacy to the cropped information to obtain the differential update information includes: Obtain the level of autonomous driving; The differential privacy strength is determined based on the autonomous driving level; The sensitivity of the model to update data is determined based on the differential privacy strength. Based on the sensitivity, Gaussian noise that satisfies differential privacy is added to the cropping information to obtain the differential update information.

11. A personalized federated learning method, characterized in that, Applied to the server side, the method includes: During each round of global training, differential update information is received from multiple clients; The differential update information from multiple clients is aggregated to obtain aggregated update information; The current global feature extractor parameters are updated based on the aggregated update information to obtain the updated global feature extractor parameters. The updated global feature extractor parameters are obtained by multiplying the aggregated update information by a preset global learning rate and then adding the current global feature extractor parameters. Repeat the above steps until the preset number of global training rounds is reached, and the global feature extractor parameters of the global feature extractor are obtained.

12. The method according to claim 11, characterized in that, The aggregated update information obtained by aggregating the differential update information from multiple clients includes: The differential update information from the multiple clients is aggregated by weighted average to obtain the aggregated update information. The aggregation weight of each client is related to the number of samples in the local dataset in which the client participated in training. The aggregated update information does not undergo any server-side differential privacy processing.

13. The method according to claim 11, characterized in that, The updated global feature extractor parameters do not add any noise generated by the server.

14. The method according to claim 11, characterized in that, Before aggregating the differential update information from multiple clients, the method further includes: Anomaly detection is performed on all received differential update information from the clients to determine the mean vector and covariance matrix of all differential update information. Differential update information with Mahalanobis distance exceeding a preset quantile is removed, and only the differential update information that has not been removed is used for subsequent aggregation.

15. The method according to claim 11, characterized in that, After updating the current global feature extractor parameters based on the aggregated update information, the method further includes: When the L2 norm change of the aggregated update information in consecutive preset rounds is lower than the preset stopping threshold, global training is terminated early, and the current global feature extractor parameters are output as the final parameters, and subsequent rounds are not executed.

16. A personalized federated learning device, characterized in that, Applied to a client, the device includes: The first acquisition module is configured to acquire the first feature extractor parameters of the local feature extractor and the second classifier head parameters of the local classifier head. The first training module is configured to freeze the second classifier head parameters, train the first feature extractor parameters, and reparameterize the first feature extractor parameters during the training process to obtain the second feature extractor parameters. The first sparse processing module is configured to perform sparsification processing on the difference between the second feature extractor parameters and the first feature extractor parameters to obtain sparse update information, wherein the sparse update information is obtained by masking the difference. The differential privacy processing module is configured to perform differential privacy processing on the sparse update information to obtain differential update information, and then upload the differential update information to the server.

17. A personalized federated learning device, characterized in that, Applied to the server side, the device includes: The first receiving module is configured to receive differential update information from multiple clients during each round of global training. The aggregation module is configured to aggregate the differential update information from multiple clients to obtain aggregated update information; The first update module is configured to update the current global feature extractor parameters based on the aggregated update information to obtain the updated global feature extractor parameters. The updated global feature extractor parameters are obtained by multiplying the aggregated update information by a preset global learning rate and then adding the current global feature extractor parameters. The repeat execution module is configured to repeat the above steps until the preset global training rounds are reached, and the global feature extractor parameters of the global feature extractor are obtained.

18. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the personalized federated learning method as described in any one of claims 1-11 or 12-15.

19. A non-transitory computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program for a personalized federated learning method, which, when executed by a processor, implements the steps of the personalized federated learning method as described in any one of claims 1-11 or 12-15.