# Abnormal Ship Behavior Detection Based on AIS Data
## 4 Results and Discussion
### Simulated Experiments  
In order to verify the effectiveness of the method, based on the definition of abnormal ship behavior, this study simulated the ship trajectory point from the perspective of spatial and thematic attributes. Based on the ship spatial attributes and four special attributes, a set of normal trajectory point data in accordance with a Gaussian distribution was fitted. Based on the fitting results, three times the standard deviation was added to the abnormal data, and finally, a set of trajectory point data with an abnormal behavior label was obtained. Finally, we simulated about 1000 track points, of which the abnormal data accounted for about 5%. The spatial anomaly representation of the simulation data is shown in Figure 7, and the anomaly representation of the thematic attributes is shown in Figure 8.  
This part of the study separately explored and analyzed the feasibility of the proposed method for detecting spatial anomalous behavior and thematic attribute anomalous behavior. For the detection of abnormal behavior for spatial attributes, we chose the classical anomaly detection algorithm of the Gaussian mixture model (GMM) and frontier ship anomaly detection algorithm [6] of maritime trajectory modeling and anomaly detection (MT-MAD) as the contrast method. For the detection of abnormal behavior for thematic attributes, we chose the classic anomaly detection algorithm density-based spatial clustering of applications with noise (DBSCAN) and the frontier abnormal ship behavior detection algorithm based on the DBSCAN algorithm and Markov algorithm proposed by [PERSON] [18] as the comparison method. At the same time, we selected the values of accuracy, recall, precision, and F-score as the evaluation indicators.  
Figure 7: Simulation data for abnormal behavior of ship spatial attributes.  
The accuracy is the most intuitive measure of the model, and it is calculated as the number of results judged correct divided by the number of all the participants. The precision is calculated as the ratio of the number of samples correctly retrieved to the total number of samples retrieved. The recall is calculated as the ratio of the number of samples correctly retrieved to the number of samples that should be retrieved. The F-score can comprehensively reflect the changes in precision and recall and can be used to effectively evaluate the effectiveness of the model.  
The test results for the performance of each method are shown in Tables 2 and 3.  
In order to verify the rationality of the proposed method, we compared the results of different algorithms from the perspective of spatial attributes and thematic attributes. It can be observed from Tables 2 and 3 that the method proposed in this paper was accurate for the simulation dataset compared with the traditional classical algorithm, and it was effective in comparison with the frontier method. From the results of the table, we can observe that the classical method had a higher accuracy but a lower F-score. Due to the imbalance between the positive and negative samples, the accuracy index had a larger defect, so we could not select a single accuracy evaluation method. Recall and precision are a pair of contradictory performance measures, while the F-score can compare the performance of a comprehensive approach. It can be observed that the method proposed in this paper had a higher F-score value than the front-end method, which verifies the effectiveness of the method proposed in this paper.