# SBNN: A Searched Binary Neural Network for SAR Ship Classification
## 4 Experiments
### Experimental Details  
#### 4.2.1 Training  
To improve the learning with a small data set size, we apply a data augmentation policy including random cropping and random horizontal flipping to expand the diversity of data. The inputs of SBNN share a same shape of \(1\times 100\times 100\), where 1 indicates VV or VH polarization. OpenSARShip dataset provides uint8 files, which have been processed and generated from SAR products with related automatic identification system information. Compared with prior studies using PCA or a sub-network in data pre-processing, SBNN requires a much easier data pre-processing where only center cropping and resizing are employed. Considering the targets are surrounded by a large area of clear background, each sample is processed as follows. In the three categories classification task, targets share a similar size. To reduce the distortion effect of resizing, targets larger than \(128\times 128\) are center-cropped to \(112\times 112\), and targets smaller than \(112\times 112\) are resized to \(112\times 112\). In the six-categories dual-polarization classification task, targets are lying on a large range of size, which means the distortion effect of resizing is obvious and unavoidable. All targets are resized to \(128\times 128\), and then center-cropped to \(112\times 112\). Notice that the data pre-processing provides a size of \(112\times 112\) which is slightly larger than the input of SBNN. This size is instrumental in applying the data augmentation policy, where random cropping produces data with a size of \(100\times 100\). With reference to AdamBNN [27] about training binary networks, we use a distillation learning [40] method to train the weights in SBNN. Binary networks have a low learning capability, which means direct training with the cross-entropy loss and hard labels could \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Ship Category** & **All Samples** & **Training Samples** & **Test Samples** \\ \hline Bulk Carrier & 333 & 100 & 233 \\ Cargo & 671 & 100 & 571 \\ Container Ship & 573 & 100 & 473 \\ Fishing & 125 & 100 & 25 \\ General Cargo & 142 & 100 & 42 \\ Tanker & 242 & 100 & 142 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The sample numbers of each category in the six categories SAR Dual-Polarization ship classification. Figure 6: SAR ship samples in OpenSARShip. result in poor performance. The soft label generated by floating-point networks can help the learning of binary networks. When training [PERSON], the floating-point network, which acts as a teacher, is the searched CNN by PC-DARTS, the prototype of SBNN. The initial channel number of the teacher is 8 and the cell number is 8. [PERSON] is the student and trained with the KL divergence loss which can be computed as below:  
\[\mathcal{L}=-\frac{1}{b}\sum_{\text{class}}\sum_{i=1}^{b}P_{\text{class}}^{ \text{float}}(x_{i})\text{log}(\frac{\text{c}_{\text{class}}^{\text{binary}}(x _{i})}{\text{c}_{\text{class}}^{\text{float}}(x_{i})}) \tag{6}\]  
where: \(b\) is the batch size, class indicates the category of a sample, \(P\) is the SoftMax output of the floating-point network or the binary network. In this paper, Adam optimizer [41] updates the weights in SBNN. To be specific, the weight decay for the convolution and linear layers is set as 0. The weight decay for other learnable parameters, such as the weights in Batch Normalization, is set as \(1\times 10^{-5}\). Training has two stages. Each stage has 256 epochs, a batch size of 32 and a base learning rate of 0.001. We apply a linear scheduler to change the learning rate during training, the specific learning \(lr_{ep}\) for each epoch can be calculated as:  
\[lr_{ep}=0.001\times(1-\frac{ep}{256}) \tag{7}\]  
where: \(ep\) denotes the number of trained epochs. In the first stage, all binary convolutional operators are replaced by the floating-point convolutional operators. The network learns the distribution of feature maps.