Shape complexity estimation using VAE

Markus Rothgaenger, Andrew Melnik, Helge RitterarXiv 2023

What makes a shape "complex"? A circle feels simple, while a jagged snowflake feels complicated. For humans, this intuition is immediate, but for computer vision systems, "complexity" is a notoriously slippery concept to define mathematically.

In their paper, "Shape complexity estimation using VAE," Markus Rothgänger and his colleagues at Bielefeld University propose a clever new way to quantify this attribute using the internal mechanics of Variational Autoencoders (VAEs).

TL;DR

The researchers introduce a "Complexity Score" based on the reconstruction error difference between two VAEs with different latent space sizes. By measuring how much a shape "breaks" when forced through a tighter information bottleneck, they can effectively rank 2D shapes by their structural complexity.

What Problem Does This Paper Address?

In computer vision, ranking shapes by complexity is useful for everything from object recognition to scene analysis. However, there is no single, universally accepted definition of shape complexity.

Traditional methods usually fall into two camps:

  1. Information Theory: Using compression algorithms (like ZIP) to see how much a file can be shrunk. If it doesn't shrink much, it's "complex."
  2. Signal Processing: Using Fourier Transforms (FFT) to look for high-frequency components (sharp edges and fine details).

While useful, these methods can be fooled by noise or fail to capture the "structural" logic of a shape. The authors sought a method that captures how a neural network perceives and internalizes shape structure.

Methods

The core idea relies on the information bottleneck principle. A VAE works by "squeezing" an image into a small vector (the latent space) and then trying to reconstruct the original image from that vector.

The authors' novel approach uses two VAEs:

  • Encoder 1 / Decoder 1: Has a relatively generous bottleneck of 64 neurons.
  • Encoder 2 / Decoder 2: Has a very restrictive bottleneck of only 16 neurons.
Fig. 1: Diagram of the architecture and calculation of the Complexity Score (CS) of a shape. The higher the score, the more complex the shape. S1, S2, S3 - Shape 1, Shape 2, Shape 3.

The logic is elegant: A simple shape (like a triangle) can be easily described even with very few parameters, so both VAEs will reconstruct it well. A complex, jagged shape, however, will "clog" the 16-neuron bottleneck, resulting in a blurry, poor reconstruction, while the 64-neuron version might still manage a decent job.

The Complexity Score (CS) is calculated as the absolute pixel-wise difference ($D$) between these two reconstructions, normalized by the number of white pixels ($W$) in the original image to ensure the score isn't just a reflection of the shape's size.

Datasets

The authors evaluated their method across three distinct types of data:

  • MineRL: Shapes extracted from first-person views in a Minecraft environment.
  • MPEG-7: A classic computer vision dataset containing a wide variety of real-world object silhouettes (animals, tools, etc.).
  • Human-Ranked Reference Set: A small dataset of 30 shapes with pre-existing complexity rankings provided by human subjects.

Key Insights and Ideas

  • Complexity as "Squeezability": The paper reinforces the idea that complexity is inversely proportional to how well a shape can be compressed without losing its essence.
  • Capacity Delta: The most interesting insight is that we shouldn't just look at reconstruction error against the ground truth, but rather the difference in performance between a high-capacity model and a low-capacity one. This isolates the "hard-to-learn" features of the shape.
  • Multi-Dimensionality: The authors found that combining their VAE score with traditional FFT and compression metrics (creating a "3D" measure) often yielded the most robust results, suggesting that "complexity" is actually a composite of several different geometric properties.

Key Results

The researchers compared their VAE-based rankings against human judgments and traditional metrics using Spearman’s rank correlation (where 1.0 is a perfect match).

Fig. 2: Spearman’s rank correlation evaluated on the reference test dataset [6] with 30 shapes. Fill Ratio is the percentage of white pixel in the images, 3D is the combined measure of VAE, FFT and compression.
  • Human Correlation: On the 30-shape reference set, the compression-based measure actually aligned most closely with human intuition. However, the VAE method provided a unique perspective that traditional methods missed.
  • Structural Sensitivity: Qualitatively, the VAE method proved excellent at identifying "structural" complexity. As seen in the figure below, as the complexity score increases, the 16-neuron VAE (bottom row) struggles significantly more than the 64-neuron VAE (middle row) to maintain sharp edges.
Fig. 6: A comparison of sorting a random subset of the MPEG-7 [3] dataset using our measures. The associated complexity value is given in orange text (for the combined measure it is FFT, compression and VAE from top to bottom). (a - pixel fill percentage, b - compression, c - FFT, d - VAE, e - combined, f - combined equal contribution)

Limitations and Future Work

The authors are transparent about the fact that "complexity" remains an informal definition. One major challenge is distinguishing between true complexity and noise. A simple circle with a "noisy" or pixelated edge might receive a high complexity score even though its underlying structure is simple.

Future work could involve larger user studies to better align these algorithmic scores with human perception. Additionally, the authors suggest exploring whether neural networks can be trained specifically to distinguish between structural complexity and random noise, perhaps by approximating Kolmogorov complexity more directly.

Summary updated

BibTeX
@misc{rothgaenger2023shape,
  author = {Markus Rothgaenger and Andrew Melnik and Helge Ritter},
  title = {{Shape complexity estimation using VAE}},
  year = {2023},
  eprint = {2304.02766},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.02766},
}
Figure