Context-Aware Chart Element Detection

Pengyu Yan, Saleem Ahmed, David Doermann · DOI

Abstract

As a prerequisite of chart data extraction, the accurate detection of chart basic elements is essential and mandatory. In contrast to object detection in the general image domain, chart element detection relies heavily on context information as charts are highly structured data visualization formats. To address this, we propose a novel method CACHED, which stands for Context-Aware Chart Element Detection, by integrating a local-global context fusion module consisting of visual context enhancement and positional context encoding with the Cascade R-CNN framework. To improve the generalization of our method for broader applicability, we refine the existing chart element categorization and standardized 18 classes for chart basic elements, excluding plot elements. Our CACHED method, with the updated category of chart elements, achieves state-of-the-art performance in our experiments, underscoring the importance of context in chart element detection. Extending our method to the bar plot detection task, we obtain the best result on the PMC test dataset.

Introduction

Automated data extraction from charts is a multi-step pipeline requiring precise element detection, optical character recognition (OCR), and data interpretation. The primary bottleneck in this pipeline is often the initial detection of basic elements such as axes, legends, and titles. Unlike general object detection tasks—where visual features like shape and color are often sufficient—chart element detection is inherently context-dependent.

Chart element detection objective and the 18 standardized classes.

In a chart, visually identical text blocks can serve entirely different semantic roles. A small block of text might be a tick label, a legend label, or part of a title depending solely on its spatial relationship to other elements. Standard detectors often struggle with this ambiguity. To resolve this, we propose that semantic identity in charts is defined by context: a tick label is defined by its proximity to a tick mark, and a legend label by its inclusion within a legend box.

Methodology

We introduce CACHED (Context-Aware Chart Element Detection), a framework built upon the Cascade R-CNN architecture with a Swin Transformer backbone. The core of our approach is the Local-Global Context Fusion Module, which addresses the limitations of standard detectors that view regions of interest (RoIs) in isolation.

Local-Global Context Fusion

  1. Visual Context Enhancement (VCE): This module extracts global feature maps from the entire chart image and fuses them with local RoI features. This allows the model to "see" the global layout while classifying a specific local element.
  2. Positional Context Encoding (PCE): Using a Transformer-based encoder, PCE processes the coordinates of all proposed bounding boxes. This enables the model to learn the "spatial grammar" of charts—for example, recognizing that x-axis labels typically appear below the plot area.
The CACHED architecture featuring the Local-Global Feature Fusion Module.

Refined Categorization

To improve generalization, we standardized a set of 18 classes for chart elements. We specifically separated x-axis and y-axis elements (e.g., "x-tick label" vs. "y-tick label") and introduced "structural area" labels like "legend area." This refined categorization forces the model to utilize positional context more effectively. Additionally, Focal Loss was implemented to manage the natural class imbalance found in chart datasets.

Experimental Results

Our method was evaluated using the PubMed Central (PMC) Chart Dataset, the Adobe Synthetic Dataset, and the Excel400K dataset for qualitative robustness testing.

  • State-of-the-Art Performance: On the ICPR 2022 Chart Competition (Task 2: Text Detection), CACHED achieved an Average IoU of 0.869, significantly outperforming the previous benchmark of 0.820.
  • Ablation Study: The inclusion of VCE and PCE modules improved the Average Precision (AP) from a baseline of 0.699 to 0.729, validating the importance of context fusion.
  • Bar Plot Detection: When extended to bar plot detection, CACHED achieved an F-measure of 89.30% (at IoU=0.5) on the PMC test set, establishing a new state-of-the-art result.

Conclusion

CACHED demonstrates that explicitly modeling spatial and visual context is essential for accurate chart element detection. By integrating local-global feature fusion and a refined categorization schema, our model overcomes the visual ambiguities inherent in structured data visualizations. Future work will focus on incorporating OCR results as semantic features and improving robustness against rotated text and complex hybrid chart-table layouts.

Summary updated

BibTeX
@misc{yan2023context,
  author = {Pengyu Yan and Saleem Ahmed and David Doermann},
  title = {{Context-Aware Chart Element Detection}},
  year = {2023},
  eprint = {2305.04151},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.04151},
}
Figure