A Modiﬁed GrabCut Using a Clustering Technique to Reduce Image Noise

: In this paper, a modiﬁed GrabCut algorithm is proposed using a clustering technique to reduce image noise. GrabCut is an image segmentation method based on GraphCut starting with a user-speciﬁed bounding box around the object to be segmented. In the modiﬁed version, the original image is ﬁltered using the median ﬁlter to reduce noise and then the quantized image using K-means algorithm is used for the normal GrabCut method for object segmentation. This new process showed that it improved the object segmentation performance a lot and the extract segmentation result compared to the standard method.


Introduction
Digital image processing deals with a wide variety of applications ranging from biology, military, medical, space science, art, games and movie industries.
The object segmentation is an important step in image processing and analysis [1].In computer vision, segmentation divides the input image into background and objects.The purpose of the segmentation is to simplify and make it easy to interpret or convert to more meaningful representation of an image.Segmentation is one of the most difficult subjects in an digital image processing, and many studies on this subject have been done to get more accurate results.
GrabCut method is based on object segmentation algorithm called GraphCut [2,3].While GraphCut algorithm segments an image without user intervention, GrabCut accepts an interest area defined by a user and extracts objects using the clues given to get better results.Many studies have been done to improve performance of GrabCut detecting objects in unknown regions [4,5].
In the proposed method, the image is smoothed using median filter and the quantized using k-means clustering technique.Then, GrabCut extracts objects from the quantized image [6].In this way, we got improved performance.

Related Work
In general, object segmentation is one of the most fundamental tasks in image processing.Image segmentation is to divide an image into a number of pixel sets on the basis of shape or area.In this work, we following image filters and a clustering technique is applied for an efficient object segmentation.

Image Filter
Filtering is one of the main tasks of signal processing.Filtering is used to remove noise in the image, to extract visual characteristics of interest, and to resample the image.Representative filters are Gaussian filter, Mean, etc. Gaussian filter is used to remove the noise using the following equations: Gpx, yq " where σ is the standard deviation.Mean filter is the representative noise removing filter and is defined as follows: where Ipx `i, y `jq is a neighbor pixel and W is a mask of size p2N `1q ˆp2N `1q.

Image Segmentation
Segmentation is the process of dividing the digital image into a set of multiple pixels to simplify the image representation.Typical methods of image clustering are Mean Shift (MS), Fuzzy C-Means (FCM), etc. [7].
Mean shift (MS) is a procedure for locating the maxima of a given window area by selecting a pixel (mode) most close to the averaged color, then moving the center of the window to the mode to find local maxima repeatedly until it is converged [8,9].The result of MS is good in low frequency areas, but it has some difficulties to group high frequency areas.The following Figure 1 show the example.Filtering is one of the main tasks of signal processing.Filtering is used to remove noise in the image, to extract visual characteristics of interest, and to resample the image.Representative filters are Gaussian filter, Mean, etc.
Gaussian filter is used to remove the noise using the following equations: where σ is the standard deviation.
Mean filter is the representative noise removing filter and is defined as follows: is a neighbor pixel and W is a mask of size (2 + 1) × (2 + 1).

Image Segmentation
Segmentation is the process of dividing the digital image into a set of multiple pixels to simplify the image representation.Typical methods of image clustering are Mean Shift (MS), Fuzzy C-Means (FCM), etc. [7].
Mean shift (MS) is a procedure for locating the maxima of a given window area by selecting a pixel (mode) most close to the averaged color, then moving the center of the window to the mode to find local maxima repeatedly until it is converged [8,9].The result of MS is good in low frequency areas, but it has some difficulties to group high frequency areas.The following Figure 1  FCM is to overcome the difficulty of MS by considering belonging or membership degree into the distance.Data-points close to a cluster center have a high belonging degree [10,11].
a data set to be clustered, where p is feature dimension, p R is a real vector space, and N is the number of pixels.Each pixel of color image is expressed as feature vectors like 1 ,, , where p is feature dimension and C is the number of clusters.FCM calculates matrix U minimizing the target function FCM is to overcome the difficulty of MS by considering belonging or membership degree into the distance.Data-points close to a cluster center have a high belonging degree [10,11].
Let X " x 1 , ¨¨¨, x N Ď R p a data set to be clustered, where p is feature dimension, R p is a real vector space, and N is the number of pixels.Each pixel of color image is expressed as feature vectors like x k " x k1 , ¨¨¨, x kp and center of cluster is V " pv 1 , ¨¨¨, v C q, where p is feature dimension and C is the number of clusters.FCM calculates matrix U minimizing the target function J FCM pU, V|Xq .
Symmetry 2016, 8, 64 where u ik " 1, and u ik is membership degree that data k belongs to cluster i. V j is the center of cluster i, defined using Equation (5).
where u ik is the mean value of x k using fuzzy constant m.One disadvantage of FCM is that the number of clusters should be provided in advance.Figure 2 is the class membership map applying FCM algorithm and Figure 3 is result of FCM clustering.
Symmetry 2016, 8, 64 3 of 9 where , and ik u is membership degree that data k belongs to cluster i. j V is the center of cluster i, defined using Equation (5).
where ik u is the mean value of Image segmentation can be accomplished also by using GraphCut.Boykov proposed GraphCut to get optimized interactive image segmentation: where α is a vector of either 0 or 1. 0 means background and 1 means object.(α)

U is continuity between adjacent pixels and () α
V is a data term representing how much the data belongs to object or background.Data term requires prior information about object and background, and provided probability density function, data term calculated using Equation (7).
where b H and o H are histograms of background and object, p is a pixel and P is a pixel set of an image.p I is the intensity of pixel P. Figure 4 is result of GraphCut algorithm that is another typical method of image segmentation., and ik u is membership degree that data k belongs to cluster i. j V is the center of cluster i, defined using Equation (5).
where ik u is the mean value of k x using fuzzy constant m.One disadvantage of FCM is that the number of clusters should be provided in advance.Figure 2 is the class membership map applying FCM algorithm and Figure 3  Image segmentation can be accomplished also by using GraphCut.Boykov proposed GraphCut to get optimized interactive image segmentation: where α is a vector of either 0 or 1. 0 means background and 1 means object.(α) U is continuity between adjacent pixels and () α V is a data term representing how much the data belongs to object or background.Data term requires prior information about object and background, and provided probability density function, data term calculated using Equation (7).
where b H and o H are histograms of background and object, p is a pixel and P is a pixel set of an image.p I is the intensity of pixel P. Figure 4 is result of GraphCut algorithm that is another typical method of image segmentation.Image segmentation can be accomplished also by using GraphCut.Boykov proposed GraphCut to get optimized interactive image segmentation: where α is a vector of either 0 or 1. 0 means background and 1 means object.Upαq is continuity between adjacent pixels and Vpαq is a data term representing how much the data belongs to object or background.Data term requires prior information about object and background, and provided probability density function, data term calculated using Equation (7).
V pαq " where H b and H o are histograms of background and object, p is a pixel and P is a pixel set of an image.I p is the intensity of pixel P. Figure 4 is result of GraphCut algorithm that is another typical method of image segmentation.

The proposed Method
The flow of proposed method is show in Figure 5.

Clustering to Reduce Noise
Digital image can be contaminated during data transmission.
where N is the size of data set.K-means clustering method is applied to the output of the filter.Kmeans classifies the data set to the predefined number of classes.Let μ i be the center of i-th cluster and   be the set of pixels belongs to cluster i.The variance of all the data set is defined as Equation (9).
The goal is to find   minimizing V. K-means starts with arbitrary initial values μ  .Allocating pixels to close μ  and recalculating μ  is repeated until it is converged.10) is the simplest clustering method minimizing   repeatedly.Figure 6 shows applied the median filter in image.

The proposed Method
The flow of proposed method is show in Figure 5.

The proposed Method
The flow of proposed method is show in Figure 5.

Clustering to Reduce Noise
Digital image can be contaminated during data transmission.
where N is the size of data set.K-means clustering method is applied to the output of the filter.Kmeans classifies the data set to the predefined number of classes.Let μ i be the center of i-th cluster and   be the set of pixels belongs to cluster i.The variance of all the data set is defined as Equation (9).
The goal is to find   minimizing V. K-means starts with arbitrary initial values μ  .Allocating pixels to close μ  and recalculating μ  is repeated until it is converged.10) is the simplest clustering method minimizing   repeatedly.Figure 6 shows applied the median filter in image.

Clustering to Reduce Noise
Digital image can be contaminated during data transmission.
where N is the size of data set.K-means clustering method is applied to the output of the filter.K-means classifies the data set to the predefined number of classes.Let µ i be the center of i-th cluster and S i be the set of pixels belongs to cluster i.The variance of all the data set is defined as Equation ( 9).
V " The goal is to find S i minimizing V. K-means starts with arbitrary initial values µ i .Allocating pixels to close µ i and recalculating µ i is repeated until it is converged.
Equation ( 10) is the simplest clustering method minimizing J MSE repeatedly.Figure 6 shows applied the median filter in image.

Object Segmentation Using Improved GrabCut
GrabCut accepts an interest area defined by a user and extracts objects using the clue given.Figure 7 shows trimap of foreground of GrabCut algorithm.Object and background is mixed in unknown region.Background   is defined as Equation (11). where is the area greater than gradient.Symbol ⊕ is a dilation operator and S is a structure element for it.A Gaussian mixture model is a probabilistic model that assumes all the data points are generated from a mixture of a finite number of Gaussian distributions with unknown parameters and is given by: Where i-th vector component is characterized by normal distributions with weights α  and a pair of mean and covariance θ  .ω  represents relative importance.α  is defined as follows: 1 0 α 1 and α 1 Parameters for GMM (Gaussian Mixture Model) of M components is expressed as Equation ( 14):

Object Segmentation Using Improved GrabCut
GrabCut accepts an interest area defined by a user and extracts objects using the clue given.Figure 7 shows trimap of foreground of GrabCut algorithm.

Object Segmentation Using Improved GrabCut
GrabCut accepts an interest area defined by a user and extracts objects using the clue given.Figure 7 shows trimap of foreground of GrabCut algorithm.Object and background is mixed in unknown region.Background   is defined as Equation (11). where is the area greater than gradient.Symbol ⊕ is a dilation operator and S is a structure element for it.A Gaussian mixture model is a probabilistic model that assumes all the data points are generated from a mixture of a finite number of Gaussian distributions with unknown parameters and is given by: Where i-th vector component is characterized by normal distributions with weights α  and a pair of mean and covariance θ  .ω  represents relative importance.α  is defined as follows: 1 0 α 1 and α 1 Parameters for GMM (Gaussian Mixture Model) of M components is expressed as Equation ( 14): Object and background is mixed in unknown region.Background T B is defined as Equation (11).
where Γ pzq " ∇g ppq y t + is the area greater than gradient.Symbol ' is a dilation operator and S is a structure element for it.A Gaussian mixture model is a probabilistic model that assumes all the data points are generated from a mixture of a finite number of Gaussian distributions with unknown parameters and is given by: where i-th vector component is characterized by normal distributions with weights α i and a pair of mean and covariance θ i .ω i represents relative importance.α i is defined as follows: 0 ď α i ď 1 and Parameters for GMM (Gaussian Mixture Model) of M components is expressed as Equation ( 14): θ " pµ 1 , µ 2 , . . ., µ M , . . ., θ 2 1 , θ 2 2 , . . ., θ 2 M , α 1 , α 2 , . . ., α M q (14) T U is defined as follows: T U " T F ´TB (15) Figure 8 shows a result of the improved GrabCut algorithm.

Experiment and Discussion
The experiments were performed using about 400 photos such as figures, plants, food, etc. Performance of GraphCut, standard GrabCut and proposed method is compared.Figure 9 shows some results.GrabCut is better than GraphCut and, the proposed method shows better results than GrabCut in most cases by detecting background in unknown area [12,13].
Evaluation is performed using precision and recall.Precision is the fraction of retrieved instances that are relevant, while recall (also known as sensitivity) is the fraction of relevant instances that are retrieved: where (•) is the number of pixels,   is the object and   is ground truth objects.Figure 10 shows the precision and recall of three methods.The proposed method gives the best result.Experiments are performed using PSNR (Peak Signal to Noise Ratio).PSNR is the ratio between the maximum possible power of a signal and the power of corrupting noise that affects the fidelity of its representation.

Experiment and Discussion
The experiments were performed using about 400 photos such as figures, plants, food, etc. Performance of GraphCut, standard GrabCut and proposed method is compared.Figure 9 shows some results.GrabCut is better than GraphCut and, the proposed method shows better results than GrabCut in most cases by detecting background in unknown area [12,13].
Evaluation is performed using precision and recall.Precision is the fraction of retrieved instances that are relevant, while recall (also known as sensitivity) is the fraction of relevant instances that are retrieved: where N p¨q is the number of pixels, Obj EX is the object and Obj GT is ground truth objects.Figure 10 shows the precision and recall of three methods.The proposed method gives the best result.Experiments are performed using PSNR (Peak Signal to Noise Ratio).PSNR is the ratio between the maximum possible power of a signal and the power of corrupting noise that affects the fidelity of its representation.Table 1 shows the quantitative comparison of result experiments.Table 1 shows the quantitative comparison of result experiments.Table 1 shows the quantitative comparison of result experiments.

Conclusions
In this paper, a modified GrabCut method is proposed using median filter and k-means clustering technique to reduce image noise and to extract objects better.An image is preprocessed and then used for the input of standard GrabCut.This method showed better performance than GraphCut or standard GrabCut from the various and complex pictures like medical images, traffic images and people images.This research should be extended further to detect objects in video, and this can be used in many industrial applications.

Figure 5 .
Figure 5.A flowchart of the proposed method.

Figure 5 .
Figure 5.A flowchart of the proposed method.

Figure 5 .
Figure 5.A flowchart of the proposed method.

Figure 6 .
Figure 6.An image applied the median filter image.(a) Original image; (b) Result image.

Figure 6 .
Figure 6.An image applied the median filter image.(a) Original image; (b) Result image.

Figure 6 .
Figure 6.An image applied the median filter image.(a) Original image; (b) Result image.

Figure 8 Figure 8 .
Figure8shows a result of the improved GrabCut algorithm.
Squared Error) is the difference between the estimator and what is estimated.Where MSE is defined as follows: