# Abnormal Ship Behavior Detection Based on AIS Data
## 4 Results and Discussion
### Experimental Results for Real Datasets
#### 4.2.2 Detection of Abnormal Ship Behavior Based on Thematic Attributes  
Based on the above experiments, we obtained the maritime route structure of the input ship trajectory data. Then, we used the intersection as the breakpoint to segment the channel network, and the results after segmentation are shown in Figure 13.  
In light of the time and space constraints on the navigation of ships, the data density distribution of different maritime route segments was not uniform; that is, the sample sizes of some route segments were large, and those of some route segments were small. Considering that ships often exhibit different motion characteristics on different routes in the course of running, we considered the partial route data of the biased data as the input of the experimental data for feature anomaly detection. We counted the number of trajectory points of each segment, and the statistical results are shown in Figure 14.  
As shown in Figure 14, it can be seen that the route segments with the IDs 12, 17, and 18 had more trajectory points, so we selected the route segment with the most trajectory points, segment 12, as the experimental route segment. We selected the thematic attribute features of the ship, including the speed over ground, the variation of the course over ground, the average speed, and the average acceleration and used different combinations as model inputs to obtain abnormal scores for different attributes. The higher the score, the more abnormal the attribute of the point. First, we used the above four quantiles as the threshold to separate the characterization and detection of the abnormal scores of four attributes as shown in Figure 15.  
In order to further verify the effectiveness of the algorithm, we classified the subject attributes into two large categories according to the time variance of the experimental data. Figure 12: Abnormal ship behavior detection results based on spatial attributes. The first category was used to express instantaneous changes of the ship with the speed over ground and the variation of the course over ground, and the second category was used to express the slow change characteristics of the ship over time with the average speed and average acceleration. We used the entropy weight method to assign the weights of the attributes and finally obtained the anomaly scores of each point based on the thematic topic attribute characteristics. The physical meaning of the composite score can be used to describe the degree of the anomaly of the ship at that point in time. We used the above four quantiles as the threshold to detect the abnormal scores for the two types of composite topic attributes, and the results are shown in Figure 16.  
Figure 14: Statistics for the number of trajectory points in the maritime route segments. Figure 13: Maritime road segmentation results. It was found that the outliers accounted for about 0.49% of all the point sets when the combined thematic attributes were the speed over ground and the variation of the course over ground. When the combined thematic attribute features were the average velocity and average acceleration, outliers accounted for about 0.46% of all the point sets. In order to verify the rationality of the detection results, we further discovered and explained the detected abnormal points according to the characteristic values of the adjacent attributes and the geographical environmental characteristics of the ship points. We selected the vessel with the MMSI number 413,459,270 for a period of trips from 29 October 2021 to 31 October 2021 for the combined thematic attribute characterized as the speed over ground and the variation of the course over ground to illustrate the detection results. The ship was in the Caofeidian port on its way to the Xihoumen port, and in the time period from 1:48 a.m. on 30 October 2021 to 2:56 a.m. on 30 October 2021, it was in a hovering state for a long time due to unknown factors and was traveling at a lower speed and with a variable steering angle.