1. Introduction
The continued expansion of global trade has led to a substantial rise in maritime cargo volumes, accompanied by a pronounced shift toward larger vessels. According to the International Transport Forum [
1], the average size of container ships has in-creased by approximately 90% since 1996. This rapid growth in vessel dimensions has intensified the complexity of berthing and unberthing—operations already recognised as among the most technically demanding tasks in port environments [
2]. Within con-fined harbour waters, the manoeuvrability of large vessels becomes significantly restricted, resulting in higher operational difficulty and elevated safety risks [
3]. In this context, the importance of tugboats as essential support units—providing auxiliary propulsion, navigational guidance, and safety assurance—has grown considerably [
4,
5]. Through pushing, pulling, and precision manoeuvring, tugboats play a crucial role in enabling large vessels to complete berthing and unberthing operations safely and efficiently [
6]. However, the highly dynamic, short-duration, and task-dependent nature of tugboat maneuvers makes their operational states inherently difficult to be automatically identified using conventional monitoring approaches.
Despite this, the management of tugboat operations still relies heavily on manual coordination and radio communication, which is inefficient and highly dependent on operator experience [
7]. Such approaches are poorly suited to the short-distance, highly dynamic nature of tugboat activities and are unable to support reliable, large-scale, and fine-grained identification of tugboat operational states [
8,
9]. Consequently, there is an urgent need for data-driven, automated methods capable of accurately identifying tugboat operational states, thereby improving the transparency and intelligence of port management systems [
10].
Accurate identification of tugboat operational states not only facilitates the optimisation of port resource allocation but also provides substantial additional value. The recognised states can be directly used to calculate ship carbon emissions under different operational modes with greater precision [
11,
12], thereby offering essential data support for the development of green ports [
13,
14]. Furthermore, efficiency assessments based on operation-state information can assist decision-makers in improving port management and operational scheduling [
15]. Recent studies have also investigated the coupling between forward speed and tugboat hydrodynamics, suggesting that control strategies must account for these speed-dependent variations [
16].Accurate recognition of berthing and unberthing events also supplies critical information for compiling port statis-tics on ship arrivals and departures and for detecting loading and unloading activities [
17,
18]. Despite the richness of Automatic Identification System (AIS) data for analysing vessel behaviour, several challenges hinder its practical application: raw AIS records often contain substantial noise and missing data [
19,
20], and manual updates of AIS navigational status by crew members are prone to delays and inaccuracies [
21]. These characteristics significantly limit the effectiveness of generic AIS-based learning models and highlight the need for robust state-identification methods tailored to tug-boat operations.
Current research has largely concentrated on topics such as tugboat scheduling optimisation [
8,
22], manoeuvrability analysis [
23], and assessments of emission characteristics [
11,
12], leaving a clear gap in the automatic identification of tugboat operational states. Existing studies suffer from several notable limitations. First, methods such as those proposed by [
17] rely heavily on the accuracy of AIS-reported navigational status, which substantially limits their practical applicability. Second, although [
24] used logistic regression to identify cooperative interactions between tugboats and large vessels, their method does not sufficiently distinguish the specific operational nature of these interactions—namely, whether they correspond to berthing or unberthing activities. More critically, existing studies generally treat tug assistance activities as a single operational category, without explicitly analysing or quantifying the directional and temporal asymmetry between assisted berthing and assisted unberthing operations. As a result, the fundamentally different speed-evolution patterns embedded in these two processes remain largely underexplored, despite being essential for achieving high-precision tugboat operational state recognition. Additionally, most current studies have not fully exploited the multidimensional information inherent in AIS data—such as speed, heading, and trajectory morphology—to develop a more dis-criminative and comprehensive feature system [
17].
Although substantial progress has been made in applying artificial intelligence techniques to AIS data mining—for instance, anomaly detection frameworks utilizing clustering and random forests have effectively classified abnormal behaviors in ship trajectories [
25]. In terms of predictive modeling, LSTM-based trajectory prediction methods have yielded F1 scores approaching 95% on benchmark datasets [
26]. For visual perception, multi-scale CNNs have achieved remarkable precision in ship detection, reporting classification accuracies of 99%, with precision, recall, and F1-scores all reaching 0.99 [
27]. Furthermore, the integration of knowledge graphs with multi-model stacking ensemble learning has offered novel technical guidance for predicting fines related to illegal fishing, thereby enhancing law enforcement efficiency [
28]. Additionally, multimodal trajectory prediction frameworks have demonstrated the capability to forecast vessel attributes over 10 h in advance, significantly outperforming competitive baselines [
29]—these approaches are predominantly designed for long-range navigation, large-scale trajectory continuity, or general vessel behavior analysis. As a result, they are not well suited to capturing the short, fragmented, and highly task-oriented maneuvers that characterize tugboat operations in port environments, and therefore fail to achieve fine-grained differentiation between assisted berthing and assisted unberthing operations under noisy AIS data conditions.
To address this research gap, this study presents an integrated recognition framework that combines trajectory segmentation, feature engineering, and deep learning. A speed-threshold-based sliding-window method is employed to segment trajectories, effectively distinguishing berthing from sailing states. A comprehensive 15-dimensional feature set—including 11 statistical and 4 descriptive features—is constructed to characterize tugboat operational behaviors. A fully connected neural network classifier is developed to capture non-linear interactions among multidimensional features, while explicit speed-dynamic rules are employed to further discriminate between assisted berthing and unberthing operations. The proposed approach is validated on real-world AIS data from Ningbo–Zhoushan Port, offering a practical and reliable solution for intelligent port surveillance.
Beyond proposing a classification framework, this study provides new methodological and empirical insights into tugboat operational behavior that have not been systematically explored in existing AIS-based research. Specifically, this work makes three key contributions:
- (1)
It explicitly reveals and quantifies the spatiotemporal asymmetry between assisted berthing and assisted unberthing operations, demonstrating that opposite speed-evolution patterns constitute a robust and interpretable discriminative cue. To the authors’ knowledge, few existing studies have analytically distinguished these two assistance modes using AIS trajectory dynamics.
- (2)
It introduces a set of trajectory morphological descriptors, such as the Overlap Ratio and start–end distance ratio, which function as implicit spatial proxies. These features enable accurate identification of berth-adjacent assistance behaviours without reliance on Electronic Navigational Chart (ENC) data, reducing data dependency and deployment cost.
- (3)
It develops a hybrid learning–rule recognition strategy that combines feature-based deep learning with domain-informed temporal rules, achieving a balance between classification accuracy, interpretability, and operational practicality for intelligent port surveillance systems. This design avoids excessive model complexity while maintaining robustness under limited and noisy training data.
The structure of the paper is organized as follows:
Section 2 analyses the typical patterns and operational characteristics of tugboats.
Section 3 presents the methodology, including data preprocessing, trajectory segmentation, feature extraction, and model development.
Section 4 validates the proposed framework through a case study conducted at Ningbo–Zhoushan Port. Finally,
Section 5 concludes the study and outlines potential directions for future research.
2. Problem Description
As illustrated in
Figure 1, tugboat activities within the port environment can be categorised into four fundamental operational states based on motion characteristics and functional objectives: Berthing, Cruising, Assisting in Berthing, and Assisting in Unberthing. Each state displays distinct behavioural patterns in AIS trajectory data, as described below.
Berthing: The tugboat remains stationary or moves at very low speed, typically positioned near a dock, anchorage, or standby area. The AIS trajectory is characterised by densely clustered points, sustained speeds below 0.3 knots [
30], minimal heading variation, and negligible spatial displacement.
Cruising: The tugboat travels at a relatively high and stable speed (typically 6–8 knots) with only minor fluctuations in heading. The trajectory is predominantly linear, covering considerable distances without notable turning or loitering behaviour.
Assisting in Berthing: When supporting the docking of large vessels, tugboats exhibit characteristic “wandering” behaviour [
31], which is marked by frequent fluctuations in both speed and heading. Trajectories commonly contain reciprocal or back-tracking movements—for example, accelerating toward a rendezvous point and subsequently returning at reduced speed while escorting the vessel. A notable temporal feature is that speed is generally higher at the beginning of the operation and decreases significantly toward the end of the segment.
Assisting in Unberthing: Although sharing similar spatial features with berthing assistance—such as short-distance manoeuvres and looping trajectories—this state exhibits opposite temporal dynamics. The tugboat typically begins at a low speed and gradually accelerates, with speed increasing markedly toward the end of the trajectory segment (see
Section 3.5).
These differences among operational states primarily arise from the geographical constraints of port environments and the dynamic interactions between tugboats and the larger vessels that they assist.
Figure 2 presents the core behavioural characteristics and schematic representations of typical trajectories corresponding to each of the four operational states.
Building on these observations, this study constructs a feature system encompassing three dimensions—speed, heading, and trajectory morphology. The system comprises 11 statistical features and 4 descriptive features (see
Section 3.2 for details), designed to quantitatively capture the distinguishing characteristics of each operational state. These features form the input to the subsequent classification model.
3. Methodology
3.1. Methodology Overview
Directly applying learning models to raw AIS trajectories is problematic for tug-boats, as their trajectories typically consist of heterogeneous operational phases, including sailing, idling, and short-duration assistance maneuvers. These mixed patterns obscure the behavioral signatures of berthing-related assistance and significantly de-grade classification performance. Therefore, trajectory segmentation is a necessary prerequisite to isolate behaviorally homogeneous segments for reliable state identification.
This study proposes an automated method for identifying tugboat operational states using AIS data, with the aim of classifying four typical states: Berthing, Cruising, Assisting in Berthing, and Assisting in Unberthing. The overall workflow, illustrated in
Figure 3, comprises the following key steps:
Step 1: Trajectory Segmentation: AIS trajectories are segmented using a sliding-window approach based on a speed threshold, applied after data preprocessing (including outlier removal, filtering, and interpolation). This process removes noise, smooths the speed time series, and bridges minor data gaps, thereby ensuring high-quality inputs for segmentation. It provides a preliminary distinction between berthing and sailing phases.
Step 2: Feature Extraction: From each sailing segment, 11 statistical and 4 descriptive features are extracted to form a multidimensional feature vector that characterises the segment’s spatiotemporal behaviour.
Step 3: Initial Classification: A three-layer fully connected neural network (FCNN) is employed to classify each sailing segment as either “Cruising” or “Assisting in Berthing/Unberthing.”
Step 4: Fine-Grained Classification: Segments classified as “Assisting in Berth-ing/Unberthing” are further differentiated into “Assisting in Berthing” and “Assisting in Unberthing” based on their dynamic speed profiles.
As illustrated in
Figure 3, the proposed method forms a conceptual deployment scenario, data-driven decision-support system. The end-to-end workflow—from AIS data ingestion to state inference and operational feedback—can be seamlessly embedded within an intelligent port-supervision framework. Model outputs may serve as direct inputs to human operators or automated decision-making modules, while the corrected states or operational responses generated in return can further refine subsequent inferences. This closed feedback mechanism enables adaptive optimisation over time and enhances the system’s applicability within smart-port infrastructures.
By integrating feature engineering with deep learning, the proposed method achieves the automated and high-accuracy identification of tugboat operational states, thereby providing robust technical support for intelligent port surveillance.
For clarity in subsequent sections, the primary variables and their definitions used in this study are summarised in
Table 1.
It should be emphasized that the proposed workflow is not a purely engineering-driven pipeline. Each component is designed to address a specific limitation identified in existing studies: trajectory segmentation isolates operational phases, morphological features compensate for the absence of explicit spatial constraints, and the hybrid classification strategy explicitly captures the asymmetric temporal dynamics between assisted berthing and unberthing operations.
3.2. Trajectory Segmentation
The preprocessed AIS data (see Algorithm A1 in
Appendix A) form the tugboat trajectory dataset
, representing the latitude
, longitude
, smoothed speed over ground
, and course over ground
of the
k-th tugboat at time
, expressed as
To distinguish between sailing and berthing states, a sliding window method based on a speed threshold [
32] is applied for trajectory segmentation. The specific steps are as follows:
Sort the AIS data chronologically and set the speed threshold
knot [
33].
Slide a window with a step size of 1. When is detected consecutively, start recording a segment; the segment ends when occurs. This segment is labelled as a sailing segment.
Data points not included in any sailing segment are considered part of the berthing state and are excluded from subsequent feature extraction and classification.
Each sailing segment serves as a sample for subsequent feature extraction and model training (see Algorithm A2 in
Appendix A).
3.3. Feature Engineering
To accurately characterize the heterogeneous operational patterns of tugboats, this study constructs a 15-dimensional feature (11 statistical features and 4 descriptive features) vector comprising statistical and descriptive dimensions. The selection of these features is grounded in the kinematic physics of tugboats and the specific operational constraints of port environments (see Algorithm A3 in
Appendix A).
First, regarding kinematic dynamics, although environmental factors (e.g., wind and current) are not explicitly input into the model, their physical effects are implicitly encoded within the statistical features of Speed Over Ground (SOG) and Course Over Ground (COG). For instance, a tugboat maintaining a position against strong currents will exhibit increased speed variance (SOG_diff_sum) and heading fluctuations (COG_change_mean) due to compensatory maneuvering. Therefore, these statistical features serve as effective proxies for external environmental disturbances, capturing the resultant vessel behavior without requiring separate meteorological data streams.
Second, regarding spatial morphology, the feature design explicitly considers the operational nature of tugboats as harbor-working vessels. Unlike long-haul merchant ships, tugboats operate within confined port waters characterized by short sailing distances and fixed dispatch routes.
3.3.1. Statistical Features
The statistical features comprise 11 indicators across three categories—speed, heading, and spatial characteristics—with their calculation formulas provided in
Table 2 (where h denotes the Haversine distance function):
Speed Features: average speed, maximum speed, maximum speed change, median speed change, sum of speed changes, and mean speed change;
Heading Features: mean course change, maximum course change, median course change, and range of course changes;
Spatial Feature: straight-line distance between the start and end points of the trajectory segment.
Together, these features capture differences in motion stability and manoeuvrability across different tugboat operation states.
3.3.2. Descriptive Features
To further capture the characteristics of trajectory morphology, four descriptive features are introduced:
The SOG_diff_ratio quantifies the degree of speed fluctuation. This value tends to be lower during Assisting in Berthing/Unberthing operations due to frequent low-speed manoeuvring.
- 2.
Start–End Point Distance Ratio (start_end_distance_ratio):
start_end_distance_ratio reflects the extent of backtracking within a trajectory. Smaller values are typically observed during Assisting in Berthing/Unberthing, consistent with short-range zigzag movements.
- 3.
Maximum Distance Ratio (max_distance_ratio):
max_distance_ratio describes the degree of trajectory tortuosity. Higher values are generally associated with Cruising, where movement is more linear and spatially extended.
- 4.
Overlap Ratio (overlap_ratio):
overlap_ratio measures the extent of repeated trajectory coverage based on a 100 m × 100 m grid. A constant factor of 100 is applied to amplify the differences between operational states.
To ensure the robustness of the feature set and identify potential multicollinearity, a Pearson correlation analysis is incorporated into the evaluation framework. This step is critical for understanding the structural relationships between the proposed morphological descriptors and traditional kinematic features, the results of which are detailed in
Section 4.3.
3.4. FCNN-Based Tugboat Trajectory Classification Model
Although extensive hyperparameter tuning was not performed, the selected FCNN architecture—with two hidden layers comprising 64 and 32 neurons, respectively—was chosen based on well-established empirical heuristics and prior experience in classification tasks of similar complexity. The use of ReLU activation and dropout regularization was intended to ensure efficient training and robust generalization. This configuration strikes a practical balance between model capacity and overfitting risk, making it suitable for moderate-sized AIS datasets with non-linear feature interactions (see Algorithm A4 in
Appendix A).
3.4.1. Model Architecture
This study constructs a three-layer fully connected neural network (FCNN) to classify sailing segments into “Cruising” or “Assisting in Berthing/Unberthing”. The model structure is as follows:
Input Layer: Takes a 15-dimensional feature vector as input, with Z-score normalisation applied;
Hidden Layer 1: 64 neurons, ReLU activation, Dropout rate of 0.4, He initialisation;
Hidden Layer 2: 32 neurons, ReLU activation;
Output Layer: 2 neurons, Softmax activation, outputting class probabilities.
This relatively shallow architecture was chosen to balance model complexity with the available data, capturing non-linear feature interactions without excessive overfitting risk. The model uses the Adam optimiser with a learning rate of 0.0001. L2 regularisation (weight decay = 0.005) and early stopping (patience = 30) are incorporated to enhance generalisation capability. These hyperparameters were determined through preliminary experiments to optimize validation performance and prevent overfitting.
3.4.2. Training and Loss Function
The sparse categorical cross-entropy loss function is employed. Class weights are introduced to address sample imbalance:
where C = 2, and
represents the class weight. During training, SMOTE is applied to oversample the minority class, with a batch size of 32 and a validation set ratio of 10%.
3.4.3. Model Interpretability Strategy
Although deep learning models are often considered ‘black boxes,’ interpreting their decision-making logic is essential for safety-critical port operations. Instead of relying on static weight analysis, which can be unstable due to random initialization, this study employs the Permutation Importance method to quantify feature contribution.
The process involves randomly shuffling the values of a single feature
in the test set while keeping others fixed, thereby breaking the association between the feature and the target. The importance score
is defined as the degradation in model performance (accuracy):
A significant drop in accuracy indicates that the model heavily relies on feature j for prediction. This method provides an unbiased metric of feature relevance, robust to model structural variances.
3.5. Fine-Grained Classification: Distinguishing Assistance During Berthing and Unberthing
Based on the “assisting in berthing/unberthing” category output by the FCNN, a further distinction between assisting in berthing and assisting in unberthing is made using dynamic speed characteristics:
Divide the trajectory into first and second halves based on the temporal midpoint.
Calculate the average speeds of the first and second halves, denoted as and :
If , classify the segment as assisting-in-berthing;
If , classify it as assisting-in-unberthing.
This rule is based on typical speed variation patterns of tugboats during berthing and departure operations, offering high interpretability and practical utility (see Algorithm A5 in
Appendix A).
4. Case Study
4.1. Data and Experimental Setup
This study employed tugboat AIS data from Ningbo–Zhoushan Port for the year 2020 as the empirical dataset. A total of 572 tugboat operation trajectories were collected over six months. After applying the trajectory segmentation method described in
Section 3.2, 483 valid voyage segments were obtained. These segments exhibited a notable class imbalance, with cruising segments approximately three times more numerous than assistance-related segments.
To address this issue, the Synthetic Minority Over-sampling Technique (SMOTE) was applied to the 15-dimensional statistical feature space. This approach enhances the model’s ability to learn the decision boundaries of minority classes without generating physically impossible geographical trajectories. The balanced dataset was then randomly divided into a training set (338 samples) and a test set (146 samples) using a 70:30 ratio. Basic statistical characteristics of the dataset are summarised in
Table 3.The resulting dataset was then randomly divided into a training set and a test set using a 70:30 ratio. Basic statistical characteristics of the dataset are summarised in
Table 3.
The proposed framework was implemented in a Python 3.12 environment utilizing the Keras deep learning library with a TensorFlow backend. All experiments were conducted on a workstation equipped with an AMD Ryzen 7 5800X 8-Core Processor and 32 GB of RAM. To ensure the reproducibility of the experimental results, a global random seed was fixed at 42 for all stochastic processes, including weight initialization and dataset partitioning. The classification model consists of a fully connected neural network (FCNN) with two hidden layers containing 64 and 32 neurons, respectively. To mitigate overfitting, L2 regularization (penalty coefficient = 0.005) was applied to the kernels of both hidden layers, coupled with a Dropout layer (rate = 0.4) after the first hidden layer. The model parameters were optimized using the Adam optimizer with a learning rate of 0.0001. During training, an Early Stopping mechanism was employed to monitor the validation loss; training was automatically terminated if no improvement was observed for 30 consecutive epochs (patience = 30), and the weights corresponding to the minimum validation loss were restored.
4.2. Model Training Results and Performance Analysis
As shown in
Figure 4, the training process exhibited favourable convergence behaviour: the accuracy increased rapidly from an initial value of 0.54 and eventually stabilised above 0.95, while the loss decreased markedly from 1.41 to approximately 0.32. The validation curves closely matched the training curves, achieving a final accuracy of 0.9412 and a loss of about 0.325, indicating strong generalisation capability.
The application of SMOTE oversampling effectively mitigated the class-imbalance issue. During the early training phase, the model displayed a tendency to favour the majority class (Cruising). However, after oversampling and introducing class-weighted loss, the model’s ability to learn the minority class (Assisting in Berthing/Unberthing) improved substantially. This improvement is reflected in the high recall (0.93) for the assistance-related class during testing.
Detailed performance metrics on the test set are summarised in
Table 4. Overall, the model achieved an accuracy of 89.73% and an F1-score of 0.90, demonstrating robust and balanced classification performance. Further analysis reveals the following:
For the Cruising class, the model achieved high precision (0.93) but relatively lower recall (0.86), suggesting a conservative classification tendency in which some borderline cases were misclassified as assistance operations.
For the Assisting in Berthing/Unberthing class, the high recall (0.93) indicates a strong recognition capability for this minority class. However, the slightly lower precision (0.87) suggests that certain atypical cruising behaviours were incorrectly identified as assistance-related activities.
These findings are consistent with the operational complexities of tugboat behaviour. Within port environments, cruising patterns may vary considerably due to factors such as traffic control, dynamic task assignments, and local navigation constraints, resulting in ambiguous boundaries between cruising and assistance operations.
4.3. Feature Distribution and Discriminative Analysis
To gain a deeper understanding of the model’s decision-making basis and validate the effectiveness of the proposed multidimensional feature set, a comprehensive analysis was conducted. This includes examining statistical distributions, evaluating feature correlations, and quantifying feature importance based on a permutation strategy.
4.3.1. Distributional Characteristics of Features
Figure 5 presents the distributions of the 11 statistical features across different operational states, revealing clear and interpretable patterns:
Speed-related features: During the Cruising state, the average speed is predominantly concentrated within the 6–8-knot range, and speed-variation indicators (such as SOG_diff_sum and SOG_change_median) remain low, reflecting stable and continuous navigation. By contrast, the average speed during Assisting in Berthing/Unberthing exhibits a more dispersed distribution (typically between 2 and 6 knots), and the total amount of speed change (SOG_diff_sum) is substantially higher. This is consistent with the frequent acceleration–deceleration behaviour characteristic of tugboats during close-range manoeuvring.
Heading-related features: A similar pattern is observed for heading features. In the Cruising state, the mean course change (COG_change_mean) is generally below 5°, and the variation range (COG_change_range) is typically under 30°, indicating stable course-keeping behaviour. In contrast, heading-variation metrics during Assisting in Berthing/Unberthing are considerably greater: COG_change_mean often exceeds 10°, and COG_change_range commonly surpasses 90°. These results align with the operational requirements of tugboats, which frequently adjust propulsion direction when assisting larger vessels.
Spatial features: Among the spatial indicators, the start–end point distance (d_start_end) demonstrates particularly pronounced differences. For Cruising, this distance typically exceeds 1000 m, reflecting sustained linear movement over longer distances. In comparison, during Assisting in Berthing/Unberthing, the distance generally falls below 500 m, consistent with operations conducted within confined harbour areas that involve repeated back-and-forth manoeuvres.
Figure 6 further illustrates the discriminative power of the four descriptive features:
SOG_diff_ratio: Under Cruising conditions, this ratio exhibits a clear unimodal distribution with a peak around 0.5, corresponding to a typical accelerate–steady–decelerate speed pattern. In contrast, during Assisting in Berthing/Unberthing, the values are more dispersed and generally lower, reflecting the more complex and variable speed dynamics characteristic of close-range manoeuvring.
Overlap_ratio: This feature demonstrates near-complete separation between the two classes. Most Cruising segments have overlap_ratio values below 10, whereas the majority of Assisting in Berthing/Unberthing segments exceed 20, strongly indicating the repeated zigzag movement prevalent in assistance operations.
Start–End Point Distance Ratio: For Cruising, this ratio is concentrated around 1.0, indicating nearly linear movement. By comparison, during Assisting in Berthing/Unberthing, the ratio predominantly falls within the 0.2–0.6 range, clearly capturing the characteristic zigzag behaviour.
Maximum Distance Ratio: The distribution of max_distance_ratio further reinforces these observations: values for Cruising are mostly above 0.7, while those for Assisting in Berthing/Unberthing are largely below 0.5.
These distinctive distribution patterns not only validate the efficacy of the proposed feature engineering but also provide interpretable evidence underpinning the model’s robust classification performance. Crucially, although the framework does not explicitly ingest Electronic Navigational Chart (ENC) data, it effectively accounts for geographical context through descriptive morphological features. In particular, the Overlap Ratio and Start–End Distance Ratio function as implicit spatial proxies. The combination of a high Overlap Ratio and a low Start–End Distance Ratio quantitatively captures the ‘wandering’ behaviour and spatial confinement characteristic of berth-adjacent assistance operations. By leveraging these indicators of tortuosity and repeated coverage, the model successfully discriminates between task-oriented manoeuvring and transit-oriented cruising, without relying on external spatial constraints.
4.3.2. Correlation and Redundancy Analysis
To assess the internal structure of the feature set and identify potential multicollinearity, a Pearson correlation analysis was performed (
Figure 7).
The heatmap reveals two key structural insights:
Kinematic Redundancy: High positive correlations are observed among certain SOG-related indicators. For instance, SOG_diff_ratio and max_distance_ratio show a correlation coefficient exceeding 0.8. While this indicates information redundancy regarding speed dynamics, the FCNN model effectively mitigates the risk of overfitting through the application of L2 regularisation.
Independence of Descriptive Features: Crucially, the descriptive features exhibit a high degree of independence. The overlap_rate shows low correlation with primary kinematic metrics (e.g., |r| < 0.45 with mean_SOG). This confirms that these features capture spatial structural information that is complementary to, rather than redundant with, the kinematic data.
4.3.3. Feature Importance and Model Interpretability
To further quantify the contribution of each feature to the model’s final decision, a Permutation Importance analysis was conducted. Unlike static weight analysis, this method measures the drop in model accuracy when a feature’s values are randomly shuffled, providing a robust metric of feature dependence. To ensure the statistical reliability of these estimates, the permutation process was repeated 10 times for each feature using different random seeds. The results are visualized in
Figure 8, where the bar length represents the mean decrease in accuracy, and the error bars indicate the standard deviation across these 10 independent runs. This visualization explicitly captures the stability of each feature’s influence on the classification outcome.
The analysis reveals the following mechanisms underlying the model’s high performance:
Dominance of Temporal SOG Dynamics: The results indicate that SOG_change_mean and mean_SOG are the most critical predictors. Permuting these features leads to the most significant degradation in accuracy (approximately 4–6%). This suggests that the deep learning model primarily distinguishes “Cruising” from “Assistance” by learning the temporal dynamics of SOG—specifically, the contrast between stable high-speed transit and fluctuating low-speed maneuvering.
Descriptive Features as Spatial Proxies: It is noteworthy that while the Descriptive Features (e.g., overlap_rate) exhibited high discriminative power in the distributional analysis, their individual permutation importance scores were lower than those of the kinematic features due to feature redundancy. However, this does not diminish their value.
These distinctive distribution patterns not only validate the efficacy of the feature design but also provide interpretable evidence underpinning the model’s robust classification performance. Crucially, although the framework does not explicitly ingest Electronic Navigational Chart (ENC) data, it effectively accounts for geographical context through the inclusion of these descriptive features, which inherently characterize trajectory morphology. In particular, the Overlap Ratio and Start–End Distance Ratio function as implicit spatial proxies. The combination of a high Overlap Ratio and a low Start–End Distance Ratio quantitatively captures the ‘wandering’ behavior and spatial confinement characteristic of berth-adjacent assistance operations. By leveraging these indicators of tortuosity and repeated coverage, the model successfully discriminates between task-oriented maneuvering and transit-oriented cruising without reliance on external spatial constraints.
4.4. Visual Verification
To further validate the consistency between the model outputs and actual tugboat operations, a multilevel visual analysis was conducted.
Figure 9 presents the state-identification results for tugboat trajectories (Tugboat: Yonggang 18, MMSI: 412036030; Dates: 1–2 January 2020) within the test set, with different colours indicating distinct operational states. The visualisations reveal several clear patterns:
Berthing states (blue) are predominantly located within designated port areas, closely matching the spatial distribution of known berthing points.
Cruising trajectories (orange) generally exhibit straight or gently curved paths connecting major port zones, consistent with the routing characteristics of routine tugboat deployment.
Assisting in Berthing (yellow) and Assisting in Unberthing (purple) trajectories cluster in waters adjacent to wharves and display dense zigzag patterns characteristic of tugboats performing close-range manoeuvring.
Figure 10 further validates the model’s reliability through a comparative analysis of the trajectories of a tugboat and the large vessels it assisted. AIS records from the same spatiotemporal scope were extracted—covering the tugboat Yonggang 18 (MMSI: 412036030, 1 January 2020) and the large vessels LUCKY EFFIE (MMSI: 229859000, entering port on 1 January 2020) and Huajiang 7 (MMSI: 413352710, departing on the same date). Their trajectories were rendered to scale based on actual vessel dimensions obtained from AIS static data. The resulting visualisation clearly illustrates the spatial interaction patterns between the tugboat and the assisted vessels:
During assisted berthing operations, the tugboat first travels at relatively high speed (often reaching 8–10 knots) toward the rendezvous point with the large vessel. After meeting the vessel, its speed decreases sharply to 2–3 knots as it escorts the ship at low speed toward the berth. The embedded temporal speed profile clearly illustrates this characteristic pattern of a high-speed approach followed by low-speed assistance.
In assisted unberthing operations, the speed pattern exhibits the opposite trend. The initial phase is characterised by low speeds (1–2 knots), reflecting the fine manoeuvring required to assist the large vessel in undocking, followed by a gradual increase in speed to 3–5 knots as the tugboat departs the area. These temporal dynamics are highly consistent with the subdivision criteria defined in
Section 3.5.
Visualisation results also reveal instances of multi-tug collaborative operations, where multiple tugboats jointly assist a single vessel. In such cases, the trajectories of the participating tugboats display both spatial clustering and behavioural consistency, further supporting the reliability of the model’s identifications. Conversely, occasional misclassifications—such as cruising segments within complex waterways being interpreted as assistance-related operations—highlight the challenges posed by intricate port environments and suggest potential avenues for future optimisation.
Overall, these visualisation outcomes not only confirm the consistency between model outputs and real-world tugboat behaviour but also demonstrate the practical applicability of the proposed method for intelligent port supervision. By accurately identifying tugboat operational states, port authorities can better evaluate operational efficiency, optimise resource allocation, and establish a reliable data foundation for carbon-emission assessment.
5. Conclusions
Focusing on the practical need for the automatic identification of tugboat operational states in port environments, this study proposes an integrated framework that combines trajectory segmentation, feature engineering, and deep learning. Based on empirical analysis using real AIS data from Ningbo–Zhoushan Port, the main conclusions are as follows:
First, the sliding-window trajectory-segmentation method based on speed thresholds effectively separates berthing and sailing states. By isolating behaviorally homogeneous trajectory segments, this step reduces the interference of mixed operational phases and provides a reliable foundation for subsequent state recognition. When combined with the subsequent feature-extraction process, it provides high-quality in-put samples for model construction. Second, the 15-dimensional feature system—covering speed, heading, and spatial-morphology dimensions—demonstrates strong discriminative capability. The Cruising state is characterised by higher speeds, minimal fluctuations, and long-distance linear movement, whereas Assisting in Berthing/Unberthing exhibits low speeds, greater variability, and short-distance back-tracking behaviours. These differences reflect the fundamentally distinct maneuvering objectives of transit and assistance operations, forming a robust basis for operational state classification. Third, the proposed three-layer fully connected neural network classifier achieved an accuracy of 89.73% and an F1-score of 0.90 on the test set, with a recall of 0.93 for the assistance-related class, indicating strong recognition capability for minority-class samples. This result confirms that a feature-driven learning strategy can achieve high accuracy and robustness even under noisy and imbalanced AIS data conditions. Finally, the subdivision method for distinguishing between assisted berthing and unberthing based on speed dynamics—where higher initial speed corresponds to berthing and lower initial speed corresponds to unberthing—was validated through trajectory visualisation. This finding verifies that the spatiotemporal asymmetry be-tween these two assistance modes constitutes an interpretable and physically meaningful discriminative cue.
The contributions of this study can be summarised in three main aspects. First, at the theoretical and methodological level, a complete technical framework for tugboat operational state identification was established, integrating trajectory segmentation, feature engineering, and a classification model. Rather than relying on purely end-to-end learning, the framework explicitly embeds domain knowledge into both feature design and decision logic, offering a balanced trade-off between accuracy and interpretability. This framework provides a transferable methodological reference for future research on vessel-behaviour identification. Second, at the application level, an identification solution based solely on conventional AIS data was developed, requiring no additional hardware and offering a low-cost approach suitable for intelligent port-surveillance systems. The avoidance of dependency on electronic navigational charts or dedicated sensors further enhances the deployability of the proposed method in real-world port environments. Third, at the feature-engineering level, the trajectory characteristics of tugboat operations were thoroughly analysed, leading to the design of a multidimensional feature system. In particular, the four descriptive features effectively captured subtle operational differences, demonstrating that trajectory morphology can function as an implicit spatial proxy for berth-adjacent behaviors.
Despite the promising results, several limitations warrant further investigation. First, the feature extraction approach in this study relies primarily on trajectory geometry and motion parameters, without incorporating external environmental factors such as port geography, tides, or weather conditions. Future work could integrate multi-source in-formation—such as electronic navigational charts and meteorological data—to enhance the model’s environmental adaptability. Second, the current model focuses on the operational patterns of individual tugboats and does not explicitly consider multi-tug collaborative scenarios. Future research may employ graph neural networks or spatiotemporal interaction models to capture the relational dynamics between multiple tugboats and assisted vessels, thereby improving performance in complex operational settings. Third, the robustness of the method under extreme weather conditions has not yet been fully verified. Systematic evaluation using AIS data collected under diverse and adverse meteorological conditions would help assess generalisation capability. Fourth, as this study primarily analysed historical AIS datasets, further development toward real-time identification is needed. Building a streaming-data-based system could enable real-time monitoring and decision support for port scheduling and dispatching. Finally, the current framework relies primarily on kinematic trajectory data, overlooking the mechanical heterogeneity of tugboats. Factors such as rated engine power and propulsion system type significantly influence acceleration profiles and maneuvering agility. Future research could incorporate these static vessel attributes to refine the classification logic, potentially developing power-dependent speed thresholds for more precise state recognition.
In conclusion, the tugboat operational state identification method proposed in this study demonstrates strong effectiveness and practicality, offering both methodological insight and operational value for fine-grained port surveillance. Future efforts will focus on enhancing model performance and expanding applicability through multi-source data integration, model optimisation, and real-time system development.