**1. Introduction**

With the development of sonar imaging technology, the underwater sonar image detection technology has been extensively used in marine exploration, research, and investigation [1]. The underwater sonar image must be detected in different regions including object-highlight, sea-bottom-reverberation, and shadow before the underwater object can be recognized. [2]. With the help of the underwater sonar image detection technology, we can accurately detect the above regions and effectively retain the underwater sonar image details [3]. However, because of the complexity of the underwater environment, the underwater sonar image is easily affected by the reverberation effect, strong speckle noise, fuzzy edge, and weak texture information [4]. Therefore, before the underwater sonar image detection, the denoising algorithm can be adopted to maximize noise removal.

The spatial-based method has been widely used in image processing. For cartoon components in the image fusion method, a proper spatial-based method is presented for morphological structure preservation [5]. To mitigate the boundary seams produced by spatial domain methods, a non-local means filtering is introduced on the final decision maps to generate the fusion weight maps for each of the source images [6]. In the image denoising method, the spatial information mainly includes local spatial information and non-local spatial information. Compared with the disadvantage that local spatial information only uses a single neighborhood information, non-local spatial information can utilize multiple similar neighborhood information in subregions. Therefore, the non-local spatial information makes full use of the image, which is more conducive to image denoising. The filtering degree parameter is a significant parameter. It is intensively related to denoising results [7]. The relatively large filtering degree parameter will cause the loss of some image detail information, especially the image edge information. On the contrary, the relatively small filtering degree parameter will mean that the image noise cannot be effectively eliminated. Therefore, how to select the appropriate filtering degree parameter is a challenging problem. To select the appropriate filtering degree parameter, a selection method based on the image noise level was proposed. In this method, filtering degree parameters were a single value [8]. In order to get over the disadvantage that the single filtering degree parameters are sensitive to the noise, another selection method on the basis of the statistical characteristic in the search window was proposed [9]. However, when the search window is small, the denoising ability of the non-local spatial information will be greatly reduced. Furthermore, the idea of threshold was introduced to remove the abnormal parameters and select the appropriate filtering degree parameters [7]. Nevertheless, the two thresholds are fixed values and only refer to one underwater sonar image. Different underwater sonar images have different filtering parameter distribution characteristics. Therefore, in some cases, the relatively large and small filtering degree parameters cannot be effectively removed.

Various techniques are widely used in the underwater sonar image detection. The Fuzzy clustering algorithm is used for underwater sonar image detection [10]. However, this detection algorithm is susceptible to noise. The Markov algorithm is proposed for underwater sonar image detection [11,12]. Although the detection results were satisfactory, the processing procedure was quite complicated and computationally costly. Later, a promising and multiphase detection framework related to the level set was developed [13], the key idea of which was to minimize the energy with the local mean. However, this framework was not suitable for the detection of underwater sonar images in the presence of speckle noise. To obtain better detection results, a large number of improved algorithms were proposed. Active contours were introduced in the level set method [14,15]. In this case, Markov random field and the level set are combined to extract the features from the underwater sonar image [2]. The morphological top-hat and bottom-hat transformation were used in the level set [16]. It is conducive to the extraction of underwater objects. Subsequently, an adaptive initialization narrowband Chan-Vese model is proposed and applied to underwater sonar image detection [1].

Over the years, as a framework to solve complex problems, cultural algorithm (CA) is attracting more and more attention [17]. Meanwhile, the intelligent optimization algorithm is also widely used in image processing [18,19] and has achieved good results. In order to further enhance the search ability, many intelligent optimization algorithms are used to improve the cultural algorithm. For accurate selection of business partners, a cultural particle swarm optimization algorithm (CPSO) was proposed can get better options [20]. Quantum-behaved particle swarm optimization (QPSO) was introduced into CA to figure out multi-objective optimization problems [21], which has high efficiency. Then, an adaptive cultural algorithm with improved quantum-behaved particle swarm optimization (ACA-IQPSO) was proposed to solve the problem of the underwater sonar image detection [22], which accurately completes underwater object detection by searching clustering centres. However, because the clustering centres are randomly initialized in the solution space, the situation when the clustering centres are very close can occur to some extent. Therefore, the convergence speed of the algorithm is too slow to complete the underwater sonar image detection accurately within small epochs.

A clustering algorithm is proposed to calculate the clustering centres by the potential entropy of the data field [23]. The comparative experiments have shown that this algorithm can get better clustering results. Nevertheless, it does not take the characteristics of underwater sonar images into account when calculating potential entropy, which is not conducive to the initialization of the clustering centres in the underwater sonar images.

In order to reduce the complexity of the algorithm and enhance the search ability in the process of detection, the idea of the shuffled frog leaping algorithm (SFLA) is used as the belief space update strategy in ACA-IQPSO. However, SFLA is easy to get into the local optimal solution. To make the population more diverse and improve the search ability, Quantum computing theory is used to improve SFLA [24]. A quantum-inspired shuffled frog leaping algorithm combining the new search mechanism (QSFLA-NSM) is proposed to the underwater sonar image detection [7]. The experimental results of QSFLA-NSM show that it can further enhance population diversity and search ability.

To overcome the drawback of two thresholds in work [7], in this work we proposed an adaptive non-local spatial information denoising method based on the golden ratio. Two thresholds are set adaptively according to the golden radio. Then, NACA is proposed in this paper to accurately detect underwater sonar image. The improvement of the detection algorithm focuses on two aspects: Firstly, inspired by the idea of data field and entropy [23], the AIA-DF is adopted to more accurately calculate the initialization of the clustering centres in this paper to enhance convergence efficiency. The AIA-DF can automatically extract the optimal value of threshold by using the potential entropy of data field from the underwater sonar images dataset. Subsequently, the threshold from the data field can adaptively initialize the clustering centres. Secondly, in the belief space, to improve the limitations of the update strategy, a new update strategy is used to update the cultural individuals in terms of QSFLA.

#### **2. Non-Local Spatial Information Denoising Method**

#### *2.1. Non-Local Spatial Information*

The underwater sonar image is represented as *X* = {*x*1, *x*<sup>2</sup> ··· , *xn*}, *n* is the total number of pixels. *xi* is the *i*th pixel. *xi* is the non-local spatial information of *xi* and can be expressed as:

$$\overline{X\_i} = \sum\_{p \in \mathcal{W}\_i''} w\_{ip} x\_p \tag{1}$$

where *W<sup>r</sup> <sup>i</sup>* represents the search window, its centre is *xi* and the radius is *r*. *wip* and *zi* can be calculated by:

$$w\_{ip} = \frac{1}{Z\_i} \exp\left(-\left\|\mathbf{x}(N\_i) - \mathbf{x}(N\_p)\right\|\_{2,\rho}^2/h\right) \tag{2}$$

$$Z\_i = \sum\_{p \in \mathcal{W}\_i^r} \exp\left(-\left\|\mathbf{x}(N\_i) - \mathbf{x}(N\_p)\right\|\_{2,p}^2/\hbar\right) \tag{3}$$

where *Ni* is the neighborhood window, its centre is the *xi* and the radius is *s*. *x*(*Ni*) is the vector and represents all the pixels in *Ni*. *h* is the filtering degree parameter. *x*(*Ni*) − *x* - *Np* 2 2,*ρ* is defined as:

$$\left\|\mathbf{x}(N\_{i})-\mathbf{x}\left(N\_{p}\right)\right\|\_{2,\rho}^{2} = \sum\_{q=1}^{\left(2s+1\right)^{2}} \rho^{(q)}\left(\mathbf{x}^{(q)}(N\_{i})-\mathbf{x}^{(q)}\left(N\_{p}\right)\right)^{2} \tag{4}$$

where *x*(*q*)(*Ni*) is the *q*th pixel in *x*(*Ni*).

*ρ*(*q*) can be presented as:

$$\rho^{(q)} = \sum\_{t=\max\left(d,1\right)}^{s} \frac{1}{\left(2t+1\right)^{2}s} \tag{5}$$

$$d = \max\left( \left| y\_q - s - 1 \right|, \left| z\_q - s - 1 \right| \right) \tag{6}$$

where *yq* = mod(*q*,(2*s* + 1)), *zq* = *floor*(*q*,(2*s* + 1)) + 1. - *yq*, *zq* represents the coordinates of the *q*th dimension in *Ni*.

#### *2.2. Our Proposed Denoising Method—An Adaptive Non-Local Spatial Information Denoising Algorithm Based on the Golden Ratio*

*h* is a significant parameter. Its value can powerfully impact the weight of neighborhood configuration in Equation (2) and Equation (3). Therefore, *h* is closely related to the denoising result in the non-local spatial information denoising method. In the process of denoising, too large *h* will cause missing the image detail information. Meanwhile, too small *h* will reduce the denoising performance of non-local spatial information.

In our previous work [7], to select the appropriate *h*, two thresholds *hmin* = 0.01 and *hmax* = 0.05 were set to remove the inappropriate *h*. Experimental results showed that this method can effectively remove noise and had certain adaptability. However, it is found that different underwater sonar images have different *h* distribution characteristics. The two thresholds *hmin* = 0.01 and *hmax* = 0.05 are determined only based on one sonar image. In other words, we use the same thresholds for different underwater sonar images denoising. It obviously has limitations.

Although the distribution characteristics of *h* in the different underwater sonar images are different, further experiments show that the proportion of appropriate *h* in the total *h* is approximately the same, which satisfies the golden ratio within a certain error. Based on this discovery, in this paper, we propose an adaptive non-local spatial information denoising method based on the golden ratio which realizes two threshold adaptive settings and removes the underwater sonar image noise more effectively. The statistical law that the proportion satisfies is investigated on 20 different underwater sonar images by calculating the proportion of the *h* within two thresholds in the total *h*. Owing to space constraints, we only show partial results from 20 sonar images. Figures 1–6 show the estimated values of the optimal thresholds based on different underwater sonar images.

g

**Figure 1.** The estimated values of the optimal threshold (image size: 277 × 325): (**a**) Original sonar image; (**b**) The estimated values of the optimal threshold.

**Figure 2.** The estimated values of the optimal threshold (image size: 173 × 167): (**a**) Original sonar image; (**b**) The estimated values of the optimal threshold.

**Figure 3.** The estimated values of the optimal threshold (image size: 197 × 211): (**a**) Original sonar image; (**b**) The estimated values of the optimal threshold.

**Figure 4.** The estimated values of the optimal threshold (image size: 205 × 201): (**a**) Original sonar image; (**b**) The estimated values of the optimal threshold.

**Figure 5.** The estimated values of the optimal threshold (image size: 130 × 106): (**a**) Original sonar image; (**b**) The estimated values of the optimal threshold.

**Figure 6.** The estimated values of the optimal threshold (image size: 146 × 135): (**a**) Original sonar image; (**b**) The estimated values of the optimal threshold.

As seen from Figure 1b, Figure 2b, Figure 3b, Figure 4b, Figure 5b, and Figure 6b, different underwater sonar images have different distribution characteristics of *h*. This means that the estimated optimal thresholds are different. A linear fitting method is used to calculate the proportion satisfies based on different underwater sonar images.

For each underwater sonar image, the set of total *h* is defined as *H* = {*hi*|*i* ∈ *NU* }, *hi* is the filtering degree parameter corresponding to the *i*th pixel, *NU* is the number of the total pixels on the underwater sonar image. The set of *h* within two thresholds is defined as *H* = {*hi*|*i* ∈ *NU* ∧ *hi* ≥ *hmin* ∧ *hi* ≤ *hmax* }. The ratio of the cardinality of *H* to the cardinality of *H* is defined as:

$$\eta = \frac{\text{card }H\prime}{\text{card }H} \tag{7}$$

Table 1 shows the estimated optimal threshold and *η* of 20 different underwater sonar images.


**Table 1.** The estimated optimal threshold and *η* of 20 different underwater sonar images.

**Figure 7.** The result of the linear fitting based on Table 1.

The fitting curve is *y* = 7.14*e* − 06*x* + 0.613 in Figure 7. It demonstrates that *η* is approximately distributed in the vicinity of 0.613. The statistical law that the proportion satisfies is the golden radio within the range of error permitting. Two thresholds are set adaptively according to the golden ratio to remove too large and small *h*. On this basis, an adaptive non-local spatial information denoising method based on the golden ratio is proposed in this paper to effectively improve the denoising performance.

This is set that *h* less than *hmin* is defined as *H*<sup>1</sup> = {*hi*|*i* ∈ *NU* ∧ *hi* ≤ *hmin* } and that *h* larger than *hmax* is defined as *H*<sup>1</sup> = {*hi*|*i* ∈ *NU* ∧ *hi* ≥ *hmax* }. On this basis, the ratio of the cardinality of *H*<sup>1</sup> to the cardinality of *H* is defined as *η*<sup>1</sup> = *card H*<sup>1</sup> *card H* . The ratio of the cardinality of *H*<sup>2</sup> to the cardinality of *H* is defined as *η*<sup>2</sup> = *card H*<sup>2</sup> *card H* . Comparing *<sup>η</sup>*<sup>1</sup> and *<sup>η</sup>*<sup>2</sup> with <sup>1</sup>−*<sup>η</sup>* <sup>2</sup> , when the value exceeds the range of error permitting, the two thresholds are constantly updated by the dichotomy. The update process is not finished until the experiment result simultaneously satisfies *η*<sup>2</sup> <sup>−</sup> <sup>1</sup>−*<sup>η</sup>* 2 <sup>≤</sup> *<sup>ε</sup>* and *η*<sup>1</sup> <sup>−</sup> <sup>1</sup>−*<sup>η</sup>* 2 <sup>≤</sup> *<sup>ε</sup>*. *<sup>ε</sup>* is the range of error permitting. The result of two adaptive thresholds is respectively defined as *Ahmin* and *Ahmin*.

For the *i*th pixel in the sonar image, *hi* is defined as:

$$h\_i = \begin{cases} Ahmin & lmu\_i \le A lmim \\ Ahmax & lmu\_i \ge A lmmax \\ lmu\_i & \text{otherwise} \end{cases} \tag{8}$$

$$\text{Min}\_{i} = \max\_{p \in \mathcal{W}\_{i}^{r}} \left\{ \left\| \mathbf{x} \left( \mathbf{N}\_{\bar{j}} \right) - \mathbf{x} \left( \mathbf{N}\_{p} \right) \right\|\_{2,p}^{2} \right\} \tag{9}$$

The adaptive non-local spatial information denoising method based on the golden ratio is described in Algorithm 1.

#### **Algorithm 1: the proposed denoising method**


#### 13: Calculate non-local spatial information *x* using Equation (1).

### **3. Culture Algorithm**

#### *3.1. Cultural Algorithm Framework*

The bilevel evolutionary mechanism in the cultural algorithm mainly includes three elements: the population space, the belief space, and the communication protocol. The communication protocol consists of influence function and accept function. The population space and the belief space are two relatively independent evolutionary and update processes. However, they rely on the influence function and accept function to communicate with each other, manage relevant information, and guide the evolution and update of space. The important feature of the cultural algorithm is the introduction of belief space. The individual evolutionary experience in the population space can be transferred to the belief space by the accept function. The belief space transforms advanced experience into knowledge through certain rules. The knowledge in the belief space guides the evolution of the population space towards a more accurate direction through the influence function. Figure 8 shows the schematic diagram of CA.

**Figure 8.** Schematic diagram of CA (cultural algorithm).

#### *3.2. Our Proposed Cultural Algorithm—A New Adaptive Culture Algorithm*

In our previous work [22], we proposed an adaptive cultural algorithm with improved quantum-behaved particle swarm optimization (ACA-IQPSO) and applied it to the underwater sonar image detection. In the population space, to enhance the search ability of the ACA-IQPSO, we introduced the IQPSO as the evolution strategy. In the belief space, we adopted a new update strategy based on the idea of SFLA. Situational knowledge, normative knowledge, and domain knowledge were selected to form the knowledge structure. A new communication mechanism was designed to make better use of the information in the population space and belief space. Experimental results show that ACA-IQPSO has better searching ability and convergence efficiency.

However, we found that ACA-IQPSO could not obtain good initial clustering centres, and the update strategy of the belief space easily gets into the local optimal solution. Therefore, the convergence ability of ACA-IQPSO needs to be improved and the efficiency of underwater sonar image detection is reduced.

Therefore, in order to complete the underwater sonar image detection more accurately in shorter iterations, NACA is proposed for the underwater sonar image detection. NACA has two improvements over ACA-IQPSO. To begin with, inspired by the idea of data field and maximum entropy [23], we propose an adaptive initialization algorithm based on data field (AIA-DF) for underwater sonar image detection. AIA-DF is used in the population space to more accurately find the initial clustering centres. Secondly, in our previous work [7], we proposed QSFLA-NSM for the underwater sonar image detection. Experimental results show that compared with SFLA, QSFLA-NSM has stronger search ability. Therefore, we propose a new update strategy in the belief space based on the idea of QSFLA-NSM.
