Computer Vision

[CV] Object Detection Metric-IoU, mAP

date
Sep 26, 2022
slug
cv-object-detection
author
status
Public
tags
DeepLearning
summary
type
Post
thumbnail
category
Computer Vision
updatedAt
Jul 16, 2023 01:52 PM

์ปดํ“จํ„ฐ ๋น„์ „(computer vision)

  • cv๋Š” ์ธ๊ฐ„์˜ ์‹œ๊ฐ๊ณผ ๊ด€๋ จ๋œ ๋ถ€๋ถ„์„ ์ปดํ“จํ„ฐ ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์ด์šฉํ•ด์„œ ๊ตฌํ˜„ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์—ฐ๊ตฌํ•˜๋Š” ๋ถ„์•ผ
  • ์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜(image classification, segmantic image segmentation, object detection ๋“ฑ์˜ ์ปดํ“จํ„ฐ ๋น„์ „์˜ ๋Œ€ํ‘œ์ ์ธ ๋ฌธ์ œ
  • ์ปดํ“จํ„ฐ ๋น„์ „ ๋ฌธ์ œ๋ฅผ ํ’€๊ธฐ ์œ„ํ•ด์„  ๋”ฅ๋Ÿฌ๋‹ ์—ฌ๋Ÿฌ ๊ตฌ์กฐ ์ค‘ CNN์ด ๋งŽ์ด ์‚ฌ์šฉ๋จ.

์ปดํ“จํ„ฐ ๋น„์ „ ๋ฌธ์ œ ์˜์—ญ - object Detection

  • object Detection : ๋ฌผ์ฒด๊ฐ€ ์žˆ๋Š” ์˜์—ญ์˜ ์œ„์น˜ ์ •๋ณด๋ฅผ bounding box๋กœ ์ฐพ๊ณ  bounding box๋‚ด์— ์กด์žฌํ•˜๋Š” ์‚ฌ๋ฌผ์˜ ๋ผ๋ฒจ(label)์„ ๋ถ„๋ฅ˜ํ•˜๋Š” ๋ฌธ์ œ ์˜์—ญ

Object Dectection ๋ฌธ์ œ ์˜์—ญ์˜ ์ถœ๋ ฅ๊ฐ’ - x_min, y_min, x_max, y_max, class, confidence

  • x_min : ๋ฌผ์ฒด์˜ bounding box์˜ ์™ผ์ชฝ ์œ„(left-top) x์ขŒํ‘œ
  • y_min : ๋ฌผ์ฒด์˜ bounding box์˜ ์™ผ์ชฝ ์œ„(left-top) y์ขŒํ‘œ
  • x_max : ๋ฌผ์ฒด์˜ bounding box์˜ ์˜ค๋ฅธ์ชฝ ์•„๋ž˜(Right-Bottom) x์ขŒํ‘œ
  • y_max : ๋ฌผ์ฒด์˜ bounding box์˜ ์˜ค๋ฅธ์ชฝ ์•„๋ž˜(Right-Bottom) y์ขŒํ‘œ
  • class : bounding box์— ์†ํ•œ ๋ฌผ์ฒด์˜ class
  • confidence : bounding box์— ์‹ค์ฒด ๋ฌผ์ฒด๊ฐ€ ์žˆ์„ ๊ฒƒ์ด๋ผ๊ณ  ํ™•์‹ ํ•˜๋Š” ์ •๋„๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ๊ฐ’(0.0~1.0 ์‚ฌ์ด์˜ ๊ฐ’)

Open Image Dataset Ground Truth

  • Object Detection ๋ฌธ์ œ ์˜์—ญ์˜ Ground Truth ๋ฐ์ดํ„ฐ๋Š” ์‚ฌ๋žŒ์ด ์ง€์ •ํ•œ Bounding Box์™€ Class Label
  • ์ •๋‹ต Ground Truth ๋ฐ์ดํ„ฐ์™€ ๋น„๊ตํ–ˆ์„ ๋•Œ, ์˜ˆ์ธก ๊ฐ’์˜ ์„ฑ๋Šฅ์„ ๋น„๊ตํ•˜๊ธฐ ์œ„ํ•œ metric์ด ํ•„์š”

Metric 1 - Intersection over Union(IoU) Metric

  • IoU์€ 1๊ฐœ์˜ Bounding Box์™€ 1๊ฐœ์˜ Bounding Box๊ฐ€ ์–ผ๋งˆ๋‚˜ ์ผ์น˜ํ•˜๋Š”์ง€๋ฅผ 0.0~1.1์‚ฌ์ด ๊ฐ’์œผ๋กœ ํ‘œํ˜„
  • 2๊ฐœ์˜ bounding box๊ฐ€ ์ผ์น˜ํ•  ์ˆ˜๋ก 1.0์— ๊ฐ€๊นŒ์šด ๊ฐ’์ด ๋˜๊ณ , ์ผ์น˜ํ•˜์ง€ ์•Šใ…‡๋ฅด์ˆ˜๋ก 0.0์— ๊ฐ€๊นŒ์šด ๊ฐ’์ด ๋‚˜์˜ค๊ฒŒ ๋จ.
notion image
notion image
ย 

Metric 2 - Precision, Recall, F1

  • Precision : ์ •๋ฐ€๋„(Precision)๋Š” ๊ฒ€์ƒ‰๋œ ๊ฒฐ๊ณผ๋“ค ์ค‘ ๊ด€๋ จ ์žˆ๋Š” ๊ฒƒ์œผ๋กœ ๋ถ„๋ฅ˜๋œ ๊ฒฐ๊ณผ๋ฌผ์˜ ๋น„์œจ
  • Recall : ์žฌํ˜„์œจ(Recall)์€ ๊ด€๋ จ ์žˆ๋Š” ๊ฒƒ์œผ๋กœ ๋ถ„๋ฅ˜๋œ ํ•ญ๋ชฉ๋“ค ์ค‘ ์‹ค์ œ ๊ฒ€์ƒ‰๋œ ํ•ญ๋ชฉ๋“ค์˜ ๋น„์œจ
  • F1 : Precision๊ณผ Recall์˜ ์กฐํ™”ํ‰๊ท . Precision๊ณผ Recall์„ ํ•œ๋ฒˆ์— ๋น„๊ต ๊ฐ€๋Šฅ
f1 score๊ฐ€ ๋†’์€ ๋ชจ๋ธ์ผ ์ˆ˜๋ก ๊ฒฐ๊ณผ๊ฐ€ ์ข‹๋‹ค๊ณ  ํ•  ์ˆ˜ ์žˆ๋‹ค.
notion image
ย 
notion image

Metric 2 - Average Precision(AP)

  • Positive ํŒ๋‹จ ๊ธฐ์ค€ : ์ผ์ •ํ•œ ์ž„๊ณ„์น˜์˜ IoU(์˜ˆ๋ฅผ ๋“ค์–ด, Pascal VOC ๋ฐ์ดํ„ฐ์…‹์˜ ๊ฒฝ์šฐ, 0.5)๋ฅผ ๋„˜๊ธฐ๋ฉด ๋งž์ถ˜ ๊ฒƒ์œผ๋กœ ๊ฐ„์ฃผ
  • Average Precison(AP) : Recall๋ณ„ Precision์˜ ํ‰๊ท (confidence๊ฐ€ ๋†’์€ ์˜ˆ์ธก๊ฒฐ๊ณผ ์ˆœ์œผ๋กœ ์ •๋ ฌํ–ˆ์„ ๋•Œ, ๋ช‡๋ฒˆ์งธ ์ด๋ฏธ์ง€๊นŒ์ง€๋ฅผ ๋น„๊ต๋Œ€์ƒ์œผ๋กœ ์‚ผ์„ ๊ฒƒ์ธ๊ฐ€?)
  • Mean Average Precision(mAP) : class๋“ค์˜ Average Precision์˜ ํ‰๊ท 
notion image
ย 
์ฐธ๊ณ  :