A Selective Segmentation Model Using Dual-Level Set Functions and Local Spatial Distance

Selective image segmentation is one of the most significant subjects in medical imaging and real-world applications. We present a robust selective segmentation model based on local spatial distance utilizing a dual-level set variational formulation in this study. Our concept tries to partition all objects using a global level set function and the selected item using a different level set function (local). Our model combines the marker distance function, edge detection, local spatial distance, and active contour without edges into one. The new model is robust to noise and gives better performance for images having intensity in-homogeneity (background and foreground). Moreover, we observed that the proposed model captures objects which do not have uniform features. The experimental results show that our model is robust to noise and works better than the other existing models.


I. INTRODUCTION
Image segmentation plays an important role in image processing and computer vision both. The aim of the image segmentation techniques is to differentiate various objects in the image foreground from the background; and consistently select special characteristics of an image that have enough features of interest. In addition, image segmentation has been widely used in a variety of applications, including medical imaging, object recognition, video analysis, traffic management systems, surveillance, and automated operations, to visualize relevant things in a given scene or picture.
In image segmentation, active contour models are widely studied and used due to their robustness and reliability. They The associate editor coordinating the review of this manuscript and approving it for publication was Zhan-Li Sun . are classified into two main categories that are region-based models [2], [9]- [11] and edge-based models [3], [12]- [14]. The region-based models use image intensities to guide the motion of active contours, while the edge-based models use edge information for guiding the active contours towards the object boundary. These models could segment all the features in a given image, which means that these are global segmentation models. However, they are not enough mature to overcome the problem of segmenting a particular object of interest in a given image.
In selective segmentation, the main problem is how to differentiate one feature from another if the objects have the similar/same intensity or the background and foreground are in-homogeneous with different intensities. For example, in Figure 18 the three objects have the same intensities, but in Figure 15 the intensities differences between the two objects are, extremely, small in a medical image. Moreover, as shown in Figure 13, three different images with multi objects, background, and foreground are in-homogeneous and have different intensities.
In the literature, different techniques have been developed to overcome the selective segmentation problem such as graph-cut using graph cut theory [15], geodesics using edge-based function [16], and random walks using probability distributions [17]. Guyader et al. [18] proposed a model which is based on edge information of the object, while Badshah et al. [19] proposed a model which combines an edge-based model with region-based information. [18], [19] are useful and good work for a range of images. Badshah et al. [19] reproduced the same solution of the two piece-wise constants, however, if we solve in the timemarching framework, as in [2]; therefore, in this case, the capability of segmenting a particular object is lost, and we get a global segmentation. For successful segmentation and fast convergence, Nguyen et al. [20] combined the geometrical constraints and the Split Bregman method [21]. This model works properly if the object is smooth and well described by the weighted shortest boundary length. After all of this, Rada et al. [31] improved the models [18], [19], and competes the state-of-the-art model Nguyen et al. [20].
In this paper, we propose a variational model, which ensures better performance than the state-of-the-art models [31]- [33] for in-homogeneous, objects with the same/different intensities, in-homogeneous background, in-homogeneous foreground, and noisy images. At the same time, our model will handle two tasks, first global segmentation using region information, and second selective segmentation using both local region and local edge information. Dual-level set functions are employed because each task global function ψ G and local function are characterized by level set function [22]- [26], [31]. The re-initialization may be required because the level set function is not unique. The local similarity factors (LSF) [34] depend on local spatial distance (to balance the intensity difference between the object and its neighbor) is incorporated in the proposed model to improve the segmentation results.
The rest of the paper is organized as follows. In Section II, we give a brief review of related models [31]- [33]. The proposed model and its Euler Lagrange equation are presented in Section III. For solving the PDE we describe an additive operator splitting method (AOS) in Section IV. In Section V, we presented some experimental results on different data set and compared with state-of-the-art models. Final remarks and conclusions are made in Section VI.

II. A REVIEW OF THE RELATED WORKS
As mentioned above, there are many variational (local and global) segmentation models. We will shortly summarize some of them related to this work. In the global segmentation, all objects in the image are segmented, while in selective segmentation one object of interest is segmented. For global segmentation, Mumford-Shah [9] is one of the most popular region-based model, for the best segmentation it aims to reconstruct a piece-wise smooth function to represent the given image. Using the piece-wise smooth function by Mumford-Shah [9] to find the edges of a given image, that varies over the image domain. But this model is computationally expensive and complex. A new variational global segmentation model is introduced by Chan-Vese [2], by replacing the piece-wise smooth function with a piecewise constant function and the level set representation for intensities inside and outside the contour. It can detect contours without a gradient. This model may not efficiently segment images with intensity in-homogeneity or texture. To overcome such a problem, Ali et al. [27] introduced a global segmentation model based on generalized averages for segmentation of images having multiple objects and intensity in-homogeneity. But this model cannot segment a single object in the image having multi-objects. For this particular problem, there are many variational models [28]- [30] are introduced.
Mondal et al. [39] unveiled a new model that balances local and global data. For photos with in-homogeneous intensity, noise, and outliers, the model performs well. The model can handle intensity in-homogeneity pictures, hazy border or discontinuous edges, and the existence of moderated noise, according to the experimental findings demonstrated in various data sets. Chuang et al. [40] and Tripathy et al. [41] proposed models that are better for noisy MRI images but may not be as good for pictures with intensity in-homogeneity. Because this model is not convex, the initial guess must be adjusted multiple times until the desired results are obtained. Wu has suggested a convex variational segmentation model that ignores the factor and uses the idea of coefficient of variation (CoV). Wu et al. [42] has suggested a convex variational segmentation model based on the notion of coefficient of variation (CoV), which ignores the factor as well as the existence of noise and outliers in pictures. The fact that their CoV-based image data fitting term is sum of squares divided by sum of picture intensity supports this claim.
To introduce our new selective and global segmentation model, for segmenting the object of interest and all objects in a given image having intensity in-homogeneity, first we shortly summarize some selective segmentation models related to this work.

A. DUAL LEVEL-SET MODEL FOR SELECTIVE SEGMENTATION
Rada et al. [31], introduced a model for global and local selective segmentation, based on two level-sets, that is local and global level-sets. For local level sets, region-based terms are required for this model. Using C G = ∂ G in for the global curve to locate the features of the image I , and C L = ∂ L in for the desired selective curve, the Rada et al. [31] minimization equation is min ψ L (x,y),ψ G (x,y),e 1 ,e 2 F ζ (ψ L (x, y), ψ G (x, y), e 1 , e 2 ) where β 1 , β 2 , β L , β G , η 1G , η 2G , η 1 , η 2 and η 3 are all positive parameters, d(x, y) is a distance function and g is the edge detector function defined in [19]. le 1 , le 2 are the intensity means in the local interior and local exterior, respectively. Keeping ψ fixed and minimizing Eq. (1) with respect to le 1 and le 2 , let (1 − H L (ψ L )) = Z L we obtained the following equations: if the interior and exterior of ψ G (x, y) are non-empty. κ σ is a Gaussian kernel function with the standard deviation σ . Keeping le 1 , le 2 fixed, and minimizing Eq. (1) with respect to ψ L (x, y) and ψ G (x, y).
This model may not work well for images with intensity in-homogeneity and noise, for examples Figs. 11 and 12.

B. TEXTURAL AND IN-HOMOGENEOUS OBJECT EXTRACTION MODEL
For the segmentation of multiple objects with intensity difference and in-homogeneity, Mabood et al. [32] introduced a selective segmentation model. This model is based on the average image of channels (AIC), and segment images having texture and noise. For texture image segmentation, the authors utilize the extended structure tensor (EST) in order to obtain the AIC.
The classical structure tensor (CST) J σ is given by Gaussian smoothing of tensor product of the image gradient, κ σ is a Gaussian kernel function with standard deviation σ , x, y in the subscript denote the partial derivatives.
The EST J E σ for a gray-scale image I defined by By Computing the EST one can obtain the AIC of all the channels J E σ,i ∈ J E σ for i = 1, 2, . . . , 9. The AIC is given by: Mabood et al. [32] minimization functional as follows: where the first term is the edge detector function and blends of metric, while the second term is the data term which uses the information from the AIC to tackle textural and noisy objects of interest. The data term D performs better for detecting homogeneous intensity objects and is robust against noise [19], but for the images with intensity in-homogeneity, the performance is poor.

C. WEIGHTED VARIATIONAL MODEL FOR SELECTIVE IMAGE SEGMENTATION (Liu)
Liu et al. [33] proposed a model, which applies the weighting ω to the data fitting terms for adjusting the fidelity and smoothing terms, and the minimization problem is given by where the parameters µ, µ 2 , λ ≥ 0, ω(x, y) = 1 − D(x, y)g(|∇z|), D is a distance function from marker set M (see [33]).

D. SELECTIVE SEGMENTATION MODEL FOR MULTI-REGIONS WITHIN THE OBJECT OF INTEREST
Ali et al. [38] proposed a selective segmentation model based on generalized averages, the minimization functional is given by: where the parameters µ, η 1 , η 2 and v are non-negative, g is the edge detector function, d is a distance function, A 1 , A 2 are the areas inside and outside the initial polygon respectively, le 1 is the generalized mean of the polygon constructed with the help of markers, le 2 is the generalized mean intensity outside the desired object, ψ is a level set function and H ζ is the regularized Heaviside function. They aims that the method is working good for detecting single-region and an outperforming for multi-region selective segmentation.

III. PROPOSED MODEL
Motivated by the local and global region-based active contour models [15], [18], they may fail to segment images with the in-homogeneous intensities, or if the intensity difference between two objects is very small. We proposed a new efficient and robust region-based model for noisy images having intensities homogeneous and in-homogeneous.
Let us denote the given image by I , the global evolving curve by C G = ∂ G in , and the desired selective curve by In such a way, the unknown quantities C L , C G are replaced respectively by ψ L , ψ G . To seek the possible advantages of having expanded domain of G within a distance r, define where the parameter r = 0 or r = 3, and L ⊂ G ⊆ G,r ⊂ .
By keeping in mind the idea of searching selective features L in the local domain G , and all features G in the whole image domain , we consider a new variational model: where to control the possible noise. To derive the level set formulation for the Eq. (10), first ψ L (x, y) and ψ G (x, y) will be scaled automatically with new term as in [14]. For computing the weight length of C L to G,r in place of we compel the search domain, Replacing the non-differentiable function H by regularized Heaviside function H ζ as in [1], [2]. We will use the following Heaviside functions where the gauss error function (erf (y)) is double of the integral of Gaussian distribution N (0, 1 2 ) having the form: The function H 1ζ , H 2ζ and its corresponding delta functions δ 1ζ , δ 2ζ have small support in the interval [−ζ, ζ ], but H 3ζ and δ 3ζ are non-zero all over. We suggest to use H 1ζ or H 2ζ because δ 3ζ may not be good for the case where the features of interest is lower than two pixels aside from other features, the problem will be resolved if we adjust ζ while we lose the automatic efficiency. The Eq. (10) with the regularized Heaviside function and local similarity factor in [34], can be written as: where β L > 0, β G > 0 and le 1 , le 2 are the intensity means in the local interior and local exterior respectively. N x is a neighborhood of x. Simply we will write d, I , ψ L and ψ G for d(x, y), I (x, y), ψ L (x, y) and ψ G (x, y) respectively. Assume that ψ G (x, y) has neither empty interior nor empty exterior, then keeping ψ fixed and minimizing Eq. (13) with respect to le 1 and le 2 , we obtained the following equations: κ σ is a Gaussian kernel function with the standard deviation σ .
Keeping le 1 , le 2 fixed, and minimizing Eq. (13) with respect to ψ L (x, y) and ψ G (x, y). To find the first variation of F ζ with respect to ψ L , we minimize F ζ with respect to ψ L by using the Gâteaux derivative lim h→0 d dh (F ζ (ψ L + hφ, le 1 , le 2 )) = 0.
Following the same procedure as in [19], we get the Euler-Lagrange equation for ψ L : where W = d(x, y)g(∇I (x, y)) and the boundary conditions reduce to Neumann boundary conditions: By the same procedure, we can get the Euler-Lagrange equation for ψ G .
To speedify the convergence, we add the ballon terms αW|∇ψ L |, αg(x, y)|∇ψ G | in equation for ψ L and ψ G respectively. So the equation for ψ L and ψ G are: To get the linear system of equations, we freeze the nonlinear coefficients in Eqs. (17) and (18), then it can be solved by the fixed point method. The deficiency of the fixed point method is the computational cost of the related linear system for large images. We develop a fast technique analogously to [2], [19], [36].

IV. SOLUTION OF THE PROPOSED METHOD
For solving Eqs. (17) and (18), we choose an efficient additive operator splitting technique (AOS) [35], [36] which is low computationally cost and fast convergent. Consider the parabolic equations related to Eqs. (17) and (18) respectively.
Let's denote this by: So the compact form of Eqs. (19) and (20) can be written as: We have to iterate Eq. (21) because it has nonlinear coefficients and ψ L , ψ G are dependent on each other. Both the equations in Eq. (21) are of the same disjoint form. It will be enough to solve the second equation: In x coordinate direction,the semi implicit form of Eq. (22) for a step size s 1 = s 2 = s = 1, where In the same way, in y coordinate direction: Solving the uncoupled system of Eqs. (24) and (28) in the equality of AOS, with the time step 2∇τ in the directions of x, y respectively, and then take the mean of the two solutions with the result equivalent to a coupled semi-implicit system and time step ∇τ . The matrix form of Eqs. (24) and (28)    where I is the identity matrix,ĥ k = ψ k + ∇τ h k , B I is a tri-diagonal matrix containing (v 1 , −v 2 , v 3 ) andv 1 , −v 2 ,v 3 respectively for I = 1, 2.

V. EXPERIMENTAL RESULTS
This section includes experimental results to clarify the performance, robustness, and accuracy of the proposed model, also some comparison with the exiting models [31]- [33] on homogeneous, in-homogeneous, and noisy images. We executed the experiment on medical, synthetic, artificial, and real images with different shapes and contours. The test images are taken from the datasets available online at kaggle. 1 1 https://www.kaggle.com/ The better performance of our proposed model in terms of efficiency, quality, robustness, and speed will be observed. All the experiments were carried out using Matlab 9.10.0 on a core i7 computer with 8GB RAM, 2.70GHz processor, window 10 operating system. The image size choose 128 or 256 and the parameters are η 1 = η 2 = η 3 = 1, η 1G = η 1G = 1, τ = 4, step space h = 1, time step ∇t = 0.1 or 0.01 or 0.001 or 0.2, α = 0.001, η L = η G = 0.4, β 1 = β 2 = m 2 10 . The initial global and local level sets have the form: where (x 0 G , y 0 G ), (x 0 L , y 0 L ) are the center of the circle and center of the markers in a set D, respectively. Moreover, r 0 G = m 5 is radius, r 0 L = min a =b ||p a − p b || is the minimum distance of the markers, a, b ∈ D, where .   The choices of parameters and the initialization of the initial level are the same as for [31] and [19]. Further, we divide this section as follows:

A. TEST SET-1: ROBUSTNESS OF THE PROPOSED MODEL
Test Set-1 consists of experimental results on different images of our proposed model. In Figure 1, the first-row containing images with many features, that is the tomographic image taken from Furat et al. [37] and the medical image. The second row is their successful local segmentation results and the third row is their segmented features. On these images, we test the proposed model where one object is to be selected. These In Test Set-2, we compare our model locally and globally with Rada et al. [31] for 10 different images. Figure 3 is the comparison for a simple clean image, Figs. 4, 7 are   for images with background intensities are in-homogeneous, Figs. 5, 6, 8 are for images having objects with different intensities, Figs. 9, 10 and 11 are for medical images having the intensity difference is small between the object and its neighbor and Figure 12 for a noisy image. Better performance can be seen in all these test as compare to Rada et al. [31]. Table 1, which is CPU time and iterations comparisons of the proposed model and Rada et al. [31] shows that the proposed model is more efficient than the other. For the same images as in Test Set-2 and different cases with respect to intensity in-homogeneity Figure 13, are the comparison of our proposed model with the existing models Liu et al. [33] and Mabood et al. [32]. Better performance can be seen of our proposed model, while Liu et al. is not working for these images, and the Mabood et al. results are not good.

D. QUANTITATIVE ANALYSIS
To ensure the transparency of the experimental analysis we use the Jaccard ans Sφrensen-Dice similarity similarities indices. Let I S is the segmented result found by the model algorithm and I G is the ground truth of the same image.

1) JACCARD SIMILARITY
The Jaccard similarity coefficient computed as: where | . | denotes the cardinality. The range of the Jaccard value is in [0, 1]. The higher Jaccard value shows better segmentation result.

2) SφRENSEN-DICE SIMILARITY
The Sφrensen-Dice similarity is computed as     Table 2 shows the JS coefficients comparison and Table 3 shows Sφrensen-Dice coefficients comparison of our proposed model with other competing models Liu et al. [33], Mabood et al. [32] and Rada et al. [31]. The results are obtained from experiments on 10 different images suitable for interactive segmentation with a pre-labeled ground truth consisting of the mean of the labeled ground truth. It can be observed that Rada et al. produced relatively better results compared to Liu et al. and Mabood et al., but for a high noisy or low intensity image it loses the details. From the results it is clear that our model perform better than the other competing models.

VI. CONCLUSION AND FUTURE WORK
This article mainly focuses on designing a new variational model with dual-level set functions for local and global segmentation which performs better segmentation for images having multi-region, multi-object, noisy, and intensity in-homogeneity. Moreover, the new model is efficient in medical and synthetic images having objects with non-uniform features. Experimental results show that the new model is faster, efficient and reliable than the models Rada et al. [31] (global and selective segmentation), Mabood et al. [32], Liu et al. [33] (selective segmentation). To achieve proper picture segmentation in the presence of noise and outliers, outliers must be identified and isolated during the denoising pre-processing or appropriate limitations must be imposed on the segmentation framework. For accurate picture segmentation in the future, we will apply appropriate eliminating outliers requirements backed by a well-designed theory in a variational framework.

ACKNOWLEDGMENT
The code of the proposed method will be provided for research purposes if requested via email.  MUHAMMAD ZAKARYA (Senior Member, IEEE) received the Ph.D. degree in computer science from the University of Surrey, Guildford, U.K. He is currently a Lecturer with the Department of Computer Science, Abdul Wali Khan University Mardan (AWKUM), Pakistan. He is the Program Director of the iFuture: a leading research group at AWKUM which has research collaboration with the CLOUDS Laboratory, The University of Melbourne, Australia, and the IoT Laboratory, Cardiff University, U.K. He has deep understanding of the theoretical computer science and data analysis. Furthermore, he also owns deep understanding of various statistical techniques which are, largely, used in applied research. His research has appeared in several international conferences, journals, and transactions of repute. His research interests include cloud computing, mobile edge clouds, the Internet of Things (IoT), performance, energy efficiency, algorithms, and resource management. He is a TPC member of few prestigious international conferences, including CCGrid, GECON, and UCC. He is also an Associate Editor of IEEE ACCESS journal and Journal of Cloud Computing (Springer). He is also a Guest Editor of Cluster Computing journal (Springer). He has been listed in the world's top 2% scientists list for 2020.
AFTAB AHMED received the Ph.D. degree in electronic engineering from the University of York, U.K., in 2019. He is currently a Lecturer with the Computer Science Department, Abdul Wali Khan University Mardan, Pakistan. His research work is related to improvement in performance in ultra-dense high-capacity networks. His other research interests include radio resource management, topology management to improve system performance and overall energy efficiency in ultra-dense high-capacity wireless networks, and machine learning.
IZAZ UR RAHMAN received the Ph.D. degree in computer science from the Department of Electronic and Computer Engineering, Brunel University, U.K. He is currently an Assistant Professor with the Department of Computer Science, Abdul Wali Khan University Mardan, Pakistan. His research interests include power systems, optimization algorithms, the Internet of Things, and artificial intelligence.
MUSHTAQ RAZA received the Ph.D. degree in computer science from the Faculty of Sciences, University of Porto, Portugal, with a focus on software engineering. He is currently an Assistant Professor of computer science with Abdul Wali Khan University Mardan (AWKUM) and a Research Collaborator with the Institute for Systems and Computer Engineering, Technology and Science (INESC TEC), Porto. Previously, he was a Researcher with INESC TEC and has published more than 20 papers in renowned journals and conferences in software engineering. His research interests include software process improvement, machine learning, big data analysis, software engineering, and the Internet of Things (IoT). He is also a Program Committee Member of ICSSP, top conference in software engineering, and a Focal Person of the National Technology Fund with AWKUM.
MUHAMMAD HALEEM is currently an Assistant Professor with the Department of Computer Science, Faculty of Engineering, Kardan University, Kabul, Afghanistan. His research interests include the Internet of Things, machine learning, and data analytics.