Deep Vectorization of Technical Drawings

Vage Egiazarian, Oleg Voynov, Alexey Artemov, Denis Volkhonskiy, Aleksandr Safin, Maria Taktasheva, Denis Zorin, Evgeny Burnaev · DOI

TL;DR

This paper introduces a novel deep learning-based system for converting raster technical drawings (like floor plans) into precise vector representations. It combines a learned image cleaning stage with a transformer network for primitive estimation and an optimization process for refinement, outperforming existing methods in both accuracy and compactness.

What Problem Does This Paper Address?

Technical drawings, such as architectural plans and engineering schematics, are often most useful in a vector format. Vector representations are scale-independent, compact, and allow for easy editing and semantic structuring. However, many technical drawings exist only in raster (image) form, due to being old, hand-drawn, or only available as hard copies. Reconstructing these into vector formats, a process called vectorization, is crucial but challenging. Existing methods often struggle to balance fidelity to the original image with the creation of a compact, editable vector representation, or they require significant manual tuning.

Methods

The proposed method is a four-stage pipeline:

  1. Preprocessing (Deep Learning-based Cleaning): A U-Net-based convolutional neural network (CNN) is used to clean the input raster image. This stage removes background noise, adjusts contrast, and importantly, infills missing parts of lines. This is framed as a semantic segmentation task.
  2. Primitive Estimation (Transformer Network): The cleaned image is divided into patches. For each patch, a ResNet-based encoder extracts features, which are then fed into a Transformer decoder. This network estimates initial vector primitives (line segments and quadratic Bézier curves) along with their confidence scores.
  3. Primitive Refinement (Optimization): An iterative optimization process refines the estimated primitives. This is based on an energy functional inspired by electrostatic interactions, where primitives are treated as positively charged entities and filled pixels as negatively charged ones. This encourages primitives to align with and cover the raster image while also repelling each other to avoid overlaps.
  4. Merging (Heuristic Algorithm): Primitives from all patches are merged into a single, coherent vector drawing. For lines, this involves building a graph of close and collinear primitives, fitting connected components with least-squares lines, and snapping endpoints. For Bézier curves, pairs of curves are iteratively replaced by a single fitted curve if their parameters are sufficiently close.

Datasets

  • Synthetic Data: Renderings of vector line drawings were used for training.
  • PFP Vector Floor Plan Dataset: A dataset of 1554 real-world architectural floor plans, used for training and evaluation.
  • ABC Vector Mechanical Parts Dataset: Approximately 10,000 vector images generated by projecting 3D CAD models, used for training and evaluation.
  • Degraded Line Drawings (DLD) Dataset: A newly compiled dataset of 81 photos and scans of floor plans, manually cleaned and refined to serve as raster targets for evaluating the system on real-world noisy images.

Key Insights and Ideas

  • Deep Learning for Cleaning is Crucial: The paper emphasizes that a learned preprocessing step is vital for handling real-world noisy images, significantly improving the input quality for subsequent vectorization stages.
  • Transformer for Primitive Estimation: Using a Transformer architecture allows the model to estimate a variable number of primitives per patch, adapting to local image complexity.
  • Physics-Inspired Optimization: The use of an energy functional based on electrostatic interactions provides a principled way to refine primitive shapes and positions, balancing coverage, alignment, and non-overlap.
  • Patch-based Processing with Merging: Processing images in patches allows for efficient parallelization and robustness, while a dedicated merging step ensures global coherence.
  • Trade-off Between Accuracy and Compactness: The paper acknowledges the inherent trade-off between achieving high fidelity and minimizing the number of primitives, and their method aims to find a good balance.

Key Results

  • Quantitative Performance: The proposed method significantly outperforms existing methods (FvS, CHD, PVF) on the PFP and ABC datasets across various metrics like IoU, Hausdorff distance (dH), and Mean Minimal Deviation (dM). For example, on the PFP dataset, their IoU is 86/88% (with predicted width) compared to PVF's 60%.
  • Qualitative Performance: Visual comparisons show that the method produces cleaner, more accurate, and more compact vector representations, especially on noisy and degraded images.
  • Preprocessing Effectiveness: The learned preprocessing network achieves high IoU and PSNR scores, outperforming existing methods like MS [38] in preserving straight and repeated lines.
  • Computational Efficiency: While the refinement step is iterative, the paper shows their method can achieve comparable IoU values to prior work in significantly less time.

Limitations and Future Work

  • Generalization to Other Drawing Types: While the system shows reasonable results on cartoon drawings, a proper extension to different types of drawings would require corresponding training datasets and potentially modifications to the refinement step for rough sketches.
  • Trade-off in Postprocessing: The postprocessing (merging) step, while reducing the number of primitives, can slightly deteriorate other metrics due to the inherent trade-off between compactness and accuracy.
  • Future Directions: The authors suggest that modifications to the preprocessing network, the optimization functional, and integration with OCR systems could enable applications like wireframe extraction from photos, sketch vectorization, and text annotation separation.

Summary updated

BibTeX
@inproceedings{egiazarian2020deep,
  author = {Vage Egiazarian and Oleg Voynov and Alexey Artemov and Denis Volkhonskiy and Aleksandr Safin and Maria Taktasheva and Denis Zorin and Evgeny Burnaev},
  title = {{Deep Vectorization of Technical Drawings}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58601-0\_35},
}
Figure