## 3 Materials and Methods
### Ship Feature Extraction
#### 3.3.1 Geometric Feature Extraction  
Static information message 5 of AIS data contains the length and width information of the ship, and its fields \(A\), \(B\), \(C\), and \(D\) reflect the overall dimensions of a ship, which, respectively, represent the distances from reference point \(O\) for reporting position to the bow, stem, port side, and starboard, as shown in Figure 3. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Ship Subcategory Codes** & **Ship Types** & **Ship Category Codes** \\ \hline
30 & Fishing ship & 3 \\
52 & Tug ship & 5 \\
60–69 & Passenger ship & 6 \\
70–79 & Cargo ship & 7 \\
80–89 & Tanker ship & 8 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The corresponding relationships between AIS ship type codes and ship types. Figure 2: The distribution of ship types in the AIS data. (**a**) The distribution of ship types by ship category codes; (**b**) the distribution of the top 20 ship types with the largest number by ship subcategory code. Then, the features _Length_ and _Width_ can be calculated by Equation (1):  
\[\left\{ \begin{array}{l}Length=A+B\\ Width=C+D\end{array} \right. \tag{1}\]  
In general, the measurement of ship appearance characteristics also includes _Naive_Perimeter_, _Naive_Area_, _Aspect_Ratio_, and _Shape_Complex_[38]. The relevant definitions are given in Equation (2):  
\[\left\{ \begin{array}{l}Naive\_Perimeter=2\times(Length+Width)\\ Naive\_Area=Length\times Width\\ Aspect\_Ratio=Length/Width\\ Shape\_Complex=(Length+Width)^{2}/(Length\times Width)\end{array} \right. \tag{2}\]  
Finally, the 6-dimensional feature shown in Equation (3) was selected as the geometric feature input for the ship classification algorithm. \[ \begin{array}{ll}f_{g}=&[Length,\,Width,\,Naive\_Perimeter,\,Naive\_Area,\\ Aspect\_Ratio,\,Shape\_Complex]\end{array}  \tag{3}\]  
Table 3 shows the statistical results of the mean value and standard deviation (Std. deviation) of the geometric features for the five selected types of ships. It can be observed that different types of ships exhibit certain differences in the extracted features. The _Length_ and _Width_ of ocean sailing cargo ships and oil tankers are significantly larger than those of the other three types of ships, and their geometric features are relatively similar. By contrast, fishing ships, passenger ships, and tug ships are generally small offshore ships. As can be seen from the statistical results, fishing ships and passenger ships are similar in the _Aspect_Ratio_ and _Shape_Complex_, and the _Naive_Area_ and _Naive_Perimeter_ of fishing ships and tug ships are similar; however, the size of passenger ships is slightly larger than that of fishing ships and tug ships. Figure 3: The reference point for reporting position and overall dimensions of a ship. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Geometric Features**} & \multirow{2}{*}{**Evaluating Indicators**} & \multicolumn{5}{c}{**Ship Types**} \\ \cline{3-8}  & & **Cargo** & **Tanker** & **Fishing** & **Passenger** & **Tug** \\ \hline \multirow{2}{*}{_Length_ (\(m\))} & Mean value & 212.64 & 215.96 & 50.88 & 97.75 & 43.31 \\  & Std. deviation & 66.66 & 70.70 & 24.82 & 82.16 & 37.68 \\ \hline \multirow{2}{*}{_Width_ (\(m\))} & Mean value & 32.73 & 36.65 & 10.36 & 16.89 & 12.56 \\  & Std. deviation & 9.58 & 12.97 & 5.61 & 10.76 & 6.86 \\ \hline \multirow{2}{*}{_Naive\_Perimeter_ (\(m\))} & Mean value & 490.75 & 505.21 & 122.49 & 229.23 & 111.74 \\  & Std. deviation & 150.94 & 166.49 & 57.35 & 183.40 & 87.25 \\ \hline \multirow{2}{*}{_Naive\_Area_ (\(m^{2}\))} & Mean value & 7540.11 & 8795.10 & 614.26 & 2420.80 & 761.77 \\  & Std. deviation & 4228.87 & 5555.35 & 914.04 & 3293.65 & 1814.57 \\ \hline \multirow{2}{*}{_Aspect\_Ratio_} & Mean value & 6.48 & 5.97 & 4.94 & 5.25 & 3.29 \\  & Std. deviation & 0.94 & 0.64 & 1.36 & 1.78 & 1.09 \\ \hline \multirow{2}{*}{_Shape\_Complex_} & Mean value & 8.64 & 8.14 & 7.17 & 7.47 & 5.63 \\  & Std. deviation & 0.92 & 0.63 & 1.27 & 1.69 & 1.01 \\ \hline \hline \end{tabular}
\end{table}