{'fraction_non_alphanumeric': 0.037194712077078196, 'fraction_numerical': 0.01092314586600941, 'mean_word_length': 4.356771354270855, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 23, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Visual-hint Boundary to Segment Algorithm for Image Segmentation

Image segmentation has been a very active research topic in image analysis area. Currently, most of the image segmentation algorithms are designed based on the idea that images are partitioned into a set of regions preserving homogeneous intra-regions and inhomogeneous inter-regions. However, human visual intuition does not always follow this pattern. A new image segmentation method named Visual-Hint Boundary to Segment (VHBS) is introduced, which is more consistent with human perceptions. VHBS abides by two visual hint rules based on human perceptions: (i) the global scale boundaries tend to be the real boundaries of the objects; (ii) two adjacent regions with quite different colors or textures tend to result in the real boundaries between them. It has been demonstrated by experiments that, compared with traditional image segmentation method, VHBS has better performance and also preserves higher computational efficiency.


Introduction
Image segmentation is a vast topic in image analysis. In this chapter, we present a low-level image segmentation method, which has been proposed to segment images in a way that agrees with human perceptions. In recent years, Most of the image segmentation algorithms are designed based on an idea that partitions the images into a set of regions preserving homogeneous intra-regions and inhomogeneous inter-regions. By this idea, these methods segment images in classification or clustering manner. However, human visual intuition does not always follow this manner. Our goal of this research is to define a low-level image segmentation algorithm which is consistent with human visual perceptions.
The proposed new image segmentation method is called Visual-hint Boundary to Segment (VHBS). VHBS abides by two visual hint rules based on human perceptions: (i) the global scale boundaries tend to be the real boundaries of the objects; (ii) two adjacent regions with quite different colors or textures tend to result the real boundaries between them. Compared with other unsupervised segmentation methods, the outputs of VHBS are more consistent to the human perceptions. Beside, reducing complexity is another objective of VHBS since high performance segmentation methods usually are computationally intensive. Therefore, chaos and non-chaos concepts are introduced in VHBS to prevent algorithm going down to details of pixel level. It guarantees that segmentation process stays at a coarse level and keeps the computational efficiency.
VHBS is composed by two phases, Entropy-driven Hybrid Segmentation (EDHS) and Hierarchical Probability Segmentation (HPS.) VHBS starts from EDHS, which produces a set of initial segments by combining local regions and boundaries. These local regions and boundaries are generated by a top-down decomposition process and initial segments are formed by a bottom-up composition process. The top-down decomposition process recursively decomposes the given images into small partitions by setting a stopping condition for each branch of decomposition. We set an entropy measurement as the stopping condition since smaller entropy of local partitions implies lower disorder in the local partitions. To preserve the computational efficiency, we set up a size threshold of the partitions to prevent the decomposition going down to pixel level. Based on this threshold, local partitions are grouped into two types, chaos if the size of a partition is less than the threshold and non-chaos otherwise. Local regions and boundaries are computed in local partitions. Each local region is described by a vector called feature description and the local boundaries are weighted by the probabilities. To calculate the probabilities, we design two scale filter, f 1 and f 2 , which are based on the two visual hints (i) and (ii) respectively. The boundaries be-tween two adjacent regions are weighted by the product of f 1 and f 2 . A bottom-up composition process is followed and combines these local regions and boundaries to form a set of the initial segments, S = (s 0 , . . . , s n ).
The second phase of VHBS is Hierarchical Probability Segmentation (HPS,) which constructs a Probability Binary Tree (PBT) based on these initial segments S. PBT presents the hierarchy segments based on boundary probabilities between these initial segments, which forms the leaves of PBT. The root represents the original images and the intern nodes of PBT are the segments combined by their children. Links are labeled by the boundary probabilities. PBT can be visualized in number of segments or even provides the local details. The difference compared with the methods based on MST such as [20,26,21] is that these methods generate the tree structure based on the similarities between pixels. Whereas, our method generate the tree structure based on probabilities between regions. It makes the algorithm insensitive to the noise and it greatly reduces the computational complexity. A similar approach is proposed by [1]. Compared with this approach, VHBS is more efficient since VHBS prevents the decomposition process going down to pixel level by setting a chaos threshold. The novel aspects of VHBS include: 1. Visual-Hint: Algorithm abides by two visual hint rules which force the outputs of VHBS are more consistent to human perceptions; 2. feature Detection: VHBS outputs a set of feature descriptors, which describe the features for each segment; algorithms are k-means clustering [31], histogram threshold, region growth and watershed transformation. These methods are efficient and easy to understand but with obvious weaknesses which become barriers for applications. These weaknesses include sensitivity of image noise and textures; improperly merging two disjoint areas with the similar gray values by histogram threshold methods; improper initial condition resulting in incorrect outputs and tending to produce excessive over-segmentation by watershed transformation methods [27]. All these examples demonstrate that image segmentation is an extensive and difficult research area. In recent years, numerous image segmentation methods have been proposed and greatly overcome those weaknesses. Commonly, segmentation algorithms fall into one or more than one of the following categories: edge-based, region-based, cluster-based and graph-based. The idea of edge-based segmentation methods is straightforward. Contours and segments highly correlate each other. The closed contours give the segments and segments automatically produce the boundaries. Edge-based segmentation methods rely on contours located in images and then these contours produce the boundaries of the segments. Therefore, much research has focused on contour detection. The classical approaches to detect the edges are to look for the discontinuities of brightness such as in Canny Edge Detection [6]. [36] demonstrates that these approaches by looking for discontinuities of brightness are inadequate models for locating the boundaries in natural images. One reason is that texture is a common phenomenon in natural images and these textures produce some unwanted edges. Another reason is that to locate segments in an image by edges requests closed boundaries. These approaches usually provide incontinuous contours, which is inadequate for locating the segments. In recent years, many high performance contour detections have been proposed such as [42,36,32,55,33]. One category of contour detections is locating the boundary of an image by measuring the local features. To improve the edge detection performance on the natural images, some approaches consider one or combine more descriptors for each pixel in several feature channels over a different scales and orientations to locate boundaries. [36] proposes a learning schema approach that considers brightness, color and texture features at each local position and uses a classifier to combine these local features. Based on the research of [36,33] combines the spectral component to form the so called globalized probability of boundary to improve the accuracy of the boundary detection. There are many boundary detection and segmentation methods which are oriented energy approach [37]. Examples of these approaches are [51,40]. To achieve high accuracy, these approaches usually combine more than one local feature channels. The computational complexity becomes a bottleneck if the application requests high computational efficiency. Of course there are many other proposed boundary detection and segmentation algorithms based on rich texture analysis such as [4,28,22]. However, highly accurate image contour and segment detection methods are computationally intensive [1].
To locate the segments from the contours, the contours must form closed regions. An example of such research is [45] by bridging the disconnecting contours or contours tracking to locate the regions. Another recent research is [1], which can be divided into two phases: (i) Oriented Watershed Transform (OWT) produces a set of initial regions from a contour detection. Paper selects gPb proposed by [33] as the contour detection algorithm since this contour detector gives high accuracy by the benchmark of BSDB [35]; (ii) Ultrametric Contour Map (UCM) constructs the hierarchical segments. A tree is generated by a greedy graph-based region merging algorithm, where the leaves are those initial regions and the root is the entire images. The segmentation algorithm proposed by [1] has high accuracy segmentation performance. But the disadvantage is obvious. gPb is a expensive contour detection and gPb provides fine gradient initial regions. It can be proved that the time complexity of constructing hierarchical segments over such a fine gradient is also computationally intensive. Other examples of recent contour-segment researches are [22,23].
Typically, a region-based algorithm is combined with clustering techniques to assemble the sub-regions into final segments and numerous methods fall into these two schemas such as [48,30,10,12,11,24,13]. The common used techniques include region growth, split-merge, supervised and unsupervised classification. [24] proposes a region growth algorithm, called random walk segmentation, which is a multi-label, user interactive image segmentation. This algorithm starts from a small number of seeds with user-predefined labels. Random walk algorithm can determine the probabilities by assuming a random walker starting at each unlabeled pixel that will first reach one of these user-predefined seeds. By this assumption, pixels are assigned to the label which is the greatest probability based on a random walker. Mean shift [13] is a well known density estimation cluster algorithm and been widely used for image segmentation and object tracking. Based on the domain probability distribution, the algorithm iteratively climbs the gradient to locate the nearest peak. [13] demonstrates that mean shift provides good segmentation results and is suitable for real data analysis. But the quadratic computational complexity of the algorithm is a disadvantage and the choice of moving window size is not trivial.
In recent years, much research has been built based on graph theoretic techniques. It has been demonstrated by [44,20,16,26,19,18,15,21,52,5,39,50,8,34,17] that these approaches support image segmentation as well. As pointed out by [26], graph-based segmentation could be roughly divided into two groups. One is tree-structure segmentation and another is graph-cut segmentation. Assuming a 2D image as space P , both of these two approaches view P as the collection of a set of subgraphs < p 1 , . . . , p n >, where each p i is an undivided partition, P = p i and φ = p i p j for all 1 ≤ i = j ≤ n. Commonly, p i denotes a pixel of the images. Tree-structure [20,16,26,19,18,15,21] expresses the split-merge process in a hierarchical manner. The links between parents and children indicate the including relationship and the nodes of the tree denote the pieces of subgraphs. Graph-cut [52,5,39,50,8,34,17] views each element of < p 1 , . . . , p n > as a vertex and the edges of the graph are defined by the similarities between these adjacent vertices. This process forms a weighted undirected graph G = (V, E) and relies the graph cutting to process the graph partition.
A common tree-structure approach is minimum spanning tree (MST) [41]. [20,21] propose an algorithm based on MST. That is using the local variation of intensities to locate the proper granularity of the segments based on the so called Kruskal's minimum spanning tree (KMST). Another recent example of tree-structure approach is [16]. The purpose of this approach is to find the semantic coherence regions based on -neighbor coherence segmentation criterion by a so called connected coherence tree algorithm (CCTA). Rather than generating tree based on the pixel similarities, [1] generate a tree structure based on the region similarities. Tree structure based on region similarities should provide better computational complexity than the structure based on the pixel similarities since |V | is greatly reduced by replacing pixels by regions.
Graph-cut approaches are also called spectral clustering. The basic idea of the graph-cut approach is partitioning G = (V, E) into disjoint subsets by removing the edges linking subsets. Among these approaches, the normalized cut (Ncut) [44] is widely used. Ncut proposed a minimization cut criterion which measures the cut cost as a fraction of the total edge connection to all the nodes in the graph. This paper demonstrates that minimizing the normalized cut criterion is equivalent to solving a generalized eigenvector system. Other recent examples of graph-cut approaches are [52,5]. Graphcut approaches have been proved to be NP-complete problems and the computational complexity is expensive. These disadvantages become the main barriers for graph-cut methods.

Entropy-driven Hybrid Segmentation
Entropy-driven Hybrid Segmentation, EDHS, begins with a top-down decomposition from the original input images and finishes with a bottom-up composition. Top-down decomposition quarterly partitions a given image and correspondly produces a quadtree based on a stopping condition. EDHS uses an edge detector, such as Canny Detector [6], to locate the boundaries between the local regions in the leaves. These boundaries are weighted by the probabilities computed based on the two visual hint rules.
Bottom-up composition recursively combines the local regions when the two adjacent local regions share a boundary with zero probability. This process forms the initial segments, S = (s 0 , . . . , s n ), and a set of probabilities, C b = {c i,j }, which describes the weights of the boundaries between each pair of the adjacent initial segments, where index i and j imply two initial segments s i and s j , which share a boundary valued by a real number c i,j ∈ [0, 1], 0 ≤ i = j ≤ n. For each initial segment s i , a feature vector, f d i =< v 1 , . . . , v m >, is generated to describe this segment. The feature descriptor, such as the CF in BIRCH [47], summarizes the important features of each area (cluster.) Although the specific values used in feature descriptor may vary, in this chapter we assume < r, g, b >, where r, g and b are mean values of color channels of red, green and blue.

Top-down decomposition
Decomposition mechanism is a wildly used technique in hierarchical image segmentation [2,38]. Our decomposition process recursively decomposes the images into four quadrants. The decomposition process is presented by an unbalance quadtree. The root represents the original image and nodes represent the four partitions. A stopping condition is assigned for each branch of decomposition. Partition process is stopped when the desired stopping condition is reached. Figure 1 demonstrates an example of the data structures. We summarize the top-down decomposition as follows: i Partitioning the images into small pieces reduces the information presented in local images, which helps VHBS conquer the sub-problems at the local position; ii Decomposition provides the relative scale descriptor for the scale filter to calculate the probabilities of the boundaries. We will discuss the relative scale descriptor in section 3.2.1; iii Divide and conquer schema potentially supports the parallel implementation, which could greatly improve the computational efficiency.
To describe the decomposition, the dyadic rectangle [29] is introduced. A dyadic rectangle is the family of regions The dyadic rectangle of I has some nice properties. Every dyadic rectangle is contained in exactly one "parent" dyadic rectangle, where the "child" dyadic rectangles are located inside of a "parent" dyadic rectangle. The area of "paren" is always an integer power of two times of "chil" dyadic rectangle. Mapping the images into Cartesian plane, dyadic rectangle provides a model to uniformly decompose images into sub-images recursively.
Given an n × m I, assuming that n and m are the power of 2, the set of dyadic rectangles at levels (0, 0) through (log n, log m) form a complete quadtree, whose root is the level (log n, log m) dyadic rectangle [0, n − 1] × [0, m − 1]. Each dyadic rectangle I s,t with level 1 ≤ s ≤ log n, 1 ≤ t ≤ log m has four children that are dyadic rectangles at levels s−1 and t−1, which are four quadrants of the I s,t . Suppose

Stopping Condition
In information theory, entropy is a measure of the uncertainty associated with a random variable [14]. We choose entropy [43] as the stopping condition for the top-down decomposition since entropy provides a measurement of disorder of a data set. Let ζ denote the stopping condition for each branch Definition 2 (Entropy :). Given a segment set X = {x 1 , . . . , x k } based on a partition P , then entropy of I to the base b is where p denote the probability mass function of segment set To make the analysis simple, assume the logarithm base is e. This gives Theorem 1. Let k be the number of segments of an image, supremum of H k (X) is strictly increasing function with respect to k and the supermum of Proof. Let H k (p 1 , . . . , p k ) denote the entropy of an image with segment set By [14] Theorem 2.6.4, we have Then we have Definition 3 (K -Color Rule:). Using different colors for different segments in segment set X = {x 1 , . . . , x k }, if the image holds no more than k segments, which means image can be covered by k colors, we say condition 'K -Color Rule' (K-CR) is true; else, K-CR is false.
Assume an m × n image I. If I is a one color (1-CR) image, then it is a zero entropy image by Theorem 1. Consider another case. Assume the image is too complicated that none of the segments holds more than one pixel. This case gives the maximum entropy, ln(mn) (k yields mn.) Then, the range of H k (X) for a m × n I is [0, ln(mn)]. The larger the entropy is, the more information is contained in the images.
Based on this observation of H k (X), we choose image entropy as the stopping condition for the top-down decomposition because H k (X) is highly related to the number of segments. k denotes the number of segments and the range of k is [1, mn]. If a proper value of k is chosen for a given image, then ζ yields to H k (X) ≤ ln(k) by Theorem 1. That is, for a certain branch of the quadtree, decomposition approach partitions the given images until the local entropy is no larger than ln(k).

K as An Algorithm Tuning Parameter
The value of k impacts the depth of decomposition. A small value of k results a deep quadtree because ln(k) is small. Small leaves do not contain too much information, which results few boundaries within the leaves. Thus k is a key issue since it decides the weights of the edge-and region/clustering-based segmentation techniques used in EDHS. In other words, k is a measurement that indicates the degree to which each technique is used. Figure 2 demonstrates that k can be viewed as a sliding block ranging from 1 to mn. If k is close to 1, EDHS is closer to a region/cluster-based segmentation method since few boundaries are detected in the leaves. The weight of edge-based technique increases as long as the value of k becomes large. Suppose k = 1, then the stopping condition ζ yields H k (X) ≤ ln(1) = 0. To meet this stopping condition, the decomposition process goes down to the pixel level if the neighbor pixels are inhomogeneous. Then, EDHS is a pure region/cluster-based segmentation since there is no necessary to detect the boundaries for the one color images.
Suppose k = mn, then the stopping condition ζ yields H k (X) ≤ ln(mn) . By Theorem 1, no decomposition approach is processed since ζ holds for an m × n image by Theorem 1. Then, EDHS is a pure edge-based segmentation since no decomposition approach is employed. EDHS just runs an edge detector locating the boundaries to form the local regions.
For an m × n image, the possible values of k range from 1 to mn. Are all these integers from 1 to mn valid for k? The answer is no. Let us take a close look at the cases when k = 1 and k = 2.
Points, lines and regions are three essential elements in a two-dimensional image plane. We are looking for a value of k which can efficiently recognize the lines and regions (we treat a point as noise if this point is inhomogeneous with its neighbors.) Keep in mind that the aim of decomposition is to reduce the disorder. It suggests that k should be a small integer. When k = 1, as discussed above, it forces the leaves to be one color. EDHS yields a pure region/cluster-based segmentation. Previous algorithms of this type have proved to be computationally expensive [46].
Consider k = 2. The decomposition approach continually partitions the image until the local entropy is less than ln (2), which tends to force the leaves holding no more than two colors. Assuming a line passing through the sub-images, to recognize this line, one of the local regions of the leaves needs to be this line or part of a line. It makes the size of leaves quite small and forces the decomposition process to go down to pixel level. Under this circumstance, the time and space complexities are quite expensive. Another fatal drawback is that the small size of leaves makes the EDHS sensitive to noise. Even a pixel, which is inhomogeneous with its neighbors, could cause invalid recognition around this pixel area.
k ≥ 3 is a good choice because it can efficiently recognize the lines and regions in 2D plane. An example is shown in Figure 3 (a). Top-down decomposition goes down to pixel level to locate the curve if set k < 3. But for k ≥ 3, no decomposition is needed since the entropy of Figure 3 (a) must be less than ln(3) by Theorem 1. It suggests that EDHS is stable and reliable when k ≥ 3.
There is an extreme (the worst) case that we need to consider. This case is shown in Figure 3 (b). Multiple lines pass through one point, say p. Define a closed ball B(p, ), where p is the center and > 0 is the radius of the ball. No matter how small is, B(p, ) contains 2N l + 1 segments divided by N l lines. In other words, partitioning does not help reduce the number of segments around the area B(p, ). Therefore, decomposing images into To handle this case, we introduce 'chaos' leaves.
As shown in Figure 3 (b), entropy does not decrease inside B(p, ) along with decomposition. To solve this problem, we introduce a threshold 1, which is the smallest size of the leaves. If the size of partition is less than l, the top-down decomposition does not continue even though the desired ζ has not been reached. If this case happens, we call these leaves chaos.

Approximate Image Entropy
To calculate the entropy defined by Definition 2, we should know the probability distribution P r(X = x i ) = p i , where X = (x 1 , . . . , x k ) is a set of segments of I. In most cases, we have no prior knowledge of the distribution of the segments for the given images. In other words, we are not able to directly compute the image entropy defined by Definition 2. Definition 4 gives an alternative calculation called approximate image entropy, which does not require any prior knowledge of the distribution of the segments but provides an approximate entropy value.
Definition 4 (approximate entropy:). Given a partition P of the interval where a and b are minimum and maximum of feature values of a given image I, then approximate entropy H(V ) is defined as where p denotes the probability mass function of the feature value set V = {v 1 , . . . , v n }. Each v i denotes a collection of pixels whose feature values are After setting the logarithm base as e, H(V ) yields Theorem 2. Given an I and a partition P , H(V ) is less or equal then H(X).
Proof. Given an I and a partition P = [j 0 , j 1 , . . . , j n ], where a = j 0 ≤ j 1 ≤ . . . ≤ j n = b, a and b are minimum and maximum of pixel feature values of I. Let k is the number of segments defined in Definition 2. By the Definition of 2, k must be greater or equal to n. There are two cases need to be considered. One is k = n and another is k > n. Case I: if k = n, by the Definition 2 and Definition 4, p( Case II: if k > n, it implies that there must exist at least two segments which locate at the same partition interval. Without loss of generality, assuming H(X) and H(V ) are defined over the partition P , where H(X) with two segments x i and x j , 1 ≤ i = j ≤ k, both feature values of x i and x j locate in the interval [j h−1 , j h ], 1 ≤ h ≤ n. If we can prove H(X) > H(V ), then the theorem can be proved by repeating following proof arbitrary times.
By Definition 2 and 4 respectively, Notice that α x < (1 + α) y since α is a positive number and 0 < x < y < 1 Assume an I and k-CR is true. It implies that H k (X) ≤ ln(k) by Theorem 1. By Theorem 2, H(V ) must be equal or less than H k (X). Therefore, It induces the a logical chain, truth of k-CR ⇒ H k (X) ≤ ln(k) ⇒ H(V ) ≤ ln(k). Both H k (X) ≤ ln(k) and H(V ) ≤ ln(k) are necessary but not sufficient conditions for the truth of k-CR.

Noise Segments
The term noise of an image usually refers to unwanted color or texture information. We do not count a small drop of ink on an A4 paper as a valid segment. In most circumstances, it would be considered as noise. How to distinguish those valid and invalid segments is an important issue.
Definition 5 (Dominant and Noise segments:). Let p denote the probability mass function of segment set X = {x 1 , . . . , x k } in I. Given a threshold t noise ∈ [0, 1], x i is a noise segment if P r(X = x i ) = p i ≤ t noise and p i ≤t noise p i is greatly less than p i >t noise p i , 1 ≤ i ≤ k. Other segments are called dominant segments.
If the segments are small enough and the total area of those segments occupies a small portion of a given image, we call those segments noise segments. The first requirement of noise segment is understandable because the noise segments should be small. The reason of defining the second condition is to avoid the cases that the images are totally composed by small pieces.
The value of k of K-CR in Definition 3 refers the number of dominant segments. By Theorem 1 and 2, the supremum of H(V ) for this given image is no longer ln(k). The noise supremum of H(V ) should be slightly larger than ln(k). Assuming the noise redundancy be , then redundancy stopping condition, ζ r , yields H(V ) ≤ ln(k) + .
Consider dividing segments into two groups, noise and dominant segments. By Definition 4, H(V ) yields as follows: Given an image I, let a be the total portion of dominant segments. Then a = p(x i )>t noise p(x i ) and the rest area, 1 − a = p(x i )≤t noise p(x i ), is the portion of noise segments. By Definition 5, a >> (1 − a). Let k and k be the number of dominant and noise segments respectively. After applying Theorem 2.6.4 [14], we get the noise supermum of H(V ) as follows.

Bottom-up Composition
Bottom-up composition stands at a kernel position of VHBS since this process combines the local regions at the leaves of the quadtree to form the initial segment set S = (s 0 , . . . , s n ). It also calculates the probabilities of the boundaries between these initial segments. At the same time, bottom-up The probabilities of the boundaries between these initial segments are computed by two filters, which are designed based on the two visual hint rules (i) and (ii) separately. The first one called scale filter, f 1 , abides by rule (i). The probabilities are measured by the length of the boundaries. Longer boundaries result higher probabilities. The second one called similarity filter, f 2 , abides by rule (ii). The probabilities of the boundaries are measured by the differences of two adjacent regions. Larger different features of two adjacent regions result higher probability boundaries. The finial weights of the boundaries are the trade-off of two filters by taking the products of these two filters. If the probability of the boundary between two local regions is zero, these two local regions are combined together.

Scale Filter
Scale filter is defined based on the visual hint (i): the global scale boundaries tend to be the real boundaries of the objects. It suggests that these bound-aries caused by the local texture are not likely to be the boundaries of our interesting objects because the objects with large size are more likely to be our interesting objects. To measure the relative length of each boundary, we use the sizes of the decomposition partitions in which the objects are fully located. These local scale boundaries are not likely to extend to a number of partitions since the length of these boundaries are short. By this observation, we define the scale filter f 1 based on the sizes of the partitions.
Scale filter f 1 is a function which calculates the confidence of the boundary based on the scale observations. The input parameter of f 1 is the relative scale descriptor s, which is ratio between the sizes of the local partitions and the original images. The relative scale descriptor s is the measurement of the relative scale of the boundaries. We assume the sizes of the images are the length of the longer sides. An example of calculating scale descriptor s is shown in Figure 5. The boundaries inside the marked partition have the relative scale descriptor s, which is defined as: where z is the size of a partition and L is the size of a original image. If s is small, it suggests that the confidence of the boundary should be small since the boundaries are just located in a small area. If s is close to one, it suggests that the boundaries have high confidence. The gradient of f 1 (s) is decreasing. This is because human perception is not linearly dependent on the relative scale descriptor. For the same difference, human perception is more sensitive when both of them are short rather than both of them are long. Therefore we define f 1 (s) as follows: where β 1 is the scale damping coefficient and s is the relative scale descriptor. Figure 6 gives the f 1 (s) with different scale damping coefficients. Figure 6: Scale filter f 1 (s) with different scale damping coefficients.

Similarity Filter
Compared these regions with similar colors or textures, human perception is more impressed by regions with quite different features. Visual hint (ii) suggests that two adjacent regions with different colors or textures tend to produce the high confidence of boundaries between them. Based on this observation, we defined a similarity filter f 2 to filter out the boundary signals which pass through similar regions. Similarity filter f 2 is a function which calculates the confidence of the boundaries based on the similarity measurements between two adjacent regions. Examples of similarity measurements are Dice, Jaccard, Cosine, Overlap. The similarity measurement is a real number in interval [0, 1]. The higher the value, the more similar two regions are. Similarity = 1 implies that they are absolutely the same and zero means they are totally different. Then we define f 2 (x) as follows to satisfy the requirements above.
where β 2 is the similarity damping coefficient and x is the similarity measurement between two adjacent regions defined as f d 1 and f d 2 are feature descriptors of the local regions. Figure 7 gives the curves of f 2 (x) with respect to different similarity damping coefficients. We implemented VHBS by using f 2 (x) given by equation 6. We found that the boundary signals are over-damped by the similarity filter f 2 (x). The algorithm assigns low confidence values for boundaries with global scales that preserved similar feature descriptors. Human visual is also sensitive to these sorts of boundaries. To avoid these cases, we redesign the similarity filter by considering the relative scale descriptor as well. Similarity filter is redefined as f 2 (x, s), which outputs high confidence weights when either parameter s or x is close to one. We also introduce a threshold similarity t. If the similarity measurement is higher than this threshold, algorithm sets the confidence as 0, which means that there are no boundaries between these two regions if human visual cannot tell the difference of these two adjacent regions.
where β 2 is the similarity damping coefficient, α is amplitude modulation and x is the similarity measurement between two feature descriptors. Figure  8 demonstrates f 2 (x, s) when β 2 = 10 and α = 20.

Partition Combination
The bottom-up composition starts from the very bottom leaves. Composition process iteratively combines partitions from the next lower layer and this process continues until reaching the root of the quadtree.
For the leaves of the quadtree, each boundary is marked by a confidence value, cnf , which is given by formula f 1 (s) · f 2 (x, s), where f 1 (s) and f 2 (x, s) are scale and similarity filters defined by equations 6 and 8 respectively. The relative scale descriptor, s, is computed by equation 5 and x is the similarity of two adjacent local segments. Figure 9 demonstrates the function cnf = f 1 (s) · f 2 (x, s) where with β 1 = 8, β 2 = 10 and α = 20. For these non-chaos leaves, the contours which form the closed areas and the borders of the leaves form the boundaries of local regions. For these chaos leaves, the boundaries only refer to the leaf borders. Each running time of bottom-up combination, four leaves are combined together to the next lower layer. Figure 10 shows that there are several possible cases during combining four leaves together.
i No interconnection happens during the combination; ii A new segment is formed by connecting several local regions which locate in different leaves; iii The boundaries of leaves happen to be the boundaries of segments. For the case (i) such as region A shown in Figure 10, cnf is calculated when it is in leaf 1 and there is no necessary to recalculate cnf during the combination. But for the case (ii) such as region B, region B is connected by four local regions. Each cnf is calculated separately. But the cnf region B needs to be recalculated after four local regions combined together since the new combined segment is located in a large partition and the relative scale descriptor is increased. Besides, a feature descriptor for region B is generated based on feature descriptors for each local region. The third case is that the boundaries of partitions happen to be the boundaries of the regions. One example is region C shown in Figure 10. During the combination process, algorithm also calculates cnf of the leaf boundaries. After combination hits the root of the quadtree, the process generates the initial segment set S = (s 0 , . . . , s n ), the boundary confidence set C b = {c i,j }, where c i,j indicates the boundary probability between segments s i and s j , 0 ≤ i = j ≤ n and the feature descriptor set

Hierarchical Probability Segmentation
Hierarchical segmentation is a widely used technique for image segmentation. Regular hierarchical segmentation is modeled in layer-built structures. Compared with the regular hierarchical structures, Hierarchical Probability Segmentation, HPS, presents the hierarchical segmentation by a Probability Binary Tree (PBT,) where the links are weighted by the confidence values, cnf ∈ [0, 1]. The root represents an image. Nodes represent segments and the children of a node are the sub-segments of this node. Initial segments S = (s 0 , . . . , s n ) compose the leaves of PBT. Since PBT is generated in greedy manner, higher level nodes always have higher probabilities than the lower level nodes. One can visualize the PBT in arbitrary number of segments. Of course, this number is less than the number of the initial segments.

Probability Binary Tree (PBT)
Definition 6 (Probability Binary Tree (PBT):). Let n 0 denote the root of a PBT and n 0 represents the original images I. Nodes of PBT denote the segments and links represent the relationship of inclusion. Assume nodes n i , n i1 , n i2 and links l i1 , l i2 , where n i1 and n i2 are children of n i linked by l i1 and l i2 respectively. n i , n i1 , n i2 , l i1 , l i2 preserve the following properties: i Let DS = {(n 1 i1 , n 1 i2 ), (n 2 i1 , n 2 i2 ), . . .} denote the set of all the possible pairs of sub-segments of n i . Function g(n j i1 , n j i2 ) gives the cnf of segments n j i1 and n j i2 . Assume (n i1 , n i2 ) = arg max g(DS) and l i1 . Therefore l i2 are weighted by g(n i1 , n i2 ); ii for any element of DS, (n j i1 , n j i2 ), n i = n j i1 ∪ n j i2 and φ = n j i1 ∩ n j i2 .
Definition 6 recursively gives the definition of PBT, which has the following properties: i Every PBT node (except root) is contained in exactly one parent node; ii every PBT node (except the leaves) is spanned by two child nodes; iii a number of pairs of nodes span n i . These pairs are candidates to be the children of n i and each pair is labeled with the probability of these two nodes, {cnf 0 = g(< n 0 i1 , n 0 i2 >), cnf 1 = g(< n 1 i1 , n 1 i2 >), . . .}. PBT chooses the pairs < n j i1 , n j i2 >, which have the highest cnf j to span the node n i . The links l i1 and l i2 are weighted by cnf j ; iv assume a node n i with a link l i pointed in from its parent and the links l i1 , l i2 pointing out to its children. Weights of l i1 , l i2 must be no larger than the weight of l i ; v if two nodes (segments) overlap, one of them must be a child of the other.
By presenting the segmentation in PBT, the images are recursively partitioned in two segments with the highest probability among all the possible pair of segments. Figure 11 gives an example of the PBT.
Let C b = {c i,j } denote the set of boundary probabilities. c i,j ∈ C b represents the boundary probability between initial segments s i and s j , where c i,j ∈ [0, 1], 0 ≤ i = j ≤ n. HPS constructs PBT in bottom-up manner, Figure 11: Probability Binary Tree.
which means leaves are first created and the root is the last node created. To generate a PBT in greedy schema, C b is sorted in ascending order. Let T pbt be a PBT and C b be the ascending order sequence of C b . Algorithm 3 describes to generate a T pbt .
input : C b : sorted C b in ascending order output: T pbt : a probability binary tree, PBT while C b is not empty do

Visualization of the Segmentation
Generally, there are two ways to visualize the segments. One is thresholdbased visualization and another is number-based visualization. As discussed in previous section, the root of the PBT represents the original images. For the other nodes, the more shallow the positions are, the more coarse-gradient the segments are. For example, visualizing image in segments a and b shown in Figure 11 is combining initial segments 1, 2 and 3 together to form segment a and combining initial segments 4 and 5 together to form segment b.
Suppose a threshold, t visual ∈ [0, 1], is selected for visualization. By the properties of the PBT, the weights of the links are the probabilities of the segments. The weighs are decreasing as long as the depths are increasing. Given a t visual , threshold-based visualization only displays the segments whose link weights are greater than the given t visual .
The number-based visualization displays a certain number of segments. Let n visual denote the number of visualization segments. The implementation of number-based visualization is trivial. Algorithm sorts the nodes in descending order with respect to the link weights and picks the first n visual number of nodes to display.

Algorithm Complexity Analysis
Since the algorithm is divided into two stages, EDHS and HPS, we discuss the computational complexity of them separately.

EDHS Computational Complexity
Assume the depth of the quadtree generated by top-down decomposition is d and the depth of the root is zero. The maximum d is (min( log 2 n , log 2 m )− log 2 l ), where n × m is the size of original images and l is the chaos threshold. Depending on the different images and the chosen stopping condition ζ, decomposition process generates an unbalance quadtree with depth of d. To analysis the complexity of the decomposition, we assume the worst cases that the images are fully decomposed. It implies that depth of all the leaves is d = (min( log 2 n , log 2 m )− log 2 l ). At the ith level of the quadtree, there are 4 i numbers of nodes and the size of each node is mn 4 i . Then the running time of computing the stopping condition ζ of the ith depth is 4 i mn 4 i = mn and the total running time of decomposition is dmn. Commonly, the time complexity of an edge detector is O(mn) such as Canny Edge Detection [6]. Plus the time complexity of generating the feature descriptors O(mn). The running time of top-down decomposition is (d + 2)mn, which gives the time complexity of top-down decomposition O(mn).
The combination process starts from the leaves to calculate the boundary confidence by cnf = f 1 (s) · f 2 (x, s), which gives the running time m

HPS Computational Complexity
To make the analysis simple, we assume maximum d is log 2 n (under the worst situation.) It suggests that the maximum number leaves is 4 log 2 n = n 2 . This implies the worst running complexity case is that one pixel is one local segment. At pixel level, PHS considers four pixel neighbors as adjacent local segments. They are left, right, upper and below pixels. Then the maximum size of C b is 2mn. PHS first sorts C b to C b , which gives the time complexity O(mn log(mn)). Considering the algorithm to generate the T pbt , the total running time is 2mn i=1 (2mn − i) = 2(mn) 2 − mn. This gives time complexity O((mn) 2 ). Compare with the complexity of EDHS, generating T pbt is more expensive part. In real applications, the number of elements in C b is far less than 2mn since the algorithm does not go down to pixel level by setting the size threshold of the partitions. The running time also highly depends on the input images because the number of local segments function depends on the complexity of the image itself. For the test running experiments of image set [35], the average number of elements of C b is around 3000 or less. Then the practical time complexity of algorithm is far less than O((mn) 2 ).

Experimental Results
In this section, we demonstrate experiments of VHBS by tuning different parameters and evaluate the results by comparing with outputs of Normalized Cut [44] and KMST [20,21] based on the same test set of Berkeley Segmentation dataset (BSDB) [35].

Weighted Boundary Evaluations
As discussed in previous section, the visualization of boundary probability set C b results in the weighted boundaries of the initial segments S = (s 0 , . . . , s n ). Some examples are demonstrated in Figure 10. We use the benchmark provided by BSDB, which uses Precision-Recall curves [49] to evaluate the boundary detection. Precision is defined as the number of true positives over the number of elements retrieved by the detection, and Recall is defined as the number of elements retrieved by detection divided by the total number of existing relevant elements. Precision measure can be viewed as the correctness and Recall measure can be viewed as the completeness.
Since the purpose of our algorithm is to locate the segments, algorithm only marks the contours that form the boundaries of the regions. Incontinuities or unclosed contours are ignored. These ignored contours include three portions. One is the contours within the chaos leaves. The second is the contours in non-chaos leaves that are Incontinuities or unclosed. These boundaries between two regions with similarity measure higher than the threshold t (in equation 8) are also ignored. These suggest that Precision-Recall curves mainly located at the left side of the PR graphs.
The first set of experiments is based on the observation of different values of k. We discussed the value of k in section 3.1.2. Recall one of the purposes of decomposition is to reduce the information contained in leaves. From this point of view, small integer is preferred for k since small values of k result more strict stopping condition. On the other hand, we need to avoid too many chaos leaves since chaos means that the algorithm has failed to recognize these regions. According to the arguments above, the ideal value of k should be as small as possible but large enough to lower the number of chaos leaves. We call this value optimization point. Obviously, different images have different optimization points. Figure 12 shows the boundary detection Precision-Recall based on k over the BSDB test set. As shown in Figure, algorithm has better Precision-Recall performances as long as k increasing since larger values of k give less number of chaos leaves. But after some points, there are no improvements because numbers of chaos leaves are zero.
Based the observation of k, we used a program to automatically locate the optimization points for each image. The program is trivial. It pre-generates the decomposition quadtree and selects the value of k which is the smallest integer in range [3, mn] but holding zero number of chaos leaves. Then the rest experiments are generated based on the optimization points for each image.
We also demonstrate the experiments based on damping coefficient β 1 of scale filter (f 1 6) in Figure 13 (ii), the experiments based on damping coefficient β 2 of similarity filter (f 2 8) in Figure 13  and the experiments based on similarity threshold t of similarity filter (f 2 8) in Figure 13 (iv). As demonstrated, different values of these parameters slightly shift the Precision-Recall curves. Based on these experiments, we choose α = 1, β 1 = 8, β 2 = 3 and t = 0.994 for the remaining experiments. Figure 14 provides some examples of boundary detections.

Visualization of the Segments
We demonstrate some examples of the natural images based on different number of segments in Figure 15. The visualizations of the segments are generated based on top-down manner of PBT. Since PBT is constructed based on the probabilities of the segments, the segments located at the higher level of PBT suggest higher possibilities of the segments. If visualization PBT in small number of segments, it gives the general outline of the images since only the segments with high possibilities are visualized. The more details are provided when visualization goes down to the depth of PBT.

Evaluation Experiments by Tuning Parameters
Rather than giving the subjective running experiments of the algorithm, the segmentation results need to be compared with other existed methods quantitatively. One usually used segmentation evaluation is supervised evaluation [7], which compares the results of segmentation against the manuallysegmented reference images. The disadvantage of such methods is that the quality of segmentation is inherently subjective. Then, there is a requirement to evaluate the image segmentations unsubjectively. Such methods are called unsupervised evaluation [54] methods such as [53,3,9].
To evaluate the results of segmentation quantitatively and objectively, [25] proposed four criteria: (i) the characteristics should be homogeneous within the segments; (ii) the characteristics should be quite different between the adjacent segments; (iii) shape of the segments should be simple and with- out holes inside; (iv) boundaries between segments need to be smooth and continues, not ragged. For our experiments, we choose Q(I) [3], H r (I), H l (I) and E [53] as evaluators. Q(I) and H r (I) measure the intra-region uniformity, which is described as the criteria (i). H l (I) measures the inter-region uniformity, which is the criteria (ii). E is defined as E = H r (I) + H l (I), which combine the criteria (i) and criteria (ii). Table 1 gives the details of the evaluators used in this chapter. The disadvantage of unsupervised evaluations is that these evaluation criteria might not appropriate for the natural images since the perception of human segmentation is based on the semantic understanding. It might result different conclusions by human perception [54]. Figure 16 gives the experimental evaluations based on damping coefficient β 1 of scale filter f 1 6, damping coefficient β 2 , amplitude modulation α and similarity threshold t of similarity filter f 2 8. Figure 16: Experimental evaluations based on β 1 , β 2 , α and t. Figure 16 demonstrates that the evaluations of Q(I), H r (I), H l (I) and E are not varied much by different damping coefficients β 1 , β 2 and amplitude modulation α. It suggests that Q(I), H r (I), H l (I) and E are not sensitive to parameters of β 1 , β 2 and α. Figure 16 (iv) presents the same information

Evaluator
Description Formula Q(I) [3] Intra-region evaluator based on color error H r (I) [53] H r (I) = R i=1 ( S i S I )H(X i ) Intra-region evaluator based on entropy H l (I) [53] Inter-region evaluator based on entropy Composite evaluator  Figure 13 (iv) demonstrated that similarity threshold t = 1 obviously has worse performance of Q(I) than other similarity threshold. This is the reason we do not set t = 1 in the experiments. Figure 17 shows the evaluations of Q(I), H r (I), H l (I) and E based on parameter of k, where N nc and N c are the number of non-chaos leaves and chaos leaves. The information shown in Figure 17 (i) demonstrates that both the numbers of chaos and non-chaos leaves are decreasing as long as k increasing. Notice that the number of non-chaos leaves is slightly increasing at very left side of the graph is because that there are too many areas transferring from chaos to non-chaos. Based on Figure 17 (i), we can make a judge that the average optimization point locates around k = 25 for the whole test set of BSDB since N c is close to zero when k is about 25. The evaluation Q(I) shown in Figure 17 (ii) strongly supports this estimation. Obviously, the optimization points are different when images are different.

Comparison with Other Segmentation Methods
In this section, we compare VHBS with Ncut [44] and KMST [20,21] over the entire test set of Berkeley Segmentation Dataset and Benchmark [35]. The source codes of Ncut and KMST are got from the author's websites. To fairly compare these three algorithms, we tune the parameters to output the same number of segments of each image in the test set. Figure 18 provides the evaluations of Q(I), H r (I), H l (I) and E based on number of segments.  [44] and KMST [20,21]. Figure 18 demonstrates that our algorithm gives the best performance of Q(I) and H r (I) almost over all the number of segments and Normalized Cut has the best performance of H l (I). Let us take a close look at the evaluator H l (I). As [53] points out, H l (I) favors very few large segments and many small segments. In other words, Segmentation with very few large segments and many small segments gives high evaluation H l (I).
It is expected that VHBS performs poorly over the evaluator H l (I) because H l (I) contradicts to the mechanism of scale filter f 1 , where scale filter favors large areas. Scale filter f 1 6 makes VHBS prefer to select large area segments, which is more consistent with human visual perception. Meanwhile, similarity filter f 2 8 favors the segments preserving high uniformity within the segments because f 2 marks the boundaries with high weights when two adjacent regions are quite different. Based on the discussion above, it is not hard to understand that VHBS performs well Q(I) and H r (I), but not H l (I) and E since H l (I) and E is penalized by number of small area segments.

Conclusion
Our contribution lies in proposing a new low-level image segmentation algorithm, VHBS, which obeys two visual hint rules. Unlike most unsupervised segmentation methods, which are based on the clustering techniques, VHBS is based on the human perceptions since f 1 and f 2 are designed based on two visual hint rules and somehow contradict clustering ideas. The evaluations of experiments demonstrate that VHBS has high performance over the natural images. VHBS still preserves high efficiency because VHBS does not go down to the pixel level by setting the entropy and chaos thresholds as the stopping condition of the image decompositions. Rather than outputting the segments of the given images, at the same time, VHBS also provides the feature descriptors, which are statistic summarization for each segment. To improve the performance, one of our future works is to construct the algorithm in learning schema to get the optimized parameters by a learning process.