ADAPTIVE PARAMETER SELECTION FOR GRAPH-CUT BASED SEGMENTATION ON CELL IMAGES

Graph cut segmentation approach provides a platform for segmenting images in a globally optimised fashion. The graph cut energy function includes a parameter that adjusts its data term and smoothness term relative to each other. However, one of the key challenges in graph cut segmentation is finding a suitable parameter value that suits a given segmentation. A suitable parameter value is desirable in order to avoid image oversegmentation or under-segmentation. To address the problem of trial and error in manual parameter selection, we propose an intuitive and adaptive parameter selection for cell segmentation using graph cut. The greyscale image of the cell is logarithmically transformed to shrink the dynamic range of foreground pixels in order to extract the boundaries of cells. The extracted cell boundary dynamically adjusts and contextualises the parameter value of the graph cut, countering its shrink bias. Experiments suggest that the proposed model outperforms previous cell segmentation approaches.


INTRODUCTION
Cell segmentation provides an opportunity for experts in the medical sciences to diagnose medical conditions of cancer or tuberculosis with a clear perspective.This suggests that to achieve a fast and objective diagnosis, a reliable and robust segmentation framework is essential.Graph cut provides this platform leveraging a globally optimised segmentation strategy.However, one of the key challenges of graph cut is the selection of a suitable parameter value.The parameter value plays a key role in the segmentation of images by ensuring that important parts of cells such as edges are revealed after segmentation.These parts are often lost when segmenting elongated cells (Vicente et al., 2008).
Segmentation of cell images provides a platform to monitor closely cell mobility relative to the cells' existence and interaction with other surrounding bodies.This process provides the basis for medical diagnoses through observation of shapes and forms of segmented region.However, cells often suffer from non-uniform illumination, with blurry cell boundaries delineating them from their background.In addition, live cells possess dynamic shapes and over selected time frames, they take on different shapes like oval, elongated or irregular.This makes segmentation difficult when using techniques based on cell shapes.Consider the highlighted cell in Fig. 1a at time 84.50 and its position in Fig. 1b at time 86:00; it is clear that the shape of the cells has changed over the time interval.Accurate monitoring or tracking of these cell shapes over a given time frame is therefore crucial for discovery of abnormalities such as cancerous cells (Bengtsson, 1999).In order to deliver a robust graph cut segmentation, a suitable parameter value must be realised.This is imperative because an increase in parameter value will invariably increase graph cut data term resulting in noisy image output (Fig. 2).A decrease in parameter value increases its smoothness term resulting in oversegmentation.As demonstrated in Fig. 3, the graph cut segmentation traverses a shorter route (red boundaries in Fig. 3b) rather than the longer route in Fig. 3a.This suggests that graph cut will by default preferably traverse a shorter route for the segmentation of elongated cells, unless constrained or informed by some algorithm to take the route in Fig. 3a.
Based on the aforementioned facts, the objective of this work is to develop a robust graph cut algorithm that regularises graph cut data term as well as its smoothness term by dynamically altering its parameter value.Several cell segmentation approaches have been proposed in literature leveraging graph cut.For example, a two-stage cell segmentation approach is proposed by Daněk et al. (2009).The first stage segments isolated cells from their background, while the second stage deals with touching cells or cell clusters using shape priors.Qi (2014) proposed a method for segmenting clustered cells through graph cut.The isolation of cell clusters is carried out based on the knowledge that cells are spherical in shape.In addition, a merging algorithm for object segmentation is proposed by Lin et al. (2003) where images are split into units, then a merging algorithm assembles neighbouring units together based on homogeneity criteria.The merging algorithm is explored for cell segmentation by Coelho et al. (2009) and also for object segmentation by Roy and Biswas (2015).Lastly, a supervised cell segmentation based on cell shape and texture properties is proposed by Chen et al. (2013).
While the above approaches give good segmentation results, some of them are not robust in terms of cell over-segmentation.For example, the method proposed by Al-Kofahi et al. (2010) may not perform well when confronted with elongated cells because their approach is based on blob shape priors.Similarly, the GCBAC technique (Chen et al., 2008) may result in under-segmentation, because cells have varying intensity levels.
Our observation of the shrink bias of graph cut and the poor segmentation results of non-uniform illuminated cell images with unclear boundaries also motivates this research.We therefore propose a cell segmentation method that extracts cell boundaries and can be used to adjust dynamically the relative importance of graph cut data term to the smoothness term.The main difference between the proposed approach and the previous graph cut cell segmentation is that instead of using a static regularisaation parameter for graph cut segmentation, the proposed approach uses knowledge about extracted cell boundaries to adjust dynamically graph cut parameter value.This model ensures that cell boundaries are not reduced by graph cut during segmentation.Furthermore, the proposed model saves segmentation time since manual tuning of graph cut parameter value is unnecessary.
RELATED WORKS Boykov and Jolly (2001) proposed a graph cut model where user selects sample foreground and background pixels for an interactive segmentation.In addition, a weight constraint is imposed on selected sample pixels so as to minimise the graph cut shrink bias.Peng and Veksler (2008) proposed a method for graph cut parameter selection; they developed an algorithm that selects a good segmentation based on an array of graph cut parameter values.The selection of best segmented image is based on texture and homogeneity characteristics.Peng and Veksler (2008) model uses a single parameter value throughout the whole image for segmentation.However, oversegmentation or under-segmentation may occur due to the fact that some portions of the image may require less smoothening than others (for example, object with blurry boundary) (Candemir and Akgul, 2010).
Furthermore, in Candemir and Akgul (2010) an adaptive parameter selection is introduced for object segmentation.In this approach, the boundary of the object of interest is carved by a canny edge detector (Canny, 1986).Then the result is used to regularise the parameter value of graph cut.However, for non-homogeneous cell images, cell boundary may not be extracted sufficiently, giving rise to oversegmentation or under-segmentation.Vicente et al. (2008) incorporated a connectivity prior in their graph cut algorithm.Although their algorithm improves graph cut segmentation, users are required to inscribe additional scribbles during the process.This approach is susceptible to time wasting.
Graph cut with shape prior has also been researched in literature for object segmentation (Freedman and Zhang, 2005).However, a limitation of this method is the choice of an appropriate graph cut parameter value (λ ; Lang et al., 2009;Wang et al., 2013).

PAPER ORGANISATION
The rest of the paper is organised as follows: related works with respect to graph cut parameter selection are reviewed, followed by the introduction of proposed model.In the next section, proposed model is evaluated on public and private datasets with discussions put forward.Future improvements on proposed model are discussed in the conclusion.

MATERIAL AND METHODS
The proposed model takes advantage of image logarithmic transform.This is necessary because of the high variability of foreground pixel values and provides a way to shrink the range of foreground pixel values.Foreground pixels having low values are compressed logarithmically and transformed into high values to enhance the distinctive categorisation of foreground pixels into boundary pixels and nonboundary pixels.This transformation is important in order to adjust and contextualise graph cut parameter value across the distinctive categorisation of foreground pixels.Invariably, weights of pixels found in cell boundary are adjusted.An image smoothening processs begins the model.

IMAGE SMOOTHING
In order to reduce noise, cell image is smoothened using the 2D Gaussian filter defined as follows: where σ determines the smoothening degree.Given an image I(x, y), an enhancement with the Gaussian filter F(a, b) of size m × n is obtained by performing the convolution of F(a, b) with I(x, y) defined by Eq. 2: (2) is the smoothened version of image I(x, y).

CELL BOUNDARY EXTRACTION
Cell images have varying degrees of intensity levels; hence they do not always have homogeneous structure (Chen et al., 2008).Furthermore, cells possess weak boundaries, which makes it difficult to identify or isolate individual cells in an image frame by visual analysis (Al-Kofahi et al., 2010).In this work, cell boundaries are revealed by shrinking the dynamic range of foreground pixel values in the image.The reason for this is to ensure that the foreground pixel values are compressed into a minimum value range.Another justification for shrinking the dynamic range of cell images is that they are of low quality and appear to fade into the background.As a result, we transform their foreground pixel values from a low pixel value to a high pixel value.Hence it is important to reveal cells at the point at which they begin to fade and blend with the background.The logarithmic function is defined in Eq. 3: where I G (x, y) is the intensity value of pixel at the location (x, y) of the smoothened input image.I L (x, y) indicates the intensity value of pixel at location (x, y) of the output image.α (alpha) controls the level of pixel shrinkage, and c is the scaling factor.
The cell boundary extraction process is detailed in Algorithm 1 and in Fig. 4.

GRAPH CUT ENERGY FUNCTION DERIVATION
An image is represented using a graph G = (V, E), where the graph nodes V correspond to image pixels (a, b, d, e, f , g in Fig. 5) and graph edges E are links between nodes (examples of edges in Fig. 5 Suppose pixel positions in a cell image i = 0, 1, . . .n, then the intensity values of these pixels which depend on K are given as I(0), I(1), . . ., I(n), where each intensity value is independent of the other.A joint probability of their intensity values is given as (5) In Eq. 5, P(I|K) gives the likelihood function.It emphasises the cell image creation process, that is, the probability of quantifying I(i) when K is given.In Eq. 4, P(K), P(I) are the prior probabilities; P(K) describes the partitioning of grey values of image pixels into ones and zeros while P(I) describes their intensity distribution.The maximum a posteriori (MAP) estimation (Boykov and Jolly, 2001) for image segmentation is defined as in Eq. 6: P(I) is a constant and the estimation can then be rewritten as The negative logarithm of the posterior probability can be minimised yielding Eq. 8: The negative logarithm of the probability gives the energy function E(K).Since the logarithm of a product is equal to the sum of logarithms of terms of the product, hence the energy function is rewritten in Eq. 9: In Eq. 9, n is the total number of pixels in a given image.The prior probability (second term in Eq. 9) is modelled as a markov random field (MRF) pairwise interaction between neighbouring pixels (i and j) (Greig et al., 1989;Boykov and Jolly, 2001), which is given as , j) .
In the right-hand-side of Eq. 10, N is the set of neighbouring pixels (i and j) in a given image.ed(i, j) provides the Euclidean distance between i and j (Boykov and Jolly, 2001).B(K) favours neighbouring pixels (i and j) having similar greyscale intensities.B(K) has a low value when neighbouring pixels (i and j) have different greyscale intensities.Hence the behaviour of B(K) suggests a cut when neighbouring pixels have different intensity values.σ describes how much we are concerned about pixel similarity.Then, Eq. 11 becomes the energy function, where Within the context of a graph (Fig. 5) the data term R(K) gives weight to each of the graph edges

GRAPH CUTS ENERGY FUNCTION MODIFICATION
We seek to adjust the parameter value λ dynamically in the graph cut energy function.This dynamic adjustment is motivated by I b as discussed earlier.I b increases the weights of pixels at cell boundaries in order to survive a cut.Thus, the graph cut energy function may be rewritten as follows: where λ = λ (β I b + I nb ), I b is boundary pixel, and I nb is non-boundary pixel.
In Eq. 12, β (β = 2, 3, 4, . ..) defines the weighting factor around cell boundaries.Eq. 12 shows that the weights on cell boundary pixels via the data term are increased.This development makes the parameter value adaptive.Putting the boundary pixel weights above other foreground pixel weights gives an assurance that cell boundaries can survive the graph cut shrink bias.The Max-Flow Min-Cut algorithm proposed by Boykov and Kolmogorov (2004) has been used for segmentation.Algorithm 2 summarises the cell segmentation process.
Algorithm 2 Segmentation of cell image using logarithmic transform and graph cut end if 13: end for 14: for each pixel (x, y) of I G for smoothness term do 15: Add weight B(K) to the link that connects (x, y) to its adjacent neighbours 16: end for 17: Store the Minimum Cut Maximum flow of G in I S end

DATASET
Experiment is conducted on fluorescence microscopy images of human cells.These are cells taken from different parts of the human body at the research centre for HIV and Tuberculosis, University of KwaZulu-Natal.The image dataset contains 30 images each having a size of 1201 by 901 pixels.Each image has an average of 27 cells.The cell images are captured within an interval of 10 minutes using a time-lapse microscope.Ground truths to these images are manually constructed.In order to strengthen the evaluation process further, public available dataset U2OS (Coelho et al., 2009) containing 48 images was also used to test the performance of the proposed model.Each image has an average of 40 cells.

EVALUATION
The performance of the proposed model is measured using the Rand Index (RI), Hausdorff distance (H) and Sensitivity (ST ) metrics (Coelho et al., 2009).High values of RI and ST and a low value of H are indicative of good segmentation.The Rand Index (RI) is defined in Eq. 13: where true positive (TP) defines the total number of foreground pixels in the segmented image S (binary) that overlap foreground pixels in the ground truth G (binary).True negative (TN) gives the total number of background pixels in the segmented image S that overlap background pixels in the ground truth G. False positive (FP) defines the total number of foreground pixels in the segmented image S that are referenced as background pixels in the ground truth G. False negative (FN) defines the total number of background pixels in the segmented image S that are referenced as foreground pixels in the ground truth G. Hausdorff distance (H) is defined in Eq. 14 as where l indicate co-ordinates of considered pixel pair in S and G. V (l) gives the distance between the considered pixel pair in S and G.The sensitivity (ST) formula is obtained by:

RESULTS DESCRIPTION
Some results of the application of proposed model on cell images are presented.The proposed model shows improved performance over other models while considering metrics H, ST and RI as seen in Tables 1  and 2 and Figs.6 and 7.These results (Fig. 6 and Table 1) demonstrate that elongated cells are segmented to a reasonable degree.However, in extreme cases, where cell boundaries are not visible, poor results are obtained.Table 1 also indicates that the shrink bias of graph cut is reasonably minimised by proposed model; this is evident in the metrics ST and RI.In these metrics, the contribution of FN is reduced as compared to the traditional graph cut.
This analysis (shrink bias) also holds for the public dataset as seen in Table 2, in terms of metrics H and RI; proposed model performs better as compared to other cell segmentation models.However, in terms of the RI, proposed model is the second best.This can be attributed to the fact that some extracted boundaries via Algorithm 1 may not be actual cell boundaries, but noise.Since boundaries of noise may have been extracted, the FP component in the RI metric is invariably increased.This obviously degrades the performance of the proposed model.This shows that a more sophisticated filtering method should be adopted in order to reduce noise significantly.The merging algorithm (Table 2) performs better with respect to minimising its FP component of the RI metric.The template-matching algorithm also shows good performance with respect to RI; however, its H value is the highest.

DISCUSSION
One contributing factor to the improved performance of proposed model is the incorporation of cell boundary into graph cut.By giving more weight to pixels at cell boundaries, the shrink bias of graph cut is mitigated.The contributing factor to the poor performance of traditional graph cut which is obvious in Fig. 6 is the inability to adjust its parameter (λ ) value adaptively; hence the shrink bias of graph cut comes into play.
However, when images contain touching cells or dense cells, there is a reduction in the performance of the model.For example, the model cannot draw boundary lines to separate touching cells.The model sees touching cells as a single cell.For future work, one may investigate the possibility of incorporating the segmentation of cell clusters.Our approach is an interactive cell segmentation process where user selects sample foreground and background pixels.The automation of foreground and background sample pixel selection may further improve the performance of proposed model.In addition, a more robust approach that is immune to noise for boundary extraction is suggested for better performance.

Fig. 1 .
Fig. 1. Cell images.(a) Original position of highlighted cell.(b) Final position of highlighted cell from (a).

Fig. 2 .
Fig. 2. Illustration showing the compromise between data term and smoothness term.(a) Original image.(b) Segmentation with small parameter value, ensuring a smoothened segmentation while, however, ignoring cell details such as boundaries after segmentation.(c) Segmentation with large parameter value, retaining some cell edges after segmentation; however, image is noisy.(d) Optimal segmentation with some edges still missing.
are O − a,C − a, a − b, b − d, and a − e), corresponding to links between pixels in the image context.Additionally, nodes O and C are in the set V representing terminal links.The objective is to assign a label L ∈ {0, 1} to pixels in the segmented image where 0 and 1 represent background and foreground respectively.A Bayesian framework is used to model image segmentation.Let K be the segmentation of a given image while I is the measured brightness function, then we have

Fig. 5 .
Fig. 5. Representation of an image in graph context.
, for example, edges O − a,C − a, O − b, O − e, O − f , O − g,C − e,C − f and C − b in Fig. 5.The weight of these edges is determined by the negative logarithm of the probability of a pixel being a foreground or background pixel, considering sample pixels selected by user.B(K) provides weight to node edges, for example, edges a − b, b − d and a − e in Fig. 5.The energy function in Eq. 11 is similar to the graph cut energy function introduced by Boykov and Jolly (2001); the first term gives the data term while the second term gives the smoothness term.λ regulates the relative importance of the data term versus the smoothness term.
Require: I, Greyscale image Ensure: I S Segmented image 1: I is Gaussian-filtered using Eq. 2 and the result is saved in I G 2: Find I b for I using Algorithm 1 3: Construct the graph G from I G 4: for each pixel (x,y) of I G for the data term do 5: if I G (x, y) == I b (x, y) then 6: I b = 1, I nb = 0, λ = β λ 7: Add weight λ R(K) to I G (x, y) in G to form a weight link with terminal node O 8: Add weight 0 to I G (x, y) in G to form a weight link with terminal node C 9: else 10: I b = 0, I nb = 1, λ = λ 11: Add weight λ R(K) to I G (x, y) in G to form weight links with terminal nodes O and C 12:

Fig. 6 .
Fig. 6.Visual results of segmentation of four samples of cell images from private dataset.(a) Original images.(b) Ground truth.(c) Traditional graph cut.(d) Proposed model.

Fig. 7 .
Fig. 7. Visual results of segmentation of four samples of cell images from public dataset.(a) Original images.(b) Ground truth.(c) Traditional graph cut.(d) Proposed model.

CONCLUSION
This work has explored adaptive graph cut parameter selection.This is achieved by cell boundary extraction and fusing this into the graph cut parameter value, thereby providing an avenue to alter dynamically pixel weights in the graph formulation.This development reasonably counters the shrink bias of graph cut.The proposed model has been tested on 78 cell images with an average running time of 19 seconds per image on a Windows 7, Core i5 processor, and experiment results indicate a better segmented output.This model provides a basis for objective diagnosis of diseases such as tuberculosis or cancer by medical experts.

Table 1 .
RI, H and ST evaluation of proposed model and traditional graph cut on private dataset.

Table 2 .
RI, H and ST evaluation of proposed model and traditional graph cut on public dataset.