{"id":13589493,"url":"https://github.com/DevashishPrasad/CascadeTabNet","last_synced_at":"2025-04-08T09:33:08.051Z","repository":{"id":37526849,"uuid":"255967725","full_name":"DevashishPrasad/CascadeTabNet","owner":"DevashishPrasad","description":"This repository contains the code and implementation details of the CascadeTabNet paper \"CascadeTabNet: An approach for end to end table detection and structure recognition from image-based documents\"","archived":false,"fork":false,"pushed_at":"2021-08-27T15:51:11.000Z","size":16953,"stargazers_count":1516,"open_issues_count":95,"forks_count":431,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-04-01T07:46:32.496Z","etag":null,"topics":["table-detection","table-detection-using-deep-learning","table-recognition","table-structure-recognition"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevashishPrasad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-15T15:59:13.000Z","updated_at":"2025-03-28T16:04:00.000Z","dependencies_parsed_at":"2022-07-12T16:21:44.314Z","dependency_job_id":null,"html_url":"https://github.com/DevashishPrasad/CascadeTabNet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevashishPrasad%2FCascadeTabNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevashishPrasad%2FCascadeTabNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevashishPrasad%2FCascadeTabNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevashishPrasad%2FCascadeTabNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevashishPrasad","download_url":"https://codeload.github.com/DevashishPrasad/CascadeTabNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247809964,"owners_count":20999816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["table-detection","table-detection-using-deep-learning","table-recognition","table-structure-recognition"],"created_at":"2024-08-01T16:00:30.839Z","updated_at":"2025-04-08T09:33:08.017Z","avatar_url":"https://github.com/DevashishPrasad.png","language":"Python","readme":"# CascadeTabNet\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/cascadetabnet-an-approach-for-end-to-end/table-detection-on-icdar2013-1)](https://paperswithcode.com/sota/table-detection-on-icdar2013-1?p=cascadetabnet-an-approach-for-end-to-end)\n[![PWC](https://img.shields.io/badge/PyTorch-v1.4-blue)](https://pytorch.org/)\n[![PWC](https://img.shields.io/badge/%20mmdetection%20-v1.2-blue)](https://github.com/open-mmlab/mmdetection)\n\n\u003e **CascadeTabNet: An approach for end to end table detection and structure recognition from image-based documents**\u003cbr\u003e\n\u003e [Devashish Prasad](https://github.com/DevashishPrasad),\n\u003e [Ayan Gadpal](https://github.com/ayangadpal),\n\u003e [Kshitij Kapadni](https://github.com/kshitijkapadni),\n\u003e [Manish Visave](https://github.com/ManishDV),\n\u003e \u003cbr\u003e\n\u003e [CVPR Link of Paper](http://openaccess.thecvf.com/content_CVPRW_2020/papers/w34/Prasad_CascadeTabNet_An_Approach_for_End_to_End_Table_Detection_and_CVPRW_2020_paper.pdf)\u003cbr\u003e\n\u003e [arXiv Link of Paper](https://arxiv.org/abs/2004.12629)\u003cbr\u003e\n\u003e \u003ca href=\"results.pdf\"\u003eSupplementary file\u003c/a\u003e \u003cbr\u003e\n\u003e The paper was presented (Orals) at [CVPR 2020 Workshop on Text and Documents in the Deep Learning Era](https://cvpr2020text.wordpress.com/)\u003cbr\u003e\n\n\n\u003e Virtual Oral Presentation [YOUTUBE VIDEO](https://www.youtube.com/watch?v=6rovEyWKZw8)\n\u003e \u003cbr\u003e Cascadetabnet Demo by Bhavesh Bhatt [YOUTUBE VIDEO](https://www.youtube.com/watch?v=bFahxVX9Ka0)\n\u003cimg align=\"right\" src=\"imgs/CVPR Teaser.gif\" /\u003e\n\n## 1. Introduction\nCascadTabNet is an automatic table recognition method for interpretation of tabular data in document images. We present an improved deep learning-based end to end approach for solving both problems of table detection and structure recognition using a single Convolution Neural Network (CNN) model. CascadeTabNet is a Cascade mask Region-based CNN High-Resolution Network (Cascade mask R-CNN HRNet) based model that detects the regions of tables and recognizes the structural body cells from the detected tables at the same time. We evaluate our results on ICDAR 2013, ICDAR 2019 and TableBank public datasets. We achieved 3rd rank in ICDAR 2019 post-competition results for table detection while attaining the best accuracy results for the ICDAR 2013 and TableBank dataset. We also attain the highest accuracy results on the ICDAR 2019 table structure recognition dataset. \n\n\u003cimg src=\"imgs/main_res.png\"/\u003e\n\n## 2. Setup\n\u003cb\u003eModels are developed in Pytorch based \u003ca href=\"https://github.com/open-mmlab/mmdetection\"\u003eMMdetection\u003c/a\u003e framework (Version 1.2)\u003c/b\u003e\n\u003cbr\u003e\n\n\u003cpre\u003e\npip install -q mmcv terminaltables\ngit clone --branch v1.2.0 'https://github.com/open-mmlab/mmdetection.git'\ncd \"mmdetection\"\npip install -r \"/content/mmdetection/requirements/optional.txt\"\npython setup.py install\npython setup.py develop\npip install -r {\"requirements.txt\"}\npip install pillow==6.2.1 \npip install mmcv==0.4.3\n\u003c/pre\u003e\n\n\u003cb\u003eCode is developed under following library dependencies\u003c/b\u003e \u003cbr\u003e\n\nPyTorch = 1.4.0\u003cbr\u003e\nTorchvision = 0.5.0\u003cbr\u003e\nCuda = 10.0\u003cbr\u003e\n\n\u003cpre\u003e\npip install torch==1.4.0+cu100 torchvision==0.5.0+cu100 -f https://download.pytorch.org/whl/torch_stable.html\n\u003c/pre\u003e\n\n**If you are using Google Colaboratory (Colab), Then you need add**\n```\nfrom google.colab.patches import cv2_imshow\n```\nand replace all the `cv2.imshow` with `cv2_imshow`\n\n## 3. Model Architecture\n\u003cimg src=\"imgs/model arch.png\" width=\"550\"/\u003e\n\u003ca href=\"imgs/theonnx.onnx.svg\"\u003eModel Computation Graph\u003c/a\u003e\n\n## 4. Image Augmentation\n\u003cimg src=\"imgs/3imgs.png\" width=\"750\"/\u003e\u003cbr\u003e\nCodes: \u003ca href=\"https://github.com/DevashishPrasad/CascadeTabNet/blob/master/Data%20Preparation/Dilation.py\"\u003eCode for dilation transform\u003c/a\u003e \u003ca href=\"https://github.com/DevashishPrasad/CascadeTabNet/blob/master/Data%20Preparation/Smudge.py\"\u003eCode for smudge transform\u003c/a\u003e\n\n## 5. Benchmarking\n### 5.1. Table Detection\n#### 1. ICDAR 13\n\u003cimg src=\"imgs/ICDAR 13.png\" width=\"450\"/\u003e\n\n#### 2. ICDAR 19 (Track A Modern)\n\u003cimg src=\"imgs/icdar 19.png\" width=\"450\"/\u003e\n\n#### 3. TableBank\n\u003cimg src=\"imgs/tablebank.png\" width=\"450\"/\u003e\n\n#### TableBank Benchmarking : \u003ca href=\"https://doc-analysis.github.io/\"\u003e \u003cb\u003eOfficial Leaderboard\u003c/b\u003e\u003c/a\u003e\u003cbr\u003e\nTableBank Dataset Divisions : \u003ca href=\"https://drive.google.com/open?id=1lxpK4sa4LTSHPFuQEsjFdx87NAlQ8F5O\"\u003eTableBank\u003c/a\u003e\n\n### 5.2. Table Structure Recognition\n#### 1. ICDAR 19 (Track B2)\n\u003cimg src=\"imgs/TSR.png\" width=\"450\"/\u003e\n\n## 6. Model Zoo\nCheckout our demo notebook for loading checkpoints and performing inference \u003cbr\u003e[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1lzjbBQsF4X2C2WZhxBJz0wFEQor7F-fv?usp=sharing)\u003cbr\u003e\n[Config file](Config/cascade_mask_rcnn_hrnetv2p_w32_20e.py) for the Models\u003cbr\u003e\n*Note: Config paths are only required to change during training*\u003cbr\u003e\nCheckpoints of the Models we have trained : \n\u003ctable\u003e\n  \u003ctr\u003e\n  \u003cth\u003eModel Name\u003c/th\u003e\u003cth\u003eCheckpoint File\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n  \u003ctd\u003eGeneral Model table detection\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://drive.google.com/open?id=1-xfq5hDmFdKgbY9FSFTmhSlcb2p13RPn\"\u003eCheckpoint\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n  \u003ctd\u003eICDAR 13 table detection\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://drive.google.com/open?id=1-mVr4UBicFk3mjUz5tsVPjQ4jzRtiT7V\"\u003eCheckpoint\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n  \u003ctd\u003eICDAR 19 (Track A Modern) table detection\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://drive.google.com/open?id=1vfUr4pmmI4GICZubAnBeFU8pviMUW_c9\"\u003eCheckpoint\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e  \n  \u003ctr\u003e\n  \u003ctd\u003eTable Bank Word table detection\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://drive.google.com/open?id=1-ZnV84t61IrkAfQH7dOATpo_T4C1J4Qa\"\u003eCheckpoint\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e    \n  \u003ctr\u003e\n  \u003ctd\u003eTable Bank Latex table detection\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://drive.google.com/open?id=1-9EzU_LfD6fE8iJFjOZ3nBsCObqhpNUa\"\u003eCheckpoint\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e    \n  \u003ctr\u003e\n  \u003ctd\u003eTable Bank Both table detection\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://drive.google.com/open?id=1-vjfGRhF8kqvKwZPPFNwiTaOoonJlGgv\"\u003eCheckpoint\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e      \n  \u003ctr\u003e\n  \u003ctd\u003eICDAR 19 (Track B2 Modern) table structure recognition\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://drive.google.com/open?id=1-QieHkR1Q7CXuBu4fp3rYrvDG9j26eFT\"\u003eCheckpoint\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e      \n\u003c/table\u003e\n\n## 7. Datasets\n\n1) End to End Table Recognition Dataset \u003cbr\u003e\nWe manually annotated some of the \u003ca href=\"http://sac.founderit.com/\"\u003eICDAR 19 table competition (cTDaR)\u003c/a\u003e dataset images for cell detection in the borderless tables. More details about the dataset are mentioned in the paper. \u003cbr\u003e\n\u003ca href=\"https://drive.google.com/drive/folders/1mNDbbhu-Ubz87oRDjdtLA4BwQwwNOO-G?usp=sharing\"\u003edataset link\u003c/a\u003e\n\n2) General Table Detection Dataset (ICDAR 19 + Marmot + Github)\u003cbr\u003e\nWe manually corrected the annotations of Marmot and \u003ca href=\"https://github.com/sgrpanchal31/table-detection-dataset\"\u003eGithub\u003c/a\u003e and combined them with ICDAR 19 dataset to create a general and robust dataset. \u003cbr\u003e\n\u003ca href=\"https://drive.google.com/open?id=1RuEACireEqPnQrYqghEqsOPRE-CkGSUd\"\u003edataset link\u003c/a\u003e\n\n## 8. Training\nYou may refer this \u003ca href=\"https://www.dlology.com/blog/how-to-train-an-object-detection-model-with-mmdetection/\"\u003etutorial\u003c/a\u003e for training Mmdetection models on your custom datasets in colab.\u003cbr\u003e\n\nYou may refer this \u003ca href=\"/Data Preparation/generateVOC2JSON.py\"\u003escript\u003c/a\u003e to convert your Pascal VOC XML annotation files to a single COCO Json file.\n\n## 9. Docker\n\nThe docker image of this project can be found at \u003ca href=\"https://hub.docker.com/repository/docker/akadirpamukcu/tabnet\"\u003edocker hub\u003c/a\u003e \n\nIt currently contains three models from model zoo. For details you can check the readme file at the docker hub.\n\n## Contact\nDevashish Prasad : devashishkprasad [at] gmail [dot] com \u003cbr\u003e\nAyan Gadpal : ayangadpal2 [at] gmail [dot] com \u003cbr\u003e\nKshitij Kapadni : kshitij.kapadni [at] gmail [dot] com \u003cbr\u003e\nManish Visave : manishvisave149 [at] gmail [dot] com \u003cbr\u003e\n\n## Acknowledgements\n\nWe thank the following contributions because of which\nthe paper was made possible\n\n1. The **MMdetection** project team for creating the amazing framework to push the state of the art computer vision\nresearch and which enabled us to experiment and build state of the art models very easily.\n\n2. Our college **”Pune Institute of Computer Technology”** for funding our research and giving us the opportunity to work and publish our research at an international conference.\n\n3. **\u003ca href=\"http://chenkai.site/\"\u003eKai Chen\u003c/a\u003e** for endorsing our paper on the arXiv to publish a pre-print of the paper and also for maintaining the Mmdetection repository along with the team.\n\n4. **Google Colaboratory** team for providing free high end GPU resources for research and development. All of the code base was developed using Google colab and couldn't be possible without it.\n\n5. **AP Analytica** for making us aware about a similar problem statement and giving us an opportunity to work on the same.\n\n6. **Overleaf.com** for open sourcing the wonderful project which enabled us to write the research paper easily in the latex format\n\n## License\nThe code of CascadeTabNet is Open Source under the [MIT License](LICENSE.md). There is no limitation for both acadmic and commercial usage.\n\n## Cite as\nIf you find this work useful for your research, please cite our paper:\n\n```\n@misc{ cascadetabnet2020,\n    title={CascadeTabNet: An approach for end to end table detection and structure recognition from image-based documents},\n    author={Devashish Prasad and Ayan Gadpal and Kshitij Kapadni and Manish Visave and Kavita Sultanpure},\n    year={2020},\n    eprint={2004.12629},\n    archivePrefix={arXiv},\n    primaryClass={cs.CV}\n}\n```\n","funding_links":[],"categories":["Influential Papers","Python"],"sub_categories":["CVPRW 2020"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDevashishPrasad%2FCascadeTabNet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDevashishPrasad%2FCascadeTabNet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDevashishPrasad%2FCascadeTabNet/lists"}