{'fraction_non_alphanumeric': 0.03186331101362272, 'fraction_numerical': 0.007573308704687139, 'mean_word_length': 4.873609981014375, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Nonparametric Distribution Prior Model for Image Segmentation

In many real application scenarios of image segmentation problems involving limited and low-quality data, employing prior information can significantly improve the segmentation result. For example, the shape of the object is a kind of common prior information. In this paper, we introduced a new kind of prior information, which is named by prior distribution. On the basis of nonparametric statistical active contour model, we proposed a novel distribution prior model. Unlike traditional shape prior model, our model is not sensitive to the shapes of object boundary. Using the intensity distribution of objects and backgrounds as prior information can simplify the process of establishing and solving the model. The idea of constructing our energy function is as follows. During the contour curve convergence, while maximizing distribution difference between the inside and outside of the active contour, the distribution difference between the inside/outside of contour and the prior object/background is minimized. We present experimental results on a variety of synthetic and natural images. Experimental results demonstrate the potential of the proposed method that with the information of prior distribution, the segmentation effect and speed can be both improved efficaciously. key words: level set method, active contour model, prior information, image segmentation


Introduction
Image segmentation is a significant research topic of image processing, which builds the foundation for image analysis. Active contour model is one of the most representative methods of image segmentation, whose basic idea is to solve the segmentation problem by establishing and optimizing a given energy function, and getting the edge of the object of interest iteratively through solving the Euler-Lagrange equation corresponding to the given energy function [1], [2]. In the recent thirty years, many image segmentation methods based on active contour model have been proposed, such as GVF [3], GAC [4], CV [5] and LBF [6]. These extraordinary works have progressively made active contour model more perfect and effective.
However, the models mentioned above segment objects simply based on the intensity information of images. In real application scenarios, it is hard to attain satisfactory results by using the intensity information only. Therefore, some prior information, shapes of objects e.g., is required to be utilized in order to get a more satisfying segmenting result. But this method also has some limitations. To specify, in the case where the shape of objects are irregular, inexact shape prior information will result in unsatisfying results because prior shapes are generally regular. For this case, we propose a Distribution Prior Model, which employs the known intensity distribution of objects or backgrounds as prior information to segment images. Since irregular shapes have no influence on the intensity distribution of images, our model is able to overcome the restriction of existing shape prior models.  [11]. These models generally are the linear combination of two kind of energy functions, which are the energy function of existing active contour models and the energy function reflecting the difference between active contours and shape templates. Leventon et al. [11] proposed a model incorporating statistical information of shapes and GAC (Geometric Active Contour) model. Cremers et al. [9] added non-linear shape statistical information to Mumford-Shah function. Chan et al. [8] devised a global shape prior term, that is, the Euclidean distance between the active contour and shape prior. Foulonneau et al. [10] designed a global shape prior term based on affine invariant moments. Xavier et al. [7] proposed a shape prior geometric active contour model integrating Mumford-Shah function.

Nonparametric Statistical Active Contour Model
In this paper, our work is based on nonparametric statistical active contour model [12]- [15]. A basic assumption of this kind of model is the intensity distributions between objects and backgrounds have distinct difference. Since the objects and backgrounds of images have different distributions, once a close curve which maximize the intensity distribution between the inside and outside of the curve is founded, the process of image segmentation is considered to be completed. Kim et al. [12] introduced the concept of mutual information to measure the relation between pixels statistic quantities and two-parameters label selections (objects and backgrounds). Michailovich et al. [13] proposed a statistical active contour model based on Bhattacharyya coefficient, Copyright c 2020 The Institute of Electronics, Information and Communication Engineers which is used to measure the difference between the intensity distribution inside and outside the active contour. Wu et al. [14] established an innovative method, which regarded image segmentation problems as classification problems and achieved image segmentation by minimizing the misclassification probability.

Motivation
In the previous work [16], we has proposed parametric shape prior model based on PCA method and level set method [17]. Compared with the traditional shape prior model, several referring templates are given instead of the exact template of object. During the process of segmenting, the template updates itself while the contour evolves.
As for the research on prior information, researchers pay more attention on shape prior in early days. Later, when the concept of nonparametric statistical active contour model is proposed, the prior intensity distribution (i.e. the corresponding intensity distribution in object and background region) attracts a lot of attention. Liu et al. [18] proposed an active contour model based on local statistic prior for MR image of brains, which improved the results of segmenting greatly. In such kind of histogram-based models, including nonparametric statistical active contour model, the prior information like intensity distribution is naturally embedded.
Moreover, it is discovered in our research that the transformation of object like shifting, rotating, scaling and flipping has nearly no influence on the distribution histograms. For the first 3 kinds of transformation, which is also known as rigid motion, classical shape prior model such as the work of Chan et al. [8] has proposed a feasible solution.
However, in consideration of the fact that transformation hardly affects intensity distribution, using the intensity distribution of objects and backgrounds as prior information can simplify the process of establishing and solving the model by ignoring the deformation of objects. Besides, it is hard for shape prior model to find a suitable template for irregular object boundary, but distribution prior model will not be bothered by this problem because it is not sensitive to the shapes of object boundary.

Contribution
The main contribution of this paper is that we proposed an image segmentation algorithm using intensity distribution as prior information. Different from the existing shape prior model, our distribution prior model does not require the shape information of objects. Instead, on the basic of nonparametric statistical active contour models, the prior information is considered in our model, which is a part of the energy function.
Our contributions are listed as follows: (1) The proposed model introduce intensity distribution to be prior information, which allows the model ignore the transformation of objects and thus improves the stability of the model and simplify the establishment and solution of the model.
(2) With prior distribution information, our method can efficaciously segment more complicated images. (3) Our model introduces Pearson divergence as the metric function of the difference between current region distribution and prior distribution.
The organization of this paper comes as follows. In Sect. 2, the proposed method distribution prior model is elaborated in detail. Experimental results are presented and analysed in Sect. 3. Finally, conclusions are drawn in Sect. 4.

Proposed Method
In this section, we will explain our method in detail. First of all, a brief overview of our model is presented as follows. Generally, it is assumed that pixels in the same region of an image are independent and identically distributed (i.i.d) subject to an unknown distribution while those in different regions are independent of each other. Specifically, as Fig. 1 shows, an image I can be divided into two kinds of regions, which are object region and background region. In these two regions, it is assumed that their intensity distribution histograms are subject to probability density functions P ob ject and P background , respectively. In the case that prior distribution can be obtained, it is considered that the object prior distribution, denoted as P , is close to P ob ject ; and the background prior distribution, denoted as Q , is close to P background .
The image I is separated into two kinds of regions by an active contour φ (the green line in Fig. 1). The region inside φ is denoted as R− and the region outside φ is denoted as R+. Their intensity distribution histograms are subject to probability density functions P and Q. When contour φ is determined, P and Q can be computed by Parzen density estimation [19] as follows.
where K(·) means the Gaussian kernel function, σ is the standard deviation, x represents the pixel location, I(x) rep- Fig. 1 Overview of the proposed method.
resents pixel intensity, and z is the intensity variable. The goal is to find the optimal contour φ, which maximizes the difference between P and Q, and minimizes the difference between P (or Q) and P (or Q ).

Model Description and Solution
In this subsection, it is assumed that prior distributions P and Q are already known. As for how to obtain prior distributions, we will discuss in the next subsection.
We construct an energy function to satisfy our above idea as follows.
where E(P, Q) represents the energy of distribution difference between the regions inside and outside the contour; E(P, P ) represents the energy of distribution difference between the region inside the contour and prior object; E(Q, Q ) represents the energy of distribution difference between the region outside the contour and prior background. The smaller the distribution difference, the smaller energy it will be. Length(φ) represents the length of the active contour. μ 1 , μ 2 and λ are positive parameters. Because the status of object and background should be equal, the measurement about their distribution difference should be symmetric, which means E(P, Q) = E(Q, P). Therefore, in our model, we adopt Hellinger distance to measure the distribution difference between P and Q. The formulation of E(P, Q) is as follows.
Unlike P and Q, the status of P and P should not be equal, and P is an important reference of P. Therefore, in our model, we adopt Pearson Chi-square divergence to measure the distribution difference between P and P . The formulation of E(P, P ) is as follows.
Similarly, the formulation of E(Q, Q ) is as follows.
To sum up, the whole energy function can be rewritten in the following formulation.
For further simplification, The variational level set method [20], [21] is adopted to solve the minimization of Eq. (7). We derived the gradient descent flow as follows. where Therefore, the iteration equation of level set function φ is obtained: where Δt represents the time step.

Acquisition of Prior Distributions
Above all, it should be declared that in practical application, prior distribution information of both object and background is hard to obtain at the same time. In our model, it is unnecessary to get both object and background prior distributions, because only one of them can be also helpful for segmentation. That means we can simply set μ 1 = 0 or μ 2 = 0. Of course, if both precise prior distributions are already known, it is better for the segmentation. It is still an open problem that how to acquire prior distribution. In this subsection, two methods are presented as follows.
The first one is that prior distributions are extracted from similar objects or backgrounds. This method is limited to some special cases such as co-segmentation. That means segmenting similar objects in different backgrounds, or segmenting different objects in similar backgrounds. For example, in Fig. 2, between these two images, their backgrounds (sand) are similar. Using the former as the prior distribution information for the latter, it can be effectively segmented. The detail of this experiment will be described in the next section.
The second method is that distribution information could be sampled from original images as prior distributions. Our idea is to roughly draw a red box surrounding the object, or a green box inside the object, as Fig. 3 shows. The distribution outside the red box is considered as prior background distribution; the distribution inside the green box is considered as prior object distribution.
The idea that manually selecting bounding boxes is quite similar to GrabCut [22], which is a well-known segmentation method. The main difference between GrabCut and our method to obtain prior information is that GrabCut needs more detailed human interaction. Especially for complicated backgrounds or high similarity between objects and backgrounds, it needs careful multiple human interaction to achieve better segmentation, which means it is difficult to make it fully automatic. By contrast, the manual operation of our method is much simpler. For example in Fig. 4, with the same manually chosen bounding box, our method re-   ceives better result, while GrabCut fails to segment the tail of airplane. In order to achieve better segmentation, further interaction for GrabCut is shown in Fig. 4 (d). Even with more detailed human interaction, GrabCut is unable to segment the tail as well as ours. Segmentation methods based on active contour model are good at capturing boundary changes in a small region.
In a word, both methods have their advantages and disadvantages. For the first one, the prior distributions are quite precise, but it is limited to special application like cosegmentation, which needs similar objects or backgrounds. For the second one, the prior distributions could be obtained in the original image, but it needs human interactions and maybe not precise enough.

Experimental Results and Analysis
In this section, we show the performance of the proposed method by presenting on various synthetic and natural images. All the experiments are performed by using Matlab R2013b on the PC with Intel Core (3.6GHz) and 8 GB memory under Windows 10 without any particular code optimization.

Experiments on Synthetic Image
Firstly, a group of experiment on synthetic image is presented in Fig. 5. The shape of the object is quite irregular, as Fig. 5 (a) shows. Besides, the noise in the image is gaussian noise, and distributions of object and background are given in Fig. 5 (d). As for this kind of irregular object, the segmentation result of shape prior model [8] depends on the similarity of the template. Figures 5 (b) and (c) show an accurate template and an inaccurate template. It can be seen that, compared with the template in Fig. 5 (b), the object in Fig. 5 (a) is shifted, rotated and shrunk. Figure 5     the template in Fig. 5 (c). It is obvious that result is better in Fig. 5 (f), which illustrates that for shape prior model, dependency on template is quite significant. Figure 5 (h) shows the final segmentation result by proposed method, combined the prior distribution information in Fig. 5 (d). Visually, the results segmentation of Fig. 5 (h) and (f) are almost the same perfect. But considering the running time, proposed method have an advantage over shape prior model, for the reason that transformation of the object would not affect our model.
In addition, we extra considered how flipping affect the performance of shape prior model and our distribution prior model. As Fig. 6 shows, the object in Fig. 6 (a) is obtained by flipping the object in Fig. 5 (a). In this case, the segmentation result achieved by shape prior model is shown in Fig. 6 (b). It can be seen that, the shape prior model which only considers the rigid motion could not handle the situation of flipping. Meanwhile, our distribution prior model would not be affected by any transformation, the result of segmentation is shown in Fig. 6 (c).
A group of contrast experiments on multimodal image is presented in Fig. 7. The contrast algorithms include MI [12], Bhattacharyya [13] and AMP [14]. From the final segmentation result comparison, it can be seen that without prior information, the classical nonparametric statistical active contour model would not achieve satisfied result on such kind of multimodal image, while our model achieves satisfied result. On the other hand, our method did help im-  prove the segmentation result, through making good use of the prior distribution information.

Experiments on Natural Image
In this subsection, the experiments are divided into two groups: prior object segmentation and prior background segmentation.
The experiments of prior object segmentation are shown in Figs. 8 and 9. For the image in Fig. 8 (a), the object is a rose with complicated edge. The similar rose is shown as Fig. 8 (b), and its distribution is considered as the prior object distribution P . Figure 8 [12], Bhattacharyya [13] and AMP [14], respectively. It can be seen that without prior information, the leaves in deep green are misclassified as object. However, based on prior object distribution information, our method can extract the rose from the green leaf background satisfactorily. For the image in Fig. 9 (a), the object is a polar bear with intensity homogeneity. The bounding box to get prior object distribution is shown in Fig. 9 (b). The region inside the box is considered as the prior object region, and its distribution is considered as the prior object distribution P . Figure 9 (c) is the final segmentation result of our model, while Figs. 9 (d)(e)(f) show the final segmentation results of MI [12], Bhattacharyya [13] and AMP [14], respectively. It can be seen that without prior in-    [12], Bhattacharyya [13] and AMP [14]. formation, the river on the bottom of the image is mistaken as the boundary of object.
The experiments of prior background segmentation are shown in Fig. 10. For the image in Fig. 10 (a), the object is a warning board on the beach with complicated words. The similar image is shown as Fig. 10 (b), which is a pure beach without any object. The region in the whole image is considered as the prior background region, and its distribution is considered as the prior background distribution Q . Figure 10 (c) is the final segmentation result of our model, while Figs. 10 (d)(e)(f) show the final segmentation results of MI [12], Bhattacharyya [13] and AMP [14], respectively. It can be seen that without prior information, the words on the warning are misclassified as object.

Quantitative Performance
In this subsection, the performance of the proposed method is evaluated on the Weizmann segmentation evaluation database (with groundtruth data) [23]. In order to compare the segmentation results with groundtruth data, unlike the presentation in Sect. 3.2, the segmentation results are transformed into binary images, as Fig. 11 shows. Because we planned to experiment on the whole dataset, initial settings of all the image are uniform, including the initial contour, which is set as a circle in the center of the image. As for the prior information, only the prior object distribution P is considered, which could be obtained from groundtruth data.
Average running time, precision, recall, and F-Measure and are compared against the entire database, with the F-Measure defined as: Table 1 Quantitative comparison on the Weizmann segmentation evaluation database between the proposed method and methods MI [12], Bhattacharyya [13] and AMP [14]. where β 2 is usually set to 0.3. As can be seen from Table 1, our model achieves the best performance on the database. Specifically, Fig. 12 shows the corresponding performance comparison with F-Measure curve (the test images are numbered by 1, 2, 3, . . .). Compared with the other methods, our method achieves better performance where F-Measure is generally higher than others.

Conclusion
In this paper, on the basis of nonparametric statistical active contour model, we proposed a novel distribution prior model. Unlike traditional shape prior model, our model is not sensitive to the shapes of object boundary. Instead, the prior information in our model is the distributions of object and background region. During the contour curve convergence, while maximizing distribution difference between the inside and outside of the active contour, the distribution difference between the inside/outside of contour and the prior object/background is minimized. According this idea, we constructed the energy function and solved it through variational level set method. With prior distribution information, the proposed method can segment the image more efficiently and accurately. The experiment results show that the algorithm proposed in this paper can effectively segment the images. Compared with other traditional nonparametric statistical active contour models, the method proposed in this paper has better segmentation performance and higher convergence rate.