Roughness Method to Estimate Fractal Dimension

5
Vol. 115 (2009) ACTA PHYSICA POLONICA A No. 3 Roughness Method to Estimate Fractal Dimension A. Bˆlachowski and K. Ruebenbauer * ossbauer Spectroscopy Division, Institute of Physics, Pedagogical University Podchor¸ zych 2, 30-084 Krak´ow, Poland (Received January 30, 2009; revised version February 3, 2009) A method based on the pattern roughness was introduced for determination of the fractal dimension and tested for fractals like the Sierpi´ nski carpet, the Sierpi´ nski triangle, standard Cantor set, the Menger sponge and the Sierpi´ nski tetrahedron. It was tested for non-fractal pattern like two- and four-dimensional gray scale random dust as well. It was found that for all these patterns the Hausdorff dimension is reproduced with relatively high accuracy. Roughness method is based on simple, fast and easy to implement algorithm applicable in any topological dimension. It is particularly suited for patterns being composed of the hierarchy of structures having the same topological dimension as the space embedding them. It is applicable to “fuzzy” patterns with overlapping structures, where other methods are useless. It is designed for pixelized structures, the latter structures resulting as typical experimental data sets. PACS numbers: 05.45.Df, 61.43.Hv 1. Introduction Usually fractal dimension of the “classical” fractals could be expressed in some analytical form and calculated with any required accuracy [1]. The situation is quite different for natural objects approximating some fractal structures. Similar statement applies to the computer- -generated structures, the latter structures being simi- lar rather to the natural objects instead of being simi- lar to the “classical” fractals. Many methods have been invented to estimate fractal dimension of such objects [2–5]. It seems that none of them is general, as the suc- cessful choice of method depends on details of the fractal in question. We are going to concentrate here on frac- tals composed of the hierarchy of structures having the same topological dimension as the space needed to embed given fractal. Such structures are quite common, and on the other hand, there are many “classical” fractals hav- ing above properties as described in Ref. [1]. The word “classical” is further used as shortened notation for non- -random fractals being composed of the objects (hierar- chy of structures) having the same topological dimension as the hosting space and being exactly self-similar on all scales. The most popular method used to estimate fractal di- mension for such objects is the box counting method [2]. However, this method has some limitations. It is very hard to apply to the objects having “fuzzy” boundaries, and it is practically useless in the case of overlapping * corresponding author; e-mail: [email protected] structures. Overlapping structures are quite common within the realm of natural objects, and fuzziness is al- ways encountered for sufficiently large magnifications of natural objects due to the limited resolution of the imag- ing devices and real fuzziness of the natural objects. We are proposing a method to estimate fractal dimen- sion of such objects as mentioned above. It is based on the simple concept of the object roughness seen at various scales. The algorithm is simple, fast and widely applica- ble to the hierarchical structures having the same topo- logical dimension as the space embedding them. Some- what similar approach to this problem has been suggested by Zubimendi et al. [5]. Mandelbrot [1] suggested similar idea as well. Roughness could have various meanings and hence we are going to define precisely roughness in the sense used within this contribution. A relation between roughness and fractal dimension has been discussed pre- viously by Mandelbrot [6]. The paper is organized as follows: Sect. 2 deals with the definition of the roughness method as proposed here. Section 3 is devoted to tests performed on the “classical” fractals composed of the hierarchical structures in the sense above defined. Finally, conclusions are drawn in the last Sect. 4. 2. Roughness method Generally, roughness could be defined in any met- ric Euclidean space having finite topological dimension D =1, 2,... and particularly for functions taking on in- teger values from the range [0; 2 L - 1], where L =1, 2,... stands for the number of bits describing content of the (636)

Transcript of Roughness Method to Estimate Fractal Dimension

Page 1: Roughness Method to Estimate Fractal Dimension

Vol. 115 (2009) ACTA PHYSICA POLONICA A No. 3

Roughness Method to Estimate Fractal Dimension

A. BÃlachowski and K. Ruebenbauer∗

Mossbauer Spectroscopy Division, Institute of Physics, Pedagogical UniversityPodchorazych 2, 30-084 Krakow, Poland

(Received January 30, 2009; revised version February 3, 2009)

A method based on the pattern roughness was introduced for determination of the fractal dimension andtested for fractals like the Sierpinski carpet, the Sierpinski triangle, standard Cantor set, the Menger sponge andthe Sierpinski tetrahedron. It was tested for non-fractal pattern like two- and four-dimensional gray scale randomdust as well. It was found that for all these patterns the Hausdorff dimension is reproduced with relativelyhigh accuracy. Roughness method is based on simple, fast and easy to implement algorithm applicable in anytopological dimension. It is particularly suited for patterns being composed of the hierarchy of structures havingthe same topological dimension as the space embedding them. It is applicable to “fuzzy” patterns with overlappingstructures, where other methods are useless. It is designed for pixelized structures, the latter structures resultingas typical experimental data sets.

PACS numbers: 05.45.Df, 61.43.Hv

1. Introduction

Usually fractal dimension of the “classical” fractalscould be expressed in some analytical form and calculatedwith any required accuracy [1]. The situation is quitedifferent for natural objects approximating some fractalstructures. Similar statement applies to the computer--generated structures, the latter structures being simi-lar rather to the natural objects instead of being simi-lar to the “classical” fractals. Many methods have beeninvented to estimate fractal dimension of such objects[2–5]. It seems that none of them is general, as the suc-cessful choice of method depends on details of the fractalin question. We are going to concentrate here on frac-tals composed of the hierarchy of structures having thesame topological dimension as the space needed to embedgiven fractal. Such structures are quite common, and onthe other hand, there are many “classical” fractals hav-ing above properties as described in Ref. [1]. The word“classical” is further used as shortened notation for non--random fractals being composed of the objects (hierar-chy of structures) having the same topological dimensionas the hosting space and being exactly self-similar on allscales.

The most popular method used to estimate fractal di-mension for such objects is the box counting method [2].However, this method has some limitations. It is veryhard to apply to the objects having “fuzzy” boundaries,and it is practically useless in the case of overlapping

∗ corresponding author; e-mail: [email protected]

structures. Overlapping structures are quite commonwithin the realm of natural objects, and fuzziness is al-ways encountered for sufficiently large magnifications ofnatural objects due to the limited resolution of the imag-ing devices and real fuzziness of the natural objects.

We are proposing a method to estimate fractal dimen-sion of such objects as mentioned above. It is based onthe simple concept of the object roughness seen at variousscales. The algorithm is simple, fast and widely applica-ble to the hierarchical structures having the same topo-logical dimension as the space embedding them. Some-what similar approach to this problem has been suggestedby Zubimendi et al. [5]. Mandelbrot [1] suggested similaridea as well. Roughness could have various meanings andhence we are going to define precisely roughness in thesense used within this contribution. A relation betweenroughness and fractal dimension has been discussed pre-viously by Mandelbrot [6].

The paper is organized as follows: Sect. 2 deals withthe definition of the roughness method as proposed here.Section 3 is devoted to tests performed on the “classical”fractals composed of the hierarchical structures in thesense above defined. Finally, conclusions are drawn inthe last Sect. 4.

2. Roughness method

Generally, roughness could be defined in any met-ric Euclidean space having finite topological dimensionD = 1, 2, . . . and particularly for functions taking on in-teger values from the range [0; 2L−1], where L = 1, 2, . . .stands for the number of bits describing content of the

(636)

Page 2: Roughness Method to Estimate Fractal Dimension

Roughness Method to Estimate Fractal Dimension 637

volume element called further pixel for brevity. Practi-cally, all experimental or computer generated functionscould be transformed into such representation as definedabove. All volume elements are identical (they have thesame number of bits with the same meaning of each bitfor all pixels) and they form hypercubes with all edgesmutually orthogonal and of the same length. Hypercubesfill all the space available and do not overlap one withanother. There are Nν hypercubes along each ν-th axisaligned with one of the edges. Index ν = 1, 2, . . . , D enu-merates uniquely particular dimension. Each hypercubehas 2D nearest neighbors except hypercubes lying on theborder of the considered part of the space. Hence, rough-ness could be expressed as follows:

R =

[2D

D∏ν=1

(Nν − 2)

]−1

×D∑

ν=1

Nν−1∑nν=2

k=±1

(xnν

− xnν+k

2L − 1

)2

. (1)

The following condition has to be satisfied: Nν ≥ 3.Index nν enumerates subsequent hypercubes along theν-th axis. On the other hand, the pixel content describedby integer has to satisfy conditions 0 ≤ xnν ≤ 2L − 1and 0 ≤ xnν+k ≤ 2L − 1. One can simplify the abovedefinition to the similar form:

R =

[D

D∏ν=1

(Nν − 1)

]−1

×D∑

ν=1

Nν−1∑nν=1

(xnν − xnν+1

2L − 1

)2

. (2)

For the last definition algorithm is generally faster andit is sufficient to have Nν ≥ 2. Condition 0 ≤ xnν+1 ≤2L − 1 has to be satisfied as well. Actually, for D = 1and N1 ≥ 3 one has R ≡ R. Nearest neighbor hypercubeshave common “walls”, the latter having D − 1 topologi-cal dimension. Both definitions lead to the real roughnesstaking value from the range [0; 1]. Number of bits usedto calculate roughness amounts to

Nb = L

D∏ν=1

Nν . (3)

Many experimental data sets satisfy above conditions andtherefore roughness could be calculated in a straightfor-ward manner for them.

In order to use roughness R to estimate “fractal” di-mension one needs series of patterns having all the samesets of Nν ≥ 3 parameters and the same constant L ≥ 1,albeit obtained at vastly different scales, i.e., havingall different pixel edge rλ > 0 size. Here the indexλ = 1, 2, . . . ,Λ enumerates subsequent patterns and thenumber of patterns satisfies the condition Λ ≥ 3. Subse-quent pixel edge sizes have to satisfy the following con-dition: 0 < r1 < r2 < . . . < rΛ. One can calculateroughness Rλ for each pattern and plot Yλ = ln(Rλ) ver-sus Xλ = ln(rλ/r1) provided Rλ > 0 for each pattern λ.

If one obtains straight line Yλ = β + αXλ one can calcu-late “fractal” dimension as d = D−|α| provided |α| ≤ D[1, 7]. Actually, the choice of the logarithm base has noeffect on the parameter α provided it is positive and thesame for Xλ and Yλ. One can multiply ratio rλ/r1 by anyarbitrary positive and constant number without affectingα as well. Hence, the abscissa of the above plot could bechosen as the pixel edge size r > 0 provided the loga-rithmic scale is used with any positive logarithm base.Multiplication of roughness by the positive constant (thesame for all patterns) has no effect on the slope parame-ter α as well. Plots described above are often called theRichardson plots [1]. Other similar definitions of rough-ness could be used as well as they lead to the same slopeof the Richardson plot, and the slope is the sole relevantparameter to be determined. However, other definitionsrequire more complex algorithms.

The above algorithm is simple, fast and it could be ap-plied to the majority of the experimental data sets. Inparticular, it could be applied to the “fuzzy” patterns,where other methods like the box counting method areuseless. This algorithm is applicable to patterns withoverlapping structures as well, where other methods sim-ply fail.

3. Some tests of the roughness method

It is essential to test the above hypothesis for the use-fulness. It has to produce linear Richardson plots withthe correct slopes for the fractal structures. An attemptto perform rigorous proof is rather useless as the methodis intended to be applied to the experimental patterns,the latter having none rigorous definition. The simplestway to perform such tests is to apply the roughnessmethod to the fractals having well known fractal dimen-sion in the Hausdorff sense [1]. One has to bear in mindthat “classical” fractals (as defined above) are exactlyself-similar on all scales, and therefore they do not existas real objects as nature is not invariant versus arbitrar-ily large changes of scale. The same statement applies toany computer-generated pattern. Hence, one has to startfrom some smallest scale by definition of the “elementarycell”, the latter being no longer divisible according tothe particular fractal algorithm. In fact, natural objectshave also small-scale limit due to the fact that matter iscomposed of atoms. For some fractals like the Sierpinskitriangle one has to make suitable approximation whiledefining “elementary cell” in order to fit into the pixelscheme. It has to be remembered that real data are al-ways pixelized in some way, and hence the pixel schemeis enforced on them at some scale without will of the ex-perimenter. Afterwards, one has to generate particularfractal pattern according to the rules characteristic of thefractal in question. This iterative process has some limitdue to the computer limitations as well. Natural objectshave similar limits, as they cannot be made arbitrarilylarge. Usually “classical” fractals have natural scale fac-tor embedded in the generation algorithm. For example,

Page 3: Roughness Method to Estimate Fractal Dimension

638 A. BÃlachowski, K. Ruebenbauer

standard Cantor set and the Sierpinski carpet require in-crease in the size along each dimension by factor three ineach iterative step, while the Sierpinski triangle has thisfactor equal to two. Random dust has none natural scalefactor and it has no fractal properties, but it is charac-terized by null “fractal” dimension as it is composed ofindependent points. For such patterns like random dustit is desirable to apply factor two in order to get as manypoints as possible within limits of the scale range andwithout violating of the pixel scheme. Number of ac-cessible scale levels strongly depends on the topologicaldimension required to generate particular fractal. Forlarge dimensions data volume increases very rapidly ineach iteration step.

Once the required pattern has been generated, one hasto make respective series of patterns in order to calcu-late roughness for each of them. Such patterns could bemade averaging content of the adjacent pixels in accor-dance with the particular scale factor, rounding resultingaverage to the nearest integer and generating new pixelreplacing group of the previous pixels. The number ofpixels in each dimension is reduced by the scale factorin each step of this iterative procedure until pattern istoo small to be used to calculate roughness. Each newpixel is centered on the center of the previous group.Such procedure simulates reduction of magnification forthe real patterns as each pixel of the next generation hasedge size increased by the scale factor in comparison withthe edge size of the pixel belonging to the previous gen-eration. For series of patterns generated this way onecan define equivalent abscissa as S = N/(F l) providedoriginal pattern has the same number of pixels in all di-mensions. The symbol N À 0 stands for the numberof pixels, along one of the dimensions, for the originalpattern, F > 0 denotes the scale factor (isotropic here),and l = 0, 1, . . . enumerates subsequent iterations lead-ing to the averaged patterns. For random dust and theSierpinski triangle F = 2, while for the Sierpinski carpetand standard Cantor set F = 3. The scale factor F = 3applies to the Menger sponge too, while for the Sierpinskitetrahedron one has F = 2. A logarithmic scale has tobe used for this abscissa as well. A pixel belonging to thenext generation is an average of FD pixels of the previousgeneration.

We have performed tests setting L = 8 (8 bits — 256levels) for all patterns investigated. Three patterns withD = 2 (planar), one pattern with D = 1 (linear), andtwo with D = 3 (flat Euclidean space) have been inves-tigated. For the two-dimensional random dust and theSierpinski triangle N = N1 = N2 = 2048 = 211 hasbeen used for the original patterns. In the case of theSierpinski carpet N = N1 = N2 = 2187 = 37 has beenset for the original pattern, while for the one-dimensionalstandard Cantor set N = N1 = 177147 = 311 has beenapplied to the original pattern. For the Menger spongeN = N1 = N2 = N3 = 729 = 36 has been appliedto the original pattern. The Sierpinski tetrahedron wasevaluated setting N = N1 = N2 = N3 = 512 = 29.

Four-dimensional random dust has been treated usingN = N1 = N2 = N3 = N4 = 128 = 27. “Elemen-tary cells” for the Sierpinski carpet, standard Cantor setand the Menger sponge have been made of black (0) andwhite (255) elements in the case of the original patterns.Original random dust pattern has been generated usingrandom number generator with the flat distribution andproducing integers in the range [0; 255]. The “elementarycell” of the original pattern approximating the Sierpinskitriangle is made of four pixels. Lower pixels have thegray scale (64), while the upper pixels have the gray scale(191). This is the best approximation to the original “el-ementary triangle” (black) fitting into the white squaremade of four pixels. Similar problem is encountered forthe Sierpinski tetrahedron. The “elementary cell” con-sists here of eight pixels. Two lower pixels have the grayscale (148), another pair of lower pixels has the gray scale(213), while the four upper pixels split into two pairs hav-ing the gray scale (240) and (254), respectively.

It is interesting to note that roughness equals unity forthe pattern made of the black and white hypercubes, thelatter ordered in the generalized chessboard-like fashion.However, the first averaging with the scale factor equal totwo leads to the pattern having roughness equal to zero,and further averaging does not change this roughnessanymore. The smallest possible chessboard-like patternuseful to calculate the roughness R in two dimensions isshown in Fig. 1 as a fragment of the larger pattern.

Fig. 1. Black (0) and white (255) chessboard-like pat-tern (planar), the latter pattern useful for calculation ofthe roughness R.

Generated original patterns for two-dimensional casesare shown in Figs. 2 and 3 together with the correspond-ing Richardson plots, the latter plots showing R versus S.The Richardson plot for the standard Cantor set is shownin Fig. 4. On the other hand, the Richardson plot ofthe Menger sponge is shown in Fig. 5. The “elemen-tary cell” transformation and the Richardson plot for theSierpinski tetrahedron is shown in Fig. 6. Finally, theRichardson plot for the four-dimensional random dust isshown in Fig. 7. One has to note that the linear behav-ior of the Richardson plots is well obeyed except for thelargest pixels (smallest magnifications), where blurring isstrong enough to almost erase any details of the pattern.These points lying in the lower left corners of the respec-tive plots are excluded and they are not shown. For theSierpinski triangle one observes some deviation from lin-

Page 4: Roughness Method to Estimate Fractal Dimension

Roughness Method to Estimate Fractal Dimension 639

Fig. 2. Original random dust of the gray scale withD = 2 and the Sierpinski carpet patterns (top) with thecorresponding Richardson plots (bottom).

Fig. 3. Original Sierpinski triangle pattern (left) andRichardson plot obtained (right). Inset in the upperright corner shows approximation used for the “elemen-tary cell”. Let us note deviation from linearity due tothe approximation made while generating the “elemen-tary cell”.

earity for the original pattern due to the approximationused to fit pattern into the pixel scheme. The same be-havior is seen for the Sierpinski tetrahedron. This pointlying in the upper right corner is shown, albeit it has beenexcluded from the data analysis for both of these frac-tals. Resulting slope parameters and fractal dimensionsare listed in Table. These parameters were obtained bymeans of the standard linear regression fits to the linearpart of the respective Richardson plots. Two-dimensional(planar) patterns are particularly important, as they usu-ally represent some images.

Fig. 4. Richardson plot obtained for the standard Can-tor set. Inset shows “elementary cell” and the first stepof the iterative procedure used to generate the originalpattern.

Fig. 5. Richardson plot obtained for the Mengersponge. Inset shows “elementary cell” of this three--dimensional structure. White pixels (255) are shownhere as transparent.

Simulations described above show that the roughnessmethod reproduces fractal dimension of the typical frac-tals with the reasonable accuracy despite limited range ofthe scale. On the other hand, it is the simplest, most ef-ficient and most widely applicable method in comparison

Fig. 6. Richardson plot obtained for the Sierpinskitetrahedron. Inset shows “elementary cell” of this three--dimensional structure and the best approximation ofthe “elementary cell” within the pixel scheme. The firstiterative step is shown schematically as well. Let us notedeviation from linearity due to this approximation.

Page 5: Roughness Method to Estimate Fractal Dimension

640 A. BÃlachowski, K. Ruebenbauer

Fig. 7. Richardson plot obtained for the four--dimensional random dust of the gray scale.

TABLEFractal dimension obtained by the roughness methodin comparison with the corresponding Hausdorff di-mension shown with the precision of four digits be-yond the decimal point where applicable.

Fractal αRoughness

dimension

Hausdorff

dimension

random dust

(non-fractal) D = 21.990(2) 0.010(2) 0

Sierpinski carpet 0.097(4) 1.903(4) 1.8928

Sierpinski triangle 0.428(3) 1.572(3) 1.5850

standard Cantor set 0.382(3) 0.618(3) 0.6309

Menger sponge 0.288(1) 2.712(1) 2.7268

Sierpinski tetrahedron 1.092(24) 1.908(24) 2

random dust

(non-fractal) D = 43.886(50) 0.114(50) 0

with other classical methods used to estimate fractal di-mension. This method has not been reported previouslyto our best knowledge as applicable to the fractal dimen-sion problem — at least in the form outlined above. It issensitive to the departure from the ideal pattern as onecan see deviations from linearity either for the stronglyblurred patterns or upon having applied approximationsto the “exact” structure. It could be used to estimatedimension of the non-fractal patterns like the randomdust gray scale pattern as well. One has to note that theSierpinski tetrahedron is somewhat special fractal as ithas fractal dimension equal to the topological dimensionof the embedded space (plane).

4. Conclusions

A method for estimation of the fractal dimension hasbeen proposed. It is based on the simple, fast and widely

applicable algorithm, the latter relying on the simpleconcept of the pattern roughness. It has been testedfor typical fractals being a hierarchy of embedded struc-tures with the same topological dimension as the hostingspace topological dimension. The Hausdorff dimensionhas been reproduced with relatively high accuracy forthese fractals regardless of the topological dimension. Itseems that this method could be particularly useful forthe analysis of the two-dimensional gray scale patternslike e.g. electron scanning microscope images. It has beenalready applied to the analysis of the phase separation inthe iron–gold alloys as described in Refs. [8, 9]. For ex-perimental patterns one can estimate fractal dimensionby making the Richardson plots of the roughness versushomogeneous scale (the same pixel size along each of themain axes), the latter scale varying from one to anotherimage of the same object. There is no need to have thesame number of pixels along each main axis, but thesenumbers should not differ vastly.

References

[1] B.B. Mandelbrot, The Fractal Geometry of Nature,Freeman, New York 1982.

[2] L.S. Liebovitch, T. Toth, Phys. Lett. A 141, 386(1989).

[3] P. Grassberger, I. Procaccia, Phys. Rev. Lett. 50, 346(1983).

[4] C.W. Lung, J. Jiang, E.K. Tian, C.H. Zhang, Phys.Rev. E 60, 5121 (1999).

[5] J.L. Zubimendi, M.E. Vela, R.C. Salvarezza,L. Vazquez, J.M. Vara, A.J. Arvia, Phys. Rev. E 50,1367 (1994).

[6] B.B. Mandelbrot, A Theory of Roughness, in: EdgeFoundations Inc., Ed. J. Brockman: www.edge.org/3rd culture/mandelbrot04/mandelbrot04 index.html .

[7] B.B. Mandelbrot, Phys. Scr. 32, 257 (1985).

[8] A. BÃlachowski, K. Ruebenbauer, J. Przewoznik,J. Zukrowski, J. Alloys Comp. 458, 96 (2008).

[9] A. BÃlachowski, K. Ruebenbauer, A. Rakowska,in: Problems of Modern Techniques in Engineer-ing and Education, Eds. P. Kurtyka, P. Malczewski,K. Mroczka, I. Sulima, IT Monograph, Krakow2007, p. 161; see also: www.elektron.ap.krakow.pl/fractal.pdf .