ROKO

[coursera] Convolutional Neural Networks: Week 3-1 본문

Artificial Intelligence/Deep Learning

[coursera] Convolutional Neural Networks: Week 3-1

RO_KO 2024. 7. 3. 01:32
728x90

Classification with localization

\(y=[p_c, b_x, b_y, b_h, b_w, c_1,c_2, c_3]\)

  • \(y_1=p_c\): 객체가 있는지 없는지에 대한 확률
  • \(b_x, b_y\): 객체의 중심좌표
  • \(b_h, b_w\): bounding box의 높이와 너비
  • \(c_1,c_2,c_3\): 각 클래스에 해당할 확률

loss 는 객체가 있을 경우 전부를 고려해서 계산하고, 객체가 없는 경우 객체 확률만 고려한다. (나머지는 객체가 없는 상황에서 무의미하기 때문) bounding box는 squared error, class는 softmax, \(p_c\)는 logisitic regression loss를 사용할 수 있다.

Landmark detection

객체 탐지를 넘어 특정 부분의 위치를 알아내고 싶어할 수 있다. 이것을 landmark detection이라고 한다.

Pose estimation

포즈 추정과 같은 경우 사람의 중요한 골격 포인트를 label화 하여 학습 할 수 있다.

Object detection

여러 크기의 window와 함께 sliding window detection 방식을 사용해 window안에 객체가 있는지 예측한다. 하지만 이건 computational cost가 너무 많이 든다. 큰 window size와 stride를 이용해 cost를 줄일 수 있지만 반대로 성능이 저하되는 형상이 나타난다. 초기에는 hand-engineering된 feature들을 이미지에서 추출해 linaer classifier를 거쳐 사용했기에 sliding window detection 방식의 오버헤드가 크지 않았다. 하지만 deep learning 은 한번의 모델 추론이 선형분류기 (linaer classifier)보다 훨씬 많은 양의 연산을 요구하므로 유사하게 생각하면 안된다.

 

Convolutional implementation of sliding window

FC layer를 1x1 convolution layer 로 변경했다.

OverFeat

이전의 sliding window detection 방식은 각각의 crop 이미지를 독립적으로 모델에 넣어야 했는데, 이는 상당히 cost가 많이 들고 사실 각 crop된 이미지는 많은 중복된 연산을 수행한다. 

https://arxiv.org/abs/1312.6229

 

OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks

We present an integrated framework for using Convolutional Networks for classification, localization and detection. We show how a multiscale and sliding window approach can be efficiently implemented within a ConvNet. We also introduce a novel deep learnin

arxiv.org

 

따라서 OverFeat 논문은 전체 이미지를 넣어서 여러 crop 된 이미지들의 확률을 한번에 계산해 버린다. 하지만 이 모델은 정확한 bounding box coordinate을 예측하지 못한다는 한계점이 있다.

 

YOLO

YOLO는 이미지에 grid를 나눈 각각의 cell에 대해서 예측하는 과정을 거친다. 위의 예시에서 최종 예측값은 3x3x8 (grid size x label)이 나온다. grid를 나누어 예측하는 과정이 bounding box를 예측하는데 도움이 된다는 것을 알 수 있다. grid 가 세밀해지만 하나의 grid 안에 여러 object 의 mid point가 겹칠일이 적으므로 정확도가 올라간다.

 

bounding box 예측값을 어떻게 encoding 되는지는 간단하다. x,y좌표는 해당 grid cell을 기준으로 cell의 한 변을 1로 했을때 (0,1) 사이의 비율값을 출력해 mid point를 찾을 수 있다. 높이와 너비는 1보다 클 수 있는데 왜냐하면 객체가 grid를 벗어나는 경우가 있기 때문이다.

https://arxiv.org/abs/1506.02640

 

You Only Look Once: Unified, Real-Time Object Detection

We present YOLO, a new approach to object detection. Prior work on object detection repurposes classifiers to perform detection. Instead, we frame object detection as a regression problem to spatially separated bounding boxes and associated class probabili

arxiv.org

 

728x90
Comments