Abstract
Fractals are complex, self-similar geometric structures often used as synthetic data for pre-training computer vision models. However, finding the mathematical parameters of an Iterated Function System (IFS) to match a specific target image—the inverse fractal problem—has historically been computationally intensive. This paper presents a novel approach to learning fractal parameters using gradient descent. By formulating fractal generation as a Recurrent Neural Network (RNN) and employing a differentiable renderer based on Radial Basis Function (RBF) kernels, the authors enable end-to-end optimization. Experimental results on datasets like MNIST and Fashion-MNIST demonstrate that this method can accurately approximate diverse shapes, offering significant improvements over traditional baselines and providing valuable structural information for downstream tasks.
Introduction
Fractals have recently gained popularity in computer vision as a rich source of synthetic data for pre-training models. While generating random fractals is straightforward, the inverse problem—identifying the specific mathematical parameters that generate a fractal matching a given target image—remains a significant challenge. Historically, solving this "fractal inversion" relied on slow, non-gradient-based methods like genetic algorithms or moment matching.
This research addresses this gap by reimagining fractal generation within a modern deep learning framework. The goal is to find an Iterated Function System (IFS)—a set of affine transformations—that can reconstruct target images ranging from abstract patterns to recognizable objects like handwritten digits and clothing.
Methodology
The core innovation lies in bridging classical geometry with differentiable optimization through three primary components:
1. IFS as a Recurrent Neural Network
The researchers observed that the iterative process of generating fractal points (repeatedly applying affine transformations) is mathematically equivalent to a Recurrent Neural Network (RNN) with identity activations and stochastic weights. This formulation allows fractal generation to be implemented using standard deep learning frameworks like PyTorch, enabling the use of backpropagation.
2. Differentiable Rendering
Standard pixel rendering is a discrete process that does not allow for gradient flow. To overcome this, the authors implemented a differentiable renderer using a Radial Basis Function (RBF) kernel. In this setup, each generated point in the fractal "diffuses" its intensity to neighboring pixels. This creates a continuous, differentiable mapping from 2D point coordinates to the final image, allowing gradients to be calculated with respect to the target image.
3. Optimization Stability
Optimizing fractals is notoriously unstable, often leading to exploding gradients. The authors introduced two key techniques to ensure convergence:
- Reparameterization: Affine matrices are decomposed into rotation, scaling, and flipping components. Scaling factors are clamped to prevent the fractal from growing infinitely.
- Noisy SGD: Small amounts of Gaussian noise are added to the parameters during training. This helps the optimization process escape poor local minima, which is particularly important given the low parameter count of an IFS compared to standard neural networks.
Experimental Results
The approach was evaluated on several benchmarks, including FractalDB, MNIST (digits), KMNIST (Japanese characters), and Fashion-MNIST (clothing items).
Reconstruction Quality
The gradient descent method significantly outperformed "inverse encoder" baselines. For instance, on the MNIST dataset, the proposed method achieved a Mean Squared Error (MSE) of 0.0202, a substantial improvement over the baseline's 0.1724. Qualitative results show that even with a limited number of affine transformations (typically around 10), the system can approximate non-fractal shapes with surprising accuracy.
Downstream Benefits
A key finding was that pre-training models on "learned" fractals—those optimized to resemble specific datasets like MNIST—resulted in higher downstream accuracy than pre-training on purely random fractals. This suggests that the structural information captured during the inversion process is highly valuable for feature learning.
Conclusion and Future Work
By making the fractal generation pipeline end-to-end differentiable, this work moves fractal inversion from a niche mathematical curiosity into a practical tool for deep learning. While the current method is limited to grayscale images and can struggle with extremely fine, non-self-similar details, it opens several avenues for future research. Potential extensions include handling color images, applying the approach to 3D point clouds, and further refining the optimization process to reduce sensitivity to initialization.
Summary updated