Generate and Recognize Graphical Patterns
I think deep learning comes very handy to solve such problems in these days. Simply create a convolutional neural network (CNN) architecture. Your input are the images, which are resized to one common dimension. The output is the class (type) of the image. For a CNN, this problem is rather simple and if you don't have a lot of training examples, a simple architecture such as LeNet would suffice. Of course, if you have a lot of classes, maybe a larger network (such as AlexNet) might be more appropriate. In either case, you could benefit from a large set of libraries, which are mostly coded in Python. To name a few: Tiny-DNN, Caffe, Tensorflow and Torch.