I am a newbie in neural network.

Saw this article Object detection with deep learning and OpenCV. These three type of neural network are shortlisted in the article

  1. Faster R-CNNs
  2. You Only Look Once (YOLO)
  3. Single Shot Detectors (SSDs)

Found a lot of online resources that help in understanding how the neural network actual works.

As building a neural network from scratch is time consuming and not entirely foolproof to get the desired efficiency.

I came across these articles Transfer learning & The art of using Pre-trained Models in Deep Learning,Transfer Learning and Transfer Learning, where we transfer the learning from an existing pre trained network to train the object which we would desire the network to detect.

All of these pre trained network have been trained on a data from either COCO or ImageNet or PASCAL VOC which contain different categories images.

Example case:

I want to train one of these to count the number of bananas here in this imageenter image description here

How should my training set of banana images be?

I need a fixed resolution of the image I feed into the network, so can I even feed a half banana like this for the training? I don't have to remove the background for training. Please correct me if I'm wrong.

enter image description here


2 Answers 2


You should read this post from the same author. It is about how to build a learning dataset with Google's search, some javascript and some python.

The idea there is to collect as many pictures of the object as possible (object = banana) and then let the deep learning network to compare and learn to differentiate them from bulk random images from some free database.

I suppose background or partial image variations are all ok. You cannot know which part of the object is visible when the whole bunch is evaluated.

Data needs to be fit to same size, at least Adobe has some tool for that.

  • $\begingroup$ This is for gathering a particular set of images, not how the images have to look like in order to be trained. $\endgroup$
    – Santhosh
    Feb 2, 2018 at 4:44

Hope this helps

After doing a bit of research into how The PASCAL Visual Object Classes Challenge 2007 image data are stored. This is what I could find.

They follow an annotation of each image which creates an xml file of that particular image which contains these details PASCAL Visual Object Classes Challenge 2007 (VOC2007) Annotation Guidelines

Here is an example of xml file from VOC2007 of one of these images


enter image description here


    <database>The VOC2007 Database</database>
    <annotation>PASCAL VOC2007</annotation>
    <flickrid>Fried Camels</flickrid>
    <name>Jinky the Fruit Bat</name>

Here's a link for annotation tool labelImg that can help you generate the similar xml file for an image in your own dataset

For more details on how the image data are divided into train,trainval,test and val check this The PASCAL Visual Object Classes Challenge 2007 (VOC2007) Development Kit


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.