# Breast Ultrasound Image Segmentation Algorithm Using Adaptive Region Growing and Variation Level Sets

Authors: Yanwei Wang; Junbo Ye; Tianxiang Wang; Jingyu Liu; Hao Dong; Xin Qiao
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

To address the features of strong noise, blurred boundaries, and poor imaging quality in breast ultrasound images, we propose a method for segmenting breast ultrasound images using adaptive region growing and variation level sets. First, this method builds a template layer from the difference between the marked image and the original image. Second, the Otsu algorithm is used to measure the target and background using the maximum class variance method to set the threshold. Finally, through the level set of the pixel neighborhood, the boundary points of the adaptive region growth are specified by the level set of the pixel neighborhood, and it is therefore possible to accurately determine the contour perimeter and area of the lesion region. The results demonstrate that the value of Jaccard and Dice for benign tumors is greater than 0.99. Therefore, the segmentation effect of breast images can be achieved by utilizing a breast ultrasound image segmentation approach that uses adaptive region growth and variation level sets.


---

## Body

## 1. Introduction

Medical image segmentation is a key technology in medical image processing, and its task is to extract interesting objects from medical images to serve the clinician’s computer-aided diagnosis. In recent years, breast ultrasound image segmentation has become a challenging task because of the simultaneous consideration of speckle noise, ultrasound image quality, and the location and size of breast lesions [1]. Several auxiliary systems assist doctors in effectively detecting some of the conditions in breast ultrasound images, via image processing and pattern recognition algorithms [2]. Segmentation of breast ultrasound images is critical to systematically localize the specific locations of breast lesions; however, speckle noise, image quality, and location and size of breast lesions are the limitations of this method.There are several automatic, semi-automatic, and manual breast ultrasound image segmentation methods available in modern society [3–5]. Histogram threshold is a common method in breast ultrasound image segmentation. In this method, a histogram threshold is set in breast ultrasound image segmentation and is widely used in grayscale image segmentation. Another method is the active contour model, which is a framework for delineating object contours from background images. It is an edge-based segmentation method, in which active contour models are widely used in breast ultrasound images [6], and it also applies in enhancement [7]. A hybrid scheme combining region-based and boundary-based techniques for breast ultrasound image segmentation was developed using these methods, in which seed points are automatically generated by an empirical rule-based formula, and boundary points are thereafter determined by region growing (RG) and directional gradient operation, which combines the clustering algorithm used in computed tomography detection [8]. Compared to RG, adaptive region growing (ARG) is more effective in segmentation [9], improved genetic algorithms [10], enhanced seeded region growing [11], automated inspection [12], magnetic resonance imaging [12], and other types of imaging [13], and it also combines clustering [14], statistical characters, and point cloud images [15]. In addition, Markov random field models have been used for breast ultrasound image segmentation. It provides efficient use of pixel correlations, and the segmentation results are further improved by applying a maximum posterior segmentation prediction scheme. However, it has a complex iterative process and is time consuming. A neural network is also used in breast ultrasound image segmentation to simplify processing. This transforms the segmentation problem into a classification decision based on a set of features. The neural-network-based image segmentation method is based on an adaptive reference point classification algorithm, and the extraction of tumor images is performed based on a cost function, which is defined according to the boundary and region information of the tumor in the frequency and spatial domains. Neural network-based methods are typically used when the lesions are compact and round, and the algorithms do not perform well in other cases [16–18]. They also combine other methods to improve accuracy [19]. Subsequently, the RG method was applied to mammary image segmentation to improve the degree of automation.Medical image segmentation is a challenging task because of the low contrast between the region of interest and other textures. Vakanski et al.[20] proposed an algorithm based on convolutional neural networks (CNN) for medical image segmentation, which included U-Net and full convolutional neural networks. To further improve the accuracy and precision of detection, an image segmentation method combining level set systems was used as a piece of picture division [21]. In this method, the region growth combined level set was applied in mammary image segmentation, and it improved the segmentation accuracy. To improve the robustness and accuracy, Regonda et al. [22] performed a machine learning approach for medical image segmentation by employing a CNN. At this time, an adaptive segmentation algorithm combined with machine learning was developed. To improve the accuracy, optimized methods are used in image segmentation and image classification. Ahmad et al. [23] proposed a probability-based optimal deep learning feature fusion applied in ultrasound image segmentation, which can detect tumors in ultrasound images automatically. Subsequently, Shwetha et al. [24] proposed a design and analysis algorithm with high precision for breast tumor segmentation in mammograms and ultrasound images and compared the features of breast ultrasound. Praveen and Rajendra Prasad [25] used multi-ROI segmentation for effective texture features of mammogram images, which is effective for texture features, and Shrivastava and Bharti [26] suggested density applied in breast tumor detection for further research. To further improve the intelligence level of segmentation, in 2020, Lei et al. [27] proposed an automatic breast anatomy segmentation method for automated whole breast ultrasound images, but experiments have proved that it is currently difficult to effectively address the breast anatomy segmentation problem using this method. To address this problem, an ARG algorithm based on optimization is applied in medical image segmentation.In conclusion, it is known from the above literature that in RG, the edges are optimized using methods such as deep learning, CNN, and level sets. Considering the boundary of the ending condition, the level set method (LSM) is used to track various interfaces and shapes. The strength of the level set method (LMD) is that it automatically handles topological changes in the tracked shape because it uses an implicit representation to represent active contours. Active contour model (ACM) is a competitive tool in image segmentation, and an active contour approach driven by adaptive local prefitting energy function based on Jeffreys divergence (APFJD) applied in image segmentation is effective while handling images with uneven intensity. [28] The LMD was developed by two mathematicians, Stanley Osher and James Sethian, in the 1980s. This method has been widely used in many disciplines and fields, and subsequently, a large amount of level set data has been developed, which makes the level set, and the application of sets in computing has become easier. It has already been applied in brain image segmentation and breast thermograms and is also used in data processing. The variation level set segmentation method, which is advantageous for dealing with a variety of topologies, is an important branch of medical applications. It is essential to transform the higher dimensional space into a lower dimensional space to describe the evolution and achieve medical image segmentation. The GMAC model was used in the variation-level set [29]. Later, to improve the accuracy of segmentation, it was combined with statistics [30].In summary, in the field of medical image segmentation, a combination of methods is often used to complement each other’s advantages. Owing to the complexity of the situation, the automatic breast ultrasound image segmentation method cannot accurately segment the breast ultrasound image, whereas the LSM can automatically process the topological changes of the tracking shape; thus, adaptive region growth and variation-based methods are adopted. The level set breast ultrasound image segmentation method makes the segmentation of breast ultrasound images more accurate.


## 2. Related Work

To improve image segmentation accuracy, Koshki et al. [31] proposed a two-step method to segment breast thermal images and obtained relatively accurate results. Niaz et al. [32] proposed an active contour method based on an improved combined local and global fitting function to address the breast tumor segmentation problem, and it was experimentally confirmed that the proposed method exhibited better performance when compared to previous state-of-the-art methods. Gonalves et al. [33] proposed a deep learning algorithm that used the learning of the probability map of key points in the loss function as a regularization term for robust learning of key point localization and analyzed a deep image segmentation and deep key point-based algorithm. A new algorithm was proposed for detecting model interactions that improve state-of-the-art performance and execution time for breast key point detection tasks. Liao et al. [34] combined ultrasound image diagnosis and deep learning technology to identify benign and malignant tumors. The experimental results show that the accuracy of the region segmentation algorithm based on supervised blocks is the same as that of manual segmentation. Ho et al. [35] presented a deep multimagnification network trained by partial annotation for automated multiclass tissue segmentation using a set of patches from multiple magnifications in digitized whole slide images. They proposed architecture with multiencoder, multidecoder, and multiconcatenation that outperformed other single- and multimagnification-based architectures by achieving the highest mean intersection-over-union and could be used to facilitate pathologists’ assessments of breast cancer. Huang et al. [36] proposed a new segmentation method by dense prediction and local fusion of superpixels for breast anatomy with scarce labeled data and achieved good results. Wang et al. [37] proposed a novel CNN with coarse-to-fine feature fusion to address the poor quality of breast ultrasound images and large variations in breast lesion size, shape, and location. Zhang et al. [38] proposed a multitask learning model based on a soft and hard attention mechanism for the simultaneous segmentation and binary classification of breast ultrasound images, and the experimental results demonstrated the effectiveness of the model. Salama and Aly [39] proposed a new framework for segmentation and classification of breast cancer images. Different models, including InceptionV3, DenseNet121, ResNet50, VGG16, and MobileNetV2, were applied to classify the mammographic image analysis society (MIAS), digital database for screening mammography (DDSM), and the curated breast imaging subset of DDSM (CBIS-DDSM) into benign and malignant, and the accuracy of breast cancer diagnosis results has been greatly improved. Hassanzadeh et al. [40] leveraged the potentials of dense and residual blocks, used the capability of evolutionary computation, and proposed an automatic evolutionary model to detect an optimum and accurate network structure and its parameters for medical image segmentation. Subsequently, Wang et al. [41] applied an iterative edge attention network in image segmentation with EA-net, whereas Han et al. [42] used a CNN for image segmentation with U-NeXt. There is a new method for the segmentation of medical images that has achieved good results.Recently, in terms of mammary image segmentation, the accuracy of the algorithm was improved by combining region growing with other methods, which is crucial for the effective classification of mammary images. In this study, based on the segmentation algorithm combining RG and adaptive level set, the boundary points of the ARG are defined through the level set of the pixel neighborhood, so that the contour perimeter and area of the lesion region could be effectively identified. The Jaccard of Koshki et al. [31] is 0.9658, and the run time is 2.6 seconds, whereas the Dice of Wang et al. [37] is 0.8142, and that of Zhang et al. [38] is 0.8152. Our work is to calculate the value of Jaccard and Dice used in an ARG algorithm for level set optimization, and the results exhibited better Jaccard and Dice. The run time was fast, which is suitable for the segmentation effect of breast images.


## 3. Methodology

The region-growing method involves gathering the region formed by the pixel points based on their similar properties. This method starts with a single pixel and gradually merges to form the desired region. Initially, the seed pixel is selected from the seed point inside the lesion by considering it as the starting point, that is, the starting point of growth.The qualified pixels in the domain are merged with the seed pixels to form a new seed pixel, and the merge operation in mathematics is used until it changes to the edge line and the unqualified points outside the edge line. Therefore, in regional growth, the selection of seed pixels, determination of growth rules, and termination conditions are the three key factors.


### 3.1. Regional Growth Principle

Regional growth utilizes the similarity between image pixels. It is a gray-value-based processing method that divides an image into similar regions according to specified criteria, as shown in Algorithm1.Algorithm 1:Region growing.
AssumeR represents the whole image, then the segmentation can be seen as the process of dividing the region R into n sub-regions:R1, R2, …, RnAnd∩1nRi=R, Ri is a connected area, i=1, 2, 3, …, nifRi∩Rj is empty,for anyi, j; i≠j;IfPRi=TURE,fori=1, 2, 3, …, n;thenPRi∪Rj=FALSEThis is a process of region growth, that is, region growth is a process of aggregating into larger regions according to subregions under the above conditions, as shown in Figure1. In the 4-neighbor connected pixels of the seed point pixel label 1, namely points 2, 3, 4, and 5, respectively. The gray value 12 of pixel point 4 is the closest to the gray value 10 of the seed point; thus, pixel point 4 is added to the segmentation area, and pixel 4 is used as a new seed point to perform the following process. During the second cycle, in the image to be analyzed, namely 2, 3, 5, 6, 7, and 8, respectively, the gray value of pixel 6 is 16, and the gray mean value of the already segmented area, comprising 1 and 4, is 10.5, pixel 6 gets added to the segmented area. The last image depicts the direction in which the region grows, from shallow to deep.Figure 1
Region growing method: (a) pixel label, (b) gray value, and (c) corresponding image.
(a)(b)(c)


### 3.2. Steps of Regional Growth

#### 3.2.1. Based on Regional Grayscale Difference

①
Scan the pixels to find pixels that have not yet been attributed②
Check its neighborhood pixels by considering a pixel as the center, that is, compare the pixels in the neighborhood with that at the center one by one, and merge them if the grayscale difference is less than a predetermined threshold③
Assume the newly merged pixel as the center, return to step ②, and check the neighborhood of the new pixel until the area cannot be expanded further④
Return to step ①, continue to scan until all pixels are assigned, and end the entire growth process


#### 3.2.2. Based on the Statistical Properties of Grayscale Distribution in the Region

①
Divide the pixels into small nonoverlapping areas②
Compare the cumulative grayscale histograms of adjacent regions and merge regions based on the similarity of the grayscale distribution③
Set the termination criteria and merge the regions by repeating the operations in step ② until the termination criteria are met


#### 3.2.3. Based on the Shape of the Area

Fixed grayscale is used to divide the image into sections. Set the perimetersP1 and P2 of the two adjacent areas and set the part where the grayscale difference between the two sides of the common boundary line of the two areas is less than the given value as L, if (T1 is a predetermined threshold)(1)LminP1,P2>T1.Following the merging of the two regions as shown in (1), let B be the common boundary length of the two adjacent areas, and the image is divided into various areas with fixed grayscale, and the length of the part, where the grayscale difference between the two sides of the common boundary line of the two areas, is set, which is less than the given value, which is set to L, and T2 is a predetermined threshold value.(2)LB>T2.In summary, the first method merges the regions with lower contrast in the common boundary of two adjacent regions, and the second method merges the lower contrast portion of the common boundary of the two adjacent regions [43].


### 3.3. Adaptive Region Growth Algorithm

While processing the breast images, it was found that the determination of growth seed points, conditions for regional growth, and conditions for terminating regional growth are the key factors for regional growth. The similarity between growth points and similar regions can be judged based on the gray value, texture, and image information, such as color. Therefore, the number, position, and gray value of seeds in the RG algorithm are also important factors that affect the results of RG. The ARG algorithm means that not only the position of the seed needs to be selected but also the gray value of the starting point of growth needs to be selected. ARG uses the grayscale difference as the criterion for regional merging and then performs the regional merging method according to the similarity of the grayscale distribution in a small area, equalizes the grayscale histogram, and finally divides and merges to determine the finish condition.In the region growing method, when a long point is selected, the growth is performed according to the similarity criterion of the gray histogram. Usually, the boundary between the discontinuous regions of the gray level, threshold processing boundary of the pixel property distribution, and segmentation of the direct search region are considered. Adaptive region growth is the process of aggregating pixels or subregions into larger regions according to predefined criteria, starting from a set of growth points, which can be either a single pixel or a certain growth point. A small area, adjacent pixels, or areas with properties similar to the growth point are merged with it. These new pixels are regarded as new growth points, and the process is repeated continuously until no pixels that meet the conditions can be included. This implies that the growth points can no longer grow because the growth of this region has been completed.In other words, the conditions for RG are similarity criteria defined according to the continuity between pixel gray levels, and the conditions for region growth stop define a termination rule, conditions, and regional growth stops. In the algorithm, we define a variable, the maximum pixel gray-value distance, reg_maxdist. When the absolute value of the difference between the gray value of the pixel to be added and the average gray value of all pixels in the segmented area is less than or equal to reg maxdist, the pixel is added to the segmented area; in contrast, and the area increases and the algorithm ends.As depicted in Figure2, Figure 2(a) is the original image, and the numbers represent the grayscale of the pixels. Assuming a pixel with a gray value of eight as the initial growth point, denoted as fi,j, the circle represents the seed point. In the 8-neighborhood, the growth criterion is that the difference between the gray value of the point to be measured and the gray value of the growing point is one or zero. Figure 2(b) shows that after the first region growth, the difference between fi−1,j, fi,j−1, fi,j+1 and the gray value of the growth point is one, thus merged. Figure 2(c) shows that after the second growth, fi+1,j is merged. Figure 2(d) shows that after the third growth, fi+1,j−1 and fi+2,j are merged. Thus far, there are no pixels that meet the growth criteria, and the growth stops.Figure 2
Schematic of iterative region growth results: (a) original image, (b) first RG result, (c) second RG result, and (d) third RG result.
(a)(b)(c)(d)Therefore, the steps for realizing adaptive region growth are as follows: the processing process is depicted in Figure3.Step 1: Scan the image sequentially to find the first pixel that has not yet been attributed and set the pixel asx0,y0.Step 2: By assumingx0,y0 as the center, consider four-neighborhood pixels x,y of x0,y0. If x0,y0 satisfies the growth criterion, merge x,y with x0,y0. In the same area, push x,y onto the stack at the same time.Step 3: Take a pixel from the stack, treat it asx0,y0, and return to Step 2.Step 4: When the stack is empty, go back to step 1.Step 5: Repeat steps 1–4 until every point in the image has attribution and the growth is over.Figure 3
ARG flow chart.In a word, the region growing method is simple to calculate and has a good effect on segmenting connected regions with the same features. However, due to the problems of noise and uneven greyscale, it is easy to generate holes and oversegmentation. Therefore, threshold method and region method are used for medical image segmentation. It is usually combined with other segmentation methods.


## 3.1. Regional Growth Principle

Regional growth utilizes the similarity between image pixels. It is a gray-value-based processing method that divides an image into similar regions according to specified criteria, as shown in Algorithm1.Algorithm 1:Region growing.
AssumeR represents the whole image, then the segmentation can be seen as the process of dividing the region R into n sub-regions:R1, R2, …, RnAnd∩1nRi=R, Ri is a connected area, i=1, 2, 3, …, nifRi∩Rj is empty,for anyi, j; i≠j;IfPRi=TURE,fori=1, 2, 3, …, n;thenPRi∪Rj=FALSEThis is a process of region growth, that is, region growth is a process of aggregating into larger regions according to subregions under the above conditions, as shown in Figure1. In the 4-neighbor connected pixels of the seed point pixel label 1, namely points 2, 3, 4, and 5, respectively. The gray value 12 of pixel point 4 is the closest to the gray value 10 of the seed point; thus, pixel point 4 is added to the segmentation area, and pixel 4 is used as a new seed point to perform the following process. During the second cycle, in the image to be analyzed, namely 2, 3, 5, 6, 7, and 8, respectively, the gray value of pixel 6 is 16, and the gray mean value of the already segmented area, comprising 1 and 4, is 10.5, pixel 6 gets added to the segmented area. The last image depicts the direction in which the region grows, from shallow to deep.Figure 1
Region growing method: (a) pixel label, (b) gray value, and (c) corresponding image.
(a)(b)(c)


## 3.2. Steps of Regional Growth

### 3.2.1. Based on Regional Grayscale Difference

①
Scan the pixels to find pixels that have not yet been attributed②
Check its neighborhood pixels by considering a pixel as the center, that is, compare the pixels in the neighborhood with that at the center one by one, and merge them if the grayscale difference is less than a predetermined threshold③
Assume the newly merged pixel as the center, return to step ②, and check the neighborhood of the new pixel until the area cannot be expanded further④
Return to step ①, continue to scan until all pixels are assigned, and end the entire growth process


### 3.2.2. Based on the Statistical Properties of Grayscale Distribution in the Region

①
Divide the pixels into small nonoverlapping areas②
Compare the cumulative grayscale histograms of adjacent regions and merge regions based on the similarity of the grayscale distribution③
Set the termination criteria and merge the regions by repeating the operations in step ② until the termination criteria are met


### 3.2.3. Based on the Shape of the Area

Fixed grayscale is used to divide the image into sections. Set the perimetersP1 and P2 of the two adjacent areas and set the part where the grayscale difference between the two sides of the common boundary line of the two areas is less than the given value as L, if (T1 is a predetermined threshold)(1)LminP1,P2>T1.Following the merging of the two regions as shown in (1), let B be the common boundary length of the two adjacent areas, and the image is divided into various areas with fixed grayscale, and the length of the part, where the grayscale difference between the two sides of the common boundary line of the two areas, is set, which is less than the given value, which is set to L, and T2 is a predetermined threshold value.(2)LB>T2.In summary, the first method merges the regions with lower contrast in the common boundary of two adjacent regions, and the second method merges the lower contrast portion of the common boundary of the two adjacent regions [43].


## 3.2.1. Based on Regional Grayscale Difference

①
Scan the pixels to find pixels that have not yet been attributed②
Check its neighborhood pixels by considering a pixel as the center, that is, compare the pixels in the neighborhood with that at the center one by one, and merge them if the grayscale difference is less than a predetermined threshold③
Assume the newly merged pixel as the center, return to step ②, and check the neighborhood of the new pixel until the area cannot be expanded further④
Return to step ①, continue to scan until all pixels are assigned, and end the entire growth process


## 3.2.2. Based on the Statistical Properties of Grayscale Distribution in the Region

①
Divide the pixels into small nonoverlapping areas②
Compare the cumulative grayscale histograms of adjacent regions and merge regions based on the similarity of the grayscale distribution③
Set the termination criteria and merge the regions by repeating the operations in step ② until the termination criteria are met


## 3.2.3. Based on the Shape of the Area

Fixed grayscale is used to divide the image into sections. Set the perimetersP1 and P2 of the two adjacent areas and set the part where the grayscale difference between the two sides of the common boundary line of the two areas is less than the given value as L, if (T1 is a predetermined threshold)(1)LminP1,P2>T1.Following the merging of the two regions as shown in (1), let B be the common boundary length of the two adjacent areas, and the image is divided into various areas with fixed grayscale, and the length of the part, where the grayscale difference between the two sides of the common boundary line of the two areas, is set, which is less than the given value, which is set to L, and T2 is a predetermined threshold value.(2)LB>T2.In summary, the first method merges the regions with lower contrast in the common boundary of two adjacent regions, and the second method merges the lower contrast portion of the common boundary of the two adjacent regions [43].


## 3.3. Adaptive Region Growth Algorithm

While processing the breast images, it was found that the determination of growth seed points, conditions for regional growth, and conditions for terminating regional growth are the key factors for regional growth. The similarity between growth points and similar regions can be judged based on the gray value, texture, and image information, such as color. Therefore, the number, position, and gray value of seeds in the RG algorithm are also important factors that affect the results of RG. The ARG algorithm means that not only the position of the seed needs to be selected but also the gray value of the starting point of growth needs to be selected. ARG uses the grayscale difference as the criterion for regional merging and then performs the regional merging method according to the similarity of the grayscale distribution in a small area, equalizes the grayscale histogram, and finally divides and merges to determine the finish condition.In the region growing method, when a long point is selected, the growth is performed according to the similarity criterion of the gray histogram. Usually, the boundary between the discontinuous regions of the gray level, threshold processing boundary of the pixel property distribution, and segmentation of the direct search region are considered. Adaptive region growth is the process of aggregating pixels or subregions into larger regions according to predefined criteria, starting from a set of growth points, which can be either a single pixel or a certain growth point. A small area, adjacent pixels, or areas with properties similar to the growth point are merged with it. These new pixels are regarded as new growth points, and the process is repeated continuously until no pixels that meet the conditions can be included. This implies that the growth points can no longer grow because the growth of this region has been completed.In other words, the conditions for RG are similarity criteria defined according to the continuity between pixel gray levels, and the conditions for region growth stop define a termination rule, conditions, and regional growth stops. In the algorithm, we define a variable, the maximum pixel gray-value distance, reg_maxdist. When the absolute value of the difference between the gray value of the pixel to be added and the average gray value of all pixels in the segmented area is less than or equal to reg maxdist, the pixel is added to the segmented area; in contrast, and the area increases and the algorithm ends.As depicted in Figure2, Figure 2(a) is the original image, and the numbers represent the grayscale of the pixels. Assuming a pixel with a gray value of eight as the initial growth point, denoted as fi,j, the circle represents the seed point. In the 8-neighborhood, the growth criterion is that the difference between the gray value of the point to be measured and the gray value of the growing point is one or zero. Figure 2(b) shows that after the first region growth, the difference between fi−1,j, fi,j−1, fi,j+1 and the gray value of the growth point is one, thus merged. Figure 2(c) shows that after the second growth, fi+1,j is merged. Figure 2(d) shows that after the third growth, fi+1,j−1 and fi+2,j are merged. Thus far, there are no pixels that meet the growth criteria, and the growth stops.Figure 2
Schematic of iterative region growth results: (a) original image, (b) first RG result, (c) second RG result, and (d) third RG result.
(a)(b)(c)(d)Therefore, the steps for realizing adaptive region growth are as follows: the processing process is depicted in Figure3.Step 1: Scan the image sequentially to find the first pixel that has not yet been attributed and set the pixel asx0,y0.Step 2: By assumingx0,y0 as the center, consider four-neighborhood pixels x,y of x0,y0. If x0,y0 satisfies the growth criterion, merge x,y with x0,y0. In the same area, push x,y onto the stack at the same time.Step 3: Take a pixel from the stack, treat it asx0,y0, and return to Step 2.Step 4: When the stack is empty, go back to step 1.Step 5: Repeat steps 1–4 until every point in the image has attribution and the growth is over.Figure 3
ARG flow chart.In a word, the region growing method is simple to calculate and has a good effect on segmenting connected regions with the same features. However, due to the problems of noise and uneven greyscale, it is easy to generate holes and oversegmentation. Therefore, threshold method and region method are used for medical image segmentation. It is usually combined with other segmentation methods.


## 4. Optimization of Variation Level Set Segmentation

### 4.1. Variable Differential Principle

Assume thatEu represents two-dimensional energy, as shown in(3)Eu=∬Fx,y,u,ux,uydxdy.We derived the Equation (3) to obtain the extreme value of energy, which is the minimum value, and applied the Euler-Lagrange Equation to obtain the basic equation for the level set, as shown in(4)∂F∂u−ddx∂f∂ux−ddy∂F∂ux=0.In the nonlinear partial differential equation (PDE) composed of Euler-Lagrange, to address the extreme value of the minimum energy, it is necessary to refer to the time variable, which also transforms the static nonlinear PDE problem into a dynamic PDE problem and realizes the steady evolution of the solution [44].The effect of the variable differential set treatment of the breast ultrasound image is depicted in Figure4, in which, we can see that the ultrasound image shows the presence of noise. The image is not high, the edge is unclear, and the image is directly used. The edges of the identified lesion area are relatively broad.Figure 4
Result of variable let segmentation. (a) Original image and (b) after CV filtering.
(a)(b)


### 4.2. Level Set Segmentation Principle

Assume thatC is a closed curve, which can be expressed using the following equation:(5)C=x,y|ux,y=c.In (5), we introduced a time variable, t in the solution of the original PDE, and the time function ux,y is the level set, which is shown in(6)Ct=x,y|ux,y,t=c.We also introduced time variables separately while constructing original Equation (4). The derivative of Equation (4) is shown in(7)dudt=∂u∂t+∇u⋅∂x∂y,∂y∂t=0.Assume the partial differential components ofx,y, and partial derivatives concerning the time variable: the partial derivative of the curve corresponds to the time variable, and ∂c/∂t represents the variation in curve C.Similarly, the form in which the total derivative ofut can be expressed as −∇u⋅V, here, we assume βF as an energy functional, and the total derivative of ut transforms to the following equation:(8)βF=N⋅V,(9)∂u∂t=βF∇u.It can be observed from the above equation that F is a velocity function. (9) is a developed form of the level set PDE equation, which belongs to a class of solutions that apply the Hamilton-Jacobi equation to the variation differential problem, which requires the introduction of time variables to find the solution of the equation.At this time, the solution of the equation does not affect the value of parameterC. Therefore, C is assigned zero. The solution of curve C can be transformed into a solution for the level set of the embedded function. Similarly, the evolution of the curve can be transformed into the evolution of the level set equation of the embedded function ux,y under a given initial value u0x,y.In the evolution process of the initial curveC, the introduced time variable can determine the current curve Ct by taking the two-dimensional level set of ux,y,t at any time, to obtain the pole that makes the energy function go. The solution of the Euler-Lagrange equation of small values terminates the evolution of curve C and finds a solution to [45](10)C0x,y|ux,y,0=u0x,y.In summary, the numerical calculation in this LSM may be unstable, or the solution process tends to be complicated owing to the improper selection of the embedded functionux,y. Therefore, the most commonly used embedding function is the signed distance function −dx,y,C, which indicates that it is outside curve C, and vice versa. Among them, the Euclidean distance represents the distance between point x,y and curve C, and its main advantage is that it is equal to one, and the rate of change of the function is uniform, which is conducive to the stability of the numerical calculation [46].


### 4.3. Variation Level Set Segmentation

When the level set indicates that curveC is a closed curve, the minimization of the equation of motion of the curve can be applied to the minimum energy of the capability functional function that should close the curve. (11) expresses the energy function of the Geodesic Active Contour model for level set image segmentation.(11)EC=∫01g∇Csds.Considering the initial value and assuming that the curve parametersC0 and C1 are equal, (11) can be modified to(12)ECp=∫01gCsCpds.Applying the LMD to (12), the PDE of the corresponding embedding function is shown in(13)∂u∂t=g∇I×Csk−∇g⋅N∇u.The Heaviside function is introduced in (13), and using Green’s Equation, the energy function can be expressed in(14)Eu=∬Ωgx,yδudxdy.The energy differentiaδu is equal to dHu/du, Hu is the Heaviside function by assuming that the energy u is larger than zero, and the Heaviside function value is equal to one. Using the variation method, the level can be set based on the type of the evolution.(15)∂u∂t=∂udivg∇u∇u.The regularization∂εu is the approximation in(16)∂u∂t=∂εudivg∇u∇u.Overall, the minimum solution of the closed curveC was converted into a solution of the minimum value of the energy functional. By introducing the embedded function, Heaviside function, and Green Equation to transform the functional, the solution of EC is transformed into the solution problem of Eu and then the PDE is obtained by the LSM, and the steady-state solution is finally obtained by numerical calculation, which is the variation LSM [47].In the process of curve evolution, the level set segmentation method must address the PDE for each iterative calculation and loop until convergence. The results are depicted in Figure5. In addition, the energy function in the segmentation model of the LSM may be nonconvex, and the curve evolution is very sensitive to the initial contour, which is prone to local minimum results, further resulting in segmentation failure.Figure 5
Level set optimization boundary.The GAC model was introduced as an active contour model to address this problem. Compared to the region-based model using level set evolution, the numerical iteration of its PDE is time consuming; therefore, the segmentation speed is slow, which is not ideal. However, the orientation of the evolution model based on gradient information in segmentation and the existence of a stable minimum solution make it easy to solve.To address the boundary problem in the traditional LSM in the past, especially in the local minimum energy function, which cannot achieve segmentation results, we have proposed a global variation segmentation method. In this method, the image area information is used to build a posterior probability-based energy model, followed by a very small variation in the overall framework. The combination of the GAC model uses gradient information to establish a global variation energy model and finally constructs a new integrated image segmentation model.


### 4.4. Variation Level Set Model

The perimeter of the shadow part was calculated, and the pixel neighborhood method was used to obtain the boundary points. We used the level set optimization to test using templatesa and b. According to the data in Figure 6, we can see that initially a template layer is developed, and the marked image and original image are acquired. Thereafter, the Otsu algorithm is used to measure the target and background using the maximum class variance method to set the threshold.Figure 6
boundary model size. (a) Model a. (b) Model b.
(a)(b)


## 4.1. Variable Differential Principle

Assume thatEu represents two-dimensional energy, as shown in(3)Eu=∬Fx,y,u,ux,uydxdy.We derived the Equation (3) to obtain the extreme value of energy, which is the minimum value, and applied the Euler-Lagrange Equation to obtain the basic equation for the level set, as shown in(4)∂F∂u−ddx∂f∂ux−ddy∂F∂ux=0.In the nonlinear partial differential equation (PDE) composed of Euler-Lagrange, to address the extreme value of the minimum energy, it is necessary to refer to the time variable, which also transforms the static nonlinear PDE problem into a dynamic PDE problem and realizes the steady evolution of the solution [44].The effect of the variable differential set treatment of the breast ultrasound image is depicted in Figure4, in which, we can see that the ultrasound image shows the presence of noise. The image is not high, the edge is unclear, and the image is directly used. The edges of the identified lesion area are relatively broad.Figure 4
Result of variable let segmentation. (a) Original image and (b) after CV filtering.
(a)(b)


## 4.2. Level Set Segmentation Principle

Assume thatC is a closed curve, which can be expressed using the following equation:(5)C=x,y|ux,y=c.In (5), we introduced a time variable, t in the solution of the original PDE, and the time function ux,y is the level set, which is shown in(6)Ct=x,y|ux,y,t=c.We also introduced time variables separately while constructing original Equation (4). The derivative of Equation (4) is shown in(7)dudt=∂u∂t+∇u⋅∂x∂y,∂y∂t=0.Assume the partial differential components ofx,y, and partial derivatives concerning the time variable: the partial derivative of the curve corresponds to the time variable, and ∂c/∂t represents the variation in curve C.Similarly, the form in which the total derivative ofut can be expressed as −∇u⋅V, here, we assume βF as an energy functional, and the total derivative of ut transforms to the following equation:(8)βF=N⋅V,(9)∂u∂t=βF∇u.It can be observed from the above equation that F is a velocity function. (9) is a developed form of the level set PDE equation, which belongs to a class of solutions that apply the Hamilton-Jacobi equation to the variation differential problem, which requires the introduction of time variables to find the solution of the equation.At this time, the solution of the equation does not affect the value of parameterC. Therefore, C is assigned zero. The solution of curve C can be transformed into a solution for the level set of the embedded function. Similarly, the evolution of the curve can be transformed into the evolution of the level set equation of the embedded function ux,y under a given initial value u0x,y.In the evolution process of the initial curveC, the introduced time variable can determine the current curve Ct by taking the two-dimensional level set of ux,y,t at any time, to obtain the pole that makes the energy function go. The solution of the Euler-Lagrange equation of small values terminates the evolution of curve C and finds a solution to [45](10)C0x,y|ux,y,0=u0x,y.In summary, the numerical calculation in this LSM may be unstable, or the solution process tends to be complicated owing to the improper selection of the embedded functionux,y. Therefore, the most commonly used embedding function is the signed distance function −dx,y,C, which indicates that it is outside curve C, and vice versa. Among them, the Euclidean distance represents the distance between point x,y and curve C, and its main advantage is that it is equal to one, and the rate of change of the function is uniform, which is conducive to the stability of the numerical calculation [46].


## 4.3. Variation Level Set Segmentation

When the level set indicates that curveC is a closed curve, the minimization of the equation of motion of the curve can be applied to the minimum energy of the capability functional function that should close the curve. (11) expresses the energy function of the Geodesic Active Contour model for level set image segmentation.(11)EC=∫01g∇Csds.Considering the initial value and assuming that the curve parametersC0 and C1 are equal, (11) can be modified to(12)ECp=∫01gCsCpds.Applying the LMD to (12), the PDE of the corresponding embedding function is shown in(13)∂u∂t=g∇I×Csk−∇g⋅N∇u.The Heaviside function is introduced in (13), and using Green’s Equation, the energy function can be expressed in(14)Eu=∬Ωgx,yδudxdy.The energy differentiaδu is equal to dHu/du, Hu is the Heaviside function by assuming that the energy u is larger than zero, and the Heaviside function value is equal to one. Using the variation method, the level can be set based on the type of the evolution.(15)∂u∂t=∂udivg∇u∇u.The regularization∂εu is the approximation in(16)∂u∂t=∂εudivg∇u∇u.Overall, the minimum solution of the closed curveC was converted into a solution of the minimum value of the energy functional. By introducing the embedded function, Heaviside function, and Green Equation to transform the functional, the solution of EC is transformed into the solution problem of Eu and then the PDE is obtained by the LSM, and the steady-state solution is finally obtained by numerical calculation, which is the variation LSM [47].In the process of curve evolution, the level set segmentation method must address the PDE for each iterative calculation and loop until convergence. The results are depicted in Figure5. In addition, the energy function in the segmentation model of the LSM may be nonconvex, and the curve evolution is very sensitive to the initial contour, which is prone to local minimum results, further resulting in segmentation failure.Figure 5
Level set optimization boundary.The GAC model was introduced as an active contour model to address this problem. Compared to the region-based model using level set evolution, the numerical iteration of its PDE is time consuming; therefore, the segmentation speed is slow, which is not ideal. However, the orientation of the evolution model based on gradient information in segmentation and the existence of a stable minimum solution make it easy to solve.To address the boundary problem in the traditional LSM in the past, especially in the local minimum energy function, which cannot achieve segmentation results, we have proposed a global variation segmentation method. In this method, the image area information is used to build a posterior probability-based energy model, followed by a very small variation in the overall framework. The combination of the GAC model uses gradient information to establish a global variation energy model and finally constructs a new integrated image segmentation model.


## 4.4. Variation Level Set Model

The perimeter of the shadow part was calculated, and the pixel neighborhood method was used to obtain the boundary points. We used the level set optimization to test using templatesa and b. According to the data in Figure 6, we can see that initially a template layer is developed, and the marked image and original image are acquired. Thereafter, the Otsu algorithm is used to measure the target and background using the maximum class variance method to set the threshold.Figure 6
boundary model size. (a) Model a. (b) Model b.
(a)(b)


## 5. Breast Ultrasound Image Segmentation Algorithm

### 5.1. Differential Image Acquisition

Read the “marked image” and “unmarked image,” because the “marked image” is marked in red. The Red channel is referred as the R channel, and the difference between the two images “−diff” (difference value) is obtained.


### 5.2. Image Segmentation

Using the OUST algorithm to binarize the diff image [48], a black-and-white image was obtained in the previous step.The regional growth method was used to grow from two origins in the upper right corner and the lower left corner, respectively. The growth rules are as follows:(1)
Horizontal growth begins from the first pixel of each row(2)
Vertical growth starts from the first pixel in each column(3)
Stop the growth if it encounters a marked boundary value(4)
Stop all growth after all growth outside the marked area is completeThe area of the shadowed part was calculated. After executing the above three steps, only the pixel value of the shadow part was zero, all the points with a pixel value of zero in the image were traversed, and the total number was counted, which is the area of the shadow part.In the neighborhood of templates a andb, if only one neighborhood is a boundary point, this point can be considered as a boundary point. Taking the four neighborhoods as an example, as depicted in Figure 6, all black points are traversed, and when there is a white point in the four neighborhoods of the black point, the point is determined as a boundary point and marked as orange. The number of orange points was counted to obtain the perimeter of the marked area.


## 5.1. Differential Image Acquisition

Read the “marked image” and “unmarked image,” because the “marked image” is marked in red. The Red channel is referred as the R channel, and the difference between the two images “−diff” (difference value) is obtained.


## 5.2. Image Segmentation

Using the OUST algorithm to binarize the diff image [48], a black-and-white image was obtained in the previous step.The regional growth method was used to grow from two origins in the upper right corner and the lower left corner, respectively. The growth rules are as follows:(1)
Horizontal growth begins from the first pixel of each row(2)
Vertical growth starts from the first pixel in each column(3)
Stop the growth if it encounters a marked boundary value(4)
Stop all growth after all growth outside the marked area is completeThe area of the shadowed part was calculated. After executing the above three steps, only the pixel value of the shadow part was zero, all the points with a pixel value of zero in the image were traversed, and the total number was counted, which is the area of the shadow part.In the neighborhood of templates a andb, if only one neighborhood is a boundary point, this point can be considered as a boundary point. Taking the four neighborhoods as an example, as depicted in Figure 6, all black points are traversed, and when there is a white point in the four neighborhoods of the black point, the point is determined as a boundary point and marked as orange. The number of orange points was counted to obtain the perimeter of the marked area.


## 6. Experimental Results and Analysis

### 6.1. Experimental Data and Platform

In the experiment, three datasets from various sources were employed. The first dataset(data set (1) was generated from the mini-MIAS mammography database, which divided the data into benign and malignant categories based on tumor severity. The second dataset(data set (2) was gathered from public dataset Dataset_BUSI_with_GT, which was collected and released. It includes thousands of breast ultrasound images, of which 780 were chosen as the experimental dataset. The third dataset (data set (3) was a two-dimensional image of over 200 breast instances acquired over 6 months using Toshiba’s BSM31 equipment. Staff screening resulted in the identification of nine photographs for the study. The data set 3 is manually labeled into three sections: benign, malignant, and normal.The collected images were run on an AMD Ryzen 74800H with 8 cores and 16 threads at 4.2 G Hz, the GPU was RTX 2060 6G, the operating system was Windows 11, the memory is 16G, the hard disk is 512G, using Python version 3.8 programming, the compiler uses VS Code, and the experimental results are obtained.Using adaptive area production and variation level set optimization, the relative perimeter and area of the diseased area in breast images were obtained, and its shape was determined. Finally, the optimization results of four-neighborhood a and eight-neighborhoodb in adaptive region growing were compared, along with the relative perimeter difference, perimeter-area ratio, and other parameters.


### 6.2. Evaluation

In this study, the Jaccard similarity coefficient (Jaccard) and Sørensen–Dice coefficient (Dice) are introduced to calculate the effectiveness of breast image segmentation. Jaccard was used to compare the similarities and differences between the limited sample sets. The larger the Jaccard coefficient value, the more similar the samples, and the higher the degree. The Jaccard was calculated as shown in Equation (17). The Jaccard similarity coefficient was defined.(17)accx,y=x∩yx+y−x∩y.Whenx equals y, the Jaccard coefficient is one. When A and B do not intersect, the Jaccard coefficient is zero, and the Jaccard distance represents the dissimilarity of the sample or set. The larger the Jaccard distance, the lower the sample similarity. Therefore, the Jaccard distance was used to describe the dissimilarity. However, the disadvantage is that it is only applicable to sets of binary data.The Dice distance is mainly used to calculate the similarity between two sets (it can also measure the similarity of the strings). The Dice similarity coefficient of the two sets ofx and y is defined as: where x represents the cardinality of the set x (that is, the number of elements in the set) and y represents the cardinality of the set y.(18)Dicex,y=2∗x∩yx+y.Jaccard and Dice calculations were performed on 18 sample images collected at the hospital. The calculation results are depicted in Figure7. It can be observed from the figure that the two parameters of the six sets of data are both below 0.99, which can be judged as irregular images and malignant tumors.Figure 7
Perimeter comparison.Comparing the images of the public dataset, the calculation results of Jaccard and Dice are shown in Figures8-9. It can be seen from the figure that 11 pairs of two parameters are below 0.99, which are images of the algorithm misjudged, and the misjudgment rate is 2.422%. The running time of each image on the public dataset is shown in Figure 10. In which, data set 1 is a subset of benign tumors in the public dataset and data set 2 is a subset of malignant tumors in the public dataset.Figure 8
Calculation results of Jaccard and Dice from data set 1.Figure 9
Calculation results of Jaccard and Dice from data set 2.Figure 10
Run time results of data set 1 and data set 2.


### 6.3. Results and Discussion

According to the comparison of different public data sets, nine sets of ultrasound images were simultaneously selected for testing at the same time. The outline of the lesion is represented using red, and the long and short diameters are represented using green lines, as shown in Figure11.Figure 11
Test3 breast ultrasound image: (a, b) model a processing and (c) model b processing.
(a)(b)(c)In the experiment, a third group of double lesions was used as an example. To demonstrate the effectiveness of the processing results, the small lesions in the third group were selected and processed by adaptive region growth and variation level set optimization.The degree histogram is shown on the right in Figures11(a)–11(c) respectively give the local effect maps of the neighborhoods processed by two different templates, (b) is the boundary termination point of the growth of the four-neighborhood optimization area of template a, (b) the pixel distribution on the left, and the right schematic diagram of the lesion, (c) is the boundary termination point for the growth of the eight-neighborhood optimization region of template b, (c) the pixel distribution on the left, and the schematic diagram of the lesion on the right.From the comparison of the results in Figures11(b) and 11(c), the boundary point in Figure 10(b) is a closed curve with strong connectivity. In Figure 11(c), the lesion point is mistakenly judged as the boundary point. Figure 11(b) has a better effect.The results of the adaptive region growth optimized by the variable differential level set are applied to other lesions, and the images of the left lesions in the third group are processed to obtain the image shown in Figure11(a), and then the edges are corrected to obtain Figure 11(b).At the same time, the perimeter and area of the nine groups were calculated according to the method of modifying the adaptive region growth by variable differential. The calculation results are listed in Table1. This lays the foundation for the automatic labeling of lesions and identification of lesion morphology.Table 1
Result of area and perimeter in data set 3.
NameRegionAreaModel a perimeterModel b perimetertest1Left4904240341Right5661262373test2Whole1435576test3Left3573248355Right3697291test4Whole1017136189test5Whole672169211test6Whole974177228test7Whole1295185224test8Whole3101224286test9Whole1643196259We evaluated five ways to find the circumference of breast cancer on the first dataset using Jaccard and Dice scored on data set 1 and dataset set 2. The five methods are 4-neighborhood, 8-neighborhood, original image minus erode image, dilate image minus original image, and dilate image minus erode image. The Dice and Jaccard scores for the various ways are shown in Figures12 and 13.Figure 12
Dice comparison histogram in data set 3.Figure 13
Jaccard comparison histogram in data set 3.For data set 3, we simultaneously compared the perimeters computed for the two different templates in Section6.2, resulting in the image depicted in Figure 14. The comparison results show that the perimeter data calculated by template a is closer to the actual disease image. In addition, the comparison data of the area and perimeter of the application of template a and the method described in this study were also investigated. From Figure 14, it is evident that as the perimeter length increased, the accuracy of the detection results decreased.Figure 14
Perimeter comparison in data set 3.According to Table2, the run results showed a total of 24 breast tumors, which are malignant tumor data in public dataset 2, those images are Jaccard values below 0.99, or Dice values below 0.98. No is the image number, and value is the score with Dice or Jaccard. Combined with a comparison of clinical observations, the tumors in the 24 images detected above were all malignant tumors.Table 2
Dice or Jaccard evaluation value of less than 0.99 for malignant tumors in data set 2.
No.45812436880101112120127139Dice0.9917410.9888840.9601180.9948260.9906540.9878580.9948060.9937320.9806710.9943780.9861360.988848Jaccard0.9836180.9780130.9232950.9897060.9814810.9760070.9896660.9875420.9620740.9888190.9726510.977941No.148149152156162166167169172174185203Jaccard0.9923880.9800770.9887190.9806320.993430.9943260.9823790.9948670.9922150.9921260.9902410.994195Dice0.984890.9609320.977690.9620.9869450.9887150.9653680.9897870.9845490.9843750.980670.988458Figure15 depicts 13 images with Jaccard and Dice below 0.99 in the malignant tumor database. It can be seen from the figure that breast malignant tumors present an irregular shape, and the average Jaccard value of the public dataset is 0.9932.Figure 15
Correspondence map with a Dice or Jaccard evaluation value of less than 0.99 for malignant tumors in data set 2.The experimental results demonstrated that the clinical images and public dataset images were processed in this study, and the boundary points of the adaptive region growth were defined through the level set of the pixel neighborhood to effectively identify the contour perimeter and area of the lesion area. The results demonstrated that in the proposed method for breast ultrasound image segmentation based on adaptive region growing and changing level sets, the Jaccard and Dice values of the processed benign tumors were both greater than 0.99; therefore, breast ultrasound image segmentation using adaptive region growing and changing level sets is adopted. This method is suitable for the segmentation of mammary gland images and can address the problem of image classification in the case of large noise, blurred boundaries, and poor imaging quality of mammary gland images.According to the data in Table3, it shows that there are different methods of breast image segmentation indicators. Through the investigation of Dice and Jaccard, Jaccard and running time were compared to level set model for multiclass [31], and Dice was compared to Coarse-to-Fine Fusion CNN [37] and soft and hard attention multitask learning [38], respectively. By testing the surface of the public data set, the value of the method explained in this paper is better than that listed in level set model for multiclass [31] on Jaccard, which reduces the running time; when compared to the Dice index, the value of the Dice method in this paper is higher than that mentioned in Coarse-to-Fine Fusion CNN [37] and soft and hard attention multitask learning [38].Table 3
Comparison of different methods of breast image segmentation indicators.
MethodAverage Dice (%)Average Jaccard (%)Average run time (%)Soft and hard attention multitask learning [38]81.42——Level set model for multiclass [31]—96.582.60Coarse-to-fine fusion CNN [37]86.52——Our method for malignant public data subsets99.9999.970.23Our method for benign public data subsets99.7799.540.19


## 6.1. Experimental Data and Platform

In the experiment, three datasets from various sources were employed. The first dataset(data set (1) was generated from the mini-MIAS mammography database, which divided the data into benign and malignant categories based on tumor severity. The second dataset(data set (2) was gathered from public dataset Dataset_BUSI_with_GT, which was collected and released. It includes thousands of breast ultrasound images, of which 780 were chosen as the experimental dataset. The third dataset (data set (3) was a two-dimensional image of over 200 breast instances acquired over 6 months using Toshiba’s BSM31 equipment. Staff screening resulted in the identification of nine photographs for the study. The data set 3 is manually labeled into three sections: benign, malignant, and normal.The collected images were run on an AMD Ryzen 74800H with 8 cores and 16 threads at 4.2 G Hz, the GPU was RTX 2060 6G, the operating system was Windows 11, the memory is 16G, the hard disk is 512G, using Python version 3.8 programming, the compiler uses VS Code, and the experimental results are obtained.Using adaptive area production and variation level set optimization, the relative perimeter and area of the diseased area in breast images were obtained, and its shape was determined. Finally, the optimization results of four-neighborhood a and eight-neighborhoodb in adaptive region growing were compared, along with the relative perimeter difference, perimeter-area ratio, and other parameters.


## 6.2. Evaluation

In this study, the Jaccard similarity coefficient (Jaccard) and Sørensen–Dice coefficient (Dice) are introduced to calculate the effectiveness of breast image segmentation. Jaccard was used to compare the similarities and differences between the limited sample sets. The larger the Jaccard coefficient value, the more similar the samples, and the higher the degree. The Jaccard was calculated as shown in Equation (17). The Jaccard similarity coefficient was defined.(17)accx,y=x∩yx+y−x∩y.Whenx equals y, the Jaccard coefficient is one. When A and B do not intersect, the Jaccard coefficient is zero, and the Jaccard distance represents the dissimilarity of the sample or set. The larger the Jaccard distance, the lower the sample similarity. Therefore, the Jaccard distance was used to describe the dissimilarity. However, the disadvantage is that it is only applicable to sets of binary data.The Dice distance is mainly used to calculate the similarity between two sets (it can also measure the similarity of the strings). The Dice similarity coefficient of the two sets ofx and y is defined as: where x represents the cardinality of the set x (that is, the number of elements in the set) and y represents the cardinality of the set y.(18)Dicex,y=2∗x∩yx+y.Jaccard and Dice calculations were performed on 18 sample images collected at the hospital. The calculation results are depicted in Figure7. It can be observed from the figure that the two parameters of the six sets of data are both below 0.99, which can be judged as irregular images and malignant tumors.Figure 7
Perimeter comparison.Comparing the images of the public dataset, the calculation results of Jaccard and Dice are shown in Figures8-9. It can be seen from the figure that 11 pairs of two parameters are below 0.99, which are images of the algorithm misjudged, and the misjudgment rate is 2.422%. The running time of each image on the public dataset is shown in Figure 10. In which, data set 1 is a subset of benign tumors in the public dataset and data set 2 is a subset of malignant tumors in the public dataset.Figure 8
Calculation results of Jaccard and Dice from data set 1.Figure 9
Calculation results of Jaccard and Dice from data set 2.Figure 10
Run time results of data set 1 and data set 2.


## 6.3. Results and Discussion

According to the comparison of different public data sets, nine sets of ultrasound images were simultaneously selected for testing at the same time. The outline of the lesion is represented using red, and the long and short diameters are represented using green lines, as shown in Figure11.Figure 11
Test3 breast ultrasound image: (a, b) model a processing and (c) model b processing.
(a)(b)(c)In the experiment, a third group of double lesions was used as an example. To demonstrate the effectiveness of the processing results, the small lesions in the third group were selected and processed by adaptive region growth and variation level set optimization.The degree histogram is shown on the right in Figures11(a)–11(c) respectively give the local effect maps of the neighborhoods processed by two different templates, (b) is the boundary termination point of the growth of the four-neighborhood optimization area of template a, (b) the pixel distribution on the left, and the right schematic diagram of the lesion, (c) is the boundary termination point for the growth of the eight-neighborhood optimization region of template b, (c) the pixel distribution on the left, and the schematic diagram of the lesion on the right.From the comparison of the results in Figures11(b) and 11(c), the boundary point in Figure 10(b) is a closed curve with strong connectivity. In Figure 11(c), the lesion point is mistakenly judged as the boundary point. Figure 11(b) has a better effect.The results of the adaptive region growth optimized by the variable differential level set are applied to other lesions, and the images of the left lesions in the third group are processed to obtain the image shown in Figure11(a), and then the edges are corrected to obtain Figure 11(b).At the same time, the perimeter and area of the nine groups were calculated according to the method of modifying the adaptive region growth by variable differential. The calculation results are listed in Table1. This lays the foundation for the automatic labeling of lesions and identification of lesion morphology.Table 1
Result of area and perimeter in data set 3.
NameRegionAreaModel a perimeterModel b perimetertest1Left4904240341Right5661262373test2Whole1435576test3Left3573248355Right3697291test4Whole1017136189test5Whole672169211test6Whole974177228test7Whole1295185224test8Whole3101224286test9Whole1643196259We evaluated five ways to find the circumference of breast cancer on the first dataset using Jaccard and Dice scored on data set 1 and dataset set 2. The five methods are 4-neighborhood, 8-neighborhood, original image minus erode image, dilate image minus original image, and dilate image minus erode image. The Dice and Jaccard scores for the various ways are shown in Figures12 and 13.Figure 12
Dice comparison histogram in data set 3.Figure 13
Jaccard comparison histogram in data set 3.For data set 3, we simultaneously compared the perimeters computed for the two different templates in Section6.2, resulting in the image depicted in Figure 14. The comparison results show that the perimeter data calculated by template a is closer to the actual disease image. In addition, the comparison data of the area and perimeter of the application of template a and the method described in this study were also investigated. From Figure 14, it is evident that as the perimeter length increased, the accuracy of the detection results decreased.Figure 14
Perimeter comparison in data set 3.According to Table2, the run results showed a total of 24 breast tumors, which are malignant tumor data in public dataset 2, those images are Jaccard values below 0.99, or Dice values below 0.98. No is the image number, and value is the score with Dice or Jaccard. Combined with a comparison of clinical observations, the tumors in the 24 images detected above were all malignant tumors.Table 2
Dice or Jaccard evaluation value of less than 0.99 for malignant tumors in data set 2.
No.45812436880101112120127139Dice0.9917410.9888840.9601180.9948260.9906540.9878580.9948060.9937320.9806710.9943780.9861360.988848Jaccard0.9836180.9780130.9232950.9897060.9814810.9760070.9896660.9875420.9620740.9888190.9726510.977941No.148149152156162166167169172174185203Jaccard0.9923880.9800770.9887190.9806320.993430.9943260.9823790.9948670.9922150.9921260.9902410.994195Dice0.984890.9609320.977690.9620.9869450.9887150.9653680.9897870.9845490.9843750.980670.988458Figure15 depicts 13 images with Jaccard and Dice below 0.99 in the malignant tumor database. It can be seen from the figure that breast malignant tumors present an irregular shape, and the average Jaccard value of the public dataset is 0.9932.Figure 15
Correspondence map with a Dice or Jaccard evaluation value of less than 0.99 for malignant tumors in data set 2.The experimental results demonstrated that the clinical images and public dataset images were processed in this study, and the boundary points of the adaptive region growth were defined through the level set of the pixel neighborhood to effectively identify the contour perimeter and area of the lesion area. The results demonstrated that in the proposed method for breast ultrasound image segmentation based on adaptive region growing and changing level sets, the Jaccard and Dice values of the processed benign tumors were both greater than 0.99; therefore, breast ultrasound image segmentation using adaptive region growing and changing level sets is adopted. This method is suitable for the segmentation of mammary gland images and can address the problem of image classification in the case of large noise, blurred boundaries, and poor imaging quality of mammary gland images.According to the data in Table3, it shows that there are different methods of breast image segmentation indicators. Through the investigation of Dice and Jaccard, Jaccard and running time were compared to level set model for multiclass [31], and Dice was compared to Coarse-to-Fine Fusion CNN [37] and soft and hard attention multitask learning [38], respectively. By testing the surface of the public data set, the value of the method explained in this paper is better than that listed in level set model for multiclass [31] on Jaccard, which reduces the running time; when compared to the Dice index, the value of the Dice method in this paper is higher than that mentioned in Coarse-to-Fine Fusion CNN [37] and soft and hard attention multitask learning [38].Table 3
Comparison of different methods of breast image segmentation indicators.
MethodAverage Dice (%)Average Jaccard (%)Average run time (%)Soft and hard attention multitask learning [38]81.42——Level set model for multiclass [31]—96.582.60Coarse-to-fine fusion CNN [37]86.52——Our method for malignant public data subsets99.9999.970.23Our method for benign public data subsets99.7799.540.19


## 7. Conclusion

In this study, breast image segmentation based on global adaptive region growing and variation-level sets were combined for blurred and noisy edges of lesions in breast ultrasound images. By establishing the difference model between the breast ultrasound image and the labeled image, setting the R channel, selecting two seed points through the upper right and lower left, growing along the horizontal and vertical directions simultaneously, and then setting the neighborhood template and variation-level set optimization. When compared to the adaptive region growing method [13], this study optimizes the cut-off adjustment through variation level sets, compares the localized boundaries of the four-neighborhood template a and the eight-neighborhood template b, and provides the discrimination of the neighborhood template a. Result of level set optimization adaptive region growing algorithm is better. When compared to the level set model for multiclass [31], this study optimizes Jaccard; the value is 0.9999 in malignant and 0.9954 in benign, both of which are better than 0.9658. At the same time, the runtime is shorter, 0.233 s and 0.185 s in this study, which is shorter than 2.6 s. Considering the Dice, by comparing soft and hard attention multitask learning [38] and Coarse-to-Fine Fusion CNN [37], the scores are 0.9999 and 0.9977, respectively, both of which are better than 0.8142 and 0.8652.In the future, we will obtain the segmentation effect of breast images and extract the perimeter and area of the lesion image, thereby laying a foundation for the accuracy of computer-aided diagnosis and lesion identification.



---

*Source: 1752390-2022-10-03.xml*