LLM spatial-temporal trajectory classification method and device based on Kramers-Moyal coefficient prompt fine tuning expansion
By introducing Kramers-Moyal coefficients and spatiotemporal feature extraction adapter in the LLM model, the problem of difficulty in identifying noise, missing values and complex spatiotemporal correlation features when dealing with large-scale spatiotemporal trajectory data is solved, and higher classification accuracy and computational efficiency are achieved.
Patent Information
- Application Number
- CN202411795472.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-09
AI Technical Summary
Traditional spatiotemporal trajectory classification methods are difficult to effectively deal with noise, missing values and complex spatiotemporal correlation characteristics when processing large-scale data. Especially under dynamic changes, complex environments and irregular time intervals, classification accuracy and computing efficiency are challenges.
The LLM method based on the prompt fine-tuning extension based on the Kramers-Moyal coefficient is adopted. By calculating the Kramers-Moyal coefficient of multi-source spatiotemporal trajectory data and inputting it into the extended LLM model, combining the spatiotemporal feature extraction adapter and spatiotemporal compression adapter, the robustness and computing efficiency of the model are improved.
It improves classification accuracy and model robustness, enhances the ability to identify complex spatiotemporal trajectory patterns, especially in the absence of noise and data, significantly improves classification accuracy and optimizes computing efficiency.
Smart Images

Figure CN119719983A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and device for classifying spatiotemporal trajectories based on an LLM with fine-tuning and expansion of a Kramers-Moyal coefficient prompt. Background Art
[0002] Spatiotemporal trajectory classification plays an important role in location-based services, traffic management, and public safety, and aims 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 division, and can effectively segment and classify trajectory data. Its advantages are that the method is intuitive, easy to implement, and suitable for the classification of relatively regular trajectory data. However, these methods perform poorly when faced with high-noise or unevenly distributed trajectory data, and it is difficult to capture the complex spatiotemporal features in the data. At the same time, with the refinement of grid division, the computational complexity will increase significantly, which may lead to performance degradation when processing large-scale data.
[0004] RNN-based methods (such as TrajODE and ST-GRU) can effectively process data with irregular time intervals and improve classification accuracy by modeling the long-term dependencies of time series data. TrajODE uses Neural Ordinary Differential Equations to process continuous time data, while ST-GRU adds an improved structure based on traditional RNN to enhance the modeling ability of spatiotemporal correlation. Despite this, the training time of the RNN model is relatively long, especially when the amount of data is large, and the computing resource requirements are also very high. Moreover, RNN is very sensitive to the order of data. If there is missing data or the time interval is too long, the model performance will be affected.
[0005] CNN-based methods (such as TraClets) convert trajectory data into image form and then use existing CNN technology for classification. This method avoids the complex preprocessing steps in traditional trajectory classification methods and shows good applicability in various types of trajectory data. However, some spatiotemporal information may be lost during the conversion process, especially when dealing with complex or long time series. In addition, CNN has high requirements for computing resources and has limited modeling capabilities when dealing with dynamic time interval changes.
[0006] Transformer-based methods (such as TrajFormer) improve the performance of models on large-scale datasets by processing long time series data and efficiently modeling their spatiotemporal dependencies. The auxiliary loss and squeeze function introduced in its structure accelerate the training process, achieving a good balance between speed and accuracy. However, the computational complexity of Transformer is high, the model contains a large number of parameters, and training takes a long time and has a large demand for computing resources. In addition, Transformer does not perform as well as RNN when dealing with short-term dependencies and less data.
[0007] Time series-based methods such as TimeMixer and TimesNet propose unique processing frameworks for the complexity of time series data. TimeMixer extracts fine-grained and coarse-grained trend and seasonal features through a multi-scale mixing framework, while TimesNet efficiently captures spatiotemporal features by converting one-dimensional time series into two-dimensional tensors. These methods can better handle periodically changing data and improve classification accuracy. However, due to the complex model structure, parameter adjustment is more difficult and the optimization process may be cumbersome. When processing long time series, efficiency issues may be encountered, and the performance may not be as expected when the data is noisy.
[0008] In summary, with the advancement of mobile devices and sensor technology, a large amount of spatiotemporal trajectory data is continuously generated, which reflects the dynamic changes of mobile objects in time and space. However, with the increase in data volume, traditional spatiotemporal trajectory classification methods face many challenges. Especially when dealing with large-scale data, traditional methods often cannot effectively deal with noise, missing values and complex spatiotemporal correlation features in the data. Especially when dealing with dynamic changes, complex environments and irregular time intervals, in order to improve classification accuracy, it is urgent to develop new algorithms to better capture these complex spatiotemporal patterns. Summary of the invention
[0009] In order to improve the classification accuracy of spatiotemporal trajectory data under dynamic changes, complex environments and irregular time intervals, the present invention provides a spatiotemporal trajectory classification method and device based on LLM with Kramers-Moyal coefficient prompt fine-tuning and expansion. Combined with the high-order dynamic characteristics capture of the Kramers-Moyal coefficient and the extended LLM fine-tuning method, the present invention can not only improve the classification accuracy, but also enhance 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 a Kramers-Moyal coefficient-prompted fine-tuned extended LLM, comprising: Step 1: Collect multi-source spatiotemporal trajectory data and perform data preprocessing; Step 2: Calculate the Kramers-Moyal coefficient 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; Step 4: Input the Kramers-Moyal coefficient 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.
[0011] Furthermore, the data preprocessing includes data cleaning and data normalization of the multi-source spatiotemporal trajectory data.
[0012] Furthermore, the preprocessed multi-source spatiotemporal trajectory data is divided into multiple tokens, 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 preferentially divide the data block with the largest variance into multiple tokens.
[0013] Furthermore, the fine-tuning process of the preset extended LLM includes: The extended LLM is fine-tuned using a labeled spatiotemporal trajectory dataset. During the fine-tuning process, only the parameters of the newly added L Transformer blocks are updated, keeping the parameters of the original LLM fixed.
[0014] 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 jump connection is added between the output of the multi-head attention layer and the input of the residual connection and layer normalization.
[0015] Furthermore, the spatiotemporal feature extraction adapter includes a CNN and two bidirectional LSTM layers connected in sequence.
[0016] Furthermore, the spatiotemporal compression adapter adopts a CNN connected multi-layer perceptron structure.
[0017] In a second aspect, the present invention provides a spatiotemporal trajectory classification device based on a Kramers-Moyal coefficient-prompted fine-tuned extended LLM, comprising: Data collection and preprocessing module, used to collect multi-source spatiotemporal trajectory data and perform data preprocessing; A calculation module, used to calculate the Kramers-Moyal coefficient of the preprocessed multi-source spatiotemporal trajectory data; Data block optimizer, used to divide the preprocessed multi-source spatiotemporal trajectory data into multiple tokens; The spatiotemporal feature extraction adapter is used to extract spatial and temporal features based on the vectorization results after multiple tokens are vectorized; A classification module is used to input the Kramers-Moyal coefficient 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.
[0018] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect when executing the program.
[0019] In a fourth aspect, 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.
[0020] Beneficial effects of the present invention: (1) Improved classification accuracy. By introducing the Kramers-Moyal coefficient, the model can effectively capture the high-order dynamic characteristics in the trajectory data, thereby improving the ability to recognize complex spatiotemporal trajectory patterns, especially in the case of noise and missing data, the classification accuracy is significantly improved.
[0021] (2) Enhance model robustness. The Kramers-Moyal coefficient, as a hint, helps 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.
[0022] (3) Effectively handle long-term dependencies. By extending the LLM and fine-tuning the model, especially the expansion of the Transformer block, while retaining its general language understanding ability, the model can better capture the long-term dependencies and complex spatiotemporal associations in spatiotemporal trajectory data, thereby improving the effect of trajectory classification.
[0023] (4) Improved few-shot learning capability. The model shows significant advantages in few-shot learning tasks. Even when the amount of data is limited, it can maintain high classification accuracy and is suitable for practical application scenarios where data is scarce.
[0024] (5) Optimizing 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 the training speed and computational efficiency of the model.
[0025] (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., and provide efficient and accurate trajectory analysis and prediction tools for various industries. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A schematic diagram of a flow chart of a spatiotemporal trajectory classification method based on a Kramers-Moyal coefficient-prompted fine-tuned extended LLM provided in an embodiment of the present invention; Figure 2 A schematic diagram of the structure of a spatial-temporal feature extractor adapter (STFEA) provided in an embodiment of the present invention; Figure 3 A schematic diagram of the structure of a spatial-temporal compression adapter (STCA) provided in an embodiment of the present invention; Figure 4 A schematic diagram of a flow chart of a spatiotemporal trajectory classification device based on a Kramers-Moyal coefficient-prompted fine-tuned extended LLM provided in an embodiment of the present invention; Figure 5 A structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] like Figure 1 As shown, an embodiment of the present invention provides a spatiotemporal trajectory classification method based on the LLM with fine-tuning and expansion of the Kramers-Moyal coefficient prompt, comprising the following steps: S101: Collect multi-source spatiotemporal trajectory data and perform data preprocessing; Specifically, multi-source spatiotemporal trajectory data is collected, including but not limited to GPS positioning data, flight data, traffic data, etc. The data type may include attributes of the trajectory such as longitude, latitude, speed, acceleration, timestamp, etc.
[0029] Example datasets may include: Geolife dataset (recording daily activity trajectories), Animals dataset (animal migration trajectories), AIS and ADS-B dataset (ship and aircraft trajectories), etc.
[0030] Data preprocessing mainly includes data cleaning and data normalization. First, the collected raw data is cleaned, outliers are removed, missing data are processed, and missing trajectory points are filled; the filling methods include time series interpolation (such as cubic spline interpolation) and weighted moving average method. Then the cleaned data is normalized to standardize the values of longitude, latitude, speed, acceleration, etc. to a unified range.
[0031] The normalized dataset is divided into a training set and a test set, and the training set with category labels is subsequently used to fine-tune the extended LLM.
[0032] S102: Calculate the Kramers-Moyal coefficient of the preprocessed multi-source spatiotemporal trajectory data, and divide the preprocessed multi-source spatiotemporal trajectory data into multiple tokens; Specifically, kernel density estimation (KDE) is performed on the preprocessed spatiotemporal trajectory data to estimate the probability density function (PDF) of the data. 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 coefficient is calculated, which can capture the high-order dynamic characteristics in the spatiotemporal trajectory, especially for complex patterns such as jumps and nonlinear changes in the data.
[0033] First, the preprocessed multi-source spatiotemporal trajectory data is divided into blocks, and then the data block optimizer PatchingOptimizer is used to dynamically adjust the appropriate data block size (automatically selected according to the variance of the data) to optimize the model's learning efficiency for trajectories in different time periods. This module calculates the variance of the data block and selects the data block with the largest variance to prioritize and divide it into multiple tokens to ensure data diversity and information richness.
[0034] The Patching Optimizer module selects the most informative areas for processing by calculating the variance of data patches. The variance of a data patch measures the degree of change in the data. The larger the variance, the more information the area contains and the more obvious the change. 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 can prioritize areas that contain more key features rather than treating all data indiscriminately. This module can automatically determine the optimal data patch size and moving step size, and improve the learning efficiency and effect of the model by maximizing the variance between data patches. This optimization is particularly important for processing spatiotemporal trajectory data of variable length, which helps the model better capture high-order dynamic features in the data.
[0035] S103: vectorizing multiple tokens as input to the spatiotemporal feature extraction adapter to extract spatial and temporal features; Specifically, Figure 2 As shown, the spatiotemporal feature extraction adapter includes a CNN and two bidirectional LSTM layers connected in sequence, and the CNN and bidirectional LSTM layers are combined to extract temporal and spatial features.
[0036] S104: Input the Kramers-Moyal coefficient 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. Assuming that the number of Transformer blocks contained in the original LLM is N, and L Transformer blocks are added after the original Transformer blocks, the extended model will contain a total of N+L Transformer blocks.
[0037] Specifically, using the Kramers-Moyal coefficient as an input feature of the model can help the model better understand the dynamic dependencies in the data, especially when dealing with data containing noise or irregular sampling.
[0038] On the basis of existing pre-trained large language models (such as GPT-2), additional Transformer blocks are added to obtain extended LLMs. These additional Transformer blocks are initialized through the "identity mapping" strategy to ensure that the original reasoning ability of the model is not affected. The extended model adds more Transformer layers, enabling it to better process long-span spatiotemporal trajectory data and improve its ability to capture complex dynamic changes.
[0039] Furthermore, in order to improve the computational efficiency and reduce the computational complexity, specifically, Figure 1 As shown in , 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 jump 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 multi-layer perceptron (MLP) structure to compress spatiotemporal features, reduce redundant information, improve computational efficiency, reduce computational complexity and reduce overfitting risks.
[0040] Fine-tuning and training process: The Kramers-Moyal coefficients and spatial and temporal features corresponding to the training set are input into the extended LLM, and the extended LLM is fine-tuned, such as Figure 1 As shown in the figure, only the parameters of the newly added L Transformer blocks are updated, and the parameters of the original Transformer blocks are kept fixed to retain the general reasoning ability of the model. The Adam optimizer is used for training, and the appropriate learning rate and number of steps are used for fine-tuning to ensure that the model can learn accurate classification patterns from the spatiotemporal trajectory data.
[0041] It should be noted that for the extended Transformer block, this embodiment adopts an improved initialization strategy, initializing the initial weight W0 to zero, that is, initializing the weight matrix of the two-layer linear transformation of FFN to zero to ensure the "identity mapping" feature; the layer normalization (layernorm) parameter is also set to 0. At the same time, the attention module weight is randomly initialized.
[0042] Testing process: After training, the model is used for spatiotemporal trajectory classification tasks. The Kramers-Moyal coefficients and spatial and temporal features corresponding to the test set are input into the model, and the model will output the category label of the trajectory. Classification tasks can include different trajectory pattern recognition, such as traffic patterns, animal migration patterns, etc.
[0043] Furthermore, in terms of model performance evaluation, we can use indicators such as accuracy, precision, recall, and F1-score to evaluate the classification performance of the model and compare it with the existing baseline model. We can also verify the application effect of the model in different scenarios and ensure its generalization ability by testing on multiple data sets (such as Geolife, AIS, ADS-B, etc.).
[0044] Furthermore, in terms of the few-shot learning evaluation of the model, an evaluation is performed in a few-shot learning scenario to test the performance of the model with a small number of samples and verify its robustness and accuracy under data-scarce conditions.
[0045] The present invention provides a spatiotemporal trajectory classification method based on the LLM extended by fine-tuning with the Kramers-Moyal coefficient prompt. By introducing the Kramers-Moyal coefficient as a prompt, the Patching Optimizer module, the spatiotemporal feature extraction adapter (STFEA) and the spatiotemporal compression adapter (STCA) are designed to improve the model's ability to understand and classify spatiotemporal trajectory data, and can adapt to spatiotemporal trajectory classification tasks in different fields. For example, in the field of intelligent transportation, trajectory classification can be used for traffic pattern recognition, road flow prediction, traffic accident analysis, etc. In the field of public safety, it can be applied to the trajectory classification and behavior prediction of mobile targets such as police vehicles and drones. In the field of logistics management, it is used for the optimization and monitoring of logistics vehicle trajectories. In the field of environmental monitoring, the trajectories of natural disasters, animal migration, etc. are analyzed.
[0046] Corresponding to the above method, such as Figure 4 As shown, an embodiment of the present invention also provides a spatiotemporal trajectory classification device based on the LLM with fine-tuning extension of the Kramers-Moyal coefficient prompt, including a data collection and preprocessing module, a calculation module, a data block optimizer, a spatiotemporal feature extraction adapter and a classification module.
[0047] Among them, the data collection and preprocessing module is used to collect multi-source spatiotemporal trajectory data and perform data preprocessing; the calculation module is used to calculate the Kramers-Moyal coefficient 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; the spatiotemporal feature extraction adapter is used to extract spatial and temporal features according to the vectorization results after the multiple tokens are vectorized; the classification module is used to input the Kramers-Moyal coefficient 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: L Transformer blocks are added after the original LLM.
[0048] It should be noted that the spatiotemporal trajectory classification device provided in the embodiment of the present invention is for realizing the above method. The specific functions thereof can be referred to the above method embodiment, which will not be described in detail here.
[0049] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5As shown, the electronic device may include: a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502 and the memory 503 communicate with each other through the communication bus 504. The processor 501 may call the logic instructions in the memory 503 to execute the spatiotemporal trajectory classification method, which includes: collecting multi-source spatiotemporal trajectory data and performing data preprocessing; calculating the Kramers-Moyal coefficient of the preprocessed multi-source spatiotemporal trajectory data, and dividing the preprocessed multi-source spatiotemporal trajectory data into multiple tokens; vectorizing the multiple tokens as inputs of the 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.
[0050] In addition, when the logic instructions in the above-mentioned memory 503 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0051] An embodiment of the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned method embodiments, for example, including: 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 as input of 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.
[0052] An embodiment of the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method provided by the above-mentioned method embodiments is implemented, for example, including: collecting multi-source spatiotemporal trajectory data and performing data preprocessing; calculating the Kramers-Moyal coefficient of the preprocessed multi-source spatiotemporal trajectory data, and dividing the preprocessed multi-source spatiotemporal trajectory data into multiple tokens; vectorizing the multiple tokens as input of the spatiotemporal feature extraction adapter to extract spatial and temporal features; inputting the Kramers-Moyal coefficient 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.
[0053] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0054] 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 embodiments of the present invention.
Claims
1. A spatiotemporal trajectory classification method based on the LLM with fine-tuning and extension based on the Kramers-Moyal coefficient, characterized in that: include: Step 1: Collect multi-source spatiotemporal trajectory data and perform data preprocessing; Step 2: Calculate the Kramers-Moyal coefficient 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; Step 4: Input the Kramers-Moyal coefficient 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.
2. The spatiotemporal trajectory classification method based on the LLM with Kramers-Moyal coefficient hint fine-tuning and extension 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 the LLM with Kramers-Moyal coefficient hint fine-tuning and extension according to claim 1, characterized in that: The preprocessed multi-source spatiotemporal trajectory data is divided into multiple tokens, 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 preferentially divide the data block with the largest variance into multiple tokens.
4. The spatiotemporal trajectory classification method based on the LLM with Kramers-Moyal coefficient hint fine-tuning and extension according to claim 1, characterized in that: The fine-tuning process of the preset extended LLM includes: The extended LLM is fine-tuned using a labeled spatiotemporal trajectory dataset. During the fine-tuning process, only the parameters of the newly added L Transformer blocks are updated, keeping the parameters of the original LLM fixed.
5. The spatiotemporal trajectory classification method based on the LLM with Kramers-Moyal coefficient hint fine-tuning and extension 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 the LLM with Kramers-Moyal coefficient hint fine-tuning and extension according to claim 1, characterized in that: The spatiotemporal feature extraction adapter includes a CNN and two bidirectional LSTM layers connected in sequence.
7. The spatiotemporal trajectory classification method based on the LLM with Kramers-Moyal coefficient hint fine-tuning and extension according to claim 5, characterized in that: The spatiotemporal compression adapter adopts a CNN connected multi-layer perceptron structure.
8. A spatiotemporal trajectory classification device based on the LLM fine-tuned and extended by the Kramers-Moyal coefficient, characterized in that: include: Data collection and preprocessing module, used to collect multi-source spatiotemporal trajectory data and perform data preprocessing; A calculation module, used to calculate the Kramers-Moyal coefficient of the preprocessed multi-source spatiotemporal trajectory data; Data block optimizer, used to divide the preprocessed multi-source spatiotemporal trajectory data into multiple tokens; The spatiotemporal feature extraction adapter is used to extract spatial and temporal features based on the vectorization results after multiple tokens are vectorized; A classification module is used to input the Kramers-Moyal coefficient 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.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.
10. 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, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Intelligent agent trajectory prediction method, system and device under frequency domain perspective, and medium
CN115661199A
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
Cited By
Construction method and use method of trajectory generation model
CN122432681A