ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • You Only Look Once: Unified, Real-Time Object Detection
    머신러닝, 딥러닝 공부 2020. 3. 9. 12:44
    반응형

    1. Unified Detection

    YOLO의 핵심은 unified detection이다. 기존의 R-CNN은 이미지 내의 2000개의 bounding box후보를 선정하고 각 bounding box안 모든 영역에 대해 calssification을 진행해서 매우 느리고 복잡했다.

     

    R-CNN (First, extract region proposals; Then detect object for each region proposals)

     

    그에 비해 YOLO(You Only Look Once)는 이미지를 한 번 보는 것으로 object의 종류와 위치를 추측한다. single convolutional network를 통해 multiple bounding box에 대한 class probablility를 계산하는 방식이다.

     

    YOLO Unified Detection

     

    YOLO의 object detection 과정은 Input image를 S X S grid로 나누는 것에서 시작한다. 각각의 grid cell은 B개의 bounding box와 각 bounding box에 대한 confidence score를 갖는다. Confidence score은 아래와 같이 정의된다.

     

    Confidence score은 해당 grid cell에 object가 존재할 확률과 예측된 bounding box가 실제 bounding box와 일치하는 정도인 IOU(intersection over union) 값을 곱해서 계산된다. Grid cell에 object가 없다면 confidence score는 0이 된다.

     

    또한 각각의 grid cell은 C개의 conditional class probability를 갖는다. Conditional class probability는 다음과 같이 정의된다.

     

    이는 object가 각 클래스일 조건부 확률을 의미한다.

     

    추가로 bounding box는 아래와 같은 정보를 포함한다.

     

    • (x,y): Bounding box의 중심점을 의미하며, grid cell의 범위에 대한 상대 값

    • (w,h): 전체 이미지의 width, height에 대한 상대 값

    • 앞서 계산한 confidence

    Bounding box의 중심점이 grid cell의 가장 왼쪽에 있다면 x=0, y가 grid cell의 중간에 있다면 y=0.5이 되며 bbox의 width가 이미지 width의 절반이라면 w=0.5이 되는 것이다.

     

    마지막으로 conditional class probability와 bounding box의 confidence score를 곱하여 class-specific confidence score를 계산한다. 아래와 같이 표현이 가능하다.

     

    논문에서는 YOLO의 성능평가를 위해 PASCAL VOC을 사용하였으며, S, B, C에는 각각 7, 2, 20이 사용되었다.

     

    2. Network Architecture

     

    YOLO의 구조이다. Network architecture는 GoogLeNet for image classification 모델을 기반으로 한다. 좀 더 직관적으로 표현하면 아래와 같다.

     

    https://docs.google.com/presentation/d/1aeRvtKG21KHdD5lg6Hgyhx5rPq_ZOsGjG5rJ1HP7BbA/edit#slide=id.p

    결과적으로 7x7x30의 feature가 출력된다. 7x7은 49개의 Grid Cell을 의미한다. 채널은 각각 bounding box의 정보와 class로 이루어져 있다. 각각의 grid cell은 B개의 bounding box를 가지고 있는데 각 bounding box를 표현하는 채널은 5개이다. 즉 B=2에서 앞 5개의 값은 해당 Grid cell의 첫 번째 bounding box에 대한 값이 채워져 있으며 다음 5개는 두 번째 bounding box에 대한 값이다. 마지막 20개는 class 20개를 표현한다. 즉 5+5+20=30. 이를 표현한것이 아래 그림이다.

     

    https://docs.google.com/presentation/d/1aeRvtKG21KHdD5lg6Hgyhx5rPq_ZOsGjG5rJ1HP7BbA/edit#slide=id.p

     

    위 그림과 같이 해당 grid cell의 채널 방향으로 30개의 정보가 담겨있다. bounding box의 5개 정보에는 각각

     

    1. x - coordinate of bbox center inside cell ([0; 1] wrt grid cell size)

    2. y - coordinate of bbox center inside cell ([0; 1] wrt grid cell size)

    3. w - bbox width ([0; 1] wrt image)

    4. h - bbox height ([0; 1] wrt image)

    5. c - bbox confidence ~ P(obj in bbox2)

    을 포함한다. 아래는 class 부분의 내용이다. 여기에는 20개의 class에 대한 conditional class probability에 해당한다.

     

    https://docs.google.com/presentation/d/1aeRvtKG21KHdD5lg6Hgyhx5rPq_ZOsGjG5rJ1HP7BbA/edit#slide=id.p

     

    이제 아래와 같이 첫 번째 bounding box의 confidence score와 각 conditional class probability를 곱하면 첫 번째 bounding box의 class specific confidence score가 나온다. 마찬가지로, 두 번째 bounding box의 confidence score와 각 conditional class probability를 곱하면 두 번째 bounding box의 class specific confidence score가 나온다.

     

    https://docs.google.com/presentation/d/1aeRvtKG21KHdD5lg6Hgyhx5rPq_ZOsGjG5rJ1HP7BbA/edit#slide=id.p

     

    이러한 과정을 모든 bounding box에 대해 하게되면 총 98(7x7x2)개의 class specific confidence score를 얻을 수 있다. 이 class specific confidence score에 대해 각 20개의 클래스를 기준으로 non-maximum suppression을 하여, Object에 대한 Class 및 bounding box Location를 결정한다. non-maximum suppression은 이 PPT를 참고하자.

     

    3. Loss Function

     

     

     

    4. Results

    mAP and FPS Results (VOC 2007)

    다른 real-time object detect 알고리즘에 비해 높은 mAP를 보여준다. Fast YOLO의 경우 가장 빠른 속도를 보여준다.

     

     

    References

    1. https://arxiv.org/abs/1506.02640

    2. https://towardsdatascience.com/yolov1-you-only-look-once-object-detection-e1f3ffec8a89

    3. https://curt-park.github.io/2017-03-26/yolo/

    4. https://docs.google.com/presentation/d/1aeRvtKG21KHdD5lg6Hgyhx5rPq_ZOsGjG5rJ1HP7BbA/edit#slide=id.p

    반응형

    댓글

Designed by black7375.