## 3 Methodology
### Data Processing
#### 3.2.2 Removal of Anomalies/Redundant Points  
Biases, errors, and duplicate data may occur during the collection, transmission, and network latency of AIS data, and there is the fact that adjacent data points in AIS data do not have equal time intervals, which is not conducive to the prediction and analysis of subsequent models. Therefore, in addition to removing abnormal data, this paper also removes some redundant points with relatively small changes in navigation states and  
Figure 3: Trajectory segmentation. points with significant changes in navigation states, collectively referred to as removal points (\(Po_{drop}\)). This paper calculates the change rate of course over ground (CRC) and change rate of speed over ground (CRS) between adjacent points. Minimum and maximum thresholds for CRC and CRS are set. Points with values less than the minimum threshold indicate insignificant changes in navigation states and are removed. Points with values greater than the maximum threshold indicate abnormal trajectory points and are also removed. The calculation of \(crc_{i}\) and \(crs_{i}\) for each trajectory point is shown in Formula (6). \[ \begin{bmatrix}crc_{i}\\ crs_{i}\end{bmatrix} = \begin{bmatrix}cop_{i+1}-cop_{i}\\ sog_{i+1}-sog_{i}\end{bmatrix} [t_{i+1}-t_{i}]^{-1} \tag{6}\]  
We calculate the values of \(crc_{i}\) and \(crs_{i}\) for each trajectory point and perform mathematical statistics on them. We use a Gaussian distribution denoted as '\(a\)' to fit the distribution of global CRC and CRS. A simplified representation is as follows:  
\[\overline{x}^{a}=\frac{1}{n}\underset{i=1}{\overset{n}{\sum}}x_{i}^{a} \tag{7}\]  
\[(\sigma^{a})^{2}=\frac{1}{n-1}\underset{i=1}{\overset{n}{\sum}}\left(x_{i}^{a }-\overline{x}^{a}\right)^{2} \tag{8}\]  
where \(\overline{x}^{a}\in R^{2}\) represents the mean of the samples, \(n\in R\) is the total sample count, \(a=\{CRC,CRS\}\), and \((\sigma^{a})^{2}\in R^{2}\) represents the variance of the samples. Based on the distribution statistics, we use the value of \(3\sigma\) as the threshold boundary for CRC and CRS, and their respective mathematical expressions are given by (9). \(b_{min}^{crc}\) and \(b_{max}^{crc}\) represent the minimum and maximum values of the CRC threshold boundary, while \(b_{min}^{crc}\) and \(b_{max}^{crc}\) represent the minimum and maximum values of the CRS threshold boundary. \[ \begin{bmatrix}b_{min}^{crc}&b_{max}^{crc}\\ b_{min}^{cr}&b_{max}^{cr}\end{bmatrix} = \begin{bmatrix}\overline{x}_{1}^{a}\\ \overline{x}_{2}^{a}\end{bmatrix}\begin{bmatrix}1&1\end{bmatrix} +3 \begin{bmatrix} (\sigma_{1}^{a})^{2}\\ (\sigma_{2}^{a})^{2}\end{bmatrix}\begin{bmatrix}-1&1\end{bmatrix}  \tag{9}\]  
For each trajectory in the navigation trajectory set (\(Tar^{max}\)), we traverse and remove discovered anomaly points and redundant points. For each trajectory point in the set, the points to be removed are denoted as \(Po_{drop}=\{Po_{or},Po_{co},Po_{de},Po_{re}\}\). * Error Points (\(Po_{or}\)): Trajectory points with \(cop_{i}\), \(sog_{i}\), \(lon_{i}\), and \(lat_{i}\) values outside reasonable ranges, mathematically defined in Formula (10). * Coincident Points (\(Po_{co}\)): Points in the trajectory where \(sog_{i}\) is greater than 0, but the coordinates (\(lon_{i},lat_{i}\)) are the same. Mathematically defined in Formula (11). * Deviation Points (\(Po_{de}\)): Current trajectory points that have a significant offset from adjacent trajectory points, mathematically defined in Formula (12). * Redundant Points (\(Po_{re}\)): Current trajectory points where \(crc_{i}\) and \(crs_{i}\) with the previous trajectory point are less than the minimum threshold or greater than the maximum threshold, mathematically defined in Formula (13).