An Integrated Strategy toward the Extraction of Contour and Region of Sonar Images

: In this paper, an integrated underwater sonar image extraction strategy, which combines two improved methods, namely the level set method (LSM) and the Lattice Boltzmann Method (LBM), is proposed. First, sonar images are processed by a clustering method and a connected domain analysis to generate the target minimum rectangle frame. Next, the segmentation task is decomposed into two subtasks, namely a coarse segmentation task to obtain the initial contour and a ﬁne segmentation task after embedding the initial contour. Finally, the improved LSM is used to obtain the target contour, and the coarse contour of the segment is embedded into the LBM to obtain the region segmentation of the target in the sonar images. The main contributions of the paper are as follows: (1) The contours and regions of the sonar images are extracted simultaneously. (2) The original LBM method is enhanced to solve the level set iteration problem. (3) The region segmentation with the original image background is extracted, and a more intuitive region segmentation result than that of directly extracting the contour of the level set is achieved. Experimental results based on four evaluation indices of image segmentation show that our method is e ﬀ ective, accurate, and superior to other existing methods.


Introduction
Image segmentation is the key step from image processing to image analysis. In general, image segmentation methods can be summarized as threshold-based, region-based, edge-based, and some specific theory-based segmentation methods. These methods have their own characteristics. Image segmentation based on a threshold is simple and widely used, but it is difficult to obtain good segmentation when the image is complex. Most edge-based segmentation methods are applicable to the image with obvious edges. The edge segmentation results may have discontinuous edges, and it is highly desirable to obtain a continuous edge so as to obtain the overall contour of the target. In addition, there is a segmentation method based on neural networks, which requires a lot of image annotations and offline training. Unfortunately, there is no general sonar image data set that can support the training model.
Most of these image segmentation research object categories are optical or remote sensing images, and the research for underwater sonar image segmentation has always been a challenging problem. The correct segmentation of underwater sonar images is an important prerequisite for the development of seabed resources, underwater search and rescue, and the classification and recognition of seabed geology and other activities. Hence, it is highly important to study the segmentation of sonar images. At the same time, we notice that the contour information of a target is the most concise way to describe the target, among which the level set method (LSM) is used widely and has a great prospect.
The LSM in [1] is a kind of numerical technology for interface tracking and shape modeling. It is also robust to deal with noise images and has been applied in the field of image processing. By using Because the numerical scheme (such as the finite difference method) used in the LSM will limit the time step, the number of iterations in the LSM is large, and the calculation is complex. We notice that the LBM is a common method in physical hydrodynamics, which is rarely used in image segmentation. Furthermore, compared with other region segmentation methods, such as texture segmentation, it can be used for large-area classification problem like seabed topography. Threshold segmentation [27] can only present several gray-level block regions according to the selection of the threshold. There are also some examples of using filters [27] to segment images. These common classical region segmentation methods are more suitable for optical images [28]. In view of the uneven distribution and high noise of sonar images, we introduce the LBM to segment the region. It turns out that the LBM is suitable for the problem at hand as evidenced by the experimental results. Hence, we employed it in sonar image segmentation to observe the region segmentation of sonar images, embedded it in our level set initialization improvement algorithm, and obtained good results with a few iterations. Finally, the method shows the segmentation effect, including the original image background and the target, and it solves the problem that the segmentation effect is only the contour or the pure area extracted directly from the contour, which is conducive to a comprehensive observation of the target.
Since the pixels far away from the object contour are meaningless for obtaining the object boundary and will increase the computational load, the sonar image is coarsely segmented by removing the unnecessary background and shadow first. In this way, the number of evolution iterations and time can be saved. The minimum rectangular contour of the target in the sonar image, which can be embedded as the initial evolution curve of the level set, is accordingly obtained.
The main ideas of the proposed strategy are as follows: First, sonar images are processed by the clustering method and connected domain analysis [28] to generate the target minimum rectangle frame. The minimum bounding rectangle is embedded into the initialization process of the LSM (we termed the uniform operation as the cluster connected analysis), which is the precondition to generate a minimum bounding rectangle of the target in sonar images. The energy equation of the LSM is subsequently redesigned so as to eliminate the deviation caused by setting the initial contour randomly or manually. Next, the region segmentation of the sonar images can be combined with the LBM, which can be used to segment the target with an original background. This is beneficial to our overall observation. Finally, the information of the contour and the region of underwater sonar images is presented, and the objective of obtaining the region and contour information of the target in sonar images is achieved. Experimental studies show that the accuracy of segmentation is improved, and the number of iterations is reduced significantly by using the proposed method. The main contributions of this paper are as follows: (1) To overcome the shortcomings of traditional LSM, which needs a random setting or manual definition of an initial contour, the minimum bounding rectangle of the target domain can be embedded automatically as the initial contour of the level set. (2) The evolution accuracy is improved by dividing the sonar image segmentation into two subtasks, namely a coarse segmentation of the cluster connected analysis and a fine segmentation of the curve evolution. (3) The LSM and LBM are improved respectively and integrated; the former is applied to fine segmentation to obtain the target contour, while the latter is used to obtain the region segmentation of the target in sonar images.
The paper is organized as follows. Section 2 gives an overview of our framework, including the traditional level set model, the DRLSE model, and LBM. Section 3 introduces the proposed integration method and its theoretical knowledge in detail. In Section 4, experimental studies demonstrate that the performance of our method on synthetic, natural, and sonar images is superior. Concluding remarks are drawn in Section 5.

Preliminaries
As foreshadowed, the proposed strategy combines two classical methods, namely the LSM and LBM. To facilitate the understanding of the proposed strategy, the preliminaries pertaining to the LSM and LBM are reviewed here.

Traditional Level Set Model
This traditional level set model was proposed in [1]. Specifically, the singularity problem in the general equation of curve evolution, which is as follows, was solved in [1], where C represents a two-dimensional curve, t is the time, β denotes the normal component of the velocity of motion, V is the speed of motion, and N is the unit normal vector of a two-dimensional curve. The implicit expression of a planar closed curve C is used to extend it from the level set of a two-dimensional Cartesian coordinate function u(x, y): where the extension is made to the zero-level set of a three-dimensional continuous function u(t, x, y) surface, defined on the image as follows: where (x, y) denotes the image pixel. For any given contour curve, the level set function u(t, x, y) begins to evolve under the influence of the velocity field. The specific level set evolution function u can be expressed as follows: The above equation is the basic equation of the LSM for curve evolution, which depends on the image data and the level set function.

DRLSE Model
The DRLSE model in [11] was proposed by Li C. et al. Given that Ω is set as the image area and C(x, y) as the level set function defined on I, the energy function ε(C) of the DRLSE model is expressed as where the first item is the penalty item, and it guarantees the smoothness of the level set curve in the evolution process. The second item is the length item, and the third item is the area item. These items guide the evolution of the level set to the target boundary. The constants µ, λ, and v are the weighting coefficients for each energy term, while p (·) is the energy density function, ∇ is the gradient operator, δ(·) denotes the Dirac functions, and H(·) denotes the Heaviside functions. The edge stop function g(x, y) is defined as where G σ is the Gaussian kernel of the parameter σ, and I(x, y) is the image function. This DRLSE model sometimes fails to segment images in cases when either there is noise, the edge is not obvious, or the background is complex. As shown in Figure 1, the experiment on a simple image shows that the method segments the target successfully, but the target is not segmented effectively when replaced with a noisy image or an uneven gray-scale image. In addition, it should be highlighted that the sonar images in this paper are all public from the website. We set different initial modes by using traditional methods and may obtain different segmentation results, which makes the work of image segmentation difficult.
When we increase the number of iterations from 300 to 500, this also fails to segment the contour of the target correctly, implying that the DRLSE model is seriously affected by noise in an image.

Lattice Boltzmann Model
The Lattice Boltzmann method (LBM) has been used as an alternative to solve level set equations (LSE) recently [29]. Because of the simplicity of the algorithm and the implicit calculation of curvature, the height can be parallelized, which can handle time-consuming problems better.
The equation of the LBM evolution in [30] can be written as follows using Bhatnagar, Gross, and Krook collision models: Each link has its velocity vector ⃗ and a particle distribution ⃗, that moves along this link where ⃗ is the position of the cell, is the time, and represents the relaxation time of a fluid that determines the kinetic viscosity , and is a balanced particle distribution, which is defined as where to are constants, depending on the geometry of the lattice chain, denotes the macroscopic fluid density, and ⃗ denotes velocities calculated from the particle distribution: where is the discrete velocity distribution function, which represents the particle density when the velocity is .
In a typical diffusion calculation model case, the balanced function can be simplified as follows: We set different initial modes by using traditional methods and may obtain different segmentation results, which makes the work of image segmentation difficult.
When we increase the number of iterations from 300 to 500, this also fails to segment the contour of the target correctly, implying that the DRLSE model is seriously affected by noise in an image.

Lattice Boltzmann Model
The Lattice Boltzmann method (LBM) has been used as an alternative to solve level set equations (LSE) recently [29]. Because of the simplicity of the algorithm and the implicit calculation of curvature, the height can be parallelized, which can handle time-consuming problems better.
The equation of the LBM evolution in [30] can be written as follows using Bhatnagar, Gross, and Krook collision models: Each link has its velocity vector → e i and a particle distribution f i → r , t that moves along this link where → r is the position of the cell, t is the time, and τ represents the relaxation time of a fluid that determines the kinetic viscosity ϑ, and f eq i is a balanced particle distribution, which is defined as where A i to D i are constants, depending on the geometry of the lattice chain, ρ denotes the macroscopic fluid density, and → u denotes velocities calculated from the particle distribution: where f i is the discrete velocity distribution function, which represents the particle density when the velocity is e i . In a typical diffusion calculation model case, the balanced function can be simplified as follows: Our strategy uses D 2 Q 9 (2D with eight links in its neighbors and one link in its cell) cell structure of LBM. Figure 2 shows a typical D 2 Q 9 model [30]. The model has zero links 4/9, axial connections 1/9, and diagonal links 1/36 e relaxation time is determined by the diffusion coefficient , which is defined as The LBM can be used to solve a parabolic diffusion equation, which can be recovered by th lowing Chapman-Enskog expansion: In this case, external forces can be included in the LBM after the collision computation as d the LSE can be restored by replacing ρ with the sign distance function ∅.

. An Overview
To solve the aforementioned problems, we fix the initialization term and embed it in the initia ergy function of the level set, which is represented in the image as the minimum boundin tangle. We first apply the method of rectangle generation, which is a combination of cluste alysis and connected region analysis. Next, we start the evolutionary process. This strategy ca ercome the randomness of manual initialization. At the same time, we import the coarse contou the target into the LBM and apply it to the segmentation of sonar images. Finally, this integratio thod not only obtains the contour information of the underwater target, but it also obtains th ion segmentation with an image background. Finally, the accuracy and speed of targe The model has zero links A i = 4/9, axial connections A i = 1/9, and diagonal links A i = 1/36. The relaxation time τ is determined by the diffusion coefficient γ, which is defined as The LBM can be used to solve a parabolic diffusion equation, which can be recovered by the following Chapman-Enskog expansion: In this case, external forces can be included in the LBM after the collision computation as where → F is the body force. Thus, Equaction (13) becomes and the LSE can be restored by replacing ρ with the sign distance function Φ.

An Overview
To solve the aforementioned problems, we fix the initialization term and embed it in the initial energy function of the level set, which is represented in the image as the minimum bounding rectangle. We first apply the method of rectangle generation, which is a combination of cluster analysis and connected region analysis. Next, we start the evolutionary process. This strategy can overcome the randomness of manual initialization. At the same time, we import the coarse contour of the target into the LBM and apply it to the segmentation of sonar images. Finally, this integration method not only obtains the contour information of the underwater target, but it also obtains the region segmentation with an image background. Finally, the accuracy and speed of target segmentation can be improved greatly by our strategy.
The flow diagram of this framework is shown in Figure 3. By using the proposed strategy, the complexity and the computational load can be reduced significantly, and the segmentation accuracy of sonar images is improved greatly by combining the improved level set and LBM. By using the proposed strategy, the complexity and the computational load can be reduced significantly, and the segmentation accuracy of sonar images is improved greatly by combining the improved level set and LBM.

K-Means
Assuming that the input samples are S = x 1 , x 2 , . . . , x m where x 1 , x 2 , . . . , x m represent the number of objects in the sample, the algorithm steps are as follows: Given that the centers of K clusters are µ 1 , µ 2 , . . . µ k , and the number of samples in each cluster is N 1 , N 2 , . . . N k , the square error function is regarded as the following objective function [31]: For x i of each sample, we mark it as the category closest to the category center, and we have the following: We update the center of each category to the mean of all samples belonging to that category as follows: This function is a convex function about µ 1 , µ 2 , . . . µ k , and its stagnation point is calculated as follows: Repeat the next two steps until the category center changes less than a certain threshold. When the objective function reaches the minimum value, the iteration is stopped.
In our research, the clustering method is only a part of the simple application of coarse segmentation of sonar images. Hence, we chose the classical K-means clustering method, which can achieve fast coarse segmentation of images.
Since the K-means clustering only needs to play a role in the coarse segmentation of sonar images, our framework needs the number of clusters (K = 2) in K-means clustering. Figure 4 shows the core process of initial contour acquisition. The test image is transformed into its gray level, and the gray histogram of the image is presented. Through a large number of experiments in the early stage, aiming at the characteristics of sonar images in this paper, the binarization threshold is between 0.45 and 0.5.
Using this threshold, we can automatically extract a large connected area through the code to obtain the main body of the target.

Acquisition of Initialization Curve
In order to obtain an appropriate initial evolution curve, the minimum bounding rectangle is constructed. By using a cluster connected analysis of the sonar images, their coordinates are obtained and embedded. Because the target boundary is almost covered by the initial contour, the level set is defined as an inward evolution, which can be regarded as an appropriate initial evolution curve. The number of iterations is reduced using the initial evolution curve based on shape knowledge. Our sonar images can be represented by where is a normal number, is the image region, represents the area enclosed by the minimum initial rectangle contour at this moment (it should be noted that once the evolution begins, will continue to change until it reaches the desired edge), and is the minimum bounding rectangle after applying a cluster connected analysis of the sonar images. Table 1 shows the initial coordinate points generated after clustering connection. The pixels of the images we used have been normalized to 128 × 128.

Improved Energy Equation
In the fine segmentation, we embed the initial contour, which is obtained by our strategy in Figure 4, and the evolution equation is redesigned as follows:

Acquisition of Initialization Curve
In order to obtain an appropriate initial evolution curve, the minimum bounding rectangle is constructed. By using a cluster connected analysis of the sonar images, their coordinates are obtained and embedded. Because the target boundary is almost covered by the initial contour, the level set is defined as an inward evolution, which can be regarded as an appropriate initial evolution curve. The number of iterations is reduced using the initial evolution curve based on shape knowledge. Our sonar images can be represented by where d is a normal number, Ω 0 is the image region, I 0 represents the area enclosed by the minimum initial rectangle contour at this moment (it should be noted that once the evolution begins, I 0 will continue to change until it reaches the desired edge), and ∂I 0 is the minimum bounding rectangle after applying a cluster connected analysis of the sonar images. Table 1 shows the initial coordinate points generated after clustering connection. The pixels of the images we used have been normalized to 128 × 128.

Improved Energy Equation
In the fine segmentation, we embed the initial contour, which is obtained by our strategy in Figure 4, and the evolution equation is redesigned as follows: where F is the rate of evolution. Once the evolution begins, I 0 will be refreshed as the evolution contour continuously. The basic equation of curve evolution can be changed to where N is the unit normal vector of the two-dimensional curve, and the function β = N·V is the normal component of the velocity, which depends on the image data and the level set function. We verify the availability of our method on some the simple images and optical images given in Figure 5. It can be seen from Figure 5 that our improved LSM has been verified in both the simple and optical images successfully. In the next step, this method will be applied to some challenging sonar image segmentation and compared with some existing methods.

| |
where is the unit normal vector of the two-dimensional curve, and the function • is the normal component of the velocity, which depends on the image data and the level set function. We verify the availability of our method on some the simple images and optical images given in Figure 5. It can be seen from Figure 5 that our improved LSM has been verified in both the simple and optical images successfully. In the next step, this method will be applied to some challenging sonar image segmentation and compared with some existing methods.

Importing LBM
Region segmentation of the sonar images can be obtained by the LBM. Combined with our improved LSM, we can observe image contour and region segmentation with a background simultaneously so that we can analyze the segmentation results more comprehensively. There is a problem that needs attention when using the LBM. If the initial contour of the LBM is generated randomly, it can achieve good results in simple images, but it can hardly achieve correct segmentation in sonar images because the gray distribution of a general sonar image is uneven and contains much noise. Figure 6 shows a failed sonar image segmentation initialized in a random way by the LBM.

Importing LBM
Region segmentation of the sonar images can be obtained by the LBM. Combined with our improved LSM, we can observe image contour and region segmentation with a background simultaneously so that we can analyze the segmentation results more comprehensively. There is a problem that needs attention when using the LBM. If the initial contour of the LBM is generated randomly, it can achieve good results in simple images, but it can hardly achieve correct segmentation in sonar images because the gray distribution of a general sonar image is uneven and contains much noise. Figure 6 shows a failed sonar image segmentation initialized in a random way by the LBM. Original sonar images. The second row: Segmentation results of the random initial LBM. The third row: Color images of the second row. It can be seen that using the LBM to segment sonar images directly will lead to wrong segmentation.
Based on the problems in the above experiments, we propose a strategy that embeds the coarse contour of the improved level set evolution into the LBM as the initial evolution contour. Only a few iterations are needed to obtain the target region segmentation. In this paper, the rough contour of a sonar target is defined as . Next, the evolution energy function of LBM is written as where represents the relaxation time of the fluid that determines the kinematic viscosity : and is the equilibrium particle distribution, which is defined as where to are constants that are dependent on the geometry of the lattice chain; and and ⃗ are, respectively, the macroscopic fluid densities and velocities calculated from the particle distribution: For a typical diffusion calculation model, the equilibrium function can be simplified as follows:

Experimental Results and Analysis
This section is divided into five parts. In the first part, we compare the region segmentation results of our LBM with that of the random initial contour LBM to show the effectiveness of our method intuitively. The second part shows the initial contour generated by the cluster connected analysis. In the third part, we compare the final evolution curve of the improved level set with five other LSMs. The fourth part lists the number of iterations in a table. In the fifth part, four evaluation indices are used to evaluate our method and other parallel methods, and we analyze the accuracy and advantages of our strategy used in real images objectively and quantitatively.
It should be emphasized that the LBM is introduced into the region segmentation of images. Compared with the contour segmentation of the level set, the LBM can obtain accurate region Based on the problems in the above experiments, we propose a strategy that embeds the coarse contour of the improved level set evolution into the LBM as the initial evolution contour. Only a few iterations are needed to obtain the target region segmentation. In this paper, the rough contour of a sonar target is defined as u 1 . Next, the evolution energy function of LBM is written as where τ represents the relaxation time of the fluid that determines the kinematic viscosity ϑ: and f eq i is the equilibrium particle distribution, which is defined as where A i to D i are constants that are dependent on the geometry of the lattice chain; and ρ and → u are, respectively, the macroscopic fluid densities and velocities calculated from the particle distribution: For a typical diffusion calculation model, the equilibrium function can be simplified as follows:

Experimental Results and Analysis
This section is divided into five parts. In the first part, we compare the region segmentation results of our LBM with that of the random initial contour LBM to show the effectiveness of our method intuitively. The second part shows the initial contour generated by the cluster connected analysis. In the third part, we compare the final evolution curve of the improved level set with five other LSMs. The fourth part lists the number of iterations in a table. In the fifth part, four evaluation indices are used to evaluate our method and other parallel methods, and we analyze the accuracy and advantages of our strategy used in real images objectively and quantitatively.
It should be emphasized that the LBM is introduced into the region segmentation of images. Compared with the contour segmentation of the level set, the LBM can obtain accurate region segmentation directly with a few iterations in the case of an image background. This kind of region segmentation is more suitable for subjective observation, while the contour result of the level set is conducive to data evaluation. Even a simple contour can be used to train the shape characteristics of specific underwater objects, which is conducive to underwater object recognition and classification. This is also the reason why the two methods are used together in this paper. The information in sonar images is analyzed comprehensively and objectively from human visual subjective data.
Due to the limitation of having few sonar image data sets, most of the research on sonar image target extraction is a single data set. There is a data set including 8 sonar images in [23], which contains noise and nonuniform intensity sonar images, and the size and variance of those are given. This is a relatively comprehensive data set with description that we found. We use 11 sonar images with noise and uneven intensity. If compared with images of the same size, our image variance is larger and more challenging than the eight images in [23].
To demonstrate the effectiveness and efficiency of our method, we provide the mean and standard deviation of the 11 sonar images in Table 2. Through the data of Table 2 and real sonar images, we can see that the segmentation work is indeed challenging.

Comparison of LBM Evolution
The original LBM uses an automatically generated circle as the initial contour. Our Lattice Boltzmann evolution uses our proposed initial contour, which is embedded in the level set. It can be seen from Figure 7 that the segmentation of the first, sixth, seventh, and eighth images in the second and third rows respectively are not successful, and other segmentation effects are not ideal. This is due to the limitations of traditional methods and the diversity of our data set. However, in the actual task for sonar image segmentation, it is impossible to have all simple images. Hence, our data set is reasonable, and it is necessary to expand the diversity of the data set. If the improved method can be used in complex image segmentation, the effectiveness of our improvement method will be further shown.
The fourth to the fifth rows show our improved LBM segmentation. It can be seen that the segmentation results of our improved LBM are significantly improved compared with the original segmentation of the second to the third rows. The fourth to the fifth rows show our improved LBM segmentation. It can be seen that the segmentation results of our improved LBM are significantly improved compared with the original segmentation of the second to the third rows.  Figure 8 shows the initial contour generated by a cluster connected analysis. The core process of initial contour generation is shown in Figure 4.   Figure 8 shows the initial contour generated by a cluster connected analysis. The core process of initial contour generation is shown in Figure 4. The fourth to the fifth rows show our improved LBM segmentation. It can be seen that the segmentation results of our improved LBM are significantly improved compared with the original segmentation of the second to the third rows.  Figure 8 shows the initial contour generated by a cluster connected analysis. The core process of initial contour generation is shown in Figure 4.

Comparison of Level Set Evolution
As shown in Figure 9, we compared our level set method with other classical level set methods. In order to obtain a better segmentation effect for other methods, we manually selected the initial contour closer to the target than that which we automatically generated. It should be emphasized that the research work on LSM for sonar image segmentation is very rare. The important literature we have found are [22][23][24][25], but their work is devoted to the segmentation of three parts instead of removing the background and shadow. This is very different from our research purpose. Therefore, our comparative test does not include these recent studies.
By comparing the segmentation results in the visual observation images, we can see that our method is concise and clear in segmenting the contour of the target generally. Other traditional methods have great limitations in sonar image segmentation.
removing the background and shadow. This is very different from our research purpose. Therefore, our comparative test does not include these recent studies.
By comparing the segmentation results in the visual observation images, we can see that our method is concise and clear in segmenting the contour of the target generally. Other traditional methods have great limitations in sonar image segmentation. Figure 9. Segmentation of sonar images by the level set method. The first row: Original sonar images (1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11). The second row: Images generated after clustering analysis. The third row: Minimum initial contours generated by the connected domain analysis after removing the straggling points [32]. The fourth to the eighth rows: Comparative tests by using five traditional level set methods (Casells method, Chan Vese method, Lankton method, Li method, and Shi method.) The ninth row: Results of our improved level set method on sonar image segmentation. Figure 9. Segmentation of sonar images by the level set method. The first row: Original sonar images (1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11). The second row: Images generated after clustering analysis. The third row: Minimum initial contours generated by the connected domain analysis after removing the straggling points [32]. The fourth to the eighth rows: Comparative tests by using five traditional level set methods (Casells method, Chan Vese method, Lankton method, Li method, and Shi method.) The ninth row: Results of our improved level set method on sonar image segmentation.

Analysis of Number of Iterations
After intuitively analyzing the segmentation results, we compared and analyzed the number of iterations of the experiment here. Figure 10 lists the number of iterations of six LSMs and two LBMs respectively. The X-axis represents the test sonar image number for the experiment, and the Y-axis represents the number of iterations. The image sequence is the same as the first line in Figure 7. By analyzing the number of iterations for LSE, we can see that the average number of iterations set by our method are at the middle level, and the number of iterations of Lankton's method is significantly lower because the method itself is an experiment based on the local energy of an active contour. According to the corresponding image results in Figure 9, we can see that Lankton's method is not suitable for complex underwater sonar images because regardless of how many iterations we set, we will not get satisfactory results. Due to the fact that Shi's method emphasizes the real-time computation of the algorithm, which is a great advantage, our method is committed to accurately segmenting the contour and area of the target in the sonar image, which lays a solid foundation for subsequent research works. Because the sonar images we have chosen are diverse, we can increase the number of iterations properly in more complex images to obtain better segmentation results. This can be seen in Figure 10b. When we use our LBM strategy to segment regions, the number of iterations is greatly reduced. At the same time, we can conclude that the comparative test in part B of this section, i.e., our LBM region segmentation strategy, shows good segmentation results.

Performance Evaluation
We select several common evaluation indices (Dice, Jaccard, precision, and recall) for image segmentation [33] to evaluate the segmentation results. The three evaluation indices of Dice, precision, and recall involve the principle of confusion matrix [34]. The formula and schematic diagram are described in Figure 11.
segmenting the contour and area of the target in the sonar image, which lays a solid foundation for subsequent research works. Because the sonar images we have chosen are diverse, we can increase the number of iterations properly in more complex images to obtain better segmentation results. This can be seen in Figure 10b. When we use our LBM strategy to segment regions, the number of iterations is greatly reduced. At the same time, we can conclude that the comparative test in part B of this section, i.e., our LBM region segmentation strategy, shows good segmentation results.

Performance Evaluation
We select several common evaluation indices (Dice, Jaccard, precision, and recall) for image segmentation [33] to evaluate the segmentation results. The three evaluation indices of Dice, precision, and recall involve the principle of confusion matrix [34]. The formula and schematic diagram are described in Figure 11. The significance of the four evaluation indices is as follows: 1.
Dice coefficient: It is a set similarity measurement function, which is usually used to calculate the similarity of two samples (value range is [0, 1]). The larger the value is, the closer the results of the two samples are. It is given by the following:

2.
Precision: Represents the accuracy of the forecast results, given by 3.
Recall: Represents the comprehensiveness of the forecast results, and it is given by the following [35]: 4. Jaccard: It is used to compare the similarity and difference between finite sample sets. It is the ratio of the intersection and union of two given sets A and B. The larger the Jaccard value is, the higher the similarity is, as given by The input images are SEG (which represents experimental segmentation results) and GT (ground truth). We need to take out the corresponding categories in SEG and GT from the segmented images and use the function to calculate the category separately.
We select the representative level set as the Chan-Vese (CV) method [7] and the Lankton method [12] from the image experiment shown in Figure 9 for quantitative comparison. The methods proposed in these two studies have been widely used in the past decade, and the number of citations has reached thousands. Up to now, they have been cited 107 times and 9 times respectively in 2020, which is enough to illustrate the practicability and durability of the two data comparison methods. The results are shown in Table 3. Recently, a novel method using a superellipse active contour has been proposed [36]. However, this paper mainly focuses on the recognition and classification of naval mines. It should be highlighted that a superellipse does not always perfectly track the shapes in very noisy input data. Hence, based on the high noise characteristics of our sonar images, we do not compare our work with this method. However, it should still be noted that the superellipse parameters are sufficiently described in the very noisy input data case so that a successful classification of naval mines can be achieved. In the future work of classification and recognition of sonar images, we will conduct an in-depth study on this.
We transformed the data results into a histogram and line graph [37,38] in order to facilitate observation and comparison. As shown in Figures 12-15, we can see that our method is accurate and effective in most cases by listing the evaluation results. Because precision and recall are two relative evaluation indices and are contradictory, we regard them as better segmentation, as their values are higher at the same time. We calculated the average value of four evaluation indices of the three methods respectively, and the results are shown in Table 4. We can see that the average value of our strategy is higher than other methods.
At the same time, by observing the evaluation results of the line chart, we can see that our strategy is more consistent than both CV and Lankton's when the sonar images are segmented. There are great fluctuations in the recall value of CV. Generally speaking, our method has advantages in both visual image results and numerical evaluation results, which further proves the effectiveness of our strategy.
The above experiment is the best result we have obtained, although the problem also involves some algorithm parameters (smooth Gaussian kernel parameters, filter parameters, time step), and each parameter has substantive significance, which may affect the final result. However, what we want to emphasize here is that the new method proposed in this paper is effective and efficient to segment the contour and region information of sonar images simultaneously.

Conclusions
In this paper, a novel strategy for sonar image segmentation was devised. Not only was the typical LSM applied and improved by us, but also the improved LBM was extended to sonar image segmentation. To summarize, first, the sonar images were preprocessed based on the clustering method. After eliminating the discrete points, the connectivity domain of the target was analyzed to obtain the minimum bounding rectangle, which is different from the original contour randomly set or manually defined by the classical LSM. Next, we embedded the contour of the level set evolution and obtained a fine segmentation of the target in the sonar images by iterations. The segmentation task is divided into two subtasks, namely coarse segmentation using a cluster connected analysis and fine segmentation of curve evolution. During the fine segmentation process, we used the improved LSM to obtain the target contour, and then used the improved LBM to obtain the region segmentation of the target with the original image background. Finally, the integrated segmentation of the sonar images is achieved by extracting the continuous edge contour of the target and the shape features of the area. We tested the proposed strategy on simple composite images and sonar images, and four indices of image segmentation evaluation were used to evaluate the segmentation results. The results demonstrate that the proposed method not only provides abstract contour information and area shape features of the image, but it also accelerates the speed of curve evolution and improves the segmentation accuracy. Experimental results show that our strategy is accurate and effective for the challenging task of the segmentation of sonar images.