Efficient semantic perception pre-training track representation learning method and device
By combining the Traj-Mamba encoder and the learnable mask generator, the computational burden and low efficiency problems in learning vehicle trajectory semantic information are solved, and efficient trajectory embedding generation is achieved, which is suitable for intelligent transportation systems.
Patent Information
- Application Number
- CN202511460395.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-14
- Publication Date
- 2026-02-17
AI Technical Summary
Existing technologies suffer from heavy computational burden and low efficiency when learning semantic information from vehicle trajectories, especially when integrating textual information, where computational complexity is high, and existing trajectory compression methods lack learnability.
Trajectory embeddings are generated using a Traj-Mamba encoder. The encoder is trained using road views and point-of-interest views, pre-trained using contrastive learning, and combined with a learnable mask generator to filter redundant points to generate compressed embeddings. Alignment is achieved using maximum entropy coding and a mask length loss function.
It effectively captures the travel purpose information of vehicle trajectories, avoids the computational overhead of introducing large language models in downstream tasks, improves coding efficiency and embedding quality, and is suitable for real-time trajectory analysis.
Smart Images

Figure CN121542685A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to an efficient semantic-aware pre-training trajectory representation learning method and device. BACKGROUND
[0002] The vehicle GPS trajectory records the movement process of the vehicle over time, and contains valuable travel semantics including movement patterns, travel purposes, etc. These semantic information plays an important supporting role in spatio-temporal data mining tasks such as trajectory prediction, travel time estimation, and anomaly detection, and is indispensable in the construction of intelligent transportation systems. At present, vehicle trajectory learning methods are mainly divided into end-to-end trajectory learning methods and pre-training trajectory embedding methods. The end-to-end method is designed for a specific task, although it is easy to implement, but it is difficult to reuse, and the model needs to be designed, trained and stored separately for each task, and the performance depends on a large number of task-specific labels, and the applicability is limited. The pre-training trajectory embedding method maps the trajectory to an embedding vector through the learning of a trajectory encoder, which can be used across tasks, and has received attention in recent years, such as methods based on RNN (Recurrent Neural Network), Transformer, and methods combining contrastive learning and multi-task training.
[0003] However, the existing technology still has obvious deficiencies: on the one hand, when extracting the travel purpose, the road traversed by the trajectory and the functional information of the point-of-interest (POI) need to be combined, and these information is usually encoded in the text description. In order to process this kind of text information, the method of integrating a language model in the standard trajectory learning model will significantly increase the computational burden, and cannot balance efficiency and semantic richness; on the other hand, actual trajectories have a large number of redundant points (such as trajectory points collected during traffic congestion or when the vehicle maintains a constant speed) that cannot provide useful information due to high-frequency sampling, so it is necessary to compress the trajectory to improve the encoding efficiency and embedding quality at the same time. Most of the existing trajectory compression methods are based on rules or geometric principles (such as the Douglas-Peucker algorithm), which have high time complexity and lack learnability.
[0004] Therefore, how to efficiently and sufficiently learn the semantic information in the vehicle trajectory is still a problem to be solved in the existing technology. SUMMARY
[0005] The present application provides an efficient semantic-aware pre-training trajectory representation learning method and device, which solves the technical problem of how to efficiently and sufficiently learn the semantic information in the vehicle trajectory.
[0006] The present application provides an efficient semantic-aware pre-training trajectory representation learning method, comprising:
[0007] generating a trajectory embedding of the vehicle trajectory through a first encoder;
[0008] training the first encoder according to a road view and a point of interest view of the vehicle trajectory;
[0009] initializing a second encoder according to weights of the first encoder;
[0010] generating a compressed embedding of a vehicle trajectory by the second encoder;
[0011] aligning the trajectory embedding with the compressed embedding.
[0012] Optionally, the generating, by the first encoder, a trajectory embedding of a vehicle trajectory comprises:
[0013] obtaining a GPS view feature, a road view feature, and a high-order motion feature sequence of each trajectory point in the vehicle trajectory;
[0014] inputting the GPS view feature, the road view feature, and the high-order motion feature sequence into the first encoder to obtain the trajectory embedding generated by the first encoder.
[0015] Optionally, the first encoder is configured to:
[0016] map the GPS view feature into a first latent vector sequence and map the road view feature into a second latent vector sequence;
[0017] input the first latent vector sequence, the second latent vector sequence, and the high-order motion feature sequence into a plurality of stacked Traj-Mamba blocks to obtain a GPS latent vector and a road latent vector output by the Traj-Mamba blocks;
[0018] concatenate and mean-pool the GPS latent vector and the road latent vector to obtain the trajectory embedding.
[0019] Optionally, before the training the first encoder according to a road view and a point of interest view of the vehicle trajectory, the method further comprises:
[0020] obtaining a road segment text description and a point of interest text description of each trajectory point in the vehicle trajectory;
[0021] generating the road view according to the road segment text description and generating the point of interest view according to the point of interest text description.
[0022] Optionally, the training the first encoder according to a road view and a point of interest view of the vehicle trajectory comprises:
[0023] aligning the trajectory embedding with the road view and the point of interest view by contrast learning to obtain the first encoder with fixed weights.
[0024] Optionally, the second encoder has the same structure as the first encoder.
[0025] Optionally, the generating, by the second encoder, of the compressed embedding of the vehicle trajectory comprises:
[0026] filtering trajectory points in the vehicle trajectory to obtain a compressed trajectory;
[0027] inputting the compressed trajectory into the second encoder to obtain the compressed embedding generated by the second encoder.
[0028] Optionally, the filtering trajectory points in the vehicle trajectory to obtain a compressed trajectory comprises:
[0029] preprocessing the vehicle trajectory to obtain a preprocessed trajectory;
[0030] inputting the preprocessed trajectory into a mask generator to obtain the compressed trajectory output by the mask generator.
[0031] Optionally, the aligning the trajectory embedding with the compressed embedding comprises:
[0032] aligning the trajectory embedding with the compressed embedding through a maximum entropy encoding loss function and a mask length loss function.
[0033] The application further provides an efficient semantic-aware pre-training trajectory representation learning device, comprising:
[0034] a first generation module configured to generate a trajectory embedding of a vehicle trajectory through a first encoder;
[0035] a first training module configured to train the first encoder according to a road view and a point of interest view of the vehicle trajectory;
[0036] an initialization module configured to initialize a second encoder according to the weights of the first encoder;
[0037] a second generation module configured to generate a compressed embedding of the vehicle trajectory through the second encoder;
[0038] a second training module configured to align the trajectory embedding with the compressed embedding.
[0039] The one or more technical solutions provided by the application have at least the following technical effects or advantages:
[0040] This invention uses travel purpose perception pre-training, eliminating the need to introduce large language models in the downstream task encoding stage. While effectively capturing travel purpose, it avoids additional computational overhead and solves the problem of heavy computational burden when integrating text information in traditional methods. It can efficiently and fully learn semantic information in vehicle trajectories, making real-time trajectory analysis possible. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a flowchart illustrating an efficient semantic perception pre-trained trajectory representation learning method in an embodiment of the present invention.
[0043] Figure 2 This is a schematic diagram of the Traj-Mamba block in an embodiment of the present invention;
[0044] Figure 3 This is a schematic diagram illustrating the principle of an efficient semantic perception pre-trained trajectory representation learning method in an embodiment of the present invention.
[0045] Figure 4 This is a schematic diagram of an efficient semantic-aware pre-trained trajectory representation learning device in an embodiment of the present invention. Detailed Implementation
[0046] This invention provides an efficient semantic-aware pre-trained trajectory representation learning method and apparatus, solving the technical problem of how to efficiently and fully learn semantic information in vehicle trajectories.
[0047] To better understand the technical solution of the present invention, the technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0048] like Figure 1 As shown, the efficient semantic perception pre-trained trajectory representation learning method of the present invention includes, but is not limited to, steps S1, S2, S3, S4 and S5.
[0049] Step S1: Generate the trajectory embedding of the vehicle trajectory using the first encoder.
[0050] The first encoder can be a Traj-Mamba encoder.
[0051] In this invention, a vehicle trajectory is a time-stamped location sequence, denoted as... where n is the total number of trajectory points, τ i = (g i , e i , t i ) denotes the i-th trajectory point, containing GPS coordinates g i , road segment e i , and timestamp t i .
[0052] In one embodiment, step S1 can specifically include:
[0053] obtaining a GPS view feature, a road view feature, and a high-order motion feature sequence of each trajectory point in the vehicle trajectory;
[0054] inputting the GPS view feature, the road view feature, and the high-order motion feature sequence into a first encoder to obtain a trajectory embedding generated by the first encoder.
[0055] Specifically, for each trajectory point τ i of the vehicle trajectory , its GPS view feature and road view feature are extracted. The GPS view feature includes the GPS coordinates g i , relative time difference Δt i (i.e., the time interval relative to the starting point of the trajectory), and the minute-level timestamp of each trajectory point; the road view feature includes the road segment ID, date, hour, and minute information. In addition, to capture the dynamic motion state of the vehicle, a high-order motion feature sequence containing the speed, acceleration, and moving angle (derived by the coordinates and time difference of adjacent trajectory points) of each trajectory point is calculated. These features are used to guide the subsequent generation of selective state space model (SSM) parameters.
[0056] In one embodiment, the first encoder can be specifically used for:
[0057] mapping the GPS view feature into a first latent vector sequence and mapping the road view feature into a second latent vector sequence;
[0058] inputting the first latent vector sequence, the second latent vector sequence, and the high-order motion feature sequence into a plurality of stacked Traj-Mamba blocks to obtain a GPS latent vector and a road latent vector output by the Traj-Mamba blocks;
[0059] concatenating and mean-pooling the GPS latent vector and the road latent vector to obtain the trajectory embedding.
[0060] The process of generating the trajectory embedding by the first encoder includes:
[0061] mapping the above features into a latent vector sequence through an embedding layer. The GPS view feature is linearly transformed to obtain a first latent vector sequence Road-view features are indexed and embedded into a second latent vector sequence where E is the embedding dimension. These latent vector sequences are fed into the stacked Traj-Mamba blocks as input, i.e., as input to the first Traj-Mamba block.
[0062] Each Traj-Mamba block structure is shown in Figure 2 and contains two parallel selective SSM branches: GPS-SSM and Road-SSM, which process the GPS-view and road-view latent vectors, respectively. In the GPS-SSM branch, the input latent vector is first passed through a linear layer, a 1D causal convolution, and a SiLU activation function to capture local feature dependencies, generating an intermediate vector Subsequently, based on high-order motion features the dynamic parameters B, C, Δ of the SSM are computed via linear projection, enabling the model to adjust the state space according to the vehicle's motion details (e.g., acceleration, turning), enhancing the ability to capture complex movement patterns. Similarly, the Road-SSM branch takes as input, passes through a linear layer and a SiLU activation to obtain whose parameters B', C', Δ' are derived from the output intermediate vector of the GPS-SSM, enabling cross-view information interaction, allowing the road feature modeling to dynamically respond to the motion changes observed by GPS.
[0063] Subsequently, the outputs of the two branches are fused through a dot product gating mechanism: the output of the GPS-SSM is element-wise multiplied with the input of the Road-SSM , normalized by RMSNorm and linearly transformed to obtain the output of the Road-SSM is directly linearly transformed to obtain This fusion method ensures deep interaction between GPS and road-view features, preserving their unique information while achieving semantic complementarity.
[0064] Finally, after processing by L Traj-Mamba blocks, the final GPS latent vector and the road latent vector are concatenated and mean-pooled to generate a trajectory embedding of dimension E as output of the first encoder.
[0065] This invention employs dual SSM branch joint modeling of GPS and road perspectives, and achieves cross-perspective information interaction through dynamic parameter generation, solving the problem that single-perspective modeling is difficult to fully capture movement patterns. By introducing high-order motion features to guide SSM parameter adjustment, the first encoder can adapt to changes in vehicle motion state, improving the ability to represent complex behaviors (such as rapid acceleration and sharp turns). Feature fusion is achieved through dot product gating mechanism, which enhances the flexibility of feature interaction while ensuring computational efficiency.
[0066] Step S2: Train the first encoder based on the road view and point of interest view of the vehicle trajectory.
[0067] Prior to step S2, the efficient semantic-aware pre-trained trajectory representation learning method of the present invention further includes:
[0068] Obtain the road segment text description and point of interest text description for each trajectory point in the vehicle trajectory;
[0069] Generate a road view based on the road segment text description, and generate a point-of-interest (POI) view based on the point-of-interest (POI) text description.
[0070] The road network of this invention is modeled as a directed graph. in Let be the set of nodes, and ε be the set of edges. Each node This indicates the intersection or end point of a road segment. Each edge e i ∈ε represents a road segment connecting two nodes, defined as v j As the starting node, v k As the endpoint node, This includes a text description of the road segment (including the road's name and type).
[0071] Points of Interest (POIs) are locations of specific cultural, environmental, or economic importance, denoted as... Includes GPS coordinates g i and text description of points of interest (Including the name, type, and address of the POI).
[0072] Specifically, firstly, regarding the trajectory Each trajectory point τ i Match it with the p that is geographically closest i And extract the corresponding road segment e i , and These text descriptions are generated through a pre-trained text embedding module E. text (such as OpenAI's text-embedding-3-large) is converted into the initial text embedding. and
[0073] Then, to enhance the semantic richness of the text embedding, updates are performed by aggregating local and global information. and For section e i Based on the road network topology, the embedding of its adjacent road segments and the embedding of the trajectory start and end segments are aggregated, and residual connections are used to... Updated to For p i It aggregates the embeddings of surrounding POIs and the embeddings of the trajectory's start and end points, and overlays the POI index embeddings, then uses residual connections to... Updated to The aggregation process employs a weighted summation mechanism, where the weights of adjacent elements are determined by both textual relevance and geographical distance, ensuring that important contextual information is effectively captured.
[0074] Updated road segment embedding sequence and POI embedding sequence Semantic relationships within the sequence are captured through two layers of Mamba2 blocks, followed by mean pooling to generate a road view of the trajectory. and Point of Interest View These two views together encode the travel purpose semantics of the trajectory.
[0075] In one embodiment, step S2 of the present invention may specifically include:
[0076] By aligning the trajectory embedding with the road view and point of interest view through contrastive learning, a first encoder with fixed weights is obtained.
[0077] Specifically, for a batch trajectory Each trajectory in Embedded with the trajectory output by the first encoder As anchor points, connect the same trajectory and As positive samples, the road views and POI views of other trajectories within the batch are used as negative samples, and the InfoNCE loss function is used to optimize the first encoder:
[0078]
[0079] in, These represent the contrastive losses between trajectory embedding and road view, and between trajectory embedding and point-of-interest view, respectively. Through this process, the trajectory embedding is guided to align with the semantic view in the vector space, thereby implicitly containing travel purpose information.
[0080] After the pre-training process is completed, the weights of the first encoder are fixed and used as the teacher model in the subsequent knowledge distillation pre-training process.
[0081] This invention enables a trajectory encoder to capture the travel purpose of a trajectory through pre-training, without introducing additional computational overhead by explicitly using a language model when generating embeddings in downstream tasks. Specifically, the method of optimizing text embedding by combining local adjacency information and global start-end point information enhances the geographical relevance and completeness of semantic representation. Furthermore, achieving implicit alignment between trajectory embeddings and semantic views through contrastive learning avoids reliance on explicit semantic annotation.
[0082] Step S3: Initialize the second encoder according to the weights of the first encoder.
[0083] The second encoder has the same structure as the first encoder; that is, the second encoder can also be a Traj-Mamba encoder. The first encoder is the teacher model, and the second encoder is the student model.
[0084] Step S4: Generate a compressed embedding of the vehicle trajectory using the second encoder.
[0085] In one embodiment, step S4 of the present invention may specifically include:
[0086] By filtering the trajectory points in the vehicle trajectory, a compressed trajectory is obtained;
[0087] The compressed trajectory is input into the second encoder to obtain the compressed embedding generated by the second encoder.
[0088] In one embodiment, filtering trajectory points in the vehicle trajectory to obtain a compressed trajectory may further include:
[0089] The vehicle trajectory is preprocessed to obtain the preprocessed trajectory;
[0090] The preprocessed trajectory is input into the mask generator to obtain the compressed trajectory output by the mask generator.
[0091] Specifically, firstly, the original vehicle trajectory... Preprocessing is performed. Explicitly redundant points are filtered out, including midpoints during vehicle stationary periods (speed is zero and duration exceeds a threshold) and points of uniform speed on the same road segment (speed change rate is below a threshold), resulting in a preprocessed trajectory.
[0092] For the preprocessed trajectory, the mask generator generates a mask m through a sparse random gate to identify key trajectory points that need to be retained. The calculation of the mask parameter μ incorporates the potential temporal correlation of trajectory features. Specifically, it first captures the trajectory using lightweight Mamba blocks. The time dependency of the feature is then compared with the randomly initialized... μ is obtained after Sigmoid activation and mean pooling. The mask value m for each trajectory point. i By μ i (Gaussian noise is added during training but not during testing.) The resulting image is truncated to [0,1], which ensures sparsity while reducing mask variance. The preprocessed trajectory is then filtered based on the mask m. The compressed trajectory can then be obtained. Will Input the student model (second encoder) to generate compressed embeddings
[0093] Step S5: Align the trajectory embedding with the compressed embedding.
[0094] In one embodiment, step S5 may specifically include:
[0095] The trajectory embedding and compressed embedding are aligned using the maximum entropy coding loss function and the mask length loss function.
[0096] The Maximum Entropy Coding (MEC) loss function maximizes the amount of information contained in the compressed embedding; the mask length loss function controls the average length of the compressed trajectory through a Gaussian error function. To balance efficiency and effectiveness, the final total loss is defined as:
[0097]
[0098] in, This represents the trajectory of a batch of vehicles. The maximum entropy encoding loss function is used. is the mask length loss function. After optimizing the student model using this loss, its output compressed embedding can maintain semantic consistency with the full embedding while significantly reducing the number of trajectory points in the input trajectory encoder.
[0099] Steps S3, S4, and S5 of this invention are equivalent to knowledge distillation pre-training. By proposing a learnable mask generator, key trajectory points are identified with linear time complexity based on the temporal correlation of trajectory features. The alignment between compressed embedding and complete embedding is achieved through MEC loss, which solves the semantic offset problem that may occur during compression. The compressed trajectory length is constrained by combining mask length loss, which improves the encoding speed while ensuring the embedding quality.
[0100] Based on the above, we can conclude that... Figure 3 The complete technical solution of the present invention, as shown, includes: introducing a Traj-Mamba encoder to generate embedding vectors to effectively capture movement patterns; and proposing a pre-training method for travel purpose perception to efficiently perceive travel purpose, by combining the learned embeddings with the trajectory. The Traj-Mamba encoder is trained by aligning road views and point-of-interest (POI) views, where the road views and POI views encode the travel purpose using a road text encoder and a POI text encoder. After this pre-training, the encoder has fixed weights and serves as a teacher model in subsequent processes. This is done to effectively reduce trajectory... To address the redundancy in the data, a knowledge distillation pre-training method was designed, which uses a learnable mask generator to identify trajectories. The key trajectory points in the model are used to compress the trajectory. Then, the compressed representation generated by the Traj-Mamba encoder initialized by the teacher model is aligned with the complete trajectory embedding generated by the teacher model. Finally, the compressed representation is used as... The trajectory representation is used for various downstream tasks.
[0101] This section uses urban taxi trajectory data as an example. Figure 3 For example:
[0102] Dataset preparation: A real-world vehicle trajectory dataset was used, containing 140,000 GPS trajectory records (18,832,411 trajectory points) for taxis, spanning from September 30 to October 10, 2018. Additionally, POI information (such as name, type, and coordinates) was obtained from the Amap API, and road network data (such as road network topology, road type, and text description) was obtained from OpenStreetMap.
[0103] Preprocessing: 1) Remove abnormal trajectories with a length less than 5 or greater than 120 points, retaining valid trajectories within a reasonable range; 2) Use a Hidden Markov Model (HMM) to match each GPS point to its corresponding road segment, obtaining a map matching trajectory containing the road segment ID; 3) Find adjacent road segments for each road segment based on the road network topology, and find POIs within a 300-meter radius of each POI as its surrounding POIs; 4) Extract features from the trajectory to obtain its GPS view features, road view features, and high-order motion features; 5) Filter out explicit redundant points for the trajectory, including midpoints during vehicle stationary periods (speed is zero and duration exceeds a threshold) and uniform speed points on the same road segment (speed change rate is less than a threshold), obtaining the preprocessed trajectory.
[0104] Traj-Mamba encoder:
[0105] 1) For the trajectory Map its GPS features and road features into latent vector sequences and 2) Stack L layers of Traj-Mamba blocks and extract their high-order motion feature sequences. 3) Map the parameters of L GPS-SSMs in the L-layer Traj-Mamba block to the linear layer in one step; and The input is fed into stacked Traj-Mamba blocks, ultimately yielding trajectory embeddings of dimension E.
[0106] Pre-training for trip purpose perception:
[0107] 1) For a batch of trajectories The Traj-Mamba encoder, road text encoder, and POI text encoder are used to generate trajectory embeddings, road views, and POI views; 2) These encoders are trained using the InfoNCE loss function, i.e.: 3) Repeat the first two steps until the model converges and the pre-training of travel purpose perception ends; 4) Fix the weights of the Traj-Mamba encoder and use the encoder as the teacher model in the knowledge distillation pre-training process.
[0108] Knowledge distillation pre-training:
[0109] 1) Generate complete embeddings for all trajectories using the teacher model and store them; 2) Initialize a student model using the teacher model weights; 3) For a batch of trajectories... The preprocessed trajectories are input into a mask generator to obtain their compressed trajectories (first obtain the corresponding mask, then filter the preprocessed trajectories based on the mask to obtain the compressed trajectories), and then these compressed trajectories are input into the student model to generate compressed embeddings; 4) Use loss Optimize the student model; 5) Repeat steps 3 and 4 until the model converges, and the knowledge distillation pre-training ends.
[0110] Downstream task applications:
[0111] Taking destination prediction as an example, the last 5 points of each trajectory are deleted; then, the compressed embedding of the trajectory is obtained through a mask generator and a student Traj-Mamba encoder, which is used for the trajectory embedding in the downstream task; the trajectory embedding is fed into the prediction head composed of a 2-layer fully connected network to output the destination prediction value (GPS coordinates or road segment).
[0112] As described above, the efficient semantic-aware pre-trained trajectory representation learning method of this invention pre-trains based on travel purpose perception, eliminating the need to introduce a large language model in the downstream task encoding stage. While effectively capturing travel purpose, it avoids additional computational overhead, solving the problem of heavy computational burden when integrating text information in traditional methods, and providing a possibility for real-time trajectory analysis. This invention utilizes a learnable mask generator to dynamically identify and filter redundant points in the trajectory, significantly reducing the number of trajectory points and greatly shortening the embedding encoding time, while also enhancing the quality of the generated trajectory embeddings. The trajectory embeddings generated by this invention can be used for various downstream tasks, exhibiting good generalization and balancing efficiency and accuracy. It can provide a more reliable basis for decision-making in intelligent transportation systems and is adaptable to real-time processing scenarios of large-scale trajectory data, such as urban traffic monitoring and intelligent navigation, demonstrating strong practical application value.
[0113] like Figure 4 As shown, the efficient semantic-aware pre-trained trajectory representation learning device provided by the present invention includes, but is not limited to:
[0114] The first generation module is used to generate a trajectory embedding of the vehicle trajectory through the first encoder;
[0115] The first training module is used to train the first encoder based on the road view and point of interest view of the vehicle trajectory;
[0116] An initialization module is used to initialize the second encoder based on the weights of the first encoder;
[0117] The second generation module is used to generate a compressed embedding of the vehicle trajectory through the second encoder;
[0118] The second training module is used to align the trajectory embedding with the compressed embedding.
[0119] In one embodiment, the first generation module can also be used for:
[0120] Obtain the GPS view features, road view features, and high-order motion feature sequences of each trajectory point in the vehicle trajectory;
[0121] The GPS viewpoint features, road viewpoint features, and high-order motion feature sequences are input into the first encoder to obtain the trajectory embedding generated by the first encoder.
[0122] In one embodiment, the first encoder can be used for:
[0123] GPS view features are mapped to a first latent vector sequence, and road view features are mapped to a second latent vector sequence;
[0124] The first latent vector sequence, the second latent vector sequence, and the higher-order motion feature sequence are input into multiple stacked Traj-Mamba blocks to obtain the GPS latent vectors and road latent vectors output by the Traj-Mamba blocks.
[0125] The GPS latent vector and the road latent vector are concatenated and mean-pooled to obtain the trajectory embedding.
[0126] In one embodiment, the efficient semantic-aware pre-trained trajectory representation learning device may further include:
[0127] The third generation module is used to obtain the road segment text description and point of interest text description of each trajectory point in the vehicle trajectory; generate a road view based on the road segment text description, and generate a point of interest view based on the point of interest text description.
[0128] In one embodiment, the first training module can also be used for:
[0129] By aligning the trajectory embedding with the road view and point of interest view through contrastive learning, a first encoder with fixed weights is obtained.
[0130] In one embodiment, the second encoder has the same structure as the first encoder.
[0131] In one embodiment, the second generation module can also be used for:
[0132] By filtering the trajectory points in the vehicle trajectory, a compressed trajectory is obtained;
[0133] The compressed trajectory is input into the second encoder to obtain the compressed embedding generated by the second encoder.
[0134] In one embodiment, the second generation module can also be used for:
[0135] The vehicle trajectory is preprocessed to obtain the preprocessed trajectory;
[0136] The preprocessed trajectory is input into the mask generator to obtain the compressed trajectory output by the mask generator.
[0137] In one embodiment, the second training module can also be used for:
[0138] The trajectory embedding and compressed embedding are aligned using the maximum entropy coding loss function and the mask length loss function.
[0139] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0140] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. An efficient semantic-aware pre-trained trajectory representation learning method, characterized in that, include: The trajectory embedding of the vehicle trajectory is generated by the first encoder; The first encoder is trained based on the road view and point-of-interest view of the vehicle trajectory; The second encoder is initialized based on the weights of the first encoder; The compressed embedding of the vehicle trajectory is generated by the second encoder; Align the trajectory embedding with the compressed embedding.
2. The efficient semantic-aware pre-trained trajectory representation learning method as described in claim 1, characterized in that, The trajectory embedding generated by the first encoder for the vehicle trajectory includes: Obtain the GPS view features, road view features, and high-order motion feature sequences of each trajectory point in the vehicle trajectory; The GPS viewpoint features, the road viewpoint features, and the higher-order motion feature sequence are input into the first encoder to obtain the trajectory embedding generated by the first encoder.
3. The efficient semantic-aware pre-trained trajectory representation learning method as described in claim 2, characterized in that, The first encoder is used for: The GPS view features are mapped to a first latent vector sequence, and the road view features are mapped to a second latent vector sequence; The first latent vector sequence, the second latent vector sequence, and the higher-order motion feature sequence are input into multiple stacked Traj-Mamba blocks to obtain the GPS latent vectors and road latent vectors output by the Traj-Mamba blocks. The GPS latent vector and the road latent vector are concatenated and averaged to obtain the trajectory embedding.
4. The efficient semantic-aware pre-trained trajectory representation learning method as described in claim 1, characterized in that, Before training the first encoder based on the road view and point of interest view of the vehicle trajectory, the method further includes: Obtain the road segment text description and point of interest text description for each trajectory point in the vehicle trajectory; The road view is generated based on the road segment text description, and the point of interest view is generated based on the point of interest text description.
5. The efficient semantic-aware pre-trained trajectory representation learning method as described in claim 1, characterized in that, Training the first encoder based on the road view and point-of-interest view of the vehicle trajectory includes: By aligning the trajectory embedding with the road view and the point of interest view through contrastive learning, a first encoder with fixed weights is obtained.
6. The efficient semantic-aware pre-trained trajectory representation learning method as described in claim 1, characterized in that, The second encoder has the same structure as the first encoder.
7. The efficient semantic-aware pre-trained trajectory representation learning method as described in claim 1, characterized in that, The compressed embedding of the vehicle trajectory generated by the second encoder includes: The trajectory points in the vehicle trajectory are filtered to obtain a compressed trajectory; The compressed trajectory is input into the second encoder to obtain the compressed embedding generated by the second encoder.
8. The efficient semantic-aware pre-trained trajectory representation learning method as described in claim 7, characterized in that, The step of filtering the trajectory points in the vehicle trajectory to obtain the compressed trajectory includes: The vehicle trajectory is preprocessed to obtain a preprocessed trajectory; The preprocessed trajectory is input into the mask generator to obtain the compressed trajectory output by the mask generator.
9. The efficient semantic-aware pre-trained trajectory representation learning method as described in claim 1, characterized in that, Aligning the trajectory embedding with the compressed embedding includes: The trajectory embedding is aligned with the compressed embedding using the maximum entropy coding loss function and the mask length loss function.
10. A highly efficient semantic-aware pre-trained trajectory representation learning device, characterized in that, include: The first generation module is used to generate a trajectory embedding of the vehicle trajectory through the first encoder; The first training module is used to train the first encoder based on the road view and point of interest view of the vehicle trajectory; An initialization module is used to initialize the second encoder according to the weights of the first encoder; The second generation module is used to generate a compressed embedding of the vehicle trajectory through the second encoder; The second training module is used to align the trajectory embedding with the compressed embedding.