일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- layoutlm
- 레이블링
- 딥러닝
- document understanding
- OCR
- Text Recognition
- joint training of textual and layout information
- Test set
- layoutxml
- VrDU
- Pre-training
- document image understanding
- multilingual
- Today
- Total
JM_Research Blog
LayoutLMv3: Pre-training for Document AI with Unified Text and Image Masking 본문
LayoutLMv3: Pre-training for Document AI with Unified Text and Image Masking
-jm- 2024. 4. 25. 13:26🌞Summary
이번 포스팅은 LayoutLM의 세 번째 버전인 LayoutLMv3입니다.
해당 논문에서 주의 깊게 본 것은 layout 정보를 추출하기 위해서 pret-trained vision transformer를 사용한 것입니다. 기존의 layout 정보를 추출했던 방법들은 높은 파라미터 cost와 정답 set이 있어야 하는 한계가 있었는데 vision transformer를 활용하여서 이를 해결하였습니다.
추가적으로 사전학습에서는 BEiT에서 사용한 MIM 사전학습 objective를 사용하여서 통합된 text and image masking objective를 사용한 것이 눈여겨볼 만합니다.
ABSTRACT & INSTRODUCTION
•이 논문은 textual and layout information 정보 간의 상호작용을 통합하여 모델링했던 LayoutLM의 버전 3인LayoutLMv3를 제안합니다.
• LayoutLMv3는 visual feature를 추출함에 있어 pre-trained cnn을 사용하지 않은 첫 멀티모달 모델
•파라미터와 라벨링 cost를 save 할 수 있음
•사전 학습에서 text, image masking objective를 사용함
•대다수의 multimodal pre-trained models들의 text modality관련 objectives들은 MLM으로 통일되는데 반해 image modality의 objectives는 다양함
RELATED WORK
왜 visual feature를 추출함에 있어 기존의 방식인 pre-trained cnn 나 Faster R-CNN 같은 모델들을 사용하지 않은 걸까??
•기존의 방식은 파라미터가 많아 계산량이 많고, 정답 set이 있어야 해서 이에 따른 cost가 존재함
•vision-and-language-pre-training(VLP) 분야에서 region features → grid features로 전환하려는 시도들 등장
•사전 정의된 object classes and region supervision의 한계 해소 but cnn에서 발생하는 계산량의 문제는 해소 못함
• ViLT는 가벼운 linear layer로 시각적 특징을 학습하고, 모델의 size와 running time을 줄이는 특징을 갖고 있음 → 따라서 VilT를 사용함
region features
이미지 내의 특정 영역(region)에서 추출된 특성. 이러한 영역은 물체나 이미지의 특정 부분을 나타내며, 각 영역은 객체 검출(object detection) 알고리즘(예: Faster R-CNN)을 통해 식별함
grid features
grid features는 이미지를 균일한 크기의 격자(grid)로 분할하고, 각 격자 셀에서 특성을 추출하는 방식. 이 과정에서는 특정 객체를 식별하기보다는 이미지 전체를 고르게 분석
LAYOUTLMV3
Text Embedding
•layoutlmv2와 아래의 차이점을 제외하고 동일
•차이점
•position embedding: segment-level layout positions vs word-level layout positions(layoutlmv2)
•segment로 position embedding을 구하게 되면 다른 text여도 같은 segment에 있다면 동일한 위치정보를 얻게 됨
Image Embedding
•기존은 visual encoder의 경우 heavy computation과 라벨링 된 region이 필요 → cost 증가
•Inspired by ViT and ViLT
•이미지를 linear projection features of image patches로 표현
•step
1. image를 hwc로 resize
2. pxp 크기의 patch로 만듬
3. 각 patch를 D차원으로 liner projection 한 후 flatten
•최종 embedding : patch embedding + 1d position embedding
Pre-training Objectives
•LOSS=LMLM+LMIM+LWPA
• Objective I: Masked Language Modeling (MLM)
•mask 30% of text tokens a span masking strategy
•해당 mask 된 토큰을 원래 토큰으로 예측하도록
• Objective II: Masked Image Modeling (MIM)
•adapt the MIM pre-training objective in BEiT
•image tokens의 40%를 랜덤 하게 blockwise 마스킹함
•해당 mask 된 토큰을 원래 토큰으로 잘 복원하도록
• Objective III: Word-Patch Alignment (WPA)
•text and image modalities를 alignment 하기 위함 → fine-grained alignment
•objective : text word와 corresponding 하는 image patch가 마스킹되었는지 판별
•masked text token은 계산에서 제외
•aligned : text token → unmasked image token
•unaligned : text token → masked image token
참고문헌
더 자세한 내용을 보고 싶으시다면 해당 자료를 살펴보시기 바랍니다.
1. paper : https://arxiv.org/abs/2204.08387
LayoutLMv3: Pre-training for Document AI with Unified Text and Image Masking
Self-supervised pre-training techniques have achieved remarkable progress in Document AI. Most multimodal pre-trained models use a masked language modeling objective to learn bidirectional representations on the text modality, but they differ in pre-traini
arxiv.org
2. 참고 자료 : https://www.youtube.com/watch?v=3yOQXVUJ6h8&t=1998s
3. 참고 자료 : https://www.youtube.com/watch?v=uCWhUayAwOY
(정말 많은 도움 되었습니다 감사합니다 😊😊)