2.1. Data Preprocessing
The dataset used in this study is publicly available from the HeyWhale open data platform (
https://www.heywhale.com/mw/dataset/623b00c9ae5cf10017b18cc6/content, accessed on 6 February 2026). This open-source AIS dataset comprises real historical vessel trajectory data collected from Chinese offshore waters, with the original data derived from vessel traffic in the East China Sea.
The AIS data used in this study cover fishing vessel trajectory records in the East China Sea (21° N to 37° N, 115° E to 130° E), spanning from September 2016 to November 2020. The dataset comprises 18,320 CSV files, each corresponding to one or more trips of a single fishing vessel, and covers three operational types registered by the fisheries authority: trawler, gillnetter, and purse seiner. The AIS data have been de-identified, and the original fields include vessel ID, timestamp (time), longitude, latitude, speed (Speed), course over ground (Type), and vessel type. The data are predominantly sampled at a 10 min interval, and irregular sampling also occurs. Given the large number of trajectory points, the trajectories are downsampled to produce an overview map, as shown in
Figure 1.
Prior to the experiments, trajectory data cleaning is required. Zhang and Zhou [
16] proposed a fishing vessel trajectory outlier detection method based on the Geohash geocoding algorithm, providing a reference for broadening the approaches to data cleaning. This paper implements the following cleaning rules:
Missing value handling: records with empty values in any of the fields of timestamp, longitude, latitude, speed, or course are removed.
Duplicate record removal: for duplicate trajectory points with identical timestamps, only the first record is retained; for records with different timestamps but identical longitude, latitude, speed, and course while the speed is non-zero, the subsequent duplicates are deleted.
Speed anomaly filtering: since the maximum speed of a fishing vessel generally does not exceed 20 knots, records with speed greater than 30 knots or less than 0 knots are treated as anomalies and removed.
Course anomaly filtering: the valid range of the course field is 0° to 360°, and records outside this range are deleted.
Abnormal drift detection: for adjacent trajectory points, the spherical distance is calculated using the Haversine formula. If this distance exceeds the theoretical distance that a fishing vessel can travel at maximum speed within the same time interval, the latter point is identified as an abnormal drift point and removed. The detection rule is:
where
is the spherical distance between two adjacent points,
denotes the maximum speed of the fishing vessel, and
is the time interval between the two points.
Small file filtering: CSV files containing fewer than 300 trajectory points are discarded.
2.2. Adaptive Speed Threshold
Speed serves as an essential component in feature design. Yang et al. [
17] demonstrate that well-constructed trajectory features can significantly improve a classifier’s ability to distinguish fishing vessel operation modes. Accordingly, we consider establishing a global segmentation threshold that applies to the speed range of all vessels. Farahnakian et al. [
18] survey the application of clustering techniques in detecting abnormal vessel behavior and confirm the feasibility of clustering-driven behavior segmentation, which further justifies this approach.
This paper presents a data-driven adaptive motion state segmentation pipeline. Using stratified sampling, we randomly select 300,000 speed points from each of three categories of fishing vessels to construct a sample set. Based on the optimal number of Gaussian components K, we determine the equal-probability decision boundaries between adjacent components, which serve as the final segmentation thresholds for the speed intervals. According to the upper speed bound of the data, the speed range is divided into four intervals: , , , and , where knots.
To determine the number of Gaussian components
K, we fit mixture models for
on a stratified sample of 900,000 speed points and evaluate both the Bayesian Information Criterion (BIC) and the Akaike Information Criterion (AIC). As shown in
Figure 2c, the BIC curve exhibits its steepest descent at
, while the
transition yields a comparatively modest
(
Figure 2d).
Figure 2d displays only
; because
and
share the same log-likelihood term
, all three criteria agree on the
improvement, and the large-sample BIC–AIC divergence is already visible in
Figure 2c. However, the BIC and AIC curves diverge beyond
, reflecting the well-known tendency of BIC to under-select components at large sample sizes: the BIC penalty per parameter
substantially exceeds the AIC penalty
. Second, the log-likelihood improvement from
to
is consistently positive across all five random seeds, confirming that the fourth component captures non-trivial structure in the speed distribution. Third,
provides a physically meaningful decomposition: under
, the low-speed operational range collapses into a single broad mode (
Figure 2a), whereas
resolves it into two distinct components centered near 0 and 1.6 kts respectively, capturing finer structure in the low-speed range (
Figure 2b). We therefore adopt
as it balances statistical evidence with distributional resolution.
where
denotes the Gaussian probability density function:
For two adjacent motion states
and
, the optimal decision boundary
is defined, under the Bayesian decision theory framework, as the speed value that equalizes their posterior probabilities:
Since the denominator of the posterior probability is identical across all components in Equation (
2), Equation (
4) simplifies to
This boundary exhibits clear statistical optimality. To the left of , where , assigning a sample to component minimizes the posterior risk; to the right, assigning it to minimizes the posterior risk. Consequently, serves as the Bayes-optimal split point for separating adjacent motion states.
In practical computation, exactly solving Equation (
4) requires solving a quadratic equation in
x for each pair of adjacent components. The equal-probability decision boundary can be approximated as the midpoint between the means of two adjacent components:
Substituting the component means into Equation (
6) yields three speed interval segmentation thresholds. We overlay these thresholds as dividing lines onto the speed frequency histograms of the three fishing vessel categories. As shown in
Figure 3, the four colored curves correspond to the four Gaussian components, and the red lines mark the three decision boundaries, namely, 0.85 kts, 2.17 kts, and 5.18 kts, determined by the midpoints of adjacent component means.
2.3. Robust Feature Design
Since the AIS data used in this paper are predominantly sampled at 10 min intervals, the reliability of instantaneous motion details between adjacent points degrades. We therefore construct a 39-dimensional feature set based on window statistics across multiple dimensions, as listed in
Table 1.
The features listed in
Table 1 can be interpreted as follows:
Speed interval proportions: Let the speed sequence be
, and let the speed interval thresholds be
. The proportion
of the
k-th interval is defined as
where
is the indicator function, equal to 1 if the condition holds and 0 otherwise; the four proportions always sum to 1 and represent the fraction of time the fishing vessel spends in each of the four motion states.
Global speed statistics, speed extremes, and speed distribution shape: The global speed statistics include the mean, median, standard deviation, maximum, minimum, and interquartile range, while the speed distribution shape is captured by skewness and kurtosis:
A positive indicates a right-skewed distribution, reflecting a prevalence of higher speed values, whereas a negative indicates a left-skewed distribution with a prevalence of lower speed values. A positive corresponds to a distribution that is more peaked than the normal distribution, while a negative indicates a flatter distribution.
Cumulative turning: Let
n be the number of trajectory points and
the sliding window size. For the
k-th window, the cumulative turning angle is defined as the sum of absolute heading differences over all adjacent point pairs within the window:
where
is the course over ground of the
j-th trajectory point, and
is the minimum absolute heading difference between the two points (ranging in
). Because AIS course over ground is reported in the range
, a naïve subtraction
would introduce an artificial discontinuity at the 360°/0° boundary. To avoid this, we define the minimum angular difference as
which always yields a value in
and is free of boundary artifacts.
By iterating over all windows, we extract the mean, standard deviation, and maximum of the cumulative turning sequence.
For the heading distribution features, we adopt a sin/cos decomposition that respects the circular topology, which representation maps angles onto the unit circle and thus introduces no artificial discontinuity at the 360°/0° boundary. Given a sequence of course values , the circular mean is computed as and the circular concentration as , where the overline denotes the arithmetic mean.
Trajectory shape: This category includes three features: sinuosity, median distance to the center point, and head-to-tail direction consistency.
Sinuosity is defined as the ratio of the total path length to the straight-line distance between the start and end points:
where
denotes the
i-th trajectory point,
is the spherical distance, and
N is the total number of trajectory points. A sinuosity value of
indicates a strictly straight trajectory, while
indicates tortuous movement.
Head-to-tail direction consistency is defined using the same minimum angular difference
introduced above, applied to the heading vector of the first segment (
) and that of the last segment (
), and normalized to the interval
:
where
indicates that the head and tail headings are perfectly consistent, while
indicates completely opposite headings.
Stop events: We adopt the low-speed threshold kts and define a stop event as a sequence of at least two consecutive sampling points with speed below . The duration of each stop event is measured in number of trajectory points, from which we extract the total number of stop events, the average duration in points, and the maximum duration in points.
Motion change rate: Acceleration and turn rate are defined as follows:
where
is the time difference between adjacent points, and
is a small smoothing term to prevent division by zero. We then extract the median and interquartile range of the acceleration sequence
and the turn rate sequence
.
Fractal dimension: We adopt the box-counting method. At multiple scales
, we cover the trajectory with a grid and count the number of grid cells
intersected by the trajectory. The slope is then fitted via the log–log linear relationship:
Using five scales , we perform a least-squares linear fit on , and the slope gives the fractal dimension. , with values closer to 1 indicating a more straight-line trajectory and values closer to 2 indicating higher space-filling capacity.
Stop point spatial entropy: The trajectory’s spatial extent is partitioned into a uniform
grid (
), and the frequency distribution
of stop points in each grid cell is computed to calculate the Shannon entropy:
where
is a small smoothing term to prevent
. A larger
indicates a more uniform spatial distribution of stop points, whereas a smaller value indicates that stop points are concentrated in fewer locations.
Turn point density and gap coefficient of variation: A turn point is defined as the position of a trajectory point where the minimum angular difference
between consecutive headings exceeds a threshold
. Turn point density is defined as the number of turns per unit distance traveled:
where
is the total distance traveled along the trajectory. Let
be the sequence of turn point indices, with
, and let
denote the index gap between consecutive turn points. The coefficient of variation of these gaps is
A larger indicates a more uneven distribution of turn points, whereas a smaller value indicates a more uniform distribution.
Speed autocorrelation: The persistence of speed over time is measured by the first-order autocorrelation coefficient:
where
is the mean speed, and
is a small smoothing term to prevent division by zero. A value of
indicates that the speed remains persistent and stable with high positive correlation, whereas
indicates rapid alternating changes in speed. When
or the standard deviation of speed is zero, a default value of 0 is assigned.