Use the K Means algorithm, one of the machine learning techniques, to classify whether the image has low saturation or not.
Set the value of k to 3 to extract the three colors representing the whole image. Then, compare the RGB values of the three colors. If the RGB values are similar, they are classified as a grayscale image.
Gray Factor is the basis of comparison. Add the absolute values of R-G, R-B and G-B in all three colors representing the image. There are 3 values per color and 9 values are output. When all these values are added, if it is over 125, it is classified as a color image. If it is lower than 125, it is classified as a grayscale.
grayfactor is 470.433684348195
this image is color image
grayfactor is 220.00078428233624
this image is color image
grayfactor is 361.9403200650253
this image is color image
grayfactor is 394.7566669657726
this image is color image
grayfactor is 657.9671760918529
this image is color image
grayfactor is 206.07376379585685
this image is color image
grayfactor is 175.778811114855
this image is color image
grayfactor is 219.33294774865516
this image is color image
grayfactor is 120.08708814516638
this image is grayscale image
grayfactor is 166.23216016614876
this image is color image
grayfactor is 74.21911310513414
this image is grayscale image
grayfactor is 16.921373829598963
this image is grayscale image
grayfactor is 74.8569993561774
this image is grayscale image
grayfactor is 21.336244560550085
this image is grayscale image
grayfactor is 39.46925756428328
this image is grayscale image
grayfactor is 83.9590711276494
this image is grayscale image
grayfactor is 50.64524879463909
this image is grayscale image
grayfactor is 29.222783415229628
this image is grayscale image
grayfactor is 44.29888605893774
this image is grayscale image
grayfactor is 30.120887800532955
this image is grayscale image
The test resulted in 19 images classification is correct out of a total of 20 images. An accuracy of 95% indicates that this classifier works correctly.