Skip to content

bsm8734/mask-wearing-image-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

์ด๋ฏธ์ง€๋ถ„๋ฅ˜ ๊ฒฝ์ง„๋Œ€ํšŒ

  • ๋ถ€์ŠคํŠธ์บ ํ”„ AI Tech 1๊ธฐ ๊ณผ์ • ์ค‘, P stage 1 ๊ธฐ๊ฐ„ ๋™์•ˆ ์ฐธ์—ฌํ•œ ์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜ ๊ฒฝ์ง„๋Œ€ํšŒ ์†Œ์Šค์ฝ”๋“œ ์ž…๋‹ˆ๋‹ค.
  • ๋Œ€ํšŒ๊ธฐ๊ฐ„: 2021.03. ~ 2021.04 (2 weeks)

๋Œ€ํšŒ ์„ค๋ช…

  • ์–ผ๊ตด์„ ์ •๋ฉด์œผ๋กœ ์ฐ์€ ์‚ฌ์ง„์ด ์ž…๋ ฅ์œผ๋กœ ์ฃผ์–ด์ง‘๋‹ˆ๋‹ค. (์ด 18,000์žฅ)
  • ๋งˆ์Šคํฌ ์ •์ƒ ์ฐฉ์šฉ ์—ฌ๋ถ€(3) * ๋‚˜์ด๋Œ€(3) * ์„ฑ๋ณ„(2) = 18 classes
  • ์ด 18๊ฐœ์˜ ํด๋ž˜์Šค๋กœ ์ด๋ฏธ์ง€๋ฅผ ๋ถ„๋ฅ˜ํ•˜๋Š” ๊ฒฝ์ง„๋Œ€ํšŒ์ž…๋‹ˆ๋‹ค.
  • ํ‰๊ฐ€์ง€ํ‘œ๋Š” f1-score๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

๊ฒฐ๊ณผ

  • Public LB Score
    • Accuracy: 81.2381%
    • F1-score: 0.7716
    • Rank: 21๋“ฑ (21/223)
  • Private LB Score
    • Accuracy: 80.3651%
    • F1-score: 0.7541
    • Rank: 28๋“ฑ (28/223)

๋ฐ์ดํ„ฐ ์„ค๋ช…

  • ๋Œ€์ƒ: ์•„์‹œ์•„์ธ ๋‚จ๋…€, 20๋Œ€~70๋Œ€
  • ์ „์ฒด ์‚ฌ๋žŒ ์ˆ˜ : 4,500
  • ํ•œ ์‚ฌ๋žŒ๋‹น ์‚ฌ์ง„์˜ ๊ฐœ์ˆ˜: 7
    • ๋งˆ์Šคํฌ ์ •์ƒ ์ฐฉ์šฉ: 5์žฅ
    • ๋งˆ์Šคํฌ ๋ถˆ๋Ÿ‰ ์ฐฉ์šฉ: 1์žฅ
    • ๋งˆ์Šคํฌ ๋ฏธ์ฐฉ์šฉ: 1์žฅ
  • ์ด๋ฏธ์ง€ ํฌ๊ธฐ: (384, 512)
๋ฐ์ดํ„ฐ ์ƒ์„ธ Description ๋ณด๊ธฐ

ํ•™์Šต๋ฐ์ดํ„ฐ, ํ…Œ์ŠคํŠธ ๋ฐ์ดํ„ฐ

  • ๋ฐ์ดํ„ฐ ๋ถ„ํ• 
    • ํ•™์Šต๋ฐ์ดํ„ฐ 60%
    • public ํ…Œ์ŠคํŠธ์…‹ 20%
    • private ํ…Œ์ŠคํŠธ์…‹ 20%

์ž…์ถœ๋ ฅ

  • ์ž…๋ ฅ: ๋งˆ์Šคํฌ ์ฐฉ์šฉ ์‚ฌ์ง„, ๋ฏธ์ฐฉ์šฉ ์‚ฌ์ง„, ํ˜น์€ ์ด์ƒํ•˜๊ฒŒ ์ฐฉ์šฉํ•œ ์‚ฌ์ง„(์ฝ”์Šคํฌ, ํ„ฑ์Šคํฌ)

  • ์ถœ๋ ฅ: ์ด 18๊ฐœ์˜ class๋ฅผ ์˜ˆ์ธกํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. ๊ฒฐ๊ณผ๊ฐ’์œผ๋กœ 0~17์— ํ•ด๋‹น๋˜๋Š” ์ˆซ์ž๊ฐ€ ๊ฐ ์ด๋ฏธ์ง€ ๋‹น ํ•˜๋‚˜์”ฉ ๋‚˜์™€์•ผํ•ฉ๋‹ˆ๋‹ค.

    ์˜ˆ์‹œ
    • the class of cfe1268.jpg : 7
    • the class of 3a2662c.jpg : 2

ํด๋ž˜์Šค ๋ถ„๋ฅ˜ ๊ธฐ์ค€

  • ๋งˆ์Šคํฌ ์ฐฉ์šฉ์—ฌ๋ถ€, ์„ฑ๋ณ„, ๋‚˜์ด๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์ด 18๊ฐœ์˜ ํด๋ž˜์Šค๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

    ์ƒ์„ธ ๋ถ„๋ฅ˜ ๊ธฐ์ค€ ๋ณด๊ธฐ

ํ‰๊ฐ€๋ฐฉ์‹

  • Submission ํŒŒ์ผ์„ ์ฑ„์ ์„œ๋ฒ„์— ์˜ฌ๋ฆฌ๋ฉด, F1-Score๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๊ฒฐ๊ณผ๋ฅผ ๋ณด์—ฌ์ฃผ๋Š” ๋ฐฉ์‹์ž…๋‹ˆ๋‹ค.
  • ํ‰๊ฐ€๊ธฐ์ค€: F1-score

์‹œ๋„ํ•œ ๋ฐฉ๋ฒ•๋“ค ๋ฐ ๊ฒฐ๊ณผ

Index Model(Backbone) Trial Score
1 VGG11 - Accuracy: 45.8600%
- F1-score: 0.3300
2 ResNet50 - Adam optimizer
- CE loss
- Accuracy: 54.2500%
- F1-score: 0.5400
3 EfficientNet b4 - Random-crop(256, 128)
- AdamP optimizer
- Focal loss
- Accuracy: 73.6984%
- F1-score: 0.6986
4 ResNet50 - Age filter(58)
- CenterCrop(380,380)
- MADGRAD optimizer
- Accuracy: 73.6984%
- F1-score: 0.7206
5 EfficientNet b4 - CLAHE(์ „์ฒ˜๋ฆฌ)
- Age filter(58)
- CenterCrop(380,380)
- Label smoothing loss(0.05)
- MADGRAD optimizer
- Accuracy: 79.2857%
- F1-score: 0.7493
6 EfficientNet b4 - Face-crop Augmentation
- Age filter(58)
- Label smoothing loss(0.05)
- MADGRAD optimizer
- Accuracy: 80.0952%
- F1-score: 0.7582
7 EfficientNet b4 - Age filter(58)
- Label smoothing loss(0.05)
- MADGRAD optimizer
- Accuracy: 80.8730%
- F1-score: 0.7681
8 EfficientNet b4 - Age filter(58)
- Label smoothing loss(0.05)
- MADGRAD optimizer
+ fine tuning(SGD)
- Accuracy: 81.2381%
- F1-score: 0.7716

์†Œ์Šค์ฝ”๋“œ ์„ค๋ช…

Efficientnet_b4

  • efficientnet b4 pretrained model ์‚ฌ์šฉ
  • loss function์„ ๋ฐ”๊ฟ”๊ฐ€๋ฉฐ ์‹คํ—˜
  • optimizer๋กœ Adamp, MADGRAD ์‚ฌ์šฉํ•ด๋ด„
  • Age Filter: 60์„ธ ์ด์ƒ ๊ทธ๋ฃน์˜ ๋ ˆ์ด๋ธ”์„ ์ž„์˜๋กœ 58์„ธ ์ด์ƒ ๋ฐ์ดํ„ฐ๋กœ ์กฐ์ •ํ•˜์—ฌ ์‚ฌ์šฉ

K_fold_Efficientnet_b4

  • ์œ„์˜ Efficientnet_b4 ๊ตฌ์กฐ์— K-fold๋ฅผ ์ถ”๊ฐ€
  • dataset.py > MaskSplitByStratifiedProfileDataset ํด๋ž˜์Šค ์ถ”๊ฐ€ ๊ตฌํ˜„

Resnet50

  • Resnet50 pretrained model ์‚ฌ์šฉํ•˜์—ฌ ์ „์ดํ•™์Šต

VGG11

  • VGG11 pretrained model ์‚ฌ์šฉํ•˜์—ฌ ์ „์ดํ•™์Šต

CLAHE

  • Contrast Limited Adaptive Histogram Equalization
  • ํƒ€์ผ(8*8)๋‹จ์œ„ ์ด๋ฏธ์ง€ ํžˆ์Šคํ† ๊ทธ๋žจ ๊ท ์ผํ™”
  • ํƒ€์ผ๊ฐ„ ๊ฒฝ๊ณ„๋ถ€๋ถ„์€ Bilinear interpolation ์ ์šฉ
  • ์ด๋ฏธ์ง€ ํžˆ์Šคํ† ๊ทธ๋žจ ๊ท ์ผํ™”๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ์…‹ ์ƒ์„ฑ

FacialDetection

  • opencv CascadeClassifier ์‚ฌ์šฉ
  • ์–ผ๊ตด ๋ถ€์œ„๋ฅผ ์ค‘์‹ฌ์œผ๋กœ 380*380 ์ด๋ฏธ์ง€๋ฅผ cropํ•˜์—ฌ ๋ฐ์ดํ„ฐ์…‹ ์ƒ์„ฑ

Fine_tuning_SGD

  • 60์„ธ ์ด์ƒ ๊ทธ๋ฃน์˜ ๋ ˆ์ด๋ธ”์„ ์ž„์˜๋กœ 58์„ธ ์ด์ƒ ๋ฐ์ดํ„ฐ๋กœ ์กฐ์ •ํ•ด

MISC

  • DataAnalysis
  • Data_processing

๊ฒฝ์ง„๋Œ€ํšŒ ๊ณผ์ •์— ๋Œ€ํ•œ ๊ธฐ๋ก, ์‚ฌ์šฉํ•œ ์•„ํ‚คํ…์ฒ˜๋Š” Notion์— wrap-up report๋กœ ์˜ฌ๋ ค๋‘์—ˆ์Šต๋‹ˆ๋‹ค.

About

๐Ÿ˜ˆ Image classification competition code

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published