Fast differential box-counting algorithm on GPU

  • Juan Ruiz de MirasEmail author


The differential box-counting (DBC) algorithm is the most widely used method for calculating the fractal dimension (FD) of grayscale images. FD analysis of grayscale images has important applications in fields such as shape classification, texture analysis and image segmentation. Nowadays these kinds of images can reach a very large size, especially in 3D, and there is a trend of increasing dataset size; this means that a current dataset of this type of image may need high computation times for computing the DBC. In this paper, we present an efficient implementation on graphics processing unit (GPU) of the original DBC algorithm in its optimized version for parallel processing. Our implementation with NVIDIA Compute Unified Device Architecture (CUDA) computes the DBC with high branch efficiency and very low GPU serialization. This fact allows us to obtain a very efficient GPU implementation of the algorithm. We tested our implementation on two different hardware/software platforms for a set of 2D and 3D grayscale images of increasing size. The results showed that this GPU implementation scaled very well and achieved a speedup of up to 52× with respect to a CPU single-thread implementation of the same algorithm. Against an OpenACC multi-thread implementation in CPU, our CUDA algorithm obtains a speedup of up to 6×.


Differential box-counting Fractal dimension CUDA GPU Grayscale image 


Compliance with ethical standards

Conflict of interest

The author declares no conflict of interest.


  1. 1.
    Mandelbrot BB (1983) The fractal geometry of nature. Am J Phys. CrossRefGoogle Scholar
  2. 2.
    Xu S-X, Feng Z-D, Gao P-Q, Wang M (2011) Detection method of weak and dim bubble on magnesium melt based on fractal dimension. Zhuzao/Foundry 60:673–675Google Scholar
  3. 3.
    Hsu WY, Lin CC, Ju MS, Sun YN (2007) Wavelet-based fractal features with active segment selection: application to single-trial EEG data. J Neurosci Methods 163:145–160. CrossRefGoogle Scholar
  4. 4.
    Hong D, Pan Z, Wu X (2014) Improved differential box counting with multi-scale and multi-direction: a new palmprint recognition method. Optik (Stuttg) 125:4154–4160. CrossRefGoogle Scholar
  5. 5.
    Han J, Zhang T (2017) Novel method for SEI based on 3D-Hilbert energy spectrum and multi-scale segmentation features. In: Proceedings of 2017 IEEE 2nd Advanced Information Technology, Electronic and Automation Control Conference (IAEAC), pp 351–355Google Scholar
  6. 6.
    Tian B, Yuan J, Yue X, Ning X (2007) Feature extraction algorithm for space targets based on fractal theory. Second Int Conf Space Inf Technol. CrossRefGoogle Scholar
  7. 7.
    Lopes R, Betrouni N, Szurhaj W (2007) 3D Fractal analysis for epilepsy characterization on SPECT images. Eur J Nucl Med Mol Imaging, Abstr Annu Congr EANM 2007, Copenhagen, Denmark 34:394.
  8. 8.
    Tzeng YC, Chen D, Chen KS (2008) Integration of spatial chaotic model and type-2 fuzzy sets to coastline detection in SAR images. In: International Geoscience and Remote Sensing Symposium, pp 1430–1433Google Scholar
  9. 9.
    Lin K-H, Lam K-M, Siu W-C (2002) Locating the eye in human face images using fractal dimensions. IEE Proc Vis Image Signal Process 148:413–421. CrossRefGoogle Scholar
  10. 10.
    Sarkar N, Chaudhuri BB (1994) An efficient differential box-counting approach to compute fractal dimension of image. IEEE Trans Syst Man Cybern 24:115–120. CrossRefGoogle Scholar
  11. 11.
    Nayak SR, Mishra J, Palai G (2018) A modified approach to estimate fractal dimension of gray scale images. Optik (Stuttg) 161:136–145. CrossRefGoogle Scholar
  12. 12.
    Panigrahy C, Garcia-Pedrero A, Seal A et al (2017) An approximated box height for Differential-Box-Counting method to estimate fractal dimensions of gray-scale images. Entropy 19:e534. MathSciNetCrossRefGoogle Scholar
  13. 13.
    Li J, Du Q, Sun C (2009) An improved box-counting method for image fractal dimension estimation. Pattern Recognit 42:2460–2469. CrossRefzbMATHGoogle Scholar
  14. 14.
    Li Y, Hui M, Liu M et al (2018) Edge detection of optical subaperture image based on improved differential box-counting method. In: 2017 International Conference on Optical Instrument and Technology, Beijing, China, pp 106200U-1–8Google Scholar
  15. 15.
    Lai K, Li C, He T et al (2016) Study on an improved differential box-counting approach for gray-level variation of images. In: Proceedings of International Conference on Sensor Technologies (ICST), pp 1–6Google Scholar
  16. 16.
    Liu Y, Chen L, Wang H et al (2014) An improved differential box-counting method to estimate fractal dimensions of gray-level images. J Vis Commun Image Represent 25:1102–1111. CrossRefGoogle Scholar
  17. 17.
    Nayak S, Mishra J, Sethy A, Mohapatra S (2017) A comparative analysis on estimation of fractal dimension of gray scale images. Int J Pure Appl Math 19:323–329Google Scholar
  18. 18.
    Hanen A, Imen B, Asma BA et al (2009) Multifractal modelling and 3D lacunarity analysis. Phys Lett Sect A Gen At Solid State Phys 373:3604–3609. CrossRefzbMATHGoogle Scholar
  19. 19.
    Tzeng YC, Fan KT, Chen KS (2012) A parallel differential box-counting algorithm applied to hyperspectral image classification. IEEE Geosci Remote Sens Lett 9:272–276. CrossRefGoogle Scholar
  20. 20.
    Biswas MK, Ghose T, Guha S, Biswas PK (1998) Fractal dimension estimation for texture images: a parallel approach. Pattern Recognit Lett 19:309–313. CrossRefzbMATHGoogle Scholar
  21. 21.
    Jiménez J, Ruiz de Miras J (2012) Fast box-counting algorithm on GPU. Comput Methods Programs Biomed. CrossRefGoogle Scholar
  22. 22.
    Jiménez J, Ruiz De Miras J (2013) Box-counting algorithm on GPU and multi-core CPU: an OpenCL cross-platform study. J Supercomput. CrossRefGoogle Scholar
  23. 23.
    NVIDIA Corporation (2019) Cuda C Programming Guide v10.0.
  24. 24.
    Kong J, Dimitrov M, Yang Y et al (2010) Accelerating MATLAB image processing toolbox functions on GPUs. In: International Conference on Architectural Support for Programming—ASPLOS. Pittsburgh, pp 75–85Google Scholar
  25. 25.
    Farber R (2017) Parallel programming with OpenACC, 1st edn. Morgan Kaufmann Publishers, BurlingtonGoogle Scholar
  26. 26.
    Wittenbrink CM, Kilgariff E, Prabhu A (2011) Fermi GF100 GPU architecture. IEEE Micro 31:50–59. CrossRefGoogle Scholar
  27. 27.
    Harris M (2008) Optimizing parallel reduction in CUDA.
  28. 28.
    Ruiz de Miras J, Salazar M (2018) GPU inclusion test for triangular meshes. J Parallel Distrib Comput 120:170–181. CrossRefGoogle Scholar
  29. 29.
    Wilt N (2013) The CUDA handbook. Addison-Wesley, BostonGoogle Scholar
  30. 30.
    NVIDIA Corporation (2019) CUDA math library. Accessed 4 Apr 2019
  31. 31.
    Kirk DB (2016) Programming massively parallel processors: a hands-on approach, 3rd edn. Elseiver, New York. CrossRefGoogle Scholar
  32. 32.
  33. 33.
    Brodatz P (1966) Textures: a photographic album for artists and designers. Dover Publications, New YorkGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2019

Authors and Affiliations

  1. 1.Computer Science DepartmentUniversity of JaénJaénSpain
  2. 2.Departamento de InformáticaUniversity of JaénJaénSpain

Personalised recommendations