TGRNet: A Table Graph Reconstruction Network for Table Structure Recognition

Related tags

Deep Learning TGRNet
Overview

TGRNet: A Table Graph Reconstruction Network for Table Structure Recognition

Xue, Wenyuan, et al. "TGRNet: A Table Graph Reconstruction Network for Table Structure Recognition." arXiv preprint arXiv:2106.10598 (2021).

This work has been accepted for presentation at ICCV2021. The preview version has released at arXiv.org (https://arxiv.org/abs/2106.10598).

Abstract

A table arranging data in rows and columns is a very effective data structure, which has been widely used in business and scientific research. Considering large-scale tabular data in online and offline documents, automatic table recognition has attracted increasing attention from the document analysis community. Though human can easily understand the structure of tables, it remains a challenge for machines to understand that, especially due to a variety of different table layouts and styles. Existing methods usually model a table as either the markup sequence or the adjacency matrix between different table cells, failing to address the importance of the logical location of table cells, e.g., a cell is located in the first row and the second column of the table. In this paper, we reformulate the problem of table structure recognition as the table graph reconstruction, and propose an end-to-end trainable table graph reconstruction network (TGRNet) for table structure recognition. Specifically, the proposed method has two main branches, a cell detection branch and a cell logical location branch, to jointly predict the spatial location and the logical location of different cells. Experimental results on three popular table recognition datasets and a new dataset with table graph annotations (TableGraph-350K) demonstrate the effectiveness of the proposed TGRNet for table structure recognition.

Getting Started

Requirements

Create the environment from the environment.yml file conda env create --file environment.yml or install the software needed in your environment independently. If you meet some problems when installing PyTorch Geometric, please follow the official installation indroduction (https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html).

dependencies:
  - python==3.7.0
  - pip==20.2.4
  - pip:
    - dominate==2.5.1
    - imageio==2.8.0
    - networkx==2.3
    - numpy==1.18.2
    - opencv-python==4.4.0.46
    - pandas==1.0.3
    - pillow==7.1.1
    - torchfile==0.1.0
    - tqdm==4.45.0
    - visdom==0.1.8.9
    - Polygon3==3.0.8

PyTorch Installation

# CUDA 10.2
pip install torch==1.5.0 torchvision==0.6.0
# CUDA 10.1
pip install torch==1.5.0+CU101 torchvision==0.6.0+CU101 -f https://download.pytorch.org/whl/torch_stable.html
# CUDA 9.2
pip install torch==1.5.0+CU92 torchvision==0.6.0+CU92 -f https://download.pytorch.org/whl/torch_stable.html

PyTorch Geometric Installation

pip install torch-scatter==2.0.4 -f https://pytorch-geometric.com/whl/torch-1.5.0+${CUDA}.html
pip install torch-sparse==0.6.3 -f https://pytorch-geometric.com/whl/torch-1.5.0+${CUDA}.html
pip install torch-cluster==1.5.4 -f https://pytorch-geometric.com/whl/torch-1.5.0+${CUDA}.html
pip install torch-spline-conv==1.2.0 -f https://pytorch-geometric.com/whl/torch-1.5.0+${CUDA}.html
pip install torch-geometric

where ${CUDA} should be replaced by your specific CUDA version (cu92, cu101, cu102).

Datasets Preparation

cd ./datasets
tar -zxvf datasets.tar.gz
## The './datasets/' folder should look like:
- datasets/
  - cmdd/
  - icdar13table/
  - icdar19_ctdar/
  - tablegraph24k/

Pretrained Models Preparation

IMPORTANT Acoording to feedbacks from users (I also tested by myself), the pretrained models may not work for some enviroments. I have tested the following enviroment that can work as expected.

  - CUDA 9.2
  - torch 1.7.0+torchvision 0.8.0
  - torch-cluster 1.5.9
  - torch-geometric 1.6.3
  - torch-scatter 2.0.6
  - torch-sparse 0.6.9
  - torch-spline-conv 1.2.1
  • Download pretrained models from Google Dive or Alibaba Cloud.
  • Put checkpoints.tar.gz in "./checkpoints/" and extract it.
cd ./checkpoints
tar -zxvf checkpoints.tar.gz
## The './checkpoints/' folder should look like:
- checkpoints/
  - cmdd_overall/
  - icdar13table_overall/
  - icdar19_lloc/
  - tablegraph24k_overall/

Test

We have prepared scripts for test and you can just run them.

- test_cmdd.sh
- test_icdar13table.sh
- test_tablegraph-24k.sh
- test_icdar19ctdar.sh

Train

Todo

Comments
  • Do you have a plan to release the source code of this paper?

    Do you have a plan to release the source code of this paper?

    Hi, I read the paper and very interested in it Do you have a plan to release the source code of this paper? Thank you, hope to see your response soon!

    opened by huyhoang17 5
  • Getting 'KeyError' while loading weights

    Getting 'KeyError' while loading weights

    Hi Team, I was running the tests on cmdd dataset using test_cmdd.sh I am able to create the dataset correctly. dataset [TbRecCMDDDataset] was created The number of test images = 104. Testset: ./datasets/cmdd /home/ashishk/.pyenv/versions/3.7.0/envs/tgr/lib/python3.7/site-packages/torchvision/models/_utils.py:209: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and will be removed in 0.15, please use 'weights' instead. f"The parameter '{pretrained_param}' is deprecated since 0.13 and will be removed in 0.15, " /home/ashishk/.pyenv/versions/3.7.0/envs/tgr/lib/python3.7/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum orNonefor 'weights' are deprecated since 0.13 and will be removed in 0.15. The current behavior is equivalent to passingweights=None. warnings.warn(msg) initialize network with normal initialize network with normal model [TbRecModel] was created Load SUfficx best loading the model from ./checkpoints/cmdd_overall/best_net_Backbone.pth

    However, when I am loading the pre-trained model weights for cell Logical prediction model, I am getting following error.

    Traceback (most recent call last): File "test.py", line 32, in <module> model.setup(opt) # regular setup: load and print networks; create schedulers File "/home/ashishk/research/TGRNet/models/base_model.py", line 92, in setup self.load_networks(load_suffix, rm_layers) File "/home/ashishk/research/TGRNet/models/base_model.py", line 219, in load_networks net.load_state_dict(state_dict,strict=False) File "/home/ashishk/.pyenv/versions/3.7.0/envs/tgr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1590, in load_state_dict load(self) File "/home/ashishk/.pyenv/versions/3.7.0/envs/tgr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1578, in load load(child, prefix + name + '.') File "/home/ashishk/.pyenv/versions/3.7.0/envs/tgr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1578, in load load(child, prefix + name + '.') File "/home/ashishk/.pyenv/versions/3.7.0/envs/tgr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1575, in load state_dict, prefix, local_metadata, True, missing_keys, unexpected_keys, error_msgs) File "/home/ashishk/.pyenv/versions/3.7.0/envs/tgr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1474, in _load_from_state_dict hook(state_dict, prefix, local_metadata, strict, missing_keys, unexpected_keys, error_msgs) File "/home/ashishk/.pyenv/versions/3.7.0/envs/tgr/lib/python3.7/site-packages/torch_geometric/nn/dense/linear.py", line 140, in _lazy_load_hook weight = state_dict[prefix + 'weight'] KeyError: 'gconv_row.lin.weight'

    Could you please provide any suggestions here?

    opened by ashj9 1
  • no prt_net_Backbone.pth when training ICDAR2013 dataset from scratch

    no prt_net_Backbone.pth when training ICDAR2013 dataset from scratch

    Hi, I am trying to train this model on ICDAR2013 dataset, and I use train_icdar13table.sh. It seems that the model is defined in prt_net_Backbone.pth, but there is no such pth file can be downloaded. Could you provide some details about the model in the pth file or provde that prt_net_Backbone file? Thank you so much.

    opened by buptxiaofeng 1
  • 作者方便提供一下预训练模型吗?

    作者方便提供一下预训练模型吗?

    作者您好,调整相关路径之后运行了您的测试脚本没有问题,但是训练时找不到预训练模型,根据您GITHUB上提供的预训练模型地址下载下来的是训练好的pth模型文件,方便提供一下原始的预训练模型吗? 报错是这样的:FileNotFoundError: [Errno 2] No such file or directory: './checkpoints/cmdd_overall/prt_net_Backbone.pth' 方便提供这个prt_net_Backbone.pth文件吗?

    opened by zhangtao1234567 1
  • graph_edge

    graph_edge

    您好,在解压后的datasets后得到的的三个txt文件中都有类似这样的路径。 /data/xuewenyuan/data/icdar19_ctdar/graph_edge/cTDaR_t00496_0_edge.csv 然而我没有找到graph_edge文件夹。 请问怎样才能得到这个文件夹,是需要自己生成吗?

    opened by mdbhmdbh 2
  • Testing model on ICDAR 2013 and 2019

    Testing model on ICDAR 2013 and 2019

    Hi, I am trying to run your model on the ICDAR 2013 and 2019 datasets but I was getting the error below:

    Screen Shot 1400-12-17 at 13 35 38

    It seems the path in the pickle files have been set to your directory. Please can you help out?

    Thanks

    opened by Kehindeajayi01 4
Owner
Wenyuan
Beijing Jiaotong University
Wenyuan
"MST++: Multi-stage Spectral-wise Transformer for Efficient Spectral Reconstruction" (CVPRW 2022) & (Winner of NTIRE 2022 Challenge on Spectral Reconstruction from RGB)

MST++: Multi-stage Spectral-wise Transformer for Efficient Spectral Reconstruction (CVPRW 2022) Yuanhao Cai, Jing Lin, Zudi Lin, Haoqian Wang, Yulun Z

Yuanhao Cai 274 Jan 5, 2023
The source code of the paper "SHGNN: Structure-Aware Heterogeneous Graph Neural Network"

SHGNN: Structure-Aware Heterogeneous Graph Neural Network The source code and dataset of the paper: SHGNN: Structure-Aware Heterogeneous Graph Neural

Wentao Xu 7 Nov 13, 2022
RefineGNN - Iterative refinement graph neural network for antibody sequence-structure co-design (RefineGNN)

Iterative refinement graph neural network for antibody sequence-structure co-des

Wengong Jin 83 Dec 31, 2022
The implementation of the CVPR2021 paper "Structure-Aware Face Clustering on a Large-Scale Graph with 10^7 Nodes"

STAR-FC This code is the implementation for the CVPR 2021 paper "Structure-Aware Face Clustering on a Large-Scale Graph with 10^7 Nodes" ?? ?? . ?? Re

Shuai Shen 87 Dec 28, 2022
Boost learning for GNNs from the graph structure under challenging heterophily settings. (NeurIPS'20)

Beyond Homophily in Graph Neural Networks: Current Limitations and Effective Designs Jiong Zhu, Yujun Yan, Lingxiao Zhao, Mark Heimann, Leman Akoglu,

GEMS Lab: Graph Exploration & Mining at Scale, University of Michigan 70 Dec 18, 2022
Implementation of Self-supervised Graph-level Representation Learning with Local and Global Structure (ICML 2021).

Self-supervised Graph-level Representation Learning with Local and Global Structure Introduction This project is an implementation of ``Self-supervise

MilaGraph 50 Dec 9, 2022
Code for the paper "MASTER: Multi-Aspect Non-local Network for Scene Text Recognition" (Pattern Recognition 2021)

MASTER-PyTorch PyTorch reimplementation of "MASTER: Multi-Aspect Non-local Network for Scene Text Recognition" (Pattern Recognition 2021). This projec

Wenwen Yu 255 Dec 29, 2022
This is an open-source toolkit for Heterogeneous Graph Neural Network(OpenHGNN) based on DGL [Deep Graph Library] and PyTorch.

This is an open-source toolkit for Heterogeneous Graph Neural Network(OpenHGNN) based on DGL [Deep Graph Library] and PyTorch.

BUPT GAMMA Lab 519 Jan 2, 2023
Source code for CVPR 2021 paper "Riggable 3D Face Reconstruction via In-Network Optimization"

Riggable 3D Face Reconstruction via In-Network Optimization Source code for CVPR 2021 paper "Riggable 3D Face Reconstruction via In-Network Optimizati

null 130 Jan 2, 2023
HDR Video Reconstruction: A Coarse-to-fine Network and A Real-world Benchmark Dataset (ICCV 2021)

Code for HDR Video Reconstruction HDR Video Reconstruction: A Coarse-to-fine Network and A Real-world Benchmark Dataset (ICCV 2021) Guanying Chen, Cha

Guanying Chen 64 Nov 19, 2022
Plug and play transformer you can find network structure and official complete code by clicking List

Plug-and-play Module Plug and play transformer you can find network structure and official complete code by clicking List The following is to quickly

null 8 Mar 27, 2022
An extremely simple, intuitive, hardware-friendly, and well-performing network structure for LiDAR semantic segmentation on 2D range image. IROS21

FIDNet_SemanticKITTI Motivation Implementing complicated network modules with only one or two points improvement on hardware is tedious. So here we pr

YimingZhao 54 Dec 12, 2022
Losslandscapetaxonomy - Taxonomizing local versus global structure in neural network loss landscapes

Taxonomizing local versus global structure in neural network loss landscapes Int

Yaoqing Yang 8 Dec 30, 2022
BasicNeuralNetwork - This project looks over the basic structure of a neural network and how machine learning training algorithms work

BasicNeuralNetwork - This project looks over the basic structure of a neural network and how machine learning training algorithms work. For this project, I used the sigmoid function as an activation function along with stochastic gradient descent to adjust the weights and biases.

Manas Bommakanti 1 Jan 22, 2022
Recovering Brain Structure Network Using Functional Connectivity

Recovering-Brain-Structure-Network-Using-Functional-Connectivity Framework: Papers: This repository provides a PyTorch implementation of the models ad

null 5 Nov 30, 2022
Face-Recognition-Attendence-System - This face recognition Attendence system using Python

Face-Recognition-Attendence-System I have developed this face recognition Attend

Riya Gupta 4 May 10, 2022
[ICCV2021] Official code for "Channel-wise Topology Refinement Graph Convolution for Skeleton-Based Action Recognition"

CTR-GCN This repo is the official implementation for Channel-wise Topology Refinement Graph Convolution for Skeleton-Based Action Recognition. The pap

Yuxin Chen 148 Dec 16, 2022
GLaRA: Graph-based Labeling Rule Augmentation for Weakly Supervised Named Entity Recognition

GLaRA: Graph-based Labeling Rule Augmentation for Weakly Supervised Named Entity Recognition

Xinyan Zhao 29 Dec 26, 2022
Two-Stream Adaptive Graph Convolutional Networks for Skeleton-Based Action Recognition in CVPR19

2s-AGCN Two-Stream Adaptive Graph Convolutional Networks for Skeleton-Based Action Recognition in CVPR19 Note PyTorch version should be 0.3! For PyTor

LShi 547 Dec 26, 2022