AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.71k stars 7.96k forks source link

fine tuning setup #5205

Open duongdqq opened 4 years ago

duongdqq commented 4 years ago

Before this question, I have read some issues such as #5180 #4585

My target task is to detect: container ship, helicoper, person and aeroplane In those objects, I want to detect container ship and want to use pre trained weight for person and aeroplane of yolov3.weight on MS COCO.

I have some problems and hope you can help me:

  1. In the training dataset, if my target is to train model which can detect container ship and use yolov3.weight to detect person and aeroplane, should I just have only container ship images (i). If (i) is true, If image has person and aeroplane, should I label them
  2. In the file .names does the order of class's name matter to the performance?

I set up my project as below:

  1. file .names: ship person aeroplane
  2. the training set includes container ship person aeroplane
  3. I shink yolov3.weight to yolov3.conv.81 by: ./darknet partial cfg/yolov3.cfg yolov3.weights yolov3.conv.81 81 I train the model by ./darknet detector train obj.data yolov3_obj.cfg yolov3.conv.81 Do I have any wrong stuff in above set up?
ntdat017 commented 4 years ago
  1. I think the order of class's name doesn't affect to the performance.

The set up is ok. I do the same thing like that, and it work well with mAP@50 ~ 0.79. If you are professional, you can try modify anchor box in yolo layer or other tuning like input size, augmentation.

duongdqq commented 4 years ago
  1. I think the order of class's name doesn't affect to the performance.

The set up is ok. I do the same thing like that, and it work well with mAP@50 ~ 0.79. If you are professional, you can try modify anchor box in yolo layer or other tuning like input size, augmentation.

Hi @ntdat017 I do change anchor size to fit with the training dataset, increase input size to 832*832. But my person AP is just 30%, very low if I fine tuning correctly. I think some things wrong.

I have some questions:

  1. Do you have person images in your training set? If yes, are those different from MS COCO or same.
  2. If we use fine tuning to utilize learning knowledge for 'person', should we label person in our new training set
ehsanrahnama commented 4 years ago

Before this question, I have read some issues such as #5180 #4585

My target task is to detect: container ship, helicoper, person and aeroplane In those objects, I want to detect container ship and want to use pre trained weight for person and aeroplane of yolov3.weight on MS COCO.

I have some problems and hope you can help me:

  1. In the training dataset, if my target is to train model which can detect container ship and use yolov3.weight to detect person and aeroplane, should I just have only container ship images (i). If (i) is true, If image has person and aeroplane, should I label them
  2. In the file .names does the order of class's name matter to the performance?

I set up my project as below:

  1. file .names: ship person aeroplane
  2. the training set includes container ship person aeroplane
  3. I shink yolov3.weight to yolov3.conv.81 by: ./darknet partial cfg/yolov3.cfg yolov3.weights yolov3.conv.81 81 I train the model by ./darknet detector train obj.data yolov3_obj.cfg yolov3.conv.81 Do I have any wrong stuff in above set up?
  1. About the first question, you should labeled all of target in your all of images. if you don't label theme, yolo might be ignore it and accuracy of your model decrease.

  2. The order of file .name is important because it match with your label. In coco dataset person has 0 labeled and in file name the first one is person. you can check another labels.

I have suggestion to add some images to dataset that don't have label and .txt file is empty. Accordingly to : link