GPS track travel mode identification method based on semi-supervised double-graph learning
By constructing a topological structure of sequence graphs and learnable dependency graphs and pre-training a self-supervised mask graph autoencoder, the performance degradation of GPS trajectory travel mode recognition in short sequence and sparse label scenarios is solved. Efficient recognition is achieved without the need for long sequences and massive labeled data, thus improving the robustness and generalization ability of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-13
- Publication Date
- 2026-04-10
AI Technical Summary
Existing GPS trajectory travel mode recognition technologies suffer from severe performance degradation in short sequences and sparse label scenarios, making it difficult to maintain stable recognition results in dynamic urban traffic scenarios. Furthermore, their reliance on massive amounts of labeled data leads to overfitting and poor generalization capabilities.
A semi-supervised dual-graph learning method is adopted. By constructing the topology of sequence graph and learnable dependency graph, and combining the pre-training and supervised fine-tuning of self-supervised mask graph autoencoder, the model learns a dependency-aware spatiotemporal representation by pre-training with unlabeled data and fine-tuning with a small amount of labeled data, thereby improving the robustness and generalization ability of the model.
It significantly improves the model's recognition accuracy and robustness in short sequence and sparse label scenarios, reduces the dependence on massive labeled data, enhances the model's adaptability and universality, and can better adapt to the differences in trajectory distribution among different cities and user groups.
Smart Images

Figure CN121834244A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of intelligent transportation systems and spatial trajectory data mining, and particularly relates to a GPS trajectory travel mode recognition method based on semi-supervised double graph learning. BACKGROUND
[0002] With the popularity and rapid development of the Internet of Things, edge computing and portable intelligent devices, a large number of GPS positioning terminals have been deployed worldwide. These terminals continuously generate a large amount of vehicle and pedestrian trajectory data, providing an unprecedented data foundation for the construction of intelligent transportation systems. As a key component of smart cities and the next generation of travel systems, accurate traffic travel mode recognition is of great significance for urban transportation planning, dynamic path guidance, traffic congestion management and carbon emission assessment.
[0003] Currently, the traffic travel mode recognition technology for GPS trajectories mainly develops along two technical 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 usually rely on threshold values or physical models defined manually by domain experts, such as setting threshold values for speed, acceleration, and dwell time to distinguish patterns. Although this method has good interpretability, its generalization ability is often limited by the rigidity of pre-set rules, making it difficult to adapt to complex urban traffic environments. In order to improve recognition accuracy, academia and industry have gradually turned to deep learning models, such as using convolutional neural networks to extract local features or using recurrent neural networks and their variants to model the temporal dependence of trajectories.
[0004] However, the existing mainstream deep learning methods face two inherent challenges in actual engineering implementation. First, existing models generally assume that the input is a long trajectory sequence containing sufficient context information, but in real-time navigation, privacy protection computing or communication interruption, etc. In practical application scenarios, short, sparse trajectory segments are often available for analysis. Under such incomplete information conditions, the model is difficult to capture complete motion semantics, resulting in a sharp decline in recognition performance. Second, the strong fitting ability of deep models highly depends on a large amount of high-quality manually labeled data. In reality, obtaining accurate travel mode labels not only consumes time and effort, but also involves user privacy, leading to the "label sparsity" or even "zero label" dilemma in actual applications. Simply relying on a small number of labeled samples for supervised training, the model is prone to overfitting, with poor generalization ability, making it difficult to maintain stable recognition performance in dynamically changing urban traffic scenarios. SUMMARY
[0005] Inventive purpose: The purpose of the present application is to provide a GPS trajectory travel mode recognition method based on semi-supervised dual graph learning, which overcomes the defects of the prior art that the recognition performance is seriously reduced in the actual scene of short sequence and sparse label due to excessive dependence on long sequence trajectory and massive labeled data, and significantly improves the model robustness and generalization ability.
[0006] Technical scheme: The GPS trajectory travel mode recognition method based on semi-supervised dual graph learning comprises the following steps:
[0007] S1, acquiring GPS trajectory data, segmenting the GPS trajectory data according to time sequence, and extracting point feature of each trajectory segment to obtain a plurality of trajectory segments;
[0008] S2, constructing a dual graph topology for each trajectory segment; the dual graph topology comprises a sequence graph for representing local time continuity between trajectory points, and a learnable dependency graph for adaptively capturing non-local semantic correlation between trajectory points;
[0009] S3, based on the dual graph topology, pre-training a self-supervised mask graph autoencoder using unlabeled trajectory segments to learn a dependency-aware spatio-temporal representation;
[0010] S4, after pre-training, using labeled trajectory segments to supervise the fine-tuning of the pre-trained model, and outputting a travel mode prediction result for the target trajectory segment.
[0011] The present application effectively overcomes the defects of the prior art that the recognition performance is seriously reduced in the actual scene of short sequence and sparse label due to excessive dependence on long sequence trajectory and massive labeled data, by constructing a dual graph topology and adopting a semi-supervised learning paradigm combining self-supervised pre-training and supervised fine-tuning. Specifically, step S1 decomposes the original trajectory into short sequence segments through time segmentation and point feature extraction, laying the foundation for dealing with the problem of trajectory fragmentation in the actual scene; step S2 constructs a dual graph topology composed of a sequence graph and a learnable dependency graph for each segment, which not only retains local time continuity, but also adaptively mines long-distance non-local semantic correlation, thereby capturing more rich 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 robust spatio-temporal representation with dependency awareness, significantly reducing the dependence on massive labeled samples and improving the feature expression ability in the label sparse scene; step S4 fine-tunes the model through a small amount of labeled data, efficiently transferring the general knowledge learned by pre-training to the specific travel mode recognition task, and finally significantly enhances the recognition accuracy, robustness and generalization ability of the model under the real conditions of short sequence and sparse label.
[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; adding self-loops to the initial adjacency matrix and performing symmetric normalization operation to obtain the normalized sequence graph adjacency matrix: where I is the identity matrix and D is the degree matrix.
[0017] By constructing the sequence graph and performing symmetric normalization operation, the temporal dependency between adjacent points in the trajectory segment is accurately described, enabling the model to effectively capture the local motion patterns and continuity features in short sequences. Meanwhile, by adding self-loops to retain the node's own properties and using the degree matrix to balance the feature propagation weights under different connection densities, the numerical instability and gradient anomaly problems caused by uneven sampling of trajectory points or differences in sequence length are significantly alleviated, thereby improving the model's robust representation ability of temporal features under fragmented trajectory data and providing a stable and reliable local topology basis for subsequent learning of the dual-graph structure.
[0018] Preferably, the construction of the learnable dependency graph in step S2 includes:
[0019] Using trainable query and key projection matrices , projecting the feature matrix of the trajectory segment into a latent space with dimension and calculating the affinity score matrix between trajectory points through dot product where d is the feature dimension;
[0020] using the row Top-K sparsification strategy on the affinity score matrix and introducing a temperature hyperparameter for scaling, and then normalizing via the Softmax function to obtain a sparse, directed and adaptive dependency graph adjacency matrix:
[0021]
[0022] where the RowTopK(·) operation is used to retain the connections of the top k neighbors most relevant to each node, and the temperature hyperparameter τ is used to control the sharpness of the resulting attention distribution.
[0023] By constructing a learnable dependency graph, the adaptive capture of non-local semantic relationships between trajectory points is realized, thereby significantly enhancing the model's perception of global structural features in short sequences and sparse label scenarios. Specifically, the trajectory features are mapped to the latent space using trainable query and key projection matrices, and the point affinity is calculated through dot product, enabling the model to automatically mine long-distance but semantically related dependencies. Further, the row Top-K sparsification strategy is adopted to retain only the top k most relevant connections for each node, reducing computational complexity and avoiding the introduction of redundant noise. Combined with temperature parameter scaling and Softmax normalization, efficient sparse, directed, and adaptive 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 associations, improving the model's understanding of underlying travel patterns in fragmented data and ultimately enhancing the robustness and generalizability of recognition performance.
[0024] Preferably, the pre-training of the self-supervised mask graph autoencoder in step S3 comprises:
[0025] Based on the asymmetric mask strategy, the original feature matrix of the input trajectory segment is randomly masked, and the generated mask view and the complete view are input into the dual-branch graph convolution network encoder for processing to obtain a unified latent representation matrix;
[0026] After obtaining the latent representation matrix, the latent representation of the masked node is re-masked and replaced with a learnable mask label vector;
[0027] The latent representation matrix after re-masking is input into the sequence graph-based graph convolution network decoder to reconstruct the original feature matrix and obtain a reconstructed feature matrix;
[0028] The model is optimized by a joint loss function composed of a reconstruction loss and a regularization loss.
[0029] By pre-training through a self-supervised mask graph autoencoder, the model's ability to learn dependent representations of short sequence trajectories is significantly improved without the need for manual annotation, effectively overcoming the performance decline of traditional methods in label-sparse scenarios due to excessive reliance on large amounts of labeled data. Specifically, an asymmetric mask strategy is used to force the model to use local and global information from visible nodes to predict masked nodes, thereby learning deep semantic dependencies and spatio-temporal structure features between trajectory points; a dual-branch graph convolutional network encoder processes the masked view and the complete view, respectively, and integrates the dual graph topology information through a unified latent representation, enhancing the completeness and robustness of feature expression; a re-masking operation and a sequence graph-based decoder 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 a spatio-temporal representation with strong generalization ability and excellent noise resistance in the pre-training phase, providing a high-quality feature basis for subsequent supervised fine-tuning, significantly improving recognition accuracy and model robustness in fragmented trajectories and limited labeled samples.
[0030] Preferably, the obtaining of the unified latent representation matrix comprises:
[0031] inputting an input feature matrix performing a random mask operation to generate a masked view wherein is the number of trajectory points, is the feature dimension; the masked view is only input to a branch for processing a sequence graph, while the branch for processing a learnable dependency graph inputs a complete original feature matrix to ensure that the establishment of the global topology structure is not damaged by the mask noise;
[0032] inputting the masked view and a normalized adjacency matrix of the sequence graph into a first graph convolutional network branch, inputting the original feature matrix and an adjacency matrix of the learnable dependency graph into a second graph convolutional network branch; the outputs of the two graph convolutional network branches are spliced in the feature dimension to form a unified latent representation matrix wherein is the hidden layer dimension of a single graph convolutional network branch.
[0033] By designing an asymmetric dual-branch input, efficient collaborative learning of local temporal information and global semantic dependency is achieved in self-supervised pre-training, thereby significantly improving the robust representation ability of the model for short sequence trajectories. Specifically, for the sequence graph branch input mask view, the model is forced to use the temporal dependency between local consecutive nodes to infer the masked information, thereby strengthening the deep understanding of the local motion pattern of short sequences; while for the learnable dependency graph branch input complete features, the establishment of the global topological structure is ensured not to be disturbed by the mask noise, so that the model can stably capture the semantic association between distant nodes. Finally, by concatenating the outputs of the two branches in the feature dimension, a unified latent representation that integrates local temporal and global dependency is formed, which not only avoids the loss of structural information caused by the mask operation, but also enhances the completeness and discriminability of feature expression, providing more rich context information for the subsequent mask reconstruction task, thereby effectively improving the generalization ability and recognition performance of the model in the label sparse scenario.
[0034] Preferably, the re-masking operation on the latent representation of the masked node includes:
[0035]
[0036] wherein, is the latent representation vector of the i-th node in the latent representation matrix Z; let is the set of masked node indexes, is an indicator function, taking the value of 1 when node i is masked, otherwise 0; is a globally learnable mask marker vector.
[0037] Through the re-masking operation, the potential identity mapping shortcut of the encoder is effectively prevented in the decoding stage, thereby forcing the model to learn a deep dependency representation with better generalization ability. Specifically, this operation is used to replace the latent representation of the masked node with a globally learnable mask marker vector, while retaining the original encoding output of the unmasked node; this design cuts off the direct information leakage of the masked node from the encoder to the decoder, so that the decoder must rely on the context information of the neighbor nodes in the sequence graph to reconstruct the original features of the masked nodes, thereby strengthening the modeling ability of the model for local temporal dependency and non-local semantic association. Finally, 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 the short sequence scenario with sparse labels.
[0038] Preferably, the expression of the joint loss function is:
[0039]
[0040] wherein, is the reconstruction loss, to balance the weight coefficients of reconstruction loss and regularization loss, for the number of trajectory points, denotes the learnable dependency graph adjacency matrix The first The information entropy of the row attention distribution;
[0041] The reconstruction loss Only on the set of masked node indices The mean square error is calculated as:
[0042]
[0043] where, and denote the first row of the original feature matrix and the reconstructed feature matrix respectively, is the number of masked nodes, denotes the squared Euclidean distance between two vectors;
[0044] The calculation formula of is:
[0045]
[0046] where, is the element in the first row and the first column of the learnable dependency graph adjacency matrix , representing the attention weight from node to node , is a small positive constant greater than zero, used to ensure the numerical stability of the logarithmic operation.
[0047] By designing a joint loss function composed of reconstruction loss and regularization loss, the collaborative optimization of feature reconstruction accuracy and dependence graph structure explainability is realized in self-supervised pre-training, thereby significantly improving the robustness and generalization ability of the model in the short sequence and label sparse scene. Specifically, the reconstruction loss only calculates the mean square error on the mask nodes, forcing the model to accurately use the local time sequence and non-local semantic information of the visible nodes to restore the masked features, thereby strengthening the modeling ability of the deep dependence relationship of the trajectory; the regularization loss encourages the attention distribution to tend to be sparse and concentrated by minimizing the information entropy of each row of the learnable dependence graph, so that the model can automatically select the most discriminative long-distance semantic connections, avoiding the introduction of redundant noise and enhancing the explainability of the graph structure. Through joint optimization by balancing the weights, both ensure the high fidelity of feature reconstruction and promote the adaptive sparsification learning of the dependence graph, ultimately enabling the model to learn a more compact, efficient and generalizable spatio-temporal representation under limited labeled samples, effectively overcoming the computational redundancy and overfitting problems caused by the dependence on dense graph structure in traditional methods.
[0048] Preferably, the step S4 of using the labeled trajectory segment to supervise and fine-tune the pre-trained model comprises:
[0049] The decoder used in the pre-training stage is stripped and discarded, and the encoder composed of the double-branch graph convolutional network is retained as the feature extractor; the batch size of trajectory segments is input into the encoder composed of the double-branch graph convolutional network to obtain the node-level embedding of each trajectory point; the node-level embedding of trajectory points in each trajectory segment is aggregated by sum-pooling layer to obtain the graph-level representation tensor , wherein is the hidden layer dimension of a single graph convolutional network branch in the encoder; the graph-level representation tensor is input into the classifier to output the corresponding mode of transportation prediction result; the cross-entropy loss is calculated using the real label corresponding to the labeled trajectory segment, and the parameters of the encoder and the classifier are jointly optimized by the back propagation algorithm.
[0050] The pre-trained model is task-adapted through the supervised fine-tuning stage, realizing efficient transfer from general trajectory representation to specific mode recognition, thereby significantly improving the recognition accuracy and generalization ability of the model in the short sequence and label sparse scene. Specifically, by stripping the decoder and retaining the pre-trained double-branch graph convolutional encoder as a feature extractor, the local temporal dependence and global semantic association knowledge learned in the self-supervised stage are fully inherited; the node-level embedding is aggregated into a graph-level representation using sum-pooling, realizing effective compression and global feature fusion of variable-length trajectory segments; finally, the classifier outputs the prediction result and uses cross-entropy loss for end-to-end optimization, so that the encoder and classifier adapt to the specific task, and only a small amount of labeled samples are needed to complete accurate mode recognition. This mechanism effectively overcomes the overfitting and generalization deficiency problems caused by the dependence on massive labeled data in traditional methods, greatly improving the practicality and robustness of the model in the label sparse actual scene.
[0051] Preferably, the classifier is a lightweight multilayer perceptron, which includes in turn:
[0052] a first fully connected layer for performing linear transformation on the input graph-level representation tensor to output first hidden layer features; a ReLU activation layer connected after the first fully connected layer for performing nonlinear transformation on the first hidden layer features; a second fully connected layer connected after the ReLU activation layer for reducing the feature dimension to the number of target traffic modes and outputting a normalized prediction probability distribution tensor , wherein represents the total number of traffic mode categories to be identified.
[0053] By using a lightweight multilayer perceptron as the classifier, efficient feature mapping and rapid task adaptation are realized in the supervised fine-tuning stage, thereby significantly reducing the computational overhead and overfitting risk while maintaining the strong representation ability of the model. Specifically, the first fully connected layer performs linear transformation on the graph-level representation, compressing the high-dimensional features that integrate local temporal and global dependence into a compact hidden layer space; the ReLU activation layer introduces nonlinear transformation, enhancing the model's learning ability for complex mode boundaries; the second fully connected layer further maps the features to the target traffic mode category space and outputs the normalized prediction probability distribution. This classifier structure is simple and efficient, requiring only a small number of learnable parameters. When optimized with the pre-trained encoder, it can quickly converge and effectively avoid overfitting caused by sparse labeled samples, ultimately improving the training efficiency and deployment flexibility of the model in practical applications while ensuring recognition accuracy.
[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-segment 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-range consistency over time (e.g., similar bus stop patterns at different stations), sequence graphs alone are insufficient to model these long-range 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 the extreme scarcity of GPS track labels in real-world scenarios, this invention utilizes a massive amount 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 mask noise, while prompting 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 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. 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 construction of the learnable dependency graph in step S2 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.
5. 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.
6. The method according to claim 5, 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 denoted as the hidden layer dimension of a single graph convolutional network branch.
7. The method according to claim 5, 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.
8. The method according to claim 5, 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 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.
9. 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.
10. The method according to claim 9, 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 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.
Citation Information
Patent Citations
Online track point identification method based on self-supervised learning model
CN119131815A
Automatic vulnerability detection method based on intermediate pseudo code and graph neural network
CN120561927A
Multi-scale tensor diagram space-time network wind power prediction method fusing space-time correlation and environmental factors
CN121011996A
Multivariate method for detecting time series anomalies for intelligent IoT systems
DE112023000312T5
Weakly supervised semantic segmentation method and apparatus based on attention mask
WO2025060272A1