## 3 Materials and Methods
### Ship Feature Extraction
#### 3.3.2 Behavior Characteristic Extraction  
To improve the accuracy of ship classification, this paper adds to the extraction of behavior characteristics besides geometric features. The behavioral descriptions of ships are more complex. Cargos and tankers often carry out cross-ocean transportation across continents. Their activity range is much larger than that of small ships such as fishing ships, passenger ships, and tug ships, and their speed is relatively stable when sailing in the ocean, whereas fishing ships, passenger ships, and tug ships are flexible and their speed changes quickly. Based on the above analysis and the fact that spaceborne AIS data can achieve the global monitoring of ships, this paper conducts a ship behavior study within the time range of one year. Messages 1, 2, and 3 of the AIS data contain the longitude, latitude, \(SOG\), and other dynamic ship information. According to Equation (4), the features _Longitude_Span_ (unit: \({}^{\circ}\)), _Latitude_Span_ (unit: \({}^{\circ}\)), and _Voyage_Distance_ (unit: km) of each ship can be calculated as the motion trajectory characteristics of ships in this paper. Assuming that the _i-th_ ship has \(m\) (\(m>1\)) AIS messages, then  
\[\left\{\begin{array}{l}Longitude\_Span=|longitude_{\max}-longitude_{ \min}|\\ Latitude\_Span=|latitude_{\max}-latitude_{\min}|\\ Voyage\_Distance=\sum\limits_{k=1}^{m-1}2R\cdot\arcsin\left(\sqrt{\sin^{2}( \frac{\Delta\phi_{k}}{2})+\cos(rlat_{k})\cdot\cos(rlat_{k+1})\cdot\sin^{2}( \frac{\Delta\lambda_{k}}{2})}\right)\end{array}\right. \tag{4}\]  
where \(\Delta\varphi_{k}=|rlat_{k+1}-rlat_{k}|\) and \(\Delta\lambda_{k}=|rlon_{k+1}-rlon_{k}|\) represent the absolute values of the latitude and longitude differences between two adjacent points, _rlat_ and _rlon_ represent the radian values of the corresponding latitude and longitude, and \(R\) is the average radius of the Earth, which is taken as 6371 km in this paper.  
In addition, through a statistical analysis of the speeds of various types of ships in the AIS database, this paper divides the speeds of ships (SOG) into high-speed and low-speed sailing states according to whether it is greater than five knots. According to Equation (5), this paper calculates the mean value and standard deviation of the two states to describe the average speed and speed change scale of ships, respectively; thus, four additional ship behavior characteristics (i.e., _High_Speed_Mean_, _High_Speed_Std_, _Low_Speed_Mean_, and _Low_Speed_Std_) can be obtained. Suppose that there are \(n\) AIS messages with SOG \(>5\) in \(m\) AIS messages of ship \(i\), then  
\[\left\{\begin{array}{l}High\_Speed\_Mean=\left(\sum\
olimits_{k=1}^{n}SOG_{ k}\right)/n\\ High\_Speed\_Std=\left[\sum\
olimits_{k=1}^{m}\left(SOG_{k}-High\_Speed\_ Mean\right)^{2}\right]/n\\ Low\_Speed\_Mean=\left(\sum\
olimits_{l=1}^{m-n}SOG_{l}\right)/(m-n)\\ Low\_Speed\_Std=\left[\sum\
olimits_{l=1}^{m-n}\left(SOG_{l}-Low\_Speed\_ Mean\right)^{2}\right]/(m-n)\end{array}\right. \tag{5}\]  
where \(0<n<m\). In the case of \(n=0\) or \(n=m\), this paper automatically fills it with the average value of the corresponding features of this type of ship. The extracted 7-dimensional motion features are expressed in Equation (6):  
\[\begin{array}{ll}f_{m}=&\left[Longitude\_Span,\ Latitude\_Span,\ Voyage\_Distance,\right.\\ &\left.High\_Speed\_Mean,\ High\_Speed\_Std,\right.\\ &\left.Low\_Speed\_Mean,\ Low\_Speed\_Std\right]\end{array} \tag{6}\]  
The statistical results of the ship behavior characteristics on the dataset are shown in Table 4. It can be seen that the annual activity range of cargo ships and tanker ships is much larger than that of the other three types of ships. The speed of fishing ships at high speeds is generally lower than that of other ships, but their speed is the highest at low speeds, which reflects the characteristics of the frequent maneuvering of fishing ships in fishing operations. Compared with other types of ships, tugs have a smaller value in _Longitude_Span_,