Inferring Iterated Function Systems Approximately from Fractal Images

Haotian Liu, Dixin Luo, Hongteng Xu

Abstract

This paper introduces a deep learning framework designed to solve the "inverse problem" of fractals: automatically inferring underlying mathematical rules, such as Iterated Function Systems (IFSs), from a single image. By employing a multi-head autoencoder and a semi-supervised learning paradigm, the model successfully reconstructs parameters for both Julia sets and L-systems. The framework demonstrates significant generalization capabilities, extending to natural objects like plants and shells. The inclusion of unlabeled data is shown to be critical for bridging disparate fractal domains in the latent space.

Introduction

Fractals are complex geometric structures characterized by self-similarity, prevalent in both nature (e.g., ferns, coastlines) and digital art. While generating a fractal from a set of rules—an Iterated Function System (IFS)—is mathematically straightforward, the reverse process is notoriously difficult. Inferring the IFS from an image presents a "needle in a haystack" problem due to the massive search space and the unknown intrinsic structure of the rules. Existing methods are typically hand-crafted for specific fractal types and lack the flexibility to handle heterogeneous datasets. This work proposes a unified, deep-learning-based approach that minimizes prior knowledge requirements.

Methodology

The proposed architecture utilizes a multi-head auto-encoding framework trained via semi-supervised learning.

  1. Unified Encoder: A shared backbone (such as DenseNet) maps input fractal images into a d-dimensional latent space.
  2. Specialized Decoders: Three distinct heads process the latent representation:
  3. Sequential Predictor: An RNN or Transformer that predicts the symbolic grammar of L-systems.
  4. Non-sequential Predictor: A CNN-based head that estimates continuous parameters for Julia sets (e.g., the complex constant $c$, scale, and iterations).
  5. Image Decoder: A reconstruction head that redraws the input image from the latent representation, serving as a regularizer.
The multi-head auto-encoding architecture for fractal rule inference.

The "secret sauce" of this approach is the semi-supervised learning paradigm. By incorporating a large-scale dataset of unlabeled fractal images, the model is forced to capture meaningful semantic features even in the absence of ground-truth rules. This prevents overfitting to labeled examples and facilitates a more continuous latent manifold.

Datasets

The model was evaluated using several datasets:

  • Labeled Julia Sets: 10,000 synthetic images with randomized parameters.
  • Labeled L-systems: Approximately 10,000 images based on 59 distinct grammar rules.
  • Unlabeled Fractals: 12,000 images from FractalDB, a diverse dataset of automatically generated fractals.
  • Natural Images: Real-world photographs of spiral aloes and trees used to test zero-shot generalization.

Results and Discussion

Experimental results indicate that CNNs, specifically DenseNet, outperform Vision Transformers (ViT) for fractal tasks. The authors suggest that CNNs' hierarchical features better preserve the global spatial patterns and self-similarity across scales, which ViT's patch-based tokenization may disrupt.

Visualizations of Julia set variations processed by the model.

A key insight from t-SNE visualizations is the "bridge" effect provided by unlabeled data. Without it, the latent spaces for Julia sets and L-systems remain isolated; with it, the model develops a continuous manifold that enhances generalization. The model achieved high accuracy in parameter estimation for Julia sets and near-perfect symbolic rule inference for L-systems (measured by BLEU and ROUGE scores). Furthermore, the system successfully inferred rules for natural objects after applying edge detection, recreating complex branching and spiral patterns found in nature.

Conclusion

This research demonstrates a robust framework for the approximate inference of IFSs from images. By combining specialized decoders with semi-supervised regularization, the model overcomes the heterogeneity of different fractal types. Future work will focus on scaling the framework to handle even more complex and randomized rule sets, potentially leading to a universal engine for fractal analysis.

Summary updated

BibTeX
@inproceedings{liu2024inferring,
  author = {Haotian Liu and Dixin Luo and Hongteng Xu},
  title = {{Inferring Iterated Function Systems Approximately from Fractal Images}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2024},
}
Figure