Non-Maximum Suppression(NMS)

ChangSeong Yooยท2023๋…„ 7์›” 20์ผ
0

Machine Learning

๋ชฉ๋ก ๋ณด๊ธฐ
3/7
post-thumbnail

๐Ÿ“์ด ํฌ์ŠคํŠธ๋Š” Non-Maximum Suppression์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.




์ •์˜

Non-Maximum Suppression์€ object detector๊ฐ€ ์˜ˆ์ธกํ•œ ์—ฌ๋Ÿฌ bounding box ์ค‘์—์„œ ๊ฐ€์žฅ ์ •ํ™•ํ•œ bounding box๋ฅผ ์„ ํƒํ•˜๋„๋ก ํ•˜๋Š” ๊ธฐ๋ฒ•์ž…๋‹ˆ๋‹ค.
NMS๋Š” bounding box๋“ค ์ค‘์˜ ๋ถˆํ•„์š”ํ•œ ์ค‘๋ณต์„ ์ตœ์†Œํ™”ํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค.
์ด ์•Œ๊ณ ๋ฆฌ์ฆ˜์€ ๋งค์šฐ ๊ฐ„๋‹จํ•˜๋ฉด์„œ๋„ ํšจ๊ณผ์ ์ธ ๋ฐฉ๋ฒ•์œผ๋กœ ์ค‘๋ณต์„ ์ œ๊ฑฐํ•˜๊ณ  ๊ฒฐ๊ณผ์˜ ์ •ํ™•์„ฑ์„ ํ–ฅ์ƒ์‹œํ‚ต๋‹ˆ๋‹ค. ๋‹จ, ํ•ด๋‹น ์•Œ๊ณ ๋ฆฌ์ฆ˜์€ ์ง€์—ญ์ ์œผ๋กœ ์ตœ๋Œ€๊ฐ’์„ ์ฐพ๊ธฐ ๋•Œ๋ฌธ์—, ์ง€์—ญ ์ตœ๋Œ€๊ฐ’์ด ์—ฐ๊ฒฐ๋œ ๊ธด ์—ฃ์ง€๋‚˜ ๊ฐ์ฒด์— ๋Œ€ํ•ด์„œ๋Š” ์ž˜ ๋™์ž‘ํ•˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.




๋ชฉ์ 

๋ชจ๋ธ์ด ์˜ˆ์ธกํ•œ ์—ฌ๋Ÿฌ bounding box๋“ค ์ค‘์— ๊ฐ€์žฅ ์Šค์ฝ”์–ด๊ฐ€ ๋†’์€ bounding box๋งŒ ๋‚จ๊ธฐ๊ณ  ์Šค์ฝ”์–ด๊ฐ€ ๋‚ฎ์€ bounding๋ฅผ ์ œ๊ฑฐํ•˜๊ธฐ ์œ„ํ•ด




์›๋ฆฌ

  1. ๋ชจ๋“  bounding box๋“ค ์ค‘์—์„œ threshold ์ดํ•˜์˜ ์ ์ˆ˜๋ฅผ ๊ฐ–๋Š” bounding box๋“ค์„ ์ œ๊ฑฐํ•œ๋‹ค.
  2. ์ œ๊ฑฐํ•˜๊ณ  ๋‚จ์€ bounding box๋ฅผ ์ ์ˆ˜๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๋‚ด๋ฆผ์ฐจ์ˆœ ํ•œ๋‹ค.
  3. ์ •๋ ฌ ํ›„ ๋งจ ์•ž์— ์žˆ๋Š” ์ ์ˆ˜๊ฐ€ ๊ฐ€์žฅ ๋†’์€ Bounding box ํ•˜๋‚˜๋ฅผ ๊ธฐ์ค€์œผ๋กœ, ๋‹ค๋ฅธ ๋‚˜๋จธ์ง€ bounding box์™€ Intersection over Unit(IoU) ๊ตฌํ•œ๋‹ค.
    IoU์— ๋ฅผ ์•„์ง ์ž˜ ๋ชจ๋ฅด์‹ ๋‹ค๋ฉด
    IoU ํฌ์ŠคํŠธ ์— ๋“ค์–ด๊ฐ€ IoU์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.
  4. IoU๊ฐ€ threshold ์ด์ƒ์ธ Bounding box๋“ค์€ ์ œ๊ฑฐ ํ•ฉ๋‹ˆ๋‹ค. bounding box๋ผ๋ฆฌ IoU๊ฐ€ ๋†’์„์ˆ˜๋ก ์ค‘๋ณต ์˜์—ญ์ด ํฌ๋‹ค๋Š” ๊ฒƒ์ด๊ณ , ๋งŽ์ด ๊ฒน์ณ์งˆ์ˆ˜๋ก ๊ฐ™์€ ๋ฌผ์ฒด๋ฅผ ๊ฒ€์ถœํ•˜๊ณ  ์žˆ๋‹ค๋Š” ๋œป์ž…๋‹ˆ๋‹ค. ๊ณ ๋กœ ์ค‘๋ณต๋œ bounding box๋ฅผ ์ œ๊ฑฐํ•ฉ๋‹ˆ๋‹ค.

e.g.e.g.

  1. threshold = 0.5 ๋กœ ํ•˜์—ฌ 0.5 ์ดํ•˜์˜ ์ ์ˆ˜๋ฅผ ๊ฐ–๋Š” bounding box๋“ค์„ ์ œ๊ฑฐํ•˜์˜€์Šต๋‹ˆ๋‹ค.
  2. ์ œ๊ฑฐํ•˜๊ณ  ๋‚จ์€ bounding box๋ฅผ ๋‚ด๋ฆผ์ฐจ์ˆœํ•ฉ๋‹ˆ๋‹ค.

  1. ์ •๋ ฌ ํ›„ ๊ฐ€์žฅ ๋†’์€ ์ ์ˆ˜๋ฅผ ๊ฐ–๋Š” ' 0.92 ' ์ธ ๋นจ๊ฐ„์ƒ‰ bounding box ๋ฅผ ์„ ํƒํ•œ๋‹ค.
    ๊ทธ๋ฆฌ๊ณ  ๋‹ค๋ฅธ bounding box ( 0.65 , 0.51 , 0.68 ) ์™€ IoU๋ฅผ ๊ตฌํ•œ๋‹ค.
  2. IoU๊ฐ€ threshold ์ด์ƒ์ธ bounding box๋“ค์„ ํ•˜๋‚˜์”ฉ ์ œ๊ฑฐํ•˜์—ฌ bounding box ๋ฆฌ์ŠคํŠธ๊ฐ€ ํ•˜๋‚˜๋„ ๋‚จ์ง€ ์•Š์„ ๋•Œ๊นŒ์ง€ ๋ฐ˜๋ณตํ•œ๋‹ค.

์ด๋ ‡๊ฒŒ ํ•˜์—ฌ ๊ฐ€์žฅ ๋†’์€ ์ ์ˆ˜๋ฅผ ๊ฐ–๋Š” bounding box ๋‹จ ํ•˜๋‚˜๋งŒ ๋‚จ๊ฒจ ๊ฐ์ฒด ํƒ์ง€๋ฅผ ์™„์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

profile
๐’ฅ๐“Š๐“ƒ๐’พโ„ด๐“‡ ๐’Ÿ๐’ถ๐“‰๐’ถ ๐’ฎ๐’ธ๐’พโ„ฏ๐“ƒ๐“‰๐’พ๐“ˆ๐“‰

0๊ฐœ์˜ ๋Œ“๊ธ€