[Object Detection] darknet 으로 Gaussian YOLOv3 학습하기 (linux)
darknet 학습하기는 아래 포스팅 참고하시길 바란다.
darknet 학습 준비하기 : https://eehoeskrap.tistory.com/367
[Object Detection] Darknet 학습 준비하기
환경 Ubuntu 16.04 GeForce RTX 2080 1. 학습 준비하기 1.1 COCO 데이터 세트를 이용한 학습 COCO 데이터는 2014 , 2017 로 나뉘어져 있는데, 홈페이지에서 다운 받을 수도 있지만, 크기가 너무 커서 유틸리티 cur..
eehoeskrap.tistory.com
darknet custom 학습하기 : https://eehoeskrap.tistory.com/370
[Object Detection] darknet custom 학습하기
darknet 학습을 위해 이전에 처리해야할 과정들은 다음 포스팅을 참고 [Object Detection] darknet custom 학습 준비하기 https://eehoeskrap.tistory.com/367 [Object Detection] Darknet 학습 준비하기 환경 Ubu..
eehoeskrap.tistory.com
본 포스팅은 리눅스 환경에서 AlexeyAB 의 darknet 레포를 이용하여 Gaussian Yolo v3 를 학습하는 방법을 담는다.
또한 Gaussian Yolo v3 를 학습하는데 있어서 발생하는 issue 들을 정리하였다.
https://github.com/AlexeyAB/darknet
The Loss value does not decrease · Issue #4481 · AlexeyAB/darknet
@AlexeyAB Hi. When I use Gaussian_yolov3_BDD.cfg to train my own dataset. When the Loss value reached about 780, then it won't decrease but float around 780 for a long time as I observed. Here ...
github.com
1. AlexeyAB 에서 업데이트된 git 다운로드 or Gaussin yolo v3 에 관련된 파일들만 대체
필자는 귀찮아서, 폴더를 하나 생성하여 git 을 새로 다운 받았다.
$ git clone https://github.com/AlexeyAB/darknet.git
2. Cmake or make 를 통하여 컴파일하기
https://github.com/AlexeyAB/darknet#how-to-compile-on-linux-using-make
AlexeyAB/darknet
Windows and Linux version of Darknet Yolo v3 & v2 Neural Networks for object detection (Tensor Cores are used) - AlexeyAB/darknet
github.com
위 방법을 참조하여 컴파일을 수행한다. 필자는 아래와 같이 Makefile 을 설정하고 간단하게 make 를 실행하였다.
GPU=1
CUDNN=1
CUDNN_HALF=1
OPENCV=1
AVX=0
OPENMP=0
LIBSO=0
ZED_CAMERA=0
$ make
3. 데이터셋 준비하기
아래 포스팅 참고하여 데이터세트 및 .data 파일, .names 파일 등을 준비하기
https://eehoeskrap.tistory.com/367
[Object Detection] Darknet 학습 준비하기
환경 Ubuntu 16.04 GeForce RTX 2080 1. 학습 준비하기 1.1 COCO 데이터 세트를 이용한 학습 COCO 데이터는 2014 , 2017 로 나뉘어져 있는데, 홈페이지에서 다운 받을 수도 있지만, 크기가 너무 커서 유틸리티 cur..
eehoeskrap.tistory.com
https://eehoeskrap.tistory.com/370
[Object Detection] darknet custom 학습하기
darknet 학습을 위해 이전에 처리해야할 과정들은 다음 포스팅을 참고 [Object Detection] darknet custom 학습 준비하기 https://eehoeskrap.tistory.com/367 [Object Detection] Darknet 학습 준비하기 환경 Ubu..
eehoeskrap.tistory.com
4. cfg 수정하기
오리지널 gaussian yolo cfg 는 cfg 폴더에 담겨져 있다.
기존 yolo v3 는 아래와 같이 필터수를 수정하였다면,
filters = (classes + 4 + 1) * <numbers in mask>
새로운 Gaussian Yolo v3 는 아래와 같이 필터수를 조정한다.
filters = (classes + 8 + 1) * 3
또한, learning_rate 수를 0.001 이 아닌 0.00001 로 수정한다. (그 이유는 맨 아래에서 설명)
learning_rate=0.00001
burn_in=1000
max_batches = 50200
policy=steps
steps=40000,45000
scales=.1,.1
max_epochs = 300
그리고, 각자 입맛에 맞게 cfg 파일을 수정하여준다. 클래스 수 등등
5. 학습하기
필자는 mAP 및 loss avg 를 눈으로 확인하기 위하여 -map 플래그를 사용하였다.
./darknet detector train user.data cfg/Gaussian_yolov3_BDD.cfg darknet53.conv.74 -gpus 0 -map
gaussain yolo v3 학습 이슈
- learning_rate = 0.001 vs learning_rate = 0.00001
참고자료 : https://github.com/AlexeyAB/darknet/issues/4190
about [Gaussian_yolo] · Issue #4190 · AlexeyAB/darknet
Hi, @AlexeyAB Thanks for you share. I found you add "[Gaussian_yolo]" Can I train now?Any precautions? Trhanks
github.com
- loss 값이 800 ~ 이상 값으로 계속 떨어지지 않고, mAP 는 올라가는 이슈
- 이는 학습이 잘 되고 있는 것이라고 한다.
- gaussian yolo v3 가 원래 손실값이 높게 나온다고 레포 저자가 말하고 있다.
참고자료 : https://github.com/AlexeyAB/darknet/issues/4190
about [Gaussian_yolo] · Issue #4190 · AlexeyAB/darknet
Hi, @AlexeyAB Thanks for you share. I found you add "[Gaussian_yolo]" Can I train now?Any precautions? Trhanks
github.com
- gaussain yolo v3 에서 작은 객체에 대해서 false positives 가 생기는 현상
- 이는 아래와 같이 iou_normalizer 및 uc_normalizer 값을 조정하여 재학습한다.
[Gaussian_yolo]
iou_normalizer=0.1
uc_normalizer=0.1
참고자료 : https://github.com/AlexeyAB/darknet/issues/4408
Gaussian-yolov3 will have false positives about small targets · Issue #4408 · AlexeyAB/darknet
Thanks for your work,I am your fans. I have tried yolov3 and gauss_yolov3, 3 categories, one of which is a small target. More than 6000 images. Yolov3 was trained 18,000 times, the latter was train...
github.com
- gaussian yolo v3 에서 사용되는 GIOU 에 대한 자료
https://arxiv.org/abs/1902.09630v2
Generalized Intersection over Union: A Metric and A Loss for Bounding Box Regression
Intersection over Union (IoU) is the most popular evaluation metric used in the object detection benchmarks. However, there is a gap between optimizing the commonly used distance losses for regressing the parameters of a bounding box and maximizing this me
arxiv.org
Generalized Intersection over Union
Pseudocode Algorithm: $IoU$ and $GIoU$ as bounding box losses $input$: Predicted $B^p$ and ground truth $B^g$ bounding box coordinates: $B^p = (x^p_1,y^p_1,x^p_2,y^p_2) $, $B^g = (x^g_1,y^g_1,x^g_2,y^g_2)$ $output$: $\mathcal{L}_{IoU}$, $\mathcal{L}_{GIoU}
giou.stanford.edu
'AI Research Topic > Object Detection' 카테고리의 다른 글
[Object Detection] The Car Connection Picture Dataset (4) | 2020.02.03 |
---|---|
[Paper Review] Imbalance Problems in Object Detection : A Review (1) | 2020.01.30 |
[Paper Review] M2Det : A Single-Shot Object Detector based on Multi-Level Feature Pyramid Network (7) | 2020.01.09 |
[Object Detection] Gaussian YOLOv3 (0) | 2019.12.27 |
[Object Detection] darknet custom 학습하기 (83) | 2019.10.16 |