STR: Spatio-temporal trajectory representation learning with dual-focus encoder for whole trajectory similarity computation
Mengqiu Li, Xinzheng Niu, Jiahui Zhu, Philippe Fournier‐Viger, Youxi Wu · Information Fusion · 2025
In the field of trajectory data mining , trajectory similarity computation is a key issue associated with trajectory representation learning . Current methods of trajectory similarity computation often represent trajectory data of varying lengths as vectors with uniform dimension. However, existing trajectory representations fall short of comprehensively calculating trajectory similarity: first, they focus solely on spatial information, while overlooking the temporal information of the trajectory, and second, they represent the temporal and spatial information separately. To address these limitations, we propose a novel Spatio-temporal Trajectory Representation method, named STR, aimed at capturing both the features of individual trajectories and the relationships between them in a three-dimensional spatio-temporal region from the perspectives of both trajectory points and whole trajectories, and improving the accuracy of trajectory similarity metrics. STR consists of two main modules: (i) a trajectory feature tokenization module, which considers the uneven density distribution of trajectory points in the three-dimensional space to build a hierarchical structure that considers space and time as a whole, and extracts spatio-temporal features to construct a token sequence; (ii) a dual-focus trajectory encoder learns the features of a given trajectory and those of similar trajectories, thereby enabling the consideration of relationships between whole trajectories. Moreover, a density-based whole trajectory similarity metric is designed to find similar trajectories. Experiments were conducted on three public datasets, and the accuracy of the trajectory representations obtained with STR is significantly greater than for existing state-of-the-art baselines on a variety of distance metrics.