Skip to content

Our official implementation for the journal paper 'Swin-chart: An efficient approach for chart classification,' published in Pattern Recognition Letters.

License

Notifications You must be signed in to change notification settings

moured/Swin-chart

Repository files navigation

📊 Swin-Chart

Swin-chart: An efficient approach for chart classification

Volume 185, September 2024, Pages 203-209

visits

🏡 About

Swin-Chart is a Swin Transformer-based model for chart classification across various datasets. It achieved first place in the chart classification task at the ICDAR 2023 CHART Infographics competition.

🔎 Introduction

We introduce Swin-Chart, a Swin Transformer-based model with finetuning and a greedy weight-averaging strategy for chart image classification. The pre-trained Swin Transformer captures both local and global feature dependencies, and after finetuning on chart image datasets, the best model weights are averaged to achieve optimal performance. Experiments on five chart image datasets demonstrate that Swin-Chart outperforms state-of-the-art models across all datasets.

📝 Catalog

  • Training Code
  • Testing Code
  • Swin-Chart Checkpoints (soon)
    • Best Swin-Base Checkpoint
    • Greedy Soup Checkpoint (soon)
  • Checkpoint Averaging Code (soon)

📦 Installation

1. Clone the repository

git clone [https://github.com/yufanchen96/RoDLA.git](https://github.com/moured/Swin-chart.git)
cd Swin-chart

2. Create a conda virtual environment

# create virtual environment
conda create -n swinchart python=3.8 -y
conda activate swinchart

3. Install Dependencies

pip install -r requirements.txt 

📂 Dataset Preparation

Download the UB-PMC dataset.

Prepare the dataset for by splitting it into 80% for training and 20% for testing. Modify the dataset paths in ICPR_split.sh, then execute the following command:

bash ICPR_split.sh

🚀 Quick Start

Training

1. Modify the train/test dataset split paths and model selection in config.json, You can choose between baseline or large models.

"model_name": "swin_base_patch4_window7_224"

OR

"model_name": "swin_large_patch4_window7_224"

2. Start Training

python train.py

Evaluate the Swin-Chart model

You can download our best model from the Releases page.

1. Modify the test dataset path and model checkpoint in test.sh

2. Start Testing

bash test.sh

🌳 Citation

If you find this code useful for your research, please consider citing:

@article{DHOTE2024203,
title = {Swin-chart: An efficient approach for chart classification},
journal = {Pattern Recognition Letters},
volume = {185},
pages = {203-209},
year = {2024},
issn = {0167-8655},
doi = {https://doi.org/10.1016/j.patrec.2024.08.012},
url = {https://www.sciencedirect.com/science/article/pii/S0167865524002447},
author = {Anurag Dhote and Mohammed Javed and David S. Doermann},
keywords = {Chart classification, Swin transformer, Deep learning, Scientific documents},
}

About

Our official implementation for the journal paper 'Swin-chart: An efficient approach for chart classification,' published in Pattern Recognition Letters.

Resources

License

Stars

Watchers

Forks

Packages

No packages published