## 3 Methodology
### Implementation of MFELCM
#### 3.4.3 Implementation of Bi-GRU  
To solve the short-term memory problem of the original RNN, [PERSON], et al. [30] propose the long short-term memory (LSTM) unit. GRU [31] is the simplified version of LSTM. Figure 11 is the structure of a GRU unit, in which \(g_{t}\) is the main layer and \(r_{t}\) controls the reset gate, which resets \(h_{t-1}\) based on \(h_{t-1}\) (from the previous time step) and \(x_{t}\) (from the current time step). The \(h_{t-1}\) which has been reset is submitted to \(g_{t}\). \(z_{t}\) controls the forgetting gate as well as the output gate, which uses a '1-' operation to ensure that the weight of the forgotten memory must be equal to the weight of the added memory at the current time step. The weights of \(h_{t-1}\) to forget and that of \(g_{t}\) to input into \(h_{t-1}\) are determined by \(h_{t-1}\) and \(x_{t}\), Equation (16) shows the way to update the parameters of a GRU unit, where \(W_{xz}\), \(W_{xx}\), \(W_{xg}\) and \(W_{hz}\), \(W_{hr}\), \(W_{hg}\) are the connection weight matrixes of  
Figure 10: Structure of 1D-CNN. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Layers** & **Shape** & **Input** & **Output** & **Activation Function** & **(Padding, Strides)** \\ \hline Conv\_1 (Convolutional layer\_1) & \(15\times 30\) & \(100\times 13\) & \(86\times 30\) & ELU (Exponential Linear Units) & (False,1) \\ MaxPooling\_1 & \(4\times 30\) & \(86\times 30\) & \(21\times 30\) & & (False,1) \\ Conv\_2 & \(5\times 40\) & \(21\times 30\) & \(17\times 40\) & ELU & (False,1) \\ Conv\_3 & \(5\times 40\) & \(17\times 40\) & \(13\times 40\) & ELU & (False,1) \\ MaxPooling\_2 & \(4\times 40\) & \(13\times 40\) & \(3\times 40\) & \(\backslash\) & (False,1) \\ Flatten layer & \(\backslash\) & \(3\times 40\) & \(120\times 1\) & \(\backslash\) & \\ FC (Full connection layer) & \(\backslash\) & \(120\times 1\) & \(4\times 1\) & Softmax & \(\backslash\) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Details of 1D-CNN. and \(h_{t-1}\) to three fully connected layers. In addition, \(b_{z},\ b_{r},\ b_{g}\) are the bias terms of three full connection layers, respectively. \[\left\{ \begin{array}{l}z_{t}=\sigma(W_{\rm{sr}}^{T}x_{t}+W_{\rm{lg}}^{T}h_{t-1 }+b_{z})\\ r_{t}=\sigma(W_{\rm{sr}}^{T}x_{t}+W_{\rm{hr}}^{T}h_{t-1}+b_{r})\\ g_{t}=\tanh(W_{\rm{sr}}^{T}x_{t}+W_{\rm{hg}}^{T}(r_{t}\otimes h_{t-1})+b_{g}) \\ h_{t}=z_{t}\otimes h_{t-1}+(1-z_{t})\otimes g_{t}\end{array} \right. \tag{16}\]  
Figure 12 shows the structure of Bi-GRU. The time-series samples in a batch (e.g., \(TS_{1}^{in}\), \(TS_{2}^{in}\), and \(TS_{3}^{in}\)) are firstly filled with a value v to the same length. After going through the mask layer, the network will ignore the time step in which the data are filled with v. Bi-GRU is composed of a cyclic part and a full connection part. The cyclic part has four layers, and the hidden state of each layer in the cyclic part is 35 dimensions. The first layer in the cyclic part uses the bidirectional GRU, which enables the network to understand the behaviors of the previous time steps with the help of subsequent time steps. In this layer, for the GRU unit with input \(d_{j}^{in}\), its output \(y_{j}\) is obtained by concatenating \(h_{j}\) (output in the forward direction) and \(h_{j}^{\prime}\) (output in the reverse direction). The second layer and the third layer are the same unidirectional GRU network. The fourth layer outputs \(y_{j+k}^{in}\) of the last time step and inputs it to two full connection layers. Finally, the network outputs a 4-dimensional vector, and the value (between 0 and 1) of each dimension in this vector represents the probability that \(TS_{m}^{in}\) belongs to a certain class of ships. Figure 11: A GRU unit. Figure 12: The framework of Bi-GRU. The trajectory \(T^{i_{m}}\) contains multiple time-series samples \(TS^{i_{m}}_{n}\), and each \(TS^{i_{m}}_{n}\) has its predicted type.