## 3 Materials and Methods
### Balanced Positive and Negative Data Enhancement  
In the initial experiments with ship targets on SAR images, detection errors often occurred. Specifically, there were two kinds of errors: when there was a target, but there was no detection or missed detection (Figure 2a), and when no target was present (Figure 2b), but a target was detected (false detection). Statistical analysis of these error types found that the latter outweighed the former. We analyzed the causes of the above two types of error. Most of the area in the images was land or ocean, and the detection target represented a very small part. During detection training, all oceans and land were negative samples for ship target detection. Positive samples, on the other hand, only accounted for a very small proportion of the images. To obtain the ideal detection rate, it is necessary to increase the proportion of positive samples in the training data, that is, to increase the number of ship targets in the images. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Relative** & **Relative** & **Absolute** & **Absolute** \\  & **Len Error (\%)** & **Wid Error (\%)** & **Len Error (m)** & **Wid Error (m)** \\ \hline VH & 8.13 & 32.43 & 15.63 & 9.77 \\ VV & 7.33 & 41.10 & 14.22 & 11.51 \\ Average & 7.73 & 36.77 & 14.93 & 10.64 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Preliminary extraction results (Reprinted from Ref. [5]). Figure 2: Common errors in ship target detection: (a) missed ship target; (b) false ship target. When performing data enhancement, it is necessary to consider the balance of positive and negative samples and the characteristics of ship targets in SAR images. Ship targets have distinct characteristics:
* Ship targets only appear in the open sea or near shore. * In a large area of sea, ships have a fixed travel route. The common routes include relatively dense ship traffic near the coast, straits, and seaports. Furthermore, in a vast region of the sea, ships have a higher probability of appearing near the travel route. * Unlike natural images, the targets not only account for a small proportion in the picture but also have a small target size. According to the characteristics of the SAR image acquisition sensor, the target size has a certain distribution interval. When the data enhancement method addresses the above points, it is possible to train a feature detector that is suitable for SAR ship targets and ensures the balance of positive and negative samples. Based on the characteristics of SAR image data, two kinds of data enhancement were carried out. * Method 1: Enhancement of target data based on statistical analysis. In this method, the appearance of ships is counted, and regional enhancements are performed. In some characteristic sea areas, such as locations close to land and between straits, ship targets are more likely to appear. First, the locations where the target ships appear in the SAR image are counted; then, the ship targets in the sea areas where there are many ships in the sea area are enhanced, thus increasing the number of ship targets and the number of positive samples. * Method 2: Data augmentation based on statistical analysis of target size. When the ship target is added, it cannot be similar to the target enhancement method of natural images, and random scale transformation cannot be carried out. Targets that are too large or too small do not meet the characteristics of ship targets. Therefore, when performing data enhancement, the size of the target is considered by referring to the size of real targets before performing new target enhancement. The overall data augmentation process is as follows:  
In the first step, we count the value distribution in the prelabeled data frame to determine whether there is a ship. Then, we randomly select a small area and determine whether the value of this part is a composite ocean through the previous statistical analysis value. If compounded, the marked objects will be filled and marked.