# Ship Detection from X-Band SAR Images Using M2 Det Deep Learning Model
## 4 Results  
### SAR Preprocessing Result  
First, the SAR image was converted into decibels through decibel conversion, thereby converting the distribution of values to a normal distribution. Figure 5 shows a magnetized intensity image of the red box in Figure 1e (1). Figure 5 depicts an intensity decibel image converted from Figure 5 using Equation (4). Figure 5,d shows the histograms of Figure 5,b, respectively. As illustrated in Figure 5, the SAR image showing the Rayleigh distribution shows a normal distribution through the decibel conversion. Furthermore, before the decibel conversion, the distribution band of the values was widely distributed from tens of thousands to hundreds of thousands, but after the decibel conversion, the distribution band was significantly narrowed down to tens. Because of these changes, it can be expected that the weights will be learned in a balanced way during the training process [35]. After a decibel image was created, median filtering and multi-looking were performed to reduce speckle noise in the image. To prevent the disappearance of small ships owing to their small number of pixels and median filtering, the size of the median filter was selected to be \(3\times 3\), which is the minimum size. Moreover, to prevent a ship from becoming a dot owing to its small size, only two looks were performed in the range and azimuth directions. Figure 6 shows the effect of speckle noise reduction by using a median filter and multi-looking. Figure 6a,b shows an intensity decibel image before and after speckle noise reduction, respectively. Furthermore, Figure 6c,d show the histograms of Figure 6a,b, respectively. The difference is barely noticeable because the size the median filter was \(3\times 3\). However, as shown in Figure 6d, it can be observed that the noise components of the sea surface are reduced by speckle noise reduction. Figure 5: (**a**) Magnified intensity image of the red box in Figure 1e (1); (**b**) intensity decibel image of (**a**); (**c**) histogram of (**a**); (**d**) histogram of (**b**). Figure 6: (**a**) Magnified intensity decibel image of the red box in Figure 1e2; (**b**) the same image with reduced speckle noise; (**c**) a histogram of (**a**); (**d**) a histogram of (**b**). Subsequently, land masking was performed using the DEM with a resolution of 30 m. However, because some artifacts, such as bridges built after the DEM were created, do not appear in the DEM, the artifacts cannot be eliminated. To cover these area, we added buffer area at the edge of DEM. The DEM and the SAR image were matched using the intensity cross-correlation and then overlapping areas were removed (Figure 7). Images were normalized after masking the land in the SAR image. After this, sea surface images were generated from the normalized images. If median filters are applied more than twice the size of a ship, the shape of the ship will almost disappear in the images and only the smoothed sea surface remains [33]. Therefore, the size of the filter must be determined by considering the size of the ships [33]. In the images used in this study, the size of the ship was about 10 to 40 pixels. Therefore, we designed the filter with a size of 81 \(\times\) 81 based on the largest ships. Figure 8a-c shows the normalized images, and Figure 8d-f shows the sea surface images generated through median filtering from Figure 8a-c, respectively. As shown in Figure 8d-f, it can be observed that only the shape of the sea surface remained in the sea surface image, and very little influence from the ship was found. Simple difference and RMSD calculations were performed using normalized intensity images and sea surface images to generate intensity difference images and texture images. Figure 9a,b shows the intensity difference image and the texture image, respectively, and Figure 9c,d depicts the histograms of Figure 9a,b, respectively. The red boxes in Figure 9c,d indicate the distribution band of ship pixel values.