Dataset Preparation - RecycleAI/RecycleIT-A GitHub Wiki

Tips for initial dataset

Most of the time good results can be obtained with no changes to the models or training settings, provided your dataset is sufficiently large and well labelled. To prepare dataset, there are some major steps that should be taken

  1. Images per class. ≥1.5k images per class

  2. Instances per class. ≥10k instances (labeled objects) per class total

  3. Image variety. Must be representative of deployed environment. For real-world use cases we recommend images from different times of day, different seasons, different weather, different lighting, different angles, different sources (scraped online, collected locally, different cameras) etc.

  4. Label consistency. All instances of all classes in all images must be labelled. Partial labeling will not work.

  5. Label accuracy. Labels must closely enclose each object. No space should exist between an object and it's bounding box. No objects should be missing a label.

  6. Background images. Background images are images with no objects that are added to a dataset to reduce False Positives (FP). It is recommend that about 0-10% background images should be added to help reduce FPs (In this project we use 1% background images).


photo from our dataset

Augmentation

Here we utilize two main packages for augmenting our dataset:

  1. Torchvision
  2. Albumentation

YOLOv5 is fully integrated with Albumentations, a popular open-source image augmentation package. Albumentations transforms will be automatically apply during YOLOv5 training if albumentations>=1.0.3 is installed in your environment.

Example train_batch0.jpg on our dataset:

train_batch0

Note these Albumentations operations run in addition to the YOLOv5 hyperparameter augmentations, i.e. defined in hyp.scratch.yaml.

Background Images

As we talked above, some images which are lacked related object have been given to reduce Recall.

2 3