# Deep Visual Waterline Detection for Inland Marine Unmanned Surface Vehicles
## 3 Methodology
### Training Methods of Two Deep Networks
#### 3.3.1 Training WLdetectNet by Supervised Learning  
The WLdetectNet acts as the mainstay of DeepWL. According to its design schemes described previously, WLdetectNet aims to capture discriminative information relevant to waterline segments for final waterline detection. Thereby, in order to guarantee its accuracy and generalization ability, a large amount of training data is required, except for those significant designs regarding its architecture (described in Section 3.1). However, no public dataset on waterlines is available at present. Moreover, as mentioned before, it \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Layer** & **Operation** & **Kernel** & **Nonlinearity** & **BN?** & **Dropout** & **Output Size** \\ \hline \multicolumn{6}{c}{\(G(z)\)-input} \\ \hline
1 & Linear & ReLU & Y & & 4 \(\times\) 4 \(\times\) 1024 \\ \hline
2 &
\begin{tabular}{c} Fractionally- \\ strided \\ convolution \\ \end{tabular} & \(5\times 5\) & ReLU & Y & & 8 \(\times\) 8 \(\times\) 512 \\ \hline
3 &
\begin{tabular}{c} Fractionally- \\ strided \\ convolution \\ \end{tabular} & \(5\times 5\) & ReLU & Y & & 16 \(\times\) 16 \(\times\) 256 \\ \hline
4 &
\begin{tabular}{c} Fractionally- \\ strided \\ convolution \\ \end{tabular} & \(5\times 5\) & ReLU & Y & & 32 \(\times\) 32 \(\times\) 128 \\ \hline
5 &
\begin{tabular}{c} Fractionally- \\ strided \\ convolution \\ \end{tabular} & \(5\times 5\) & Tanh & & & 64 \(\times\) 64 \(\times\) 3 \\ \hline \multicolumn{6}{c}{\(D(x)\)-input} \\ \hline
1 & Convolution & \(5\times 5\) & LeakyReLU & Y & 0.5 & 32 \(\times\) 32 \(\times\) 64 \\ \hline
2 & Convolution & \(5\times 5\) & LeakyReLU & Y & 0.5 & 16 \(\times\) 16 \(\times\) 128 \\ \hline
3 & Convolution & \(5\times 5\) & LeakyReLU & Y & 0.5 & 8 \(\times\) 8 \(\times\) 256 \\ \hline
4 & Convolution & \(5\times 5\) & LeakyReLU & Y & 0.5 & 4 \(\times\) 4 \(\times\) 512 \\ \hline
5 & Linear & Sigmoid & Y & & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The architecture of WLgenerateNet (stride = 2). is also very difficult to collect such a large dataset, due to the labor and economic costs. To effectively carry out the training of WLdetectNet, we opt to build our own dataset on waterline segments in a simple and economical manner, which involves the following two processes. (1)Manually gathering original data satisfying the structural layout of WLpeephole  
We first gather 2000 image patches containing diverse waterline segments by manually cropping from surveillance videos associated with an inland waterline, then resize them to be consistent with the structural layout of WLpeephole, especially compelling their waterline segments to display only in a smaller scope identical to the recognizing field \((s\times s)\) of WLpeephole. Figure 3 shows such a group of exemplars including 16 image patches. In practice, these gathered image patches come from varied scenarios including dissimilar weather conditions and different illumination conditions, so that the diversity of these samples is helpful for enhancing the perceptive ability of WLpeephole to detect various waterline segments, thus improving the generalization ability of WLdetectNet. (2)Automatically generating artificial data on waterline segments for data augmentation  
It is common knowledge that one of the best ways to improve the performance of a deep learning model is to add more data to its training set. However, due to labor and economical costs, it has been proved to not be an easy thing to hunt for plentiful labeled data on waterline segments. Thus, aside from manually gathering more such samples that are representative of distinct waterline segments, we also attempt to augment the labeled data we already have by means of WLgenerateNet. Specifically, we make advantage of WLgenerateNet to automatically generate more artificial data on waterline segments (almost 8000 image patches at present) from the existing manual dataset (i.e., 2000 image patches).