ChartDETR: A Multi-shape Detection Network for Visual Chart Recognition

Wenyuan Xue, Dapeng Chen, Baosheng Yu, Yifei Chen, Sai Zhou, Wei PengarXiv 2023 · DOI

Introduction

Chart recognition is the process of converting visual chart images back into structured data tables. While humans perform this task effortlessly, it remains a significant challenge for computer vision systems. Traditional "bottom-up" methods rely on detecting individual keypoints (e.g., bar corners or line vertices) and then applying hand-crafted heuristic rules to group them into coherent data series. This approach is prone to errors in complex scenarios, such as overlapping bars or crossing lines, and lacks the flexibility to handle diverse chart types within a single framework.

ChartDETR addresses these limitations by introducing an end-to-end transformer-based model. By treating data elements—such as bars, lines, and pie slices—as "query groups," ChartDETR predicts all keypoints of a shape simultaneously. This "set prediction" approach eliminates the need for error-prone post-processing and achieves state-of-the-art performance across multiple benchmarks.

The end-to-end pipeline of ChartDETR for extracting data tables from document images.

Methodology

The architecture of ChartDETR is built upon the DEtection TRansformer (DETR) framework, modified to accommodate the multi-point geometry of chart elements.

Query Grouping Decoder

The primary innovation is the Query Grouping Decoder. Unlike standard DETR, which uses a single query to predict a bounding box, ChartDETR employs groups of queries. For a chart containing up to $M$ data elements, where each element is defined by $N$ keypoints, the model utilizes $M \times N$ queries. Each group of $N$ queries is dedicated to reconstructing one specific data element.

Within each group, the first query acts as a "pivot," predicting the existence probability of the entire shape. The remaining queries in the group focus on regressing the spatial coordinates of the individual keypoints.

The Query Grouping Decoder architecture, showing how groups of queries are processed to predict multi-point shapes.

Unified Shape Representation

To handle various chart types (bar, line, pie) in a single model, ChartDETR uses a unified keypoint-based representation:

  • Bars: Defined by 2 keypoints (top-left and bottom-right).
  • Pie Slices: Defined by 3 keypoints (the center point and two arc endpoints).
  • Lines: Represented by a sequence of "knee points" or vertices.

For line charts, which often have a variable number of vertices, the authors implemented a "Duplicated Keypoint Matching" strategy. This method uses nearest interpolation to match ground-truth points to the model's fixed-size query groups during training, ensuring consistent supervision.

Training Strategies

The model employs a Hybrid Matching training scheme, combining one-to-one matching (for unique object detection) with one-to-many matching. This dual approach provides richer supervision signals, accelerating convergence and enhancing final accuracy.

Experiments and Results

ChartDETR was evaluated on three large-scale datasets: Adobe Synthetic, ExcelChart400k, and LINEEX430k.

  • Adobe Synthetic: The model achieved an F1 score of 0.98, a massive improvement over the previous state-of-the-art of 0.71.
  • ExcelChart400k: It reached SOTA scores of 0.97 for pie charts and 0.923 for bar charts.
  • Line Detection: On the LINEEX430k dataset, ChartDETR improved the Object Keypoint Similarity ($OKS_{str}$) F1 score by 14.4% compared to existing methods.

Qualitative analysis demonstrates the model's robustness, accurately identifying tiny pie slices (representing 1% of data) and correctly locating the "invisible" center points in donut charts. The authors also noted that using a high-resolution backbone like HRNet significantly improved performance on dense bar charts.

Conclusion

ChartDETR represents a paradigm shift in visual chart recognition. By moving from point-wise detection to group-wise set prediction, it overcomes the grouping errors that plagued previous systems. While challenges remain regarding superfluous points in straight lines, ChartDETR sets a new standard for accuracy and generality in automated data extraction from charts.

Summary updated

BibTeX
@misc{xue2023chartdetr,
  author = {Wenyuan Xue and Dapeng Chen and Baosheng Yu and Yifei Chen and Sai Zhou and Wei Peng},
  title = {{ChartDETR: A Multi-shape Detection Network for Visual Chart Recognition}},
  year = {2023},
  eprint = {2308.07743},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.07743},
}
Figure