YOLO v3 training along with validation dataset

3 views (last 30 days)
I have been training Yolo v3 object detction model with just training dataset, but i would also like to add validation dataset during training. In the example Object Detection Using YOLO v3 Deep Learning validation set is considered during training. Whereas in Object Detection Using YOLO v2 Deep Learning validation set is used by giving it as an input to trainYOLOv2ObjectDetector through training options.
Is there any similar function for YOLO v3 for training to use validation dataset?
Thank you

Answers (1)

Varun Sai Alaparthi
Varun Sai Alaparthi on 21 Nov 2022
Hello Akshatha,
I understand that you are asking for giving validation data for model to train through training options.
But the functionality for the training options ‘validation dataset’ field is to give validation accuracy during training, it will not train the model on that.
However, you can add this to the train data store and initiate the training for the model to use it for training. You can combine datastores using this code
dsseq = combine(ds1,ds2,ReadOrder="sequential");
Please refer to this link for more information:
You can directly input the combined datastore to ‘trainNetwork’ API.
I hope this information helps and please reach out for any further issues.
Sincerely
Varun
  2 Comments
Akshatha Doddabyaladakere Nagaraju
thank you for the response.
I need to calculate the validation loss along with training. For YOLO v3 there is no function to train the model like there is for YOLO v2( trainYOLOv2ObjectDetector), also for YOLOv4 (trainYOLOv4ObjectDetector).
In order to calculate and plot the validation loss, I will have to convert the validation dataset into dlarray format and use 'forward' function to do the calculations.
How to convert multiple images into "dlarray" format at once?
Vivek Akkala
Vivek Akkala on 24 Nov 2022
You can use transform datastore to convert all the images to dlarray at once. 'forward' function of the yolov3ObjectDetector can be used to compute the validation loss during traning.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!