How to train new classes on pretrained yolov4 model in darknet

Written by- Aionlinecourse1182 times views

Image

The conventional way to train new classes on the pretrained YOLO4 model in Darknet is by implementing each classifier with its corresponding weights. Thus, the conventional way sets the Weight attribute on the IO connector for this new class.

One need to configure different yolov4 models according to different input_targets of new classes, do not erase old configurations of old models, keep original configuration of new class models for share parameters. 

How to train new classes on pretrained yolov4 model in darknet

Solution 1:

You can't insert new classes in a trained model. When you trained using only the fire and smoke dataset, your config were not configured for 2 classes, but for 5 instead. Probably it's why you didn't get anything in your second test.

The model does not forget, but uses that weight as a head start for your new model. Just train again with a dataset containing all categories labelled.


Solution 2:

From the procedure that YOLO follows in training, any further training will enhance and modify the currently layers, so if you added new classes and retrained, you will enhance the exiting one and create new classes from scratch, which means not all classes will be the same during detection. I think the safest way is to train all from scratch.


Thank you for reading the article.