Edge Augmentation for Large-Scale Sketch Recognition without Sketches

Nikos Efthymiadis, Giorgos Tolias, Ondrej Chum

Abstract

Sketch recognition is traditionally limited by the high cost of collecting human-drawn training data. This paper presents a method to train large-scale sketch classifiers using zero human sketches during the training phase. The core innovation is the transformation of natural RGB images into a "pseudo-sketch" domain called randomized Binary Thin Edges (rBTE). By applying randomized edge detection, thinning, and thresholding, the model learns to generalize from synthetic edges to real-world hand-drawn doodles. The approach achieves state-of-the-art results on the PACS benchmark and scales to 874 categories, significantly outperforming traditional domain generalization techniques.

Introduction

Identifying what a hand-drawn doodle represents—sketch recognition—is a classic computer vision challenge. However, scaling these systems to thousands of categories is bottlenecked by data: collecting human sketches is incredibly slow and expensive. For context, the popular Sketchy dataset required nearly 4,000 hours of human labor for just 125 categories. To reach 1,000 categories, researchers would need over 13 human-years of drawing.

The fundamental obstacle is the domain gap. Natural images are dense, colorful, and textured, while sketches are sparse, binary, and focused on 2D contours. Most domain generalization techniques struggle when the source (RGB) and target (sketch) are this visually distinct. This paper proposes a training pipeline that treats sketch recognition as a single-source domain generalization problem, eliminating the need for human-drawn training data entirely.

The rBTE Methodology

Instead of training on RGB images, the authors transform them into randomized Binary Thin Edges (rBTE). This pipeline consists of several stages designed to mimic the variability of human sketching:

  1. Edge Detection: Multiple edge detectors (SE, HED, and BDCN) are used to extract contours. Using multiple models expands the variety of "styles" the network encounters.
  2. Geometric Augmentation: Standard flips, rotations, and crops are applied to the edge maps.
  3. Thinning (NMS): Non-maximum suppression ensures edges are only one pixel wide, mimicking the stroke of a pen.
  4. Randomized Thresholding: This is a key contribution. Instead of a fixed threshold, the system randomly selects from several binarization methods (Otsu, Yen, Li, etc.) and varies hysteresis thresholds. This simulates different levels of detail, from minimalist outlines to detailed drawings.
  5. Filtering: Small "noise" components are discarded to clean up the image.
Comparison of natural images, synthetic rBTE training data, and target free-hand sketches.

The resulting model is a standard ResNet-101 trained using a simple cross-entropy loss on these synthetic "sketches."

Key Insights and Ideas

  • Randomization as the "Secret Sauce": Human sketches vary wildly in detail. By randomizing the edge detection and thresholding parameters, the model learns features that are invariant to the specific "style" or "density" of a sketch.
  • Thinning is Essential: The authors found that without Non-Maximum Suppression (NMS), performance drops significantly. The network needs to see thin, binary lines to generalize to real pen-and-paper or stylus drawings.
  • Shape over Texture: The method succeeds because it forces the deep network to ignore color and texture entirely, focusing purely on the 2D geometry and spatial arrangement of parts. Pre-training on rBTE-transformed ImageNet data is far more effective for sketch recognition than starting with standard RGB-trained weights.

Results and Evaluation

The authors introduced Im4Sketch, a large-scale benchmark containing over 1 million natural images across 874 categories for training, and 80,582 sketches for evaluation.

Key performance metrics include:

  • State-of-the-Art on PACS: On the Image-to-Sketch task of the PACS benchmark, rBTE achieved 70.6% accuracy, significantly outperforming the previous best method, L2D (58.5%).
  • Massive Performance Boost: On the Sketchy dataset, a baseline model trained on RGB images achieves only ~11% accuracy when tested on sketches. The rBTE approach boosts this to ~50-60% without ever seeing a real sketch during training.
  • Scalability: The authors successfully demonstrated recognition across 874 classes, which is 2.5 times larger than the previous largest sketch recognition effort (DomainNet's 345 classes).

Conclusion

The rBTE approach demonstrates that the domain gap between natural images and sketches can be bridged through strategic edge augmentation. By focusing on shape and geometry while randomizing style, models can achieve high accuracy on human-drawn sketches without requiring expensive, manually-collected training data. While some domain gap persists, this method provides a scalable path forward for large-scale sketch recognition systems.

Summary updated

BibTeX
@inproceedings{efthymiadis2022edge,
  author = {Nikos Efthymiadis and Giorgos Tolias and Ondrej Chum},
  title = {{Edge Augmentation for Large-Scale Sketch Recognition without Sketches}},
  booktitle = {ICPR},
  year = {2022},
  url = {https://openreview.net/forum?id=vCkYxOCd1A3},
}
Figure