Skip to content

boostcampaitech7/level2-cv-semanticsegmentation-cv-10-lv3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

38 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Hand Bone Segmentation Project

๐Ÿ“‹ Overview

๋ผˆ๋Š” ์šฐ๋ฆฌ ๋ชธ์˜ ๊ตฌ์กฐ์™€ ๊ธฐ๋Šฅ์— ์ค‘์š”ํ•œ ์˜ํ–ฅ์„ ๋ฏธ์น˜๊ธฐ ๋•Œ๋ฌธ์—, ์ •ํ™•ํ•œ ๋ผˆ ๋ถ„ํ• ์€ ์˜๋ฃŒ ์ง„๋‹จ ๋ฐ ์น˜๋ฃŒ ๊ณ„ํš์„ ๊ฐœ๋ฐœํ•˜๋Š” ๋ฐ ํ•„์ˆ˜์ ์ด๋‹ค. Bone Segmentation์€ ์ธ๊ณต์ง€๋Šฅ ๋ถ„์•ผ์—์„œ ์ค‘์š”ํ•œ ์‘์šฉ ๋ถ„์•ผ ์ค‘ ํ•˜๋‚˜๋กœ, ํŠนํžˆ, ๋”ฅ๋Ÿฌ๋‹ ๊ธฐ์ˆ ์„ ์ด์šฉํ•œ ๋ผˆ Segmentation์€ ๋งŽ์€ ์—ฐ๊ตฌ๊ฐ€ ์ด๋ฃจ์–ด์ง€๊ณ  ์žˆ์œผ๋ฉฐ, ๋‹ค์–‘ํ•œ ๋ชฉ์ ์œผ๋กœ ๋„์›€์„ ์ค„ ์ˆ˜ ์žˆ๋‹ค.

  • ์งˆ๋ณ‘ ์ง„๋‹จ : ์† ๋ผˆ ๋ณ€ํ˜•, ๊ณจ์ ˆ ๋“ฑ ์ด์ƒ ํƒ์ง€
  • ์ˆ˜์ˆ  ๊ณ„ํš : ๋ผˆ ๊ตฌ์กฐ ๋ถ„์„์„ ํ†ตํ•œ ์ˆ˜์ˆ  ๋ฐฉ์‹ ๊ฒฐ์ •
  • ์˜๋ฃŒ ์žฅ๋น„ ์ œ์ž‘ : ์ธ๊ณต ๊ด€์ ˆ, ์ž„ํ”Œ๋ž€ํŠธ ๋“ฑ์˜ ๋งž์ถค ์ œ์ž‘
  • ์˜๋ฃŒ ๊ต์œก : ๋ผˆ ๊ตฌ์กฐ ํ•™์Šต ๋ฐ ์ˆ˜์ˆ  ์‹œ๋ฎฌ๋ ˆ์ด์…˜
image



๐Ÿ‘ฅ Member


๊น€๋Œ€ํ™˜

๋ฐ•์œค์ค€

๊น€ํ˜„์ง„

์œค์˜์„œ

์ •์ง€์œค



๐Ÿ” EDA

๋ฐ์ดํ„ฐ์…‹ ๊ฐœ์š”

  • ๊ตฌ์„ฑ : ์ด 2048x2048 ํ•ด์ƒ๋„์˜ X-ray ์ด๋ฏธ์ง€๋กœ ๊ตฌ์„ฑ๋œ ๋ฐ์ดํ„ฐ์…‹, ์–‘์† ๋ชจ๋‘ ํฌํ•จ
  • ํด๋ž˜์Šค : 29๊ฐœ์˜ ์† ๋ผˆ ๋ ˆ์ด๋ธ” ํฌํ•จ
  • ๊ตฌ์กฐ : ๋ชจ๋“  ๋ฐ์ดํ„ฐ๊ฐ€ ์ขŒ์šฐ ์†์œผ๋กœ ์Œ์„ ์ด๋ฃธ

ํŠน์ง•

  • ID363 ๋ฐ์ดํ„ฐ๋Š” ์•…์„ธ์„œ๋ฆฌ(๋ฐ˜์ง€)๋ฅผ ์ฐฉ์šฉํ•˜๊ณ  ์žˆ์Œ
  • ์ผ๋ถ€ ๋ฐ์ดํ„ฐ(ID274~321)๋Š” ์ผ๋ฐ˜์ ์ธ ์† ์ž์„ธ์™€ ๋‹ค๋ฅธ ํฌ์ฆˆ๋ฅผ ์ทจํ•œ ๋ฐ์ดํ„ฐ
  • ์†๋“ฑ ๋ผˆ(Trapezoid, Pisiform ๋“ฑ) ๊ฐ„ ๊ฒน์นจ์ด ๋ฐœ์ƒํ•˜๋ฉฐ, ํ•ด๋‹น ํด๋ž˜์Šค์˜ ์ •ํ™•๋„๊ฐ€ ๋‹ค๋ฅธ ํด๋ž˜์Šค๋ณด๋‹ค ๋‚ฎ์Œ(Val acc 0.90)
  • ์†๊ฐ€๋ฝ ๋ ๋ถ€๋ถ„ (f1, f4, f8, ,f12, f16) ์„ฑ๋Šฅ์ด ๋‚ฎ์Œ (Val acc 0.95)
image

๋ฌธ์ œ ์ •์˜

  • ์†์ด ํœ˜์–ด์ง„ ๋ฐ์ดํ„ฐ๋ฅผ ๋Œ€์‘ํ•˜๊ธฐ ์œ„ํ•ด Rotate ์ฆ๊ฐ• (limit=15,30) ์œผ๋กœ ์ ์šฉ
  • ์†๋“ฑ ๋ถ€๋ถ„์„ Cropํ•˜์—ฌ ๋ชจ๋ธ์ด ํ•ด๋‹น ์˜์—ญ์„ ์ง‘์ค‘์ ์œผ๋กœ ํ•™์Šตํ•  ์ˆ˜ ์žˆ๋„๋ก ๋ฐ์ดํ„ฐ ์ „์ฒ˜๋ฆฌ ๋ฐ ํ•™์Šต ๊ณผ์ • ์„ค๊ณ„
  • ํด๋ž˜์Šค ๊ฐ„ ๊ฒฝ๊ณ„ ๊ฐœ์„ ์„ ์œ„ํ•ด ElasticTransform ์ถ”๊ฐ€ ์ฆ๊ฐ• ์ ์šฉ
  • ์ž‘๊ณ  ๊ฒน์น˜๋Š” ํด๋ž˜์Šค์˜ ์„ฑ๋Šฅ ํ–ฅ์ƒ์„ ์œ„ํ•ด ์ด๋ฏธ์ง€ ํฌ๊ธฐ๋ฅผ 512์—์„œ 1024, 2048๋กœ ์ ์ง„์ ์œผ๋กœ ํ™•๋Œ€ํ•˜๋ฉฐ ํ•™์Šต์„ ์ง„ํ–‰



๐Ÿ› ๏ธ Methods

Model Selection

๋ชจ๋ธ Image size Epoch Time Score
Unet 512 100 3.5 h 93.72 %
Unet++ 512 100 4.3 h 95.01 %

์œ„์˜ 2๊ฐœ ๋ชจ๋ธ ๊ฐ„ ์„ฑ๋Šฅ ์ฐจ์ด๋Š” ์•ฝ 0.2%๋กœ ์ฐจ์ด๊ฐ€ ์žˆ์—ˆ์œผ๋ฉฐ, ํ•™์Šต ์‹œ๊ฐ„ ์—ญ์‹œ ์•ฝ 40๋ถ„ ์ฐจ์ด์— ๋ถˆ๊ณผํ•˜์—ฌ Base ๋ชจ๋ธ๋กœ UNet++์„ ์„ ์ •ํ•˜๊ณ  ๋‹ค์–‘ํ•œ ์‹คํ—˜์„ ์ง„ํ–‰ํ–ˆ๋‹ค. ๋ฐ˜๋ฉด, ๋‹ค๋ฅธ ๋ชจ๋ธ(Segformer, Convnext, DeepLab3v+)๋“ค์€ ํ•™์Šต ์‹œ๊ฐ„์ด 6~7์‹œ๊ฐ„ ์ •๋„ ์†Œ์š”๋˜์–ด Base ๋ชจ๋ธ์—์„œ ์ œ์™ธํ•˜์˜€๋‹ค.

Augmentation

Base UNet++ ๋ชจ๋ธ์„ ๊ธฐ์ค€์œผ๋กœ Augmentation ๊ธฐ๋ฒ•์„ ํ•˜๋‚˜์”ฉ ๋ณ€๊ฒฝํ•˜๋ฉฐ ๋‹จ๊ณ„์ ์œผ๋กœ ์‹คํ—˜

Augmentation Condition Epoch Score Result
Base Base 100 95.08 % Base
HorizontalFlip p=0.5 100 95.33 % 0.25 % ์ƒ์Šน
GaussianBlur blur_limit=(3, 7), sigma_limit=(0.1, 2), p=0.5 100 95.61 % 0.32 % ์ƒ์Šน
ElasticTransform alpha=1, sigma=50, p=0.5 100 95.43 % 0.35 % ์ƒ์Šน
GridDistortion ratio=0.4, random_offset=False, holes_number_x=12, holes_number_y=12, p=0.2 100 95.42 % 0.34 % ์ƒ์Šน
Rotate limit=30, p=0.3 100 95.28 % 0.20 % ์ƒ์Šน
CLAHE clip_limit=(1, 4), tile_grid_size=(8, 8), p=0.5 100 95.33 % 0.25 % ์ƒ์Šน
RandomBrightnessContrast brightness_limit=(0.0, 0.3), contrast_limit=0.3, p=0.5 100 95.10 % 0.02 % ์ƒ์Šน
GridDropout distort_limit=0.2, p=0.4 100 95.10 % 0.02 % ์ƒ์Šน

์ตœ์ข…์ ์œผ๋กœ ์„ฑ๋Šฅ์ด ์ƒ์Šนํ•œ Augmentation ๊ธฐ๋ฒ•์„ ์ฑ„ํƒํ•œ ๋’ค, ์ถ”๊ฐ€์ ์ธ ์‹คํ—˜์„ ์ด์–ด๊ฐ”๋‹ค.

EDA ๊ณผ์ •์—์„œ ๋ฐœ๊ฒฌ๋œ ๋ฌธ์ œ์ ์ธ ์†๋“ฑ ๋ผˆ ์˜์—ญ์˜ ์„ฑ๋Šฅ ์ €ํ•˜๋ฅผ ๊ฐœ์„ ํ•˜๊ธฐ ์œ„ํ•ด CenterCrop, RandomCrop, RandomResizedCrop ๋“ฑ์˜ Crop ๊ธฐ๋ฐ˜ ๊ธฐ๋ฒ•์„ ์‚ฌ์šฉํ•˜์—ฌ ํ•™์Šต์„ ์‹œ๋„ํ–ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜, ์ด๋Ÿฌํ•œ ๋ฐฉ์‹์€ ์˜คํžˆ๋ ค ์„ฑ๋Šฅ์ด ๋–จ์–ด์ง€๋Š” ๊ฒฐ๊ณผ๋ฅผ ๋ณด์˜€๋‹ค.

์ด์— ๋”ฐ๋ผ, ์ƒˆ๋กœ์šด ์ ‘๊ทผ์œผ๋กœ Sliding Window์™€ Image Crop์„ ์ ์šฉํ•˜์—ฌ ํ•™์Šต์„ ์ง„ํ–‰ํ–ˆ๋‹ค. Sliding Window๋Š” ์ด๋ฏธ์ง€๋ฅผ ํƒ€์ผ๋กœ ๋ถ„ํ• ํ•ด ํ•™์Šตํ•˜๊ณ , Image Crop์€ ์†๋“ฑ ์ค‘์‹ฌ์œผ๋กœ ํŠน์ • ์˜์—ญ์„ ์ž˜๋ผ ํ•™์Šต์— ์ง‘์ค‘ํ•˜๋„๋ก ํ•˜์—ฌ ์„ฑ๋Šฅ ํ–ฅ์ƒ์„ ๋„๋ชจํ–ˆ๋‹ค.

Sliding Window, Image Crop ํ•™์Šต ์‹คํ—˜

๊ธฐ์กด์˜ Crop ๊ธฐ๋ฐ˜ Augmentation์€ ์„ฑ๋Šฅ์ด ์ €ํ•˜๋˜๋Š” ๊ฒฐ๊ณผ๋ฅผ ๋ณด์˜€๊ณ , ์†๋“ฑ ๋ผˆ์˜ ์ •ํ™•๋„ ํ–ฅ์ƒ์„ ๋ชฉํ‘œ๋กœ ์ƒˆ๋กœ์šด ๋ฐฉ์‹์˜ Crop ๊ธฐ๋ฒ•์„ ๋„์ž…ํ•˜์—ฌ ์‹คํ—˜์„ ์ง„ํ–‰ํ–ˆ๋‹ค.

Sliding Window

  1. Datasets์„ ๋งŒ๋“ค ๋•Œ, ์ด๋ฏธ์ง€๋ฅผ ๋ถˆ๋Ÿฌ์™€ Tile(512x512, Stride 256)์„ ์ƒ์„ฑ
  2. ์ด ์ค‘ ํ•™์Šตํ•  ์ˆ˜ ์žˆ๋Š” ๋ถ€๋ถ„์ด 10% ๋ฏธ๋งŒ์ผ ๊ฒฝ์šฐ ์ œ์™ธ
  3. ๋ฉ”๋ชจ๋ฆฌ ํ•œ๊ณ„(OOM) ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ์ด๋ฏธ์ง€๋ฅผ 3๊ฐœ์˜ ํŒŒํŠธ๋กœ ๋ถ„ํ• ํ•˜์—ฌ ํ•™์Šต
  4. Inference ๋‹จ๊ณ„์—์„ธ๋„ ๋™์ผํ•˜๊ฒŒ ์ด๋ฏธ์ง€๋ฅผ Tileํ™” ํ•˜์—ฌ ์˜ˆ์ธก ๊ฒฐ๊ณผ๋ฅผ ์ถœ๋ ฅ

๊ฒฐ๊ณผ

Model result
BaseModel 94.09 %
SlidingWindow 86.16 %

์„ฑ๋Šฅ์ด ํฌ๊ฒŒ ๋–จ์–ด์ง„ ์›์ธ์œผ๋กœ๋Š” ์ด๋ฏธ์ง€ ๊ฐ„ ์ฐจ์ด๊ฐ€ ํฐ ๋ฐ์ดํ„ฐ ํŠน์„ฑ, ์ถฉ๋ถ„ํ•œ Epoch ํ•™์Šต ๋ถ€์กฑ, ๊ทธ๋ฆฌ๊ณ  ์ด๋ฏธ์ง€๋ฅผ 3ํŒŒํŠธ๋กœ ๋‚˜๋ˆ„์–ด ํ•™์Šตํ•œ ๋ฐฉ์‹์˜ ํ•œ๊ณ„๊ฐ€ ์ฃผ์š” ์š”์ธ์œผ๋กœ ๋ถ„์„๋œ๋‹ค.

Image Crop ํ•™์Šต ํ›„ ๊ฒฐ๊ณผ ์ ์šฉ

  1. ์†๋“ฑ ๋ผˆ์˜ ์œ„์น˜๋ฅผ ์ •ํ™•ํžˆ ์‹๋ณ„ํ•˜์—ฌ ํ•ด๋‹น ์˜์—ญ์˜ ์ขŒํ‘œ๋ฅผ ๊ตฌํ•จ
  2. ์†๋“ฑ ๋ผˆ๊ฐ€ ํฌํ•จ๋œ ๋ฒ”์œ„๋ฅผ ๊ธฐ์ค€์œผ๋กœ Train ์ด๋ฏธ์ง€๋ฅผ 512x512 ํฌ๊ธฐ๋กœ ์ž˜๋ผ ํ•™์Šต ๋ฐ์ดํ„ฐ ์ƒ์„ฑ
  3. ์†๋“ฑ ๋ผˆ ์˜์—ญ๋งŒ์„ ์ง‘์ค‘์ ์œผ๋กœ ํ•™์Šตํ•˜์—ฌ ์„ฑ๋Šฅ ํ–ฅ์ƒ ๋„๋ชจ
  4. Pseudo Labeling ๊ฒฐ๊ณผ๋ฅผ ํ™œ์šฉํ•˜์—ฌ Test ์ด๋ฏธ์ง€์—์„œ๋„ ์†๋“ฑ ์˜์—ญ๋งŒ ๋‚˜์˜ค๋„๋ก 512x512 ํฌ๊ธฐ๋กœ Crop
  5. Inference๋ฅผ ํ•œ ํ›„ ํ•™์Šต๋œ ์†๋“ฑ ๋ผˆ ๋ฐ์ดํ„ฐ๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ๊ธฐ์กด ๋ชจ๋ธ์˜ ์†๋“ฑ ๋ผˆ ์˜ˆ์ธก ๊ฒฐ๊ณผ๋ฅผ ๋Œ€์ฒด

์ ์šฉ ๋ชจ๋ธ UNet++, SegFormer B4, ConvNext XL์— Augmentation์„ ๊ฒฐํ•ฉํ•˜์—ฌ ์ตœ์ข… ํ•™์Šต ๋ฐ ํ‰๊ฐ€๋ฅผ ์ง„ํ–‰.

๊ฒฐ๊ณผ

Model result
BaseModel 97.45 %
Crop Change 97.54 %

Crop ํ›„ ํ•™์Šตํ•œ ์ด๋ฏธ์ง€ ๊ฒฐ๊ณผ๋กœ ๋Œ€์ฒดํ•œ ๊ฒฐ๊ณผ ์„ฑ๋Šฅ์ด ์ฆ๊ฐ€ํ•˜์˜€์Œ์„ ์•Œ ์ˆ˜ ์žˆ์—ˆ๋‹ค.

Pseudo labeling

Pseudo Labeling์„ ํ™œ์šฉํ•ด ๋ ˆ์ด๋ธ”์ด ์—†๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ํ•™์Šต ๋ฐ์ดํ„ฐ๋กœ ์ถ”๊ฐ€ํ•˜์—ฌ ๋ชจ๋ธ์˜ ์ผ๋ฐ˜ํ™” ์„ฑ๋Šฅ๊ณผ ์ •ํ™•๋„๋ฅผ 0.27% ํ–ฅ์ƒ์‹œ์ผฐ๋‹ค.

Model result
BaseModel 97.00 %
PseudoModel 97.27 %



๐Ÿง  Modeling

Resolution

๋ฉ”๋ชจ๋ฆฌ ๋ฌธ์ œ ํ•ด๊ฒฐ

  • AMP(FP16 + FP32)๋ฅผ ํ™œ์šฉํ•ด CUDA ๋ฉ”๋ชจ๋ฆฌ ์ œํ•œ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐ
  • AMP๋Š” ๋ชจ๋ธ ์„ฑ๋Šฅ ์ €ํ•˜ ์—†์ด ์—ฐ์‚ฐ ์†๋„๋ฅผ ๋†’์ด๊ณ  ๋ฉ”๋ชจ๋ฆฌ ํšจ์œจ์„ฑ์„ ๊ฐœ์„ ํ•˜์—ฌ ์•ˆ์ •์ ์ธ ํ•™์Šต์„ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•จ

ํ•ด์ƒ๋„์— ๋”ฐ๋ฅธ ์„ฑ๋Šฅ ํ–ฅ์ƒ

  • ํ•ด์ƒ๋„๋ฅผ ๋†’์ผ์ˆ˜๋ก ์„ฑ๋Šฅ์ด ํฌ๊ฒŒ ํ–ฅ์ƒ๋จ์„ ํ™•์ธ
  • SegFormer B4, ConvNext ๋“ฑ ๋ฌด๊ฑฐ์šด ๋ชจ๋ธ์€ 2048 ํ•ด์ƒ๋„์—์„œ OOM ๋ฐœ์ƒ, 1024 ํ•ด์ƒ๋„๋กœ ์ œํ•œ
  • SegFormer B0์™€ ๊ฐ™์€ ๊ฐ€๋ฒผ์šด ๋ชจ๋ธ์€ 2048 ํ•ด์ƒ๋„์—์„œ ๋” ์šฐ์ˆ˜ํ•œ ์„ฑ๋Šฅ์„ ๋ณด์ž„

์ตœ์ข… ํ•™์Šต ์ „๋žต

  • 2048 ํ•ด์ƒ๋„ ํ•™์Šต ๊ฐ€๋Šฅ ๋ชจ๋ธ: 2048 ํ•ด์ƒ๋„๋กœ ํ•™์Šต
  • OOM ๋ฐœ์ƒ ๋ชจ๋ธ: 1024 ํ•ด์ƒ๋„๋กœ ํ•™์Šต

๊ฒฐ๊ณผ ์š”์•ฝ

  • 2048 ํ•ด์ƒ๋„๋ฅผ ์ ์šฉํ•œ ๊ฐ€๋ฒผ์šด ๋ชจ๋ธ์ด ์„ฑ๋Šฅ ํ–ฅ์ƒ์— ๊ฐ€์žฅ ์ค‘์š”ํ•œ ์š”์†Œ๋กœ ํ™•์ธ
  • DeepLabV3+ ์„ฑ๋Šฅ:
Model Image size Result
DeepLabV3+ 512 95.50 %
DeepLabV3+ 1024 96.63 %
DeepLabV3+ 2048 97.07 %



โš–๏ธ Loss

๋ฌธ์ œ

  • ํฐ ๋ผˆ์— ๋น„ํ•ด ์ž‘์€ ๋ผˆ๋ฅผ ์ •ํ™•ํžˆ ์˜ˆ์ธกํ•˜์ง€ ๋ชปํ•˜๋Š” ๋ฌธ์ œ๊ฐ€ ์ง€์†๋จ.
  • BCE Loss๋Š” ํ”ฝ์…€ ๋‹จ์œ„ ๋ถ„๋ฅ˜์— ์œ ์šฉํ•˜์ง€๋งŒ ์ž‘์€ ๊ฐ์ฒด ํƒ์ง€์—๋Š” ํ•œ๊ณ„๊ฐ€ ์žˆ์Œ.

๊ฐ€์„ค ๋ฐ ์ ‘๊ทผ

  • Dice Loss: ์ •๋ฐ€๋„์™€ ์žฌํ˜„์œจ ์ตœ์ ํ™”.
  • Focal Loss: ์–ด๋ ค์šด ์ƒ˜ํ”Œ(์ž‘์€ ๊ฐ์ฒด)์— ๊ฐ€์ค‘์น˜๋ฅผ ๋ถ€์—ฌํ•˜์—ฌ ํƒ์ง€ ์„ฑ๋Šฅ ํ–ฅ์ƒ ๊ธฐ๋Œ€.
  • Focal+Dice ์กฐํ•ฉ: ๋‘ ์†์‹ค ํ•จ์ˆ˜์˜ ๊ท ํ˜•์„ ๋งž์ถฐ ์„ฑ๋Šฅ ๊ฐœ์„  ๋„๋ชจ.
  • Focal4+Dice6 ์กฐ์ •: Focal Loss์˜ ๊ณผ๋„ํ•œ ๊ฐ€์ค‘์น˜๋ฅผ ์™„ํ™”ํ•˜์—ฌ ๋‹ค๋ฅธ ํ”ฝ์…€ ํ•™์Šต ์•ฝํ™” ๋ฌธ์ œ ํ•ด๊ฒฐ.

๊ฒฐ๊ณผ (UNet3+ ๊ธฐ์ค€)

BCE 95.42 %
BCE+Dice 95.35 %
Focal+Dice 95.32 %
Focal4+Dice6 95.57 %

๊ฒฐ๊ณผ(DeepLabV3+ ๊ธฐ์ค€)

(Baseline)BCE 95.38 %
BCE+Dice(bce_weight=0.5) 95.50 %
Focal+Dice 95.23 %
Focal4+Dice6 95.21 %

๊ฒฐ๋ก  ๋ฐ ์ตœ์ข… ์„ ํƒ

  • BCE+Dice: DeeplabV3+, ConvNext, SegFormer์— ์ ์šฉ
  • Focal4+Dice6: **UNet2+, UNet3+**์— ์ ์šฉ

์ž‘์€ ๊ฐ์ฒด ํƒ์ง€ ์„ฑ๋Šฅ ํ–ฅ์ƒ์„ ์œ„ํ•ด Focal Loss์™€ Dice Loss์˜ ๋น„์œจ ์กฐ์ •์ด ํšจ๊ณผ์ ์ž„



๐Ÿ“ˆ Scheduler

Cosine Annealing Learning Rate Scheduler ์ฑ„ํƒ

  • ํ•™์Šต ์ดˆ๊ธฐ: ๋†’์€ ํ•™์Šต๋ฅ ๋กœ ๋น ๋ฅด๊ฒŒ ์ˆ˜๋ ด
  • ํ•™์Šต ํ›„๋ฐ˜: ํ•™์Šต๋ฅ ์„ ์ ์ง„์ ์œผ๋กœ ๊ฐ์†Œ์‹œ์ผœ ์•ˆ์ •์  ํ•™์Šต๊ณผ ๊ณผ์ ํ•ฉ ๋ฐฉ์ง€
  • ์žฅ์ : ์ž์—ฐ์Šค๋Ÿฌ์šด ๊ฐ์†Œํญ์œผ๋กœ ์•ˆ์ •์  ํ•™์Šต ํ™˜๊ฒฝ ์ œ๊ณต

๊ฒฐ๊ณผ

  • UNet++ ๊ธฐ์ค€, ๋ฒ ์ด์Šค๋ผ์ธ ๋Œ€๋น„ 0.01 % ์„ฑ๋Šฅ ํ–ฅ์ƒ ํ™•์ธ
  • Cosine Annealing Scheduler๋ฅผ ์ตœ์ข…์ ์œผ๋กœ ์ฑ„ํƒ



๐Ÿ› ๏ธ Optimizer

AdamW๋ฅผ ์ตœ์ข…์ ์œผ๋กœ ์ฑ„ํƒํ•˜์˜€๋‹ค. ๊ณผ์ ํ•ฉ ๋ฐฉ์ง€์— ๋” ํšจ๊ณผ์ ์ธ AdamW๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ผ๋ฐ˜ํ™” ์„ฑ๋Šฅ์ด ํ–ฅ์ƒํ•˜์—ฌ ์„ฑ๋Šฅ์ด ๋” ์ข‹๋‹ค๊ณ  ํŒ๋‹จํ–ˆ๋‹ค.

๊ฒฐ๊ณผ(UNet++ ๊ธฐ์ค€ 0.24% ์ƒ์Šน)

RMSprop 95.29 %
AdamW 95.53 %



๐Ÿงน Post-Processing

CRF (Conditional Random Field)

CRF๋Š” segmentation ๋ชจ๋ธ์˜ ์ถœ๋ ฅ(ํ™•๋ฅ  ๋งต)์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๊ณต๊ฐ„ ๋ฐ ์ƒ‰์ƒ ์ •๋ณด๋ฅผ ํ™œ์šฉํ•˜์—ฌ ํ”ฝ์…€ ๊ฐ„ ๊ด€๊ณ„๋ฅผ ์ตœ์ ํ™”ํ•˜๊ณ , ์„ธ๋ฐ€ํ•œ ๋ถ„๋ฅ˜ ์„ฑ๋Šฅ์„ ๊ฐœ์„ ํ•˜๋Š” ํ›„์ฒ˜๋ฆฌ ๊ธฐ๋ฒ•์ด๋‹ค.

์‹คํ—˜ ๊ฒฐ๊ณผ

  1. ๊ธฐ๋ณธ ํŒŒ๋ผ๋ฏธํ„ฐ:
    • ํŒŒ์ผ ์šฉ๋Ÿ‰์ด ์ง€๋‚˜์น˜๊ฒŒ ์ปค์ ธ ์ฑ„์  ๋ถˆ๊ฐ€๋Šฅ.
    • ์›์ธ: ๊ณผ๋„ํ•œ smoothing ํšจ๊ณผ๋กœ ๋ฐ์ดํ„ฐ๊ฐ€ ๊ณผ๋„ํ•˜๊ฒŒ ๋ณ€ํ˜•๋จ.
  2. ํ•˜์ดํผํŒŒ๋ผ๋ฏธํ„ฐ ์กฐ์ •:
    • ์„ฑ๋Šฅ์ด ์˜คํžˆ๋ ค ๊ฐ์†Œ.
    • ์›์ธ ๋ถ„์„:
      1. ํ•˜์ดํผํŒŒ๋ผ๋ฏธํ„ฐ ์˜์กด์„ฑ: ๋ถ€์ ์ ˆํ•œ ๊ฐ’ ์„ค์ •์œผ๋กœ ์„ธ๋ถ€ ์ •๋ณด ์†์‹ค ๋ฐœ์ƒ.
      2. ๋ถ€์ ํ•ฉํ•œ smoothing: ๋ณต์žกํ•œ ๊ฒฝ๊ณ„๋ฅผ ์ง€๋‚˜์น˜๊ฒŒ ๋‹จ์ˆœํ™”ํ•˜์—ฌ ์ž‘์€ ๊ฐ์ฒด๋‚˜ ์–‡์€ ์˜์—ญ์ด ์ œ๊ฑฐ๋˜๊ฑฐ๋‚˜ ๋ณ‘ํ•ฉ๋˜๋Š” ์˜ค๋ฅ˜ ๋ฐœ์ƒ.

CRF๋Š” ํ”ฝ์…€ ๋‹จ์œ„์˜ ๋ถ„๋ฅ˜ ์˜ค๋ฅ˜์™€ ๊ณ„๋‹จ ํ˜„์ƒ์„ ํ•ด๊ฒฐํ•˜๋ ค๋Š” ๋ชฉ์ ์—์„œ ๋„์ž…๋˜์—ˆ์œผ๋‚˜, ์ ์ ˆํ•œ ํ•˜์ดํผํŒŒ๋ผ๋ฏธํ„ฐ ์กฐ์ •์ด ๋ถ€์กฑํ•˜์—ฌ ์„ฑ๋Šฅ ๊ฐœ์„ ์— ์‹คํŒจํ–ˆ๋‹ค. ํŠนํžˆ, ๊ณผ๋„ํ•œ smoothing์œผ๋กœ ์ธํ•ด ์„ฑ๋Šฅ ์ €ํ•˜์™€ ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ๋ฌธ์ œ๋ฅผ ์•ผ๊ธฐํ–ˆ๋‹ค.



๐Ÿ”„ TTA

๋‹ค์–‘ํ•œ TTA๋ฅผ ์‹คํ—˜ํ–ˆ์ง€๋งŒ HorizontalFlip ๋งŒ์ด ๊ธฐ์กด๋ณด๋‹ค dice๊ฐ€ 0.06 % ์ƒ์Šนํ•˜๋Š” ์œ ์˜๋ฏธํ•œ ๊ฒฐ๊ณผ๋ฅผ ๋ณด์—ฌ์ฃผ์–ด ์ตœ์ข… TTA์—๋Š” HorizontalFlip๋งŒ์„ ์ ์šฉํ•˜์˜€๋‹ค.



๐Ÿค Ensemble

๋ชจ๋ธ ์‹คํ—˜์—์„œ ์„ฑ๋Šฅ์ด ์šฐ์ˆ˜ํ–ˆ๋˜ ๋ชจ๋ธ๋“ค์„ ์„ ์ •ํ•˜์—ฌ K-Fold๋ฅผ ์ง„ํ–‰ํ•œ ๋’ค, ์ด๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ Soft Voting, Hard Voting, Classwise Ensemble ๋“ฑ ๋‹ค์–‘ํ•œ ์•™์ƒ๋ธ” ๋ฐฉ๋ฒ•์„ ์‹คํ—˜ํ–ˆ๋‹ค.

์ตœ์ข…์ ์œผ๋กœ ๊ฐ€์žฅ ์ข‹์€ ์„ฑ๋Šฅ์„ ๋ณด์ธ ๋ฐฉ๋ฒ•์€ Classwise Ensemble๋กœ, ๊ฐ ํด๋ž˜์Šค์—์„œ ๊ฐ€์žฅ ์šฐ์ˆ˜ํ•œ ์˜ˆ์ธก์„ ์ˆ˜ํ–‰ํ•œ ๋ชจ๋ธ์˜ ๊ฒฐ๊ณผ๋ฅผ ์‚ฌ์šฉํ•ด ์ถ”๋ก ํ•˜๋Š” ๋ฐฉ์‹์ด๋‹ค.

ํŠนํžˆ, Cropํ•œ ์ด๋ฏธ์ง€๋ฅผ ํ™œ์šฉํ•ด ์†๋“ฑ ๋ผˆ๋ฅผ ์ค‘์‹ฌ์œผ๋กœ ํ•™์Šตํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ Classwise Ensemble์„ ์ง„ํ–‰ํ•˜์—ฌ ์†๋“ฑ ๋ผˆ ๋ถ€๋ถ„์˜ ์ •ํ™•๋„๋ฅผ ํšจ๊ณผ์ ์œผ๋กœ ํ–ฅ์ƒ์‹œ์ผฐ๋‹ค.

KFOLD

  • Convnext Xlarge 1024 + 5fold
  • Segformer b4 1024 + 5fold
  • DeeplabV3p 2048 + 4fold
  • Segformer b0 2048 + 4fold

Final Ensemble

์ตœ์ข… Classwise Ensemble์œผ๋กœ 97.54%๋ฅผ ๋‹ฌ์„ฑํ•˜์˜€๋‹ค.

image



๐ŸŽฏ Conclusion

X-ray ์† ๋ผˆ ๋ถ„ํ• ์˜ ์ฃผ์š” ๊ณผ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ๋‹ค์–‘ํ•œ ์ฆ๊ฐ• ๊ธฐ๋ฒ•, ๋ชจ๋ธ ์•„ํ‚คํ…์ฒ˜, ์•™์ƒ๋ธ” ๊ธฐ๋ฒ•์„ ์ ์šฉํ–ˆ๋‹ค. ํŠนํžˆ, ์›๋ณธ ์ด๋ฏธ์ง€ ํ•™์Šต ๋ชจ๋ธ ๊ธฐ๋ฐ˜ Classwise Ensemble ๊ธฐ๋ฒ•์€ ์†๋“ฑ ๋ผˆ์™€ ๊ฐ™์€ ์–ด๋ ค์šด ์˜์—ญ์—์„œ ์„ฑ๋Šฅ ํ–ฅ์ƒ์„ ์ด๋Œ์—ˆ๋‹ค. ๋˜ํ•œ, SOTA ๊ฐ™์€ ๋ฌด๊ฑฐ์šด ๋ชจ๋ธ์„ ๋‚ฎ์€ ํ•ด์ƒ๋„๋กœ ํ•™์Šตํ•˜๋Š” ๊ฒƒ๋ณด๋‹ค ๊ฐ€๋ฒผ์šด ๋ชจ๋ธ์„ ๋†’์€ ํ•ด์ƒ๋„๋กœ ํ•™์Šตํ•˜๋Š” ๊ฒƒ์ด ๋ณธ ๋Œ€ํšŒ ์„ฑ๋Šฅ ํ–ฅ์ƒ์— ๋งค์šฐ ์ค‘์š”ํ–ˆ์Œ์„ ์•Œ๊ฒŒ ๋˜์—ˆ๋‹ค. ํ–ฅํ›„ ์—ฐ๊ตฌ์—์„œ๋Š” ๋„๋ฉ”์ธ ์ง€์‹์„ ํ™œ์šฉํ•œ ๋” ์ •๊ตํ•œ ์ „์ฒ˜๋ฆฌ ๋ฐ ํ›„์ฒ˜๋ฆฌ ๊ธฐ๋ฒ•์„ ์ ์šฉํ•˜์—ฌ ๋”์šฑ ๋†’์€ ์„ฑ๋Šฅ์„ ๋ชฉํ‘œ๋กœ ํ•  ๊ฒƒ์ด๋‹ค.



๐Ÿ† ์ตœ์ข… ์„ฑ๊ณผ

  • Public Dice Score: 97.56%
image
  • Private Dice Score: 97.64 %
image



๐Ÿ“š Reference

About

level2-cv-semanticsegmentation-cv-10-lv3 created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •