์ฝ˜ํ…์ธ ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ

COCO-Seg ๋ฐ์ดํ„ฐ ์„ธํŠธ

COCO-Seg ๋ฐ์ดํ„ฐ ์„ธํŠธ๋Š” COCO(Common Objects in Context) ๋ฐ์ดํ„ฐ ์„ธํŠธ์˜ ํ™•์žฅ์œผ๋กœ, ๊ฐ์ฒด ์ธ์Šคํ„ด์Šค ๋ถ„ํ•  ์—ฐ๊ตฌ๋ฅผ ๋•๊ธฐ ์œ„ํ•ด ํŠน๋ณ„ํžˆ ๊ณ ์•ˆ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. COCO์™€ ๋™์ผํ•œ ์ด๋ฏธ์ง€๋ฅผ ์‚ฌ์šฉํ•˜์ง€๋งŒ ๋” ์ž์„ธํ•œ ์„ธ๋ถ„ํ™” ์ฃผ์„์„ ๋„์ž…ํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด ๋ฐ์ดํ„ฐ ์„ธํŠธ๋Š” ์ธ์Šคํ„ด์Šค ์„ธ๋ถ„ํ™” ์ž‘์—…์„ ํ•˜๋Š” ์—ฐ๊ตฌ์ž์™€ ๊ฐœ๋ฐœ์ž์—๊ฒŒ ์ค‘์š”ํ•œ ๋ฆฌ์†Œ์Šค์ด๋ฉฐ, ํŠนํžˆ YOLO ๋ชจ๋ธ์„ ํ›ˆ๋ จํ•˜๋Š” ๋ฐ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค.

์ฃผ์š” ๊ธฐ๋Šฅ

  • COCO-Seg๋Š” COCO์˜ ์›๋ณธ 330K ์ด๋ฏธ์ง€๋ฅผ ๋ณด๊ด€ํ•ฉ๋‹ˆ๋‹ค.
  • ์ด ๋ฐ์ดํ„ฐ ์„ธํŠธ๋Š” ์›๋ž˜ COCO ๋ฐ์ดํ„ฐ ์„ธํŠธ์— ์žˆ๋Š” ๊ฒƒ๊ณผ ๋™์ผํ•œ 80๊ฐœ์˜ ๊ฐœ์ฒด ์นดํ…Œ๊ณ ๋ฆฌ๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.
  • ์ด์ œ ์ฃผ์„์— ์ด๋ฏธ์ง€์˜ ๊ฐ ๊ฐ์ฒด์— ๋Œ€ํ•œ ๋” ์ž์„ธํ•œ ์ธ์Šคํ„ด์Šค ์„ธ๋ถ„ํ™” ๋งˆ์Šคํฌ๊ฐ€ ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.
  • COCO-Seg๋Š” ๊ฐ์ฒด ๊ฐ์ง€๋ฅผ ์œ„ํ•œ ํ‰๊ท  ํ‰๊ท  ์ •๋ฐ€๋„(mAP), ์ธ์Šคํ„ด์Šค ์„ธ๋ถ„ํ™” ์ž‘์—…์„ ์œ„ํ•œ ํ‰๊ท  ํ‰๊ท  ํšŒ์ˆ˜์œจ(mAR)๊ณผ ๊ฐ™์€ ํ‘œ์ค€ํ™”๋œ ํ‰๊ฐ€ ์ง€ํ‘œ๋ฅผ ์ œ๊ณตํ•˜์—ฌ ๋ชจ๋ธ ์„ฑ๋Šฅ์„ ํšจ๊ณผ์ ์œผ๋กœ ๋น„๊ตํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

๋ฐ์ดํ„ฐ ์„ธํŠธ ๊ตฌ์กฐ

COCO-Seg ๋ฐ์ดํ„ฐ ์„ธํŠธ๋Š” ์„ธ ๊ฐœ์˜ ํ•˜์œ„ ์ง‘ํ•ฉ์œผ๋กœ ๋ถ„ํ• ๋ฉ๋‹ˆ๋‹ค:

  1. Train2017: ์ด ํ•˜์œ„ ์ง‘ํ•ฉ์—๋Š” ์ธ์Šคํ„ด์Šค ๋ถ„ํ•  ๋ชจ๋ธ ํ›ˆ๋ จ์šฉ ์ด๋ฏธ์ง€๊ฐ€ 11๋งŒ 8์ฒœ ๊ฐœ ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.
  2. Val2017: ์ด ํ•˜์œ„ ์ง‘ํ•ฉ์—๋Š” ๋ชจ๋ธ ํ•™์Šต ์ค‘ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ์— ์‚ฌ์šฉ๋˜๋Š” 5K ์ด๋ฏธ์ง€๊ฐ€ ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.
  3. Test2017: ์ด ํ•˜์œ„ ์ง‘ํ•ฉ์—๋Š” ํ•™์Šต๋œ ๋ชจ๋ธ์„ ํ…Œ์ŠคํŠธํ•˜๊ณ  ๋ฒค์น˜๋งˆํ‚นํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋˜๋Š” 20K ์ด๋ฏธ์ง€๊ฐ€ ํฌํ•จ๋ฉ๋‹ˆ๋‹ค. ์ด ํ•˜์œ„ ์ง‘ํ•ฉ์— ๋Œ€ํ•œ ์‹ค์ธก ๋ฐ์ดํ„ฐ ์ฃผ์„์€ ๊ณต๊ฐœ์ ์œผ๋กœ ์ œ๊ณต๋˜์ง€ ์•Š์œผ๋ฉฐ, ๊ฒฐ๊ณผ๋Š” ์„ฑ๋Šฅ ํ‰๊ฐ€๋ฅผ ์œ„ํ•ด COCO ํ‰๊ฐ€ ์„œ๋ฒ„์— ์ œ์ถœ๋ฉ๋‹ˆ๋‹ค.

์• ํ”Œ๋ฆฌ์ผ€์ด์…˜

COCO-Seg๋Š” YOLO ๋ชจ๋ธ๊ณผ ๊ฐ™์€ ์ธ์Šคํ„ด์Šค ์„ธ๋ถ„ํ™”์—์„œ ๋”ฅ๋Ÿฌ๋‹ ๋ชจ๋ธ์„ ํ›ˆ๋ จํ•˜๊ณ  ํ‰๊ฐ€ํ•˜๋Š” ๋ฐ ๋„๋ฆฌ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ์ˆ˜๋งŽ์€ ์ฃผ์„์ด ๋‹ฌ๋ฆฐ ์ด๋ฏธ์ง€, ๋‹ค์–‘ํ•œ ๊ฐ์ฒด ๋ฒ”์ฃผ, ํ‘œ์ค€ํ™”๋œ ํ‰๊ฐ€ ์ง€ํ‘œ๋Š” ์ปดํ“จํ„ฐ ๋น„์ „ ์—ฐ๊ตฌ์ž์™€ ์‹ค๋ฌด์ž์—๊ฒŒ ์—†์–ด์„œ๋Š” ์•ˆ ๋  ๋ฆฌ์†Œ์Šค์ž…๋‹ˆ๋‹ค.

๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ YAML

๋ฐ์ดํ„ฐ ์„ธํŠธ ๊ตฌ์„ฑ์„ ์ •์˜ํ•˜๋Š” ๋ฐ๋Š” YAML(๋˜ ๋‹ค๋ฅธ ๋งˆํฌ์—… ์–ธ์–ด) ํŒŒ์ผ์ด ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์—๋Š” ๋ฐ์ดํ„ฐ ์„ธํŠธ์˜ ๊ฒฝ๋กœ, ํด๋ž˜์Šค ๋ฐ ๊ธฐํƒ€ ๊ด€๋ จ ์ •๋ณด์— ๋Œ€ํ•œ ์ •๋ณด๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. COCO-Seg ๋ฐ์ดํ„ฐ ์„ธํŠธ์˜ ๊ฒฝ์šฐ์—๋Š” coco.yaml ํŒŒ์ผ์€ ๋‹ค์Œ ์œ„์น˜์—์„œ ๊ด€๋ฆฌ๋ฉ๋‹ˆ๋‹ค. https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml.

ultralytics/cfg/datasets/coco.yaml

# Ultralytics YOLO ๐Ÿš€, AGPL-3.0 license
# COCO 2017 dataset https://cocodataset.org by Microsoft
# Documentation: https://docs.ultralytics.com/datasets/detect/coco/
# Example usage: yolo train data=coco.yaml
# parent
# โ”œโ”€โ”€ ultralytics
# โ””โ”€โ”€ datasets
#     โ””โ”€โ”€ coco  โ† downloads here (20.1 GB)

# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
path: ../datasets/coco # dataset root dir
train: train2017.txt # train images (relative to 'path') 118287 images
val: val2017.txt # val images (relative to 'path') 5000 images
test: test-dev2017.txt # 20288 of 40670 images, submit to https://competitions.codalab.org/competitions/20794

# Classes
names:
  0: person
  1: bicycle
  2: car
  3: motorcycle
  4: airplane
  5: bus
  6: train
  7: truck
  8: boat
  9: traffic light
  10: fire hydrant
  11: stop sign
  12: parking meter
  13: bench
  14: bird
  15: cat
  16: dog
  17: horse
  18: sheep
  19: cow
  20: elephant
  21: bear
  22: zebra
  23: giraffe
  24: backpack
  25: umbrella
  26: handbag
  27: tie
  28: suitcase
  29: frisbee
  30: skis
  31: snowboard
  32: sports ball
  33: kite
  34: baseball bat
  35: baseball glove
  36: skateboard
  37: surfboard
  38: tennis racket
  39: bottle
  40: wine glass
  41: cup
  42: fork
  43: knife
  44: spoon
  45: bowl
  46: banana
  47: apple
  48: sandwich
  49: orange
  50: broccoli
  51: carrot
  52: hot dog
  53: pizza
  54: donut
  55: cake
  56: chair
  57: couch
  58: potted plant
  59: bed
  60: dining table
  61: toilet
  62: tv
  63: laptop
  64: mouse
  65: remote
  66: keyboard
  67: cell phone
  68: microwave
  69: oven
  70: toaster
  71: sink
  72: refrigerator
  73: book
  74: clock
  75: vase
  76: scissors
  77: teddy bear
  78: hair drier
  79: toothbrush

# Download script/URL (optional)
download: |
  from ultralytics.utils.downloads import download
  from pathlib import Path

  # Download labels
  segments = True  # segment or box labels
  dir = Path(yaml['path'])  # dataset root dir
  url = 'https://github.com/ultralytics/yolov5/releases/download/v1.0/'
  urls = [url + ('coco2017labels-segments.zip' if segments else 'coco2017labels.zip')]  # labels
  download(urls, dir=dir.parent)
  # Download data
  urls = ['http://images.cocodataset.org/zips/train2017.zip',  # 19G, 118k images
          'http://images.cocodataset.org/zips/val2017.zip',  # 1G, 5k images
          'http://images.cocodataset.org/zips/test2017.zip']  # 7G, 41k images (optional)
  download(urls, dir=dir / 'images', threads=3)

์‚ฌ์šฉ๋ฒ•

์ด๋ฏธ์ง€ ํฌ๊ธฐ๊ฐ€ 640์ธ 100๊ฐœ์˜ ์—ํฌํฌ์— ๋Œ€ํ•ด COCO-Seg ๋ฐ์ดํ„ฐ ์„ธํŠธ์—์„œ YOLOv8n-seg ๋ชจ๋ธ์„ ํ›ˆ๋ จํ•˜๋ ค๋ฉด ๋‹ค์Œ ์ฝ”๋“œ ์กฐ๊ฐ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์ธ์ˆ˜์˜ ์ „์ฒด ๋ชฉ๋ก์€ ๋ชจ๋ธ ํ›ˆ๋ จ ํŽ˜์ด์ง€๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

์—ด์ฐจ ์˜ˆ์‹œ

from ultralytics import YOLO

# Load a model
model = YOLO('yolov8n-seg.pt')  # load a pretrained model (recommended for training)

# Train the model
results = model.train(data='coco-seg.yaml', epochs=100, imgsz=640)
# Start training from a pretrained *.pt model
yolo detect train data=coco-seg.yaml model=yolov8n.pt epochs=100 imgsz=640

์ƒ˜ํ”Œ ์ด๋ฏธ์ง€ ๋ฐ ์ฃผ์„

COCO-Seg๋Š” ์ด์ „ ๋ฒ„์ „์ธ COCO์™€ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ๋‹ค์–‘ํ•œ ๊ฐ์ฒด ๋ฒ”์ฃผ์™€ ๋ณต์žกํ•œ ์žฅ๋ฉด์ด ํฌํ•จ๋œ ๋‹ค์–‘ํ•œ ์ด๋ฏธ์ง€ ์„ธํŠธ๋ฅผ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ COCO-Seg๋Š” ์ด๋ฏธ์ง€์˜ ๊ฐ ๊ฐ์ฒด์— ๋Œ€ํ•ด ๋ณด๋‹ค ์ƒ์„ธํ•œ ์ธ์Šคํ„ด์Šค ๋ถ„ํ•  ๋งˆ์Šคํฌ๋ฅผ ๋„์ž…ํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ์€ ๋ฐ์ดํ„ฐ ์„ธํŠธ์˜ ์ด๋ฏธ์ง€์™€ ํ•ด๋‹น ์ธ์Šคํ„ด์Šค ๋ถ„ํ•  ๋งˆ์Šคํฌ์˜ ๋ช‡ ๊ฐ€์ง€ ์˜ˆ์ž…๋‹ˆ๋‹ค:

๋ฐ์ดํ„ฐ ์„ธํŠธ ์ƒ˜ํ”Œ ์ด๋ฏธ์ง€

  • ๋ชจ์ž์ดํฌ ์ด๋ฏธ์ง€: ์ด ์ด๋ฏธ์ง€๋Š” ๋ชจ์ž์ดํฌ๋œ ๋ฐ์ดํ„ฐ ์„ธํŠธ ์ด๋ฏธ์ง€๋กœ ๊ตฌ์„ฑ๋œ ํ›ˆ๋ จ ๋ฐฐ์น˜๋ฅผ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค. ๋ชจ์ž์ดํฌ๋Š” ์—ฌ๋Ÿฌ ์ด๋ฏธ์ง€๋ฅผ ๋‹จ์ผ ์ด๋ฏธ์ง€๋กœ ๊ฒฐํ•ฉํ•˜์—ฌ ๊ฐ ํ›ˆ๋ จ ๋ฐฐ์น˜ ๋‚ด์—์„œ ๋‹ค์–‘ํ•œ ๊ฐœ์ฒด์™€ ์žฅ๋ฉด์„ ๋Š˜๋ฆฌ๋Š” ํ›ˆ๋ จ ์ค‘์— ์‚ฌ์šฉ๋˜๋Š” ๊ธฐ๋ฒ•์ž…๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ๋ชจ๋ธ์ด ๋‹ค์–‘ํ•œ ๊ฐ์ฒด ํฌ๊ธฐ, ์ข…ํšก๋น„ ๋ฐ ์ปจํ…์ŠคํŠธ์— ์ผ๋ฐ˜ํ™”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ์˜ˆ๋Š” COCO-Seg ๋ฐ์ดํ„ฐ ์„ธํŠธ์— ํฌํ•จ๋œ ์ด๋ฏธ์ง€์˜ ๋‹ค์–‘์„ฑ๊ณผ ๋ณต์žก์„ฑ, ๊ทธ๋ฆฌ๊ณ  ํ›ˆ๋ จ ๊ณผ์ •์—์„œ ๋ชจ์ž์ดํฌ ์ฒ˜๋ฆฌ์˜ ์ด์ ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

์ธ์šฉ ๋ฐ ๊ฐ์‚ฌ

์—ฐ๊ตฌ ๋˜๋Š” ๊ฐœ๋ฐœ ์ž‘์—…์—์„œ COCO-Seg ๋ฐ์ดํ„ฐ์„ธํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ, COCO ๋…ผ๋ฌธ ์›๋ณธ์„ ์ธ์šฉํ•˜๊ณ  COCO-Seg์˜ ํ™•์žฅ์„ฑ์„ ์ธ์ •ํ•ด ์ฃผ์„ธ์š”:

@misc{lin2015microsoft,
      title={Microsoft COCO: Common Objects in Context},
      author={Tsung-Yi Lin and Michael Maire and Serge Belongie and Lubomir Bourdev and Ross Girshick and James Hays and Pietro Perona and Deva Ramanan and C. Lawrence Zitnick and Piotr Dollรกr},
      year={2015},
      eprint={1405.0312},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

์ปดํ“จํ„ฐ ๋น„์ „ ์ปค๋ฎค๋‹ˆํ‹ฐ๋ฅผ ์œ„ํ•ด ์ด ๊ท€์ค‘ํ•œ ๋ฆฌ์†Œ์Šค๋ฅผ ๋งŒ๋“ค๊ณ  ์œ ์ง€ ๊ด€๋ฆฌํ•ด ์ฃผ์‹  COCO ์ปจ์†Œ์‹œ์—„์— ๊ฐ์‚ฌ๋ฅผ ํ‘œํ•ฉ๋‹ˆ๋‹ค. COCO ๋ฐ์ดํ„ฐ ์„ธํŠธ์™€ ์ œ์ž‘์ž์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ COCO ๋ฐ์ดํ„ฐ ์„ธํŠธ ์›น์‚ฌ์ดํŠธ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.



2023-11-12 ์ƒ์„ฑ, 2023-11-22 ์—…๋ฐ์ดํŠธ๋จ
์ž‘์„ฑ์ž: glenn-jocher (3), Laughing-q (1)

๋Œ“๊ธ€