1 Introduction

Magnetic resonance imaging or MRI is a radiology system that utilizes radio waves and magnetism in addition with a computer to deliver the mages of a body structures. Originally, MRI is also called as “nuclear magnetic resonance imaging (NMRI)” as well as “magnetic resonance tomography (MRT)” and is the type of a “nuclear magnetic resonance (NMR)” which is a therapeutic utilization of a nuclear magnetic resonance (NMR). Nuclear magnetic resonance is a physical marvel in which the nuclei in a magnetic field assimilate and reproduce electromagnetic radiation which can likewise be utilized for imaging in other NMR applications, for example, NMR spectroscopy. NMR is likewise routinely utilized in the advanced medical imagining systems, for example, in MRI. “Computed tomography (CT),” “magnetic resonance imaging (MRI)”, “digital mammography,” as well as other imaging modalities provide effective means for a noninvasive analysis of the anatomy of a subject. The brain is the front-most piece of central nervous system. Alongside the spinal cord, it forms the “central nervous system” (CNS). In a field of medicinal science, an eccentric cell magnification inside the cerebrum is kenned as a tumor. Brain in the human body is the most delicate fragment. The most important part in the brain or a cerebrum MRI can isolate between white matter what’s more with the grey matter-GM and can in like manner be utilized to investigate aneurysms at the same time tumors also. Since MRI does not use an X-rays or another radiation, it is an imaging approach of choice where an incessant imaging is required for the assurance or else treatment, particularly in the cerebrum or in the brain [1,2,3,4].

In this paper, we proposed optimized KPCM clustering using level set method, which is motivated by the KPCM clustering and PSO algorithms to modify and overcome the drawbacks of the existing techniques such as outlier reduction, spatial information, noise, and distance metric. In an existing method, the development of the algorithm “FCM” was pragmatic to the image segmentation concerns particularly simply on the one side, which were often could not be enough to yield the acceptable outcomes. Therefore, in the proposed process, we do integrate an algorithm which is single as well as number of improvements that are deemed to be a relevant one. From the experimental results, we can say that the proposed process gives an improved segmentation results. For the medical images, cluster boundaries found through the utilization of optimized KPCM were used as initial contours for a level set [5,6,7,8].

This paper was organized as follows: Sect. 2 is the introduction and how to calculate the best fitness values in an image by using particle swarm optimization. Section 3 discusses the algorithm “kernel-based possibilistic fuzzy c-means (KPFCM)” clustering. An implementation of the proposed optimized KPFCM clustering using level set formulation is described in Sect. 4. In Sect. 5, we present experimental results as well as discussion of planned algorithm by utilizing synthetic images, simulated along with the real MR brain images. At last, in Sect. 6 we presented the conclusion and future scope.

2 Particle Swarm Optimization (PSO) Algorithm

2.1 Calculate Optimum Pixel Values by Using PSO Algorithm

Kennedy and in addition Eberhart (1995) [9] stayed enlivened to have an improvement in look system of PSO by the scavenging conduct of groups of fowls along with schools of a fish. Every particle has its own location as well as velocity, at which a quality speaks to the factors of a choice in the present emphasis along with the development vector for the following cycle, separately. A velocity additionally the position of each and every particle as needs be varieties to the information which is partaken in the middle of each particle in the present cycle. The most vital preparing step is that to figure the novel velocity as well as the location of every particle in the following procedure by utilizing the conditions (1) and (2).

$$ \begin{aligned} v_{id} (t + 1) & = w*v_{id} (t) + c_{1} r_{1} (x_{p(id)} (t) - x_{id} (t) \\ & \quad + c_{2} r_{2} (x_{gd} (t) - x_{id} (t))) \\ \end{aligned} $$
(1)

At which, \( v_{id} (t) \) indicates the value of velocity of dth.

Dimension’ of ith particle in tth-iteration. A variable \( x_{id} \)(t) indicates location of dth dimension if ith particle in tth iteration. A variable w is a weight of inertia, \( c_{1} \) self-cognition acceleration coefficient, and \( c_{2} \) social cognition acceleration coefficient.

$$ x_{id} (t + 1) = x_{id} (t) + v_{id} (t + 1) $$
(2)

Equation (2) represents new location of every particle which is refreshed utilizing a first position along with the new velocity by a condition (1), at which \( r_{1} \) and additionally \( r_{2} \) were produced independently. The range of uniform distributed random numbers is (0, 1).The below segment depicts quickly about these two classes of estimations of parameter segment.

The parameters inertial weight (w), acceleration coefficients c1 and c2 and r1 and r2 are used in Eq. (1). The proper values are choosing for better results. Standard PSO algorithm utilizes the c1 and c2 which are equal to 2. For better segmentation results, changes are made in the inertial weight (w) and acceleration coefficients according to the specific application, which is called “adaptive PSO”. In this work, we considered the following parameter values for optimum pixel calculation from the input image. The parameter values used in this paper are as shown in Table 1.

Table 1 Parameters used to get optimum pixel values

3 Kernel Possibilistic FCM (KPCM) Clustering

In our proposed algorithm, changes are made in the preprocessing an image to improve segmentation accuracy. In this paper, some modifications are done in the conventional clustering technique, i.e., possibilistic c-means (PCM) clustering. The improved PCM clustering is called kernel possibilistic c-means (KPCM) clustering by incorporating the Gaussian function as a kernel and modifying the distance metric, i.e., Euclidian distance, which is replaced by Mahalanobis distance to get the smaller distance between pixels and cluster centers. The noise effect in the MRI brain Images is overcome by spatial information of both local and nonlocal, and membership. The objective utility of Kernel-based PFCM is incorporated through this modified distance metric. To overcome all this limitation, the subsequent algorithm is called “kernel-based possibilistic fuzzy c-means (KPFCM)”. We utilize a Gaussian function as kernel function to incorporate this function into the PCM clustering, which is called kernel PCM clustering. These results intended for the enhanced segmentation [10, 11].

3.1 Kernel Possibilistic C-Means (KPCM) Algorithm

“Kernel possibilistic clustering algorithm (KPCM)” had taken into consideration to overcome issues of robustness against the noise, outliers as well as the arbitrarily shaped clusters’ boundaries. Keller in addition with krishnapuram introduced the new below objective function by utilizing the modified distance metric called mahalanobis distance is as following.

$$ J_{\text{PCM}} = \sum\limits_{i = 1}^{c} {\sum\limits_{k = 1}^{n} {\mu_{ik}^{m} d^{2} (x_{k} ,V_{iopt} ) + \sum\limits_{i = 1}^{c} {\eta_{i} \sum\limits_{k = 1}^{n} {(1 - \mu_{ik} )^{m} } } } } $$
(3)

At which ‘d’ represents the distance of Mahalanobis:

$$ d^{2} (x_{k} ,V_{iopt} ) = (x_{k} - V_{iopt} )^{T} S_{i} (x_{k} - V_{iopt} ) $$
(4)
$$ S_{i} = \left| {\mathop \sum \limits_{i} } \right|^{{\frac{1}{p}}} \sum_{1}^{ - 1} $$
(5)

where xk is pixels of an image, n total number of pixels, ‘C’ number of clusters, and \( V_{iopt} \) optimum cluster center.

p = 1, dimension problem, as well as \( \eta_{i} \) were positive numbers.

An initial term of Eq. (3) campaigns for a distance minimum

In between prototypes in addition with data types, at the same time \( \mu_{ik} \) should be large as possible as. Here, \( \eta_{i} \) were preferred as:

$$ \eta_{i} = K_{1} \frac{{\sum\nolimits_{k = 1}^{n} {\mu_{ik}^{m} \left\| {x_{k} - V_{iopt} } \right\|^{2} } }}{{\sum\nolimits_{k = 1}^{n} {\mu_{ik}^{m} } }} $$
(6)

K1 was preferred to be a 1, and PCM memberships were modified as below:

$$ \mu_{ik} = \frac{1}{{1 + \left( {\left( {\left\| {x_{i} - V_{iopt} } \right\|^{2} } \right)/(\eta_{i} )} \right)^{(1)/(m - 1)} }} $$
(7)

KPCM objective function is represented as:

$$ \begin{aligned} J_{\text{KPCM}} (U,V) & = \sum\limits_{i = 1}^{c} {\sum\limits_{k = 1}^{n} {\mu_{ik}^{m} \left\| {\phi (x_{k} ) - \phi (V_{iopt} )} \right\|} }^{2} \\ & \quad + \sum\limits_{i = 1}^{c} {\eta_{i} \sum\limits_{k = 1}^{n} {(1 - \mu_{ik} )^{m} } } \\ \end{aligned} $$
(8)

By considering KFCM, modified memberships were written as below:

$$ \mu_{ik} = \frac{1}{{1 + \left[ {\frac{{2(1 - K_{1} (x_{k} ,V_{iopt} ))}}{{\eta_{i} }}} \right]^{(1)/(m - 1)} }} $$
(9)
$$ V_{iopt} = \frac{{\sum\nolimits_{k = 1}^{n} {\mu_{ik}^{m} k_{1} (x_{k} ,v_{iopt} )x_{k} } }}{{\sum\nolimits_{k = 1}^{n} {\mu_{ik}^{m} k_{1} (x_{k} ,v_{iopt} )} }} $$
(10)

Here, the Gaussian function was used as kernel function as well as \( \eta_{i} \) were assessed using:

$$ \eta_{i} = K\frac{{\sum\nolimits_{k = 1}^{n} {\mu_{ik}^{m} 2(1 - K_{1} (x_{k} ,V_{iopt} ))^{2} } }}{{\sum\nolimits_{k = 1}^{n} {\mu_{ik}^{m} } }} $$
(11)

Usually, K is preferred to be as 1. We here condense a KPCM algorithm as below.

3.2 Algorithm Steps of Optimized KPCM Clustering

  1. 1.

    Initiate (number of a class: c, fuzziness degree: m>1, criterion stopping:\( \varepsilon \))

  2. 2.

    Optimum cluster centers are obtained by using Eq. (1) and Eq. (2).

  3. 3.

    Initiate the \( U^{t} = 0 \) by utilizing the random values.

  4. 4.

    Assess the \( \eta_{i} \), Eq. (11).

  5. 5.

    a. Modify \( V^{t} \), Eq. (10)

    1. b.

      Modify \( U^{t} \), Eq. (9)

    2. c.

      Stop the process if \( \left| {J_{KPCM}^{t + 1} - J_{KPCM}^{t} } \right| < \varepsilon \),

Or else return to stage 3.

The KPCM algorithm undergoes from the issues of an initialization stage, metric distance, spatial data as well as rejection of outlier. So we propose a single algorithm which considers all these aspects which will be taking into account.

4 Proposed Method

Here in this section, we were proposing the implementation of optimized KPCM clustering by using level set method for robustness and reduce outlier rejection. The implementation of post-processing level set segmentation method is described below [12].

4.1 Implementation to Level Set Segmentation

Active contours are a well-defined method by means of image segmenting [13, 14]. Rather than the parametric classification of active contour, the segmentation of level set is embedding them into a period of subordinate “partial differential equation (PDE)” \( \psi (a,b,c) \). It is then conceivable toward inexact the evolution of active contour’s verifiably through the following level set \( \Gamma (a) \). To introduce spontaneously an initial contour of a level set, we do utilize the subsequent clustering accomplished by optimized KPCM clustering.

$$ \left\{ {\begin{array}{*{20}c} {\psi (a,b,c) < 0,(b,c)\,{\text{inside}}\,\Gamma (a)} \\ {\psi (a,b,c) = 0,(b,c)\,{\text{at}}\,\Gamma (a)} \\ {\psi (a,b,c) > 0,(b,c)\,{\text{inside}}\,\Gamma (a)} \\ \end{array} } \right\} $$
(12)

\( \Gamma \) might be consist as a contour. It could be effortlessly controlled through checking estimations of a level set function \( \psi \), which adjusts to a topological variations of an implicit interface \( \Gamma \). An evolution finishing is controlled by:

$$ \left\{ {\begin{array}{*{20}c} {\frac{\partial \psi }{\partial t} + F\left| {\nabla \psi } \right| = 0} \\ {\psi (0,b,c) = \psi_{0} (b,c)} \\ \end{array} } \right\} $$
(13)

At which, \( \left| {\nabla \psi } \right| \) represents normal direction,\( \psi_{0} (b,c) \) indicates an initial contour, as well as ‘F’ shows a comprehensive forces. An evolving forces F must be regularized through an edge representation capacity g with a specific end goal to stop a level set evolution near to an optimal solution.

$$ g = \frac{1}{{1 + \left| {\nabla (G_{\sigma } *I_{\text{OKPCM}} )} \right|^{2} }} $$
(14)

where \( G_{\sigma } *I_{\text{OKPCM}} \) is convolution in between the Gaussian Kernel \( G_{\sigma } \) and the image IOKPCM. \( \nabla \) is an gradient operator.

Formulation of the segmentation of level set is treated as follows:

$$ \frac{\partial \psi }{\partial t} = g\left| {\nabla \psi } \right|\left( {{\text{div}}\left( {\frac{\nabla \psi }{{\left| {\nabla \psi } \right|}}} \right) + \nu } \right) $$
(15)

Here, \( \left( {{\text{div}}\left( {\frac{\nabla \psi }{{\left| {\nabla \psi } \right|}}} \right)} \right) \) appropriates a mean curvature k in addition with a customable balloon force.

The algorithm called fast level set was introduced in

$$ \frac{\partial \psi }{\partial t} = \mu \zeta (\psi ) + \xi (g,\psi ) $$
(16)
$$ \zeta (\phi ) = \Delta \phi - {\text{div}}\left( {\frac{\nabla \phi }{{\left| {\nabla \phi } \right|}}} \right) $$
(17)

At which, \( \zeta (\psi ) \) shows a penalty momentum of a \( \psi \) as well as \( \xi (g,\psi ) \) is the image gradient data.

$$ \xi (g,\psi ) = \lambda \delta (\psi ) + {\text{div}}\left( {g\frac{\nabla \psi }{{\left| {\nabla \psi } \right|}}} \right) + \nu g\delta (\psi ) $$
(18)

In the above equation, \( \delta (\psi ) \) represents a function of dirac. \( \nu ,\mu \) and \( \lambda \) were the constraints to the control of an evolution level set. The parameter \( \psi \) in Eq. (16), i.e., \( \xi (g,\psi ) \) and \( \zeta (\psi ) \), attracts toward the boundaries of the images and automatically approach nearer to the signed distance function (SDF), espectively.

5 Results and Discussions

Implementation of suggested algorithm is performed on MRI brain T1 image for segmentation of three tissues such as white matter (WM), gray matter (GM) and cerebral spinal fluid (CSF). Dataset is taken from the MRI brain Web science Web site. The proposed results are analyzed and compared with optimized k-means and FCM clustering via level set evolution. The proposed segmentation results are accurate and faster based on the following parameters, i.e., tuning parameter, Dice, Jaccard similarity index, and iterations.

Figures 1 and 2 clearly show that the proposed optimized k-means clustering and optimized FCM clustering and its level set formulation (LSF) which fails to detect and extract the regions of the three tissues compared to the ground truth segmented images So these methods are not superior to an MRI brain T1 as well as coronal brain images compared to the proposed optimized KPCM clustering via LSF. The optimized KPCM clustering via LSF is best suitable for detecting and extracting of three tissues in terms of accurate segmentation of regions by utilizing the particle swarm optimization (PSO) and Mahalanobis distance measured in the preprocessing.

Fig. 1
figure 1

First row shows that original MRI brain T1 image with 3% noise, slice thickness is 1 mm and non-uniformity of pixels 20%, second row figures (bd) depict the ground truth images, and third row images (eg) and fifth row images (km) show that optimized k-means and optimized FCM clustered images and its level set evolution in fourth row (hj) and sixth row (np), respectively; similarly, the seventh and eighth row images such as figures (qs) and (tv) are the proposed optimized KPCM clustered and its level set evolution, respectively. Finally, the last row images (wy) show the extracted segmentation regions from eighth row

Fig. 2
figure 2

First row shows that original MRI brain T1 coronal image with 3% noise, slice thickness is 1 mm and non-uniformity of pixels 20%, second row figures (bd) depict the ground truth images, and third row images (eg) and fifth row images (km) show that optimized k-means and optimized FCM clustered images and its level set evolution in fourth row (hj) and sixth row (np), respectively; similarly, the seventh and eight row images such as figures (qs) and (tv) are the proposed optimized KPCM clustered and its level set evolution, respectively. Finally, the last row images (wy) show the extracted segmentation regions from eighth row

The performance parameters of our proposed model and conventional models are shown in Tables 1 and 2, respectively. So here we can say that optimized k-means clustering via level set formulation (LSF) in terms of Dice similarity (DS) and Jaccard similarity (JS) at which segmentation for the CSF, WM as well as GM tissues could not detected satisfactorily. At the same time, it takes more elapsed time and has less segmentation accuracy. So to improve the drawbacks occurred in Tables 1 and 2, optimized k-means and FCM clustering via level set formulation (LSF) can be done by the proposed method optimized KPCM clustering via level set formulation (LSF). A pixel-based quantitative evaluation approach is used. In this evaluation, approach made a comparison between the final segmented image ‘P’ and ground truth image ′Q’. The segmentation similarity coefficient (SSC) is measured with the help of Dice and Jaccard coefficients. The proposed final level set segmentation results covered the maximum segmented area compared with conventional models. A pixel-based quantitative evaluation approach is used. In this evaluation, approach made a comparison between the final segmented image ‘P’ and ground truth image ‘Q’. The segmentation similarity coefficient (SSC) is measured with the help of Dice and Jaccard coefficients, true positive fraction (TPF), true negative fraction (TNF), false positive fraction (FPF). For the higher values of the Dice and Jaccard coefficients gives the better performance. The Dice and Jaccard indexes can be defined as

Table 2 Performance analysis of optimized k-means, optimized FCM and optimized KPCM clustering via level set model in terms of Dice similarity (DS) index, Jaccard similarity (JS) index, true positive fraction (TPF), and false negative fraction (FNF) measures
$$ {\text{Dice}} = \frac{{2\left| {P \cap Q} \right|}}{\left| P \right| + \left| Q \right|}\quad {\text{Jaccard}} = \frac{P \cap Q}{P \cup Q} $$
(19)
$$ {\text{TPF}} = \frac{P \cap Q}{Q};\quad {\text{TNF}} = 1 - \frac{P - Q}{Q} $$
(20)
$$ {\text{FPF}} = \frac{P - Q}{Q};\quad {\text{FNF}} = \frac{Q - P}{Q} $$
(21)

The performance evaluation parameters such as Dice similarity index (DS), Jaccard similarity index (JS), TPF, TNF, FPF, FNF which we considered in our proposed method, the better performance can be achieved by Dice similarity index (DS), Jaccard similarity index, True Positive Fraction (TNF), True Negative Fraction (TNF) for higher values. Moreover, for higher values of false positive fraction (FPF) and false negative fraction (FNF), it leads to the worst performance. Based on the above-mentioned information, Dice similarity index (DS), Jaccard similarity index (JS), true negative fraction (TNF), and false negative fraction (FNF) of the proposed method give improved results when compared with the conventional methods.

From Table 2, the proposed model is superior and segmentation area is nearly to the accurate areas of ground truth images. All the experimentations are done on MATLAB R2017b 64b in Windows 10 OS with Intel(R) dual core(TM) 64-bit processor, CPU @ 1.80 GHz, 2 GB RAM.

6 Conclusion

Optimized kernel possibilistic FCM clustering (KPCM) using level set method is presented in this paper for the efficient segmentation of three tissues’ MRI brain images. This is used to suppress the noise effect during the segmentation. In our algorithm, PSO with KPCM is performed in the primary step for improving the clustering efficiency and information of mutually local as well as non-local which are included into the KPCM objective utility which is modified by distance metric. Later, in secondary step, for achieving the robust image segmentation using level set method. The segmentation accuracy is measured based on similarity metrics such as Dice similarity, Jaccard similarity, true positive fraction, and false negative fraction. To demonstrate the superiority of our proposed method, we compared our results with optimized k-means and FCM clustering via level formulation. Thus, our proposed method can show better results than all other two methods.