Spatiotemporal trajectory classification method and device based on LLM with fine-tuning and extension of Kramers-Moyal coefficient

By using an LLM model based on Kramers-Moyal coefficients, the complexity of spatiotemporal trajectory classification under large-scale, high-noise, and irregular time intervals is solved, achieving efficient, accurate, and robust trajectory classification, which is applicable to fields such as intelligent transportation, public safety, and logistics management.

CN119719983BActive Publication Date: 2025-10-28Chinese People's Liberation Army Cyberspace Force Information Engineering University
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411795472.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-10-28
Estimated Expiration
2044-12-09

AI Technical Summary

Technical Problem

Existing spatiotemporal trajectory classification methods struggle to effectively capture complex spatiotemporal features when dealing with large-scale, high-noise, irregular time intervals, and complex environments. They suffer from high computational complexity and resource requirements, and perform poorly, especially when the amount of data is large or the data is scarce.

Method used

An extended LLM model based on Kramers-Moyal coefficients is adopted. By introducing Kramers-Moyal coefficients as cue information, and combining the Patching Optimizer module, the Spatiotemporal Feature Extraction Adapter (STFEA), and the Spatiotemporal Compression Adapter (STCA), a Transformer block is added to the original LLM and fine-tuned to optimize the model structure and improve classification accuracy and robustness.

Benefits of technology

提高了时空轨迹分类的准确性和鲁棒性,能够有效处理长时间依赖和复杂时空关联,减少计算复杂度,适用于少样本学习场景,适应不同领域的时空轨迹分类任务。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719983B_ABST
    Figure CN119719983B_ABST
Patent Text Reader

Abstract

This invention provides a spatiotemporal trajectory classification method and apparatus based on Kramers-Moyal coefficient-based extended LLM with fine-tuning, relating to the field of artificial intelligence. The method includes: collecting multi-source spatiotemporal trajectory data and performing data preprocessing; calculating the Kramers-Moyal coefficients of the preprocessed multi-source spatiotemporal trajectory data and dividing the preprocessed multi-source spatiotemporal trajectory data into multiple tokens; vectorizing the multiple tokens and using them as input to a spatiotemporal feature extraction adapter to extract spatial and temporal features; inputting the Kramers-Moyal coefficients and the spatial and temporal features into a preset extended LLM to obtain the classification result; wherein the preset extended LLM is constructed by adding L Transformer blocks after the original LLM. This invention can address challenges such as high noise, missing values, and irregular time intervals, improving the model's classification accuracy and generalization ability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a spatiotemporal trajectory classification method and apparatus based on Kramers-Moyal coefficient cue fine-tuning extension of LLM. Background Technology

[0002] Spatiotemporal trajectory classification plays an important role in fields such as location services, traffic management, and public safety, aiming to identify and distinguish different motion patterns by analyzing the trajectory data of moving objects.

[0003] Grid-based methods (such as TraClass and grid extension) simplify the processing of spatiotemporal data through spatial grid partitioning, effectively segmenting and classifying trajectory data. Their advantages lie in their intuitiveness, ease of implementation, and suitability for classifying relatively regular trajectory data. However, these methods perform poorly when dealing with high-noise or unevenly distributed trajectory data, struggling to capture complex spatiotemporal features. Furthermore, as the grid refinement increases, computational complexity significantly rises, potentially leading to performance degradation when processing large-scale datasets.

[0004] RNN-based methods (such as TrajODE and ST-GRU) can effectively handle data with irregular time intervals and improve classification accuracy by modeling long-term dependencies in time-series data. TrajODE uses neural frequent differential equations to handle continuous-time data, while ST-GRU adds an improved structure to the traditional RNN, enhancing its ability to model spatiotemporal correlations. Nevertheless, RNN models have long training times, especially with large datasets, and their computational resource requirements are very high. Furthermore, RNNs are very sensitive to data order; missing data or excessively long time intervals can negatively impact model performance.

[0005] CNN-based methods (such as TraClets) convert trajectory data into image form and then classify it using existing CNN techniques. This approach avoids the complex preprocessing steps of traditional trajectory classification methods and shows good applicability to various types of trajectory data. However, some spatiotemporal information may be lost during the conversion process, especially when dealing with complex or long-term sequences. In addition, CNNs have high computational resource requirements and limited modeling capabilities when dealing with dynamic time interval changes.

[0006] Transformer-based methods (such as TrajFormer) improve model performance on large-scale datasets by handling long-term series data and efficiently modeling their spatiotemporal dependencies. The auxiliary loss and squeezing function introduced into their structure accelerate the training process, achieving a good balance between speed and accuracy. However, Transformers have high computational complexity, containing a large number of parameters, requiring significant training time and computational resources. Furthermore, Transformers perform worse than RNNs when handling short-term dependencies and scenarios with limited data.

[0007] Time series-based methods (such as TimeMixer and TimesNet) offer unique frameworks for handling the complexity of time series data. TimeMixer extracts fine-grained and coarse-grained trend and seasonal features through a multi-scale hybrid framework, while TimesNet efficiently captures spatiotemporal features by converting one-dimensional time series into two-dimensional tensors. These methods can handle periodically changing data well and improve classification accuracy. However, due to their complex model structures, parameter tuning is difficult, and the optimization process can be cumbersome. When processing long-term series, they may face efficiency issues, and their performance may be less than expected when the data is noisy.

[0008] In summary, with the advancement of mobile devices and sensor technologies, a vast amount of spatiotemporal trajectory data is constantly being generated, reflecting the dynamic changes of moving objects in time and space. However, with the increasing volume of data, traditional spatiotemporal trajectory classification methods face numerous challenges. Especially when dealing with large-scale data, traditional methods often fail to effectively handle noise, missing values, and complex spatiotemporal correlations. Particularly when dealing with dynamic changes, complex environments, and irregular time intervals, there is an urgent need to develop new algorithms to better capture these complex spatiotemporal patterns in order to improve classification accuracy. Summary of the Invention

[0009] To improve classification accuracy for spatiotemporal trajectory data under dynamic changes, complex environments, and irregular time intervals, this invention provides a spatiotemporal trajectory classification method and apparatus based on Kramers-Moyal coefficient-based LLM fine-tuning extension. By combining the high-order dynamic characteristics capture of Kramers-Moyal coefficients with the extended LLM fine-tuning method, this invention not only improves classification accuracy but also enhances the robustness and generalization ability of the model, providing an efficient solution for various spatiotemporal trajectory analysis tasks.

[0010] In a first aspect, the present invention provides a spatiotemporal trajectory classification method based on Kramers-Moyal coefficient cue-based fine-tuning extension of LLM, comprising:

[0011] Step 1: Collect multi-source spatiotemporal trajectory data and perform data preprocessing;

[0012] Step 2: Calculate the Kramers-Moyal coefficients of the preprocessed multi-source spatiotemporal trajectory data, and divide the preprocessed multi-source spatiotemporal trajectory data into multiple tokens;

[0013] Step 3: Vectorize multiple tokens and use them as input to the spatiotemporal feature extraction adapter to extract spatial and temporal features;

[0014] Step 4: Input the Kramers-Moyal coefficients and the spatial and temporal features into a preset extended LLM to obtain the classification result; wherein, the construction process of the preset extended LLM is as follows: add L Transformer blocks after the original LLM.

[0015] Furthermore, the data preprocessing includes data cleaning and data normalization of the multi-source spatiotemporal trajectory data.

[0016] Furthermore, the preprocessed multi-source spatiotemporal trajectory data is divided into multiple tokens, specifically including:

[0017] The preprocessed multi-source spatiotemporal trajectory data is divided into multiple data blocks, the variance of each data block is calculated, and the data block with the largest variance is dynamically selected to prioritize the division of the data block with the largest variance into multiple tokens.

[0018] Furthermore, the fine-tuning process of the preset extended LLM includes:

[0019] The expanded LLM was fine-tuned using a labeled spatiotemporal trajectory dataset. During the fine-tuning process, only the parameters of the newly added L Transformer blocks were updated, while the parameters of the original LLM remained fixed.

[0020] Furthermore, in each of the newly added Transformer blocks, a spatiotemporal compression adapter is inserted between the multi-head attention layer and the residual connection and layer normalization, and a skip connection is added between the output of the multi-head attention layer and the input of the residual connection and layer normalization.

[0021] Furthermore, the spatiotemporal feature extraction adapter includes a CNN and two bidirectional LSTM layers connected in sequence.

[0022] Furthermore, the spatiotemporal compression adapter adopts a CNN-connected multilayer perceptron structure.

[0023] Secondly, the present invention provides a spatiotemporal trajectory classification device based on Kramers-Moyal coefficient cue-based fine-tuning extension of LLM, comprising:

[0024] The data collection and preprocessing module is used to collect multi-source spatiotemporal trajectory data and perform data preprocessing.

[0025] The calculation module is used to calculate the Kramers-Moyal coefficients of the preprocessed multi-source spatiotemporal trajectory data;

[0026] The data block optimizer is used to divide the preprocessed multi-source spatiotemporal trajectory data into multiple tokens;

[0027] A spatiotemporal feature extraction adapter is used to extract spatial and temporal features based on the vectorization results after multiple tokens have been vectorized.

[0028] The classification module is used to input the Kramers-Moyal coefficients and the spatial and temporal features into a preset extended LLM to obtain the classification result; wherein, the construction process of the preset extended LLM is as follows: L Transformer blocks are added after the original LLM.

[0029] Thirdly, the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method as described in the first aspect.

[0030] Fourthly, the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in the first aspect.

[0031] The beneficial effects of this invention are:

[0032] (1) Improve classification accuracy. By introducing the Kramers-Moyal coefficient, the model can effectively capture the high-order dynamic characteristics in trajectory data, thereby improving the ability to identify complex spatiotemporal trajectory patterns. In particular, the classification accuracy is significantly improved in the case of noise and missing data.

[0033] (2) Enhance model robustness. The Kramers-Moyal coefficients serve as cue information, which helps to improve the robustness of the model, enabling it to cope with challenges such as high noise, missing values ​​and irregular time intervals, thereby improving the stability and generalization ability of the model.

[0034] (3) Effective handling of long-term dependencies. By extending the LLM and fine-tuning the model, especially the Transformer block, the model can better capture long-term dependencies and complex spatiotemporal relationships in spatiotemporal trajectory data while retaining its general language understanding ability, thereby improving the performance of trajectory classification.

[0035] (4) Improved few-shot learning ability. The model shows significant advantages in few-shot learning tasks. Even with limited data, it can maintain high classification accuracy and is suitable for real-world application scenarios where data is scarce.

[0036] (5) Optimize computational efficiency. By designing spatiotemporal adapters (STFEA and STCA), the model can not only efficiently extract spatiotemporal features, but also reduce computational complexity through feature compression and fusion, thereby improving training speed and model computational efficiency.

[0037] (6) It has broad application prospects. The model can adapt to spatiotemporal trajectory classification tasks in different fields, including intelligent transportation, public safety, logistics management, environmental monitoring, etc., providing efficient and accurate trajectory analysis and prediction tools for various industries. Attached Figure Description

[0038] Figure 1 A flowchart illustrating the spatiotemporal trajectory classification method based on Kramers-Moyal coefficient cueing and fine-tuning extension of LLM provided in this embodiment of the invention;

[0039] Figure 2 A schematic diagram of the structure of a spatio-temporal feature extractor adapter (STFEA) provided in an embodiment of the present invention;

[0040] Figure 3 A schematic diagram of the structure of a spatio-temporal compressor adapter (STCA) provided in an embodiment of the present invention;

[0041] Figure 4 A schematic diagram of the spatiotemporal trajectory classification device based on Kramers-Moyal coefficient hinting fine-tuning extension of LLM provided in an embodiment of the present invention;

[0042] Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

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

[0044] like Figure 1As shown, this embodiment of the invention provides a spatiotemporal trajectory classification method based on Kramers-Moyal coefficient cue-based fine-tuning extension of LLM, comprising the following steps:

[0045] S101: Collect multi-source spatiotemporal trajectory data and perform data preprocessing;

[0046] Specifically, multi-source spatiotemporal trajectory data is collected, including but not limited to GPS positioning data, flight data, and traffic data. Data types may include trajectory attributes such as longitude, latitude, speed, acceleration, and timestamp.

[0047] Example datasets may include: Geolife dataset (recording daily activity tracks), Animals dataset (animal migration tracks), AIS and ADS-B datasets (ship and aircraft tracks), etc.

[0048] Data preprocessing mainly includes data cleaning and data normalization. First, the collected raw data is cleaned to remove outliers, handle missing data, and fill in missing trajectory points; methods include time-series interpolation (such as cubic spline interpolation) and weighted moving average. Then, the cleaned data is normalized, standardizing values ​​such as longitude, latitude, velocity, and acceleration to a uniform range.

[0049] The normalized dataset is divided into a training set and a test set. The extended LLM is then fine-tuned using the training set with class labels.

[0050] S102: Calculate the Kramers-Moyal coefficients of the preprocessed multi-source spatiotemporal trajectory data and divide the preprocessed multi-source spatiotemporal trajectory data into multiple tokens;

[0051] Specifically, kernel density estimation (KDE) is performed on the preprocessed spatiotemporal trajectory data to estimate the probability density function (PDF). The Nadaraya-Watson estimator is used to smooth the spatiotemporal data to reduce the impact of noise and improve the accuracy of the calculation. Based on the PDF of KDE, the Kramers-Moyal coefficients are calculated. These coefficients can capture the higher-order dynamic characteristics of spatiotemporal trajectories and are particularly suitable for complex patterns such as jumps and nonlinear changes in the data.

[0052] First, the preprocessed multi-source spatiotemporal trajectory data is divided into blocks. Then, the PatchingOptimizer dynamically adjusts the appropriate block size (automatically selected based on the data variance) to optimize the model's learning efficiency for trajectories in different time periods. This module calculates the variance of the data blocks and prioritizes dividing the blocks with the largest variance into multiple tokens to ensure data diversity and information richness.

[0053] The Patching Optimizer module selects the most informative regions for processing by calculating the variance of data patches. Patch variance measures the degree of data variability; the larger the variance, the richer the information and the more pronounced the variation in that region. By selecting the patch with the largest variance, the model can focus on the most variable and diverse parts of the data, thereby improving learning efficiency and prediction accuracy. This approach ensures that the model prioritizes regions containing more key features, rather than treating all data indiscriminately. This module automatically determines the optimal patch size and step size, maximizing the variance between patches to improve the model's learning efficiency and performance. This optimization is particularly important for processing spatiotemporal trajectory data of variable length, helping the model better capture higher-order dynamic features in the data.

[0054] S103: Vectorize multiple tokens and use them as input to the spatiotemporal feature extraction adapter to extract spatial and temporal features;

[0055] Specifically, such as Figure 2 As shown, the spatiotemporal feature extraction adapter includes a CNN and two bidirectional LSTM layers connected in sequence, and extracts temporal and spatial features by combining the CNN and the bidirectional LSTM layers.

[0056] S104: Input the Kramers-Moyal coefficients and the spatial and temporal features into a preset extended LLM to obtain the classification result; wherein, the construction process of the preset extended LLM is as follows: add L Transformer blocks after the original LLM. Let the original LLM contain N Transformer blocks, and add L Transformer blocks after the original Transformer blocks, then the extended model will contain a total of N+L Transformer blocks.

[0057] Specifically, using Kramers-Moyal coefficients as input features of the model can help the model better understand the dynamic dependencies in the data, especially when dealing with noisy or irregularly sampled data.

[0058] An extended LLM is obtained by adding extra Transformer blocks to an existing pre-trained large language model (such as GPT-2). These extra Transformer blocks are initialized using an "identity mapping" strategy to ensure that the model's original inference capabilities are not affected. The extended model adds more Transformer layers, enabling it to better handle spatiotemporal trajectory data over long periods and improve its ability to capture complex dynamic changes.

[0059] Furthermore, in order to improve computational efficiency and reduce computational complexity, specifically, such as Figure 1 As shown, in the newly added Transformer block, a spatiotemporal compression adapter is inserted between the multi-head attention layer and the residual connection and layer normalization, and a skip connection is added between the output of the multi-head attention layer and the input of the residual connection and layer normalization. Figure 3 As shown, the spatiotemporal compression adapter adopts a CNN connected to a multilayer perceptron (MLP) structure. The spatiotemporal features are compressed through the multilayer perceptron structure, reducing redundant information, improving computational efficiency, reducing computational complexity, and reducing the risk of overfitting.

[0060] Fine-tuning and training process: The Kramers-Moyal coefficients and spatial and temporal features corresponding to the training set are input into the expanded LLM, and the expanded LLM is fine-tuned, such as... Figure 1 As shown, only the parameters of the newly added L Transformer blocks are updated, while the parameters of the original Transformer blocks remain fixed to preserve the model's general inference capabilities. The Adam optimizer is used for training, with fine-tuning using appropriate learning rates and steps to ensure the model can learn accurate classification patterns from spatiotemporal trajectory data.

[0061] It should be noted that for the extended Transformer block, this embodiment adopts an improved initialization strategy, initializing the initial weights W0 to zero. That is, the weight matrix of the two linear transformations of FFN is initialized to zero to ensure the "identity mapping" characteristic; the layer normalization parameter is also set to 0. At the same time, the attention module weights are randomly initialized.

[0062] Testing Process: After training, the model is used for spatiotemporal trajectory classification tasks. The Kramers-Moyal coefficients corresponding to the test set, along with spatial and temporal features, are input into the model, which outputs the category label for the trajectory. Classification tasks can include different trajectory pattern recognition, such as traffic patterns and animal migration patterns.

[0063] Furthermore, in terms of model performance evaluation, metrics such as accuracy, precision, recall, and F1-score can be used to assess the model's classification performance and compare it with existing baseline models. Additionally, testing on multiple datasets (such as Geolife, AIS, and ADS-B) verifies the model's application effectiveness in different scenarios, ensuring its generalization ability.

[0064] Furthermore, in terms of evaluating the model's few-shot learning, the model is evaluated in a few-shot learning scenario to test its performance with a small sample size, thus verifying its robustness and accuracy under conditions of scarce data.

[0065] This invention provides a spatiotemporal trajectory classification method based on Kramers-Moyal coefficient-based fine-tuning extension of LLM. By introducing Kramers-Moyal coefficients as cues, and designing a Patching Optimizer module, a Spatiotemporal Feature Extraction Adapter (STFEA), and a Spatiotemporal Compression Adapter (STCA), the method enhances the model's understanding and classification capabilities of spatiotemporal trajectory data, enabling it to adapt to spatiotemporal trajectory classification tasks in various fields. For example, in intelligent transportation, trajectory classification can be used for traffic pattern recognition, road flow prediction, and traffic accident analysis. In public safety, it can be applied to trajectory classification and behavior prediction of moving targets such as police vehicles and drones. In logistics management, it can be used for optimizing and monitoring the trajectories of logistics vehicles. In environmental monitoring, it can be used to analyze the trajectories of natural disasters and animal migrations.

[0066] Corresponding to the methods mentioned above, such as Figure 4 As shown, this embodiment of the invention also provides a spatiotemporal trajectory classification device based on Kramers-Moyal coefficient cue fine-tuning extension of LLM, including a data collection and preprocessing module, a calculation module, a data block optimizer, a spatiotemporal feature extraction adapter, and a classification module.

[0067] The system comprises the following modules: a data collection and preprocessing module for collecting multi-source spatiotemporal trajectory data and performing data preprocessing; a calculation module for calculating the Kramers-Moyal coefficients of the preprocessed multi-source spatiotemporal trajectory data; a data block optimizer for dividing the preprocessed multi-source spatiotemporal trajectory data into multiple tokens; a spatiotemporal feature extraction adapter for extracting spatial and temporal features based on the vectorization results after vectorizing multiple tokens; and a classification module for inputting the Kramers-Moyal coefficients and the spatial and temporal features into a preset extended LLM to obtain classification results. The preset extended LLM is constructed by adding L Transformer blocks after the original LLM.

[0068] It should be noted that the spatiotemporal trajectory classification device provided in this embodiment of the invention is for implementing the above method, and its specific function can be referred to the above method embodiment, which will not be repeated here.

[0069] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5As shown, the electronic device may include: a processor 501, a communication interface 502, a memory 503, and a communication bus 504. The processor 501, communication interface 502, and memory 503 communicate with each other via the communication bus 504. The processor 501 can call logical instructions in the memory 503 to execute a spatiotemporal trajectory classification method. This method includes: collecting multi-source spatiotemporal trajectory data and performing data preprocessing; calculating the Kramers-Moyal coefficients of the preprocessed multi-source spatiotemporal trajectory data and dividing the preprocessed multi-source spatiotemporal trajectory data into multiple tokens; vectorizing the multiple tokens and using them as input to a spatiotemporal feature extraction adapter to extract spatial and temporal features; inputting the Kramers-Moyal coefficients and the spatial and temporal features into a preset extended LLM to obtain the classification result; wherein the construction process of the preset extended LLM is: adding L Transformer blocks after the original LLM.

[0070] Furthermore, when the logical instructions in the aforementioned memory 503 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0071] This invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can execute the methods provided in the above-described method embodiments, such as: collecting multi-source spatiotemporal trajectory data and performing data preprocessing; calculating the Kramers-Moyal coefficients of the preprocessed multi-source spatiotemporal trajectory data and dividing the preprocessed multi-source spatiotemporal trajectory data into multiple tokens; vectorizing the multiple tokens and using them as input to a spatiotemporal feature extraction adapter to extract spatial and temporal features; inputting the Kramers-Moyal coefficients and the spatial and temporal features into a preset extended LLM to obtain a classification result; wherein the construction process of the preset extended LLM is: adding L Transformer blocks after the original LLM.

[0072] This invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the methods provided in the above-described method embodiments, including, for example,: collecting multi-source spatiotemporal trajectory data and performing data preprocessing; calculating the Kramers-Moyal coefficients of the preprocessed multi-source spatiotemporal trajectory data and dividing the preprocessed multi-source spatiotemporal trajectory data into multiple tokens; vectorizing the multiple tokens and using them as input to a spatiotemporal feature extraction adapter to extract spatial and temporal features; inputting the Kramers-Moyal coefficients and the spatial and temporal features into a preset extended LLM to obtain a classification result; wherein the construction process of the preset extended LLM is: adding L Transformer blocks after the original LLM.

[0073] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0074] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A spatiotemporal trajectory classification method based on Kramers-Moyal coefficient-based fine-tuning extension of LLM, characterized in that, include: Step 1: Collect multi-source spatiotemporal trajectory data and perform data preprocessing; the multi-source spatiotemporal trajectory data includes GPS positioning data, flight data, or traffic data; the data types include the longitude, latitude, velocity, acceleration, and timestamp of the trajectory; Step 2: Calculate the Kramers-Moyal coefficients of the preprocessed multi-source spatiotemporal trajectory data, and divide the preprocessed multi-source spatiotemporal trajectory data into multiple tokens; Step 3: Vectorize multiple tokens and use them as input to the spatiotemporal feature extraction adapter to extract spatial and temporal features; the spatiotemporal feature extraction adapter includes a CNN and two bidirectional LSTM layers connected in sequence; Step 4: Input the Kramers-Moyal coefficients and the spatial and temporal features into a preset extended LLM to obtain the classification result; wherein, the construction process of the preset extended LLM is as follows: add L Transformer blocks after the original LLM.

2. The spatiotemporal trajectory classification method based on Kramers-Moyal coefficient cue-based fine-tuning extension of LLM according to claim 1, characterized in that, The data preprocessing includes data cleaning and data normalization of the multi-source spatiotemporal trajectory data.

3. The spatiotemporal trajectory classification method based on Kramers-Moyal coefficient cue-based fine-tuning extension of LLM according to claim 1, characterized in that, The preprocessed multi-source spatiotemporal trajectory data is divided into multiple tokens, specifically including: The preprocessed multi-source spatiotemporal trajectory data is divided into multiple data blocks, the variance of each data block is calculated, and the data block with the largest variance is dynamically selected to prioritize the division of the data block with the largest variance into multiple tokens.

4. The spatiotemporal trajectory classification method based on Kramers-Moyal coefficient cue-based fine-tuning extension of LLM according to claim 1, characterized in that, The fine-tuning process of the preset extended LLM includes: The expanded LLM was fine-tuned using a labeled spatiotemporal trajectory dataset. During the fine-tuning process, only the parameters of the newly added L Transformer blocks were updated, while the parameters of the original LLM remained fixed.

5. The spatiotemporal trajectory classification method based on Kramers-Moyal coefficient cue-based fine-tuning extension of LLM according to claim 1 or 4, characterized in that, In each of the newly added Transformer blocks, a spatiotemporal compression adapter is inserted between the multi-head attention layer and the residual connection and layer normalization, and a skip connection is added between the output of the multi-head attention layer and the input of the residual connection and layer normalization.

6. The spatiotemporal trajectory classification method based on Kramers-Moyal coefficient cue-based fine-tuning extension of LLM according to claim 5, characterized in that, The spatiotemporal compression adapter adopts a CNN connected to a multilayer perceptron structure.

7. A spatiotemporal trajectory classification device based on Kramers-Moyal coefficient-based fine-tuning extended LLM, characterized in that, include: The data collection and preprocessing module is used to collect multi-source spatiotemporal trajectory data and perform data preprocessing. The multi-source spatiotemporal trajectory data includes GPS positioning data, flight data, or traffic data; the data types include the trajectory's longitude, latitude, velocity, acceleration, and timestamp. The calculation module is used to calculate the Kramers-Moyal coefficients of the preprocessed multi-source spatiotemporal trajectory data; The data block optimizer is used to divide the preprocessed multi-source spatiotemporal trajectory data into multiple tokens; A spatiotemporal feature extraction adapter is used to extract spatial and temporal features based on the vectorization results after multiple tokens are vectorized; the spatiotemporal feature extraction adapter includes a CNN and two bidirectional LSTM layers connected in sequence; The classification module is used to input the Kramers-Moyal coefficients and the spatial and temporal features into a preset extended LLM to obtain the classification result; wherein, the construction process of the preset extended LLM is as follows: L Transformer blocks are added after the original LLM.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Urban road extraction method based on multi-source data fusion, storage medium and equipment

    CN118094471A

  • Systems and methods for a bayesian spatiotemporal graph transformer network for multi-aircraft trajectory prediction

    US20240054329A1