Training YOLO object detector

4 views (last 30 days)
Stephen Gascoigne
Stephen Gascoigne on 20 Jul 2022
Answered: Piyush Dubey on 8 Sep 2023
Hi,
I'm currently working on a project where I'm attempting to train a YOLO object detector to identify waste objects but I don't have much experience in this area. The categories I'm using are carboard, glass, metal, paper and plastic and the training set I'm using includes about 1900 images. I've attempted to augment these images by using the transform function which radomly crops, flips and rotates the images and bounding boxes. I then train the neural network using the following training options:
options = trainingOptions("rmsprop",...
InitialLearnRate=0.008,...
MiniBatchSize=5,...
MaxEpochs=40,...
BatchNormalizationStatistics="moving",...
ResetInputNormalization=false,...
VerboseFrequency=5,...
LearnRateSchedule="piecewise",...
LearnRateDropPeriod=10,...
SquaredGradientDecayFactor=0.95,...
ValidationData=ValidationData,...
ValidationFrequency=350);
Once the detector is finished training, the performance of it is far worse than what it was when I used the original data without augmenting it. I have the following questions:
  • Do you think there's anything wrong with my training options?
  • What do you think I'm doing wrong with my data augmentation?
  • Have you got any other suggestions on how the performance of the detector could be improved?
I've also atatched the mfile which I'm using to train the detector if you want to have a look at that as well.
Cheers,
Stephen

Answers (1)

Piyush Dubey
Piyush Dubey on 8 Sep 2023
Hi Stephen,
In my understanding you have a custom dataset and with the help of which you are trying to train a YOLO (You Only Look Once) Object detector to identify waste objects. Your dataset comprises of 1900 images and to enhance the training outcome you applied augmentation but that did not seem to improve the model’s performance significantly
Please know that with a limited dataset it is highly likely that the model will be overfit to the data if more epochs are run to train the model, applying augmentation to a dataset which is comprising of identical pictures would cause more confusion on augmentation. The aim should be to increase the dataset size by including more and different images of the objects. Since the classification is also being done for more than 2 classes an ample number of images in the dataset for each one of them would be a necessity before applying augmentation.
You can refer to the following documentation link to know more about the best practices to be followed for data augmentation:
Please refer to the following documentation to learn more about hyperparameter evolution:
Hope this helps!

Categories

Find more on Image Data Workflows in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!