CDistNet: Perceiving Multi-Domain Character Distance for Robust Text Recognition

Inc Lomin's avatar
Apr 19, 2022
CDistNet: Perceiving Multi-Domain Character Distance for Robust Text Recognition
최근 Scene text recognition 분야에서도 attention network를 사용하여 State-of-the-art의 성능을 내는 모델이 많이 나오고 있습니다. 그러나 attention-base model은 attention drift 문제를 가지고 있으며 이를 해결하기 위해 다양한 방법이 소개 되었습니다. 이 논문에서는 attention drift 문제를 해결하기 위해 positional embedding을 잘 활용하는 방법을 제시하였으며 현재 기준으로 ICDAR2013, ICDAR2015, IIIT5k, SVTP 등의 benchmark에서 sota의 성능을 보여주었습니다.

Introduction

 
attention drift(혹은 alignment drift)는 이미지상의 바람직하지 않은 부분에 집중하므로써 ground-truth text와 mismatching이 생기는 문제입니다. (Fig 1.) 이 문제는 글자의 형태가 복잡하거나 이미지의 퀄리티가 나쁜 경우 발생할 수 있으며 이 문제를 해결하기 위한 방법으로 focusing network을 [Cheng et al. (2017)] 추가하거나 segmentation을 활용하는 등의 다양한 방법이 제시되었습니다.
 
Fig 1. Image from "Focusing Attention: Towards Accurate Text Recognition in Natural Images"
Fig 1. Image from "Focusing Attention: Towards Accurate Text Recognition in Natural Images"
Wang et al.(2019)는 이러한 문제는 text의 길이가 길수록 (Fig 2.)에 의해 심해지는 경향이 있으며 그 원인이 기존 모델 Decoder에서 visual clue와 semantic clue를 분리하지 않고 다루는데 있다고 판단하여 이를 분리한 모델(DAN)을 제시하였습니다.
나아가 최근에는 visual clue와 semantic clue의 mismatching 문제, 즉 attention drift 문제를 해결하기 위해 positional embedding을 활용한 방법이 제안 되었습니다. 저자는 이러한 방법을 position-enhanced method의 일종으로 분류하고 본 논문도 이에 속합니다. Yue et al. (2020)는 time step에 따라 positional information이 약해지고 contextual information이 점차 강해지는 것을 보임으로써 긴 text가 attention drift에 취약한 이유라고 지적했습니다. 이를 해결하기 위해 positional enhancement branch와 dynamic fusing module을 제안하여 높은 성능을 보였습니다.
Fig 2. Image from "Decoupled Attenetion Network for Text Recognition"
Fig 2. Image from "Decoupled Attenetion Network for Text Recognition"
Fig 2. Image from "Decoupled Attenetion Network for Text Recognition"
Fig 2. Image from "Decoupled Attenetion Network for Text Recognition"
 
본 논문은 Yue et al. (2020) 와 유사하지만 positional embedding을 visual, semantic features 모두에 적용한 multi-domain distance aware modeling을 구성하였다는 점에 차이점이 있습니다. 그리고 이와 함께 Self-attention enhancement (SAE) 모듈과 Dynamic shared fusion(DSF) 모듈을 추가하여 하나의 모듈(MDCDP)을 만들고 이를 N번 반복하여 하나의 decoder로 구성하였습니다.
 
notion image

Proposed Method

 

Encoder

visual branch, sementic branch, 그리고 positional branch로 구성됩니다.
visual branch에서는 Thin-plate-splines (TPS) preprocess를 거친후, ResNet-45, Transformer units를 통해 visual feature를 추출합니다.
notion image
: TPS block, : ResNet-45, : transformer unit.
 
semantic branch는 LSTM과 scaled dot-product attention을 사용하였습니다.(Sheng 2019, Yue 2020와 비슷함.)
Positional Branch는 transformer original paper를 따랐습니다.(Vaswani 2017)
 
notion image

MDCDP(Multi-Domain Character Distance Perception) module

MDCDP module은 SAE, CBI, DSF 세가지 모듈로 구성됩니다.
 
Self-Attention Enhancement (SAE)
dimension을 절반으로 줄인 vanilla transformer를 사용합니다. 그리고 "seeing itself" (information leak)을 방지하기 위해 query vector에 upper triangular mask를 적용합니다.
Cross-Branch Interaction (CBI)
enhance된 positional embedding은 query vector로 사용되어 visual, semantic branch에 입력되며 각각 CBI-V, CBI-S라 부릅니다. Semantic branch 또한 information leak을 방지하기 위해 upper triangular mask를 사용합니다.
notion image
Dynamic Shared Fusion (DSF)
두개의 positional-enhanced features (F_sem, F_vis)를 input으로 받아 같은 크기의 F_out을 출력합니다.
순서대로 Concat (2), 1X1 Convolution (2), 그리고 dynamic fusion (3) 을 거칩니다.
notion image
여기서 이며, 이 weights는 모든 MDCDP에서 share합니다.
notion image
 

Experiment

Datasets

학습으로 두개의 synthetic datasets (MJSynth, SynthText)을 사용하고, model verification으로 두개의 augmented datasets (HA-IC13, CA-IC13)을 사용하였습니다.
HA-IC13과 CA-IC13은 ICDAR2013 데이터셋을 각각 horizontal, curved stretching을 하여 제작하였습니다. stretching 정도에 따라 1~6단계로 나누었습니다.
 
ablation study와 기존 method와의 비교를 위해 아래 6개의 public datasets을 사용하였습니다.
ICDAR2013,
Street View Text,
IIIT5k-Words,
ICDAR2015,
SVT-Perspective,
CUTE80
 

Ablation study

Number of MDCDP modules
notion image
MDCDP의 개수를 3으로 설정
 
The effectiveness of SAE
enhanced branch(SAE)가 positional branch에 있을때 성능의 개선 효과가 큰 것을 볼 수 있습니다.
다른 branch에 비교하여 positional branch는 고정된 embedding으로 부터 만들어지기 때문에 SAE를 통해 self-adjustment를 해서 성능향상이 큰 것이라고 분석하였습니다.
notion image
 
The effectiveness of CBI
CBI를 구성하는 다양한 방법중 6가지를 비교.(Table 3) Positional embedding과 Visual feature, 그리고 Positional embedding과 Semantic embedding에 CBI를 적용한 경우 성능 향상이 가장 큰 것을 볼 수 있습니다.
The effectiveness of DSF
positional-enhanced visual and semantic features를 fuse하기 위해 4가지 실험(Table 4)을 하였습니다.
weight를 sharing 한 DSF가 가장 성능이 높습니다.
 
notion image
notion image
 

Model verification

notion image
Table 5를 보면 CDistNet의 다양한 요소 중 각각의 요소 주는 향상을 볼 수 있습니다. CDisNet w/o Sem 은 semantic branch를 제거한 모델입니다. Transformer*는 raw implementation에서 visual encoding branch만 본 논문의 것으로 교체한 것입니다. RobustScanner*는 RobustScanner의 "CNN-LSTM"을 본 논문처럼 Transformer unit으로 교체한 버전입니다.
Performance on augmented datasets
Table 6는 ICDAR2013으로 부터 augmentation (horizontal, curve stretching) 을 통해 생성한 HA-IC13, CA-IC13 데이터셋에 대한 성능을 Transformer*모델과 비교한 결과입니다.
notion image
 
notion image
notion image
notion image
Share article