1
votes

I am classifying images where the color doesn't play any role. So, I grayscaled my images and got just grayscale images. But they are represented by 3 channels. I know, that I can use the following formula:

gray_value = R * 0.299 + G * 0.587 + B * 0.114

to convert RGB image to grayscale image and get grayscale image with just one channel.

My question is, is there a difference between using grayscale images represented by 3 channels or by 1 channel in CNN (not in code or filters but in results)? Do the results vary depending on the number of channels, even when the images are the same in both cases?

1
I am guessing you mean your greyscale images comprise 3 channels whereby R=G=B? I am no expert in CNN, but in general things tend to take 3 times longer if you have 3 channels, rather than 1. There may be other consequences too, hopefully someone cleverer than me will answer :-) - Mark Setchell
In terms of accuracy the results must converge to the same. - Dmytro Prylipko
@DmytroPrylipko Not really. The model with three channel inputs have more parameters. - hkchengrex
That was my question. Is the accuracy the same? perhaps because of parameters it would be another. - user3625605
I meant that it must converge to the same accuracy. At some point you stop getting improvements by increasing number of weights if your model is large enough. Since three gray channels convey the same amount of information as one, there should come no difference due to the data only. - Dmytro Prylipko

1 Answers

3
votes

The information given by the 3 channel and the 1 channel gray scale is the same but in terms of weights and biases of the CNN, the CNN coming from 3 channel images will be bigger and so it will take more time to compute. I would recommend to preproces the images to a 1 channel gray scale and only then use images as input for the CNN.