# A ResNet1D-AttLSTM-Based Approach for Ship Trajectory Classification
## 3 Experiment
### Model Evaluation and Analysis
#### 3.3.3 Classification Performance on Different Ship Types  
Next, this study conducted a detailed statistical analysis of the classification results for each type of ship trajectory in the test set. The detailed classification results, confusion matrix, and metrics such as precision, recall, and F1-score are presented in Table 4. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Actual Class**} & \multicolumn{8}{c}{**Predicted Class**} \\ \cline{2-10}  & **Towing** & **Fishing** & **Sailing** & **Passenger** & **Tanker** & **Precision(\%)** & **Recall(\%)** & **F1(\%)** \\ \hline
**Towing** & 45,849 & 1144 & 888 & 741 & 928 & 90.8 & 92.5 & 91.6 \\
**Fishing** & 1075 & 44,863 & 2060 & 635 & 917 & 86.3 & 90.5 & 88.4 \\
**Sailing** & 1632 & 3737 & 42,304 & 840 & 1037 & 89.2 & 85.4 & 87.3 \\
**Passenger** & 1091 & 1390 & 1492 & 43,007 & 2570 & 93.0 & 86.8 & 89.8 \\
**Tanker** & 845 & 837 & 690 & 1008 & 46,170 & 89.4 & 93.2 & 91.3 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Classification performance of the ResNet1D-AttLSTM model on different ship types. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline  & **Scheme 1** & **Scheme 2** & **Scheme 3** & **Scheme 4** & **Scheme 5** & **Scheme 6** & **Scheme 7** \\ \hline
**Number of** & & & & & & & \\
**residual blocks** & 1 & — & 1 & 1 & 2 & 2 & 3 \\ \hline
**Number of** & & & & & & & \\
**LSTM layers** & — & 2 & 2 & 2 & 2 & 2 & 2 \\ \hline
**Memory** & & & & & & & \\
**cell dimension** & — & 128 & 128 & 128 & 128 & 128 & 128 \\ \hline
**Number of** & & & & & & & \\
**attention heads** & — & — & — & 4 & 4 & 8 & 12 \\ \hline
**Attention layer** & & & & & & & \\
**embedding dimension** & — & — & — & 128 & 128 & 256 & 256 \\ \hline
**Accuracy (\%)** & 79 & 81.1 & 84.3 & 87.4 & 87.9 & 90.1 & 88.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Classification performance of the ResNet1D-AttLSTM model under different settings. From Table 4, several observations can be made:  
1. F1-score analysis: * The model demonstrates good recognition ability across all categories of ship trajectories, with F1 scores exceeding 87% for each category. The highest F1 score is achieved for towing vessels at 91.6%, while the lowest is for sailing vessels at 87.3%. * The superior classification performance for towing vessels may be attributed to their distinctive movement patterns: relatively fixed navigation paths, low and stable speeds, and regular turning behaviors. * The lower F1 score for sailing vessels could be due to their variable heading and speed characteristics, as well as their broad and unfixed activity areas. 2. Precision analysis: * The model achieves the lowest precision for fishing vessels at 86.3% and the highest for passenger ships at 93%. This indicates that many non-fishing vessel trajectories were misclassified as fishing vessels, whereas most predicted passenger ship trajectories were correctly identified. * Further analysis of the confusion matrix reveals that the low precision for fishing vessels primarily stems from confusion between sailing and fishing vessel trajectories. Under specific sailing conditions, these two types of vessels exhibit similar trajectory features. For example, when wind conditions allow small fishing boats and sailboats to have comparable speed and heading changes, or when they operate in similar waters, it becomes challenging for the model to distinguish between them. This confusion also contributes to the lower recall rate for sailing vessels. 3. Recall analysis: * The recall for passenger ship trajectories is relatively low at 86.8%, while it is highest for oil tankers at 93.2%. This suggests that some passenger ship trajectories were misclassified as other types, whereas most actual oil tanker trajectories were correctly identified. * The analysis shows that many passenger ship trajectories were misidentified as oil tankers. Oil tankers typically have more fixed routes and higher data quality, which helps the model better distinguish them from other types of ships.