## 4 Prediction Algorithm of Maritime Traffic Condition
### Data Preparation  
Preparation of the data involves obtaining a dataset and pre-processing the data. There are various data related to maritime traffic conditions such as AIS, V-PASS, and LTE-M. AIS data are for ships with a gross tonnage of 300 tons or more. In addition, V-PASS data are data for fishing boats, and LTE-M data are provided from a wireless communication network that introduces LTE communication technology to the sea as a basis for providing intelligent maritime traffic information to ships sailing up to 100 km from the coast of Korea. However, personal access to LTE-M data is limited. Considering this comprehensively, AIS data were used in this study. AIS data were collected using AIS transponder capable of collecting both A class and B class, and position reports messages, ship static and voyage-related data messages were used. In addition, coordinate transformation was not performed for gate line analysis using WGS-84(World Geodetic System-84) based software (XTSSRC_v1.0). Table 1 is the description of the dataset.  
The target sea area was limited to Ulsan Port, the largest industrial support port in Korea; there are several fairways including the entrance for Ulsan Port. Among those, the most complicated gate line of No.1 Fairway was selected as the analysis point, which is near the gate line of No.3 Fairway and the entrance for Ulsan Port. The period of the data is from 1 September 2019 to 31 August 2020. Figure 2 is an example of the visualization of the AIS data of the target sea area.  
Data pre-processing is a process that increases the reliability of data and is a very important step since it directly affects training results.  
The AIS data consisted of dynamic, static, navigation-related, and safety-related information. Except for the dynamic information, the reception period of the remainder was 6 min, and the reception period of dynamic information changed from a minimum of 2 s to a maximum of 3 min, depending on the class of the AIS equipment and the dynamic condition of the ship. The occurrence of missing data was addressed through the implementation of linear interpolation. Moreover, a large number of outliers was present depending on the marine conditions and the communication environment, and these errors were addressed during the data pre-processing process.  
\begin{table}
\begin{tabular}{c c c} \hline  & **Static Data** & **Dynamic Data** \\ \hline Size & 8.22 MB & 558 GB \\ \hline Number of records & 142,160 & 8,259,187,180 \\ \hline  & Maritime Mobile Service Identity & \\  & number (Integer), & Maritime Mobile Service \\  & Ship’s name (Text), & Identity number (Integer), \\  & Ship’s type code (Integer), & Latitude (Double), \\  & International Maritime & Longitude (Double), \\  & Organization number (Integer), & Course of ground (Float), \\  & Call sign (Text), & Speed of ground (Float), \\  & Length of all (Integer), & Heading (Integer), \\  & Breath (Integer), & Time (DateTime). \\  & Draft (Integer). & \\ \hline \end{tabular}
\end{table}
Table 1: Description of dataset.  
The range of outliers was first selected by considering the characteristics of the target sea area. Outliers were removed using the IQR (interquartile range), which is the difference between the values in the top 75% and bottom 25% of the quartile. Equations (8) and (9) are expressions for calculating outliers using IQR.  
\[\text{IQR}=Q_{3}-Q_{1} \tag{8}\]  
\[\{a\ \mid\ [a<(Q_{1}-1.5\text{-IQR})]\cup[a>(Q_{3}+1.5\text{-IQR})]\} \tag{9}\]  
where  
\(Q_{1}\): Midpoint of the lower half of the data values,  
\(Q_{2}\): Midpoint of the upper half of the data values.