Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV Clasification Neural Network + Image Flattening Question

There's no simple way to explain his so I will get to the point.

For a neural network, would it be better for me to flatten down a color image to between 0 and 1 like this: 0.RRRGGGBBBAAA whereas the pixel, say 0, would be .255000000255 meaning there is a red pixel at position 0, or just do HSV, thresh it, then greyscale to a grey color between 0 and 1?

Some background. I build what are called PxlDbl's or Pixel Double spelled out, and its exactly how it sounds... Its a pixels' color in a single double between 0 and well .255255255255 would be the max. Why a double? A float didn't have the precision I needed to achieve this. I currently have a custom neural network with many activation functions to be used in each topological layer. The one I am using for images is the well-known sigmoid which takes a number between 0 and 1. My end goal and the question are to place a flattened image of some kind into this Network. My question really relates to the best way to flatten it. Should I take my image size and multiply it by 4 to then have a neuron for each color channel for each pixel? I could take the value between 0 and 255 and map it between 0 and 1 which would give me effectively what I am looking for but say a 600x400 image x4 channels results in something like 960,000 neurons in the first layer which even in my case alone is truly unattainable to get to function no matter how well I programmed the Network... With a theoretical PxlDbl it shrinks the neuron could down to just the image size of 600x400 being only 240,000 neurons which is much more manageable in terms of weights and such. My only concern is with the inputs being so precise my outputs since their classifications might be much more difficult to train, ie after like .255^128076255 it might just drop off the 128076255 in the training because it just can't do that precise of numbers.

Help on this would be greatly appreciated...