An Analysis on Natural Image Small Patches

The method of computational homology is used to analyze natural image 8 × 8 and 9 × 9-patches locally. Our experimental results show that there exist subspaces of the spaces of 8× 8 and 9× 9-patches that are topologically equivalent to a circle and a Klein bottle respectively. These extend the results of the paper ”on the local behavior of spaces of natural images.” To the larger patches. The Klein bottle feature of natural image patches can be used in image compression. Keywords—natural image analysis; persistent homology; highcontrast patches; Klein bottle; barcode


I. INTRODUCTION
Many results on statistics of images were obtained in the recent years [1], [2], [3].Lee, Pedersen, Mumford [3] discuss the distributions of 3 × 3 image patches, they found that the majority of high-contrast 3 × 3 patches concentrate near A circle.Carlsson, Ishkanov, de Silva, and Zomorodian [4] analyze 3×3 natural image patches; they find a high density the subset is called the primary circle and prove that there exists the large 2-dimensional subset with the topology of a Klein bottle Which includes the primary circle.In [5], we showed that 4 × 4, 5 × 5, 6 × 6 and 7 × 7 natural image patches have the circle behavior.
In this paper, we utilize the methods of the paper [4] to study the structure of n×n high-contrast natural image patches for the cases n=8 and n=9.In particular, we find the largest 2-Dimensional subspace of each case, whose topology is that of a Klein bottle.The results of the paper enlarge the results of [4] To 8×8 and 9×9 patches.The Klein bottle feature of image patches can be used in techniques of image compression [4], [6].The data sets used in this paper were chosen from INRIA Holidays dataset [7], which are different from that of the paper [4].

II. THE DATA SETS OF NATURAL IMAGE PATCHES
As the dimensional problem of the data, it is very difficult To directly analyze the pixel distribution of images.We divide each natural image into small n×n-patches, and consider each patch as an n 2 -dimension vector, we study the topology of the space of n × n-patches for sufficiently small n, here we study the cases of n=8, 9.
Our main spaces X 8 and X 9 are sets of 8 × 8 and 9 × 9 Patches of high contrast created by the following steps.The routine handled here is similar to [3], [4], [8].
Step 1. Sample 550 images from INRIA Holidays dataset.
Step 2. Using MATLAB function rgb2gray to compute the intensity at each pixel for each image.
Step 4. We treat each patch as an n 2 -dimensional vector, and take the logarithm of each coordinate.
Step 5.For any vector x=(x 1 , x 2 , ..., x n ), we calculate the D-norm: x D .Two coordinates of x are neighbors, expressed by i ∼ j, if the corresponding pixels in the n × n patch are adjacent.The formula of D-norm is: Step 6.We select the patches which have a D-norm in the top t percent in each image.We take t = 20%, as done in [3], [4], [8].
Step 7. Subtract an average of all coordinates from each coordinate.
Step 8. We map X 8 ( X 9 ) into a unit sphere by dividing each vector with its Euclidean norm.We do not translate to the DCT basis for convenience.
Step 9. We randomly select 50,000 points from X 8 and X 9 for computational convenience, the subspaces of X 8 and X 9 are indicated by X8 and X9 respectively.

III. COMPUTATIONAL METHOD
For determining topological features of an underlying space by sampled finite points, the computing method used in this paper is persistent homology, which is set up by Edelsbrunner, Letscher, and Zomorodian [9] and distilled by Carlsson and Zomorodian [10].To apply persistent homology, we firstly build lazy witness complexes for a sampled point set P from underlying space X.
For a point cloud P , a landmark subset L, for all p ∈ P .Let t(p) be the distance p to the closest landmark point.The lazy witness complex LW (P, L, ) is formulated as follows: (i) the vertex set is L; (ii) for vertices a and b, edge [ab] is in LW (P, L, ) if there is a witness point p ∈ P such that max{d(a, p), d(b, p)} ≤ + t(p); (iii) a higher dimensional simplex is in LW (P, L, ) if all of its edges are.The most important parameter in a sequence of lazy witness complexes is , but there is no an optimal value of without prior information of the underlying space, we do not know how To pick the value of .However, using the Javaplex package developed by Adam and Tausz [12], we can compute the Betti numbers in an interval of and explain the result by a Betti barcode.The instinctive explanation is that long intervals accord to actual topological features of the underlying space while short ones are explained as noise.
To uncover the topological features of our spaces X 8 and X 9 , we use the different core subsets of X 8 and X 9 .We evaluate the local density of the space at a point by its the nearest neighbor.For y ∈ X and k > 0, let ρ k (y) =| y − y k |, here y k is the kth nearest neighbor of y.The larger k-Values contribute more global estimations, while small k-Values result in local density estimates.For a given k, we arrange the points of X by descending density; we pick the points with densities in the top p percent, written as X(k, p).The core subset X(k, p) possibly give important topological information, which may be disappeared for all the points of X.
Here we examine core subsets Xn (k, p) of Xn for n = 8, 9. Core subsets have two parameters k and p, they demonstrate some topological features of their underlying space for k and p with suitable values.

IV. RESULTS FOR X8 (k, p) AND X9 (k, p)
The authors of the paper [4] applied persistent homology to detect the topologies of high-density subsets of natural image patches.They discovered that the topology of the core sets vary from a circle to a 3-circle model as decreasing of Density estimator k.In this paper, we use INRIA Holidays data set, which is other than that of the paper [4], to prove experimentally that some core sets of X 8 and X 9 possess the similar results as above.
We take the core subsets X8 (300, 20), X9 (300, 20), and calculate the barcodes by Javaplex software, their sample barcode plots are displayed in Fig. 2, Fig. 2 separately.In Fig. 2, Fig. 3, there exist a single long line of Betti 0 and a single long Betti 1 line (i.e.β 0 = 1 and β 1 = 1), which means that they have the topology of a circle.When we project core sets onto some plane, their circle feature is visible in Fig. 4 and Fig. 5. Choosing different landmark points, we run many times experiments on X8 (300, 20), X9 (300, 20), and the results are very steady.
For 8 × 8 and 9 × 9 patches, there are much different cores subsets of X8 and X9 , if we take proper values of parameters k and p, the core sets also have the topology of a circle.For X8 (100, 20), X8 (200, 20), X9 (100, 20) and X9 (200, 20), We ran many trials and found that they have the topology of a circle and the results to be robust.When we consider the core subsets X8 (15, 20), X9 (15, 20), and calculate the barcodes, their sample barcode plots are shown in Fig. 6, Fig. 7 separately.In Fig. 6 (Fig. 7), there are a single long line of Betti 0 and five long Betti 1 line for from 0.06 to 0.18 (from 0.05 to 0.19), which shows that they have the topology of three circle model [4] (Fig. 8), that is, Betti numbers β 0 = 1 and β 1 = 5.
www.ijacsa.thesai.orgThe Klein bottle is a very important non-orientable surface, it can be sketched by the quotient space of the square [0, 1] × [0, 1] with sides glued by the relations (0, y) ∼ (1, y) for y ∈ [0, 1] and (x, 0) ∼ (1 − x, 1) for x ∈ [0, 1].To identify the Klein bottle features of subspaces of X 8 and X 9 , we embed the Klein bottle into S 63 and S 80 , and get another theoretical model of the Klein bottle.
To embed the Klein bottle into into S 63 and S 80 , primarily, we uniformly take 200 points ({x 1 , ..., x 200 }) from the unit circle, all possible tuples (x i , x j ) produce a point set on the torus S 1 × S 1 .Secondly, we map each of the 40000 points into S 63 and S 80 through compositions of h 8 • g and h 9 • g separately, VI.RESULTS FOR X 8 AND X 9

S lin S v S h
We have embedded the Klein bottle into S 63 and S 80 , and the subspaces K 8 (200) and K 9 (200) are a proper approximation of the Klein bottle in S 63 and S 80 respectively.Applying K 8 (200) and K 9 (200), we can find subspaces of X 8 and X 9 , whose topology is that of the Klein bottle.The constructing process of the subspaces of X 8 and X 9 are as following.
For each point of X 8 , we compute the Euclidean distance from the point to point set K 8 (200), then we resort points of X 8 according to increasing of their Euclidean distances to K 8 (200), then we take the top t percent of the closest distances, and represent the subspace of X 8 as XP 8 (200, t).The subspace XP 9 (200, t) of X 9 is constructed by a similar way.
To find subspaces of X 8 and X 9 having the topology of the Klein bottle, we take the parameter t=20 we do  From the results of [5], we knew that the largest subspaces with the homology of the Klein bottle of 3 × 3, 4 × 4, 5 × 5, 6 × 6 and 7 × 7 patches are about 40%, 35%, 30% and 25% of points of X 3 , X 4 , X 5 , X 6 and X 7 respectively.Combining the current results, we may conclude that the size of the largest subspace having the Klein bottle's homology of n × n patches depends on the patch size n, and the larger of patch size the smaller the size of the largest subspace.Hence it is necessary to discuss different sizes patches in natural images.

VII. CONCLUSION
In this paper we apply persistent homology to study natural image 8 × 8 and 9 × 9 patches, and obtain similar results to the papers [4], [5], the results of in this paper enlarge image analysis to larger patches.We find the largest subspaces of X 8 and X 9 with the Klein bottle's homology, and the size of the largest subspace of n × n natural image patches having the Klein bottle's homology is decreases as increasing of n.  small n.The Klein bottle's feature of natural image patches may improve techniques of image compression [4], [6].But it is worth to study that for how big of n, the n × n natural image patches have no the Klein bottle feature.As increasing of n, the computing for n × n patches becomes more difficult.