TransWikia.com

What to input into machine learning algorithm for image recogniton?

Data Science Asked by Dhruv Kapu on September 4, 2021

I am working on a project that involves classifying images as either that of a cat or that of a dog, without using CNNs. I used SKImage to convert the images to a matrices and changed it to grayscale to reduce dimensions and complexity. I then flattened the matrices to vectors and input them into an SVC, Logistic Regression and Stochastic GD Classifier, but all of them were very innacurate and had less than 60% accuracy. This leads me to believe that I converted the images to the wrong format, which is why the ML algos are unable to fit the data. So what should I convert them to? Should I use feature extraction?

2 Answers

You requested for a solution without CNNs.

However, nearly all machine learning algorithms like KNN,SVM, Random Forest work well only if the data has some underlying structure allowing to cluster it (e.g. invariances to different lightings,..).

If you work directly on the image pixel values, this will fail with classic machine learning algorithms. You need to use some image descriptor, e.g. HOG,FAST,...

Note that a CNN can be understood as transforming the image into a more meaningful representation and then performing SVM clustering on that representation.

Answered by Graph4Me Consultant on September 4, 2021

Usually, neural networks are used to do image classification. The reason is that image data is very complex (highly non-linear) if you want to say so.

Have a look at Keras/Tensorflow. You can even use pre-trained models to quickly achieve good results on most problems. Find an example for Python here: https://github.com/Bixi81/Python-ml/blob/master/keras_pretrained_imagerec_binaryclass.py

There is a very instructive book „Deep learning with Python“, which can give you a quick start. Find the book here: https://github.com/fchollet/deep-learning-with-python-notebooks

Answered by Peter on September 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP