학술
기타
A deep neural network and AIS-integrated method for ship trajectory prediction and yaw warning in cross-river power transmission line protection
PLOS ONE
조회 0
CC BY
이 매체는 공공·자유 라이선스로 본문을 직접 표시합니다.Figures
Abstract
Ship trajectory prediction plays a crucial role in ensuring the safety of inland waterway transportation and enabling intelligent scheduling. To address the limitations of traditional models in capturing long-term dependencies and extracting salient features, this study proposes a novel prediction model—TDV-TTCN-BiGRU—integrating a Temporal-Dependent Variable (TDV) attention mechanism with an improved TCN-BiGRU architecture. The model employs a hierarchical Temporal Convolutional Network (TTCN) to extract multi-scale temporal features in parallel, incorporates the TDV attention mechanism to adaptively adjust the weights of speed and heading features, and uses BiGRU to model bidirectional dependencies, thereby enhancing prediction accuracy and stability. Experiments based on real AIS data include both comparative and ablation studies. Results show that the proposed TCN-BiGRU outperforms CNN, BiGRU, CNN-BiLSTM, and CNN-BiGRU models, achieving the lowest prediction errors. Compared to CNN-BiGRU, the TDV-TTCN-BiGRU model reduces MSE of predicted longitude and latitude by 14.47% and 18.83%, respectively; MAE by 22.41% and 21.25%; and ADE by 21.46%, with trajectory plots showing closer alignment with actual vessel tracks. Furthermore, to address the risk of vessels deviating from navigable channels, a multi-level yaw warning mechanism is developed and validated in typical cross-river scenarios. The system achieves a warning accuracy of over 96%, significantly improving the responsiveness to unexpected yaw behavior. The proposed method provides technical support for intelligent ship navigation, maritime safety management, and the protection of overhead transmission lines.
Citation: Rui Y, Zhaofeng L, Xunyun L, Zehuai L (2026) A deep neural network and AIS-integrated method for ship trajectory prediction and yaw warning in cross-river power transmission line protection. PLoS One 21(6): e0350221. https://doi.org/10.1371/journal.pone.0350221
Editor: Lei Zhang, Beijing Institute of Technology, CHINA
Received: November 17, 2025; Accepted: May 11, 2026; Published: June 9, 2026
Copyright: © 2026 Rui et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Data Availability: Data were obtained from the South China Sea Navigation Service Center of the China Maritime Safety Administration and are available with the full permission of the China Maritime Safety Administration. Interested researchers may contact the open URL to obtain detailed information on the temporal and geographical scope of the dataset before applying for access from the official source AUTHORS hereby request that the open-access journal PLOS ONE publish the original data contents under the Creative Commons Attribution License (CC BY 4.0). Please note that this license permits un-restricted use, distribution, and re-production by any users, even for commercial purposes, provided appropriate credit is given. Accordingly, I provide this explicit written permission, the URL confirmation: https://osf.io/9shbk/overview.
Funding: Dongguan Power Supply Bureau of Guangdong Power Grid Co., Ltd. Science and Technology Project: Auxiliary Research Project on Cross - Waterway Line Sensing and Alarm Technology. No:031900KC23110061 (GDKJXM20231262).
Competing interests: The authors have declared that no competing interests exist.
Introduction
With the rapid development of the shipping industry, the number of vessels navigating inland waterways has surged. However, due to factors such as violations by heavy vessel operators, negligence, and insufficient training in electrical safety, incidents involving ships colliding with overhead power transmission lines that span across waterways have occurred with increasing frequency. These accidents not only pose serious threats to vessel safety and human life but also jeopardize the stability of power supply systems. As a result, the development of advanced and reliable ship trajectory prediction and yaw warning methods has become a research hotspot in inland waterway traffic safety. Such technologies are crucial for enhancing navigation safety and protecting cross-river transmission lines from external mechanical damage.
To date, substantial research has been conducted on ship trajectory prediction by scholars both domestically and internationally. Traditional methods are mainly categorized into kinematics-based models and machine learning-based approaches. Kinematic models often suffer from significant errors when dealing with nonlinear dynamic behaviors and heavily depend on state transition probabilities, resulting in limited adaptability and accuracy in complex navigation environments. Machine learning methods, on the other hand, struggle to fully exploit the temporal features of AIS (Automatic Identification System) data and are prone to parameter tuning challenges and local optima, which compromise prediction performance.
In recent years, with the advancement of deep learning, neural network-based models have gradually become the mainstream approach for trajectory prediction. Ma et al. [1] proposed a multi-trajectory prediction model based on RNN-LSTM. Xue et al. [2] developed a hierarchical architecture integrating GRU and Transformer, significantly improving mid- and long-term prediction capabilities. Wang [3] combined CNN and LSTM for AIS trajectory modeling, enhancing spatial and temporal feature extraction. Zhao et al. [4] introduced a feature attention mechanism into the RNN-BiLSTM framework, notably improving prediction accuracy, especially in curved navigation scenarios. GRU, known for its fewer parameters and faster training speed, has also been widely used in trajectory modeling. You et al. [5] utilized GRU to encode spatiotemporal AIS sequences, mitigating gradient vanishing and improving model performance. Yu et al. [6] further integrated ARIMA and BiGRU with attention mechanisms to model ship trajectories. Moreover, Temporal Convolutional Networks (TCN) have drawn attention for combining the parallelism of convolutional operations with the capability to model long-term dependencies. Guo [7] proposed an attention-based model integrating TCN and Bi-LSTM to effectively extract past and future trajectory states. Dong et al. [8] developed a CNN-MTABiGRU model incorporating temporal attention, which demonstrated significant error reduction in prediction tasks.
Despite the notable progress achieved by deep learning-based approaches in ship trajectory prediction, challenges remain in terms of limited feature extraction capability and insufficient generalization [9]. Especially in complex inland waterway environments, existing models often fail to fully capture long-term dependencies in temporal sequences, resulting in unsatisfactory prediction accuracy for practical applications [10]. Thus, designing models with enhanced temporal perception and feature extraction abilities remains a pressing research challenge.
To address these issues, this paper proposes a novel ship trajectory prediction and yaw warning method that integrates a Temporal-Dependent Variable (TDV) attention mechanism with an improved TCN-BiGRU framework. A hierarchical TCN (TTCN) is introduced to overcome the limitations of conventional TCN in long-sequence modeling, leveraging multi-layer parallel dilated convolutions to enhance trajectory feature extraction and improve the model’s capability to handle long-term dependencies. Meanwhile, the TDV attention mechanism adaptively adjusts the feature weights of navigational directions (i.e., heading and speed), optimizing prediction performance under varying vessel motion states. BiGRU is then incorporated to further model the temporal dependencies in trajectory data, enhancing the overall prediction accuracy and stability. Experimental results verify the accuracy and robustness of the proposed model. Furthermore, in the tested river segments, the model successfully issues safety prompts and yaw warnings to passing vessels, thereby improving the management and emergency response capacity of cross-river transmission lines. The proposed method significantly improves the accuracy, reliability, and robustness of trajectory prediction in inland waterway environments, offering technical support for intelligent waterway management and the protection of overhead power transmission lines, with promising application and promotion value.
Model architecture
Temporal convolutional network
The Temporal Convolutional Network (TCN) is an architecture that integrates the core concepts of Convolutional Neural Networks (CNNs) and is specifically designed to handle time series data. It enables more efficient parallel computation and offers flexible receptive fields, thereby providing advantages in both training and inference stages. TCN employs a dilated causal convolution structure that ensures temporal causality while achieving a large receptive field with fewer network layers, which is critical for modeling long-term dependencies [11]. The structure of a dilated causal convolution is illustrated in Fig 1.
As shown in Fig 1, input data enters the network from the lower layers, where each data point is processed through convolutional layers. The dilation factor determines the step size between input points and is commonly set to increase exponentially, such as 1, 2, 4, etc. By progressively increasing across layers, TCNs can achieve a large receptive field with relatively few layers, enabling them to capture long-range temporal dependencies. The total receptive field after L stacked layers can be expressed as:
(1)where denotes the kernel size, and is the dilation factor at the -th layer. With exponential growth in , the convolutional kernel can effectively capture information across a broad temporal span. The output layer aggregates the convolutional features from the previous layers and produces the final output of the network. This structure combines the strengths of causal and dilated convolutions, enabling TCNs to adaptively expand their receptive fields layer by layer and exhibit strong performance in time series modeling and forecasting tasks.
To address the vanishing gradient problem as networks deepen, residual connections, as proposed by He et al. [12], are incorporated to improve training efficiency and model performance. Each residual block in the TCN comprises four components: dilated causal convolution, weight normalization, an activation function, and regularization. The structure of a standard TCN residual block is shown in Fig 2.
In a residual connection, the output from one layer is directly added to the output of a subsequent layer through a “skip connection.” Specifically, if the input is and the output of the transformation is , the residual output becomes . This residual formulation can be mathematically expressed as Equation (2). Residual connections facilitate stable gradient flow throughout the network and enhance training efficiency.
(2)In traditional TCNs, each layer employs only a single dilated causal convolution with a fixed dilation factor to expand the receptive field. This design suffers from a critical limitation: a single temporal scale is insufficient to capture complex temporal dependencies effectively. To overcome this, we propose a Tiered Temporal Convolutional Network (TTCN), which structurally expands the single-layer convolution into a multi-branch parallel design. Specifically, each residual unit contains multiple parallel dilated causal convolution layers with varying dilation factors. This multi-scale feature extraction mechanism enables the model to simultaneously capture both short-term and long-term temporal patterns. The outputs from these parallel branches are then fused via a fully connected layer to ensure that essential information is fully utilized. The improved residual unit structure is shown in Fig 3.
In this figure, represent dilated causal convolution layers with different dilation factors. The number of parallel branches must be chosen carefully, balancing model complexity, temporal characteristics of the data, and computational resource constraints. Generally, a smaller is suitable for modeling short-term dependencies with reduced computational cost and faster training, whereas a larger is more appropriate for long-sequence forecasting at the expense of higher computational demands. In this study, we set the number of parallel dilated convolution branches to , which achieves low prediction error while maintaining computational efficiency.
In summary, the improved TTCN architecture—through its parallel dilated convolution layers, multi-scale feature fusion, and optimized residual blocks—enables more accurate modeling of ship trajectory data. Compared with traditional TCNs, this structure allows parallel feature extraction across different temporal scales, enhancing the model’s ability to capture multi-scale temporal dependencies and long-term trajectory trends. This serves as a solid foundation for the subsequent integration of attention mechanisms to further optimize the model.
TDV attention mechanism
The attention mechanism was initially introduced for machine translation tasks and has since been widely applied in areas such as speech recognition and image processing [13]. Its core idea lies in dynamically assigning weights to each time step in the input sequence based on their importance, thereby extracting more representative features [14].
In the context of ship trajectory prediction, although traditional attention mechanisms can capture sequence features, they fall short in modeling directional changes and motion trends within trajectories. To address this limitation, we propose the TDV (Trajectory Direction Vector) Attention Mechanism. The central idea of TDV is to integrate a ship’s Speed Over Ground (SOG) and Course Over Ground (COG) to enhance the model’s ability to capture motion dynamics. The attention mechanism is then used to adaptively adjust the feature weights of the trajectory, improving both prediction accuracy and stability.
This mechanism combines traditional attention with trajectory direction information. During prediction, it dynamically adjusts the weights of SOG and COG, thereby improving the model’s adaptability to different navigation phases (e.g., acceleration, deceleration, turning). A schematic diagram illustrating the predicted weight distribution under the TDV attention mechanism is shown in Fig 4.
In this figure, represents a known trajectory point, for which the latitude, longitude, , and are known. denotes the navigation direction from point to . represents the trajectory direction vector, which can be interpreted as the product of and the time interval, i.e., the sailing distance. R indicates the prediction error range; a smaller R implies a better prediction. is the predicted trajectory point generated by the deep learning model enhanced with the TDV attention mechanism, whereas is predicted by a traditional deep learning model without TDV. The latter exhibits significantly higher error. As training iterations progress, the TDV component adaptively adjusts the weight distribution of , addressing random prediction deviations and enhancing accuracy. The structure of the TDV attention mechanism is illustrated in Fig 5, which consists of three main components: Encoder, Attention Mechanism, and Decoder.
As shown above, in the encoder part, the input trajectory data is processed to extract features, and the trajectory direction information is encoded into hidden state vectors that serve as inputs to the attention mechanism. The trajectory direction vector TDV is defined as:
(3)where is the speed over ground at time step , is the course over ground at that moment, and is the time interval. These values are then input into the encoder to produce hidden states, calculated as follows:
(4)where and are the weight matrices for the input layer and hidden state S, respectively, and sigmoid is a nonlinear activation function. The encoder’s function is to extract trajectory features and represent them in a high-dimensional space, which are then passed to the attention module for adaptive weight adjustment during prediction.
In the attention mechanism, the model evaluates the importance of different trajectory features based on the encoder’s output and assigns different weights. For each trajectory point and decoder hidden state , a similarity score is computed using trainable parameters and :
(5)These similarity scores are normalized using the Softmax function to derive attention weights:
(6)Finally, the weighted sum of all trajectory points is computed to obtain the context vector:
(7)The context vector encapsulates the most relevant historical trajectory information needed for predicting the current ship location and is passed to the decoder for the next step.
In the decoder part, the context vector is combined with the previous decoder hidden state to predict the current ship trajectory point. The computation is given by:
(8)Where is the weight matrix of , is the weight matrix of , and ReLU is the activation function. The decoder output is then projected into the trajectory prediction space via a fully connected layer to generate the predicted value for the next time step.
The TDV attention mechanism dynamically adjusts feature weights by incorporating trajectory direction vectors formed from SOG and COG. It demonstrates heightened sensitivity during significant maneuvering events such as acceleration, deceleration, and turning, while automatically reducing the influence of trajectory features during stable cruising to minimize noise. This mechanism compensates for the temporal lag often encountered in traditional attention methods, significantly improving both the accuracy and stability of trajectory prediction.
Compared with existing studies, the TDV attention mechanism proposed in this paper exhibits distinct differences and extensions in both design and application. First, previous works (e.g., Chen [15]) have explored TDV-based approaches to adaptively adjust the weights of heading and speed features across different navigation stages in order to enhance temporal modeling capability. However, most of these methods directly operate on the input layer or hidden states of neural networks, lacking integration with multi-scale convolutional features. In this study, the TDV attention mechanism is embedded into the improved TTCN-BiGRU framework, enabling it to dynamically select and weight critical heading and speed information at the multi-scale convolutional feature layer, thereby achieving cross-scale temporal feature filtering. Second, beyond verifying the effectiveness of TDV attention in trajectory prediction, this research further couples it with the logic of yaw deviation warning, forming a closed-loop mechanism of “prediction–evaluation–warning.”
Bidirectional gated recurrent unit
The Gated Recurrent Unit (GRU) is an improved variant of the Recurrent Neural Network (RNN). By incorporating gating mechanisms, GRU effectively mitigates the vanishing gradient problem and enhances training efficiency while preserving long-term dependency information [16]. The structure of the GRU model is illustrated in Fig 6.
The GRU consists of two core components: the reset gate and the update gate. The process of state update is as follows:
The reset gate controls the influence of the previous hidden state on the current input:
(9)The update gate determines how much historical information is retained in the current state:
(10)The candidate hidden state is updated by combining the current input with the reset-modulated historical state [17]:
(11)The final hidden state is computed by merging historical and new information under the control of the update gate:
(12)In these equations, represents the Sigmoid activation function, denotes the Hadamard (element-wise) product, is the current input, is the candidate state, is the hidden state, and W, U are trainable weight matrices with as the bias term.
Compared with standard RNNs, GRU is more effective in learning long-term dependencies and avoids the vanishing gradient issue. Compared with Long Short-Term Memory (LSTM) networks, GRU has fewer parameters, leading to shorter training times and reduced risk of overfitting, thereby improving computational efficiency [18].
However, the standard GRU processes sequence information only in the forward direction, making it difficult to capture full contextual dependencies. To enhance the temporal modeling capability, we introduce a Bidirectional GRU (BiGRU) structure, which allows the model to simultaneously integrate both forward and backward information, thereby enhancing its ability to perceive global trajectory features.
The BiGRU consists of a forward GRU and a backward GRU, enabling the model to consider both past and future contexts and significantly improve time-series modeling. The structure of the BiGRU model is shown in Fig 7.
Compared to the unidirectional GRU, BiGRU substantially enhances the model’s ability to capture complex temporal patterns without significantly increasing computational complexity [19]. By integrating both forward and backward information flows, BiGRU achieves superior performance in many practical applications, particularly in tasks that require modeling long-term dependencies, outperforming traditional RNNs and unidirectional GRUs.
TTCN-TDV-BiGRU trajectory prediction model
Although TCN possesses multi-scale convolutional receptive fields that can capture both local and mid-range dependencies of trajectories, the convolutional kernel weights remain fixed over time, limiting its adaptive memory capability in handling abrupt state changes (e.g., sharp turns or deceleration). The introduction of BiGRU addresses this issue by leveraging gating mechanisms to dynamically update hidden states, thereby enabling the model to adaptively retain or discard historical information within long sequences. While TCN is responsible for parallel extraction of multi-scale temporal features, BiGRU performs re-gating and integration along the temporal dimension. Together, they complement each other and significantly enhance the stability and generalization capability of trajectory prediction.
To leverage the respective strengths of Temporal Convolutional Networks (TCN) and Bidirectional Gated Recurrent Units (BiGRU), this study constructs a ship trajectory prediction model based on the TCN-BiGRU architecture. The TCN is responsible for extracting both local and global temporal features from the trajectory data, while the BiGRU further learns the dynamic evolution patterns to optimize trajectory prediction. The structure of the TCN-BiGRU model is shown in Fig 8.
The detailed execution process of the TCN-BiGRU ship trajectory prediction model is as follows:
Step 1: Data Input and Preprocessing.
The raw AIS data is first filtered and preprocessed. The model takes the previous five time steps of longitude, latitude, Speed Over Ground (SOG), and Course Over Ground (COG) as input features for predicting the next time step.
Step 2: Temporal Feature Extraction via TCN.
The TCN utilizes causal convolutions to maintain the temporal order of the sequence, and dilated convolutions to enlarge the receptive field for capturing long-term dependencies. Weight normalization stabilizes the data distribution and accelerates model convergence. The ReLU activation function enhances nonlinear representation capability, and Dropout is employed to prevent overfitting and improve generalization. TCN extracts high-dimensional temporal features and passes them to the next stage.
Step 3: Sequence Modeling via BiGRU.
The BiGRU consists of a forward GRU and a backward GRU, enabling the model to learn temporal patterns in both directions and better capture the dynamic evolution of ship trajectories, thereby enhancing prediction accuracy.
Step 4: Trajectory Prediction via Fully Connected Layer.
The high-dimensional output features of the BiGRU are passed through a fully connected layer for nonlinear transformation, and finally, the predicted longitude and latitude at time t are obtained as output.
However, the standard TCN-BiGRU model lacks sufficient capacity to capture rapid changes in ship speed and direction, making it less effective in modeling directional dynamics embedded in the trajectory data. To further improve the prediction accuracy and robustness, this study proposes an enhanced model—TDV-TTCN-BiGRU—which integrates a TDV attention mechanism with an improved TCN-BiGRU structure.
The core idea of the proposed model is to use an enhanced TCN (TTCN) to extract local temporal features of the ship trajectory, employ a Trajectory Direction Vector (TDV) attention mechanism to capture directional features, and leverage BiGRU for long-term dependency modeling, thereby obtaining a complete representation of trajectory dynamics and improving both accuracy and stability. The model architecture is illustrated in Fig 9.
The detailed execution process of the TDV-TTCN-BiGRU model is as follows:
Step 1: Data Input and Preprocessing.
As in the baseline model, the AIS data is filtered and preprocessed. The previous five time steps of longitude, latitude, SOG, and COG are selected as input features.
Step 2: Temporal Feature Extraction via TTCN.
The preprocessed data is first fed into the improved TCN (TTCN), which incorporates parallel dilated causal convolution layers, weight normalization, ReLU activation, and Dropout to further enhance feature extraction and generalization capabilities. The output is then passed to the attention module.
Step 3: Directional Attention via TDV Mechanism.
The output features from the TTCN are processed by the TDV attention mechanism, which adaptively adjusts the importance of each trajectory point. The attention weights remain stable during linear sailing, while dynamically emphasizing key trajectory points during sharp turns or speed variations. The attention scores are calculated based on cosine similarity between trajectory points and normalized using Softmax to ensure valid attention distributions. This mechanism enhances the model’s sensitivity to trajectory dynamics such as turning and acceleration, improving prediction accuracy.
Step 4: Sequence Modeling via BiGRU.
The BiGRU integrates forward and backward temporal dependencies. The forward GRU captures the trajectory pattern in the direction of motion, while the backward GRU uses global trajectory context to refine the reasoning process, thereby enhancing the stability and reliability of trajectory predictions.
Step 5: Trajectory Prediction via Fully Connected Layer.
The BiGRU’s output is passed through a fully connected layer for nonlinear mapping, and the predicted coordinates at the next time step are generated.
Compared with the original TCN-BiGRU model, the optimized TDV-TTCN-BiGRU model demonstrates significant advantages. The TTCN expands the receptive field using dilated convolutions while reducing computational complexity and improving parallel computing efficiency. The TDV attention mechanism enhances the model’s ability to represent directional features in trajectories, allowing for more accurate predictions across different motion states. The improved model not only achieves higher prediction accuracy but also provides a more robust solution for applications in intelligent shipping and maritime traffic management.
Multi-level warning strategy design
During vessel navigation, environmental disturbances, maneuvering errors, or unexpected events may cause ships to deviate from their planned routes, potentially resulting in collisions with overhead transmission lines spanning waterways. Such incidents pose significant threats not only to the safety of vessels and crew but also to the stability of regional power supply systems. Therefore, the development of effective yaw warning methods is critical for the early identification and prevention of such deviations, ultimately reducing the risk of accidents and improving waterway traffic safety.
The core of this study lies in predicting ship trajectories to determine their spatiotemporal relationship with static obstacles (such as overhead power lines and bridge piers) at future time steps. When the prediction results indicate that the future trajectory of a vessel may enter the buffer zone of an obstacle or exceed the defined safety boundary, the warning mechanism is activated. In essence, trajectory prediction and yaw warning represent a proactive assessment of ship–environment interactions. Through this approach, the model can quantify potential navigation risks in advance, thereby providing reliable support for collision avoidance and waterway safety management.
In this study, we propose a high-efficiency yaw warning system by designing a three-tier warning mechanism based on predefined distance thresholds. The system consists of three designated zones: Warning Zone, Alarm Zone, and Emergency Alarm Zone, as illustrated in Fig 10.
The specific definitions and response strategies for each zone are as follows:
Warning Zone: This zone spans from 1.5 km to 2.0 km away from the overhead transmission line. When large and fast-moving vessels enter this region, the system issues a preliminary warning by assessing the vessel’s size and speed to indicate potential risk.
Alarm Zone: This zone covers the distance between 1.0 km and 1.5 km from the transmission line. If the vessel is oversized, moving at high speed, or shows signs of yawing, the system triggers an alarm to highlight a dangerous target.
Emergency Alarm Zone: This zone includes the area within 1.0 km of the transmission line. The presence of oversized, high-speed, or significantly deviating vessels in this region activates an emergency warning. The system recognizes the vessel as an imminent collision threat—potentially impacting the overhead conductors or support towers—and initiates emergency response procedures. These include continuous video tracking, reporting to maritime supervision authorities, and notifying relevant personnel for accident preparedness and response.
The corresponding classification of warning levels is summarized in Table 1.
In summary, this paper constructs a three-level yaw warning system based on distance thresholds. By dividing the monitoring region into warning, alarm, and emergency alarm zones and combining real-time vessel speed, height, and yaw status, the system dynamically evaluates the threat level posed by ships to overhead transmission lines. Corresponding warning measures are deployed based on the threat level, enabling a graded response mechanism ranging from early notification to emergency management. This approach effectively reduces the risk of vessel-contact accidents and enhances both maritime navigation and power transmission safety.
Experiments and analysis
Experimental environment and model parameter settings
The experiments were conducted on a Windows 11 machine using Python for data processing and model training. The deep learning models were implemented and optimized using the PyTorch framework, with auxiliary libraries such as NumPy, Pandas, and Matplotlib employed for data preprocessing and result visualization. The specific experimental environment is detailed in Table 2.
The model parameter settings used in the experiments are summarized in Table 3.
Experimental data description
The experimental dataset consists of AIS trajectory data collected from a vessel with MMSI number 413773017 operating in the Yangtze River Basin. The data spans the period from November 1 to November 7, 2024, containing a total of 1,946 valid trajectory points, covering multiple round-trip voyages along the main channel of the Yangtze River. The AIS records include key attributes such as Longitude, Latitude, Speed Over Ground (SOG), Course Over Ground (COG), and Timestamps.
To ensure data quality, preprocessing procedures such as data cleaning, anomaly detection, trajectory interpolation, and normalization were applied. The dataset was divided into a training set and a test set in a 70:30 ratio, with 1,362 and 584 samples respectively, ensuring sufficient training and enabling generalization assessment on unseen trajectory sequences. A portion of the AIS data is shown in Table 4.
Here, “lat” and “lon” represent latitude and longitude, respectively, while “sog” and “cog” stand for speed over ground and course over ground, respectively.
Evaluation metrics
Evaluation metrics for trajectory prediction.
To comprehensively evaluate model performance, three metrics are used: Mean Squared Error (MSE), Mean Absolute Error (MAE), and Average Displacement Error (ADE). These metrics are calculated separately for latitude and longitude to ensure a precise assessment of prediction accuracy [20]. MSE quantifies the squared difference between predicted and actual trajectory points, reflecting the overall deviation. Lower values indicate higher prediction accuracy. MAE measures the average absolute difference between predictions and ground truth, offering an intuitive sense of the average error in the predictions. The MSE and MAE are calculated as follows:
(13)(14)where denotes the number of samples, the predicted longitude or latitude, and the corresponding ground truth.
ADE measures the average Euclidean distance between predicted and actual trajectory points over the entire sequence [21]. It evaluates the spatial deviation of predicted trajectories.
(15)where and are the predicted and actual longitude and latitude, respectively. Lower ADE values indicate that the predicted trajectory is closer to the actual trajectory, thus providing more reliable support for intelligent navigation.
Evaluation metrics for yaw warning.
To quantitatively assess the performance of the yaw warning system, this study utilizes four key evaluation metrics: Precision, Recall, F1-score, and False Alarm Rate (FAR).
(1) Precision measures the proportion of true yaw events among all the system’s yaw warnings:
(16)Where TP (True Positives) refers to the number of correctly predicted yaw cases, and FP (False Positives) denotes the number of false warnings where no yaw actually occurred.
(2) Recall indicates the proportion of correctly identified yaw events among all actual yaw cases:
(17)Where FN (False Negatives) is the number of actual yaw cases that were not detected by the system.
(3) F1-score is the harmonic mean of Precision and Recall, providing a balanced assessment of system performance:
(18)When there is a significant disparity between Precision and Recall, the F1-score offers a more comprehensive evaluation.
(4) False Alarm Rate (FAR) measures the frequency of false warnings for vessels that are not yawing:
(19)Where TN (True Negatives) represents the number of correctly identified non-yawing vessels. A low FAR indicates high system stability in terms of minimizing unnecessary warnings.
In summary, Precision reflects the proportion of correct alerts among all yaw warnings; a higher precision suggests the system can reduce false alarms and maintain high credibility. Recall assesses the system’s ability to detect actual yaw events; a higher recall implies better coverage of real risks. F1-score integrates both metrics and is particularly valuable when there is a trade-off between Precision and Recall. Lastly, a lower FAR signifies better robustness and fewer unnecessary disruptions. An ideal yaw warning system should aim to maintain high recall while minimizing the FAR to ensure both comprehensive detection and accurate alerts, thereby enhancing navigation safety and system reliability.
Experimental results and analysis
Comparative experiments.
To evaluate the effectiveness of different models in trajectory prediction, a controlled experiment was conducted by keeping the dataset split, hyperparameters, and number of iterations constant while altering only the model structure. Five models—CNN, BiGRU, CNN-BiLSTM, CNN-BiGRU, and TCN-BiGRU—were selected for comparison. The prediction errors (MSE, MAE) for both latitude and longitude, as well as ADE, were measured. Additionally, visualizations were created to compare the predicted trajectories with the actual ones.
The prediction error results using MSE are illustrated in Fig 11. When using MAE as the evaluation metric, the results are shown in Fig 12. The ADE results for each model are presented in Fig 13. The detailed error metrics for each model across the three evaluation criteria are summarized in Table 5.
From Table 5, it is evident that:
In latitude prediction, the TCN-BiGRU model achieved the lowest MSE and MAE. Compared with the other four models (CNN, BiGRU, CNN-BiLSTM, and CNN-BiGRU), its MSE was reduced by 30.02%, 15.93%, 32.56%, and 13.04%, respectively, and its MAE was reduced by 10.76%, 6.87%, 15.42%, and 4.64%, respectively.
In longitude prediction, TCN-BiGRU also outperformed the others, with its MSE reduced by 8.47%, 9.44%, 31.79%, and 4.69%, and its MAE decreased by 12.16%, 7.52%, 10.60%, and 3.76%, respectively.
For ADE, TCN-BiGRU demonstrated the best overall performance, achieving the lowest displacement error with reductions of 11.51%, 5.92%, 17.70%, and 2.85% compared to the baseline models.
These results confirm that TCN-BiGRU exhibits superior performance across all evaluation metrics, making it more effective for ship trajectory prediction tasks. To further validate the model’s prediction capability, trajectory plots comparing the prediction results with ground truth are shown in Fig 14.
As seen in Fig 14, most models can effectively follow the general direction of the actual trajectories, particularly in straight segments at lower longitudes. However, discrepancies are noticeable in terms of accuracy. The TCN-BiGRU model shows the closest alignment with actual trajectories, especially in curves where the predicted turning angles better match the actual movement. However, in segments involving sudden maneuvers (e.g., near longitude 118.2395 and latitude 31.2979), the TCN-BiGRU model exhibits delayed longitude predictions, leading to a slight deviation of the trajectory toward the lower right. This suggests that the model’s responsiveness to abrupt directional changes remains limited, possibly due to insufficient capture of high-frequency dynamic features in the sequential data, indicating a need for further improvement.
Ablation experiments.
In the preceding comparative experiments, although the TCN-BiGRU model exhibited relatively high prediction accuracy across most segments, it still showed delayed responses in certain abrupt turning areas. This suggests that its adaptability to complex waterways still has room for improvement. To further enhance trajectory prediction accuracy, this study introduces a hierarchical TCN (TTCN) structure into the original TCN-BiGRU framework. The goal is to improve the model’s ability to capture long-term dependencies and reduce redundancy in high-order features. TTCN enhances temporal feature extraction by employing multiple parallel dilated causal convolution layers, enabling the model to capture multi-scale temporal patterns. This mitigates the issue of local receptive fields in traditional TCNs, thus improving overall prediction performance. This section analyzes the performance gains of the TTCN-BiGRU model over the TCN-BiGRU model through ablation experiments, using MSE, MAE, and ADE as evaluation metrics.
The prediction errors of the two models on the dataset under different metrics are as follows. When using MSE as the evaluation metric, the results are shown in Fig 15. When using MAE as the evaluation metric, the results are shown in Fig 16.
When using ADE as the evaluation metric, the results are shown in Fig 17.
To present the error comparison more intuitively, Table 6 summarizes the specific error values of the two models under different metrics.
As seen from Table 6, the TTCN-BiGRU outperforms TCN-BiGRU across all metrics. Specifically, the Latitude MSE is reduced by 8.27% and the Longitude MSE by 6.73%, indicating that the hierarchical TCN structure is more effective in capturing global features of vessel trajectories. The Latitude MAE and Longitude MAE are reduced by 11.96% and 5.87%, respectively, demonstrating an improvement in modeling fine-grained local patterns. The ADE is reduced by 7.87%, further confirming that TTCN-BiGRU provides more accurate trajectory predictions.
To further evaluate the models’ performance in real-world scenarios, a visual comparison of the predicted trajectories is presented in Fig 18.
According to the figure, both TCN-BiGRU and TTCN-BiGRU closely follow the actual trajectories, showing stable tracking performance along the main navigation segments. This indicates strong overall trend prediction capabilities. However, in critical turning regions (e.g., near longitude 118.2348), TTCN-BiGRU shows better alignment with the actual trajectory. Particularly in the segments between longitude 118.2268 to 118.2208 and 118.2370 to 118.2300, the trajectory deviation of TTCN-BiGRU is significantly reduced, verifying the enhanced adaptability of the improved model to sudden maneuvers.
Compared to TCN-BiGRU, the TTCN-BiGRU exhibits less lag in latitude and longitude predictions, though some lag still persists. This indicates that while the hierarchical TCN improves the capture of long-range temporal dependencies over traditional TCNs, its responsiveness to abrupt changes in heading and speed remains limited. To address this, a TDV attention mechanism is introduced into the TTCN-BiGRU framework to dynamically adjust the weights of ground speed and course over ground, thus improving adaptability across various navigation phases (e.g., acceleration, deceleration, turning, etc.).
The following sections compare the performance of TCN-BiGRU, TTCN-BiGRU, A-TTCN-BiGRU (with standard attention), and TDV-TTCN-BiGRU (with TDV attention). While standard attention mechanisms (A-TTCN-BiGRU) can assign varying importance to different time steps, they rely solely on global features and lack dynamic adjustment capabilities for local navigational cues such as speed and course. In contrast, the TDV attention mechanism can dynamically assign weights to trajectory-related features and adapt to various navigation conditions, thereby enhancing prediction accuracy and adaptability to sudden maneuvers.
To analyze the impact of the TDV attention mechanism on prediction errors, we compare the models under the MSE, MAE, and ADE evaluation metrics, as shown in Figs 19, 20, and 21, respectively. Table 7 provides a numerical summary of the prediction errors for all models under each evaluation metric.
From the table, it is evident that the TDV-TTCN-BiGRU model consistently achieves the lowest error across all metrics. For latitude prediction, the TDV-TTCN-BiGRU reduces MSE by 18.83%, 11.51%, and 2.38% compared to TCN-BiGRU, TTCN-BiGRU, and A-TTCN-BiGRU, respectively. Similarly, for MAE, the reductions are 21.25%, 10.55%, and 2.60%, confirming its superiority in latitude prediction.
For longitude prediction, the MSE of TDV-TTCN-BiGRU is reduced by 14.47%, 8.30%, and 3.41%, and MAE by 22.41%, 17.57%, and 6.65%, respectively, compared to the other three models. These results highlight the enhanced precision of the proposed model in longitude prediction.
Regarding overall trajectory accuracy (ADE), TDV-TTCN-BiGRU achieves the lowest error, with reductions of 21.46%, 14.75%, and 9.98% compared to the other models. This confirms its strong advantage in comprehensive trajectory prediction.
To further visualize model performance, a trajectory comparison for the four models is shown in Fig 22.
The TDV-TTCN-BiGRU model demonstrates significant advantages in both overall alignment and localized dynamic response. Compared to the baseline TCN-BiGRU and its improved versions, TDV-TTCN-BiGRU shows the highest spatial consistency with real trajectories, especially in critical turning areas (e.g., longitude 118.2340–118.2390), where it exhibits smooth transitions and accurate directional changes. At sharp turns (e.g., near longitude 118.2308), its predicted trajectory closely aligns with the actual path, resulting in superior fit.
Although A-TTCN-BiGRU enhances attention to key time steps, it fails to sufficiently focus on navigational features like speed and heading. In contrast, the TDV attention mechanism introduced in TDV-TTCN-BiGRU enables adaptive weighting of trajectory features (e.g., speed, course), allowing the model to dynamically adjust to changes in navigation behavior. This ensures timely correction of directional changes and maintains stable predictions under complex navigation scenarios.
In conclusion, the proposed TDV-TTCN-BiGRU trajectory prediction model consistently outperforms others across all evaluation metrics, fully validating the effectiveness of the hierarchical TCN structure (TTCN) and the superiority of the TDV attention mechanism. TTCN enhances the model’s ability to capture long-term dependencies through multi-layer parallel dilated causal convolutions, while TDV adaptively allocates the importance of speed and course information, significantly improving the model’s robustness and generalization, especially in response to sudden maneuvers such as turning, acceleration, and deceleration. These advantages make the model a more reliable and accurate tool for vessel trajectory prediction.
Yaw warning experiments.
To validate the effectiveness of the proposed multi-level yaw warning method, two experimental pilot sites were selected: the Liaoxia River section of the Dongjiang South Branch in Huizhou, Guangdong (Experiment I), and the N14–N15 river section of the 220 kV Zhanglongjia Transmission Line (Experiment II). AIS trajectory data were collected from April 1 to April 7, 2025, with 2,512 and 2,416 tracks gathered for Experiment I and II, respectively. Yaw warning responses were conducted for vessels entering and exiting the monitored areas during the observation period. The statistics of normal navigation and yaw events for the two experiments are shown in Tables 8 and 9.
To quantitatively evaluate the yaw warning performance of the system, this study calculated metrics such as Precision, Recall, False Alarm Rate (FAR), and F1-score for different warning levels. The results for Experiments I and II are presented in Tables 10 and 11, respectively.
The experimental results demonstrate that the proposed multi-level yaw warning model delivers high accuracy and stability across all warning levels. For both normal navigation and mild yaw, the system achieved over 99% and 96% precision, respectively, with FARs below 1%, indicating strong practical adaptability. In the alarm zone, the model achieved 100% recall and precision, showcasing its high sensitivity and responsiveness to potentially high-risk vessels.
Although no emergency-level yaw events occurred during the observation period, the model maintained zero false alarms under this highest alert tier, further validating its robustness under extreme conditions. In conclusion, the proposed system ensures high accuracy in warning issuance while effectively minimizing disturbance from false alarms. This demonstrates its excellent engineering application potential and provides critical technical support for safeguarding overhead transmission lines that cross navigable waterways.
Conclusion
To address the challenges of insufficient long-term dependency modeling and inadequate dynamic feature weighting in inland waterway vessel trajectory prediction, this study proposes a hybrid model—TDV-TTCN-BiGRU—which integrates a TDV attention mechanism with an improved TCN-BiGRU framework. This model leverages the multi-scale temporal feature extraction capabilities of TTCN, the dynamic modeling of course and speed features via the TDV attention mechanism, and the bidirectional sequence modeling strength of BiGRU. Together, these components significantly enhance both the accuracy and stability of trajectory prediction.
The baseline TCN-BiGRU model was trained on historical AIS trajectory data using sequences of five time steps as input and benchmarked against CNN, BiGRU, CNN-BiLSTM, and CNN-BiGRU models. Experimental results demonstrate that TCN-BiGRU outperforms the others in terms of MSE, MAE, and ADE, delivering superior predictive accuracy. Building on this foundation, a refined model—TDV-TTCN-BiGRU—was developed by introducing a hierarchical TTCN structure and the TDV attention mechanism. Ablation experiments show that, compared with CNN-BiGRU, the proposed model reduces longitude and latitude MSE by 14.47% and 18.83%, MAE by 22.41% and 21.25%, and ADE by 21.46%, respectively. These improvements reflect a significantly enhanced spatial alignment between predicted and actual trajectories, demonstrating the model’s robustness and stability under complex navigation conditions.
In addition, a multi-level yaw warning method was designed to detect potential yaw events in inland waterways. Field validation was conducted in two scenarios: the Liaoxia River section of the Dongjiang South Branch and the river section under the 220 kV Zhanglongjia Transmission Line. Three spatial warning zones were defined to enable tiered responses as vessels approached overhead transmission lines. The experimental results show that the system achieved recall rates of over 92% and 100% in the warning and alarm zones, respectively, with false alarm rates under 4%, demonstrating strong performance in recognizing and responding to yaw risks in real-world scenarios.
In summary, the proposed TDV-TTCN-BiGRU model effectively improves vessel trajectory prediction accuracy, while the accompanying multi-level yaw warning system provides a reliable solution for the safety protection of overhead transmission lines across navigable waterways. The research outcomes offer theoretical and technical support for intelligent inland shipping, collision avoidance, and waterborne traffic safety management, with strong practical value and potential for broader application.
Nevertheless, the proposed method has certain limitations. The model training primarily relies on AIS data from specific river sections, resulting in insufficient diversity of data distribution. Consequently, its generalization capability under extreme hydrological conditions or complex interactive environments requires further validation. Future research may incorporate multi-source data and synthetic simulation samples to enrich the training and evaluation scenarios, thereby extending the applicability of the model to more complex waterways, multi-vessel interactions, and intelligent shipping systems, and verifying its scalability and potential for broader deployment. Moreover, given the scarcity of emergency yaw alarm events in the measured data, future work will integrate systematic evaluations based on simulation and synthetic scenarios to assess the applicability and reliability of the yaw warning mechanism under full-spectrum risk conditions.
References
- 1. Ma H, Zuo Y, Li T. Vessel navigation behavior analysis and multiple‐trajectory prediction model based on AIS data. J Adv Transp. 2022;2022(1):6622862.
- 2. Xue H, Wang S, Xia M, Guo S. G-Trans: a hierarchical approach to vessel trajectory prediction with GRU-based transformer. Ocean Eng. 2024;300:117431.
- 3.
Wang YT. Ship trajectory prediction based on CNN and LSTM. Dalian Maritime University; 2020.
- 4. Zhao CD, Zhuang JH, Cheng XM, Li YH, Guo DP. Ship trajectory prediction based on feature attention mechanism RNN-Bi-LSTM. J Guangdong Ocean Univ. 2022;42(5):102–9.
- 5. You L, Han X, He Z, Xiao SY, He D, Pan XM. Short-term AIS trajectory sequence prediction model based on improved Seq2Seq. Comput Sci. 2020;47(9):169–74.
- 6.
Yu C. Research on ship trajectory prediction based on ARIMA and BiGRU. Dalian Maritime University; 2022.
- 7. Guo YJ, Zhang JY, Wang P. Ship trajectory prediction based on attention mechanism and TCN-BiLSTM. Comput Meas Control. 2024;32(1):30–6.
- 8. Dong X, Raja SS, Zhang J, Wang L. Ship trajectory prediction based on CNN-MTABiGRU Model. IEEE Access. 2024;12:115306–18.
- 9. Zhang C, Liu S, Guo M, Liu Y. A novel ship trajectory clustering analysis and anomaly detection method based on AIS data. Ocean Eng. 2023;288:116082.
- 10. Chen X, Liu Y, Achuthan K, Zhang X. A ship movement classification based on Automatic Identification System (AIS) data using convolutional neural network. Ocean Eng. 2020;218:108182.
- 11.
Wang HZ. Short-term power load forecasting based on improved attention mechanism and TCN-LSTM. Northeast Petroleum University; 2024.
- 12.
He K, Zhang X, Ren S, Sun J. Deep residual learning for image recognition. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2016. pp. 770–8. https://doi.org/10.1109/CVPR.2016.90
- 13. Huang M, Yang YD, Wu XP. Ship trajectory prediction method based on spatio-temporal attention mechanism STA-GRU. J Traffic Inf Secur. 2023;41(6):82–9.
- 14. Jiang J, Zuo Y. Prediction of Ship Trajectory in Nearby Port Waters Based on Attention Mechanism Model. Sustainability. 2023;15(9):7435.
- 15. Chen J, Zhang J, Chen H, Zhao Y, Wang H. A TDV attention-based BiGRU network for AIS-based vessel trajectory prediction. iScience. 2023;26(4):106383. pmid:37063464
- 16.
Zhao XY. Research on inland ship trajectory prediction method based on CNN-BiGRU with temporal attention mechanism and mish activation function. Yangtze University; 2024.
- 17. Bao K, Bi J, Gao M, Sun Y, Zhang X, Zhang W. An improved ship trajectory prediction based on AIS data using MHA-BiGRU. J Mar Sci Eng. 2022;10(6):804.
- 18.
Yang S, Chen S, Liu C, Li M, Wang M, Wang J. A ship trajectory prediction model based on ECA-BiGRU. In: 2023 IEEE 8th International Conference on Big Data Analytics (ICBDA). IEEE; 2023. pp. 94–99. https://doi.org/10.1109/ICBDA57405.2023.10104909
- 19.
Wang Y, Guo J, Xu L, Li K, Li Z. AIS data driven CNN-BiGRU model for ship target classification. In: International Conference on Spatial Data and Intelligence. Cham, Switzerland: Springer Nature; 2022. pp. 113–132. https://doi.org/10.1007/978-3-031-24521-3_9
- 20. Nguyen D, Fablet R. A transformer network with sparse augmented data representation and cross entropy loss for AIS-Based vessel trajectory prediction. IEEE Access. 2024;12:21596–609.
- 21.
Zhao WZ. Research on ship trajectory prediction method based on deep learning. Dalian Maritime University; 2023.
이 뉴스, 독자들은 어떻게 느꼈나요?
첫 반응을 남겨보세요로그인하면 감정 반응에 참여할 수 있어요.
관련 뉴스
관련 뉴스 제보는 로그인 후 가능합니다.
'research' 카테고리 뉴스
Correction: A new criterion for defining tunnel portal failure using the strength reduction method
PLOS ONE
Drug-induced gastric motility disorders: A disproportionality analysis from the FAERS and CVARD databases
PLOS ONE
Musculoskeletal surgeons use mixed reasoning rather than pure Bayesian strategies in clinical practice
PLOS ONE
PLOS의 다른 기사
Correction: Efficacy and safety of the ayurvedic formulation ‘<i>Trikatu</i>’ as an add-on to standard care in dyslipidemia: Study protocol for a randomized, double-blind, placebo-controlled trial evaluating lipid parameters, and gut microbiota
PLOS ONE
KYNU in macrophages contributes to the unique immune feature of LUAD via integrating single-cell and bulk RNA sequencing data: an exploratory analysis
PLOS ONE
Perspectives of community-dwelling older adults with chronic diseases on Baduanjin practice: A qualitative study
PLOS ONE