Skip to content

boostcampaitech6/level2-cv-datacentric-cv-01

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“– Overview

๋ณธ ํ”„๋กœ์ ํŠธ๋Š” ์ปดํ“จํ„ฐ ๋น„์ „ ๋ถ„์•ผ์—์„œ ํ˜„์žฌ ๋„๋ฆฌ ์“ฐ์ด๋Š” ๋Œ€ํ‘œ์ ์ธ ๊ธฐ์ˆ  ์ค‘ ํ•˜๋‚˜์ธ OCR (Optical Character Recognition) ๊ธฐ์ˆ ์— ์‚ฌ์šฉ๋œ ๋ชจ๋ธ์˜ ์„ฑ๋Šฅ ๊ฐœ์„ ์„ ๋ชฉํ‘œ๋กœ ํ•œ๋‹ค. ๋ฐ์ดํ„ฐ ๋ถ„์„์„ ํ†ตํ•ด ํ‰๊ฐ€ ๋ฐ์ดํ„ฐ์— ์ ์šฉ๋œ ๋…ธ์ด์ฆˆ๋ฅผ ๋ฐœ๊ฒฌํ•˜์˜€๋‹ค. ์ด๋ฅผ ํ•ด๊ฒฐํ•˜๊ณ ์ž ๋ฐ์ดํ„ฐ ์ฆ๊ฐ•, ์ดˆํ•ด์ƒ๋„, ๋””๋…ธ์ด์ง•, ๋ฐฐ๊ฒฝ ์ œ๊ฑฐ ๋ฐ ์•™์ƒ๋ธ” ๋“ฑ์˜ ์ „๋žต ์ˆ˜๋ฆฝ ํ›„ ์‹คํ—˜์„ ์ˆ˜ํ–‰ํ•˜์˜€๋‹ค. ์ด๋“ค ์ค‘ ๊ฐ€์žฅ ์œ ์˜๋ฏธํ•œ ๊ฒฐ๊ณผ๋ฅผ ์–ป์€ ์ดˆํ•ด์ƒ๋„, ์•™์ƒ๋ธ” ์ „๋žต์„ ์ ์šฉํ•˜์—ฌ 2์œ„์˜ ์„ฑ์ ์„ ๊ฑฐ๋‘์—ˆ๋‹ค.

๐Ÿ† Rank

Test dataset(Public)
Test dataset(Private)

๐Ÿช„ How to run

  • ํ•™์Šต ์‹œ ํ•„์š”ํ•œ ์ •๋ณด๋ฅผ tools ํด๋” ๋‚ด ์ฝ”๋“œ๋ฅผ ํ™œ์šฉํ•ด์„œ prepocessing ํ›„ ์ฝ”๋“œ ์‹คํ–‰
python ./code/train.py --train_dataset_dir /path/to/dataset --model_dir ...
python ./code/inference.py --model_dir /path/to/model --data_dir /path/to/data

๐Ÿ—‚ Dataset

1 2
  • Images & Size : Train: 100, Test: 100, (6002500) * (6003500)

๐Ÿ“ƒ Metric

  • OCR ์€ ๊ธ€์ž ๊ฒ€์ถœ, ๊ธ€์ž ์ธ์‹, ์ •๋ ฌ๊ธฐ ๋“ฑ์˜ ๋ชจ๋“ˆ๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ์Œ. ๋ณธ ๋Œ€ํšŒ์—์„œ๋Š” ๊ธ€์ž ๊ฒ€์ถœ task ๋งŒ์„ ํ•ด๊ฒฐํ•จ. ๊ฒ€์ถœ ์„ฑ๋Šฅ ํ‰๊ฐ€๋ฅผ ์œ„ํ•œ ์ง€ํ‘œ๋กœ Precision, Recall, F1 Score๋ฅผ ์‚ฌ์šฉํ•จ.
0

Team CV-01

๐Ÿ‘ฌ๐Ÿผ Members


๊น€๋ฏผ์œค

๊น€์ฑ„์•„

๋ฐฐ์ข…์šฑ

๋ฐ•์ฐฌ์ข…

์กฐ๋ช…ํ˜„

์ตœ์‹œํ˜„

๐Ÿ‘ฉโ€๐Ÿ’ป Roles

Name Common Role
๊น€๋ฏผ์œค EDA,
๋ชจ๋ธ ํ•™์Šต ๊ฒฐ๊ณผ ๋ถ„์„
Image Background Remove
๊น€์ฑ„์•„ WandB ์„ธํŒ…, ํ•™์Šต ์†๋„ ์ตœ์ ํ™” ์‹คํ—˜
๋ฐฐ์ข…์šฑ Data Augmentation, Super Resolution, Denoise
๋ฐ•์ฐฌ์ข… Pickle Data Generation, Data Augmentation, Corner Crop
์กฐ๋ช…ํ˜„ Denoise, Text sharpening
์ตœ์‹œํ˜„ Annotation ์‹œ๊ฐํ™”, Box Filtering & Ensemble

๐Ÿ’ป Enviroments

  • Language: Python 3.10.13
  • Hardwares: Intel(R) Xeon(R) Gold 5120, Tesla V100-SXM2 32GB ร— 6
  • Framework: Pytorch, Numpy
  • Cowork Tools: Github, Weight and Bias, Notion, Discord, Zoom, Google calendar

๐Ÿ“Š Project

๐Ÿ”Ž EDA

2

Train Dataset

  • ํ•™์Šต ๋ฐ์ดํ„ฐ์…‹ ๋ถ„์„์—์„œ ์„ธ๋กœ ์ด๋ฏธ์ง€, ๊ฐ€๋กœ ์ด๋ฏธ์ง€, ๊ตฌ๊ฒจ์ง„ ์ด๋ฏธ์ง€ ์ด ์„ธ๊ฐ€์ง€ ํŠน์„ฑ์„ ํŒŒ์•…ํ•จ.
  • ๋˜ํ•œ, ๋…ธ์ด์ฆˆ๊ฐ€ ๊ฑฐ์˜ ์—†๋Š” ํด๋ฆฐํ•œ ๋ฐ์ดํ„ฐ์ž„์„ ํŒŒ์•…ํ•จ.

Test Dataset

  • ํ‰๊ฐ€ ๋ฐ์ดํ„ฐ์…‹ ๋ถ„์„ ๊ณผ์ •์—์„œ ํ•™์Šต ๋ฐ์ดํ„ฐ์…‹๊ณผ๋Š” ๋Œ€์กฐ์ ์œผ๋กœ ์ด๋ฏธ์ง€ ๋‚ด์— ๋‹ค์–‘ํ•œ ๋…ธ์ด์ฆˆ๊ฐ€ ์กด์žฌํ•˜๋Š” ๊ฒƒ์„ ํ™•์ธํ•จ.

Limitation in UFO Format

  • UFO ํฌ๋งท์€ Albumentation๊ณผ ๊ฐ™์€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์—์„œ ํฌ๋งท์„ ์ง€์›ํ•˜์ง€ ์•Š์•„ Vertice๋ฅผ ๋ณ€๊ฒฝํ•˜๋Š” Transformation์— ๋Œ€ํ•ด์„œ Numpy๋ฅผ ์ด์šฉํ•˜๋ฉฐ, ์ด๋Š” ํ•™์Šต ์‹œ CPU ์—ฐ์‚ฐ์„ ์ด์œ ๋กœ ๋ณ‘๋ชฉํ˜„์ƒ์ด ๋ฐœ์ƒํ•˜์—ฌ ํ•™์Šต ์‹œ๊ฐ„์ด ์˜ค๋ž˜๊ฑธ๋ฆฐ๋‹ค๋Š” ๋‹จ์ ์„ ํ™•์ธํ•จ.
3

๐Ÿ”ฌ Methods

Pickle Data Generation

  • ํ•™์Šต ๋ฐ์ดํ„ฐ๋ฅผ Pickle ํŒŒ์ผ๋กœ ๋ณ€ํ™˜
python ./code/to_pickle.py
4
  • Pickle ํŒŒ์ผ๋กœ ํ•™์Šต ๋ฐ์ดํ„ฐ๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ํ•™์Šต ์‹œ๊ฐ„์„ ๊ธฐ์กด 1์—ํญ ๋‹น 15๋ถ„ ๊ฑธ๋ฆฌ๋˜ ํ•™์Šต ์‹œ๊ฐ„์„ 10์ดˆ ์ด๋‚ด๋กœ ๋‹จ์ถ•ํ•จ.

Augmentation

  • ํ‰๊ฐ€ ๋ฐ์ดํ„ฐ์…‹๊ณผ ์œ ์‚ฌํ•œ ๋…ธ์ด์ฆˆ๋ผ๊ณ  ์ƒ๊ฐ๋˜๋Š” ๋‹ค์–‘ํ•œ Augmentation ๊ธฐ๋ฒ•์„ ์ ์šฉํ•˜์—ฌ ์‹คํ—˜ ์ง„ํ–‰ํ•จ.
5
Augmentation F1 score Recall Precision
Default_CJ, Default_N 0.9119 0.8647 0.9645
Default_CJ, Default_N, S&P 0.9024 0.8493 0.9627
Default_CJ, Default_N, GB, B 0.8967 0.849 0.9501
Augmentation F1 score Recall Precision
Default_CJ, Default_N 0.8779 0.9214 0.8383
CJ, N 0.8532 0.8692 0.8377
GN, N 0.7978 0.7755 0.8214
CJ, GB, B, N 0.8843 0.8735 0.8954
CJ, GB, B, GN, N 0.8634 0.8618 0.8651
CJ, GB, B, HSV, N 0.8807 0.9019 0.8604
CJ, GB, HSV, N 0.9124 0.8665 0.9651

Denoise

6
  • ํ‰๊ฐ€ ๋ฐ์ดํ„ฐ์…‹ ๋‚ด์˜ ๋…ธ์ด์ฆˆ๋Š” ๋ชจ๋ธ์˜ ์„ฑ๋Šฅ์— ๋ถ€์ •์ ์ธ ์˜ํ–ฅ์„ ๋ฏธ์น  ๊ฐ€๋Šฅ์„ฑ์ด ๋†’๋‹ค๊ณ  ํŒ๋‹จํ•จ.
  • Cycle GAN์„ ํ™œ์šฉํ•˜์—ฌ ์ด๋ฏธ์ง€ ๋‚ด์˜ ์ƒ๋‹น์ˆ˜์˜ ๋…ธ์ด์ฆˆ๋ฅผ ์ œ๊ฑฐํ•จ.

Background Remove

7 8
  • ํ‰๊ฐ€ ๋ฐ์ดํ„ฐ์…‹ ์ถ”๋ก  ๊ฒฐ๊ณผ ๋ฌธ์„œ ์™ธ๋ถ€ ๋ฐฐ๊ฒฝ ๋ถ€๋ถ„์—์„œ ๋‹ค์ˆ˜์˜ ๋…ธ์ด์ฆˆ ๊ฒ€์ถœ ํ™•์ธํ•จ.
  • ๋ชจ๋ธ์˜ ๋ฐฐ๊ฒฝ ๋…ธ์ด์ฆˆ ๊ฒ€์ถœ์ด ์ค„์–ด๋“ค ๊ฒƒ์„ ๊ฐ€์ •ํ•˜์—ฌ ๋ฐฐ๊ฒฝ ์ œ๊ฑฐ ํ›„ ํ‰๊ฐ€ ๋ฐ์ดํ„ฐ์…‹์— ๋Œ€ํ•œ ์ถ”๋ก  ์ˆ˜ํ–‰ํ•จ.
Dataset F1 score Recall Precision
Original 0.9106 0.915 0.9061
Background removed 0.8608 0.8758 0.8463

Super Resolution

9 10
  • ์ œ๊ณต๋œ ๋ฐ์ดํ„ฐ์…‹์˜ ๊ฒฝ์šฐ ๊ธ€์ž๋“ค์˜ ํฌ๊ธฐ๊ฐ€ ๋Œ€๋ถ€๋ถ„์€ ์ž‘์€ ๊ฒƒ์„ ํ™•์ธํ•˜์—ฌ ์ดˆํ•ด์ƒ๋„ ๊ธฐ๋ฒ•์„ ์ ์šฉํ•˜์—ฌ ์›๋ณธ ์ด๋ฏธ์ง€ ๋Œ€๋น„ 2๋ฐฐ, 4๋ฐฐ ํ•ด์ƒ๋„์˜ ์ด๋ฏธ์ง€๋ฅผ ์ƒ์„ฑํ•จ.
  • ์„œ๋ฒ„ GPU ๋ฉ”๋ชจ๋ฆฌ ํ•œ๊ณ„๋กœ ์›๋ณธ ์ด๋ฏธ์ง€์— ์ง์ ‘ SR์„ ์ ์šฉํ•˜๊ธฐ ์–ด๋ ค์›Œ์„œ ์ด๋ฏธ์ง€๋ฅผ 8๋“ฑ๋ถ„์œผ๋กœ ์ž๋ฅธ ๋’ค SR์„ ์ ์šฉํ•จ.
Dataset F1 score Recall Precision
Original 0.9106 0.915 0.9061
SR x2 0.9381 0.9392 0.9369
SR x4 0.941 0.9369 0.9451

Corner Crop

12
  • ์ด๋ฏธ์ง€์˜ ์šฐ์ธก ์ƒ๋‹จ์— QR code ์˜† ์„ธ๋กœ ๊ธ€์”จ์— ๋Œ€ํ•œ ๊ฒ€์ถœ ์„ฑ๋Šฅ์ด ๋ถ€์กฑํ•˜์—ฌ ์˜๋„์ ์œผ๋กœ Coner ๋ถ€๋ถ„์„ ํฌํ•จ์‹œ์ผœ ํ•™์Šต์„ ์ง„ํ–‰ํ•จ

Ensemble

13
  • ๋ฌธ์ž ๊ฒ€์ถœ ์‹œ์— Confidence Score๋ฅผ ์‚ฐ์ถœํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— ๋…ธ์ด์ฆˆ๋ผ๊ณ  ๊ฐ„์ฃผ๋˜๋Š” ๋‚ฎ์€ ์‹ ๋ขฐ๋„ ์˜์—ญ์„ ์‹๋ณ„ํ•˜๋Š”๋ฐ ์–ด๋ ค์›€์ด ์žˆ์Œ.
  • Noise Filtering : ์„ค์ •ํ•œ ์ž„๊ณ„๊ฐ’๋ณด๋‹ค ์ ์€ ์ˆ˜ ์˜ ๋ชจ๋ธ์ด ์˜ˆ์ธกํ•œ ์˜์—ญ์˜ ๊ฒฝ์šฐ ๋…ธ์ด์ฆˆ๋ผ๊ณ  ๊ฐ„์ฃผ
  • Small box Filtering : ์ž‘์€ ๋ฐ•์Šค๋“ค ์ค‘ IoU ๊ฐ’์ด ๋‚ฎ์•„ ์•™์ƒ๋ธ”์„ ํ†ตํ•ด ํ•ฉ์ณ์ง€์ง€ ์•Š๋Š” ๊ฒฝ์šฐ ์ œ๊ฑฐ
Ensemble F1 score Recall Precision
Model Average 0.9364 0.9357 0.9371
Noise Filtering 0.9485 0.9479 0.9491
Noise Filtering & Small box filtering 0.9503 0.9479 0.9526

๐Ÿ“ˆ Experimental Result

No Ensemble Dataset Image Size F1 score Recall Precision
0 Single Original $[1024,1536,2048]$ 0.9106 0.915 0.9061
1 Single Original $[1024,1536,2048,4096]$ 0.9303 0.9312 0.9294
2 Single SR x2 $[1024,1536,2048,4096]$ 0.9381 0.9392 0.9369
3 Single SR x4 $[1024,1536,2048,4096,8192]$ 0.9410 0.9369 0.9451
4 Single SR x4 $[1024,1536,2048,4096$,
$8192,12288,16384]$
0.9389 0.9355 0.9424
$\mathbf{5}$ $\mathbf{1}+\mathbf{2}+\mathbf{3}$ - - $\mathbf{0 . 9 5 0 6}$ $\mathbf{0 . 9 5 0 3}$ $\mathbf{0 . 9 5 0 8}$

Conclusion & Discussion

Conclusion

๋ณธ ๋Œ€ํšŒ์˜ ๋ชฉํ‘œ๋Š” ๋ณ‘์› ์˜์ˆ˜์ฆ์— ํฌํ•จ๋œ ๊ธ€์ž๋ฅผ ์ •ํ™•ํžˆ ๊ฒ€์ถœํ•˜๋Š” ๊ฒƒ์ด ๋ชฉํ‘œ์ด๋‹ค. EDA๋ฅผ ํ†ตํ•ด ํ•™์Šต ๋ฐ์ดํ„ฐ์…‹๊ณผ ๋‹ฌ๋ฆฌ ํ‰๊ฐ€ ๋ฐ์ดํ„ฐ์…‹์— ๋งŽ์€ ๋…ธ์ด์ฆˆ๊ฐ€ ํฌํ•จ๋œ ๊ฒƒ์„ ํ™•์ธํ•˜์˜€๋‹ค. ์ด๋ฅผ ํ•ด๊ฒฐํ•˜๊ณ ์ž ๋ฐฐ๊ฒฝ ์ œ๊ฑฐ, ๋…ธ์ด์ฆˆ ์ œ๊ฑฐ, ์ดˆํ•ด์ƒ๋„ ๊ธฐ๋ฒ•, ๋ฐ์ดํ„ฐ ์ฆ๊ฐ•์„ ์ ์šฉํ•˜์˜€๋‹ค. ํŠนํžˆ ์ดˆํ•ด์ƒ๋„ ๊ธฐ๋ฒ•์„ ํ†ตํ•ด Recall๊ณผ Precision ๋ชจ๋‘ ํฐ ํญ์˜ ์„ฑ๋Šฅ ํ–ฅ์ƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค. ์ดํ›„ ๊ฒฐ๊ณผ ๋ฐ์ดํ„ฐ ๋ถ„์„์„ ํ†ตํ•ด ์•™์ƒ๋ธ”์„ ์ ์šฉํ•˜์—ฌ ์ข‹์€ ์„ฑ์ ์„ ๋‚ผ ์ˆ˜ ์žˆ์—ˆ๋‹ค.

Discussion

๋ฐ์ดํ„ฐ ํด๋ Œ์ง• & ๋ฆฌ๋ ˆ์ด๋ธ”๋ง

์ง€๋‚œ ๋Œ€ํšŒ์—์„œ ํ›ˆ๋ จ ๋ฐ์ดํ„ฐ์…‹๊ณผ ํ‰๊ฐ€ ๋ฐ์ดํ„ฐ์…‹์˜ ๋ ˆ์ด๋ธ”๋ง์— ๋Œ€ํ•œ ๋น„์Šทํ•œ ์–‘์ƒ์˜ ์˜ค๋ฅ˜๊ฐ€ ์กด์žฌํ•˜์˜€๋‹ค. ๋ณธ ๋Œ€ํšŒ๋„ ๋น„์Šทํ•œ ์–‘์ƒ์œผ๋กœ ํŒ๋‹จํ•˜์—ฌ ํด๋ Œ์ง• ์ž‘์—…๊ณผ ๋ฆฌ๋ ˆ์ด๋ธ”๋ง ์ž‘์—…์„ ์ƒ๋žตํ•˜์˜€๋‹ค.

๋Œ€ํšŒ ๊ฐ€์ด๋“œ๋ผ์ธ ๋ณ€๊ฒฝ

๋Œ€ํšŒ ์ง„ํ–‰ ์ค‘ ํ‰๊ฐ€ ๋ฐ์ดํ„ฐ์…‹ ์ „์ฒ˜๋ฆฌ ๊ฐ€์ด๋“œ๋ผ์ธ ๋ณ€๊ฒฝ์œผ๋กœ ํ‰๊ฐ€ ๋ฐ์ดํ„ฐ์…‹์— ๋Œ€ํ•œ ๋‹ค์–‘ํ•œ ์ „์ฒ˜๋ฆฌ ๊ธฐ๋ฒ•์„ ์ตœ๋Œ€ํ•œ ํ™œ์šฉํ•˜์ง€ ๋ชปํ–ˆ๋‹ค.

ํ‰๊ฐ€ ๋ฐ์ดํ„ฐ์™€ ์œ ์‚ฌํ•œ ๊ฒ€์ฆ ๋ฐ์ดํ„ฐ์…‹ ๊ตฌ์ถ•

ํ•™์Šต ๋ฐ์ดํ„ฐ์…‹๊ณผ ๋‹ฌ๋ฆฌ ๋งŽ์€ ๋…ธ์ด์ฆˆ๊ฐ€ ํฌํ•จ๋œ ํ‰๊ฐ€ ๋ฐ์ดํ„ฐ์…‹์ด ์ฃผ์–ด์กŒ๋‹ค. ๋”ฐ๋ผ์„œ ํ‰๊ฐ€ ๋ฐ์ดํ„ฐ์…‹๊ณผ ๊ฒฝํ–ฅ์„ฑ์ด ์œ ์‚ฌํ•œ ๊ฒ€์ฆ ๋ฐ์ดํ„ฐ์…‹์„ ์ฐพ๊ธฐ ์–ด๋ ค์› ๋‹ค.

K-fold

bbox๋ณ„ confidence score๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š์•„ ๋ชจ๋ธ์˜ voting์ด ์ด๋ฃจ์–ด์งˆ ์ˆ˜ ์—†๋‹ค. ๋”ฐ๋ผ์„œ ์ผ๋ฐ˜์ ์ธ ์•™์ƒ๋ธ” ๋ฐฉ์‹๊ณผ๋Š” ๋‹ค๋ฅด๊ฒŒ ํ•„ํ„ฐ๋ง ์กฐ๊ฑด๋“ค์„ ์ง์ ‘ ๊ตฌํ˜„ํ•˜์˜€๋‹ค.

About

level2-cv-datacentric-cv-01 created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages