0
$\begingroup$

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.

Example of good image

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.

Example of bad image

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?

If more information is needed please let me know.

$\endgroup$
2
  • $\begingroup$ 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." $\endgroup$ – Pedro Henrique Monforte Apr 15 '19 at 23:09
  • $\begingroup$ 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? $\endgroup$ – Jeffrey Minnaard Apr 16 '19 at 7:35
1
$\begingroup$

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()

modelBS.add(Conv2D(150, (3, 3), input_shape=(ImgSize,ImgSize,1), activation='relu', padding='same'))
modelBS.add(MaxPooling2D(pool_size=(5, 5), strides=(5, 5)))

modelBS.add(Conv2D(150, (5, 5), activation='relu', padding='valid'))
modelBS.add(Conv2D(150, (2, 2), activation='relu', padding='valid'))

modelBS.add(Flatten())
modelBS.add(Dense(rp, activation='softmax'))
$\endgroup$
0
$\begingroup$

Maybe not exactly what you need for a binary image, but the paper here show how to use different convolutional paths for the low and a high spatial frequency part of images.

Or, in more prosaic terms, 'borders' of the objects in an image and 'everything else'.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.