A novel image thresholding algorithm based on neutrosophic similarity score

Image thresholding is an important ﬁeld in image processing. It has been employed to segment the images and extract objects. A variety of algorithms have been proposed in this ﬁeld. However, these methods perform well on the images without noise, and their results on the noisy images are not good. Neutrosophic set (NS) is a new general formal framework to study the neutralities’ origin, nature, and scope. It has an inherent ability to handle the indeterminant information. Noise is one kind of indeterminant information on images. Therefore, NS has been successfully applied into image processing and computer vision research ﬁelds. This paper proposed a novel algorithm based on neutrosophic similarity score to perform thresholding on image. We utilize the neutrosophic set in image processing ﬁeld and deﬁne a new concept for image thresholding. At ﬁrst, an image is represented in the neutrosophic set domain via three membership subsets T , I and F . Then, a neutro-sophic similarity score (NSS) is deﬁned and employed to measure the degree to the ideal object. Finally, an optimized value is selected on the NSS to complete the image thresholding task. Experiments have been conducted on a variety of artiﬁcial and real images. Several measurements are used to evaluate the proposed method’s performance. The experimental results demonstrate that the proposed method selects the threshold values effectively and properly. It can process both images without noise and noisy images having different levels of noises well. It will be helpful to applications in image processing and computer vision.

Image thresholding Image segmentation Fuzzy set Neutrosophic set Similarity score a b s t r a c t Image thresholding is an important field in image processing. It has been employed to segment the images and extract objects. A variety of algorithms have been proposed in this field. However, these methods perform well on the images without noise, and their results on the noisy images are not good. Neutrosophic set (NS) is a new general formal framework to study the neutralities' origin, nature, and scope. It has an inherent ability to handle the indeterminant information. Noise is one kind of indeterminant information on images. Therefore, NS has been successfully applied into image processing and computer vision research fields. This paper proposed a novel algorithm based on neutrosophic similarity score to perform thresholding on image. We utilize the neutrosophic set in image processing field and define a new concept for image thresholding. At first, an image is represented in the neutrosophic set domain via three membership subsets T, I and F. Then, a neutrosophic similarity score (NSS) is defined and employed to measure the degree to the ideal object. Finally, an optimized value is selected on the NSS to complete the image thresholding task. Experiments have been conducted on a variety of artificial and real images. Several measurements are used to evaluate the proposed method's performance. The experimental results demonstrate that the proposed method selects the threshold values effectively and properly. It can process both images without noise and noisy images having different levels of noises well. It will be helpful to applications in image processing and computer vision.

Introduction
Image thresholding, one of the simple image segmentation procedures, is a crucial step for several image-processing applications such as object detection, shape recognition, and optical character recognition [1]. In the image thresholding process, a threshold value is selected, and the pixels on the images are classified into background or objects according to their values. Image thresholding can convert the gray level images into binary ones [2]. Thresholding is quite efficient when the object pixels and background pixels have distinct gray level distributions. Furthermore, it is easy to be implemented and usually be run fast [3,4].
A variety of algorithms have been proposed. Generally, image thresholding methods are classified into two groups based on the criteria to select the threshold value: global and local methods [5]. Global methods select the threshold values according to the characteristics of the entire images, and local ones adopt threshold values using the local information on the images. Threshold value selection method based on image histogram is a kind of the global methods [6]. For a high contrast image, the histogram has two distinguished peaks, and a wide valley between the two peaks. The threshold value is selected the value in the valley. However, the histogram based methods fail to find a proper value to segment the image on a low contrast image because the histogram does not have distinguished peaks and valleys. A variety of methods have been presented to select the thresholds based on histogram and fuzzy logic [7][8][9][10][11][12][13][14].
A fuzzy based image thresholding scheme was proposed by Pal and Rosenfeld [7]. The authors used the fuzzy compactness by using the S-function for membership evaluation. Huang and Wang proposed an efficient fuzzy thresholding method based on Yager's measure which is a measure of fuzziness depending on the relationship between the fuzzy set and its complement [8,9]. Chaira and Ray [10] used the Gamma membership function to compute the membership values of the pixels, and proposed the fuzzy divergence for image thresholding. Ramar et al. proposed the neural networks for selecting the optimum threshold value using fuzzy measure [11]. Cheng and Chen used fuzzy homogeneity and fuzzy co-occurrence      matrix for image thresholding [12]. The method [12] employed the homogeneity vectors and the fuzzy membership function, and extracted the feature of an image to determine fuzzy regions. The fuzzy entropy values were utilized to determine the thresholds for segmenting the input images. Tizhoosh proposed a thresholding technique based on ultra-fuzzy sets [13]. The ultra-fuzzy set was used to remove the vagueness in the image. Cheng et al. proposed a two dimensional fuzzy entropy method for obtaining the best threshold value [14]. The proposed method involved fuzzy partitioning on a two-dimensional histogram where fuzzy entropy was defined. Finally a genetic algorithm was employed to obtain the optimal threshold value.
In [15], Xiao et al. presented a thresholding method using an artificial bee colony (ABC) algorithm and entropy function. The ABC searched the maximum value of the entropy, and the optimal thresholds were determined based on the maximum. Xiong et al. proposed a threshold selection mechanism for the radar images thresholding which combines the characteristics of two different measures using the Markov random field model [16]. In [17], He et al. presented a threshold method using a two-dimensional histogram and multi-resolution analysis. The method determined the optimal threshold value using the spatial correlation of gray level and the flexibility, and searched the threshold value via multi-resolution way. Jun et al. proposed a two-dimensional Tsallis symmetric cross entropy for image thresholding [18]. The two-dimensional Tsallis symmetric cross entropy was defined, and a recursive algorithm was used to search the optimal threshold vector. A fuzzy entropy measure on a two-dimensional histogram method was proposed in [19]. The image was separated into several different grids with different densities. Then the intensity in the image and the average intensity of the local neighborhood were used to build a two-dimensional histogram. A multi-threshold method was presented based on the maximum fuzzy entropy principle and the two-dimensional histogram. The parameters of the entropy function were tuned via a genetic algorithm. In [20], Bustince et al. defined an ignorance function and used it to obtain a threshold value. Measurements were constructed using t-norms and auto morphism. The degree of ignorance was employed to describe the background and objects. Based on the ignorance degree, the threshold is obtained from the intervalvalued fuzzy set having the lowest associated ignorance. However, the above methods suffer from finding the optimal threshold value when the input images have noise. Especially, under the low SNR levels the above-mentioned methods' achievements drop considerably. To overcome the limitations of the above methods, we proposed a neutrosophic set based image thresholding scheme for efficient bi-level segmentation. More specifically, the proposed method uses the neutrosophic similarity measures for determining the optimal threshold value.
Neutrosophy is a new kind of generalizations of dialectics, and it studies the neutralities' origin, nature, and scope [21]. It represents every entity hAi, the opposite hAnti-Ai, and the neutralities hNeut-Ai that is neither hAi nor hAnti-Ai.
The traditional fuzzy set utilizes a membership to represent the degree belonging to a set. When the fuzzy membership value is uncertain and vague, it is challenging to be defined using a crisp value [22]. In some situations, we have to consider both the membership and the indeterminacy of the membership.
In the neutrosophic set (NS), each entity is depicted via three memberships: truth, indeterminacy and falsity memberships. This characteristic is essential to such applications as information fusion where data might have a degree of uncertainty.
The image thresholding methods based on the traditional fuzzy set can be affected by noise severely. This paper newly develops a neutrosphic set approach for image thresholding. First, an image is mapped into the NS domain. Then, a novel similarity measurement, neutrosophic similarity score, is defined to measure the pixels' belonging degree to the object on the image. Finally, the image is performed thresholding using the neutrosophic similarity score. The experiments on synthetic images having different levels of noise and noisy real world images are conducted to evaluate the proposed approach's performance.
The paper is organized as follows. Section 2 describes the proposed method, Section 3 discusses the experimental results and comparisons, and the conclusions are drawn in Section 4.

Neutrosophic similarity score
A neutrosophic set can be defined under different criteria as: let A ¼ fA 1 ; A 2 ; . . . . . . ; A m g be a set of alternatives in neutrosophic set, and C ¼ fC 1 ; C 2 ; . . . . . . C n g be a set of criteria. The alternative A i at C j criterion is denoted as the membership values to the true, indeterminacy and false set at the C j criterion.
A similarity measurement is proposed to evaluate the similarity degree between two elements in neutrosophic set under multicriteria [23]: In multi-criteria environment, the concept of ideal element can be used to identify the best alternative. The ideal alternative A * is denoted as: The similarity to the ideal alternative is computed as: An image is defined in the NS as: let U be a universe, BP be a bright pixel set in U, and an image I m described using NS is called neutrosophic image I NS . The neutrosophic image I NS is depicted using subsets T, I and F. A pixel in I NS is denoted as P NS (T, I, F), and it belongs to the bright pixel set BP in the means as: it is T true in the bright pixel set, I indeterminate, and F false. The range of the values in According to the definition of neutrosophic image, a pixel Pðx; yÞ is interpreted in the neutrosophic set domain: P NS ðx; yÞ ¼ fTðx; yÞ; Iðx; yÞ; Fðx; yÞg. Tðx; yÞ, Iðx; yÞ and Fðx; yÞ represent memberships belonging to bright pixel set, indeterminate set and non-bright pixel set, respectively. At the intensity criterion, they are defined as:  T Cg ðx; yÞ ¼ gðx; yÞ À g min g max À g min ð3Þ I Cg ðx; yÞ ¼ 1 À Gdði; jÞ À Gd min Gd max À Gd min ð4Þ F Cg ðx; yÞ ¼ 1 À T Cg ðx; yÞ ð 5Þ where g(x,y) and Gd(x,y) are the intensity value and gradient value at the position of (x,y) on the image. Then, a similarity score is calculated to identify the degree to the ideal object under intensity condition.

S
The similarity value is sensitive to noise on image. If it is used for image thresholding, the noisy regions on images will be labeled into a wrong group. In order to make the thresholding results robust to noise, we propose two new criteria, local mean intensity criterion C m and local homogeneity criterion C h , and then calculate the neutrosophic similarity score under them.
The neutrosophic set under the local mean intensity criterion C m is defined as: T Cm ðx; yÞ ¼ g m ðx; yÞ À g m min g m max À g m min ð7Þ (c) Thresholding results of the NSS method. where g m (x,y) and Gd(x,y) are the intensity value and gradient magnitude value at the position of (x,y) on the image after mean filter processing. g m min and g m max are minimum and maximum intensity values, respectively. Gd m min and Gd m max are minimum and maximum of the gradient value in the image. Mean filtering is known as the simple and intuitive procedure that has been used in image processing for smoothing the images and noise reduction. The procedure of mean filtering is replacing each pixel 0 s intensity value in an image with the mean value of its neighbors and itself. The mean filter eliminates noises by replacing it using its surroundings. In addition, homogeneity is largely related to the local information extracted from an image and reflects how uniform a region is. It plays and important role in image segmentation.
The neutrosophic set under the local homogeneity criterion C h is also defined as: where H(x,y) is the homogeneity value at (x,y), which is depicted as the filtering result with the texture energy measures (TEM) filters [31]. Gd h (x,y) is the gradient value on H(x,y). H min and H max are minimum and maximum homogeneity values respectively. In addition, Gd h min and Gd h max are minimum and maximum of the gradient value.
Using the same way, another two NSS values to the ideal alternative are calculated as: The value of A * under three criteria are same as: In the proposed method, we use the average value of S Cg , S Cm and S C h as the final neutrosophic similarity score for the future application, such as image thresholding:

Image thresholding based on NSS
After the neutrosophic similarity score is determined, Otsu's method is employed to obtain the optimized value for thresholding [24]. It selects an optimum threshold value by minimizing the within-class variance of the object and background.
The variance is used to define a function as: where r(t) is the sum of variances of the background and object pixels separated by the threshold t. r 1 (t) and c 1 (t) are the variance and probability of pixels whose intensities are less than the threshold t, while r 2 (t) and c 2 (t) are the variance and probability of pixels whose values are greater than t. The optimized threshold t * with the minimization of r(t) can separate the pixels into the foreground and background groups.
The data whose value is greater than t * will be grouped into object set Obj, and others are background set Bkg.  In the proposed thresholding method, we calculate the probabilities and variances of the two classes using the NSS value on the image and select the t NSS * value with minimized sum of variances of background and objects as the optimized threshold value. The image will be segment into background and object sets using the optimized threshold value on NSS.
The steps in the algorithm can be summarized as follows: Step 1: Convert the image into NS domain.
Step 2: Compute the NSS values under three conditions.
Step 3: Calculate the probabilities and variances of the two classes using the NSS values.
Step 4: Select the value with minimized sum of the two weighted variances on NSS values as the threshold value.
Step 5: Transfer the image into binary image using the threshold value on NSS.

Experimental results and discussions
We have tested the proposed algorithm using different images, and compared its performance with those of newly developed algorithms. In the experiments, we compare the NSS method with a newly published thresholding method based on neutrosophic set (NS) [25] which performed better thresholding results than those of Otsu method [24], Parzen window technique [26], the minimal error thresholding (MET)algorithm [27]andaentropybasedapproach [28].

Performance on artificial images
We use artificial images to compare the NSS method and NS method visually, and then evaluate their results (c) Thresholding results of the NSS method. quantitatively. In [25], several artificial images having two intensities (one is 0 and another is 255) and impaired by different levels of noise were employed to evaluation the performance of the NS method. In Fig. 1, the first column has two same artificial images as in [25] having Gaussian noise, whose mean values are 0 and standard variance values 25.5 and 178.5, respectively. The second and third columns display the thresholded results by the NS method and NSS method. From the results in Fig. 1, the NSS method achieved the same performance as the NS algorithm.
To identify the performance difference of the NS and NSS methods, we employ a new artificial image with lower contrast and different levels of Gaussian noise. Another synthetic image having two gray levels (64 and 128) is impaired by different levels of Gaussian noise to test the performance of two thresholding methods. Fig. 2(a) are synthetic images having Gaussian noise, whose mean values are 0 and standard variance values are 15 and 30, respectively. Figs. 2(b) and (c) are the results by the NS and NSS methods, respectively.
The results on the second synthetic image with low contrast show the NSS method performs better than NS method on the synthetic images with two different noise levels. A lot of pixels in Fig. 2(b) are identified in wrong classes, while they are classified correctly by NSS method in Fig. 2(c).
To evaluate the thresholding results for artificial images quantitatively, we utilize a metric: misclassification error measure (ME) [26,29], to measure the thresholding performances. The ME depicts the percentage of background points wrongly grouped to foreground set, and object points wrongly grouped to background set [26,29]:  where F 0 and B 0 are the object and background sets on the ground truth image. F T and B T are the object and background sets on the result image. || denotes the elements' number in the set. The ME defines a metric of the misgrouped points between the ground truth image and the test image. Another metric figure of merit FOM proposed by Pratt [30] is also utilized to evaluate the difference between the methods' results with the ideal thresholding result quantitatively: where N I and N A are the numbers of the object points and the ideal object pixels, respectively. d(k) is the distance from the kth actual point to the nearest thresholding point. b is a constant, and set as 1/9 in Pratt's paper [30]. The greater the FOM, the better the thresholding results are. The quality of noisy images can be measured using the SNR (signal to noise ratio): c¼0 im 2 ðr; cÞ P HÀ1 r¼0 P WÀ1 c¼0 ðimðr; cÞ À im n ðr; cÞÞ where im n (r, c) and im(r, c) are the intensities of pixel (r, c) in the noisy and original images, respectively. The values of ME are plotted at different SNR levels in Fig. 3. It demonstrates the NSS method archives lower MEs at all SNRs. All ME values of the NSS method are smaller than 0.015, and all values of NS method are higher than those of the NSS method. The NSS algorithm achieves the  optimum performance with ME = 0.0065 which is nearly equal to zero when SNR is 20.1144 dB, while NS obtains the optimum value with ME = 0.0068. Meanwhile, the values of FOM of NSS are bigger than those of NS at most SNR levels. The average value of FOM of NSS and NS are 0.953 and 0.8517, respectively (see Fig. 4).

Performance on real world images
A great number of real world images are employed to measure the NSS method's performance. Eight representative images are selected to demonstrate the effectiveness and robustness of the NSS method against the various noise levels. These images are ''Lena'', ''Woman'', ''Panda'', ''Cameraman'', ''Discover'', ''Blood'', ''Rice'' and ''Coins'', respectively. In Figs. 5-12, the first row lists the original images without noise and the results of NS and NSS method on them. The second and third rows demonstrate the results on the noisy images with different Gaussian noise variances. The experimental results demonstrate that the results by NSS method exhibits visually better quality than those of NS method. The results by NS method are affected severely by the noise on the real images. The results of the NSS method eliminate noise effect and most pixels are segmented into the right groups.
The thresholding results of the ''Lena'' image are given in the second and the third columns of the Fig. 5. It is obvious that the results obtained under the first and second noise variance are better than the NS method. The shoulder, face and the hat regions are recovered correctly. On the other hand, the NS based method yields several wrong segmentations especially in the shoulder and the face regions. It is worth mentioning that the both NSS and NS have several wrong segmentations for the third noise level. Especially both methods have misclassified pixels the background region and the shoulder and face of the ''Lena''. However, by visual inspection, the proposed method has better segmentation than the NS method when we consider the overall results. Similar results can be seen in the ''Woman'' image, which is depicted in Fig. 6. The face, hair, background regions are thresholded correctly by the NSS method for the first and second noise levels. In addition, the proposed NSS method can obtain reasonable segmentations even for the third noise level. For the second and third noise levels the NS based method yields many misclassifications in the face and background of (a) "Coins" image with different Gaussian noise level: variance: 0, 10, 20 (b) Thresholding results of the NS method.
(c) Thresholding results of the NSS method. the ''Woman'' image. In Fig. 7, there are two pandas in a grass background. In the first noise variance level, both NS and NSS methods obtain similar segmentation results. The background and the pandas are correctly segmented. For the second and third noise variance levels, the image becomes more complicated and the NS method yields many misclassified pixels in the back ground. There are also several numbers of misclassified pixels on the panda regions. The superiority of the proposed NSS method can be seen in the rest of the experiments. In the ''Cameraman'', ''Discover'', ''Blood'', ''Rice'' and ''Coins'' images, it is obvious that our proposal obtains almost all the ground truth segmentations. Especially for the ''Discover'', ''Rice'', ''Blood'' and ''Coins'' images the obtained results for all noise variance levels are better than the NS algorithm. Only there are several misclassified pixel in the grass region of the ''Cameraman'' image.
From the experiments on the artificial and real world images, we can make a conclusion that the NSS method is feasible to select better threshold values for both the clear images without noise and the noisy images with different levels.

Conclusions
This paper presents a new image thresholding algorithm using neutrosophic similarity score. The image is depicted in neutrosophic set via three subsets. Then, a neutrosophic similarity score is defined to measure the degree to the object pixels on the image. Finally, an optimized value is selected on the NSS to perform image thresholding. The experimental results show that the NSS method can obtain the thresholds properly and effectively. It is able to process both images without noise and noisy images with different levels of noises. This advantage will bring the proposed method into more applications in the research areas such as image processing and computer vision.