Personalized federal learning method for cross-regional vehicle trajectory anomaly detection

By constructing a dual-model structure of a messenger model and a personalized model and introducing a mutual distillation mechanism and differential privacy processing, the problems of data distribution differences and asynchronous communication in federated learning in cross-regional vehicle trajectory anomaly detection are solved, and efficient personalized detection and privacy protection are achieved.

CN120633778APending Publication Date: 2025-09-12CHONGQING UNIV +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510957548.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing federated learning methods cannot effectively adapt to the data distribution differences in different regions in vehicle trajectory anomaly detection. In addition, traditional methods have low training efficiency in asynchronous communication environments and are difficult to meet privacy protection and personalization requirements.

Method used

A dual-model structure of a messenger model and a personalized model is constructed, a mutual distillation mechanism is used for knowledge transfer, and differential privacy processing and asynchronous aggregation strategies are introduced to support asynchronous communication and personalization capabilities.

Benefits of technology

It significantly improves the performance of cross-regional vehicle trajectory anomaly detection, improves the model's generalization ability and detection accuracy, enhances privacy protection, and improves training efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120633778A_ABST
    Figure CN120633778A_ABST
Patent Text Reader

Abstract

The invention relates to a personalized federal learning method for cross-regional vehicle trajectory anomaly detection, which belongs to the technical field of intelligent traffic systems and comprises the following steps: constructing a federal system architecture consisting of a cloud server and a plurality of geographical distributed clients, each client holding local trajectory data; issuing a global model and constructing a double-model structure comprising a messenger model and a personalized model; the client simultaneously trains double models based on local data, and realizes knowledge migration through mutual distillation; protecting gradient information of the messenger model by adopting a differential privacy mechanism; uploading the protected model to a server, and executing asynchronous aggregation weighted according to the number of samples; and repeating the model issuing and local training process until a termination condition is met. The method gives consideration to global generalization and local adaptation, has the characteristics of asynchronous communication, differential privacy protection and the like, and can effectively improve the trajectory anomaly detection performance in data heterogeneous and communication limited environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of intelligent transportation systems and relates to a personalized federated learning method for cross-regional vehicle trajectory anomaly detection. Background Art

[0002] With the rapid development of intelligent connected vehicles and smart transportation systems, a large number of traffic sensing devices have been deployed on urban roads to collect real-time vehicle trajectory data. Vehicle trajectory anomaly detection, a key task in intelligent traffic management, can help identify abnormal driving behavior and improve road safety and operational efficiency. This type of detection typically relies on training machine learning models on large amounts of trajectory data to automatically identify abnormal behaviors such as sudden acceleration, sudden stops, and irregular lane changes. However, trajectory data is inherently sensitive to privacy. Due to data protection and management regulations, different cities or regions often cannot centralize and uniformly model the raw data. As a result, the trained models are often limited to a specific region, making them difficult to adapt to traffic behavior characteristics in other areas and lacking generalization capabilities. Furthermore, in areas where data is scarce or changes frequently, individually trained models are prone to underfitting, reducing detection accuracy and practicality.

[0003] Federated learning, a privacy-preserving distributed machine learning paradigm, offers a potential solution to these issues. By distributing model training across local nodes and aggregating model parameters to achieve global modeling, federated learning can improve model generalization without leaking the original data. However, traditional federated learning methods generally rely on a unified global model, failing to fully account for the distributional differences and personalized needs of trajectory data across regions, making it difficult to meet the requirements for local accuracy and differentiated modeling in intelligent transportation systems.

[0004] Furthermore, federated learning typically assumes that all clients can participate in training synchronously. However, in real-world traffic scenarios, edge nodes vary in their online status, communication capabilities, and computing resources. Forced synchronous updates often lead to reduced training efficiency and even affect model convergence. In heterogeneous environments, some areas may be unable to continuously upload model updates due to unstable networks or limited computing resources, thus affecting the training effectiveness of the global model.

[0005] Therefore, how to build a federated learning mechanism that supports asynchronous communication, has personalization capabilities, and adapts to data differences between regions while ensuring privacy protection is a key issue that needs to be urgently solved in the current vehicle trajectory anomaly detection task. Summary of the Invention

[0006] In view of this, the object of the present invention is to provide a personalized federated learning method for cross-regional vehicle trajectory anomaly detection.

[0007] In order to achieve the above object, the present invention provides the following technical solutions:

[0008] A personalized federated learning method for cross-regional vehicle trajectory anomaly detection includes the following steps:

[0009] S1: Build a system architecture consisting of multiple edge clients and cloud servers, where each client corresponds to a traffic monitoring area and contains its local vehicle trajectory data;

[0010] S2: The cloud server sends the current global model parameters to each client. The client initializes the global model as the messenger model and retains its own personalized model, forming a dual-model structure.

[0011] S3: The client trains both the personalized model and the messenger model based on local trajectory data. The messenger model absorbs global knowledge, while the personalized model adapts to local traffic characteristics. During local training, the messenger model and the personalized model perform bidirectional knowledge transfer through mutual distillation. The output of each model serves as the soft label for the other, and the optimization loss function is composed of the task loss and the distillation loss.

[0012] S4: After completing local training, the client performs differential privacy processing on the messenger model, specifically clipping the model gradient and injecting Gaussian noise to satisfy the |(ε,δ)|-differential privacy constraint;

[0013] S5: The client uploads the privacy-preserving messenger model to the server, which then stores the models uploaded by each client in a model cache pool. When the number of models received in the model cache pool reaches the set aggregation threshold H, the server initiates a global model aggregation, asynchronously aggregating the model parameters using a weighted approach based on the number of samples.

[0014] S6: After the aggregation is completed, the server generates a new round of global model parameters and sends them to each client to enter the next round of federated training;

[0015] S7: Repeat S2-S6 until the maximum number of training rounds is reached or the global model performance meets the preset target.

[0016] Furthermore, the system architecture established in step S1 includes a data acquisition layer, an edge computing layer, and a cloud aggregation layer;

[0017] The data acquisition layer is deployed in an urban road environment to collect vehicle trajectory data in the local traffic area in real time;

[0018] The edge computing layer corresponds to K edge clients in the traffic monitoring area, and each client k∈{1,2,…,K} holds a local dataset Used to store vehicle trajectory data in its jurisdiction; each edge client runs a personalized model adapted to local traffic characteristics and a messenger model for receiving and disseminating global knowledge;

[0019] The cloud aggregation layer is equipped with a cloud server, which is used to asynchronously receive the messenger model parameters uploaded by the edge clients, perform global aggregation, and issue the updated global model weights.

[0020] Furthermore, the S2 specifically includes:

[0021] The cloud server builds the global model w in the federated learning initialization phase g , and complete parameter initialization; the server broadcasts the global model parameters to each client, and after the client receives the model, it uses it as a messenger model Initialize the local model structure; at the same time, each client retains its own personalized model The personalized model is maintained locally and does not participate in server aggregation, thereby constructing a dual-model structure consisting of a messenger model and a personalized model.

[0022] Furthermore, the S3 specifically includes:

[0023] Each client uses its local vehicle trajectory data as input and extracts spatiotemporal behavioral features from the trajectory data through a neural network model. The messenger model and personalized model support heterogeneous basic network structures.

[0024] The client trains the anomaly detection model based on the extracted features, using a weighted binary cross entropy loss function, expressed as:

[0025]

[0026] in, represents the model's predicted value for input x, y is the true label, σ(·) is the sigmoid function, and θ pos and θ neg are the weights of positive and negative classes respectively, Represents the expectation of the local dataset; the trained model is able to identify trajectory samples that are deviant or have abnormal traffic behaviors.

[0027] Furthermore, during local client training, the messenger model and the personalized model achieve bidirectional knowledge transfer through mutual distillation. Given the same input, the two models each output predictions, using each other's outputs as soft labels to guide their own learning process.

[0028] Personalized model The distillation loss is:

[0029]

[0030] Conversely, the distillation loss of the intermediate model is:

[0031]

[0032] in are the sigmoid output probabilities of the personalized model and the mediation model respectively;

[0033] Each model uses the other model’s prediction results as soft labels, thus achieving two-way knowledge transfer;

[0034] The total loss function of the two types of models is composed of task loss and distillation loss, which are expressed as:

[0035]

[0036] In this process, the two models interactively share prediction information while maintaining independent updates of their respective parameters, thereby achieving knowledge complementarity between models.

[0037] Furthermore, in step S4, after the client completes local model training, differential privacy processing is performed on the messenger model to protect local data privacy, specifically including:

[0038] Clip the local gradient of each client:

[0039]

[0040] Where |S| is the upper limit of the gradient norm;

[0041] Add Gaussian noise to the cropped model:

[0042]

[0043] The noise standard deviation σ is calculated as:

[0044]

[0045] where Δ represents the l2 sensitivity.

[0046] Furthermore, the step S5 specifically includes:

[0047] The server asynchronously receives model updates from each client and stores them in the model cache pool:

[0048]

[0049] in, represents the mediation model parameters of client k, n k is the number of training samples for the client, The client collection that has uploaded the model at the current synchronization moment;

[0050] When the number of models in the cache pool reaches the threshold H, the server performs weighted aggregation. Weighted aggregation is performed as follows:

[0051]

[0052] Where N represents the total sample size of all participating clients in the current round;

[0053] After the aggregation is completed, the server clears the cache pool and waits to receive the next round of models.

[0054] Furthermore, the step S6 specifically includes:

[0055] After completing the current round of global model aggregation, the server broadcasts the updated global model parameters to all clients. After receiving the model, each client reinitializes the local messenger model, keeping the original personalized model unchanged. Subsequently, the client continues to perform local model training and mutual distillation based on the new round of global parameters, thereby starting the next round of personalized federated learning tasks.

[0056] The present invention proposes a personalized federated learning method for cross-regional vehicle trajectory anomaly detection. This method addresses the significant disparity in data distribution across urban traffic environments and the need for high privacy protection. It constructs a dual-model architecture consisting of a messenger model and a personalized model, and introduces a mutual distillation mechanism to achieve the integration of knowledge transfer and local adaptation. This method supports asynchronous aggregation and differential privacy protection, exhibits excellent scalability and communication efficiency, and significantly improves anomaly detection performance in multi-regional deployment scenarios, demonstrating strong practical value and engineering application prospects.

[0057] Other advantages, objects, and features of the present invention will be described in part in the following description and, in part, will be apparent to those skilled in the art upon examination of the following description or may be learned from practice of the present invention. The objects and other advantages of the present invention may be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below with reference to the accompanying drawings, in which:

[0059] Figure 1 A diagram of the personalized federated learning system model for cross-regional vehicle trajectory anomaly detection provided by the present invention;

[0060] Figure 2 This is a training flow chart of the client in the present invention. DETAILED DESCRIPTION

[0061] The following describes the embodiments of the present invention by means of specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0062] It should be noted that the illustrations provided in the following embodiments are merely schematic illustrations of the basic concept of the present invention. Therefore, the illustrations only show components related to the present invention and are not drawn according to the number, shape, and size of components in actual implementation. In actual implementation, the type, quantity, and proportion of each component may be changed arbitrarily, and the component layout may also be more complex.

[0063] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the embodiments of the present invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring the embodiments of the present invention.

[0064] Example 1:

[0065] like Figure 1 As shown, the personalized federated learning system for cross-regional vehicle trajectory anomaly detection provided by the present invention includes three functional modules: a data acquisition layer, an edge computing layer, and a cloud aggregation layer. The data acquisition layer is deployed in an urban road environment and includes various types of data acquisition equipment such as cameras, drones, and vehicle-mounted terminals, which are used to collect vehicle trajectory data within the local traffic area in real time. The edge computing layer corresponds to edge clients in multiple geographical regions, and each client runs two parallel models: a personalized model adapted to local traffic characteristics, and a messenger model for receiving and disseminating global knowledge. The cloud aggregation layer is equipped with a central server for asynchronously receiving messenger model parameters uploaded by clients, performing global aggregation, and issuing updated global model weights.

[0066] The cloud server builds the global model w in the federated learning initialization phase g, and complete parameter initialization; the server broadcasts the global model parameters to each client, and after the client receives the model, it uses it as a messenger model Initialize the local model structure; at the same time, each client retains its own personalized model The personalized model is maintained locally and does not participate in server aggregation, thereby constructing a dual-model structure consisting of a messenger model and a personalized model.

[0067] The client trains both the personalized model and the messenger model based on local trajectory data. The messenger model is responsible for absorbing global knowledge, while the personalized model is used to adapt to local traffic characteristics.

[0068] The training process of the method proposed in this invention specifically includes two core components: the mutual distillation learning mechanism on the client side and the secure asynchronous aggregation strategy on the server side. Figure 2 The client-side local training process is demonstrated. Unlike traditional one-way distillation, mutual distillation allows each model to act as both teacher and student, enabling collaborative learning. This paradigm, known as deep mutual learning, is achieved by jointly training a local personalized model and a messenger model on the same task.

[0069] In order to solve the problem of class imbalance in anomaly detection, the method adopts a weighted binary cross entropy loss function, which gives higher weights to abnormal samples to reduce bias. For any model, its task loss on client k is defined as:

[0070]

[0071] in, represents the model's predicted value for input x, y is the true label, σ(·) is the sigmoid function, and θ pos and θ neg are the weights of positive and negative classes respectively, Represents the expectation of the local dataset. The distillation loss uses the binary cross entropy loss function of the soft label to measure the difference between the two models at the prediction probability level. Personalized model The distillation loss is:

[0072]

[0073] Guide the personalized model to learn from the intermediary model. Conversely, the distillation loss of the intermediary model is:

[0074]

[0075] in are the sigmoid output probabilities of the personalized model and the intermediary model, respectively. Each model uses the other's prediction results as soft labels, thus achieving two-way knowledge transfer. The total loss function of the two types of models is composed of task loss and distillation loss, which can be expressed as: and Where α(t) is a dynamic weight function used to balance the task loss and the distillation loss, defined as follows:

[0076]

[0077] In the early stages of training, to address the problem of unstable model learning, α(t) gives higher weight to the task loss. As training progresses, the weight gradually tilts towards the distillation loss. half Finally, the two types of loss weights each account for 50%, achieving a smooth transition from single model learning to bidirectional collaborative distillation, thereby improving the generalization ability of the model.

[0078] In order to enhance privacy protection, this part adopts the local differential privacy mechanism in the model aggregation process. The specific implementation method is differential privacy stochastic gradient descent. During the intermediate model update process, the local gradient of each client is first passed through Pruning is performed. Where |S| is the upper limit of the gradient norm. In order to meet the requirements of |(ε,δ)|-differential privacy, Gaussian noise is added to the pruned model: The noise standard deviation σ can be calculated as: Where Δ represents the l2 sensitivity. This mechanism can effectively prevent inference attacks while providing strong privacy protection.

[0079] During the asynchronous aggregation phase, the server asynchronously receives model updates from each client and stores them in the model cache pool: In it, represents the mediation model parameters of client k, n k is the number of training samples for the client, The client collection that has uploaded the model at the current synchronization time. When the number of models in the cache pool reaches the threshold |H|, the server performs weighted aggregation:

[0080]

[0081] in, Represents the total sample size of all participating clients in the current round. After aggregation is complete, the server clears the cache pool and waits to receive the next round of models. This asynchronous aggregation strategy eliminates global synchronization dependencies and triggers model updates only after sufficient client updates have accumulated. This prevents slow clients from blocking training progress and significantly improves training efficiency. Furthermore, the buffered aggregation strategy effectively reduces model update variance and improves convergence stability.

[0082] To verify the effectiveness of the personalized federated learning method described in this paper in the cross-regional vehicle trajectory anomaly detection task, we selected representative existing federated learning methods (including FedAvg, FedProx, FedAsync, HierFed, and pFedVTAD*) as comparison solutions. Our anomaly detection performance was tested on a unified dataset based on real vehicle trajectories. The test metrics included accuracy, precision, recall, F1 score, and the number of iterations required to reach the target performance threshold, defined as Steps@73. pFedVTAD* represents the method described in this paper after removing the inter-distillation learning.

[0083] As shown in Table 1, the present invention demonstrates a comparison of the performance of different methods for global model anomaly detection. The present invention significantly outperforms other methods across all performance metrics, particularly in precision, recall, and F1 score, achieving improvements of approximately 10.6%, 4.2%, and 7.3% over the traditional FedAvg, respectively. Furthermore, the present invention achieves an F1 score of 73% with only 304 training steps, a significant reduction of approximately 70% compared to the 1007 steps required by FedAvg, significantly improving the model's convergence efficiency.

[0084] Table 1

[0085]

[0086] As shown in Table 2, the present invention demonstrates a performance comparison of different methods for local personalized anomaly detection models. The present invention achieved optimal or suboptimal performance on most clients, particularly achieving 93.02%, 85.89%, 82.70%, and 80.00% on Client 1, Client 2, Client 4, and Client 5, respectively, all of which are currently the best results. Furthermore, the present invention maintained stable performance on Client 3 and Client 6, with no significant degradation, demonstrating good robustness. Overall, the present invention achieved an average score of 81.63% across all clients, a 5.13% improvement over the traditional method FedAvg (76.50%), and significantly outperformed other comparison algorithms such as FedProx (76.21%), FedAsync (78.84%), and the hierarchical method HierFed (76.92%). This result fully demonstrates that the mutual distillation mechanism designed by the present invention can effectively improve the local adaptability of the personalized model while maintaining good global generalization performance.

[0087] Table 2

[0088]

[0089] This paper proposes a personalized federated learning method for cross-regional vehicle trajectory anomaly detection. To address the significant differences in data distribution across different urban traffic environments and the high demand for privacy protection, it constructs a dual-model structure consisting of a messenger model and a personalized model. It also introduces a mutual distillation mechanism to achieve the unification of knowledge transfer and local adaptation. This method supports asynchronous aggregation and differential privacy protection, exhibits excellent scalability and communication efficiency, and can significantly improve anomaly detection performance in multi-region deployment scenarios. Experiments demonstrate that this method outperforms existing representative baseline solutions in terms of accuracy, F1 score, and convergence speed, demonstrating its strong practical value and engineering application prospects.

[0090] Example 2:

[0091] An electronic device comprising a memory and a processor;

[0092] The memory is used to store computer programs;

[0093] The processor is configured to implement the method described in Example 1 when executing the computer program.

[0094] Example 3:

[0095] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in Example 1 is implemented.

[0096] Example 4:

[0097] A computer program product includes a computer program, which implements the method described in embodiment 1 when executed by a processor.

[0098] In the above embodiments, references to "this embodiment" in the specification indicate that a particular feature, structure, or characteristic described in conjunction with the embodiment is included in at least some embodiments, but not necessarily all embodiments. Multiple occurrences of "this embodiment" do not necessarily refer to the same embodiment.

[0099] In the above embodiments, although the invention has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those skilled in the art based on the foregoing description. For example, other memory structures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed. The embodiments of the present invention are intended to encompass all such alternatives, modifications, and variations that fall within the broad scope of the appended claims.

[0100] Regarding the computer-readable storage medium in this embodiment, those skilled in the art will appreciate that all or part of the steps in the aforementioned method embodiments can be implemented using hardware associated with the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When executed, the program performs the steps in the aforementioned method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0101] The electronic terminal provided in this embodiment includes a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication with each other. The memory is used to store computer programs, the communication interface is used for communication, and the processor and the transceiver are used to run computer programs so that the electronic terminal executes the various steps of the above method.

[0102] In this embodiment, the memory may include a random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage.

[0103] The above-mentioned processor 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, and discrete hardware components.

[0104] The present invention can be used in a wide variety of general-purpose or special-purpose computing system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments that include any of the above.

[0105] The present invention may be described in the general context of computer-executable instructions, such as program modules, executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media, including storage devices.

[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solutions, which should all be included in the scope of the claims of the present invention.

Claims

1. A personalized federated learning method for cross-regional vehicle trajectory anomaly detection, characterized by: The following steps are involved: S1: Build a system architecture consisting of multiple edge clients and cloud servers, where each client corresponds to a traffic monitoring area and contains its local vehicle trajectory data; S2: The cloud server sends the current global model parameters to each client. The client initializes the global model as the messenger model and retains its own personalized model, forming a dual-model structure. S3: The client trains both the personalized model and the messenger model based on local trajectory data. The messenger model absorbs global knowledge, while the personalized model adapts to local traffic characteristics. During local training, the messenger model and the personalized model perform bidirectional knowledge transfer through mutual distillation. That is, the output of each model serves as the soft label of the other model, and the optimization loss function is composed of the task loss and the distillation loss. S4: After completing local training, the client performs differential privacy processing on the messenger model, specifically clipping the model gradient and injecting Gaussian noise to satisfy the |(ε,δ)|-differential privacy constraint; S5: The client uploads the privacy-preserving messenger model to the server, which then stores the models uploaded by each client in a model cache pool. When the number of models received in the model cache pool reaches the set aggregation threshold H, the server initiates a global model aggregation, asynchronously aggregating the model parameters using a weighted approach based on the number of samples. S6: After the aggregation is completed, the server generates a new round of global model parameters and sends them to each client to enter the next round of federated training; S7: Repeat S2-S6 until the maximum number of training rounds is reached or the global model performance meets the preset target.

2. The personalized federated learning method for cross-regional vehicle trajectory anomaly detection according to claim 1 is characterized by: The system architecture established in step S1 includes a data acquisition layer, an edge computing layer, and a cloud aggregation layer; The data acquisition layer is deployed in an urban road environment to collect vehicle trajectory data in the local traffic area in real time; The edge computing layer corresponds to K edge clients in the traffic monitoring area, and each client k∈{1,2,...,K} holds a local dataset Used to store vehicle trajectory data in its jurisdiction; each edge client runs a personalized model adapted to local traffic characteristics and a messenger model for receiving and disseminating global knowledge; The cloud aggregation layer is equipped with a cloud server, which is used to asynchronously receive the messenger model parameters uploaded by the edge clients, perform global aggregation, and issue the updated global model weights.

3. The personalized federated learning method for cross-regional vehicle trajectory anomaly detection according to claim 1 is characterized by: The step S2 specifically includes: The cloud server builds the global model w in the federated learning initialization phase g , and complete parameter initialization; the server broadcasts the global model parameters to each client, and after the client receives the model, it uses it as a messenger model Initialize the local model structure; at the same time, each client retains its own personalized model The personalized model is maintained locally and does not participate in server aggregation, thereby constructing a dual-model structure consisting of a messenger model and a personalized model.

4. The personalized federated learning method for cross-regional vehicle trajectory anomaly detection according to claim 1 is characterized by: The step S3 specifically includes: Each client uses its local vehicle trajectory data as input and extracts spatiotemporal behavioral features from the trajectory data through a neural network model. The messenger model and personalized model support heterogeneous basic network structures. The client trains the anomaly detection model based on the extracted features, using a weighted binary cross entropy loss function, expressed as: in, represents the model's predicted value for input x, y is the true label, σ(·) is the sigmoid function, and θ pos and θ neg are the weights of positive and negative classes respectively, Represents the expectation of the local dataset; the trained model is able to identify trajectory samples that are deviant or have abnormal traffic behaviors.

5. The personalized federated learning method for cross-regional vehicle trajectory anomaly detection according to claim 4 is characterized by: During local client training, the messenger model and the personalized model achieve bidirectional knowledge transfer through mutual distillation. Given the same input, the two models each output predictions, using each other's outputs as soft labels to guide their own learning. Personalized model The distillation loss is: Conversely, the distillation loss of the intermediate model is: in are the sigmoid output probabilities of the personalized model and the mediation model respectively; Each model uses the other model’s prediction results as soft labels, thus achieving two-way knowledge transfer; The total loss function of the two types of models is composed of task loss and distillation loss, which are expressed as: In this process, the two models interactively share prediction information while maintaining independent updates of their respective parameters, thereby achieving knowledge complementarity between models.

6. The personalized federated learning method for cross-regional vehicle trajectory anomaly detection according to claim 1 is characterized by: In step S4, after the client completes local model training, differential privacy processing is performed on the messenger model to protect local data privacy, specifically including: Clip the local gradient of each client: Where |S| is the upper limit of the gradient norm; Add Gaussian noise to the cropped model: The noise standard deviation σ is calculated as: where Δ represents the l2 sensitivity.

7. The personalized federated learning method for cross-regional vehicle trajectory anomaly detection according to claim 1 is characterized by: The step S5 specifically includes: The server asynchronously receives model updates from each client and stores them in the model cache pool: in, represents the mediation model parameters of client k, n k is the number of training samples for the client, The client collection that has uploaded the model at the current synchronization moment; When the number of models in the cache pool reaches the threshold H, the server performs weighted aggregation. Weighted aggregation is performed as follows: Where N represents the total sample size of all participating clients in the current round; After the aggregation is completed, the server clears the cache pool and waits to receive the next round of models.

8. The personalized federated learning method for cross-regional vehicle trajectory anomaly detection according to claim 1 is characterized by: The step S6 specifically includes: After completing the current round of global model aggregation, the server broadcasts the updated global model parameters to all clients. After receiving the model, each client reinitializes the local messenger model, keeping the original personalized model unchanged. Subsequently, the client continues to perform local model training and mutual distillation based on the new round of global parameters, thereby starting the next round of personalized federated learning tasks.

9. An electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is configured to implement the personalized federated learning method for cross-regional vehicle trajectory anomaly detection as described in any one of claims 1 to 8 when executing the computer program.

10. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by the processor, the personalized federated learning method for cross-regional vehicle trajectory anomaly detection according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Multi-level federal multi-modal large model privacy protection enhancement method and electronic equipment

    CN121543115A

  • Trajectory similarity measurement and abnormal trajectory identification methods, equipment and media

    CN122413237A