0

I have an array which stores the information of a 20x20 black and white image.

int array[][] = new int[20][20];

If the pixel is black at a specific point, for example (0,5) I insert the value one into my array.

array[0][5] = 1;

I am trying to create a dataset so I can feed it into a neural network. I was wondering if there is a way to reduce the size of input values (20x20 = 400) by compressing the information.

student
  • 21
  • 2
  • If the probability of a pixel being black isn't 50%, it can be compressed (that is, more than the obvious way - using less than 1 bpp). But then you can't feed it into your neural network anymore. – harold Nov 20 '16 at 15:08
  • You could simply pack the bits into 50 bytes, instead of the current 1600 or 3200 bytes (depending on the size of an `int`). However you would then be giving the neural network the additional job of extracting the pixels from integers. Are you sure that's what you want to do? – Mark Adler Nov 20 '16 at 18:28

0 Answers0