Segmentation(5) - Metrics

HaeJin Lee·2022년 2월 14일
0

Segmentation 개념 정리

  1. Segmentation(1) - 개념 및 용어
  2. Segmentation(2) - FCN
  3. Segmentation(3) - U-Net
  4. Segmentation(4) - DeepLab
  5. Segmentation(5) - Metrics
  6. Segmentation(7) - 최근 모델, Etc

Segmentation(5) - Metrics

✅Pixel Accuracy

  • 분할된 픽셀 수(classified)를 전체 픽셀 수로 나눈 값
  • K+1K+1개의 클래스 (KK는 foreground class-분할하고자 하는 물체의 수, 11은 background-배경) 라고 가정할 때 수식은 아래와 같음

    PA=i=0Kpiii=0Kj=0KpijPA = \frac{\sum^{K}_{i=0}{p_{ii}}}{\sum^{K}_{i=0}\sum^{K}_{j=0}{p_{ij}}}

  • pijp_{ij} = 클래스 ii를 클래스 jj로 예측 시 픽셀 수

✅MPA(Mean Pixel Accuracy)

  • PA(Pixel Accuracy)의 확장 버전
  • 클래스 마다 올바르게 prediction한 픽셀 수에 Ground Truth 픽셀 수를 나누어 PA 값을 구한뒤 클래스 수에 대하여 평균

    MPA=1K+1i=0Kpiij=0KpijMPA = \frac{1}{K+1}\sum^K_{i=0}\frac{p_{ii}}{\sum^K_{j=0}{p_{ij}}}

✅IoU(Intersection over Union)

  • IoU 또는 Jaccard Index
  • Object detection에서 Ground Truth와 prediction Bbox 비교에도 사용
  • 예측된 분할 mask와 Ground Truth 사이의 교차영역(Intersection)을 결합영역(Union)으로 나눈 값

    IoU=J(A,B)=ABABIoU = J(A,B) = \frac{|A\cap B|}{|A\cup B|}

✅Mean-IoU

  • Mean-IoU는 모든 클래스에 대한 평균 IoU

    MIoU=1K+1i=0KIoUiMIoU = \frac{1}{K+1}\sum^K_{i=0}{IoU_i}

✅Precision/Recall/F1 score

  • Precision=TPTP+FPPrecision = \frac{TP}{TP+FP}, Recall=TPTP+FNRecall=\frac{TP}{TP+FN}
예시
Confusion Matrix
  • F1 score는 Precision과 Recall의 조화평균

    F1score=2PrecisionRecallPrecision+RecallF1 score = \frac{2*Precision*Recall}{Precision+Recall}

✅Dice coefficient

  • Medical Image segmentation에서 주로 쓰이는 metric

    DSC=2XYX+YDSC = \frac{2|X\cap Y|}{|X|+|Y|}
    Dice=2×TP(TP+FP)+(TP+FN)Dice = \frac{2\times TP}{(TP+FP)+(TP+FN)}

  • Sørensen–Dice coefficient 라고도 하며, F1 Score와 개념상 같음
  • 라벨링된 영역과 예측한 영역이 정확히 같다면 1, 그렇지 않을 경우 0
예시
Dise score 예시

🖇️출처
https://go-hard.tistory.com/117
http://machinelearningkorea.com/2019/07/13/%ED%8F%89%EA%B0%80%EC%A7%80%ED%91%9C-dice/

0개의 댓글