SlideShare a Scribd company logo
You Only Look Once: Unified, real-time object detection
Proceedings of the IEEE conference on computer vision and pattern recognition. 2016. p. 779-788.
발표자 : 오유진
Abstract
Key point
• 이미지의 bounding box 를 실시간으로 검출
• Object detection 을 regression 문제로 접근해, 별도의 region proposal 을 위한 구조 없이 한 번에 전체 이미지로부터 어떤 object 들이 어디에
위치하고 있는지 예측 가능
‐ RCNN 류에서는 bounding box 를 찾고 region proposal, 각 bounding box 에 대해 classification/regression 을 하는 다단계 방식.
regression, detection score 두 가지 task를 모두 수행 → 속도가 느림
• 속도가 빠르지만 정확도가 떨어짐
YOLO
[YOLO Detection System]
• 이미지 내의 bounding box 와 class probability 를 single regression problem 으로 간주해, 이미지를 한 번 보는 것으로 object 의
종류와 위치를 추측
[YOLO가 가지고 있는 상대적인 장/단점]
• 장점
‐ 간단한 처리과정으로 속도가 매우 빠름
‐ Background error(False positive)가 낮음
‐ Object 에 대한 더 일반화된 특징을 학습
• 단점
‐ 상대적으로 낮은 정확도(특히, 작은 object 에 대해)
✓ 이전의 object detection 문제가 어떻게 regression 으로
해결되었나?
RCNN 기반의 모델들은 sliding window 사용하거나,
물체가 있을 것 같은 곳이나 아무데나 bounding box를 뿌린 후
이것을 모두 분류한 다음 필요 없는 것들 지우고 점수 매기는 방법
-> 한번만 이미지를 보고 resize 해서 CNN 한번만 거치고
NMS 통해서 object detection
• Input image 를 𝐒 × 𝐒 grid 로 나눔
• 각 grid cell 이 해당 object 를 감지하고, grid cell 은 B 개의 bonding box에 대한 confidence score 를 예측
‐ Score 는 모델이 해당 box 에 object 가 얼마나 포함되고 예측 정확도가 얼마나 정확한지 반영
‐ Confidence Score: 𝑷𝒓 𝒐𝒃𝒋𝒆𝒄𝒕 ∗ 𝑰𝑶𝑼 𝒑𝒓𝒆𝒅
𝒕𝒓𝒖𝒕𝒉
, (object 가 존재하지 않으면 0)
• 각각의 bounding box 는 5개의 prediction 으로 구성: (x, y, w, h, confidence)
‐ (x, y) 좌표는 grid cell 의 bound 기준으로 한 상자의 중심
‐ Confidence 는 predicted box 와 모든 ground truth box 사이의 IOU
• 각각의 grid cell 은 C 개의 conditional class probability 를 가짐
‐ Conditional Class Probability: 𝑷𝒓 𝑪𝒍𝒂𝒔𝒔𝒊 𝑶𝒃𝒋𝒆𝒄𝒕)
• Test time 에 conditional class probability 와 bounding box 의 confidence score 를 곱해 class 별 confidence score 계산
‐ 𝐂𝐥𝐬𝐬𝐒𝐩𝐞𝐜𝐢𝐟𝐢𝐜𝐂𝐨𝐧𝐟𝐢𝐝𝐞𝐧𝐜𝐞𝐒𝐜𝐨𝐫𝐞 = 𝑷𝒓 𝑪𝒍𝒂𝒔𝒔𝒊 𝑶𝒃𝒋𝒆𝒄𝒕) ∗ 𝑷𝒓 𝑶𝒃𝒋𝒆𝒄𝒕 ∗ 𝑰𝑶𝑼 𝒑𝒓𝒆𝒅
𝒕𝒓𝒖𝒕𝒉
= 𝑷𝒓 𝑪𝒍𝒂𝒔𝒔𝒊 ∗ 𝑰𝑶𝑼 𝒑𝒓𝒆𝒅
𝒕𝒓𝒖𝒕𝒉
YOLO – Unified Detection
PASCAL VOC 에서 S=7, B=2, C=20
𝑆 × 𝑆 𝐵 × 5 + 𝐶 tensor
• GoogleNet model 기반으로 구축
• Convolutional layer 24개, Fully connected layer 2개로 구성
– 1 × 1 reduction layer 에 3 × 3 Convolutional layer 가 뒤따르는 모양을 사용
• Final output 은 7 × 7 × 30 tensor
• Fast YOLO 는 9개의 convolutional layer와 더 적은 수의 filter 사용해 속도 높여 사용
YOLO – network design
Feature extractor
Object classifier
YOLO – network design
YOLO – network design
YOLO – network design
YOLO – network design
YOLO – network design
YOLO – network design
YOLO – network design
YOLO – network design
YOLO – network design
YOLO – Non-Maximum Suppression: intuition
YOLO – Non-Maximum Suppression: intuition
YOLO – Non-Maximum Suppression: intuition
YOLO – Non-Maximum Suppression: intuition
YOLO – Non-Maximum Suppression: intuition
YOLO – Non-Maximum Suppression: intuition
YOLO – Non-Maximum Suppression: intuition
YOLO – Non-Maximum Suppression: intuition
YOLO – Non-Maximum Suppression: intuition
YOLO – Non-Maximum Suppression: intuition
YOLO – Non-Maximum Suppression: intuition
YOLO – Non-Maximum Suppression: intuition
YOLO – loss function
Object가 존재하는 grid cell 𝑖 의 predictor bounding box 𝑗 → 가장 좋은 BB 만 더 가중되게 하기 위해서
Object가 존재하지 않는 grid cell 𝑖 의 bounding box 𝑗
Object가 존재하는 grid cell 𝑖 → object 가 있는지 없는지
1) Object 가 존재하는 grid cell 𝑖 의 predictor bounding box 𝑗 에 대해 x
와 y 의 loss 를 계산
2) Object 가 존재하는 grid cell 𝑖 의 predictor bounding box 𝑗에 대해, w
와 h 의 loss 를 계산
• Large box 에 대해서 small deviation 반영 위해 제곱근 취한 후 SSE
(같은 error라도 large box 의 경우 상대적으로 IOU 에 영향을 적게 줌)
3) Object 가 존재하는 grid cell 𝑖 의 predictor bounding box 𝑗 에 대해,
confidence score 의 loss 계산 𝑪𝒊 = 𝟏
4) Object 가 존재하지 않는 grid cell 𝑖 의 bounding box 𝑗 에 대해 confidence
score 의 loss를 계산 𝑪𝒊 = 𝟎
5) Object 가 존재하는 grid cell 𝑖 에 대해, conditional class probability 의 loss 계
산 (Correct class c: 𝒑𝒊 𝒄 = 𝟏, otherwise: 𝒑𝒊 𝒄 = 𝟎)
𝜆 𝑐𝑜𝑜𝑟𝑑, coordinates(x,y,w,h)에 대한 loss 와 다른 loss 들과의 균형을 위한 balancing parameter
𝜆 𝑛𝑜𝑜𝑏𝑗, obj 가 있는 box 와 없는 box 간에 균형을 위한 balancing parameter (obj 가 없는 cell 이 더 많기 때문)
YOLO – training
• ImageNet 1000-class dataset 으로 20개의 convolutional layer 를 pre-training
• Pre-training 이후 4 convolutional layers 와 2 fully connected layers 를 추가
• BB 의 width 와 height 는 이미지의 width 와 height 로 normalize
• BB 의 x 와 y 는 특정 grid cell 의 위치의 offset 값 사용
• 𝜆 𝑐𝑜𝑜𝑟𝑑 = 5, 𝜆 𝑛𝑜𝑜𝑏𝑗 = 0.5 → BB 안에 object 가 있는지 없는 미리 판단하기 때문에 𝜆 𝑐𝑜𝑜𝑟𝑑 가 더 높음
• Batch size : 64
• Momentum : 0.9
• Learning rate : 0.001에서 0.01로 epoch 마다 천천히 상승시킴. 이후 75 epoch 동안 0.01, 30 epoch 동안 0.001, 마지막 30 epoch 동안 0.0001
• Dropout Rate : 0.5
• Activation function : leaky rectified linear activation
[ limitation]
• 각각의 grid cell 이 하나의 class 만을 예측하기 때문에, 작은 object 여러 개가 (새 무리) 붙어있으면 제대로 예측하지 못함
• Bounding box 의 형태가 training data 를 통해 학습되기때문에, 새로운 형태의 bounding box의 경우 정확한 예측이 어려움
• 몇 단계의 layer 를 거쳐서 나온 feature map 을 대상으로 bounding box 를 예측하므로 localization 이 다소 부정확해짐
YOLO – Experiments(detection system 비교)
• Fast YOLO 는 155fps 로 가장 빠른 처리 성능을 보임
• YOLO 와 Faster RCNN 과 유사한 mAP 수준
• Fast RCNN 은 error 는 background 영역에서 대부분
발생, YOLO error 는 localization 부분에서 발생
• Fast RCNN 과 YOLO 를 함께 사용하면 background
error 문제를 보완할 수 있음
YOLO – Experiments(detection system 비교)
• 정확도 측면에서 Fast RCNN + YOLO 가 최상위권
• 다른 distribution 을 가지는 환경에 모델이 얼마나 잘 일반화하는지 알아
보기 위한 실험 수행
– Artwork dataset(Picasso, People-Art)에서 실험
• YOLO 는 높은 AP 값을 보이면서 다양한 BB 검출

More Related Content

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

[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation
[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation
[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation
taeseon ryu
 
Convolutional neural networks
Convolutional neural networksConvolutional neural networks
Convolutional neural networks
HyunjinBae3
 
Voxel based game_optimazation_relelase
Voxel based game_optimazation_relelaseVoxel based game_optimazation_relelase
Voxel based game_optimazation_relelase
YEONG-CHEON YOU
 
[IGC2018] 유영천 개발자 - Voxel기반 네트워크 게임 최적화기법
[IGC2018] 유영천 개발자 - Voxel기반 네트워크 게임 최적화기법[IGC2018] 유영천 개발자 - Voxel기반 네트워크 게임 최적화기법
[IGC2018] 유영천 개발자 - Voxel기반 네트워크 게임 최적화기법
강 민우
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
Kim Daeun
 
Real-time near-field global illumination based on a voxel model
Real-time near-field global illumination based on a voxel modelReal-time near-field global illumination based on a voxel model
Real-time near-field global illumination based on a voxel modelJaeyun Lee
 
[Unite2015 박민근] 유니티 최적화 테크닉 총정리
[Unite2015 박민근] 유니티 최적화 테크닉 총정리[Unite2015 박민근] 유니티 최적화 테크닉 총정리
[Unite2015 박민근] 유니티 최적화 테크닉 총정리
MinGeun Park
 

Similar to You Only Look Once: Unified, Real-Time Object Detection (7)

[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation
[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation
[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation
 
Convolutional neural networks
Convolutional neural networksConvolutional neural networks
Convolutional neural networks
 
Voxel based game_optimazation_relelase
Voxel based game_optimazation_relelaseVoxel based game_optimazation_relelase
Voxel based game_optimazation_relelase
 
[IGC2018] 유영천 개발자 - Voxel기반 네트워크 게임 최적화기법
[IGC2018] 유영천 개발자 - Voxel기반 네트워크 게임 최적화기법[IGC2018] 유영천 개발자 - Voxel기반 네트워크 게임 최적화기법
[IGC2018] 유영천 개발자 - Voxel기반 네트워크 게임 최적화기법
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
 
Real-time near-field global illumination based on a voxel model
Real-time near-field global illumination based on a voxel modelReal-time near-field global illumination based on a voxel model
Real-time near-field global illumination based on a voxel model
 
[Unite2015 박민근] 유니티 최적화 테크닉 총정리
[Unite2015 박민근] 유니티 최적화 테크닉 총정리[Unite2015 박민근] 유니티 최적화 테크닉 총정리
[Unite2015 박민근] 유니티 최적화 테크닉 총정리
 

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

  • 1. You Only Look Once: Unified, real-time object detection Proceedings of the IEEE conference on computer vision and pattern recognition. 2016. p. 779-788. 발표자 : 오유진
  • 2. Abstract Key point • 이미지의 bounding box 를 실시간으로 검출 • Object detection 을 regression 문제로 접근해, 별도의 region proposal 을 위한 구조 없이 한 번에 전체 이미지로부터 어떤 object 들이 어디에 위치하고 있는지 예측 가능 ‐ RCNN 류에서는 bounding box 를 찾고 region proposal, 각 bounding box 에 대해 classification/regression 을 하는 다단계 방식. regression, detection score 두 가지 task를 모두 수행 → 속도가 느림 • 속도가 빠르지만 정확도가 떨어짐
  • 3. YOLO [YOLO Detection System] • 이미지 내의 bounding box 와 class probability 를 single regression problem 으로 간주해, 이미지를 한 번 보는 것으로 object 의 종류와 위치를 추측 [YOLO가 가지고 있는 상대적인 장/단점] • 장점 ‐ 간단한 처리과정으로 속도가 매우 빠름 ‐ Background error(False positive)가 낮음 ‐ Object 에 대한 더 일반화된 특징을 학습 • 단점 ‐ 상대적으로 낮은 정확도(특히, 작은 object 에 대해) ✓ 이전의 object detection 문제가 어떻게 regression 으로 해결되었나? RCNN 기반의 모델들은 sliding window 사용하거나, 물체가 있을 것 같은 곳이나 아무데나 bounding box를 뿌린 후 이것을 모두 분류한 다음 필요 없는 것들 지우고 점수 매기는 방법 -> 한번만 이미지를 보고 resize 해서 CNN 한번만 거치고 NMS 통해서 object detection
  • 4. • Input image 를 𝐒 × 𝐒 grid 로 나눔 • 각 grid cell 이 해당 object 를 감지하고, grid cell 은 B 개의 bonding box에 대한 confidence score 를 예측 ‐ Score 는 모델이 해당 box 에 object 가 얼마나 포함되고 예측 정확도가 얼마나 정확한지 반영 ‐ Confidence Score: 𝑷𝒓 𝒐𝒃𝒋𝒆𝒄𝒕 ∗ 𝑰𝑶𝑼 𝒑𝒓𝒆𝒅 𝒕𝒓𝒖𝒕𝒉 , (object 가 존재하지 않으면 0) • 각각의 bounding box 는 5개의 prediction 으로 구성: (x, y, w, h, confidence) ‐ (x, y) 좌표는 grid cell 의 bound 기준으로 한 상자의 중심 ‐ Confidence 는 predicted box 와 모든 ground truth box 사이의 IOU • 각각의 grid cell 은 C 개의 conditional class probability 를 가짐 ‐ Conditional Class Probability: 𝑷𝒓 𝑪𝒍𝒂𝒔𝒔𝒊 𝑶𝒃𝒋𝒆𝒄𝒕) • Test time 에 conditional class probability 와 bounding box 의 confidence score 를 곱해 class 별 confidence score 계산 ‐ 𝐂𝐥𝐬𝐬𝐒𝐩𝐞𝐜𝐢𝐟𝐢𝐜𝐂𝐨𝐧𝐟𝐢𝐝𝐞𝐧𝐜𝐞𝐒𝐜𝐨𝐫𝐞 = 𝑷𝒓 𝑪𝒍𝒂𝒔𝒔𝒊 𝑶𝒃𝒋𝒆𝒄𝒕) ∗ 𝑷𝒓 𝑶𝒃𝒋𝒆𝒄𝒕 ∗ 𝑰𝑶𝑼 𝒑𝒓𝒆𝒅 𝒕𝒓𝒖𝒕𝒉 = 𝑷𝒓 𝑪𝒍𝒂𝒔𝒔𝒊 ∗ 𝑰𝑶𝑼 𝒑𝒓𝒆𝒅 𝒕𝒓𝒖𝒕𝒉 YOLO – Unified Detection PASCAL VOC 에서 S=7, B=2, C=20 𝑆 × 𝑆 𝐵 × 5 + 𝐶 tensor
  • 5. • GoogleNet model 기반으로 구축 • Convolutional layer 24개, Fully connected layer 2개로 구성 – 1 × 1 reduction layer 에 3 × 3 Convolutional layer 가 뒤따르는 모양을 사용 • Final output 은 7 × 7 × 30 tensor • Fast YOLO 는 9개의 convolutional layer와 더 적은 수의 filter 사용해 속도 높여 사용 YOLO – network design Feature extractor Object classifier
  • 15. YOLO – Non-Maximum Suppression: intuition
  • 16. YOLO – Non-Maximum Suppression: intuition
  • 17. YOLO – Non-Maximum Suppression: intuition
  • 18. YOLO – Non-Maximum Suppression: intuition
  • 19. YOLO – Non-Maximum Suppression: intuition
  • 20. YOLO – Non-Maximum Suppression: intuition
  • 21. YOLO – Non-Maximum Suppression: intuition
  • 22. YOLO – Non-Maximum Suppression: intuition
  • 23. YOLO – Non-Maximum Suppression: intuition
  • 24. YOLO – Non-Maximum Suppression: intuition
  • 25. YOLO – Non-Maximum Suppression: intuition
  • 26. YOLO – Non-Maximum Suppression: intuition
  • 27. YOLO – loss function Object가 존재하는 grid cell 𝑖 의 predictor bounding box 𝑗 → 가장 좋은 BB 만 더 가중되게 하기 위해서 Object가 존재하지 않는 grid cell 𝑖 의 bounding box 𝑗 Object가 존재하는 grid cell 𝑖 → object 가 있는지 없는지 1) Object 가 존재하는 grid cell 𝑖 의 predictor bounding box 𝑗 에 대해 x 와 y 의 loss 를 계산 2) Object 가 존재하는 grid cell 𝑖 의 predictor bounding box 𝑗에 대해, w 와 h 의 loss 를 계산 • Large box 에 대해서 small deviation 반영 위해 제곱근 취한 후 SSE (같은 error라도 large box 의 경우 상대적으로 IOU 에 영향을 적게 줌) 3) Object 가 존재하는 grid cell 𝑖 의 predictor bounding box 𝑗 에 대해, confidence score 의 loss 계산 𝑪𝒊 = 𝟏 4) Object 가 존재하지 않는 grid cell 𝑖 의 bounding box 𝑗 에 대해 confidence score 의 loss를 계산 𝑪𝒊 = 𝟎 5) Object 가 존재하는 grid cell 𝑖 에 대해, conditional class probability 의 loss 계 산 (Correct class c: 𝒑𝒊 𝒄 = 𝟏, otherwise: 𝒑𝒊 𝒄 = 𝟎) 𝜆 𝑐𝑜𝑜𝑟𝑑, coordinates(x,y,w,h)에 대한 loss 와 다른 loss 들과의 균형을 위한 balancing parameter 𝜆 𝑛𝑜𝑜𝑏𝑗, obj 가 있는 box 와 없는 box 간에 균형을 위한 balancing parameter (obj 가 없는 cell 이 더 많기 때문)
  • 28. YOLO – training • ImageNet 1000-class dataset 으로 20개의 convolutional layer 를 pre-training • Pre-training 이후 4 convolutional layers 와 2 fully connected layers 를 추가 • BB 의 width 와 height 는 이미지의 width 와 height 로 normalize • BB 의 x 와 y 는 특정 grid cell 의 위치의 offset 값 사용 • 𝜆 𝑐𝑜𝑜𝑟𝑑 = 5, 𝜆 𝑛𝑜𝑜𝑏𝑗 = 0.5 → BB 안에 object 가 있는지 없는 미리 판단하기 때문에 𝜆 𝑐𝑜𝑜𝑟𝑑 가 더 높음 • Batch size : 64 • Momentum : 0.9 • Learning rate : 0.001에서 0.01로 epoch 마다 천천히 상승시킴. 이후 75 epoch 동안 0.01, 30 epoch 동안 0.001, 마지막 30 epoch 동안 0.0001 • Dropout Rate : 0.5 • Activation function : leaky rectified linear activation [ limitation] • 각각의 grid cell 이 하나의 class 만을 예측하기 때문에, 작은 object 여러 개가 (새 무리) 붙어있으면 제대로 예측하지 못함 • Bounding box 의 형태가 training data 를 통해 학습되기때문에, 새로운 형태의 bounding box의 경우 정확한 예측이 어려움 • 몇 단계의 layer 를 거쳐서 나온 feature map 을 대상으로 bounding box 를 예측하므로 localization 이 다소 부정확해짐
  • 29. YOLO – Experiments(detection system 비교) • Fast YOLO 는 155fps 로 가장 빠른 처리 성능을 보임 • YOLO 와 Faster RCNN 과 유사한 mAP 수준 • Fast RCNN 은 error 는 background 영역에서 대부분 발생, YOLO error 는 localization 부분에서 발생 • Fast RCNN 과 YOLO 를 함께 사용하면 background error 문제를 보완할 수 있음
  • 30. YOLO – Experiments(detection system 비교) • 정확도 측면에서 Fast RCNN + YOLO 가 최상위권 • 다른 distribution 을 가지는 환경에 모델이 얼마나 잘 일반화하는지 알아 보기 위한 실험 수행 – Artwork dataset(Picasso, People-Art)에서 실험 • YOLO 는 높은 AP 값을 보이면서 다양한 BB 검출