# Deep Learning for high contrast images with small differences

I am trying to make a deep learning classification on the gear part you can see in the images. The contrast is high and almost binary. I want to classify the images where the circle located closest to the centre circle is left of the circle located furthest from the centre circle as the good part.

When this is mirrored (the circle located closest to the centre circle is right of the circle located furthest from the centre circle) the part needs to be classified as bad.

The parts can be rotated over a range of 360 degrees. The parts are found beforehand and cropped with the centre of the part as the centre of the image, which makes translation not a problem. The parts do not vary in scale.

I am using Keras with TensorFlow as Backend. I have 3600 input images, with 1800 good and 1800 bad images, where the parts are rotated. I have build some simple CNNs with three convolutional layers up to the VGG16 model, without getting past 0.5 accuracy.

My knowledge on different kind of models is limited and therefore I don't know which arcitecture would suit my problem best. Can anyone help me with some guidance on the kind of model I could use or to tell me if this is at all possible like this?

• could you clarify "I want to classify the images where the circle located closest to the centre circle is left of the circle located furthest from the centre circle as the good part." – Pedro Henrique Monforte Apr 15 '19 at 23:09
• Ok I'll try. the upper image is good and the lower image is labeled bad. The difference between the two pictures is that the lower one is the mirrored version of the upper one. The parts can be rotated around the centre circle. The three circles in the part can be viewed as a small arrow pointing either in anticlockwise direction for the good part and clockwise for the bad part. I hope this helps? – Jeffrey Minnaard Apr 16 '19 at 7:35

I have solved my problem! I found a relevant article which describes an architecture suitable for my problem. I have changed it a bit however. The article: https://www.researchgate.net/publication/312328148_Binary_shape_classification_using_Convolutional_Neural_Networks.

The model in keras:

modelBS = Sequential()