I am working into object detection with YOLOv5 for a project and I had love some pointers! I have got some machine learning and Python experience but YOLOv5 is new territory for me.
Here is what I have done:
I gathered and labelled my dataset with LabelImg.
I also set up the environment following the official YOLOv5 guide on GitHub.
I started training with the default settings
But I am running into a few snags:
My model’s accuracy seems stuck after a bunch of training runs. What are some good ways to adjust the training settings to improve performance?
My dataset has some uncommon objects. How can I make sure the model pays attention to them during training?
Any recommendations for beefing up my dataset with data augmentation?
So there is a lot to try to unpack here, but let me share a few thoughts.
If you don’t have a specific need to use YOLOv5, I would recommend starting with the Ultralytics package, as it has a pip installable package and well documented Python API
Generally to provide more actionable advice, it’s helpful to know how many classes are in your dataset, how many images total you have, how many instances of each class, and what command you used for training the model.
Augmentations occur during training automatically and you can enable/disable certain ones using the various hyperparameters. Reliance on synthetic data will only get you so far and I would not rely on it as a way to improve performance with a small dataset, it’ll be more helpful in making your model robust to reasonable changes/conditions in your existing dataset.
Without much more information, the easiest advice to point to and the most likely issue, is regarding your dataset. The model performance will be primarily based on the quality and quantity of your dataset. More images, with a large amount of variety, and thousands of instances per class, is the best way to ensure your model can perform well. Additionally, making sure your annotations are consistent (never confusing class labels) and well defined (enclose the object class at its boundary) will avoid any issues with your model training performance.
From my experience, it’s common to see poorly performing models when the dataset is too small, not annotated consistently, or does not include enough variation in class instances. It’s a pain, but you will have to annotate more data to train a robust model. Ultralytics has tools like YOLO-World, SAM, FastSAM, and others that can help speed up your annotation process, so make sure to check those out if it’s terribly time consuming to annotate data (trust me, I’ve been there).