Skip to content

Good practices for collecting images

The image classification success highly depends on the quality of the training data set. Please consider the following points when preparing a training dataset:

  • Ideally, the training images should be collected under the same circumstances as you plan to collect the images for automated classification in your application. That involves:
    • Same camera type.
    • Same camera position.
    • Same image preprocessing (e.g. cropping).
    • Same light conditions.
    • If any of these conditions varies over time, it is important to make sure that this variation is also covered within the training dataset.
  • Make sure the object of interest is in focus.
  • The more images you provide per class, the better your training result will be. Providing more images will not only increase the quality of the training itself, but will also lead to a more accurate evaluation of the trained model.
  • Details that are considered relevant for the classification to one class should occur on more than one picture.
  • It is recommended to provide a similar amount of training images for all labels.
  • Make sure that all training data is labeled correctly.
  • Please consider that the training result can be influenced by details that are not supposed to matter. If e.g. different backgrounds are used for the images belonging to different classes, the classification might rely on this non-relevant detail instead of the detail that matters. The less irrelevant background information is available on an image, the better the classification will work.
  • If the relevant content of an image only covers a small part of the image, it is recommended to crop the image and train only with the relevant detail. Of course, the same image preparation will be required for the inference.
  • Identical images that have been copied to augment the number of images for a class will not help. Copies of images will be recognized dy dStudio and discarded.
  • The training images should represent a realistic sample of the images which will be classified later on. This includes effects like e.g.
    • Different light conditions at different times of a day.
    • Variation of a natural product.
  • At least two classes have to be defined for a classification.

How many images are needed?

In general there are a few rules one can use to figure this out.

  1. The gained accuracy/quality when increasing the amount of images follows a logarithmic trend. Going from 10 to 100 has a larger effect than going from 100 to 200.

  2. A larger network usually needs more examples to find the best solution.

  3. The more variance you have in your data, the more images are likely needed.

  4. It is recommended to gather at least 50-100 images for a pilot study. If you want to be more certain about your prediction performance, more data is required. Please have a look at the 'How confident can you be about your evaluation?' on the Evaluation page for more information.