FDSML: Formula-Driven Supervised Metric Learning
with Parameter-Aware Triplet Loss

Formula-Driven Supervised Learning (FDSL) enables vision pre-training without real images, but existing methods cast pre-training as classification on discretized labels, discarding continuity in the generative process. We propose Formula-Driven Supervised Metric Learning (FDSML), which derives relational supervision from image-generation parameters beyond discrete class labels. FDSML combines FineFractalDB, our refined fractal dataset with higher intra-class variation and more stable structures, with a Parameter-Aware Triplet (PA-Triplet) Loss that assigns positives and negatives according to distances in the underlying Iterated Function System parameter space. This objective trains embeddings to respect parameter-derived relative similarity orderings. Experiments show that FDSML improves transferability to image retrieval while remaining competitive on downstream classification and improving robustness under several corruption settings. On ResNet-50, Recall@1 improves from 65.6% to 74.0% on Stanford Online Products and from 56.2% to 78.4% on Stanford Cars over FDSL pre-training. These results suggest that parameter-derived relational supervision provides a stronger synthetic pre-training signal than label-based classification for transfer beyond recognition.
Formula-Driven Supervised Learning (FDSL) pre-trains vision models on images rendered from mathematical formulas, so no real images, annotations, or privacy concerns are involved. Existing FDSL methods, however, treat pre-training as classification: the continuous generation parameters are discretized into class labels, and everything that happens inside a class is thrown away.
Fractals are generated by an Iterated Function System (IFS), and their shapes change gradually as the affine parameters change. We argue that this continuity is the supervision signal itself. Instead of asking a model to recognize categories, we ask it to respect the relative similarity orderings induced by the generative parameters.
FDSML keeps the standard triplet objective and changes only how positives and negatives are chosen.
Draw an anchor xa and two candidates x1, x2 together with their IFS parameter descriptors Ψa, Ψ1, Ψ2.
The candidate closer to the anchor in parameter space becomes the positive, the other the negative. No class label is needed for this decision.
Optimize the encoder so that embedding-space distances reproduce the ordering given by the parameter space.
Each image xi is generated by an IFS {(ψk,πk)}k=1N, where ψk∈R6 are the affine parameters of map k and πk its selection probability. We summarize the generative process with a compact descriptor and a distance on it:
Ψi=k=1∑Nπkψk∈R6,dΨ(i,j)=∥Ψi−Ψj∥2.
Given an anchor and two candidates, x1 is the positive and x2 the negative whenever dΨ(a,1)≤dΨ(a,2), and the triplet is fed to the usual margin loss:
Ltriplet=max(0,∥gθ(xa)−gθ(xp)∥2−∥gθ(xa)−gθ(xn)∥2+α).
Note that dΨ is used only ordinally, to decide which candidate is closer. It is not treated as a perceptual distance, so the embedding is trained to respect relative orderings rather than categorical separability.
Two fractals drawn at random from the whole dataset are usually so different that the comparison is trivial. We therefore use the discrete class labels as a coarse prior that restricts the candidate pool; the final positive/negative assignment is still made by dΨ.

Does the parameter ordering actually match what is rendered? We measured how often the candidate closer in dΨ is also closer under the symmetric Chamfer distance between the rendered shapes.
| Filtering | Agreement with dΨ | Label-only rule |
|---|---|---|
| all | 47.2 % | – |
| each | 89.2 % | 89.4 % |
| same | 80.6 % | 50.0 % (chance) |
| diff | 46.8 % | 50.0 % (chance) |
Under each, the descriptor essentially reproduces the class label. Under same, no label rule exists at all, yet the descriptor still reaches 80.6 %: this is supervision that class labels cannot provide even in principle, and it is the regime where FDSML works best.
FractalDB-1k creates its 1,000 instances per class from only 25 parameter perturbations combined with flips and rendering variations, and its affine maps are not forced to be contractive. The result is low intra-class diversity (left, blue box) and collapsed, uninformative samples (right, red box), neither of which is good for fine-grained relational supervision.

FineFractalDB keeps the 1,000 classes × 1,000 images of FractalDB-1k but refines the generation process:
Drag the slider to compare random samples from the two datasets. Each row is one class, each column a different instance.

Retrieval depends on the geometry of the embedding space rather than on decision boundaries, which makes it the most direct test of our claim. With a ResNet-50 backbone fine-tuned with the Proxy-Anchor loss, FDSML pre-training on FineFractalDB consistently beats both training from scratch and classification-based FDSL on FractalDB-1k.
| Pre-training (ResNet-50) | SOP R@1 | SOP R@10 | Cars R@1 | Cars R@4 | In-Shop R@1 | In-Shop R@10 |
|---|---|---|---|---|---|---|
| Scratch | 70.4 | 83.1 | 40.9 | 61.5 | 87.2 | 95.7 |
| ImageNet-1k (supervised, real images) | 79.1 | 91.0 | 87.7 | 95.6 | 91.1 | 97.8 |
| FractalDB-1k, FDSL | 65.6 | 81.3 | 56.2 | 76.3 | 87.3 | 95.5 |
| FineFractalDB, FDSML (same) | 74.0 | 86.6 | 78.4 | 90.2 | 89.2 | 97.0 |
Two observations stand out. First, on SOP the FDSL model is actually worse than training from scratch (65.6 vs. 70.4 Recall@1): classification-based synthetic supervision does not automatically provide a useful inductive bias for embedding-based tasks. Second, FDSML closes a large part of the gap to real-image pre-training while never seeing a natural image. The full table with all filtering strategies and Recall@K values is in the paper.
FDSML is designed for relational tasks, but it does not sacrifice category recognition. Top-1 accuracy after fine-tuning (%):
| Pre-training (ResNet-50) | CIFAR-10 | CIFAR-100 | ImageNet-100 | ImageNet-1k | Places-30 |
|---|---|---|---|---|---|
| Scratch | 87.60 | 62.70 | 72.42 | 75.47 | 73.50 |
| ImageNet-1k (supervised) | 96.96 | 84.48 | – | – | 80.33 |
| FractalDB-1k, FDSL | 90.50 | 70.21 | 79.42 | 70.43 | 76.33 |
| FineFractalDB, FDSML (same) | 91.47 | 68.74 | 80.62 | 72.65 | 77.20 |
| Pre-training (ViT-Tiny) | CIFAR-10 | CIFAR-100 | ImageNet-100 | ImageNet-1k | Places-30 | Cars | Flowers |
|---|---|---|---|---|---|---|---|
| Scratch | 76.47 | 58.02 | 70.08 | 71.46 | 81.17 | 21.30 | 48.74 |
| ImageNet-1k (supervised) | 97.92 | 85.65 | – | – | 81.48 | 91.26 | 93.70 |
| FractalDB-1k, FDSL | 96.65 | 81.18 | 84.40 | 72.40 | 80.46 | 77.01 | 73.99 |
| FineFractalDB, FDSML (each) | 98.00 | 82.08 | 88.90 | 73.71 | 80.35 | 83.17 | 74.21 |
On ViT-Tiny, FDSML lifts ImageNet-100 from 84.40 % to 88.90 % and even edges out supervised ImageNet-1k pre-training on CIFAR-10. The same trend holds for ViT-Base (see the paper).
Ablation with ViT-Tiny (Top-1 %). Swapping the objective alone already helps; swapping the dataset helps only under FDSML.
| Objective | Dataset | CIFAR-10 | CIFAR-100 | ImageNet-100 |
|---|---|---|---|---|
| FDSL (cross-entropy) | FractalDB-1k | 96.65 | 81.18 | 84.40 |
| FDSL (cross-entropy) | FineFractalDB | 96.11 | 77.52 | 84.32 |
| FDSML (each) | FractalDB-1k | 97.77 | 81.72 | 87.93 |
| FDSML (each) | FineFractalDB | 98.00 | 82.08 | 88.90 |
Cross-entropy assigns the same label to every instance in a class, so it cannot exploit the extra intra-class variation of FineFractalDB and even suffers from it. PA-Triplet turns exactly that variation into supervision.
Classification error on ImageNet-C (lower is better), averaged within each corruption group:
| Backbone | Pre-training | Noise | Blur | Weather | Digital | Geometric |
|---|---|---|---|---|---|---|
| ResNet-50 | FractalDB-1k, FDSL | 86.16 | 74.82 | 71.94 | 60.36 | 61.15 |
| ResNet-50 | FineFractalDB, FDSML (same) | 83.62 | 72.87 | 68.81 | 57.46 | 59.13 |
| ViT-Tiny | FractalDB-1k, FDSL | 55.31 | 60.78 | 50.84 | 41.94 | 48.49 |
| ViT-Tiny | FineFractalDB, FDSML (same) | 59.26 | 60.06 | 47.64 | 43.55 | 47.97 |
For ResNet-50, FDSML improves every corruption group. For ViT-Tiny the picture is mixed: structural and environmental corruptions (blur, weather, geometric) improve, while high-frequency noise and digital corruptions get worse. We report this trade-off as is; understanding its frequency-domain cause is future work.
Grad-CAM for ResNet-50 models fine-tuned on ImageNet-1k. FDSML produces activation maps that are concentrated on the object, qualitatively closer to the ImageNet pre-trained model, whereas FDSL responses are often diffuse or drift to the background.

Layer-wise CLS-to-patch attention of ViT-Tiny on a fractal input, from shallow (left) to deep (right). FDSL attends almost exclusively to the silhouette boundary; FDSML also attends to textured interior regions, which suggests it captures fine-grained appearance in addition to coarse structure.

UMAP projection of ResNet-50 features for ten FineFractalDB test classes. FDSML (each) organizes each class into structured trajectories that follow the generative parameters, with the images (A)–(D) sampled along one trajectory shown below each panel.

The FDSML source code is released under CC BY-NC-SA 4.0 (see LICENSE). Parts of the code are derived from the third-party projects below, which keep their original licenses (see NOTICE.md for details).
This project page is built on the academic-project-template by denkiwakame, provided under CC BY-SA 4.0.
This work was supported by JSPS KAKENHI Grant Numbers JP24H00742 and JP24H00748, JST SPRING Grant Number JPMJSP2128, and computational resources of ABCI 3.0 provided by AIST and AIST Solutions.
@inproceedings{Otake2027fdsml,
author = {Hina Otake and Shinei Arakawa and Keitaro Tanaka and Yoshihiro Fukuhara and Hirokatsu Kataoka and Shigeo Morishima},
title = {FDSML: Formula-Driven Supervised Metric Learning with Parameter-Aware Triplet Loss},
booktitle = {Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV)},
year = {2027}
}
powered by Academic Project Page Template