Home

Awesome

SCOB: Universal Text Understanding via Character-wise Supervised Contrastive Learning with Online Text Rendering for Bridging Domain Gap

<div align="center">

Daehee Kim, Yoonsik Kim*, DongHyun Kim, Yumin Lim, Geewook Kim, Taeho Kil

Paper Conference

Official Implementation of SCOB | Paper | Poster

</div>

Introduction

SCOB Character-wise Supervised Contrastive Learning with Online Text Rendering for Bridging Domain Gap, is a novel pre-training method for visual document understanding and scene text understanding. SCOB can obtain abundant positive and negative pairs throughout the online rendered and real images. Moreover, SCOB can be pre-trained under weak supervision that does not require coordinate annotation for the detection of real images. Our academic paper, which describes our method in detail and provides full experimental results and analyses, can be found here: Our academic paper, which describes our method in detail and provides full experimental results and analyses, can be found here:<br>

SCOB: Universal Text Understanding via Character-wise Supervised Contrastive Learning.<br> Daehee Kim, Yoonsik Kim, Donghyun Kim, Yumin Lim, Geewook Kim, Taeho Kil In ICCV 2023.

<img width="950" alt="image" src="misc/teaser.PNG">

Updates

2022-09-26 First Commit, We release our code, model weights.

Quick start

gdown https://drive.google.com/uc?id=1vmWWxvbrscwuywMHpm7_sHkAN0UIJ9_2
unzip scobs.zip

conda env create -f environment.yaml
source activate w_cu113
python train.py --config=configs/pretrain_scob_test.yaml

Software Installation

conda env create -f environment.yaml

Getting Started

Data

This repository assumes the following structure of dataset:

> tree dataset_name
dataset_name
├── test
│   ├── metadata.jsonl
│   ├── {image_path0}
│   ├── {image_path1}
│             .
│             .
├── train
│   ├── metadata.jsonl
│   ├── {image_path0}
│   ├── {image_path1}
│             .
│             .
└── validation
    ├── metadata.jsonl
    ├── {image_path0}
    ├── {image_path1}
              .
              .

cat dataset_name/test/metadata.jsonl {"file_name": {image_path0}, "ground_truth": "{"gt_parse": {ground_truth_parse}, ... {other_metadata_not_used} ... }"}

Download Datasets & Weights

We currently provide PubTabNet, CORD, and ICDAR2013 datasets.

gdown https://drive.google.com/uc?id=1vmWWxvbrscwuywMHpm7_sHkAN0UIJ9_2
unzip scobs.zip

For Document Information Extraction

The gt_parse is a JSON object that contains full information of the document image, for example, the JSON object for a receipt may look like {"menu" : [{"nm": "ICE BLACKCOFFEE", "cnt": "2", ...}, ...], ...}.

python train.py --config=configs/finetune_cord.yaml

For Table Reconstruction

python train.py --config=configs/finetune_pubtabnet.yaml

For OCR

Training

This is the configuration of SCOB's fine-tuning on PubTabNet dataset dataset used in our experiment. Description of config file is written in configs/README.md. We ran this with a eight NVIDIA V100 GPU.

python train.py --config=configs/finetune_pubtabnet.yaml

Test

TBD

How to Cite

If you find this work useful to you, please cite:

@inproceedings{kim2023scob,
  title     = {SCOB: Universal Text Understanding via Character-wise Supervised Contrastive Learning with Online Text Rendering for Bridging Domain Gap},
  author    = {Kim, Daehee and Kim, Yoonsik and Kim, DongHyun and Lim, Yumin and Kim, Geewook and Kil, Taeho},
  booktitle = {International Conference on Computer Vision (ICCV2023)},
  year      = {2023}
}

License

SCOB
Copyright (c) 2023-present NAVER Cloud Corp.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.