Destination reasoning method for urban vehicle tracking
By segmenting and encoding trajectories using a weighted minimum description length algorithm and a Geohash-Base2vec model, and combining wavelet transform and a self-attention LSTM network, the problems of sparsity and long-term dependency in trajectory data are solved, thereby improving the accuracy of urban vehicle destination inference.
Patent Information
- Application Number
- CN202511535609.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-27
- Publication Date
- 2026-02-10
AI Technical Summary
Existing target vehicle destination reasoning methods have low accuracy when trajectory data is sparse and has long-term dependencies, and traditional methods are difficult to effectively extract trajectory features and ignore intermediate path information.
The trajectory is segmented using a weighted minimum description length algorithm, and grid encoding is performed using Geohash and Base2vec models. Time-frequency features are extracted through wavelet decomposition, and a self-attention mechanism is introduced into the LSTM network for prediction.
It improves trajectory prediction accuracy, effectively captures key patterns and detailed information in the trajectory, enhances the ability to model long-term dependencies, and improves the accuracy of destination inference.
Smart Images

Figure CN121503654A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and vehicle tracking technology, and specifically to a destination reasoning method for urban vehicle tracking. Background Technology
[0002] With the acceleration of urbanization, the efficient tracking of suspicious vehicles on the ground has become a crucial issue for urban security. Since the movement of real-world target vehicles is not random but influenced by their intentions, inferences about their intended destinations can be made to assist unmanned platforms in trajectory prediction and tracking. Existing destination inference methods typically predict possible or behavioral destinations by analyzing historical trajectories of targets. However, due to the sparsity and temporal dependencies of trajectory data, traditional methods suffer from low accuracy. For example, some methods based on Long Short-Term Memory (LSTM) networks or convolutional networks struggle to capture key patterns when trajectory data is scarce, leading to underfitting or incorrect inference. Furthermore, existing methods often only utilize the start and end points of the trajectory, ignoring crucial information along the intermediate path; some models incorporating attention mechanisms have complex structures, making training and optimization difficult. Therefore, facing situations with sparse trajectory data and long-term dependencies, a new method is needed to effectively extract trajectory features and improve inference accuracy. Summary of the Invention
[0003] In view of this, the present invention provides a destination reasoning method for urban vehicle tracking, which can effectively improve prediction accuracy.
[0004] The destination reasoning method for urban vehicle tracking of the present invention includes:
[0005] S1, collect vehicle trajectory data, and use the weighted minimum description length algorithm to segment the trajectory to obtain the globally optimal segmented trajectory sequence; wherein, in the weighted minimum description length algorithm, the optimization objective is mL(H)+nL(D|H); where m and n are the weight factors of L(H) and L(D|H), respectively;
[0006] S2, after grid encoding of the latitude and longitude points in each segment of the trajectory sequence in S1, uses the Base2vec model to map the trajectory sequence into a low-dimensional distributed vector representation, resulting in an embedded vector sequence containing geographic topological relationships, i.e., the trajectory embedding sequence.
[0007] S3, perform wavelet decomposition on each trajectory embedding sequence to obtain the time-frequency feature sequence;
[0008] S4, construct an LSTM network, including an input layer, an LSTM layer, a self-attention mechanism module, and a Softmax classifier; the input of the input layer is the time-frequency feature sequence of the trajectory embedding sequence; the LSTM layer recursively computes the time-step feature representation O. t The self-attention mechanism module is used to compute feature O. t The weights; the Softmax classifier is based on the features O at each time step. t And its weight, to predict which destination cluster the target belongs to;
[0009] The self-attention mechanism module calculates feature O in the following way. t Weight: The similarity of the query vector Q at each time step with the key vector K at all other time steps is calculated by taking the dot product, and the weight S at that time step is obtained.
[0010] S5 converts the cluster labels predicted in S4 into actual geographic coordinates to obtain the predicted destination of the target.
[0011] Preferably, in step S1, the collected vehicle trajectory data is first cleaned and denoised, including removing null values, short trajectories, and outliers.
[0012] Preferably, in step S1, long trajectory data of the vehicle is collected, and then a sliding window method is used to divide the long trajectory into multiple short trajectories of fixed length for subsequent steps.
[0013] Preferably, in S2, the latitude and longitude points in the trajectory sequence are grid-coded using the Geohash algorithm, UTM grid coding, S2 grid coding, quadtree grid coding, or H3 grid coding.
[0014] Preferably, S specifically refers to:
[0015]
[0016] Where, d x Let T be the dimension of the input feature, and T be the transpose.
[0017] Beneficial effects:
[0018] This invention first employs an improved minimum description length algorithm to adaptively segment the original trajectory, obtaining the globally optimal trajectory segmentation. Next, through grid coding and the Base2vec model, the trajectory sequence is mapped into a low-dimensional distributed vector containing geographic topological relationships, resulting in a trajectory embedding sequence, alleviating the sparsity problem in spatial representation. Then, wavelet transform is applied to the trajectory embedding sequence, performing multi-scale analysis in the time and frequency domains to extract abrupt changes in the trajectory variation patterns, thereby capturing detailed information such as rapid turns or acceleration / deceleration during target motion. Finally, the time-frequency features extracted by wavelet transform are input into an LSTM, and a self-attention mechanism is incorporated within the LSTM, enabling the model to dynamically weight the output at different time steps according to the current trajectory segment. This allows the network to adaptively focus on key points in the trajectory, enhancing its ability to model long-term dependencies. Finally, the SoftMax classifier is used to classify the output of the LSTM network, converting the classification results into specific geographic grid coordinates to obtain the predicted target destination location. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the method flow of the present invention.
[0020] Figure 2 This is a diagram of the Base2vec network structure.
[0021] Figure 3 This is a flowchart illustrating the self-attention calculation method.
[0022] Figure 4 This is a schematic diagram of wavelet transform.
[0023] Figure 5 This is a comparison chart of the algorithm's experimental results. Detailed Implementation
[0024] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0025] This invention provides a destination reasoning method for urban vehicle tracking, comprising the following steps:
[0026] Step 1: Trajectory processing.
[0027] Step 1.1: Clean and denoise the collected target trajectory data, including removing null values, short trajectories, or outliers. Apply sliding window segmentation to the remaining trajectory data, dividing long trajectories into fixed-length short sequences. This step only performs rule-based pruning based on time or number of points, without introducing any trajectory semantic judgment. The purpose is to unify the batch processing size, reduce the dimensionality of subsequent network inputs, and preserve the complete temporal information of the original trajectory.
[0028] Step 1.2: Each trajectory segment is segmented using an improved Minimum Description Length (MDL) algorithm to determine the optimal segmentation points, which are then designated as key nodes. Key nodes correspond to behavioral turning points of the vehicle in a real road environment, such as changes in position like going straight to a turn, constant speed to acceleration, or driving to stopping. This adaptive segmentation extracts key information points from the trajectory while reducing the input dimensionality for subsequent modeling.
[0029] The Minimum Description Length (MDL) principle consists of two parts: L(H) and L(D|H), where H represents the hypothetical model of data D, L(H) is the length used to encode this hypothesis, and L(D|H) is the length required to encode data D given that hypothesis H is known. The MDL principle aims to find the hypothesis H that minimizes the overall encoding length L(H) + L(D|H), which is the optimal interpretation of the current dataset D. However, this method has certain limitations: the trajectory segments it obtains are often approximate solutions to the optimal values, rather than the globally optimal solutions. Furthermore, in actual modeling, trajectory segmentation needs to strike a balance between data simplicity and representational accuracy; a single optimization objective may not fully reflect actual needs.
[0030] To address the aforementioned problems, this invention proposes a weighted improvement method based on the traditional MDL principle. By introducing two adjustment factors, m and n, the optimization objective is expanded from L(H) + L(D|H) to mL(H) + nL(D|H), where... This method allows for flexible adjustment of the weights between model complexity (represented by L(H)) and data fitting accuracy (represented by L(D|H)) according to specific application scenarios, thereby obtaining more practical trajectory segmentation results. Specifically, increasing m reduces the number of segments, making the trajectory smoother, while increasing n preserves more trajectory detail features. Practice shows that this weighted MDL method has achieved good segmentation results on multiple real-world datasets, effectively improving the accuracy and stability of subsequent prediction tasks. The specific calculation formulas for L(H) and L(D|H) are detailed in Formula (1).
[0031]
[0032] Where, par i This indicates the number of segments in the trajectory, i.e., how many segments a trajectory is divided into. j represents the index of the segment. This represents the start and end points of the j-th segment. Represents trajectory segment With trajectory point p k p k+1 The vertical distance. Represents trajectory segment With trajectory point p k p k+1 Differences in perspective.
[0033] Then, the trajectory points are treated as nodes in a graph, and the edge between two nodes (trajectory points) represents the "cost of using these two points as a segment," thus constructing an undirected complete graph (i.e., any two trajectory points are connected by an edge). The trajectory T... i The simplified trajectory can be obtained by converting the graph into an undirected complete graph and solving for the shortest path. During this process, edge P... i P j The weight ω(P) i P j It is calculated using the following formula:
[0034] ω(P i P j = mL(H) + nL(D|H)
[0035] By introducing weighting factors m and n, the optimization objective is expanded from L(H)+L(D|H) to mL(H)+nL(D|H), which allows the model to flexibly adjust the weights of model complexity and data fitting accuracy according to the actual scenario.
[0036] Ultimately, the shortest path sequence obtained using this method is the optimal sequence after trajectory segmentation.
[0037] Step 1.3: Apply the Geohash algorithm to the latitude and longitude points in the segmented trajectory sequence for grid encoding, converting the trajectory into a corresponding grid ID sequence. Specifically, Geohash uses the "top 1, bottom 0" and "right 1, left 0" rules for grid encoding of latitude and longitude according to accuracy requirements. Finally, the obtained binary encoding is converted into Base32 encoding (character set: 0–9, b–z, excluding a, i, l, o to avoid ambiguity) to generate the corresponding Geohash string. Geohash maps continuous latitude and longitude to discrete grid IDs, achieving discretization and scalability of the encoding. Then, the Base2vec model is used to embed vectors into each grid ID, generating a distributed representation vector set of the trajectory. The core idea of Base2vec is that if two grids are geographically adjacent or frequently co-occur in the trajectory sequence, their vector representations should also have higher similarity in the embedding space, thus preserving the spatial topological structure information of the trajectory while maintaining low-dimensional feature representation. Ultimately, the Geohash-Base2vec module outputs a fixed-length vector sequence that can be directly integrated into any downstream network such as CNN, Transformer, or GNN without modifying the network structure. Furthermore, the Geohash dictionary and Base2vec weights can be updated incrementally and independently, ensuring the smoothness of the system's long-term evolution.
[0038] In terms of model structure, Base2vec models the grid encoding sequences in the trajectory, and its network structure is as follows: Figure 2 As shown. Specifically, the model input is the one-hot encoded vector Cg of the current grid, with dimension M, representing the number of all possible grids. By multiplying with the embedding matrix, the input vector is mapped to an N-dimensional latent space to obtain its embedding representation; subsequently, this embedding vector is multiplied with the decoding matrix to obtain the M-vector corresponding to the grid encoding.
[0039] To train the model, Base2vec uses the SoftMax function to calculate the similarity between candidate grids and the current center grid, and selects the top k grids with the highest similarity as the prediction results, which are then compared with the real target. Finally, the parameters of the embedding matrix and decoding matrix are optimized through error backpropagation to learn a low-dimensional vector representation that reflects the geographic structure relationships. Its objective function is shown in the equation:
[0040]
[0041] Where T represents the set of all trajectory points, tra(Cg) represents the set of trajectory points adjacent to the current grid Cg, and P(tra(Cg)|Cg) represents the probability of predicting tra(Cg) given Cg.
[0042] After training, the optimal mapping matrix becomes the final embedding matrix. Subsequently, low-dimensional location vectors with geographic topological relationships can be obtained by multiplying the grid one-hot encoding with the embedding matrix.
[0043] Step 2: Time-frequency feature extraction.
[0044] After the trajectory processing in the previous step, the trajectory sequence is represented as an embedding vector sequence containing geographic topological relationships, i.e., a trajectory embedding sequence. Wavelet transform is applied to the trajectory embedding sequence to calculate the multi-scale time-frequency features corresponding to each time step. These time-frequency features can reveal the local oscillations and abrupt changes in the trajectory (such as turns, sudden stops, etc.).
[0045] Wavelet decomposition, also known as multi-resolution decomposition, uses low-pass and high-pass filters to separate signals into detail and approximate components at different scales. The core reason this invention introduces wavelet transform after the trajectory embedding sequence is that the driving patterns of suspicious vehicles often simultaneously contain two types of information: "long-period trends" (such as macroscopic intentions like "circling the city" or "crossing districts") and "short-period abrupt changes" (such as microscopic behaviors like "sudden braking," "U-turns," or "short stops"). In contrast, traditional LSTM and its variants rely solely on gating mechanisms to progressively pass hidden states in the time domain, failing to explicitly extract frequency domain features and struggling to adaptively focus on abnormal patterns at different time granularities. Therefore, their accuracy is limited in recognizing instantaneous behaviors such as sudden stops and sharp turns.
[0046] Specifically, it includes:
[0047] Step 2.1, Filtering and Subsampling
[0048] Low-pass filter (approximate):
[0049] A j [n]=∑ k h[k]×x[2n-k]
[0050] High-pass filter (details):
[0051] D j [n]=∑ k g[k]×x[2n-k]
[0052] Where h[k] and g[k] are the coefficients of the low-pass filter and the high-pass filter, respectively, n is the discrete-time index, and x is the signal.
[0053] Step 2.2, Multi-level decomposition
[0054] At each level j, the signal is decomposed into an approximate component Aj and a detail component Dj. This process is repeated for the approximate component to obtain lower-scale components.
[0055] Step 2.3, Signal Reconstruction
[0056] To reconstruct the signal from its decomposed components, a reconstruction filter associated with the analysis filter is required.
[0057] x[n]=∑ k (h′[k]×A j [2n-k]+g′[k]×D j [2n-k])
[0058] Where h′[k] and g′[k] are the coefficients of the low-pass and high-pass reconstruction filters, respectively. This decomposition is shown in the figure below.
[0059] After decomposition, the time-frequency features corresponding to each time step are obtained, and they are combined to form a time-frequency feature sequence.
[0060] Step 3: Sequence model reasoning.
[0061] Step 3.1: Input the time-frequency feature sequence obtained in the previous step into the LSTM network (Long Short-Term Memory) model.
[0062] (1) First, based on the input vector x at the current time step t The hidden state h of the previous time step t-1 The forgetting gate determines the cell state C at the previous moment. t-1 Which information should be retained or discarded? This process can be described by the following formula:
[0063] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0064] Where σ represents the Sigmoid activation function, W f Let b be the weight matrix of the forget gate. f This is a bias term.
[0065] (2) Next, the LSTM determines which information needs to be written into the cell state at the current time. The input gate first passes through x t with h t-1 The combination of calculations yields the update ratio i. t And generate new candidate states to be written. The calculation formula is as follows:
[0066] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0067]
[0068] Among them, W i W c The weight matrices for the input gate and the candidate state are respectively, b i ,b c This is a bias term.
[0069] (3) Combine the outputs of the forget gate and the input gate to update the cell state C at the current moment. t To integrate historical memory with current input, the update formula is as follows:
[0070]
[0071] Among them, C t-1 i represents the cell state at the previous time step. t This represents the total input information at time t.
[0072] (4) Finally, the hidden state h at the current moment is controlled by the output gate. t This serves as the final output feature for that time step. The output gate is calculated as follows:
[0073] O t =σ(W o ·[h t-1 ,x t ]+b o )
[0074] h t =O t *tanh(C t )
[0075] Among them, W o Let b be the weight matrix of the output gate. o This is a bias term.
[0076] Through the recursive calculations of the above four stages, the final time step output h is obtained. t This represents the feature of the entire prefix trajectory, and simultaneously yields the time-step feature representation O. t .
[0077] This invention introduces a self-attention mechanism into the traditional LSTM network, based on the characteristics of each time step O. t The network adaptively assigns attention weights. In this way, it automatically emphasizes the contribution of important trajectory points to the final intent reasoning.
[0078] To extract long-term dependencies between distant trajectory points and address the issue that Long Short-Term Memory (LSTM) networks require multiple iterations to connect these points, this invention introduces a self-attention mechanism to address the problem of long short-term memory networks needing multiple iterations to connect distant trajectory points. tWeight allocation. The calculation process in its three stages is as follows: Figure 3 As shown.
[0079] In the first stage, the similarity is calculated by performing a dot product between the query vector Query(Q) at each time step and the key vectors Key(K) at all other time steps, resulting in a preliminary weight score. The specific expression is as follows:
[0080]
[0081] Where Q and K are representations obtained by performing different linear transformations on the input feature vector x, d x The dimension of the input features is represented by the scaling dot product of the query vector Q at the current time step and the key vectors K at all time steps, which yields the preliminary similarity score S.
[0082] In the second stage, to unify the numerical range of weight scores and enhance the expressive power of salient features, a Softmax function is introduced to normalize the similarity scores obtained in the first stage. "Abnormal" segments such as sudden stops and U-turns have high similarity scores to the current point, so after Softmax, their weights are close to 1, and almost all of their motion features are preserved. Normal straight segments have low scores, so their weights tend to be 0, information is suppressed, and the model does not mix a large amount of irrelevant linear motion into the representation, thereby improving its sensitivity to and explanatory power for abrupt changes. The specific formula is:
[0083]
[0084] In the third stage, based on the attention weight coefficients calculated in the second stage, the corresponding value vectors Value(V) are weighted and summed to obtain the context representation of the current time step in the sequence. The calculation formula is as follows:
[0085]
[0086] Step 4: Intent Prediction Output.
[0087] Step 4.1: Pass the output of the last layer of the LSTM network through the Softmax classifier to predict which destination cluster the target belongs to.
[0088] Step 4.2: Then use the Geohash decoder to convert the cluster labels into actual geographic coordinates to obtain the predicted destination of the target.
[0089] Example
[0090] To verify the effectiveness of the algorithm of this invention, two real-world datasets, Porto and T-Drive, were selected, and the experimental results were compared with those of methods such as ETCNN, MDLF, HAHIF, and EFAMVA. Figure 5 As shown.
[0091] The comparison results show that the method of this invention has a significant advantage over ETCNN, MDLF, and HAHIF in terms of overall prediction accuracy across both evaluation metrics, especially on the Porto dataset, where it also demonstrates superior prediction performance compared to EFAMVA. This invention achieves flexible adjustment of trajectory segmentation and a significant improvement in prediction accuracy by combining a weighted improved MDL with a graph-based shortest path method, demonstrating advantages on multiple datasets and adapting to different scenario requirements.
[0092] In summary, the above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A destination reasoning method for urban vehicle tracking, characterized in that, include: S1, collect vehicle trajectory data, and use the weighted minimum description length algorithm to segment the trajectory to obtain the globally optimal segmented trajectory sequence; wherein, in the weighted minimum description length algorithm, the optimization objective is mL(H)+nL(D|H); where m and n are the weight factors of L(H) and L(D|H), respectively; S2, after grid encoding of the latitude and longitude points in each segment of the trajectory sequence in S1, uses the Base2vec model to map the trajectory sequence into a low-dimensional distributed vector representation, resulting in an embedded vector sequence containing geographic topological relationships, i.e., the trajectory embedding sequence. S3, perform wavelet decomposition on each trajectory embedding sequence to obtain the time-frequency feature sequence; S4, construct an LSTM network, including an input layer, an LSTM layer, a self-attention mechanism module, and a Softmax classifier; the input of the input layer is the time-frequency feature sequence of the trajectory embedding sequence; the LSTM layer recursively computes the time-step feature representation O. t The self-attention mechanism module is used to compute feature O. t The weights; the Softmax classifier is based on the features O at each time step. t And its weight, to predict which destination cluster the target belongs to; The self-attention mechanism module calculates feature O in the following way. t Weight: The similarity of the query vector Q at each time step with the key vector K at all other time steps is calculated by taking the dot product, and the weight S at that time step is obtained. S5 converts the cluster labels predicted in S4 into actual geographic coordinates to obtain the predicted destination of the target.
2. The method as described in claim 1, characterized in that, In step S1, the collected vehicle trajectory data is first cleaned and denoised, including removing null values, short trajectories, and outliers.
3. The method as described in claim 1 or 2, characterized in that, In step S1, long trajectory data of the vehicle is collected, and then a sliding window method is used to divide the long trajectory into multiple short trajectories of fixed length for subsequent steps.
4. The method as described in claim 1, characterized in that, In S2, the latitude and longitude points in the trajectory sequence are grid-coded using the Geohash algorithm, UTM grid coding, S2 grid coding, quadtree grid coding, or H3 grid coding.
5. The method as described in claim 1, characterized in that, Specifically, S refers to: Where, d x Let T be the dimension of the input feature, and T be the transpose.
