# Type of images used to train a neural network

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

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 image

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.

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.

• This is for gathering a particular set of images, not how the images have to look like in order to be trained. – Santhosh Feb 2 '18 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

IMAGE

XML

<annotation>
<folder>VOC2007</folder>
<filename>000001.jpg</filename>
<source>
<database>The VOC2007 Database</database>
<annotation>PASCAL VOC2007</annotation>
<image>flickr</image>
<flickrid>341012865</flickrid>
</source>
<owner>
<flickrid>Fried Camels</flickrid>
<name>Jinky the Fruit Bat</name>
</owner>
<size>
<width>353</width>
<height>500</height>
<depth>3</depth>
</size>
<segmented>0</segmented>
<object>
<name>dog</name>
<pose>Left</pose>
<truncated>1</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>48</xmin>
<ymin>240</ymin>
<xmax>195</xmax>
<ymax>371</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Left</pose>
<truncated>1</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>8</xmin>
<ymin>12</ymin>
<xmax>352</xmax>
<ymax>498</ymax>
</bndbox>
</object>


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