# Ship Detection from X-Band SAR Images Using M2 Det Deep Learning Model
## 3 Methods
### Training and Validation Method  
In this study, the M2 Det model was used for ship detection. Figure 4 shows the architecture of M2 Det. M2 Det uses a multi-level feature pyramid network (MLFPN) module to extract more fluent information from images. MLFPN consists of a thinned u-shape module (TUM), feature fusion module (FFM) and scale-wise feature aggregation module (SFAM) module. TUM utilizes various sizes of feature maps so that extract information from various size of objects efficiently. FFM concatenates features between TUMs and the backbone network to extract information from multi-levels. SFAM creates multi-level feature pyramid with features extracted from multi-level and multi-scale images. Lastly, M2 Det detects objects from the multi-level feature pyramid using the same anchor boxes as in SSD (Single Shot multibox Detector) [37] deep learning model. The aspect ratios of the anchor box for object detection in the existing M2 Det are \(\mathrm{a_{r}}\in\left\{1,2,3,\frac{1}{2},\frac{1}{3}\right\}\). However, because the long part of the ship is considerably longer than the short part, some ships may not be detected if the original ratio is used in the case of a ship. Therefore, in this study, \(\mathrm{a_{r}}\in\left\{1,2,3,5,7,\frac{1}{2},\frac{1}{3},\frac{1}{5},\frac{1} {7}\right\}\) were used by adding a longer ratio to the existing anchor box. In implementation details, we used RAdam optimization and batch size was 4. In the MLFPN, we used 6 scales and 8 levels--the same as [14]. In general, the object detection model detects objects using features extracted through the backbone network, and VGGNet, ResNet, and DenseNet are mainly used as the backbone networks [37; 38; 39; 40]. When VGGNet or ResNet is used as a backbone network, features of several layers are often fused to detect small objects [10; 41]. However, DenseNet utilizes all of the features from the previous layer in  
Figure 4: Architecture of M2 Det. MLFPN: multi-level feature pyramid network. each layer, it was found that the process of selecting a layer for feature fusion could be omitted and the features of the ships could be better extracted. Therefore, in this study, DenseNet was used as the backbone network of M2 Det. First, cross-validation was performed in each preprocessed dataset to get the best initial weight parameter. After set the initial weight, the deep learning model was trained using the entire training and validation set. When the entire training and validation set was used, six training processes were performed in each preprocessing method for choosing best learning rate, and the learning rate of each training was (0.005, 0.001, 0.0005, 0.0001, 0.00005, 0.00001). In addition, to increase robustness of the model, zoom in/out, cropping, and horizontal flipping were used, and values of all images were normalized to the [0, 1] range before being used. After the training is completed, the test results were expressed in terms of AP, precision, and recall. AP is the bottom area of the precision and recall graphs and can be expressed by the following equation:  
\[\int_{0}^{1}\mathrm{p(r)dr} \tag{3}\]  
where r indicates the recall and p(r) indicates the precision at each recall. Furthermore, the precision and recall are defined as follows:  
\[\mathrm{Precision}=\frac{\mathrm{TP}}{\mathrm{TP}+\mathrm{FP}} \tag{4}\]  
\[\mathrm{Recall}=\frac{\mathrm{TP}}{\mathrm{TP}+\mathrm{FN}} \tag{5}\]  
where TP is the number of events where the model predicted a true value as true, FN is the number of events where the model predicted a true value as false, and FP is the number of events where the model predicted a non-true value as true. Therefore, the precision represents the ratio of the number of actual true values to the number of true values that the model predicted as true, and the recall represents the ratio of the number of true values that the model predicted as true to the number of actual true values.