## 3 Fishing Gear Type Identification from Automatic Identification System Trajectory Data
### Preprocessing of Trajectories from AIS Data  
As mentioned in Section 3.2, AIS messages contain several types of information about ships and their movements and they are broadcast at different rates over very high frequency (VHF) channels. AIS messages are sometimes contaminated with noises caused by radio inferences with neighboring ships' radio signals or geographic obstacles like islands. A shore-based AIS device can receive contaminated messages in which some AIS messages are missing, duplicated, erroneous, or delayed. To determine the fishing gear type of a fishing trip, a trajectory needs to be constructed from a sequence of such contaminated AIS messages [22]. Hence, the AIS message data are first cleaned to remove unreliable, erroneous, or meaningless data as follows. First, we remove adjacent duplicated AIS messages and AIS messages of which longitude or latitude difference from adjacent messages are \begin{table}
\begin{tabular}{c c c} \hline \hline
**Navigation Status** & **Ship Speed** & **Transmission Period** \\ \hline \multirow{2}{*}{At anchor or moored} & \textless{}3 knots & 3 min \\  & \textgreater{}3 knots & 10 s \\ \hline \multirow{4}{*}{Cruising} & 0–14 knots & 10 s \\  & 0–14 knots and changing course & 3.3 s \\ \cline{1-1}  & 14–23 knots & 6 s \\ \cline{1-1}  & 14–23 knots and changing course & 2 s \\ \cline{1-1}  & \textgreater{}23 knots & 2 s \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Transmission rates of automatic identification system (AIS) messages with dynamic information. larger than a pre-specified threshold. Second, we remove AIS messages of which locations are close to a harbor or in a harbor area where fishing is not possible. After cleaning, the remaining AIS messages appear to be sampled at random time intervals. The proposed deep-learning based method assumes that AIS messages are generated at a specific time interval. Therefore, we first interpolate the trajectory for a sequence of AIS messages and then sample the locations on the interpolated path, courses and speeds at the specified time interval. Figure 2 shows the real data (positions, courses, speeds) of a ship at irregular time intervals and the sampled data (positions, courses, speeds) on an interpolated path at a specific time interval. In the figure, the reference time points indicate the sampling time for which the sampling period is \(\Delta t\) (e.g., 60 s). For computational efficiency, the linear interpolation method is generally used to interpolate the adjacent positions. The following interpolation method computes the interpolated positions at the sampling time points. Let \(t_{k}\) indicate the \(k\)-th sampling time and _time_\((M_{i})\) indicate the arrival time of the AIS message \(M_{i}\). If an AIS message \(M_{i}\) occurs in the time interval between the \(k\)-th sampling time and the \((k+1)\)-th sampling time, the position \([lat_{i},lon_{i}]\) of the ship for \(M_{i}\) is replaced with the position at time \(t_{k+1}\). Let \(\Delta t=t_{k+1}-time\)\((M_{i})\). The following equations are used to obtain the positions from the trajectory data at the sampling time points. \[lon_{i+\Delta t}=lon_{i}+\arctan\!\left[\frac{\frac{\sin(m_{i})}{\Delta t^{2}} \cdot\sin\frac{V\cdot\Delta t}{R}\cdot\cos(lat_{i})}{\cos\frac{V\cdot\Delta t }{R}\cdot\sin(lat_{i})\cdot\sin(lat_{i+\Delta t})}\right] \tag{1}\]  
Fishing ships usually are equipped with low-cost, low-fidelity AIS devices having a GPS sensor and gyro compass, meaning that ship course, speed, and position data are not very accurate, and AIS packets are frequently lost. The course and speed data in the AIS packets are measured at a particular moment and as such, they are prone to containing errors [23]. Due to this, the proposed method does not use those data from the AIS packets. Instead, it estimates the course and speed from the interpolated position data of which position at a specific moment is estimated by interpolating the positions of the trajectory window.