/ Модель

Характеристики

Лицензия
MIT
Библиотека
mmdetection
Опубликована
29 окт 2026

ChartDete

Поиск объектовИзображение → bounding_boxes4 профессии

CACHED — детектор, который находит структурные элементы научных диаграмм для последующего извлечения данных.

0скачиваний за 30 дней0лайковвеса обновлены29 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

CACHED (Context-Aware Chart Element Detection) — модель обнаружения элементов диаграмм, разработанная Pengyu Yan, Saleem Ahmed и David Doermann из University at Buffalo и представленная на ICDAR 2023. Репозиторий содержит исходные чекпойнты статьи: основной детектор 18 классов и отдельную версию, дообученную для обнаружения столбцов на диаграммах. Основной чекпойнт использует Cascade R-CNN с backbone Swin-T и FPN, дополненными модулями визуального и позиционного контекста.

Модель находит области диаграммы, заголовки и подписи осей, деления и подписи шкал, элементы легенды и другие структурные элементы. Она предназначена для научных диаграмм и может служить первым этапом извлечения данных из графиков. Обучение проводилось на диаграммах из научных статей PubMed Central; лицензия — MIT. Для запуска нужны код ChartDete и совместимая сборка MMDetection 2.x.

Детектор не распознаёт текст и не извлекает сами значения: OCR в него не входит, а основной 18-классовый вариант не обнаруживает линии и точки данных. Отдельный чекпойнт находит только столбцы. Качество может снижаться на инфографике, дашбордах и графиках с прикреплёнными таблицами.

Сценарии применения

  • поиск заголовков и областей графика на изображении диаграммы
  • обнаружение подписей осей, делений и отметок шкалы
  • поиск легенды и подписей значений на графике
  • локализация столбцов отдельным специализированным чекпойнтом
  • подготовка областей диаграммы для последующей обработки OCR

Ограничения

Модель обучена на научных диаграммах PubMed Central, поэтому её точность может снижаться на инфографике, дашбордах и графиках с таблицами. Она не выполняет OCR и не обнаруживает линии или точки данных; отдельный чекпойнт распознаёт только столбцы.

Для каких профессий подходит4

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

CACHED: Context-Aware Chart Element Detection (ICDAR 2023)

[!NOTE] This is the official model release of CACHED from 2023. The paper was published at ICDAR 2023 (arXiv: May 2023). The weights here are the original checkpoints from the 2023 paper, unchanged. They were uploaded to Hugging Face in October 2026 only to make them easier to download. Before that, they were available only through Google Drive links on GitHub. This is not a new model, a new version, or new work.

Pengyu Yan*, Saleem Ahmed*, David Doermann (*equal contribution). University at Buffalo.

Overview

Detecting the basic elements of a chart (axis titles, tick labels, tick marks, legend entries, and so on) is the first step of chart data extraction. Unlike objects in natural images, many chart elements look alike and differ only in their role. A text block can be a tick label, a legend label, or a value label depending on where it sits and what surrounds it. Chart element detection therefore depends heavily on context.

CACHED (Context-Aware CHart Element Detection) adds a local-global context fusion module between the RoI heads of a Cascade R-CNN with a Swin-Transformer backbone:

  • Visual context enhancement (VCE) pools the whole feature pyramid into a global feature map and fuses it with each RoI feature (with an SE block), so every region sees the full chart.
  • Positional context encoding (PCE) runs a Transformer over the normalized box coordinates of all proposals, so the model learns the layout patterns of charts (for example, x tick labels sit below the x tick marks).
  • Focal loss and balanced L1 loss handle the strong class imbalance of chart elements.

The paper also refines the chart element categories into 18 classes and releases an updated PMC dataset in COCO format: Pengyu965/ChartDete-PMC2022.

CACHED framework

Checkpoints in this repository

All checkpoints are the original MMDetection 2.x files from the paper. Each folder holds a config and its checkpoint, in the same layout as work_dirs/ in the GitHub repo. The .pth files also contain the optimizer state, which is why they are large.

FolderFileModelClassesTest AP (paper)Test AP (re-evaluated)
cascade_rcnn_swin-t_fpn_LGF_VCE_PCE_coco_focalsmoothloss/checkpoint.pthCACHED (Cascade R-CNN, Swin-T FPN, VCE + PCE, focal + balanced L1 loss)180.7290.729
cascade_rcnn_swin-t_fpn_LGF_VCE_PCE_coco_focalsmoothloss/bar_checkpoint.pthCACHED, fine-tuned for bar detection1 (bar)see below–
cascade_rcnn_swin-t-p4-w7_fpn_1x_coco/checkpoint.pthCascade R-CNN, Swin-T FPN (baseline)180.6990.699
cascade_rcnn_x101_64x4d_fpn_20e_coco/checkpoint.pthCascade R-CNN, ResNeXt-101 FPN (baseline)180.6960.696
faster_rcnn_x101_64x4d_fpn_2x_coco/checkpoint.pthFaster R-CNN, ResNeXt-101 FPN (baseline)180.6650.663
detr_finetune/checkpoint.pthDETR (baseline)180.5360.536

"Test AP" is COCO box AP on the test split (ICPR 2022 PMC split 3, 381 images) of the refined PMC dataset. The "re-evaluated" column was measured in October 2026 with the files in this repo and tools/test.py (commands below), to confirm that the uploaded checkpoints reproduce the paper. The intermediate ablation models (PCE only, VCE + PCE without the loss changes) were not released.

The bar detector was fine-tuned from CACHED on the bar-chart subset of PMC. The paper reports it with the chart competition metric (table below). For reference, its COCO box AP on baronly_test.json is 0.692.

Classes

The 18-class model detects, in this order (index = position in the model output):

#Class#Class#Class
0x_title (x-axis title)6chart_title12legend_area
1y_title (y-axis title)7x_tick (x tick mark)13mark_label
2plot_area8y_tick (y tick mark)14value_label
3other9legend_patch (legend marker)15y_axis_area
4xlabel (x tick label)10legend_label16x_axis_area
5ylabel (y tick label)11legend_title17tick_grouping

See the dataset card for definitions.

Quick start

These checkpoints need the ChartDete code. It is a fork of MMDetection 2.28 that implements the CACHED modules (CascadeRoIHead_LGF, LocalGlobal_Context_Fuser, BboxEncoder, ...). They cannot be loaded with transformers, upstream MMDetection, or MMDetection 3.x. Hugging Face only hosts the files.

1. Install

The models were built and tested with PyTorch 1.13.1 and CUDA 11.7:

conda create -n ChartDete python=3.8 -y
conda activate ChartDete

pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 --extra-index-url https://download.pytorch.org/whl/cu117
pip install mmcv-full==1.7.2 -f https://download.openmmlab.com/mmcv/dist/cu117/torch1.13/index.html

git clone https://github.com/pengyu965/ChartDete
cd ChartDete
pip install -v -e .
pip install huggingface_hub

Use mmcv-full 1.x (here 1.7.2). The code is not compatible with mmcv 2.x.

2. Detect chart elements

from huggingface_hub import hf_hub_download
from mmdet.apis import init_detector, inference_detector

repo_id = "Pengyu965/ChartDete"
name = "cascade_rcnn_swin-t_fpn_LGF_VCE_PCE_coco_focalsmoothloss"

config = hf_hub_download(repo_id, f"{name}/{name}.py")
checkpoint = hf_hub_download(repo_id, f"{name}/checkpoint.pth")
model = init_detector(config, checkpoint, device="cuda:0")  # or device="cpu"

image = hf_hub_download(repo_id, "assets/sample.jpg")  # or the path to your own chart image
result = inference_detector(model, image)  # one (N, 5) array per class: [x1, y1, x2, y2, score]

for class_name, dets in zip(model.CLASSES, result):
    for x1, y1, x2, y2, score in dets[dets[:, 4] > 0.3]:
        print(f"{class_name:14s} {score:.2f}  [{x1:.0f}, {y1:.0f}, {x2:.0f}, {y2:.0f}]")

model.show_result(image, result, score_thr=0.3, out_file="sample_result.jpg")

Example detection result

3. Detect bars

The bar detector lives in the same folder and outputs a single class, bar:

config = hf_hub_download(repo_id, f"{name}/{name}_bar.py")
checkpoint = hf_hub_download(repo_id, f"{name}/bar_checkpoint.pth")
bar_model = init_detector(config, checkpoint, device="cuda:0")

bars = inference_detector(bar_model, image)[0]  # (N, 5): [x1, y1, x2, y2, score]
print(len(bars[bars[:, 4] > 0.3]), "bars")

4. Use the checkpoints with the repo scripts

To place the checkpoints where the repo configs and scripts expect them (work_dirs/), run this from the repo root:

# CACHED only (element + bar detector, about 3.1 GB)
hf download Pengyu965/ChartDete --include "cascade_rcnn_swin-t_fpn_LGF_VCE_PCE_coco_focalsmoothloss/*" --local-dir work_dirs

# or all checkpoints, including the baselines (about 6.3 GB)
hf download Pengyu965/ChartDete --include "*/*.py" "*/*.pth" --local-dir work_dirs

Then download the test data from Pengyu965/ChartDete-PMC2022 and evaluate. This reproduces the AP in the table above:

hf download Pengyu965/ChartDete-PMC2022 pmc_coco.zip --repo-type dataset --local-dir data/pmc_2022
unzip -oq data/pmc_2022/pmc_coco.zip -d data/pmc_2022/

python tools/test.py \
    work_dirs/cascade_rcnn_swin-t_fpn_LGF_VCE_PCE_coco_focalsmoothloss/cascade_rcnn_swin-t_fpn_LGF_VCE_PCE_coco_focalsmoothloss.py \
    work_dirs/cascade_rcnn_swin-t_fpn_LGF_VCE_PCE_coco_focalsmoothloss/checkpoint.pth --eval bbox

Training follows the usual MMDetection routine (tools/train.py or tools/dist_train.sh with a config from configs/). See the GitHub repo for details.

Results (from the ICDAR 2023 paper)

COCO evaluation on the refined PMC dataset (test split). The first four rows are standard detectors trained by the authors. The last three rows are the CACHED ablation, and the last row is the released CACHED checkpoint.

ModelContext moduleBackboneAPAP50AP75APSAPMAPL
DETR––0.5360.7620.5720.3840.5550.809
Faster R-CNN–ResNeXt101-FPN0.6650.8150.7370.5570.6970.827
Cascade R-CNN–ResNeXt101-FPN0.6960.8250.7590.5790.7250.899
Cascade R-CNN–SwinT-FPN0.6990.8380.7720.5890.7320.885
Cascade R-CNNPCESwinT-FPN0.7080.8420.7750.5910.7420.903
Cascade R-CNNVCE + PCESwinT-FPN0.7130.8510.7860.5970.7410.909
CACHED (Cascade R-CNNL)VCE + PCESwinT-FPN0.7290.8450.7900.6020.7630.939

L with focal loss and balanced L1 loss.

ICPR 2022 CHART-Infographics competition (original PMC categories; CACHED predictions mapped back to the competition format):

MethodTask 2: text detection (avg. IoU)Task 3: text role classification (F-measure)
six_seven_four0.435–
IIIT_CVIT_Chart_Understanding0.7900.821
Ystar0.810–
UB-ChartAnalysis0.8200.736
CACHED0.8690.787

Bar detection on the PMC test set (F-measure at different IoU thresholds, and the chart competition score). The baseline numbers are from Ma et al. (2021).

ModelIoU=0.5IoU=0.7IoU=0.9Score_a
Faster R-CNN + FPN85.8178.0531.3089.65
Cascade R-CNN + FPN86.9283.5355.3291.76
CACHED (bar)89.3088.7376.9493.75

Limitations

  • The models were trained on real-world charts from scientific articles (PubMed Central). Accuracy may drop on other chart styles, such as infographics, dashboards, or charts with attached tables.
  • The element detector finds chart elements outside the data marks. It does not detect lines, points, or other data marks, and it does not read text (no OCR). Only the bar detector detects data marks, and only bars.
  • The code requires MMDetection 2.x with mmcv-full 1.x.

License

The code and checkpoints are released under the MIT license, the same as the GitHub repo. The models were trained on the PMC dataset of the ICPR 2022 CHART-Infographics competition, which is licensed under CC BY-NC-SA 4.0.

Citation

@inproceedings{yan2023cached,
  title     = {Context-Aware Chart Element Detection},
  author    = {Yan, Pengyu and Ahmed, Saleem and Doermann, David},
  booktitle = {Document Analysis and Recognition - ICDAR 2023},
  pages     = {218--233},
  year      = {2023},
  publisher = {Springer Nature Switzerland},
  doi       = {10.1007/978-3-031-41676-7_13}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · mmdetection · object-detection

Можно запустить

Подбираем GPU…

Ревизия весов
5e862ab

0 моделей