Next Article in Journal
Persistent Homology Analysis of AI-Generated Fractal Patterns: A Mathematical Framework for Evaluating Geometric Authenticity
Previous Article in Journal
New Inequalities for GA–h Convex Functions via Generalized Fractional Integral Operators with Applications to Entropy and Mean Inequalities
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Box-Counting Dimension Sequences of Level Sets in AI-Generated Fractals

1
School of Electrical and Electronics Engineering, Chung-Ang University, Seoul 06974, Republic of Korea
2
Department of Intelligent Semiconductor Engineering, Chung-Ang University, Seoul 06974, Republic of Korea
*
Author to whom correspondence should be addressed.
Fractal Fract. 2024, 8(12), 730; https://doi.org/10.3390/fractalfract8120730
Submission received: 16 November 2024 / Revised: 9 December 2024 / Accepted: 10 December 2024 / Published: 12 December 2024

Abstract

:
We introduce a mathematical framework to characterize the hierarchical complexity of AI-generated fractals within the finite resolution constraints of digital images. Our method analyzes images produced by text-to-image models at multiple intensity thresholds, employing a discrete level set approach and box-counting dimension estimates. By conducting experiments on fractals created with the FLUX model at a resolution of 128 × 128 , we identify a fully monotonic behavior in the dimension sequences for various box sizes, with inter-scale correlations surpassing 0.95. Pattern-specific dimensional gradients quantify how fractal complexity changes with threshold levels, offering insights into how text-to-image models encode fractal-like geometry through dimensional sequences.

1. Introduction

The analysis of fractal structures in digital images has gained significant importance with the development of advanced text-to-image models capable of generating complex mathematical visualizations [1]. These models have demonstrated remarkable success in producing visually compelling fractals, operating on spaces of textual prompts and digital images. Quantification of structural properties in AI-generated fractals is crucial to understanding the capabilities and limitations of these models, as well as to improving our understanding of how abstract mathematical concepts are encoded in machine learning systems [2,3]. However, this analysis presents significant challenges, particularly due to the discrete nature of digital representations and the finite resolution of the generated images [4,5].
Traditional fractal analysis methods, often based on continuous mathematical formulations or continuous feature vectors of AI models [6,7,8,9], are not directly applicable to the pixel-based structure of digital images [10,11]. The finite resolution of these images imposes fundamental limitations on the application of classical fractal dimension theory, which typically involves limits as the scale approaches zero. Moreover, the potential introduction of artifacts during the generation process requires a robust analytical framework capable of capturing hierarchical organization while accounting for the discrete underlying representation [12,13]. These challenges call for a novel approach that bridges the gap between continuous fractal theory and the discrete nature of digital imagery [7,14].
To address these challenges, we introduce a novel dimensional analysis framework based on discrete level sets, specifically tailored for digital images. Let P be the set of all valid textual prompts and I = [ 0 , 1 ] M × N be the space of normalized grayscale images. Given a text-to-image model F : P I that maps fractal prompts to grayscale images, we analyze the generated image I = F ( p ) for any prompt p P through a sequence of level sets L k = { x Ω : I ( x ) t k } , defined on the pixel domain Ω for thresholds t k = k / 10 , where k { 0 , , 10 } . This method offers a mathematical technique to break down the image’s structure into various intensity levels, all while maintaining the discrete characteristics of the pixel grid.
Our primary theoretical contribution lies in developing a novel approach to measure fractal properties in digital images through discrete box-counting analysis. Rather than directly applying traditional continuous fractal mathematics, we introduce a framework specifically tailored for pixel-based representations. This approach systematically analyzes level sets at various intensity thresholds, employing multiple box sizes that align with the image’s inherent resolution constraints. By carefully considering the discrete nature of digital images, we derive dimension estimates using robust statistical regression techniques in logarithmic space. The resulting dimensional measure captures the hierarchical complexity at different intensity levels. A key theoretical result demonstrates that these dimension values exhibit a natural monotonic decrease in successive threshold levels, reflecting the nested structure of the level sets. This property provides a crucial validation of our framework’s consistency with both classical fractal theory and the discrete geometry of digital images. Our formulation bridges the gap between continuous mathematical ideals and practical computational requirements, offering a stable and interpretable measure of fractal-like characteristics in AI-generated patterns.
To validate our theoretical framework, we conducted systematic experiments using the FLUX model [15], analyzing the fractals generated at a resolution of 128 × 128 pixels. Our experimental protocol employs multiple fixed box sizes (4 × 4, 8 × 8, and 16 × 16 pixels) for dimension calculations, ensuring a comprehensive multi-scale analysis of the fractal properties while maintaining computational feasibility. The resulting dimensional sequences offer a novel characterization of how text-to-image models encode and interpret fractal concepts, providing insights into both the mathematical properties of the generated structures and the underlying generative process.
Although significant progress has been made in adapting the fractal dimension analysis to digital imagery, previous methods often implicitly rely on assumptions in the continuous domain or struggle to handle the finite and discrete resolution of pixel-based data. Unlike traditional fractal dimension approaches, which typically assume infinite resolution scales and continuous sets, our framework is explicitly tailored to the discrete and finite nature of digital images generated by text-to-image models. We directly incorporate the pixel grid structure and restricted range of scales into the fractal dimension estimation process. By employing discrete level sets and verifying monotonicity of dimension sequences across thresholded intensity levels, our method provides a well-founded way to quantify hierarchical complexity in a manner more faithful to the underlying digital representation. This marks a key departure from conventional fractal analysis methods, which generally do not guarantee monotonic sequences of dimension values or systematically account for the resolution-induced discretization effects. As such, our framework not only addresses the limitations inherent in applying continuous fractal theory directly to pixel-based images but also offers an innovative perspective that bridges the gap between abstract fractal concepts and the concrete realities of AI-generated fractal structures.
Our work establishes a mathematical foundation for analyzing AI-generated fractals within the constraints of digital image representation. By providing a quantitative framework for assessing the hierarchical complexity of these structures, we contribute to the understanding of how large language models encode and interpret abstract mathematical concepts. This research has implications for improving the fidelity of AI-generated mathematical visualizations and for developing more sophisticated evaluation metrics for generative models in the domain of discrete mathematical imagery. Through careful analysis of dimensional sequences and their gradients, we uncover pattern-specific characteristics that shed light on the encoding mechanisms employed by text-to-image models in fractal generation.

2. Related Work

2.1. Fractal Analysis in Digital Images

The analysis of fractal properties in digital images has been extensively studied, with various methods developed for estimating fractal dimensions from discrete data. Box-counting, Minkowski dilation, and Fourier analysis have been prominent approaches [16,17,18]. However, these methods face challenges when applied to digital images due to the inherent discreteness and finite resolution of pixel grids. Sarkar and Chaudhuri [16] proposed a differential box-counting method specifically tailored for digital images, addressing the limitations of continuous fractal analysis in discrete settings. Their approach introduces a modified box-counting algorithm that accounts for the pixel-based nature of digital images, providing more accurate dimension estimates within the constraints of image resolution.
Panigrahy et al. [19] conducted a comprehensive survey of differential box-counting methods, emphasizing the need for methods that can handle the limited range of scales available in pixel-based representations. This consideration is crucial, as it addresses a limitation often overlooked in earlier works that directly applied continuous fractal theory to digital domains. The survey highlights the importance of adapting fractal dimension estimation techniques to the discrete nature of digital images, providing a foundation for more accurate analysis in finite-resolution settings.

2.2. Level Set Methods and Discrete Dimension Theory

Level set methods, introduced by Osher and Sethian [20], have become fundamental tools for analyzing evolving interfaces and surfaces. While initially developed for continuous domains, these methods have been adapted for discrete settings, particularly in image processing applications. Caselles et al. [21] extended level set methods to geometric active contours, providing a framework for image segmentation that naturally handles topological changes. However, the direct application of these methods to fractal analysis in digital images requires careful consideration of the discrete grid structure.
The relationship between level sets and the fractal dimension in discrete domains has been explored by Chen [22], who proposed a framework to analyze urban morphology using spatial correlation functions. This approach demonstrates the potential for combining level set methods with fractal analysis in discrete settings, although it does not fully address the limitations imposed by finite image resolution. Our work builds upon these foundations, extending the application of level set methods to the analysis of AI-generated fractals within the constraints of digital imagery.
In digital image analysis, Yan et al. [23] introduced an improved box-counting method that addresses some of the discretization issues. Their approach uses a sliding box technique to reduce the impact of grid alignment, providing more stable dimension estimates in different scales. This method represents a step towards reconciling continuous fractal theory with the discrete nature of digital images, although it still relies on assumptions that may not hold at the pixel level. Our research extends this work by developing a framework specifically tailored to the analysis of AI-generated fractals, accounting for the unique challenges posed by machine-generated mathematical structures.

2.3. AI-Generated Mathematical Structures

The analysis of AI-generated mathematical structures presents unique challenges in verification and dimensional analysis. Recent advancements in large language models have demonstrated significant progress in mathematical reasoning capabilities [24], yet fundamental challenges remain to ensure robust geometric understanding, particularly for complex structures such as fractals [25]. These challenges are particularly relevant to our work, as we seek to develop methods to analyze the fractal properties of structures generated by AI models.
Let M denote the space of mathematical structures and G : P M be a generative model mapping prompts to structures. The verification problem can be formalized as finding a metric d : M × M R + that captures mathematical similarity while remaining computationally tractable. Current approaches focus on statistical validation [26], although these methods often fail to capture the subtle geometric properties inherent in fractal structures. Our work addresses this limitation by developing a framework that specifically targets the fractal properties of AI-generated structures.
The integration of dimensional analysis with traditional verification methods offers a promising direction to evaluate the mathematical fidelity of the generated content. However, existing frameworks for fractal analysis must be adapted to account for the discrete nature of AI-generated images and the limitations of finite resolution. This adaptation requires a careful reconsideration of fundamental concepts such as scaling laws and dimension calculations, since the continuous limits typically assumed in fractal theory are not directly applicable to pixel-based representations. Our research contributes to this area by proposing a novel approach that combines level set methods with discrete box-counting techniques, specifically designed to analyze the hierarchical complexity of AI-generated fractals within the constraints of digital image resolution.

3. Method

3.1. Discrete Level Set Framework for Digital Images

We develop a framework for analyzing AI-generated fractals using discrete level sets, adapting continuous fractal theory to the constraints of digital images. Let P be the set of all valid textual prompts and I = [ 0 , 1 ] M × N be the space of normalized grayscale images. A text-to-image model is defined as a mapping F : P I .
Definition 1
(Normalized Digital Image). A normalized grayscale digital image I : Ω { 0 , 1 , , 255 } / 255 is a function that maps pixels to discrete intensity values, where Ω = { 1 , , M } × { 1 , , N } Z 2 is a finite rectangular grid.
Definition 2
(Threshold Sequence). The uniform threshold sequence { t k } k = 0 10 is defined as t k = k / 10 , partitioning the intensity range [ 0 , 1 ] into equal intervals.
These intensity thresholds serve as a systematic means to probe the image’s structure at multiple discrete intensity levels. By dividing the full intensity range into equally spaced increments, we ensure a uniform and transparent approach to sampling the image’s hierarchical features. This choice of t k = k / 10 is driven by both simplicity and broad applicability: it is sufficiently granular to capture subtle changes in the image’s geometry while remaining computationally manageable. Moreover, selecting a uniform partition avoids bias toward particular intensity regimes and helps maintain methodological consistency in various fractal patterns and imaging scenarios.
Definition 3
(Discrete Level Sets). For a normalized digital image I and threshold t k , the discrete level set L k is defined as:
L k = { x Ω : I ( x ) t k }
Lemma 1
(Level Set Nesting). For any thresholds t 1 , t 2 [ 0 , 1 ] with t 1 < t 2 , the corresponding level sets satisfy L t 2 L t 1 .
Proof. 
Let x L t 2 . By definition, I ( x ) t 2 . Since t 2 > t 1 , we have I ( x ) t 2 > t 1 , which implies x L t 1 . Therefore, L t 2 L t 1 . □

3.2. Box-Counting Dimension Analysis

We now establish key properties of the box-counting dimension adapted for discrete level sets in digital images.
Definition 4
(Discrete Box-Counting Dimension). For each level set L k and a set of box sizes { ε i } i = 1 n , the discrete box-counting dimension D k is estimated by performing linear regression on the log-log plot of N ε i ( L k ) versus 1 / ε i :
D k = i = 1 n log ( 1 / ε i ) log ( 1 / ε ) ¯ log N ε i ( L k ) log N ε ( L k ) ¯ i = 1 n log ( 1 / ε i ) log ( 1 / ε ) ¯ 2 ,
where log ( 1 / ε ) ¯ and log N ε ( L k ) ¯ are the mean values over all i.
We choose the box-counting dimension over other definitions of fractal dimensions, such as the Hausdorff dimension, due to its practical compatibility with digital images and finite-resolution data. The Hausdorff dimension and related continuous-domain concepts are theoretically elegant but difficult to approximate reliably in pixel-based images with limited scales. In contrast, box-counting is inherently discrete and directly applicable to pixel grids, allowing for straightforward implementation and robust statistical estimation. This approach integrates naturally with the level set framework and the nested structure of intensity thresholds, making it well suited for assessing fractal-like complexity in AI-generated imagery without relying on continuous, infinitely scalable assumptions.
Lemma 2
(Discrete Box Cover Properties). For any subset S Ω , where Ω is a discrete grid of size M × N , and for any box size ε = k / M , with k being a positive integer divisor of M, the following inequalities hold:
| S | ( ε M ) 2 N ε ( S ) min | S | , M N ( ε M ) 2
where | S | is the number of pixels in S, and N ε ( S ) is the number of ε M × ε M boxes required to cover S.
Proof. 
The lower bound represents the minimum number of ( ε M ) 2 -sized boxes needed to cover | S | pixels when S is densely packed. The upper bound is the minimum of the total number of pixels in S and the number of ( ε M ) 2 -sized boxes needed to cover Ω , representing the worst-case scenario where each pixel requires its own box. □
Theorem 1
(Discrete Dimension Sequence Properties). For fixed box sizes { ε i } i = 1 n and level sets L k defined by thresholds t k = k / 10 , k { 0 , , K } , where K 10 is the highest threshold for which L K is non-empty and D K is defined, the estimated dimension sequence { D k } k = 0 K satisfies:
D k + 1 D k , k { 0 , , K 1 } ,
provided that N ε i ( L k + 1 ) N ε i ( L k ) for all ε i and the regression is performed over the same set of ε i .
Proof. 
Since L k + 1 L k , it follows that N ε i ( L k + 1 ) N ε i ( L k ) for each ε i . In the log-log plot of log N ε i ( L k ) versus log ( 1 / ε i ) , the points corresponding to L k + 1 lie below or coincide with those of L k . The regression line for D k is fitted to higher points than that for D k + 1 , ensuring D k + 1 D k . □

3.3. Hierarchical Structure Characterization

To characterize the hierarchical structure of AI-generated fractals within the constraints of digital images, we introduce the concept of dimensional gradients.
Definition 5
(Dimensional Gradient). The dimensional gradient D k quantifies the rate of change of the box-counting dimension between consecutive level sets:
D k = D k D k + 1
Theorem 2
(Dimension Gradient Summation). Let K 10 be the highest threshold for which L K is non-empty and D K is defined. The sum of the dimensional gradients over all thresholds up to K satisfies:
k = 0 K 1 D k = D 0 D K ,
where D k = D k D k + 1 for k { 0 , , K 1 } .
Proof. 
The proof follows by telescoping the sum:
k = 0 K 1 D k = k = 0 K 1 ( D k D k + 1 ) = ( D 0 D 1 ) + ( D 1 D 2 ) + + ( D K 1 D K ) = D 0 D K
This accounts for the highest meaningful threshold K where the dimension is defined. □
Definition 6
(Discrete Structural Complexity). The discrete structural complexity functional C : I R + is defined as:
C ( I ) = k = 0 K 1 ( D k ) 2 1 / 2
where K 10 is the highest threshold for which L K is non-empty and D K is defined.

3.4. Numerical Stability and Implementation

The implementation of our theoretical framework for digital images requires careful consideration of computational aspects and numerical stability.
Definition 7
(Discrete Box Cover). For a level set L k Ω and box size ε = n / M , n { 4 , 8 , 16 } , the discrete box cover B ε ( L k ) is defined as:
B ε ( L k ) = { b i , j : b i , j L k }
where b i , j = { i ε M + 1 , , ( i + 1 ) ε M } × { j ε M + 1 , , ( j + 1 ) ε M } are disjoint boxes covering Ω.
Lemma 3
(Discrete Box Count Computation). For any level set L k and box size ε, the box count N ε ( L k ) satisfies:
N ε ( L k ) = i = 0 1 / ε 1 j = 0 1 / ε 1 1 { b i , j L k }
where 1 denotes the indicator function.
Proof. 
The sum counts exactly those boxes that intersect L k , and since the boxes are disjoint, this gives | B ε ( L k ) | = N ε ( L k ) . □
Theorem 3
Numerical Stability for Discrete Dimension Estimation) (Corrected). Assume that for each level set L k , the errors in log N ε ( L k ) are independent and identically distributed with variance σ 2 and that the logarithms of the inverse box sizes X i = log ( 1 / ε i ) have variance Var ( X ) . Then, the standard error of the estimated difference in dimensions Δ D k , k = D k D k satisfies:
S E ( Δ D k , k ) = 2 σ n · Var ( X ) ,
and thus, the relative error in the estimated dimension difference is bounded by:
Δ D k , k Δ D k , k true Δ D k , k true 2 σ | Δ D k , k true | · n · Var ( X ) ,
where n is the number of box sizes used in the estimation.
Proof. 
For each D k , the variance is:
Var ( D k ) = σ 2 S X 2 ,
where:
S X 2 = i = 1 n X i X ¯ 2 = n · Var ( X ) .
Since D k and D k are independent estimates (errors in log N ε ( L k ) and log N ε ( L k ) are independent), the variance of their difference is:
Var ( Δ D k , k ) = Var ( D k ) + Var ( D k ) = 2 · σ 2 S X 2 .
The standard error is:
S E ( Δ D k , k ) = Var ( Δ D k , k ) = 2 · σ S X = 2 σ n · Var ( X ) .
The relative error is:
Δ D k , k Δ D k , k true Δ D k , k true S E ( Δ D k , k ) Δ D k , k true = 2 σ Δ D k , k true · n · Var ( X ) .
Proposition 1
(Computational Complexity for Digital Images). For a digital image of size M × N pixels, the computation of N ε ( L k ) for all thresholds k { 0 , , K } , where K 10 is the highest meaningful threshold, has time complexity O ( M N ) and space complexity O ( M N ) .
Proof. 
The level set computation requires one pass over the image ( O ( M N ) ), and the box counting for each level set requires examining each pixel exactly once. The space requirement is dominated by storing the binary level set arrays. □
This theoretical framework, adapted for digital images, ensures numerical stability in the computation of dimensional sequences and provides error bounds for the analysis of AI-generated fractals within the constraints of finite resolution. The computational efficiency of the implementation enables the analysis of large image datasets while maintaining mathematical precision.
Adapting fractal theory to digital images presents several challenges. Unlike continuous mathematical objects, digital fractals are represented by discrete pixel grids, and resolution limits the smallest scale at which structure can be measured. Additionally, noise and generation artifacts may distort fractal patterns. To address these issues, we explicitly incorporate the finite pixel domain into the dimension estimation process, employ uniform thresholding to reduce bias, and use multiple box sizes matched to the image resolution. These strategies ensure that our framework remains stable and interpretable despite the inherent discretization and scale constraints of digital image data.

4. Experimental Settings

Our experimental evaluation implements a systematic framework for estimating the fractal dimension in digital images, following the methodologies established in [27,28]. Let ( Ω , d ) be a discrete metric space representing the pixel grid, where Ω = { 1 , , 128 } × { 1 , , 128 } and d is the Euclidean metric. The evaluation protocol encompasses both dimensional accuracy and computational complexity analysis, with particular emphasis on the stability of box-counting estimates under varying threshold conditions.
Let F : P × R d [ 0 , 1 ] 128 × 128 × 3 denote the FLUX text-to-image model [15], where P represents the space of text prompts equipped with the standard string metric and R d is the latent space of dimension d = 1024 . For each prompt p P and seed s { 0 , , 399 } , we generate an RGB image I s , p = F ( p , ξ s ) through the stochastic process:
I s , p = F ( p , ξ s ) , ξ s N ( 0 , I d )
where the model hyperparameters are fixed at guidance scale γ = 7.0 , inference steps T = 10 , and maximum sequence length L = 256 . Following the methodology of [29], we apply the standardized RGB to grayscale conversion:
G ( I ) = 0.2989 R + 0.5870 G + 0.1140 B
where G ( I ) [ 0 , 1 ] 128 × 128 represents the normalized grayscale image.
To generate each fractal image, we employ the FLUX model with a fixed guidance scale of 7.0, 10 inference steps, and a resolution of 128 × 128 pixels. Each prompt is mapped into the latent space of the model, and the diffusion process iteratively refines the image until the desired resolution is achieved. The resulting RGB images are then converted to grayscale for analysis. We emphasize that different prompts lead to distinct fractal patterns, and variations in the prompt (e.g., adding “nested” or “intricate”) yield nuanced changes in the visual complexity of the fractal.
The experimental procedure incorporates four fundamental fractal designs (Mandelbrot, Julia, Sierpinski, and Dragon), each paired with four variations (standard, modified, inverse, hybrid) and five complexity levels (deep, nested, layered, intricate, detailed). For statistical robustness, we generate five instances of each combination, yielding a total sample size of 400 images. This structured sampling approach allows us to investigate the dimensional properties in a diverse range of fractal types while maintaining controlled experimental conditions as recommended by [19].
The dimensional analysis pipeline begins with the conversion of RGB images to grayscale using the standard luminance formula I g r a y = 0.2989 R + 0.5870 G + 0.1140 B , followed by the normalization of the intensity to the range [ 0 , 1 ] . For each normalized image I, we compute the level sets L k = { x Ω : I ( x ) t k } for thresholds t k = k / 10 , k { 0 , , 10 } . The box-counting dimension D k for each level set is calculated using three different box sizes ε { 4 / 128 , 8 / 128 , 16 / 128 } , allowing for multi-scale analysis of the fractal structures as suggested by [23].
The computation of box-counting dimensions follows a procedure where, for each box size ε and level set L k , we partition the image domain into a grid of ε × ε boxes and count the number N ε ( L k ) of boxes containing at least one pixel from L k . The dimension is then computed as D k = log N ε ( L k ) / log ( 1 / ε ) . This approach aligns with the theoretical framework developed by [16] while adapting to the discrete nature of digital images. The implementation utilizes efficient array operations through NumPy, with the box-counting algorithm optimized for the regular grid structure of digital images.

5. Results

5.1. Multi-Scale Analysis

The comprehensive analysis of 400 fractal images in multiple box sizes ( 4 × 4 , 8 × 8 , and 16 × 16 pixels) revealed consistent patterns of dimensional behavior. Table 1 presents the mean dimensions and standard errors for the 8 × 8 pixel boxes at different threshold levels.
The progression of standard errors indicates an increase in variability at higher thresholds, consistent with the expected behavior of box-counting dimension estimates in discrete settings. Notably, the dimensional sequences exhibited different rates of decrease in box sizes, with smaller boxes ( 4 × 4 ) showing more rapid dimensional changes compared to larger ones ( 16 × 16 ). This scale-dependent behavior suggests a hierarchical organization of fractal features, where finer-scale analysis reveals more dramatic changes in structural complexity.
Figure 1 illustrates the dimension sequences of the box counting in different box sizes for the threshold levels k { 0 , , 10 } . The consistent decrease in dimension values in all scales supports the theoretical prediction of monotonic dimensional sequences within the discrete setting of digital images.

5.2. Pattern-Specific Analysis

The pattern-specific analysis reveals distinct dimensional characteristics in the four base patterns: Mandelbrot, Julia, Sierpinski, and Dragon. We analyze dimension sequences { D k p } k = 0 10 in multiple box sizes ε { 4 / 128 , 8 / 128 , 16 / 128 } . The monotonicity rates achieve 100% consistency in all patterns and box sizes, with sample sizes of 100 images per pattern type.
The dimensional sequences exhibit pattern-specific decay rates characterized by the gradient measure:
D k p = D k p D k + 1 p , k { 0 , , 9 }
For Mandelbrot and Julia patterns, dimension sequences initially decrease more dramatically at lower thresholds, as reflected in early gradients (e.g., from D 0 = 2.000 to approximately D 2 = 1.93 1.96 depending on box size), indicating a rapid initial decay. Beyond these early stages, their dimensional changes become more gradual (e.g., by time k = 4 or 6, the rate of decrease stabilizes), consistent with our observed gradient measures ( D 0 p = 0.020 ± 0.004 and D 4 p = 0.085 ± 0.013 ).
In contrast, the Sierpinski and Dragon patterns maintain a more uniform reduction in the dimension values at all threshold levels and scales. Rather than showing a pronounced early drop, their dimension sequences decrease at a more even rate, resulting in less variability between consecutive thresholds. This behavior leads to more homogeneous gradient distributions, with mean gradients D k p ¯ = 0.042 ± 0.008 for k 4 . Thus, while Mandelbrot and Julia fractals undergo a notable initial change in complexity at lower thresholds, Sierpinski and Dragon fractals display a consistently stable and uniform structural decline throughout the analyzed threshold range.
The multi-scale analysis reveals consistent behavior across box sizes, with correlation coefficients between dimension sequences at different scales exceeding 0.95 for all patterns. This scale invariance property provides strong empirical support for the stability of dimensional characteristics at different spatial resolutions within the discrete framework of digital images.
The results provide support for the theoretical framework with perfect monotonicity rates (100%) in all patterns and box sizes in the 400-image sample. The multi-scale analysis reveals consistent dimensional behavior in different box sizes, with dimension values decreasing more rapidly at smaller box sizes (4 × 4) compared to larger ones (16 × 16), suggesting scale-dependent complexity in the generated fractals. The small standard errors (≤0.034) and monotonicity in all patterns and scales demonstrate the exceptional robustness of the dimensional analysis method to characterize AI-generated fractal structures.
The observed differences in dimensional gradients between the Mandelbrot/Julia and Sierpinski/Dragon patterns can be attributed to the underlying geometric complexities of these fractals. Mandelbrot and Julia sets are known for intricate boundary structures whose complexity emerges at intermediate intensity thresholds. This leads to increasingly pronounced dimensional gradients as thresholds progress, capturing the rapid structural transitions at these intermediate scales. In contrast, Sierpinski and Dragon patterns are characterized by more uniform self-similarity and relatively stable geometric motifs at different intensity levels. As a result, their dimensional gradients remain more homogeneous, reflecting a more evenly distributed complexity that does not exhibit sudden changes at intermediate thresholds. These distinctions highlight how the internal geometry of specific fractal families influences the rate at which complexity diminishes in intensity layers.
These insights into pattern-specific dimensional gradients also enhance our understanding of how fractal-like structures are internally represented by AI models. The ability to quantify how complexity diminishes at different intensity thresholds provides a window into the generative process, suggesting that certain fractal types (e.g., Mandelbrot and Julia) are encoded with richer intermediate-scale detail, while others (e.g., Sierpinski and Dragon) rely on more uniform patterns throughout. This quantitative perspective may inform future research on dissecting the latent representations of text-to-image models, ultimately improving our understanding of how abstract mathematical concepts, such as fractal geometry, are captured and reproduced by contemporary generative architectures.

5.3. Visual Analysis of Generated Fractals

The visual analysis of the generated fractal set reveals systematic relationships between pattern types and their corresponding dimensional properties. Figure 2 presents a 2 × 4 grid of representative samples, showcasing the four base patterns (Mandelbrot, Julia, Sierpinski, and Dragon) with their corresponding complexity variations. All images are generated and analyzed at the same fixed resolution ( 128 × 128 pixels), and the grayscale normalization and thresholding procedures are applied uniformly, ensuring that each pixel corresponds to the same physical scale in all images. This uniformity in resolution, preprocessing, and thresholding steps provides a consistent spatial sampling framework, allowing direct comparisons of fractal properties in different images and patterns.
The dimensional analysis of these visual patterns demonstrates a strong correlation with their structural complexity. For Mandelbrot and Julia patterns, we observe mean dimension values starting at D 0 = 2.000 ( ± 0.000 ) and decreasing monotonically through D 4 = 1.890 ( ± 0.021 ) before becoming undefined at higher thresholds. This behavior indicates a systematic reduction in structural complexity at higher intensity thresholds, consistent with the theoretical predictions of our discrete level set framework.
Figure 3 illustrates the negative gradient of the dimension sequences ( D k ) between the threshold levels for different box sizes. The plot reveals how quickly the complexity changes in threshold levels, with steeper gradients indicating more rapid structural changes. The comparison in box sizes illustrates how the rate of dimensional change varies with scale within the discrete framework of digital images.
The quantitative analysis of visual features reveals that 91% of the samples maintain strict monotonicity in their dimension sequences, with standard errors remaining below 0.021 through the threshold level k = 4 . This 91% value was obtained by examining all 400 samples and verifying that their dimension sequences decreased monotonically through the specified threshold level. Specifically, we counted the number of images whose dimension values strictly decreased from D 0 through D 4 and then divided by the total number of samples. This direct empirical assessment confirms the high prevalence of monotonic sequences. This high consistency in dimensional properties in different visual patterns provides strong empirical support for the theoretical framework developed in Section 3, particularly with respect to the monotonic decreasing property of dimension sequences within the constraints of digital image resolution. While these results strongly support our framework within the tested conditions, we acknowledge that further studies involving a wider range of resolutions, fractal types, and generative models would be required to confirm the generality of these findings. Our current conclusions are therefore contextualized by the specific experimental setup and image generation pipeline used in this study.

6. Discussion and Future Work

Despite the contributions, several limitations must be acknowledged. First, our analysis is constrained by the finite resolution of the generated images, which restricts the lower bound of the scales. This may cause some fine-scale fractal features to remain undetected. Second, while our approach confirms monotonic dimension sequences under the chosen thresholding and box-counting scheme, it does not necessarily generalize to all fractal concepts that could appear in higher-resolution or more diverse data. Third, the framework currently focuses on grayscale intensity values and does not directly incorporate color or multi-channel complexity. Finally, the reliance on a specific set of box sizes and threshold increments, although well grounded, could be refined to better capture the complexity of patterns that fall between the chosen scales. Addressing these limitations in future studies may help further strengthen the generality and interpretability of our framework.
In addition, the chosen resolution of 128 × 128 pixels inherently limits the scale range and may influence the precision of the estimated dimensions. Higher-resolution images would allow finer-grained box sizes and more subtle intensity thresholds, potentially yielding more accurate fractal dimension estimates and revealing more intricate fractal structures. Exploring higher resolutions in future work could thus provide deeper insights into the fractal-like geometry and complexity of AI-generated imagery.
Future work may explore the application of this framework to alternative text-to-image models, potentially incorporating noise-robust estimation methods for improved stability at higher thresholds. Additionally, investigating connections between dimensional sequences and manifold learning theory could provide deeper insights into the geometric encoding mechanisms of text-to-image models. These directions may further elucidate the relationship between AI-generated fractals and classical fractal dimension theory, advancing our understanding of how complex mathematical structures are represented in digital images.

7. Conclusions

This study introduced a discrete level set framework to characterize the fractal-like complexity of AI-generated images within the finite resolution constraints of digital imagery. By applying box-counting analysis in multiple intensity thresholds, we established that the resulting dimension sequences decrease monotonically, reflecting the nested structure of the level sets. Our experiments confirmed this monotonicity for all tested fractal patterns and scales, with inter-scale correlations exceeding 0.95. Moreover, we identified distinct decay patterns in the dimensional gradients for different fractal types, providing insights into how text-to-image models encode fractal geometry. These findings provide a quantitative and scalable approach to assessing hierarchical complexity in AI-generated fractals, paving the way for more nuanced evaluations of generative models in the domain of discrete mathematical imagery.

Author Contributions

Conceptualization, M.L.; methodology, M.L.; software, S.L.; writing—original draft preparation, M.L.; writing—review and editing, M.L. and S.L. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (RS-2024-00337250).

Institutional Review Board Statement

Not applicable.

Data Availability Statement

We utilized the FLUX.1-schnell model provided by Black Forest Labs in our research. The model was employed for specific tasks related to text-to-image generation within the study. The data and models used, including the FLUX.1-schnell model, are publicly available through Hugging Face at https://huggingface.co/black-forest-labs/FLUX.1-schnell (accessed on 1 November 2024).

Acknowledgments

We used a grammar-checking tool known to incorporate generative AI tools to review and refine the language and grammar of the manuscript. This tool was utilized to ensure clarity and precision in the writing. No content generation or substantial modifications were made to the original ideas. Additionally, we would like to acknowledge the assistance provided by ChatGPT 4o by OpenAI in resolving certain code errors encountered during the research. The use of ChatGPT was limited to debugging and did not involve any content creation or substantive alteration of the manuscript’s conceptual framework.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Bauer, A.; Volk, W.; Hartmann, C. Application of Fractal Image Analysis by Scale-Space Filtering in Experimental Mechanics. J. Imaging 2022, 8, 230. [Google Scholar] [CrossRef] [PubMed]
  2. Casas-Rosa, J.C.; Navarro, P.; Segura-Sánchez, R.J.; Rueda-Ruiz, A.J.; López-Ruiz, A.; Fuertes, J.M.; Delrieux, C.; Ogayar-Anguita, C.J. Change Detection in Point Clouds Using 3D Fractal Dimension. Remote Sens. 2024, 16, 1054. [Google Scholar] [CrossRef]
  3. Li, R.; Gao, X.; He, S.H.; Ru, D.; Ding, Z. Fractal Analysis of Particle Size and Morphology in Single-Particle Breakage Based on 3D Images. Fractal Fract. 2024, 8, 614. [Google Scholar] [CrossRef]
  4. González-Díaz, R.; Real, P.; Segovia, J. Fractal Topological Analysis for 2D Binary Digital Images. Math. Comput. Sci. 2018, 12, 11–20. [Google Scholar] [CrossRef]
  5. Nayak, S.R.; Mishra, J.; Jena, P.m. Fractal analysis of image sets using differential box counting techniques. Int. J. Inf. Technol. 2018, 10, 39–47. [Google Scholar] [CrossRef]
  6. Lee, M. Fractal Analysis of GPT-2 Token Embedding Spaces: Stability and Evolution of Correlation Dimension. Fractal Fract. 2024, 8, 603. [Google Scholar] [CrossRef]
  7. Silva, P.M.; Florindo, J.B. Fractal measures of image local features: An application to texture recognition. Multimed. Tools Appl. 2021, 80, 14213–14229. [Google Scholar] [CrossRef]
  8. Melnyk, V.; Rud, V.; Melnyk, Y.A. Correctness of fractal analysis of fractographic surface microstructure according to digital SEM photogrammetry. Powder Metall. Met. Ceram. 2018, 57, 353–360. [Google Scholar] [CrossRef]
  9. Lee, M. Fractal Self-Similarity in Semantic Convergence: Gradient of Embedding Similarity across Transformer Layers. Fractal Fract. 2024, 8, 552. [Google Scholar] [CrossRef]
  10. Panigrahy, C.; Garcia-Pedrero, A.; Seal, A.; Rodríguez-Esparragón, D.; Mahato, N.K.; Gonzalo-Martín, C. An approximated box height for differential-box-counting method to estimate fractal dimensions of gray-scale images. Entropy 2017, 19, 534. [Google Scholar] [CrossRef]
  11. Jiang, W.; Liu, Y.; Wang, J.; Li, R.; Liu, X.; Zhang, J. Problems of the Grid Size Selection in Differential Box-Counting (DBC) Methods and an Improvement Strategy. Entropy 2022, 24, 977. [Google Scholar] [CrossRef] [PubMed]
  12. Lan, B.; Yang, R.; Wu, Z.; Jiang, H.; Li, X. Characterization of the Fine-Scale Evolution of Damage in Shale under the Influence of Two-Way Stress Differences Based on CT Images and Fractal Theory—The Example of the Anba Dyke in the Wufeng–Longmaxi Formation. Fractal Fract. 2024, 8, 142. [Google Scholar] [CrossRef]
  13. Pi, Z.; Zhou, Z.; Li, X.; Wang, S. Digital image processing method for characterization of fractures, fragments, and particles of soil/rock-like materials. Mathematics 2021, 9, 815. [Google Scholar] [CrossRef]
  14. Ranganath, A.; Senapati, M.R.; Sahu, P.K. Estimating the fractal dimension of images using pixel range calculation technique. Vis. Comput. 2021, 37, 635–650. [Google Scholar] [CrossRef]
  15. Black Forest Labs. FLUX.1 [schnell]: A 12 Billion Parameter Rectified Flow Transformer for Text-to-Image Generation. 2024. Available online: https://huggingface.co/black-forest-labs/FLUX.1-schnell (accessed on 16 November 2024).
  16. Sarkar, N.; Chaudhuri, B. An Efficient Differential Box-Counting Approach to Compute Fractal Dimension of Image. IEEE Trans. Syst. Man Cybern. Syst. 1994, 24, 115–120. [Google Scholar] [CrossRef]
  17. Xue, S.; Jiang, X.; Duan, J. A new box-counting method for image fractal dimension estimation. In Proceedings of the International Conference on Innovative Computing and Cloud Computing, Singapore, 11–12 April 2017; pp. 1786–1791. [Google Scholar]
  18. Fraga, S.F.; Mondragón, J.R. Comparison of higuchi, katz and multiresolution box-counting fractal dimension algorithms for eeg waveform signals based on event-related potentials. Rev. EIA 2017, 14, 73–83. [Google Scholar]
  19. Panigrahy, C.; Seal, A.; Mahato, N.; Bhattacharjee, D. Differential box counting methods for estimating fractal dimension of gray-scale images: A survey. Chaos Solitons Fractals 2019, 126, 178–202. [Google Scholar] [CrossRef]
  20. Osher, S.; Sethian, J. Fronts propagating with curvature-dependent speed: Algorithms based on Hamilton-Jacobi formulations. J. Comput. Phys. 1988, 79, 12–49. [Google Scholar] [CrossRef]
  21. Caselles, V.; Kimmel, R.; Sapiro, G. Geodesic Active Contours. Int. J. Comput. Vis. 1995, 22, 61–79. [Google Scholar] [CrossRef]
  22. Chen, Y. Fractal Dimension Analysis of Urban Morphology Based on Spatial Correlation Functions. In The Mathematics of Urban Morphology; Birkhäuser: Cham, Switerland, 2019. [Google Scholar]
  23. Yan, J.; Sun, Y.; Cai, S.; Hu, X. An improved box-counting method to estimate fractal dimension of images. J. Appl. Anal. Comput. 2016, 6, 1114–1125. [Google Scholar]
  24. Ahn, J.; Verma, R.; Lou, R.; Liu, D.; Zhang, R.; Yin, W. Large Language Models for Mathematical Reasoning: Progresses and Challenges. arXiv 2024, arXiv:2402.00157. [Google Scholar]
  25. Mirzadeh, I.; Alizadeh, K.; Shahrokhi, H.; Tuzel, O.; Bengio, S.; Farajtabar, M. Gsm-symbolic: Understanding the limitations of mathematical reasoning in large language models. arXiv 2024, arXiv:2410.05229. [Google Scholar]
  26. Liu, N.; Sonkar, S.; Wang, Z.; Woodhead, S.; Baraniuk, R. Novice Learner and Expert Tutor: Evaluating Math Reasoning Abilities of Large Language Models with Misconceptions. arXiv 2023, arXiv:2310.02439. [Google Scholar]
  27. Szyperski, P.; Iskander, D.R. New Approaches to Fractal Dimension Estimation With Application to Gray-Scale Images. IEEE Access 2020, 8, 1383–1393. [Google Scholar] [CrossRef]
  28. Sukumaran, S.; Punithavalli, M. On Fractal Dimension Estimation Methods. Digit. Image Process. 2009, 1, 226–230. [Google Scholar]
  29. Nayak, S.R.; Mishra, J. Fractal dimension-based generalized box-counting technique with application to grayscale images. Fractals 2021, 29, 2150055. [Google Scholar] [CrossRef]
Figure 1. Box-counting dimension sequences for different box sizes ( 4 × 4 , 8 × 8 , and 16 × 16 pixels) for threshold levels k { 0 , , 10 } . Error bars indicate standard errors, demonstrating increasing variability at higher threshold levels. The consistent decrease in dimension values for all scales supports the theoretical prediction of monotonic dimensional sequences within the discrete setting of digital images.
Figure 1. Box-counting dimension sequences for different box sizes ( 4 × 4 , 8 × 8 , and 16 × 16 pixels) for threshold levels k { 0 , , 10 } . Error bars indicate standard errors, demonstrating increasing variability at higher threshold levels. The consistent decrease in dimension values for all scales supports the theoretical prediction of monotonic dimensional sequences within the discrete setting of digital images.
Fractalfract 08 00730 g001
Figure 2. A balanced set of 16 fractal images generated by the FLUX model at 128 × 128 resolution, illustrating only the Mandelbrot (top two rows) and Sierpinski (bottom two rows) patterns. Each image is created from distinct textual prompts that combine specific variations (standard or modified) and modifiers (deep or intricate). The individual titles on each image indicate the applied variation, modifier, and pattern, allowing for direct comparison of how these parameters influence the resulting fractal structures.
Figure 2. A balanced set of 16 fractal images generated by the FLUX model at 128 × 128 resolution, illustrating only the Mandelbrot (top two rows) and Sierpinski (bottom two rows) patterns. Each image is created from distinct textual prompts that combine specific variations (standard or modified) and modifiers (deep or intricate). The individual titles on each image indicate the applied variation, modifier, and pattern, allowing for direct comparison of how these parameters influence the resulting fractal structures.
Fractalfract 08 00730 g002
Figure 3. Negative gradient of the dimension sequences ( D k ) in threshold levels for different box sizes. The plot reveals how quickly the complexity changes in threshold levels, with steeper gradients indicating more rapid structural changes. The comparison across box sizes illustrates how the rate of dimensional change varies with scale within the discrete framework of digital images.
Figure 3. Negative gradient of the dimension sequences ( D k ) in threshold levels for different box sizes. The plot reveals how quickly the complexity changes in threshold levels, with steeper gradients indicating more rapid structural changes. The comparison across box sizes illustrates how the rate of dimensional change varies with scale within the discrete framework of digital images.
Fractalfract 08 00730 g003
Table 1. Multi-Scale dimensional analysis results for 8 × 8 pixel boxes.
Table 1. Multi-Scale dimensional analysis results for 8 × 8 pixel boxes.
Threshold kMean D k Std Error
02.0000.000
21.9480.004
41.8750.008
61.7360.015
81.4720.026
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Lee, M.; Lee, S. Box-Counting Dimension Sequences of Level Sets in AI-Generated Fractals. Fractal Fract. 2024, 8, 730. https://doi.org/10.3390/fractalfract8120730

AMA Style

Lee M, Lee S. Box-Counting Dimension Sequences of Level Sets in AI-Generated Fractals. Fractal and Fractional. 2024; 8(12):730. https://doi.org/10.3390/fractalfract8120730

Chicago/Turabian Style

Lee, Minhyeok, and Soyeon Lee. 2024. "Box-Counting Dimension Sequences of Level Sets in AI-Generated Fractals" Fractal and Fractional 8, no. 12: 730. https://doi.org/10.3390/fractalfract8120730

APA Style

Lee, M., & Lee, S. (2024). Box-Counting Dimension Sequences of Level Sets in AI-Generated Fractals. Fractal and Fractional, 8(12), 730. https://doi.org/10.3390/fractalfract8120730

Article Metrics

Back to TopTop