Training the images

In this section, we will collect the images and keep them organized under their respective folder categories.

A few common steps for choosing your own dataset of images are as follows:

  1. First of all, you need at least 100 photos of each image category that you want to recognize. The accuracy of your model is directly proportional to the number of images in the set.
  2. You need to make sure that you have more relevant images in the image set. For example, if you have taken an image set with a single color background let's say all the objects in the images have a white background and are shot indoors and users are trying to recognize objects with distracting backgrounds (for example, colorful backgrounds shot outdoors), this won't result in better accuracy.
  3. Choose images with a variety of backgrounds. For example, if you are picking images with only two background colors, then your prediction will have a preference toward those two colors, rather than the object in the image.
  4. Try to split bigger categories into smaller divisions. For example, instead of animal, you might use cat, dog, or tiger.
  5. Make sure that you select all the input images that contain the objects that you are trying to recognize. For example, if you have a dog-recognizing app, we wouldn't use cars, buildings, or mountains as input images. In that case, it is better to have a separate classifier for the unrecognizable images.
  6. Ensure that you label images properly. For example, labeling a flower as jasmine might have the whole plant in the picture or a person behind it. The accuracy of our algorithm will differ when there are distracting objects in the input images. Let's say you have taken a few food item images from Google Images. These images have reusable permissions, so always ensure that you have this when collecting images for your model. You can do this by searching any keyword from Google Images and filter the images based on labelled for reuse usage rights. You can find this option by clicking on tools beneath the search bar.

We have collected a few images from the internet for educational purposes in this chapter. This is discussed in further detail in the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset