Abstracting Sketches Through Simple Primitives

Stephan Alaniz, Massimiliano Mancini, Anjan Dutta, Diego Marcos, Zeynep Akata

Introduction

Humans possess a remarkable ability for visual abstraction. In a game of Pictionary, a simple circle for a head and two triangles for ears are sufficient to communicate the concept of a "cat." This capacity to decompose complex objects into a few characteristic parts is a hallmark of human intelligence. However, current artificial intelligence models for sketch analysis often struggle with this level of semantic simplification.

Traditional sketch abstraction techniques typically rely on selection, where models rank original strokes and delete those deemed "least important" to reduce data size. The limitation of this approach is that if the original strokes are messy or overly detailed, simply retaining a subset may fail to preserve the object's core meaning. To address this, the Primitive-matching Network (PMN) proposes a shape-based approach: instead of merely filtering original strokes, the model learns to replace them with a standardized vocabulary of interpretable geometric primitives.

The PMN pipeline translates human sketches into a clean vocabulary of primitives, enabling high-quality abstraction even under tight data budgets.

The Primitive-Matching Network (PMN)

The challenge in developing such a system lies in the lack of labeled datasets; there is no ground-truth "Rosetta Stone" that defines which geometric shape best represents a specific hand-drawn squiggle. The PMN overcomes this through a self-supervised framework that maps human strokes to a predefined set of seven primitives: arc, circle, line, corner, triangle, square, and U-shape.

Architecture Overview

The PMN architecture consists of three primary components designed to decouple the identity of a shape from its spatial orientation:

  1. Stroke Encoder ($f$): A Transformer-based model that processes a sequence of 2D points (a stroke) to produce an embedding. This embedding is bifurcated into two distinct representations: one capturing the semantic identity of the shape ("what") and the other capturing its pose ("how").
  2. Alignment Function ($h$): This component predicts the specific affine transformations (rotation, scaling, and translation) required to fit a primitive to the target human stroke.
  3. Compatibility Function ($\phi$): This module calculates a similarity score between the target stroke and each of the seven available primitives to determine the best match.
The detailed architecture of PMN, illustrating the stroke encoder, the alignment process via affine transformations, and the self-supervised distance-transform loss.

Self-Supervised Learning via Distance Transforms

To train the model without explicit labels, the authors utilize a reconstruction loss based on distance transforms. Comparing raw coordinates is computationally difficult when point counts differ between strokes. Instead, the PMN treats each stroke as a 2D "influence map," where pixel intensity decreases as the distance from the stroke increases. The model is optimized to ensure the distance transform of the predicted primitive overlaps perfectly with the distance transform of the original human stroke, allowing for robust, label-free learning.

Experimental Results and Insights

The PMN was evaluated on major benchmarks including Quickdraw (classification) and ShoeV2/ChairV2 (Fine-Grained Sketch-Based Image Retrieval). The model demonstrates significant advantages in "low-budget" scenarios where only a small fraction of the original sketch data can be transmitted.

  • Classification Performance: On the Quickdraw dataset with a 10% information budget, PMN achieved 67.08% accuracy, vastly outperforming state-of-the-art selection-based methods like GDSA, which reached only 26.88%.
  • Retrieval Accuracy: In image retrieval tasks (ShoeV2) at a 10% budget, PMN achieved a 29.58% retrieval rate, nearly doubling the performance of traditional stroke-selection methods (14.86%).

Key Advantages

  • Semantic Density: Primitives are more efficient than raw coordinates. A single primitive, defined by a label and a few transformation parameters, carries more semantic weight than a collection of raw points.
  • Interpretability: Because the output consists of geometric shapes, the model's "reasoning" becomes transparent. One can see that a model identifies a "cat" because it detected specific geometric features like triangles and circles.
  • Hybrid Potential: The authors found that PMN is complementary to selection-based methods. Combining shape-based abstraction with stroke dropping yields the highest overall performance.

Limitations and Future Directions

The current iteration of PMN is constrained by a one-to-one mapping requirement, where the model attempts to match exactly one primitive to one human stroke. This causes issues with complex, continuous strokes (e.g., the entire silhouette of a shoe), which the model may approximate poorly. Future research may explore stroke splitting—breaking complex strokes into multiple primitives—or learning the primitives themselves directly from data rather than relying on a fixed set of seven shapes.

Summary updated

BibTeX
@inproceedings{alaniz2022abstracting,
  author = {Stephan Alaniz and Massimiliano Mancini and Anjan Dutta and Diego Marcos and Zeynep Akata},
  title = {{Abstracting Sketches Through Simple Primitives}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19818-2\_23},
}
Figure