A GPS trajectory travel mode recognition method based on semi-supervised dual-graph learning

By constructing a topological structure of sequence graphs and learnable dependency graphs, and combining pre-training and supervised fine-tuning of a self-supervised mask graph autoencoder, the performance degradation problem of GPS trajectory travel mode recognition in short sequence and sparse label scenarios is solved, achieving higher recognition accuracy and robustness.

CN121834244BActive Publication Date: 2026-07-14NANJING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING UNIV
Filing Date
2026-03-13
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing technologies suffer from a significant drop in GPS trajectory travel mode recognition performance in real-world scenarios with short sequences and sparse labels, making it difficult to maintain stable recognition results in dynamic urban traffic scenarios.

Method used

A semi-supervised dual-graph learning approach is adopted to construct the topology of sequence graphs and learnable dependency graphs. The self-supervised mask graph autoencoder is used for pre-training and supervised fine-tuning. Dependency-aware spatiotemporal representations between trajectory points are learned using unlabeled data, and the model is fine-tuned using a small amount of labeled data.

Benefits of technology

It significantly improves the model's recognition accuracy and robustness in short sequence and sparse label scenarios, reduces the dependence on massive labeled data, and enhances the model's generalization ability and adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121834244B_ABST
    Figure CN121834244B_ABST
Patent Text Reader

Abstract

The application discloses a GPS trajectory travel mode recognition method based on semi-supervised double-map learning, first acquires GPS trajectory data and segments according to time sequence, extracts point features to obtain a plurality of trajectory segments; then constructs a double-map topological structure for each segment, including a sequence map representing local time continuity, and a learnable dependency graph that adaptively captures non-local semantic correlation; then, a self-supervised mask graph autoencoder pre-training is performed on the unlabeled segments to learn a dependency-aware spatiotemporal representation; finally, the pre-trained model is supervised fine-tuned with labeled segments, and the travel mode prediction result is output; the application can fully mine the structured semantic information of short trajectory segments without long sequence trajectories and massive labeled data, effectively overcoming the defects of the prior art that the recognition performance seriously decreases in the short sequence and sparse label scene, and significantly improving the robustness and generalization ability of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent transportation systems and spatial trajectory data mining technology, and particularly relates to a GPS trajectory travel mode recognition method based on semi-supervised dual-graph learning. Background Technology

[0002] With the widespread adoption and rapid development of the Internet of Things (IoT), edge computing, and portable smart devices, massive numbers of GPS positioning terminals have been deployed globally. These terminals continuously generate enormous amounts of vehicle and pedestrian trajectory data with broad coverage, providing an unprecedented data foundation for the construction of intelligent transportation systems. As a key component of smart cities and next-generation mobility systems, accurate mode of transportation identification is crucial for urban traffic planning, dynamic route guidance, traffic congestion management, and carbon emission assessment.

[0003] Currently, traffic mode recognition technology based on GPS trajectories is developing along two main paths: one is the traditional rule-based or statistical model-based method, and the other is the deep learning-based method that has emerged in recent years. Traditional rule-based methods typically rely on thresholds or physical models manually defined by domain experts, such as setting threshold values ​​for features like speed, acceleration, and dwell time for pattern discrimination. While these methods offer good interpretability, their generalization ability is often limited by the rigidity of the predefined rules, making them difficult to adapt to complex urban traffic environments. To improve recognition accuracy, academia and industry are gradually turning to deep learning models, such as using convolutional neural networks to extract local features or recurrent neural networks and their variants to model the temporal dependencies of trajectories.

[0004] However, existing mainstream deep learning methods face two inherent challenges in practical engineering applications. First, existing models generally assume that the input is a long trajectory sequence containing sufficient contextual information. However, in real-world applications such as real-time navigation, privacy-preserving computation, or communication interruptions, what can be analyzed are often short-term, sparse trajectory fragments. Under such incomplete information conditions, the model struggles to capture complete motion semantics, leading to a sharp decline in recognition performance. Second, the strong fitting ability of deep models highly depends on massive amounts of high-quality manually labeled data. In reality, obtaining accurate travel mode labels is not only time-consuming and labor-intensive but also involves user privacy, often resulting in the dilemma of "sparse labels" or even "zero labels" in practical applications. Simply relying on a small number of labeled samples for supervised training makes the model prone to overfitting, resulting in poor generalization ability and difficulty in maintaining stable recognition performance in dynamically changing urban traffic scenarios. Summary of the Invention

[0005] Purpose of the invention: The purpose of this invention is to provide a GPS trajectory travel mode recognition method based on semi-supervised dual-graph learning, which overcomes the shortcomings of existing technologies that rely too much on long-sequence trajectories and massive labeled data, resulting in a serious decline in recognition performance in real-world scenarios with short sequences and sparse labels, and significantly improves the robustness and generalization ability of the model.

[0006] Technical solution: The GPS trajectory travel mode recognition method based on semi-supervised dual-graph learning described in this invention includes the following steps:

[0007] S1. Obtain GPS trajectory data, segment the GPS trajectory data according to time sequence, and extract the point features of each trajectory segment to obtain several trajectory segments.

[0008] S2. Construct a dual-graph topology for each trajectory segment; the dual-graph topology includes a sequence graph for characterizing the local temporal continuity between trajectory points, and a learnable dependency graph for adaptively capturing the non-local semantic correlation between trajectory points.

[0009] S3. Based on the dual-graph topology, a self-supervised mask graph autoencoder is pre-trained using unlabeled trajectory segments to learn a dependency-aware spatiotemporal representation.

[0010] S4. After pre-training, the pre-trained model is fine-tuned under supervision using labeled trajectory segments, and the prediction results of travel modes for the target trajectory segments are output.

[0011] This invention effectively overcomes the shortcomings of existing technologies, which suffer from severe performance degradation in real-world scenarios with short sequences and sparse labels due to over-reliance on long-sequence trajectories and massive labeled data, by constructing a dual-graph topology structure and adopting a semi-supervised learning paradigm that combines self-supervised pre-training and supervised fine-tuning. Specifically, step S1 decomposes the original trajectory into short, easily processed sequence fragments through time segmentation and point feature extraction, laying the foundation for addressing trajectory fragmentation issues in real-world scenarios. Step S2 constructs a dual-graph topology structure for each fragment, consisting of a sequence graph and a learnable dependency graph. This not only preserves local temporal continuity but also adaptively mines long-distance non-local semantic associations, thereby capturing richer spatial structure information in short-sequence data. Step S3 pre-trains the model using unlabeled data through a self-supervised mask graph autoencoder, enabling the model to learn a dependency-aware, robust spatiotemporal representation. This significantly reduces reliance on massive labeled samples and improves feature representation capabilities in sparsely labeled scenarios. Step S4 performs supervised fine-tuning of the model using a small amount of labeled data, efficiently transferring the general knowledge learned during pre-training to specific travel mode recognition tasks. Ultimately, this significantly enhances the model's recognition accuracy, robustness, and generalization ability under the realistic conditions of short sequences and sparse labels.

[0012] Preferably, step S1 also presets the following basic model conditions:

[0013] GPS trajectory data is defined as a geospatial movement sequence of a user arranged in chronological order, represented as... ,in This represents a complete GPS track for a single user, with each track point... They represent the first The latitude, longitude, and corresponding timestamp of each trajectory point. This represents the total number of trajectory points in the trajectory; a trajectory segment is defined as a segment derived from the GPS trajectory. The extracted continuous subsequence is denoted as: ,in Represents a single trajectory segment. This indicates the number of trajectory points contained in the segment. Furthermore, all trajectory points in the trajectory segment correspond to the same travel mode; each trajectory segment employs a feature matrix. It means that, among them The number of trajectory points. The feature dimension is defined as follows: The pattern recognition task is defined as follows: given a dataset of labeled GPS segments... Under the condition of learning the mapping function This makes it possible for any input trajectory segment Output the corresponding traffic travel mode prediction results ,in This represents a predefined set of transportation mode categories.

[0014] By pre-defining the trajectory data structure and task definition, standardized inputs and clear learning objectives are provided for subsequent modeling, thus ensuring the model's adaptability and robustness to short sequences and sparse label scenarios in terms of technical implementation. Specifically, by dividing continuous GPS trajectories into continuous sub-sequence segments corresponding to a single traffic mode and defining a unified feature matrix representation, the model can focus on pattern recognition within local short sequences, effectively overcoming the problem of traditional methods failing when data is fragmented due to reliance on complete long trajectories. At the same time, the pattern recognition task is formalized as a supervised learning function mapping based on labeled segments, laying the mathematical foundation for the subsequent semi-supervised pre-training and fine-tuning framework. This enables the model to learn generalizable travel mode discrimination capabilities with limited labeled samples, ultimately improving the recognition accuracy and generalization performance under sparse label conditions.

[0015] Preferably, the construction of the sequence map in step S2 includes:

[0016] An initial adjacency matrix for the sequence graph is constructed by connecting time-sequential GPS points. Where L is the number of trajectory points; add self-loops to the initial adjacency matrix and perform symmetric normalization to obtain the normalized sequence graph adjacency matrix: , where I is the identity matrix and D is the degree matrix.

[0017] By constructing a sequence graph and performing symmetric normalization, the temporal dependencies between adjacent points within a trajectory segment are accurately characterized, enabling the model to effectively capture local motion patterns and continuous features in short sequences. Simultaneously, by adding self-loops to preserve node attributes and using a degree matrix to balance feature propagation weights under different connection densities, numerical instability and gradient anomalies caused by uneven trajectory point sampling or sequence length differences are significantly alleviated. This improves the model's robust representation of temporal features under fragmented trajectory data, providing a stable and reliable local topological foundation for subsequent learning of bi-graph structures.

[0018] Preferably, the construction of the learnable dependency graph in step S2 includes:

[0019] Using trainable query and key projection matrices , The feature matrix of the trajectory segment Projected to dimension In the latent space, the affinity score matrix between trajectory points is calculated by dot product. , where d is the feature dimension;

[0020] For the affinity score matrix A row Top-K sparsity strategy is adopted, and a temperature hyperparameter is introduced. After scaling and normalization using the Softmax function, a sparse, directed, and adaptive dependency graph adjacency matrix is ​​obtained:

[0021]

[0022] The RowTopK(·) operation is used to retain the connections of each node with its k most relevant neighbors, and the temperature hyperparameter τ is used to control the sharpness of the resulting attention distribution.

[0023] By constructing a learnable dependency graph, adaptive capture of non-local semantic relationships between trajectory points is achieved, significantly enhancing the model's ability to perceive global structural features in short-sequence and sparse-label scenarios. Specifically, trainable query and key projection matrices are used to map trajectory features to the latent space, and dot product is used to calculate the affinity between points, enabling the model to automatically discover long-distance but semantically related dependencies. Furthermore, a row-based Top-K sparsity strategy is adopted, retaining only the top k most relevant connections for each node, which not only reduces computational complexity but also avoids the introduction of redundant noise. Combined with temperature parameter scaling and Softmax normalization, sparse, directed, and adaptive efficient graph structure learning is achieved. This mechanism effectively overcomes the limitations of traditional methods that rely solely on local temporal modeling while ignoring global semantic relationships, improving the model's ability to understand potential travel patterns in fragmented data scenarios, and ultimately enhancing the robustness and generalization of recognition performance.

[0024] Preferably, the pre-training of the self-supervised mask map autoencoder in step S3 includes:

[0025] Based on the asymmetric masking strategy, the original feature matrix of the input trajectory segment is randomly masked, and the generated masked view and the complete view are respectively input into the dual-branch graph convolutional network encoder for processing to obtain a unified latent representation matrix.

[0026] After obtaining the latent representation matrix, the latent representation of the masked nodes is remasked and replaced with a learnable masking vector.

[0027] The latent representation matrix after remasking is input into the graph convolutional network decoder based on sequence graphs to reconstruct the original feature matrix, thus obtaining the reconstructed feature matrix.

[0028] The model is optimized using a joint loss function consisting of reconstruction loss and regularization loss.

[0029] By pre-training a self-supervised masked graph autoencoder, the model's ability to learn dependency-aware representations for short-sequence trajectories is significantly improved without manual annotation, effectively overcoming the performance degradation of traditional methods in sparse label scenarios due to excessive reliance on massive labeled data. Specifically, an asymmetric masking strategy forces the model to use local and global information of visible nodes to predict masked nodes, thereby learning deep semantic dependencies and spatiotemporal structural features between trajectory points. The dual-branch graph convolutional network encoder processes the masked view and the complete view separately, and fuses the topological information of the two graphs through a unified latent representation, enhancing the integrity and robustness of feature representation. Remasking operations and sequence graph-based decoders reconstruct the original features, further strengthening the model's fidelity to local temporal continuity. Finally, through joint optimization of reconstruction loss and regularization loss, the model learns spatiotemporal representations with strong generalization ability and excellent noise resistance during the pre-training stage, providing a high-quality feature foundation for subsequent supervised fine-tuning and significantly improving the recognition accuracy and robustness of the model under fragmented trajectories and limited labeled samples.

[0030] Preferably, obtaining the unified latent representation matrix includes:

[0031] For the input feature matrix Perform a random masking operation to generate a masked view. ,in The number of trajectory points. For feature dimensions; the mask view Only the branch processing the sequence graph receives input, while the branch processing the learnable dependency graph receives the complete original feature matrix. This is used to ensure that the establishment of the global topology is not disrupted by mask noise;

[0032] The mask view Normalized adjacency matrix of sequence graph Input the first graph into the convolutional network branch, and process the original feature matrix. Adjacency matrix of learnable dependency graph Input the second graph convolutional network branch; concatenate the outputs of the two graph convolutional network branches along the feature dimension to form a unified latent representation matrix. ,in is the hidden layer dimension of a single graph convolutional network branch.

[0033] By employing an asymmetric dual-branch input design, efficient collaborative learning of local temporal information and global semantic dependencies is achieved during self-supervised pre-training, significantly enhancing the model's robust representation ability for short-sequence trajectories. Specifically, the sequence graph branch inputs a masked view, forcing the model to infer masked information using temporal dependencies between local continuous nodes, strengthening the deep understanding of local motion patterns in short sequences. Meanwhile, the learnable dependency graph branch inputs complete features, ensuring that the establishment of the global topology is unaffected by mask noise, enabling the model to stably capture semantic relationships between distant nodes. Finally, by concatenating the outputs of the two branches along the feature dimension, a unified latent representation fusing local temporal information and global dependencies is formed. This avoids structural information loss due to masking operations, enhances the completeness and discriminative power of feature representation, and provides richer contextual information for subsequent mask reconstruction tasks, effectively improving the model's generalization ability and recognition performance in label-sparse scenarios.

[0034] Preferably, the remasking operation on the potential representation of the masked node includes:

[0035]

[0036] in, Let be the latent representation vector of the i-th node in the latent representation matrix Z; let The set of node indices to be masked. This is an indicator function that takes the value 1 when node i is masked, and 0 otherwise; It is a globally learnable mask label vector.

[0037] By remasking, the potential identity mapping shortcut of the encoder is effectively prevented during the decoding stage, thus forcing the model to learn more generalizable deep dependency representations. Specifically, this operation replaces the latent representation of the masked node with a globally learnable mask label vector, while retaining the original encoded output of the unmasked node. This design cuts off the direct information leakage from the masked node from the encoder to the decoder, forcing the decoder to rely on the contextual information of neighboring nodes in the sequence graph to reconstruct the original masked features, thereby strengthening the model's ability to model local temporal dependencies and non-local semantic associations. Ultimately, this mechanism significantly improves the learning difficulty and representation quality in the self-supervised pre-training stage, enabling the model to learn more robust and transferable trajectory feature representations in short sequence scenarios with sparse labels.

[0038] Preferably, the expression for the joint loss function is:

[0039]

[0040] in, To reconstruct the loss, To balance the weighting coefficients of reconstruction loss and regularization loss, The number of trajectory points. Represents the adjacency matrix of a learnable dependency graph No. Information entropy of row attention distribution;

[0041] The reconstruction loss Only in the set of masked node indices The mean square error is calculated above:

[0042]

[0043] in, and Representing the original feature matrix respectively and reconstruct the feature matrix The OK, The number of nodes being masked. This represents the square of the Euclidean distance between two vectors;

[0044] The calculation formula is:

[0045]

[0046] in, For learnable dependency graph adjacency matrix The Middle Line number The elements of the column represent the nodes. To the node Attention weights It is a very small constant greater than zero, used to ensure the numerical stability of logarithmic operations.

[0047] By designing a joint loss function consisting of reconstruction loss and regularization loss, a synergistic optimization of feature reconstruction accuracy and dependency graph structure interpretability is achieved in self-supervised pre-training, thereby significantly improving the robustness and generalization ability of the model in short sequence and sparse label scenarios. Specifically, the reconstruction loss only calculates the mean square error on the mask nodes, forcing the model to accurately utilize the local temporal and non-local semantic information of visible nodes to recover the masked features, strengthening the modeling ability of deep dependencies in trajectories; the regularization loss, by minimizing the information entropy of each row of the learnable dependency graph, encourages the attention distribution to tend towards sparseness and concentration, enabling the model to automatically select the most discriminative long-distance semantic connections, avoiding the introduction of redundant noise and enhancing the interpretability of the graph structure. The two are jointly optimized through balanced weights, which not only ensures the high fidelity of feature reconstruction but also promotes the adaptive sparse learning of the dependency graph, ultimately enabling the model to learn a more compact, efficient, and generalizable spatiotemporal representation with limited labeled samples, effectively overcoming the computational redundancy and overfitting problems caused by the reliance on dense graph structures in traditional methods.

[0048] Preferably, step S4, which involves supervised fine-tuning of the pre-trained model using labeled trajectory segments, includes:

[0049] The decoder used in the pre-training stage is stripped and discarded, retaining the encoder, which consists of a bi-branch graph convolutional network, as the feature extractor; the batch size is... The trajectory segments are input into an encoder composed of a two-branch graph convolutional network to obtain the node-level embedding of each trajectory point; the embedding is then processed by a summation pooling layer. The node-level embeddings of each trajectory point are aggregated to obtain a graph-level representation tensor representing the entire trajectory segment. ,in The hidden layer dimension of a single graph convolutional network branch in the encoder; the graph-level representation tensor The input is fed into the classifier, which outputs the corresponding travel mode prediction result; the cross-entropy loss is calculated using the real labels corresponding to the labeled trajectory segments, and the parameters of the encoder and classifier are jointly optimized through the backpropagation algorithm.

[0050] By adapting the pre-trained model to the task through a supervised fine-tuning phase, efficient transfer from general trajectory representation to specific travel mode recognition is achieved, significantly improving the model's recognition accuracy and generalization ability in short sequence and sparse label scenarios. Specifically, by stripping the decoder and retaining the pre-trained bi-branch graph convolutional encoder as a feature extractor, the model fully inherits the local temporal dependencies and global semantic associations learned in the self-supervised phase. Summation pooling is used to aggregate node-level embeddings into graph-level representations, achieving effective compression of variable-length trajectory segments and global feature fusion. Finally, the prediction results are output by the classifier, and end-to-end optimization is performed using cross-entropy loss, enabling the encoder and classifier to adapt collaboratively to specific tasks, achieving accurate pattern recognition with only a small number of labeled samples. This mechanism effectively overcomes the overfitting and insufficient generalization problems caused by traditional methods relying on massive labeled data, significantly improving the model's practicality and robustness in real-world scenarios with sparse labels.

[0051] Preferably, the classifier is a lightweight multilayer perceptron, whose structure includes, in sequence:

[0052] The first fully connected layer is used to represent the input graph-level tensor. A linear transformation is performed to output the first hidden layer features; a ReLU activation layer, connected after the first fully connected layer, is used to perform a nonlinear transformation on the first hidden layer features; a second fully connected layer, connected after the ReLU activation layer, is used to reduce the feature dimension after the nonlinear transformation to the number of target traffic patterns. It outputs the normalized prediction probability distribution tensor. ,in This represents the total number of traffic mode categories to be identified.

[0053] By employing a lightweight multilayer perceptron as the classifier, efficient feature mapping and rapid task adaptation are achieved during supervised fine-tuning, thus significantly reducing computational overhead and overfitting risk while maintaining the model's powerful representational capabilities. Specifically, the first fully connected layer performs a linear transformation on the graph-level representation, compressing high-dimensional features that integrate local temporal and global dependencies into a compact hidden layer space; the ReLU activation layer introduces a non-linear transformation, enhancing the model's ability to learn complex travel pattern boundaries; the second fully connected layer further maps features to the target traffic pattern category space and outputs a normalized predicted probability distribution. This classifier has a simple and efficient structure, requiring only a few learnable parameters. When co-optimized with a pre-trained encoder, it converges quickly and effectively avoids overfitting caused by sparse labeled samples. Ultimately, while ensuring recognition accuracy, it improves the training efficiency and deployment flexibility of the model in practical applications.

[0054] Beneficial Effects: Compared with existing technologies, this invention has the following significant advantages: 1. By constructing a dual-graph topology structure composed of a sequence graph and a learnable dependency graph, and combining it with pre-training of a self-supervised mask graph autoencoder, this invention enables the model to fully mine the structured semantic information of short trajectory segments without the need for long sequence trajectories and massive labeled data. This effectively overcomes the shortcomings of existing technologies in terms of severely degraded recognition performance in short sequence and sparse label scenarios, and significantly improves the robustness and generalization ability of the model; 2. By simultaneously constructing a sequence graph and a learnable dependency graph for each trajectory segment, the local temporal dependencies between trajectory points and the non-local semantic correlations between distant points are captured respectively, enabling the model to more comprehensively... 1. To gain a deeper understanding of the spatiotemporal structure of trajectories, thereby extracting more discriminative travel mode features; 2. To adopt a self-supervised mask graph autoencoder pre-training strategy, making full use of a large amount of unlabeled trajectory data to learn a general dependency-aware spatiotemporal representation, and only using a small amount of labeled data for fine-tuning in subsequent stages, significantly reducing the reliance on expensive manually labeled data and improving the feasibility and economy of the method in practical applications; 3. The learnable dependency graph can adaptively discover the potential semantic relationships between trajectory points according to data features, rather than relying on fixed prior rules. This dynamic modeling capability enables the model to better adapt to the differences in trajectory distribution among different cities and user groups, enhancing the universality and transferability of the method. Attached Figure Description

[0055] Figure 1 This is a schematic diagram of the method flow of the present invention;

[0056] Figure 2 This is a schematic diagram illustrating the construction strategy of the dual-graph topology structure (local sequence graph and global dependency graph) of the present invention;

[0057] Figure 3 This is a network architecture diagram of the pre-training module of the self-supervised masked graph autoencoder (MGAE) of the present invention.

[0058] Figure 4 This is a network architecture diagram of the supervised fine-tuning module for traffic travel mode classification of the present invention;

[0059] Figure 5 This is a comparison chart of the recognition accuracy and macro F1 score of the present invention under different sparse label ratios. Detailed Implementation

[0060] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0061] This invention provides a GPS trajectory travel mode recognition method based on semi-supervised bi-graph learning. First, raw GPS trajectory data is collected from the publicly available GeoLife trajectory dataset, and continuous trajectories are divided into independent trips based on 20-minute time intervals. To meet real-time recognition and short sequence constraints, the trips are further segmented into short segments of a fixed length of 90 trajectory points. Finally, the proposed model is used to obtain the traffic mode label corresponding to each segment. Figure 1 As shown, the specific steps are as follows:

[0062] Step 1: Preset conditions for the model

[0063] Definition 1. GPS Track. A GPS track is defined as a geospatial movement sequence of a user arranged in chronological order, represented as... Each trajectory point It encapsulates geographic coordinates and corresponding timestamps.

[0064] Definition 2. GPS segment. A GPS segment is a sequence of segments derived from the original trajectory. The extracted continuous subsequence is denoted as: ,in All points within the segment are homogeneous for a single travel mode. In this invention, each segment is defined by a feature matrix. It means that, among them The number of trajectory points, For feature dimensions.

[0065] Definition 3. Pattern Recognition. Given a dataset of labeled GPS segments... The goal of pattern recognition is to learn a mapping function. This enables it to process the input trajectory fragments. Predict its corresponding transportation mode .

[0066] Step 2. Construction of the bi-graph topology

[0067] When faced with short trajectory recognition tasks, the limited input time window often leads to ambiguity in motion semantics when relying solely on local temporal features. To comprehensively capture discriminative motion features, such as... Figure 2 As shown, the present invention is for each of the following: The segment feature matrix composed of trajectory points A complementary dual-graph topology was constructed: a sequence graph that preserves strict temporal order and a learnable dependency graph that captures nonlocal correlations.

[0068] 1) Construction of the sequence graph: The sequence graph is used to preserve the strict temporal order of trajectory segments in the physical world, modeling local temporal continuity by connecting temporally consecutive GPS points. Let its initial adjacency matrix be represented as... To maintain feature scale stability and avoid gradient explosion or vanishing in subsequent graph convolution message passing mechanisms, self-loops are explicitly added to the adjacency matrix, and a symmetric normalization operation is applied. The specific formula for calculating the normalized adjacency matrix is ​​as follows:

[0069]

[0070] 2) Construction of a learnable dependency graph: Since the same traffic patterns may exhibit long-term consistency over time (e.g., similar bus stop patterns at different stations), sequence graphs alone are insufficient to model these long-term dependencies. Therefore, this invention constructs a dependency graph designed to adaptively discover "semantic shortcuts" between trajectory points that are geographically distant but highly correlated in their movement behavior. First, trainable query and key projection matrices are used. , Projecting the original features onto a dimension of In the latent space, the affinity score matrix between trajectory points is calculated by dot product. :

[0071]

[0072] To filter out irrelevant noisy connections and significantly reduce the computational overhead of global attention, this invention employs a row-top-K sparsity strategy, retaining only the most relevant connections for each node. One neighbor. In addition, a temperature hyperparameter is introduced. This controls the sharpness of the attention distribution. The final result is a sparse, directed, and adaptive dependency graph adjacency matrix. .

[0073]

[0074] Among them, the smaller The value produces a sharper probability distribution, prompting the model to select the most relevant non-local neighbors with high confidence, thereby enriching the global contextual information without introducing too many false edges.

[0075] Step 3. Pre-training of Self-Supervised Masked Graph Autoencoder (MGAE)

[0076] like Figure 3As shown, to address the bottleneck of extremely scarce GPS track labels in real-world scenarios, this invention utilizes massive amounts of unlabeled track segments and learns representations with strong generalization capabilities directly from the original GPS signals using a masked graph autoencoder paradigm.

[0077] 1) Asymmetric masking and two-branch coding: First, for the input feature matrix... Perform a random masking operation to generate a masked view. This invention creatively employs an asymmetric masking strategy: the mask is applied only to the sequence graph branch, while the dependency graph branch receives the complete original features. The technical motivation behind this design is to use the dependency graph as a "semantic anchor," ensuring that the establishment of the global topology is not destroyed by masking noise, while simultaneously encouraging the sequence view to focus on the interpolation and inference of local temporal features. Subsequently, two parallel graph convolutional network (GCN) branches process... and The outputs of each component are then concatenated along the feature dimension to form a unified latent representation matrix. (in (This refers to the hidden layer dimension of a single branch).

[0078] 2) Latent Mask Re-mapping: To prevent the autoencoder model from learning only trivial identity mappings (i.e., directly passing unmasked information to the decoder for shortcut reconstruction), this invention introduces a re-masking operation in the latent space. Let... The set of node indices to be masked. As an indicator function, the latent representation of the masked node is represented by a globally learnable masking vector. Forced replacement:

[0079]

[0080] 3) Decoding and Joint Loss Function Optimization: Reset Latent Feature Matrix The input is fed into a GCN decoder that operates solely on the sequence adjacency matrix. The decoder attempts to reconstruct the original physical feature matrix, and the output is... The pre-trained total objective loss function of this invention. It consists of the reconstruction loss and the regularization loss.

[0081]

[0082] Among them, reconstruction loss Only in the masked node set The mean squared error (MSE) is calculated above:

[0083]

[0084] In the equation and Representing the original matrix respectively and reconstruction matrix The Okay. Furthermore, Representing the dependency graph Information entropy of row attention distribution A minimal constant to ensure the numerical stability of logarithmic operations:

[0085]

[0086] This regularization term, when jointly minimized with the reconstruction loss, effectively penalizes overly smooth and uniform attention weights, forcing the model to learn more discriminative nonlocal dependencies.

[0087] Step 4: Supervised Fine-tuning and Pattern Recognition

[0088] After completing self-supervised pre-training on unlabeled data, the decoder network was stripped and discarded, retaining the pre-trained bi-branch GCN encoder as a powerful spatiotemporal feature extractor. Subsequently, as... Figure 4 As shown, the model is fine-tuned for downstream tasks using a small amount of labeled data.

[0089] 1) Feature aggregation from node level to graph level: In the fine-tuning stage, given a batch size of... Short trajectory segments as input (tensor shape is...) The pre-trained encoder first generates high-dimensional node-level embeddings. Considering that traffic pattern labels are assigned to entire trajectory segments rather than individual points, this invention employs a sum pooling layer... The embeddings of each node are aggregated and compressed into a fixed-length graph-level representation tensor. :

[0090]

[0091] 2) Lightweight Classification and End-to-End Optimization: After obtaining the graph-level representation, a lightweight classification head is used for pattern mapping. This classification head is specifically implemented as a multilayer perceptron (MLP), containing a fully connected (FC) layer, a ReLU nonlinear activation layer, and a final feature dimensionality reduction FC layer. The final output is a normalized tensor of the predicted probability distribution of various traffic patterns. In its dimensions The number of target transportation modes (e.g., 5 categories: walking, cycling, bus, car, and subway):

[0092]

[0093] During training, a cross-entropy loss is calculated using a small number of real labels, and the parameters of the lightweight classifier head and the pre-trained encoder are jointly updated during backpropagation. This "heavy encoder-light classifier" architecture not only significantly reduces the risk of overfitting on small sample data, but also ensures that the model can still achieve robust and high-accuracy recognition under limited supervision signals.

[0094] Table 1 Results of running the GeoLife dataset

[0095] method accuracy Macro recall rate Macro F1 score Our Model 72.70 69.01 70.41 MGAE-GCN 68.67 59.20 61.60 SD-GCN 67.13 57.13 57.90 TrajCNN 61.14 55.93 56.49 WT-LSTM 63.72 51.67 51.06 SECA 68.26 60.58 62.24 RF 66.01 61.05 61.35 KNN 63.48 56.83 57.30 DT 54.45 51.34 50.83 SVM 65.93 58.80 59.29

[0096] To assess the performance of this architecture, comparative experiments were conducted on the GeoLife dataset with various baseline models, as shown in Table 1 and... Figure 5 As shown, compared with semi-supervised baseline models (MGAE-GCN and SECA) that also utilize unlabeled data, our method demonstrates significant technical superiority, achieving improvements of 4.44% in accuracy and 8.43% in macro-recall compared to SECA. This indicates that the integrated dependency-aware masked graph autoencoder provides a more task-aligned inductive bias compared to traditional sequence autoencoders or fixed-structure graph autoencoders, thus more effectively utilizing the latent features in unlabeled trajectories. Secondly, our model consistently outperforms supervised deep learning baselines including SD-GCN, TrajCNN, and WT-LSTM. This performance gap demonstrates that under constraints of sparse labels and short trajectory segments, purely supervised learning is prone to overfitting, and traditional local temporal encoders struggle to capture the complex semantics in short trajectories. Our invention, however, captures non-local correlations through dual-graph modeling, significantly enhancing the discriminative power of features. Finally, compared to traditional machine learning methods such as random forests, KNN, decision trees, and support vector machines, our invention maintains a clear lead across all metrics. This reflects the significant limitations of shallow decision boundaries and manual feature engineering in handling short GPS trajectories that are highly heterogeneous and context-constrained, while the end-to-end representation learning framework of this invention can more accurately characterize the motion dynamics of different traffic modes.

[0097] In summary, compared to existing methods that rely heavily on sufficient trajectory context and large amounts of precisely labeled data, this invention combines adaptive bi-graph topology modeling with a self-supervised mask graph autoencoder. This significantly improves the model's recognition accuracy and robustness under short-sequence constraints while reducing the difficulty of obtaining manually labeled data. Furthermore, this invention develops a feature attention-driven learnable dependency graph structure, coupled with an asymmetric latent mask resetting strategy, to adaptively capture non-local semantic correlations between trajectory points and effectively prevent overfitting on small sample data.

Claims

1. A GPS trajectory travel mode recognition method based on semi-supervised dual-graph learning, characterized in that, Includes the following steps: S1. Obtain GPS trajectory data, segment the GPS trajectory data according to time sequence, and extract the point features of each trajectory segment to obtain several trajectory segments. S2. Construct a dual-graph topology for each trajectory segment; the dual-graph topology includes a sequence graph for characterizing the local temporal continuity between trajectory points, and a learnable dependency graph for adaptively capturing the non-local semantic correlation between trajectory points. The construction of the learnable dependency graph includes: Using trainable query and key projection matrices , The feature matrix of the trajectory segment Projected to dimension In the latent space, the affinity score matrix between trajectory points is calculated by dot product. , where d is the feature dimension; For the affinity score matrix A row Top-K sparsity strategy is adopted, and a temperature hyperparameter is introduced. After scaling and normalization using the Softmax function, a sparse, directed, and adaptive dependency graph adjacency matrix is ​​obtained: The RowTopK(·) operation is used to retain the connections of each node with its k most relevant neighbors, and the temperature hyperparameter τ is used to control the sharpness of the resulting attention distribution. S3. Based on the dual-graph topology, a self-supervised mask graph autoencoder is pre-trained using unlabeled trajectory segments to learn a dependency-aware spatiotemporal representation. S4. After pre-training, the pre-trained model is fine-tuned under supervision using labeled trajectory segments, and the prediction results of travel modes for the target trajectory segments are output.

2. The method according to claim 1, characterized in that, Step S1 also presets the following basic model conditions: GPS trajectory data is defined as a geospatial movement sequence of a user arranged in chronological order, represented as... ,in This represents a complete GPS track for a single user, with each track point... They represent the first The latitude, longitude, and corresponding timestamp of each trajectory point. This represents the total number of trajectory points in the trajectory; a trajectory segment is defined as a segment derived from the GPS trajectory. The extracted continuous subsequence is denoted as: ,in Represents a single trajectory segment. This indicates the number of trajectory points contained in the segment. Furthermore, all trajectory points in the trajectory segment correspond to the same travel mode; each trajectory segment employs a feature matrix. It means that, among them The number of trajectory points. The feature dimension is defined as follows: The pattern recognition task is defined as follows: given a dataset of labeled GPS segments... Under the condition of learning the mapping function This makes it possible for any input trajectory segment Output the corresponding traffic travel mode prediction results ,in This represents a predefined set of transportation mode categories.

3. The method according to claim 1, characterized in that, The construction of the sequence map in step S2 includes: An initial adjacency matrix for the sequence graph is constructed by connecting time-sequential GPS points. Where L is the number of trajectory points; add self-loops to the initial adjacency matrix and perform symmetric normalization to obtain the normalized sequence graph adjacency matrix: , where I is the identity matrix and D is the degree matrix.

4. The method according to claim 1, characterized in that, The pre-training of the self-supervised mask map autoencoder described in step S3 includes: Based on the asymmetric masking strategy, the original feature matrix of the input trajectory segment is randomly masked, and the generated masked view and the complete view are respectively input into the dual-branch graph convolutional network encoder for processing to obtain a unified latent representation matrix. After obtaining the latent representation matrix, the latent representation of the masked nodes is remasked and replaced with a learnable masking vector. The latent representation matrix after remasking is input into the graph convolutional network decoder based on sequence graphs to reconstruct the original feature matrix, thus obtaining the reconstructed feature matrix. The model is optimized using a joint loss function consisting of reconstruction loss and regularization loss.

5. The method according to claim 4, characterized in that, The obtained unified latent representation matrix includes: For the input feature matrix Perform a random masking operation to generate a masked view. ,in The number of trajectory points. For feature dimensions; the mask view Only the branch processing the sequence graph receives input, while the branch processing the learnable dependency graph receives the complete original feature matrix. This is used to ensure that the establishment of the global topology is not disrupted by mask noise; The mask view Normalized adjacency matrix of sequence graph Input the first graph into the convolutional network branch, and process the original feature matrix. Adjacency matrix of learnable dependency graph Input the second graph convolutional network branch; concatenate the outputs of the two graph convolutional network branches along the feature dimension to form a unified latent representation matrix. ,in is the hidden layer dimension of a single graph convolutional network branch.

6. The method according to claim 4, characterized in that, The remasking operation on the potential representation of the masked nodes includes: ;in, Let be the latent representation vector of the i-th node in the latent representation matrix Z; let The set of node indices to be masked. This is an indicator function that takes the value 1 when node i is masked, and 0 otherwise; It is a globally learnable mask label vector.

7. The method according to claim 4, characterized in that, The expression for the joint loss function is: ;in, To reconstruct the loss, To balance the weighting coefficients of reconstruction loss and regularization loss, The number of trajectory points. Represents the adjacency matrix of a learnable dependency graph No. Information entropy of row attention distribution; The reconstruction loss Only in the set of masked node indices The mean square error is calculated above: ;in, and Representing the original feature matrix respectively and reconstruct the feature matrix The OK, The number of nodes being masked. This represents the square of the Euclidean distance between two vectors; The calculation formula is: ;in, For learnable dependency graph adjacency matrix The Middle Line 1 The elements of the column represent the nodes. To the node Attention weights It is a very small constant greater than zero, used to ensure the numerical stability of logarithmic operations.

8. The method according to claim 1, characterized in that, Step S4, which involves supervised fine-tuning of the pre-trained model using labeled trajectory segments, includes: The decoder used in the pre-training stage is stripped and discarded, retaining the encoder, which consists of a bi-branch graph convolutional network, as the feature extractor; the batch size is... The trajectory segments are input into an encoder composed of a two-branch graph convolutional network to obtain the node-level embedding of each trajectory point; the embedding is then processed by a summation pooling layer. The node-level embeddings of each trajectory point are aggregated to obtain a graph-level representation tensor representing the entire trajectory segment. ,in The hidden layer dimension of a single graph convolutional network branch in the encoder; the graph-level representation tensor The input is fed into the classifier, which outputs the corresponding travel mode prediction result; the cross-entropy loss is calculated using the real labels corresponding to the labeled trajectory segments, and the parameters of the encoder and classifier are jointly optimized through the backpropagation algorithm.

9. The method according to claim 8, characterized in that, The classifier is a lightweight multilayer perceptron, and its structure includes the following components in sequence: The first fully connected layer is used to process the input graph-level representation tensor. A linear transformation is performed to output the first hidden layer features; a ReLU activation layer, connected after the first fully connected layer, is used to perform a nonlinear transformation on the first hidden layer features; a second fully connected layer, connected after the ReLU activation layer, is used to reduce the feature dimension after the nonlinear transformation to the number of target traffic patterns. It outputs the normalized prediction probability distribution tensor. ,in This represents the total number of traffic mode categories to be identified.

Citation Information

Patent Citations

  • Online track point identification method based on self-supervised learning model

    CN119131815A

  • Multivariate method for detecting time series anomalies for intelligent IoT systems

    DE112023000312T5