做轨迹分析或时空数据挖掘的团队,TrajTok 提供了一种无需为每个任务单独训练模型的通用方案,值得关注其预训练权重和代码开源。
TrajTok 是一种新型轨迹编码器,通过自适应多分辨率六边形网格分词和掩码标记预训练,从原始GPS轨迹中学习可迁移的轨迹表征。它解决了传统网格分词中细粒度导致稀疏、粗粒度混淆运动模式的问题。TrajTok 使用分解式Transformer编码器,分别处理几何和运动学特征,并通过交叉注意力融合。在Porto数据集上,冻结的TrajTok编码器配合轻量任务适配器,在轨迹相似性搜索、分类、预计到达时间等任务上超越多个专用方法。这表明多分辨率空间分词与掩码预训练是构建通用轨迹基础模型的有前景方向。
TrajTok: Adaptive Spatial Tokenization for Trajectory Representation Learning
Learning generalizable trajectory representations from raw GPS traces remains difficult because the data is continuous, noisy, and irregularly sampled. Spatial tokenization is also challenging: fine grids yield sparse cells with weak embeddings, while coarse grids merge heterogeneous movement patterns into the same token. We present TrajTok, a trajectory encoder with a simple pretraining recipe for transferable trajectory embeddings. TrajTok first learns a multi-resolution hexagonal cell partition from the spatial distribution of GPS points, converting noisy GPS sequences into discrete cell tokens. To capture both geometry and kinematics, it uses a factorized transformer encoder with early per-modality self-attention blocks, cross-attention fusion layers, and spatiotemporal rotary position embeddings, ST-RoPE, to encode where and when each token occurs. TrajTok is pretrained with masked-token modeling that recovers both geometric structure and kinematic patterns from partial trajectory observations. On the Porto dataset, a frozen TrajTok encoder with lightweight task adapters achieves strong performance across trajectory similarity search, classification, estimated time of arrival, and full travel-time regression, outperforming multiple task-specific methods. The same frozen encoder supports both geometry-dominated and kinematics-dominated tasks, suggesting that TrajTok learns transferable trajectory structure rather than task-specific shortcuts. These results indicate that learned multi-resolution spatial tokenization combined with masked-token pretraining is a promising direction for general-purpose trajectory foundation models.