Home

Awesome

CDeC-Net

PWC PWC

CDeC-Net: Composite Deformable Cascade Network for Table Detection in Document Images

Paper Link: ieeexplore | arXiv | Research Gate | CVIT, IIIT-H

Introduction

CDeC-Net is an end-to-end network for detecting tables in document images. The network consists of a multistage extension of Mask R-CNN with a dual backbone having deformable convolution for detecting tables varying in scale with high detection accuracy at higher IoU threshold. CDeC-Net achieves state-of-the-art results on various publicly available benchmark datasets. The code is implemented in PyTorch using <a href="https://github.com/open-mmlab/mmdetection">MMdetection</a> framework (Version 2.0.0).

Release Notes:

Oct 10, 2020: Our paper has been accepted to ICPR 2020 as oral paper.

Setup

<b>Dependencies</b><br> Python = 3.6+ <br> PyTorch = 1.4.0<br> Torchvision = 0.5.0<br> Cuda = 10.0<br> MMdetection = 2.0.0<br> mmcv = 0.5.4<br>

  1. Clone this repository
git clone https://github.com/mdv3101/CDeCNet
  1. Install the require dependencies
pip install torch==1.4.0 torchvision==0.5.0
cd CDecNet/
pip install -r requirements/build.txt
pip install "git+https://github.com/open-mmlab/cocoapi.git#subdirectory=pycocotools"
pip install -v -e .

Please follow install.md for detailed installation steps.

Training

  1. Create a folder 'dataset' in the CDeCNet and put your data into this folder. Your dataset must be in MS-Coco format. The directory structure should be:
dataset
  ├── coco
  | ├── annotations
  | ├── train2014
  | ├── val2014
  | ├── logs
  1. Create a folder 'model' in the CDeCNet and put the pre-trained model on MS-Coco into this directory. The model file can be downloaded from the drive

  2. Set load_from= /path/of/pre-trained/model in default_runtime.py

  3. To train a model on CDeC-Net, use the following commnand

python -u tools/train.py configs/dcn/db_cascade_mask_rcnn_x101_fpn_dconv_c3-c5_1x_coco.py --work-dir dataset/coco/logs/
<br> Note that step 2 and 3 are optional. If you want to train a model from scratch, then you can skip these two steps. (Training a model from scratch will take larger time to converge)

Evaluation

To evaluate the trained model, run the following command

python tools/test.py configs/dcn/db_cascade_mask_rcnn_x101_fpn_dconv_c3-c5_1x_coco.py dataset/coco/logs/latest.pth \
    --format-only --options "jsonfile_prefix=evaluation_result"

Details about various training and evaluation methods can be found in getting_started.md

Demo

To run inference on single image, use the image_demo.py file by running the following command

python demo/image_demo.py demo_image.jpg configs/dcn/db_cascade_mask_rcnn_x101_fpn_dconv_c3-c5_1x_coco.py dataset/coco/logs/latest.pth \
    --score-thr 0.95 --output-img 'output_demo.jpg'

CDeCNet Results

  1. Comparison between CDeC-Net and state-of-the-art techniques on the existing benchmark datasets.
DatasetMethodPrecisionRecallF1mAPCheckpoint
ICDAR-2013DeCNT <br>CDeC-Net0.996 <br> 1.0000.996 <br> 1.0000.996 <br> 1.000- <br> 1.000<br> model
ICADR-2017Yolov3<br>CDeC-Net0.968 <br> 0.9240.975<br> 0.9700.971 <br> 0.947- <br> 0.912<br> model
ICADR -2019TableRadar<br>CDeC-Net0.940 <br> 0.9340.950 <br> 0.9530.945 <br> 0.944- <br> 0.922<br> model
UNLVGOD <br> CDeC-Net0.910 <br> 0.9250.946 <br> 0.9520.928 <br> 0.938- <br> 0.912<br> model
MarmotDeCNT <br> CDeC-Net0.946 <br> 0.9300.849 <br> 0.9750.895 <br> 0.952- <br> 0.911<br> model
TableBankLi et al. <br> CDeC-Net0.975 <br> 0.9790.987 <br> 0.9950.981 <br> 0.987- <br> 0.976<br> model
PubLayNetM-RCNN <br> CDeC-Net-<br> 0.970-<br> 0.988-<br> 0.9780.960 <br> 0.967<br> model
  1. Comparison between our single model CDeC-Net‡ and state-of-the-art techniques on existing benchmark datasets.
DatasetMethodPrecisionRecallF1mAP
ICDAR-2013DeCNT <br>CDeC-Net‡0.996 <br> 0.9420.996 <br> 0.9930.996 <br> 0.968- <br> 0.942
ICADR-2017Yolov3<br>CDeC-Net‡0.968 <br> 0.8990.975<br> 0.9690.971 <br> 0.934- <br> 0.880
ICADR -2019TableRadar<br>CDeC-Net‡0.940 <br> 0.9300.950 <br> 0.9710.945 <br> 0.950- <br> 0.913
UNLVGOD <br> CDeC-Net‡0.910 <br> 0.9150.946 <br> 0.9700.928 <br> 0.943- <br> 0.912
MarmotDeCNT <br> CDeC-Net‡0.946 <br> 0.7790.849 <br> 0.9430.895 <br> 0.861- <br> 0.756
TableBankLi et al. <br> CDeC-Net‡0.975 <br> 0.9700.987 <br> 0.9900.981 <br> 0.980- <br> 0.965
PubLayNetM-RCNN <br> CDeC-Net‡- <br> 0.975- <br> 0.993- <br> 0.9840.960 <br> 0.978

Note: Our single model CDeC-Net‡ is trained on IIIT-AR-13K dataset and fine-tuned with training set of respective datasets (if available). The base model trained on IIIT-AR-13K dataset can be downloaded from the drive

Qualitative Results: Table Detection by CDeC-Net

<img src="imgs/qualitative_13_19.png" height="350"/> <br> <img src="imgs/qualitative_17_marmot.png" height="350"/> <br>

Issue

Kindly go through the various tutorails and documentation provided in docs folder. <br> Most of the common issues were already solved in MMdetection official repo's Issue Page. We strongly suggest to go through it before raising a new issue.

Citation

If you find this work useful for your research, please cite our paper

@inproceedings{agarwal2021cdec,
  title={Cdec-net: Composite deformable cascade network for table detection in document images},
  author={Agarwal, Madhav and Mondal, Ajoy and Jawahar, CV},
  booktitle={2020 25th International Conference on Pattern Recognition (ICPR)},
  pages={9491--9498},
  year={2021},
  organization={IEEE}
}

Contact

CDeCNet was developed by Madhav Agarwal, Dr. Ajoy Mondal and Dr. C.V. Jawahar. <br> For any query, feel free to drop a mail to Madhav Agarwal by explicitly mentioning 'CDeCNet' in the subject.