# Saliency Guided DNL-Yolo for Optical Remote Sensing Images for Off-Shore Ship Detection
## 2 Methodology
### Saliency Detection for Different Scenes  
Due to the salient characteristics of ship targets in the ocean background, we perform saliency detection on image blocks to enhance the recognizability of ship targets. Ideally, we can perform good saliency detection on all images in different scenes using only one algorithm. However, the interference of clouds and sea waves makes this impossible. Therefore, we used different methods to process image blocks in different scenes. (i) Cloudless scene: the SR algorithm is used to extract the saliency map and the mean filter parameter is set to 200 \(\times\) 200. (ii) Thin cloud scene: the above-mentioned saliency algorithm is repeated twice. The mean filter parameter is set to 400 \(\times\) 400. (iii) Scattered cloud scene: the HC algorithm is used to extract the scattered cloud area and remove it. Then we used the SR algorithm to detect the salient object. The mean filter parameter is set to 400 \(\times\) 400. (iv) Thick cloud scene: first, the CASD algorithm is used to detect the salient regions of the original image, and then the SR algorithm is used for a second detection. The mean filter parameter is set to 400 \(\times\) 400. All images initially used median filtering to eliminate noise. Figure 3: Marine scene classification algorithm based on density peak clustering. First, the grayscale curves of different marine scene sub-blocks are employed as the input of DPC algorithm. Then, these sub-blocks automatically gather to form 5 clusters, representing that marine scenes are classified into five categories. **Spectral residual algorithm. ** This method is mainly implemented in the frequency domain. First, the image is transformed into the frequency domain through Fourier transform, and the amplitude spectrum and phase spectrum are calculated. \[a=A(\mathfrak{F}(x)) \tag{5}\]  
\[p=P(\mathfrak{F}(x)) \tag{6}\]  
where \(\mathfrak{F}\) represents the Fourier transform. \(A\) and \(P\) represent the acquisition of the amplitude spectrum and the phase spectrum, respectively. Then the logarithm of the amplitude spectrum is filtered through the linear space. Then, we calculated the difference between the two to obtain the spectrum residual. \[l=\log(a) \tag{7}\]  
\[r=l-h*l \tag{8}\]  
where \(h\) represents the mean filtering, and r represents the calculated spectral residual. Finally, the spectral residual and phase spectrum are transformed to the space domain through inverse Fourier transform, and the saliency result map is obtained through linear filtering. \[s=h*\mathfrak{F}^{-1}[exp(r+p)]^{2} \tag{9}\]  
**Context-aware algorithm. ** This method is mainly implemented according to four major principles: local low-level considerations, global considerations, visual organization rules, and high-level factors. At the beginning, we divided the image into multiple blocks, and then we compared the block \(P_{i}\) corresponding to \(i\) with all other blocks \(P_{j}\) in the lab color space. If the \(P_{i}\) block has a large distance from other blocks, it is a salient block. In addition, the saliency areas are mostly clustered, thus the distance between the small blocks is relatively close. The calculation formula is as follows:  
\[d\big{(}p_{i},p_{j}\big{)}=\frac{d_{c}\big{(}p_{i},p_{j}\big{)}}{1+c\cdot d_{ p}\big{(}p_{i},p_{j}\big{)}} \tag{10}\]  
where \(d_{c}\) is the Euclidean color distance of the two image blocks in Lab space, and \(d_{p}\) is the Euclidean position distance. For the \(p_{i}\) block, if the difference from any \(p_{j}\) block is large, it is considered a salient block. Hence, the first \(N\) (usually 65) image blocks with the smallest distance to \(p_{i}\) can be obtained. By calculating the difference between them and \(p_{i}\) block, the saliency formula is defined as follows:  
\[s_{i}=1-\exp\left\{-\frac{1}{n}\sum_{n=1}^{N}d(p_{i},q_{n})\right\} \tag{11}\]  
Meanwhile, changing \(N\) can change the saliency area scale.