Possible use of machine learning for blob comparison

I currently work on a project in which I want to check images of blobs and tell if blob is OK, or NOK.


  • ~200 8bit grayscale images with same size, unlabelled
  • Each picture contains one black blob shape on white background.

Features that I currently have:

  • contour shape
  • contour volume


Classify if blob picture is OK, or NOK. Dataset is unlabelled, but I am able to manually label total OK and total NOK. But most of the blobs are somewhere close between NOK/OK. Labeling this ones will bring subjective error.

Also I want to be able to change threshold value for OK/NOK classification.

Possible solution:

  • Anomaly detection:

I did an Andrew Ng ML course on coursera. And I tried to implement anomaly detection with multivariate gaussian distribution. With change of epsilon threshold I was able to change number of classified OK/NOK blobs.

  • Use convolutional NN (didn't try yet):

Train it on total OK/NOK blobs and implement possible threshold changer in classification layer. Is there any way how I can reuse trained NN, and only change classification layer? Do you know about any trained model, that can be used for this? Can you pinpoint some good material on this topic?

  • Other possible approach?

What is other possible approach without convolutional NNs. I think I can get more features from data.


1 Answer 1


I would suggest to use CNN's.


  1. No need manual feature extraction
  2. Faster experimentation with different networks


  1. Manual labelling of dataset

In Keras framework, there are many pre-trained CNN's available for use:




You can use any of the above mentioned networks and fine tune for your dataset. There are many blogs that explains how to use pre-trained networks to do transfer learning & fine tuning.

Ex: https://www.learnopencv.com/keras-tutorial-transfer-learning-using-pre-trained-models/


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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