# ML techniques to classify simple polygons

I'm curious about suitability of Machine Learning techniques to classify grayscale images of polygons into categories defined by number of their sides, which will be kept small. Images will be "perfect" representations produced by an OpenGL rasterizer. Orientation, shape and scale of polygons will vary. Training data can be huge as it will be generated algorithmically on demand. In extreme case it can cover the whole domain, but the data size would get impractically large. Here is an image example, which belongs to category 4 (polygon with 4 sides):

My goal is to compare performance of the most appropriate ML techniques with "old fashion" Computer Vision ones. In this simple case, just counting the lines produced by Hough transform or something a bit more sophisticated, can easily achieve zero error rate. AFAIK, neural networks will struggle even on these simple images. Black on white images are only the beginning: grayscale, color, line drawing, textures, etc. will follow, if NN can handle the easier cases, but my biased opinion is that they can't. The acceptable performance is under 0.1% error rate.

• Is counting the number of sides of a polygon a general goal that must be met at all costs, or is this an exercise in figuring out how to do difficult things using neural networks only? – Ingolifs Jun 13 '18 at 7:41
• Furthermore, do you have other examples of the sorts of polygons you will be generating? Do they always come in black and white or are other shades of grey for the interiors allowed? Will there be patterns/background noise? Are concavities allowed? Are curved edges allowed? I am no expert in machine seeing, but I suspect a purely perceptron approach would struggle greatly with this sort of problem, while some clever non-NN methods may solve it outright without need for NNs. – Ingolifs Jun 13 '18 at 7:55
• Are you interested in combining existing image processing tools (edge detection, etc) to create data pre-processing for ML or are you wanting to look at approaches using exclusively ML? In biological vision the eye and optic nerve is hardwired to do a lot of image processing (contrast enhancement, edge detection etc) and what the brain then manipulates is this processed data, rather than raw images. – ReneBt Jun 13 '18 at 8:34
• @Ingolifs This is an exercise in showing limitations of neural networks vs. "old fashioned" computer vision. Yes, the images will get more difficult, when NN can handle the simple ones with near zero error rate. – Paul Jurczak Jun 13 '18 at 8:59
• @ReneBt I elaborated a bit more what I'm trying to accomplish. In biological vision the eye and optic nerve is hardwired to do a lot of image processing that's what the NN (networks of artificial neurons) are advertised to imitate best, right? – Paul Jurczak Jun 13 '18 at 9:26