Image segmentation based on gray level and local relative entropy two dimensional histogram

Though traditional thresholding methods are simple and efficient, they may result in poor segmentation results because only image’s brightness information is taken into account in the procedure of threshold selection. Considering the contextual information between pixels can improve segmentation accuracy. To to this, a new thresholding method is proposed in this paper. The proposed method constructs a new two dimensional histogram using brightness of a pixel and local relative entropy of it’s neighbor pixels. The local relative entropy (LRE) measures the brightness difference between a pixel and it’s neighbor pixels. The two dimensional histogram, consisting of gray level and LRE, can reflect the contextual information between pixels to a certain extent. The optimal thresholding vector is obtained via minimizing cross entropy criteria. Experimental results show that the proposed method can achieve more accurate segmentation results than other thresholding methods.


Introduction
Image segmentation is a fundamental task in many computer vision based applications, such as medical image analysis [1], crack detection [2,3], video analysis [4], plant disease recognition [5], etc. The main purpose of image segmentation is to categorize an image's pixels to different classes according to color, texture and brightness, etc. Image segmentation is an active research topic and many segmentation methods had been proposed up to now. The clustering based methods [6][7][8], regression based methods [9,10], and deep learning based methods [11][12][13] are the new and sophisticated methods.
Although the above methods can obtain well segmentation performance, however, the computation complexity and computation burden are relatively high. In practice, simple and effective segmentation methods are desirable. Among different image segmentation methods, thresholding segmentation methods are simple, effective and more easy to be implemented. They become popular and have received much attention of researchers. Thresholding methods assume that there is a deep valley between two peaks in the gray level histogram of the image. The ideal thresholds locate at valleys and can be obtained by optimizing a certain criteria function. The Otsu thresholding method selects the ideal threshold by maximizing the between- class variance between background and objects [14], and Kapur's thresholding method maximizing the total Shannon entropy of background and objects [15], the Kittler's thresholding method minimizing the classification error [16]. These classical thresholding methods have some improved variants [17]. However, these classical thresholding segmentation methods and their variants take only the brightness information into account and neglect the contextual information between pixels, which may result in poor segmentation performance or even false segmentation. To solve this problem, Abutaleb proposed the concept of two-dimension histogram [18]. The two-dimension histogram can reflect the contextual information between pixels to a certain extent. By virtue of two-dimension histogram, many classical thresholding methods had been extended to two dimensional case, such as two-dimension Otsu thresholding method [19], two-dimension Tsallis entropy thresholding method [20]. Compared with one-dimension histogram based thresholding methods, two-dimension histogram based thresholding methods can get better segmentation result, especially when the image was corrupted by noise. Unfortunately, it was pointed by Xiao that the two-dimension histogram ignores the edge information of image [21]. In image, edge information is a class of important information which can more effectively reflect contextual information between pixels. Observing this, Xiao proposed a new method to construct two dimension histogram by using the resemblance between a pixel and it's neighbors as the contextual information and the resulted two dimension histogram is called gray level spatial correlation (GLSC) histogram [21]. After that, Xiao et al. constructed another two-dimension histogram, called GLGM histogram using gray level of original image and its gradient magnitude. In [22], a 2-D direction histogram was constructed by using the gray level of original image and the orientation of gradient. Zheng et al. constructed a two-dimension histogram using gray level of original image and its local variance [23]. Motivate by the idea of the mentioned works, a new two-dimension histogram construction method is proposed in this paper. The proposed method constructs a new two dimension histogram using gray level of a pixel and it's local relative entropy of it's neighbors. Then, the ideal thresholding vector is selected by minimizing a relative entropy based criterion function.

Entropy and relative entropy
Originally, entropy is a thermodynamic concept, which is used to measure the disorder presented in a system. Entropy became a measure of information amount due to Shannon's work in [24]. Now, entropy is used to measure the uncertainty of a random variable. Suppose P = {p 1 , p 2 , � � �, p n } and Q = {q 1 , q 2 , � � �, q n } are two different probability distributions. The Shannon entropy of probability distribution P is given as The relative entropy, also called Kullback-Leibler divergence, between P and Q is defined as The relative entropy measures the difference between two distributions P and Q.

Gray level-local relative entropy (GLLRE) two dimensional histogram
Let I(x, y)(x = 1, 2, � � �, M; y = 1, 2, � � �, N) be the brightness of a pixel located at (x, y) in the image I. I(x, y) 2 {0, 1, � � �, L − 1}. The local relative entropy (LRE) of a pixel (x, y) in a n × n neighborhood is calculated as where � Iðx; yÞ is the mean gray level value of the pixels in the neighborhood, which is given as Then LRE of each pixel is normalized to 0 between L − 1 as where J min and J max are the minimum and maximum of J(x, y). respectively. From Eq (3), it can be seen that LRE measures the difference of brightness of a pixel between the mean brightness of its neighbors. If the brightness of a pixel is similar to it's neighbors, the LRE is small. On the contrary, the LRE is large. Usually, if a pixel and it's neighbor pixels belong to the same class, i.e., background or object, then the LRE is small. If a pixel is noise or is edge pixel, then the LRE is large.
To construct two dimensional histogram, one first calculates the number of pixel pairs such that I(x, y) = i and J(x, y) = j, which is denoted as n ij . GLLRE histogram is the occurrence frequency, which is calculated as The GLLRE histogram is a two dimensional matrix with size L × L, which is represented as P = {p ij ; i, j = 0, 1, � � �, L − 1}. The GLLRE histogram is shown in Fig 1.

GLLRRE based thresholding segmentation method
In Fig 1, threshold vector (s, t) splits the GLLRE into four parts, where s is the threshold of original image and t the local relative entropy image. As mentioned before, the pixels inside the objects and background have small relative entropy, while the pixels located at edge or noises have large relative entropy. Obviously, parts 1 and 4 represent the objects or background, and parts 2 and 3 be the edges or noises. Let C 0 and C 1 denotes object and background, their probability distribution are and C 1 : p ij P 1 ðs; tÞ ; i ¼ s þ 1; 1; 2; � � � ; L À 1; j ¼ 0; 1; � � � ; t À 1 where P 0 ðs; tÞ ¼ and P 1 ðs; tÞ ¼ To select an ideal threshold vector, an optimization criteria should be determined. In this paper, the minimum relative entropy criteria in [25] is adopted. First, the mean vector of the two classes are calculated as and respectively. The two dimensional relative entropy between original image I and its segmented version at (s, t) is calculated as [25], DðP; Qj; s; tÞ ¼

Experimental results and discussion
In order to illustrate its performance of our proposed method, it is used to segment several images and compared to Otsu thresholding method [14], To objectively evaluate the performance of the referenced methods, the misclassification error (ME) is adopted as the evaluation criteria. For bi-level thresholding problem, ME [23] is defined as where |.| represents the element number of a set, B o is the set containing background pixels of ground-truth image and F o containing foreground pixels, B T is the set containing background pixels in the thresholded image and F T containing the foreground pixels. ME range from 0 to 1. If ME equals to 0, it implies a perfect segmentation, while equals to 1 for a completely wrong segmentation. The smaller the ME value is, the better our experimental result is. The thresholds or threshold vectors and ME obtained by the referenced methods are listed in Table 1. It can be seen that ME obtained by our proposed method is the smallest, which indicates that our method obtains the best segmentation results.

Conclusion
A new method is proposed for image segmentation in this paper. The proposed method is based on GLLRE histogram. GLLRE histogram is constructed by utilizing the brightness and local relative entropy of a pixel and it's neighbors. The local relative entropy can efficiently measures the brightness difference between a pixel and it's neighbors. The proposed method integrates the contextual information between pixels into the thresholding process and obtains more accurate segmentation results than other thresholding methods.