ViRED: Prediction of Visual Relations in Engineering Drawings

Chao Gu, Ke Lin, Yiyang Luo, Jiahui Hou, Xiang‐Yang Li

TL;DR

This paper introduces ViRED, a novel vision-based model for predicting relationships between circuits and tables in electrical engineering drawings. By effectively integrating visual and structural information, ViRED achieves a remarkable 96% accuracy, significantly outperforming existing methods and enabling faster, more accurate understanding of complex technical diagrams.

What Problem Does This Paper Address?

Understanding engineering drawings, particularly electrical schematics, is crucial for industrial processes. These drawings often contain both visual circuit diagrams and textual tables describing parameters. The challenge lies in automatically linking specific circuits to their corresponding parameter tables. Existing document understanding methods heavily rely on text, making them ill-suited for these visually rich documents. Furthermore, standard visual relation detection techniques struggle to capture all possible circuit-table pairings within a single drawing due to their inherent task structure and limitations in handling variable numbers of entities. This gap hinders efficient automated analysis and reproduction of technical documentation.

Methods

ViRED is a three-part system designed to tackle this challenge:

  1. Vision Encoder: This component processes the entire engineering drawing image to extract rich visual features. The authors utilize a pre-trained Document Image Transformer (DiT) [31] as their vision encoder, leveraging its strong performance on visual document understanding tasks.
  2. Object Encoder: This module takes bounding box information and instance types (circuit or table) for detected entities and converts them into vectorial embeddings. It uses a convolutional neural network (CNN) to encode bounding box masks and combines these with learned "type embeddings" to represent each object.
  3. Relation Decoder: This is the core of ViRED. It employs a modified transformer decoder architecture. It first uses self-attention to allow object tokens to understand their relative positions. Then, a cross-attention mechanism fuses these object embeddings with the global image features from the vision encoder. Finally, a relation prediction model (a multi-layer perceptron) takes these fused features to predict whether a relationship exists between each circuit-table pair.

A key aspect of ViRED is its pretraining strategy. Due to the scarcity of annotated engineering drawing data, the model is first pretrained on the large-scale PubLayNet dataset [11]. This pretraining involves a task where the model predicts the category (table or circuit) of masked regions in document images, helping it learn general document layout understanding and positional cues.

Datasets

  • PubLayNet [11]: Used for pretraining the ViRED model. It's a large dataset of document images with bounding box and type annotations for various layout elements.
  • Proprietary Electrical Engineering Drawing Dataset: A self-annotated dataset created by the authors, containing 283 images, 4,566 entities (circuits and tables), and 2,112 relations. This dataset was used for finetuning and evaluation. It was split into 90% for training and 10% for evaluation.

Key Insights and Ideas

  • Vision-centric approach is crucial: For documents like electrical drawings, relying solely on text is insufficient. ViRED's success highlights the power of integrating visual features directly into relation prediction.
  • Transformer architecture excels: The use of transformer decoders for both object encoding and relation decoding allows for effective modeling of complex interactions and dependencies between visual entities.
  • Pretraining on general documents boosts performance: Leveraging large, publicly available datasets like PubLayNet for pretraining significantly improves the model's ability to understand visual features and positional information, even for domain-specific tasks.
  • Object type embeddings matter: Explicitly encoding whether an object is a circuit or a table helps the model differentiate entities and focus on relevant relationships, leading to better performance.
  • Efficiency is achievable: Despite its complexity, ViRED demonstrates rapid inference speeds, making it practical for real-world applications where processing numerous objects in a drawing is common.

Key Results

  • High Accuracy: ViRED achieved an impressive 96% accuracy on the task of relation prediction within the electrical engineering drawing dataset.
  • State-of-the-Art Comparison: Table I shows ViRED outperforming other visual relation detection methods like RVL-BERT, VTransE, and MBBR on their validation dataset.
  • Inference Speed: ViRED maintains a rapid inference speed even when dealing with drawings containing a large number of objects (up to 20), as illustrated in Figure 5, which plots FLOPs against the number of objects.

Limitations and Future Work

  • Dataset Size: While the authors created a custom dataset, the paper notes the scarcity of annotated data for relation detection in engineering drawings as a motivation for their pretraining strategy. Future work could involve expanding this dataset or exploring more advanced unsupervised/self-supervised learning techniques.
  • Generalizability: The current work focuses specifically on electrical engineering drawings. Extending ViRED to other types of technical diagrams (e.g., mechanical blueprints, architectural plans) would be a valuable next step.
  • Complexity of Relations: The paper primarily focuses on the existence of a relation. Future research could explore predicting the type or nature of the relation (e.g., "controls," "powers," "measures") for a more nuanced understanding.
  • Ablation Study Insights: The ablation studies (Table II and III) revealed that the choice of vision encoder and the inclusion of type embeddings and pretraining were critical for performance. The authors also noted that higher image resolutions had a diminishing return, suggesting a balance is needed.

Summary updated

Abstract

To accurately understand engineering drawings, it is essential to establish the correspondence between images and their description tables within the drawings. Existing document understanding methods predominantly focus on text as the main modality, which is not suitable for documents containing substantial image information. In the field of visual relation detection, the structure of the task inherently limits its capacity to assess relationships among all entity pairs in the drawings. To address this issue, we propose a vision-based relation detection model, named ViRED, to identify the associations between tables and circuits in electrical engineering drawings. Our model mainly consists of three parts: a vision encoder, an object encoder, and a relation decoder. We implement ViRED using PyTorch to evaluate its performance. To validate the efficacy of ViRED, we conduct a series of experiments. The experimental results indicate that, within the engineering drawing dataset, our approach attained an accuracy of 96 % in the task of relation prediction, marking a substantial improvement over existing methodologies. The results also show that ViRED can inference at a fast speed even when there are numerous objects in a single engineering drawing.
BibTeX
@misc{gu2024vired,
  author = {Chao Gu and Ke Lin and Yiyang Luo and Jiahui Hou and Xiang‐Yang Li},
  title = {{ViRED: Prediction of Visual Relations in Engineering Drawings}},
  year = {2024},
  eprint = {2409.00909},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.00909},
}

Loading related content...

Figure