2

I want to do transfer learning in YOLOv3 in Darknet so I want to use the pre-trained model of YOLOv3 that was trained on COCO dataset and then further train it on my own dataset to detect additional objects. So what are the steps that I should do? How can I label my data so that it can be used in Darknet? Please help me because it's the first time that I use Darknet and YOLO.

black
  • 799
  • 1
  • 9
  • 23

2 Answers2

6

It's all explained here: https://github.com/AlexeyAB/darknet#how-to-train-to-detect-your-custom-objects

Note that notation must be consistent. Any missing annotated object will result in a bad learning and so a bad prediction.

  • can you please elaborate on "Any missing annotated object will result in a bad learning and so a bad prediction"? Thank you – Abdu Jun 03 '22 at 13:49
  • 1
    Let's say that you are labeling car. If you are only labeling one car by image instead of all cars, the model will learn to only detect this specific car instead of all of them. – Steve Zaretti Jun 04 '22 at 14:29
1

This question was answered in "Fine-tuning and transfer learning by the example of YOLO" (Fine-tuning and transfer learning by the example of YOLO).

The answer given by gameon67, suggesting this:

If you are using AlexeyAB's darknet repo (not darkflow), he suggests to do Fine-Tuning instead of Transfer Learning by setting this param in cfg file : stopbackward=1 .

Then input ./darknet partial yourConfigFile.cfg yourWeightsFile.weights outPutName.LastLayer# LastLayer# such as :

./darknet partial cfg/yolov3.cfg yolov3.weights yolov3.conv.81 81 It will create yolov3.conv.81 and will freeze the lower layer, then you can train by using weights file yolov3.conv.81 instead of original darknet53.conv.74.

References : https://github.com/AlexeyAB/darknet#how-to-improve-object-detection

Community
  • 1
  • 1
Emil Hovad
  • 29
  • 1
  • 1
    The recommendation is only to train faster, with a decrease in accuracy. This is not a global recommendation. – h3ct0r Feb 26 '20 at 02:44