AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

How to prepare different image sizes for classification?

The forum is to discuss topics from different artificial intelligence areas, like neural networks, genetic algorithms, machine learning, etc.

How to prepare different image sizes for classification?

Postby rmk60 » Fri Mar 10, 2017 8:19 pm

Hello,
I am using Activation Network with Backpropagation Learning.
I want to classify object images in the sky like airplanes, birds, clouds (all gray scaled of different size received from motion tracking).
Finally I need only 2 classes, e.g. it is a bird or it isn't.
The network input is of fixed size 32x32[pixel]=1024.
The object images are resized either by width or by height depending on which is larger to fit into the final image size of 32x32.

- For a first approach I set all missing pixel to "0" (black) resulting in black bars on top, bottom or left, right side.
Example: Image with "0"s on left and right side
Image

I tried several network designs and decided for 1024 inputs, 49 neurons in layer 1, 24 neurons in layer 2, 2 output neurons.
Unfortunately I have only 230 learn data and around 200 test data. The result is 88% accuracy.
However I'm not sure that this approach will really work because it seems that the black bars have a strong influence on the weights?!

- Now the second approach was to fill the missing pixel with the mean gray pixel value of the original image.
However the learning algorithm does not find a global minimum.

Can anyone give some advise how to preprocess the images?
My idea was to use canny edge filtering getting a black background for all images or histogram equalization ?!?!?

Note: The approach should also work in darkness meaning dark background at night and light background at day.
rmk60
 
Posts: 6
Joined: Sat Apr 02, 2016 3:02 pm



Return to Artificial Intelligence