** Research on Water Edge Extraction in Islands from GF-2 Remote Sensing Image Based on GA Method **

Yan Bian , Yusheng Gong , Guopeng Ma and Ting Duan

## Article Information

## Abstract

**Abstract:** Aiming at the problem of low accuracy in the water boundary automatic extraction of islands from GF-2 remote sensing image with high resolution in three bands, new water edges automatic extraction method in island based on GF-2 remote sensing images, genetic algorithm (GA) method, is proposed in this paper. Firstly, the GA-OTSU threshold segmentation algorithm based on the combination of GA and the maximal inter-class variance method (OTSU) was used to segment the island in GF-2 remote sensing image after pre-processing. Then, the morphological closed operation was used to fill in the holes in the segmented binary image, and the boundary was extracted by the Sobel edge detection operator to obtain the water edge. The experimental results showed that the proposed method was better than the contrast methods in both the segmentation performance and the accuracy of water boundary extraction in island from GF-2 remote sensing images.

**Keywords:** GA-OTSU , GF-2 RS Image , Morphology , Sobel Edge Detection , Water Edges

## 1. Introduction

The coastline is the boundary between the sea and the land at the average water level of spring tides over many years [1]. The water edge refers to the instantaneous coastline, rather than the actual coastline [2]. However, the water edge extraction is the premise and important step of coastline extraction, so the research on which is of great significance.

With the development of remote sensing technology, the resolution of a multi-spectral remote sensing image is also improved. The improvement of image resolution has greatly improved the accuracy and speed of information acquisition, but it is also affected by more “noise or non-target,” “same object and different spectrum” or “foreign body in the same spectrum,” which bring more difficulties in the extrac¬tion of a linear target [3]. Under this background, developing a more efficient image extraction method is particularly important. However, extracting linear targets (coastline, road centerline, tidal channel line, etc.) with a single method can only come up with poor results, so a combination of several algorithms is widely used. Yang et al. [4] realized the extraction of coastline along the Sanya Bay, Dadonghai by using the watershed segmentation and mathematical morphological methods, which can achieve the coastline extraction. However, the watershed segmentation algorithm is susceptible to noise and other factors, and the image may be over-segmented, which easily introduces uncertain factors, and it is difficult to achieve higher accuracy even through morphological modification. Zhu et al. [5] realized the extraction of the middle line of the tidal gulch in Jiuduansa area based on the combination of top-hat transformation, the OTSU threshold segmentation algorithm, erosion and dilation methods. Although this method can extract the middle line of the tidal trench, there still exists three problems: firstly, the top-hat method can not only eliminate the noise but also destroy the edge of the target area and affect the extraction accuracy of the edge line; secondly, the OTSU method uses the maximum inter-class variance between the target and the background to determine the segmentation threshold, but the segmentation threshold is not necessarily the optimal solution of the maximum inter-class variance; lastly, the structural elements size of erosion and dilation is difficult to grasp, and it is easy to cause sawtooth phenomenon. Paravolidakis et al. [6] proposed a method combining the edge detection algorithm and the Snake algorithm. The method initially used the anisotropic diffusion algorithm to reduce the noise of the image, and then used local threshold segmentation algorithm to process the denoised image, and the output image was regionally grouped to remove all the small space objects and focused on the space objects of interest, finally, the morphological operator and Canny operator were used to extract the coastline. Ideal results have been obtained, but the process is complicated and time-consuming (for example, for a remote sensing image of 4000×4000, after noise reduction, it shall be divided into 200×300 blocks, and each block area shall be processed separately, and then the processed blocks shall be merged). The GA-OTSU threshold segmentation algorithm proposed in this paper, can not only overcome the drawbacks of traditional segmentation methods but also solve the problem that the normalized water difference index (NDWI) method [7] cannot be used to separate water body and non-water body for high-resolution three-band data. Combining with morphology closed operation and Sobel edge detection operator, it can better avoid the problems such as coastline fault and non-coastline inclusion caused by a single coastline extraction method. By using the method in this paper and comparative methods to make qualitative and quantitative comparative analysis on the water boundary extraction results of four island experimental areas, it is believed that the method in this paper is feasible to a certain extent.

## 2. The Technology and Principle of GA Method

##### 2.1 Data Pre-processing

During the remote sensing imaging process, the geometric distortion and deformation of remote sensing image are caused by the external factors of sensor, such as the change of attitude, height, speed, and so on. Moreover, due to the lack of spatial, temporal and spectral resolution of remote sensing images, information cannot be accurately recorded in the data acquisition process, which will greatly reduce the accuracy of remote sensing images. Therefore, it is necessary to conduct pre-process to remote sensing images [8]. Data preprocessing in this paper includes FLAASH atmospheric correction and geometric correction, aiming to make the ground objects in the image more consistent with the actual features. FLAASH atmospheric correction refers to the process of eliminating radiation errors caused by atmospheric scattering and absorption in remote sensing images. Geometric correction refers to the process of eliminating geometric (shape, size, position, etc.) distortion of ground objects in the imaging process.

##### 2.2 GA-OTSU Threshold Segmentation Algorithm

Genetic algorithm (GA) is a kind of self-organizing and adaptive artificial intelligence technology that simulates the biological evolution process and mechanism in nature to solve extreme value problems [9]. GA is a holistic optimization process, which is very applicable in cases where there is no deterministic method to calculate the optimal solution or if the deterministic method is complicated, and it can quickly and accurately find the global optimal solution. GA is an iterative algorithm, and the number of solutions in each iteration is called population size. Each solution is represented by a chromosome, and each chromosome is made up of genes. The flow chart of this genetic algorithm is shown in Fig. 1.

The specific meaning of each step is explained as follows:

**Step 1.** Coding. Before the genetic algorithm can be performed, the chromosome must be coded, that is, the solution space of the problem must be coded.

**Step 2.** Initialize the population. The population represents the set of solutions of the optimization pro¬blem, whose size will directly affect the scope and result of the search.

**Step 3.** The adaptation function. Its size determines the ability of an individual to adapt to the environ¬ment in each iteration process, and the strong ones will continue to choose, cross and mutate.

**Step 4.** Selection. Selection process is a kind of operation process that determines the elimination or re-production of offspring according to the level of individual fitness value.

**Step 5.** Crossover. The crossover process is the accumulation of superior bit information from the parent generation and exchange them with each other in the hope of producing superior offspring.

**Step 6.** Mutation. The process of mutation is to randomly change the bit information in the seed string, so as to obtain the best fit value of the individual.

**Step 7.** Convergence criteria. The mechanism for its termination is either the maximum number of iterations or the fitness of the best individual does not change.

GA-OTSU threshold segmentation algorithm takes the maximum inter-class variance method (OTSU algorithm [10]) as the basic segmentation method, and introduces GA to improve OTSU algorithm on the basis of it. Compared with the OTSU algorithm, the GA-OTSU threshold segmentation algorithm has the advantage of quickly and accurately obtaining the optimal segmentation threshold t* and reducing noise. The specific steps of GA-OTSU algorithm are shown as follows:

**Step 1.** Find a way to “digitize” the potential solution of the problem. The grayscale value of the image pixel ranges from 0 to 255, so the 8-bit binary number to represent the grayscale value of the pixel can be selected. An 8-bit binary number is just one byte, so treat it as a chromosome.

**Step 2.** Selection of population size. Population size refers to the total number of individuals in each generation, which can be set artificially. The larger the population size, the more likely the global solution will be found, but the running time will increase accordingly.

**Step 3.** Determine the adaptation function and decode it. In this paper, the GA-OTSU method is taken as the adaptability function to evaluate each chromosome. As shown in Eq. (1), the greater the variance obtained by a chromosome is, the closer it is to the optimal solution, and the more likely it is to be selected as the genetic seed. After the genetic seeds are determined, the genetic cal¬culation is carried out from generation to generation. The adaptive value of each new gen¬eration is different and higher than that of the previous generation so that the solution obtained is closer to the maximum value.

##### (1)

[TeX:] $$\delta^{2}(t)=\omega_{0}\left(\mu_{0}-\mu\right)^{2}+\omega_{1}\left(\mu_{1}-\mu\right)^{2}=\omega_{0} \omega_{1}\left(\mu_{1}-\mu_{0}\right)^{2}=\frac{[\mu \omega(t)-\mu(t)]^{2}}{\omega(t)[1-\omega(t)]}$$In Eq. (1), [TeX:] $$\delta^{2}(t)$$ is the threshold selection function of the Otsu method; [TeX:] $$\omega_{0}, \omega_{1}$$ is the proportion of target area and non-target area in the study area, respectively; [TeX:] $$\mu, \mu_{0}, \mu_{1}$$ each represents the average gray levels of the whole study area, the gray levels of the target area, and the non-target area.

**Step 4.** Genetic calculation. Crossover is the first genetic process which refers to exchange information of bits on chromosomes. Secondly, the mutation operation is carried out to randomly select the mutation point of a chromosome for mutation, which can compensate for the information loss caused by the selection process and the crossover process, so that the genetic algorithm has the global search ability. Finally the best threshold t* is obtained which makes [TeX:] $$\delta^{2}\left(t^{*}\right)$$ the biggest. At this time, t* can be used as the most adaptive solution for GA-OTSU threshold segmentation algorithm.

##### 2.3 Morphological Closed Operation

Morphological closed operation makes the image firstly expanded and then corroded, so that the holes inside the target in the image are not only filled but also maintain the original shape and size, and the fractured target is connected [11]. In this paper, morphological closed operation is used to fill holes in the binary image after GA-OTSU threshold segmentation to highlight the target (land) and background (ocean), which is convenient for subsequent edge detection operator to be used for edge extraction. Compared with the morphological erosion and dilation algorithms in [5], sawtooth phenomenon will not be caused by morphological closed operation. The concept of mathematical closed operation can be expressed as A×B (indicating that structural element B performs closed operation on image A) and can be defined as Eq. (2).

In Eq. (2), after A goes through B expansion operation, B again processes the results obtained by it through corrosion operation, as shown in Fig. 2.

##### 2.4 Sobel Edge Detection Operator

In image processing, edges are mainly distributed where the gray value difference between the target and the background is relatively obvious [12]. The edge types generally include horizontal, vertical and diagonal edges. Intensity and direction are two basic properties of edge lines in an image, the intensity variants the most across the edge line, but changes more gently along the edge line. The intensity change of the image is related to the discontinuity of the first derivative, and the drastic change is mainly reflected in the local maximum value of the first derivative, so the boundary strength of the corresponding point can be measured according to the value of the derivative to achieve the extraction of the boundary point set. In this paper, the Sobel operator is used for edge extraction, which is a first-step operator. The principle of its edge detection is shown in Fig. 3(a). For a digital image f(x, y), the definition of gradient vector at (x, y) is shown in Eq. (3).

##### (3)

[TeX:] $$\nabla f=\left[\frac{\partial f}{\partial x} \frac{\partial f}{\partial y}\right]^{T}=\left[G_{x} G_{y}\right]^{T}$$In Eq. (3), [TeX:] $$G_{x}, G_{y}$$ respectively represent the gradient of direction x and y. Theoretically, the partial derivative in Eq. (3) needs to calculate the position of each pixel, but in actual image processing, the image gradient is generally obtained by convolution approximation calculation based on small area template. And since both [TeX:] $$G_{x} \text { and } G_{y}$$ have their own templates, a gradient operator is the combination of the two templates. In this paper, the convolution template [TeX:] $$G_{x} \text { and } G_{y}$$ of Sobel operator is adopted, as shown in Fig. 3(b).

## 3. Experiment and Analysis

##### 3.1 GA Island Water Edge Automatic Extraction Method

GA method firstly pre-processed the experimental data. Then, GA-OTSU threshold segmentation method was used to segment the image, generate binary image, highlight the target ground object (land), and then morphological closed operation was used to fill the holes of the target ground object. Finally, Sobel edge detection operator is used to extract the water edge. In order to show the idea of GA method proposed in this paper more intuitively, a flow chart of GA method is drawn, as shown in Fig. 4.

##### 3.2 Experimental Data Set and Evaluation Indexes

The four islands studied in this paper are all located in the Bohai Bay area in the southeast of Liaoning Province. The remote sensing images were selected from the GF-2 satellite, which was equipped with a panchromatic camera of 1 m resolution and a multispectral camera of 4 m resolution, and featured with sub-meter spatial resolution, high positioning accuracy and fast attitude maneuvering.

The four island regions in the pre-processed GF-2 satellite image data with a resolution of 1 m were selected for the experiment, as shown in Fig. 5(a). The detailed information is shown in Table 1. In the images, the landforms in the study area of islands are diverse, including residential areas, woodland, barren land and harbors, etc. These landforms constitute features with different prospects. It provides data support for the study of different types of island water boundary extraction. Fig. 5(b), as a reference image, shows the manually drawn water boundary vector information corresponding to the four islands.

In this study, qualitative and quantitative indicators were used to compare and analyze the final extraction results of island water edges. Among them, qualitative analysis refers to the superposition and comparative analysis of the final extraction result of water boundary with the original image and reference image in Fig. 5. The quantitative index is evaluated by three evaluation indexes, namely accuracy P, omission error Q and redundancy error R, respectively [13], and the quantitative analysis is conducted. The equation is expressed as follows:

In Eqs. (4)–(6), i represents the vector length of the water edge line of the island which was drawn manually in the reference image; a represents the total length of the overlapping part between the extracted water boundary line and the manually drawn water boundary line vector; b refers to the total length missing from the extracted water edge compared with the artificially drawn vector, that is, the length not extracted when the water edge is taken as the background noise; c refers to the total length of redundancy of the extracted water edge compared with the manually drawn vector, that is, the background noise is taken as the extracted length of the water edge.

##### 3.3 GA Method and Result Analysis

The experiment is based on Windows Server 2016 operating system, with 16G internal storage, a NVIDA Quadro P2000 video card and 5G video storage. The program development language is MATLAB2020b.

##### 3.3.1 GA-OTSU threshold segmentation algorithm

GA-OTSU threshold segmentation algorithm is the most critical step in GA method, and the determination of segmentation threshold is a key factor affecting the image segmentation effect. GA-OTSU threshold segmentation algorithm takes OTSU algorithm as the basic segmentation method, on which genetic algorithm is introduced to improve OTSU algorithm. Compared with the OTSU algorithm, the GA-OTSU threshold segmentation algorithm has the advantage of quickly and accurately obtaining the global optimal solution, that is, the optimal segmentation threshold t*, and reducing the noise. This experiment in segmentation algorithm, for the same data set, the GA-OTSU segmentation algorithm in the GA method in this paper is not only compared with the OTSU segmentation algorithm in [5], but also compared with the watershed segmentation algorithm in [4]. In order to visually display the segmentation effects of the four research areas, the comparative results of the three segmentation methods are presented, as shown in Fig. 6.

It can be seen from Fig. 6 that the watershed segmentation algorithm in [4], the traditional OTSU algorithm in [5], and the GA-OTSU segmentation method in this paper can segment the experimental area well, and the segmenting image can retain the original image feature information rather integrally. However, it is obvious that the GA-OTSU segmentation method is better than the traditional OTSU algorithm. It can not only complete image segmentation, but also clear separation between the target and the background. The final segmented image is clearer, with less noise and less information loss, which can more effectively separate target from background and highlight the areas of interest. It is also obvious that compared with the watershed segmentation algorithm, the GA-OTSU segmentation method almost does not have excessive segmentation, which can lay a good foundation for the subsequent extraction of water edges and indirectly improve the accuracy of water edges extraction.

The GA-OTSU segmentation algorithm can not only effectively segment the target image, but also find the most adaptive threshold of the image and improve the performance of image segmentation by calculating the fitness of the genetic algorithm to obtain the operation characteristics of the optimal solution. In the parameter setting of GA-OTSU segmentation algorithm in this experiment, the initial population number N is 8, and the maximum number of evolutionary iterations is 100. As can be seen from the variation diagram of the optimal fitness curve in Fig. 7(b), the ordinate value of the curve gradually increases and finally tends to be stable, which indicates that the optimal fitness value under this condition is found through the genetic algorithm, that is, the optimal solution of the threshold value obtained by the OTSU method is found. The optimal threshold generation graph in Fig. 7(a) shows that the stable value of the curve is the optimal threshold that meets the conditions. The optimal adaptive threshold graph obtained by watershed algorithm, the OTSU algorithm and the GA-OTSU segmentation method for island images in the four experimental areas is shown in Table 2. The GA-OTSU segmentation method can more accurately find the global optimal segmentation threshold of the target image to achieve the optimal segmentation effect, which is conducive to the next step of image processing.

##### 3.3.2 Morphological closure operation

The binary image segmented by GA-OTSU is used to perform morphology closing operation with disk structure elements to fill in the holes. The results of morphological closure operation and the size of structural elements are shown in Fig. 8.

##### 3.3.3 Sobel edge detection operator

The Sobel edge detection operator is used to extract the edge of the closed binary image. Since the binary image processed by closed operation only has target (island) and background (ocean), the Sobel edge detection operator is used for boundary extraction, which is faster and has better effect, to realize the last step of GA island water edge automatic extraction method proposed in this paper, and the final island water edge is obtained. Superposition contrast analysis were also conducted between the results of water edges extracted by the GA method in this paper (GA-OTSU threshold segmentation algorithm + morphological closed operation + Sobel edge detection operation), the method in [4] (watershed segmentation + morphology modification method), the method in [5] (top-hat transform + OTSU segmentation + expansion and corrosion morphology method), the original and the reference images in Fig. 5. As shown in Fig. 9.

According to the qualitative comparative analysis of the extraction results in the first three experimental areas of the three methods in Fig. 9, it can be found that the water boundary extracted by the method of [4] (watershed segmentation + morphological modification) is over-extracted. The water edge extracted by the method in [5] (top hat transform + OTSU segmentation + expansion and corrosion morphology method) has obvious sawtooth phenomenon caused by the expansion and corrosion operation of morphology. The water edge extracted by GA method in this paper is integrated and smooth without fracture. In addition, the water edges extracted by the three methods were superimposed on the original image and the reference image (manually drawn vector), respectively. It can be found that the water edges extracted by the method in this paper also have the best matching effect with the original image and the reference image. The extraction results of the three methods are good in the fourth island, because the sea and land of which are distinct and the background is simple.

In addition to the above qualitative analysis, this paper also adopts the three quantitative evaluation indexes (accuracy P, omission error Q and redundancy error R) in Eqs. (4)–(6) above through the intersection tabulating tool in ArcGIS software to evaluate the accuracy of the island water boundary lines extracted by the three methods, the statistical results of extraction accuracy of the three methods are shown in Table 3.

It can be found from Table 3 that the average extraction accuracy of GA method in this paper can reach 98%, and the omission error (Q) and redundancy error (R) are 2.5% and 1.5%, respectively. The accuracy is significantly higher than the other two comparison methods.

## 4. Conclusion

The method proposed in this paper is compared with the methods in [4] and [5] through qualitative and quantitative analysis, and found that it is effective to extract the water edges of islands from GF-2 remote sensing images. The innovation of the GA method in this paper is partly reflected in the GA-OTSU segmentation method, which has the following advantages compared with the watershed segmentation algorithm in [4] and the OTSU segmentation algorithm in [5]: (1) it can better retain the edge of the segmented image and make the edge more integrated; (2) it has less noise; (3) there is basically no excessive segmentation phenomenon. Another innovation of the GA method is reflected in the com¬bination of GA-OTSU segmentation algorithms, morphological closure operation and Sobel edge detec¬tion operator, which has realized the automatic water edge extraction of islands, and ideal results with higher precision have been obtained, so the method can give reference advice for the water edge auto¬matic extraction of islands from GF-2 remote sensing image with high resolution in three bands.

## Biography

## Biography

## Biography

## Biography

## References

- 1 C. Chen, J. Bu, Y. Zhang, Y. Zhuang, Y. Chu, J. Hu, B. Guo, "The application of the tasseled cap transformation and feature knowledge for the extraction of coastline information from remote sensing images,"
*Advances in Space Research*, vol. 64, no. 9, pp. 1780-1791, 2019.custom:[[[-]]] - 2 D. Dominici, S. Zollini, M. Alicandro, F. Della Torre, P. M. Buscema, V. Baiocchi, "High resolution satellite images for instantaneous shoreline extraction using new enhancement algorithms,"
*Geosciences*, vol. 9, no. 3, 2019.doi:[[[10.3390/geosciences9030123]]] - 3 S. Mi, "Research on coastline automatic extraction algorithm based on image processing,"
*Shaanxi Water Conservancy*, vol. 2020, no. 1, pp. 33-35, 2020.custom:[[[-]]] - 4 B. Yang, Y Chen, J. Y u, "Coastline extraction based on watershed segmentation and edge detection of satellite remote sensing images,"
*Electronic Technology & Software Engineering*, vol. 2020, no. 11, pp. 170-171, 2020.custom:[[[-]]] - 5 Y. Zhu, Z. Han, S. He, X. Hu, P. Chen, "Remote sensing image extraction of tidal channels based on Otsu and mathematical morphology,"
*Journal of Shanghai Ocean University*, vol. 26, no. 1, pp. 146-153, 2017.custom:[[[-]]] - 6 V. Paravolidakis, L. Ragia, K. Moirogiorgou, M. E. Zervakis, "Automatic coastline extraction using edge detection and optimization procedures,"
*Geosciences*, vol. 8, no. 11, 2018.doi:[[[10.3390/geosciences8110407]]] - 7 B. Zhao, L. Wang, H. Hu, "Method of water-body extraction in mountainous area based on OLI images and DEM,"
*Hydrology*, vol. 39, no. 4, pp. 34-39, 2019.custom:[[[-]]] - 8 C. Wang, X. Wang, "Preprocess technology of high precision satellite photograph,"
*Electronic Technology & Software Engineering*, vol. 2016, no. 24, pp. 122-123, 2016.custom:[[[-]]] - 9 F. Liu, L. Y u, "Remote sensing image segmentation based on improved threshold of genetic operator,"
*Henan Keji*, vol. 2019, no. 14, pp. 37-38, 2019.custom:[[[-]]] - 10 S. Manikandan, K. Ramar, M. W. Iruthayarajan, K. G. Srinivasagan, "Multilevel thresholding for segmentation of medical brain images using real coded genetic algorithm,"
*Measurement*, vol. 47, pp. 558-568, 2014.custom:[[[-]]] - 11 J. Wan, K. Wang, S. Zhao, J. Zhang, "Fast automatic coastline extraction algorithm based graphics morphology,"
*Yellow River*, vol. 33, no. 10, pp. 126-130, 2011.custom:[[[-]]] - 12 D. Wei, X. Cao, "Using Satellite remote sensing image data to research the north coastline extraction based on Matlab: a case study of Changxing Island, Dalian City,"
*Bulletin of Surveying and Mapping*, vol. 2015, no. 5, pp. 80-83, 2015.custom:[[[-]]] - 13 B. Xuan,
*Master’s thesis, Guilin University of Technology, Guilin, China, 2019*, Guilin University of TechnologyGuilinChina, Master’s thesis, 2019.custom:[[[-]]]