Skip to content

Instructions to perform transfer learning by using yolo v3 archietecture

Notifications You must be signed in to change notification settings

VipulRamtekkar/Transfer-Learning-using-yolo-v3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Transfer-Learning-using-yolo-v3

Instructions to perform transfer learning by using yolo v3 archietecture

The key steps to perform transfer learning are as follows:

  1. Installing darknet
git clone https://github.com/pjreddie/darknet
cd darknet 
make
  1. Pretrained network weights

As we are interested in performing transfer learning rather than learning from scratch we need to download weights of a pretrained network.

wget https://pjreddie.com/media/files/darknet53.conv.74
  1. Preparing the dataset and labels

While training yolo expects the images should be presented along with the ground truth. The format for the ground truth is very specfic and is as follows:

<object class number> <bbox_x/bbox_width> <bbox_y/image_height> <bbox_width/image_width> <bbox_height/image_height>

Thus, you will get scaled values from 0 to 1 for the bbox values. Eg: 0 0.031 0.057 0.5 0.7

  1. Divide your training data into subsets of training data and test data, a rule of thumb could be keeping 90 and 10 ratio. Now create a training.txt and test.txt files that contain all the addresses of the image files in your folder.

  2. Now we are required to create three files to initiate training darknet.data, class.names and yolo.cfg. The first file tells about the location of the images and where to store the weights, the second tells about the classes in our dataset and the third tells about the configuration. You can find multiple config files in the cfg subfolder in the darknet folder. You can find sample files of all the three in the repository. Saving all these files in the darknet folder.

  3. Now you need to tweak the configuration file according to your need by first selecting a file from the cfg folder and then subsequently changing the number of classes to the number of classes in your dataset in all the [yolo] blocks and changing the number of filters in the [convolution] blocks just before the yolo blocks by using the formula: filter = num/3*(classes+5) where the default num = 9.

  4. Now, you are all set initiate the training by using the command from inside the darknet folder:

./darknet detector train ./darknet.data ./yolo.cfg ./darknet53.conv.74 > ./train.log
  1. Monitor the training and stop it when it converges to avoid overfitting.

About

Instructions to perform transfer learning by using yolo v3 archietecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published