딥러닝관련/Detection

Jaccard 계수 (Jaccard coefficient)

머리올리자 2022. 7. 6. 18:25

Jaccard coefficient

(Jaccard index 및 Jaccard similarity) 라고도 함

 

두 집합 사이의 similarity를 측정하는 방법 중 하나.

 

0~1 사이의 값을 가지며 두 집합이 동일하면 1의 값을 가지고, 공통  원소가 없으면 0을 가진다.

 

출처 : https://ko.wikipedia.org/wiki/%EC%9E%90%EC%B9%B4%EB%93%9C_%EC%A7%80%EC%88%98

 

참고

https://ko.wikipedia.org/wiki/%EC%9E%90%EC%B9%B4%EB%93%9C_%EC%A7%80%EC%88%98

 

자카드 지수 - 위키백과, 우리 모두의 백과사전

 

ko.wikipedia.org

 

Object detection에서의 Jaccard coefficient 사용

Object Detection 시 사전에 정의된 box(ex. SSD의 경우 prior box)에서

학습 이미지의 정답인 bounding box와 가까운 prior box를 찾아야 함.

(object의 클래스 정보 및 coordinate 정보도 가까운 box를 찾아야 함)

 

정답 ground truth box(bounding box)와 가장 가까운 prior box를 추출할 때 jaccard coefficient 사용

 

bounding box와 prior box의 jaccard coefficient는 두 box의 총 면적에 겹친 면적을 의미

 

위 수식과 일치

 

Jaccard coefficient는 0~1의 값을 가지며

정답과 일치하면 1

정답과 완전히 벗어나면 0

 

그림 출처 : https://programmer.ink/think/personal-summary-of-ssd-target-detection-calculation-of-iou.html

 

(보통은 IoU라고도 표현하며 두 표현 모두 detection에서 동일한 의미로 사용된다)

 

위 Jaccard coefficient를 사용하여

training data의 정답 bounding box와

Jaccard coefficient가 특정 값 이상(ex, 0.5)인 box들에 대하여

positive box로 표현

 

만약 Jaccard coefficient threshold value를 0.5로 잡았다고 가정하면

 

0.5 미만의 box들은 negative box로 한다.

Negative box는 배경(background) 클래스로 둔다.

 

0.5 이상의 box들은 positive box라고 한다.

Positive box는 물체의 class를 예측한다.