Ship Trajectory Prediction Method of Gated Recurrent Unit Based on Spatial-temporal Attention Mechanism
-
摘要: 船舶轨迹预测的精度关系到船舶智能航行水平。针对门控循环单元(gated recurrent unit, GRU)提取船舶时空信息数据能力不足,导致轨迹预测精度不佳的问题,研究了基于时空注意力机制的GRU船舶轨迹预测方法(spatial-temporal attention mechanism-gated recurrent unit, STA-GRU)。将传统GRU中的激活函数改进为加权激活函数组,以保留更完整的船舶轨迹数据;引入空间注意力机制模块提取船舶空间位置信息的特征,以船舶经纬度及相对经纬度数据作为输入序列,计算对应的空间权重注意力因子,获得空间特征向量;再引入时间注意力机制模块挖掘观测时段内历史轨迹特征向量的时空依赖性,以历史轨迹数据中的航速、航向拼接空间特征向量作为输入序列,计算时空权重注意力因子,将获得的时空特征向量作为STA-GRU模型的训练数据集,用于船舶轨迹预测。采用青岛港AIS数据开展实验验证,以输入时长20 min,采样频率2 min作为输入条件,构建船舶航行轨迹数据集,结果表明:对比LSTM、AT-GRU、Bi-GRU算法,STA-GRU模型不仅在训练过程中收敛速度更快,而且在均方根误差、平均绝对误差、最终位移误差指标中均有大幅下降,预测轨迹时各项指标平均降低了50.2%,38.7%,48.3%;预测经度时各项指标平均降低了43.8%,50.5%,49.5%;预测纬度时各项指标平均降低了52.4%,48.4%,50.5%。因此,所提船舶轨迹预测STA-GRU模型的精度有显著提升,并能满足轨迹预测的实时性需求。Abstract: The accuracy of ship trajectory prediction is crucial for the intelligence level of ship's navigation. Addressing the insufficient capability of the gated recurrent unit (GRU) in capturing spatial-temporal information from ship data, which leads to poor accuracy in trajectory prediction, a method of GRU ship trajectory prediction based on spatial-temporal attention mechanism (STA-GRU) is investigated. The traditional activation function in GRU is improved by a weighted activation function set to retain more comprehensive ship trajectory data. A spatial attention mechanism module is introduced to extract spatial location features of ships using latitude, longitude, relative latitude, and relative longitude as input sequences. This module computes spatial-temporal weight attention factors to obtain spatial feature vectors. The resulting vectors serve as the training dataset for the STA-GRU model used for ship trajectory prediction. Experimental validation is conducted using AIS data from Qingdao Port, with an input duration of 20 minutes and a sampling frequency of 2 min. A ship navigation trajectory dataset is constructed under these conditions. Results indicate that, compared to LSTM, AT-GRU, and Bi-GRU algorithms, the STA-GRU model not only converges faster during training but also significantly reduces the root mean square error, mean absolute error, and final displacement error. The average reductions of the aforementioned indexes for trajectory prediction are 50.2%, 38.7%, and 48.3%, respectively. For longitude prediction, the average reductions are 43.8%, 50.5%, and 49.5%, respectively. For latitude prediction, the average reductions are 52.4%, 48.4%, and 50.5%, respectively. Therefore, the proposed STA-GRU model exhibits significantly improved accuracy in ship trajectory prediction and meets the real-time requirements for trajectory prediction.
-
表 1 STA-GRU与不同模型预测误差对比
Table 1. Comparison between STA-GRU and other models prediction error
预测指标 模型 RMSE MAE FDE 轨迹 LSTM 0.185 6 0.214 8 0.085 1×10-2 AT-GRU 0.116 9 0.105 2 0.051 9×10-2 Bi-GRU 0.128 2 0.119 4 0.068 0×10-2 STA-GRU 0.068 7 0.081 6 0.034 0×10-2 经度 LSTM 0.139 5×10-2 1.099 9×10-3 0.107 6×10-2 AT-GRU 0.096 5×10-2 0.836 5×10-3 0.074 7×10-2 Bi-GRU 0.107 4×10-2 0.963 7×10-3 0.085 6×10-2 STA-GRU 0.062 8×10-2 0.473 0×10-3 0.044 1×10-2 纬度 LSTM 0.118 5×10-2 0.903 3×10-3 0.391 7×10-3 AT-GRU 0.074 6×10-2 0.474 7×10-3 0.237 3×10-3 Bi-GRU 0.079 1×10-2 0.541 7×10-3 0.256 1×10-3 STA-GRU 0.041 4×10-2 0.305 3×10-3 0.139 1×10-3 表 2 模型实时性分析
Table 2. Analysis of model real-time
模型 运行时间/s LSTM 2.356 2 GRU 1.578 6 Bi-GRU 2.102 5 AT-GRU 1.896 9 STA-GRU 1.648 3 -
[1] 严新平, 李晨, 刘佳仑, 等. 新一代航运系统体系架构与关键技术研究[J]. 交通运输系统工程与信息, 2021, 21(5): 22-29, 76. https://www.cnki.com.cn/Article/CJFDTOTAL-YSXT202105004.htmYAN X P, LI C, LIU J L, et al. Architecture and key technologies for new generation of waterborne transportation system[J]. Journal of Transportation Systems Engineering and Information Technology, 2021, 21(5): 22-29, 76. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-YSXT202105004.htm [2] YANG D, WU L, WANG S, et al. How big data enriches maritime research: a critical review of automatic identification system (AIS)data applications[J]. TransportReviews, 2019, 39(3): 1-19. http://www.semanticscholar.org/paper/ffb2d6dba4c557d948ff0e8acd3d0dd09ef4e226 [3] 江海洋, 高超, 马勇. 基于FP-TSDP算法的船舶轨迹压缩[J]. 无人系统技术, 2022, 5(1): 36-42. https://www.cnki.com.cn/Article/CJFDTOTAL-UMST202201004.htmJIANG H Y, GAO C, MA Y, Ship trajectory compression based on FP-TSDP algorithm[J]. Unmanned Systems Technology, 2022, 5(1): 36-42. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-UMST202201004.htm [4] 姜佰辰, 关键, 周伟, 等. 基于多项式卡尔曼滤波的船舶轨迹预测算法[J]. 信号处理, 2019, 35(5): 741-746. https://www.cnki.com.cn/Article/CJFDTOTAL-XXCN201905002.htmJIANG B C, GUAN J, ZHOU W, et al. Vessel trajectory prediction algorithm based on polynomial fitting kalman filtering[J]. Journal of Signal Processing, 2019, 35(5): 741-746. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-XXCN201905002.htm [5] 高建, 毛莺池, 李志涛. 基于高斯混合-时间序列模型的轨迹预测[J]. 计算机应用, 2019, 39(8): 2261-2270. https://www.cnki.com.cn/Article/CJFDTOTAL-JSJY201908015.htmGAO J, MAO Y C, LI Z T, et al. Trajectory prediction based on gauss mixture time series model[J]. Journal of Computer Applications, 2019, 39(8): 2261-2270. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-JSJY201908015.htm [6] 周艳萍, 曾宪群, 蔡玲. 改进灰色模型的船舶航行轨迹自动预测研究[J]. 舰船科学技术, 2021, 43(20): 34-36. https://www.cnki.com.cn/Article/CJFDTOTAL-JCKX202120013.htmZHOU Y P, ZENG X Q, CAI L. Research on automatic prediction of ship trajectory based on improved grey model[J]. Ship Science and Technology, 2021, 43(20): 34-36. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-JCKX202120013.htm [7] 冯然, 张力仁, 王立辉. 基于二阶马尔可夫链的不确定性轨迹预测[J]. 测绘与空间地理信息, 2020, 43(增刊1): 207-211. https://www.cnki.com.cn/Article/CJFDTOTAL-DBCH2020S1062.htmFENG R, ZHANG L R, WANG L H. Uncertainty trajectory prediction based on second-order markov chain[J]. Geomatics & Spatial Information Technology, 2020, 43 (S1): 207-211(in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-DBCH2020S1062.htm [8] 甄荣, 金永兴, 胡勤友, 等. 基于AIS信息和BP神经网络的船舶航行行为预测[J]. 中国航海, 2017, 40(2): 6-10. https://www.cnki.com.cn/Article/CJFDTOTAL-ZGHH201702002.htmZHEN R, JIN Y X, HU Q Y, et al. Prediction of ship navigation behavior based on AIS information and BP neural network[J]. China Navigation, 2017, 40(2): 6-10. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-ZGHH201702002.htm [9] 高天航, 徐力, 靳廉洁, 等. 考虑航艏向与数据变化差异的船舶轨迹预测[J]. 交通运输系统工程与信息, 2021, 21(1): 90-94. https://www.cnki.com.cn/Article/CJFDTOTAL-YSXT202101015.htm [10] LI H H, JIAO H, YANG Z L. AIS data-driven ship trajectory prediction modelling and analysis based on machine learning and deep learning methods[J]. Transportation Research Part E, 2023, 175: 103152. doi: 10.1016/j.tre.2023.103152 [11] 李岩. 基于深度学习的船舶航行轨迹预测方法研究[D]. 武汉: 武汉理工大学, 2021.LI Y. Study on deep learning based vessel trajectory prediction methods[D]. Wuhan: Wuhan University of Technology, 2021. (in Chinese) [12] CHEN X, WEI C, ZHOU G, et al. Automatic identification system(AIS) data supported ship trajectory prediction and analysis via a deep learning model[J]. Journal of Marine Science and Engineering, 2022, 10(9): 1314. doi: 10.3390/jmse10091314 [13] GAO D W, ZHU Y S, ZHANG J F, et al. A novel MP-LSTM method for ship trajectory prediction based on AIS data[J]. Ocean Engineering, 2021(228): 108956 [14] 王知昊, 元海文, 李维娜, 等. 交汇水域船舶轨迹预测与航行意图识别[J]. 交通信息与安全, 2022, 40(4): 101-109. doi: 10.3963/j.jssn.1674-4861.2022.04.011WANG Z H, YUAN H W, LI W N, et al. Trajectory prediction and intention identification of ships in confluence waters[J]. Journal of Transport Information and Safety, 2022, 40 (4): 101-109. (in Chinese) doi: 10.3963/j.jssn.1674-4861.2022.04.011 [15] CHEN J, CHEN H, ZHAO Y, et al. FB-BiGRU: a deep learning model for AIS-based vessel trajectory curve fitting and analysis[J]. Ocean Engineering, 2022, 266: 112898 doi: 10.1016/j.oceaneng.2022.112898 [16] ZHANG L, ZHANG J Z, NIU J, et al. Track prediction for HF radar vessels submerged in strong clutter based on MSCNN fusion with GRU-AM and AR model[J]. Remote Sensing, 2021, 13(11): 2164-2164. doi: 10.3390/rs13112164 [17] WANG S W, LI Y, XING H. A novel method for ship trajectory prediction in complex scenarios based on spatio-temporal features extraction of AIS data[J]. Ocean Engineering, 2023, 281: 114846. doi: 10.1016/j.oceaneng.2023.114846 [18] DUAN Y, CAO X, ZHAO J, et al. Health indicator construction and status assessment of rotating machinery by spatio-temporal fusion of multi-domain mixed features[J]. Measurement, 2022, 205: 112170. doi: 10.1016/j.measurement.2022.112170 [19] BAO K, BI J, GAO M, et al. An improved ship trajectory prediction based on AIS data using MHA-BiGRU[J]. Journal of Marine Science and Engineering, 2022, 10(6): 804. doi: 10.3390/jmse10060804 [20] 崔文岳, 谷远利, 赵胜利, 等. 基于有向图卷积与门控循环单元的短时交通流预测方法[J]. 交通信息与安全, 2023, 41 (2): 121-128. doi: 10.3963/j.jssn.1674-4861.2023.02.013CUI W Y, GU Y L, ZHAO S L, et al. A method of predicting short-term traffic flows based on a DGC-GRU model[J]. Journal of Transport Information and Safety, 2023, 41(2): 121-128. (in Chinese) doi: 10.3963/j.jssn.1674-4861.2023.02.013 [21] GUO M, XU T, LIU J, et al. Attention mechanisms in computer vision: a survey[J]. Computational Visual Media, 2022, 8(3): 331-368. doi: 10.1007/s41095-022-0271-y [22] 郭玲, 于海雁, 周志权. 基于SimAM注意力机制的近岸船舶检测方法[J]. 哈尔滨工业大学学报, 2023, 55(5): 14-21. https://www.cnki.com.cn/Article/CJFDTOTAL-HEBX202305002.htmGUO L, YU H Y, ZHOU Z Q. Nearshore ship detection method based on SimAM attention mechanism[J]. Journal of Harbin Institute of Technology, 2023, 55(5): 14-21. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-HEBX202305002.htm [23] NIU Z Y, ZHONG G Q, YU H. Areview on the attention mechanism of deep learning[J]. Neurocomputing, 2021, 452: 48-62. doi: 10.1016/j.neucom.2021.03.091