0
$\begingroup$

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?

$\endgroup$
2
  • $\begingroup$ There is nothing wrong with approach you have followed for converation but due nature complex data i.e. image algorithm like logistics is not performing very well. To get much better performs try using ensemble methods of machine learning. To see a real performs boost try using CNN & why you are not trying CNN? $\endgroup$ Jun 14, 2020 at 9:56
  • $\begingroup$ Hi, I wanted to try a new way of doing it instead of neural networks, but I guess that is a bad idea, so I will use neural networks, thanks $\endgroup$
    – Dhruv Kapu
    Jun 14, 2020 at 12:19

2 Answers 2

0
$\begingroup$

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

$\endgroup$
1
  • $\begingroup$ Thanks for the answer. I guess I underestimated the problem at hand, but now I think I will carry on and use a covolutional neural network. Thanks for the resources! $\endgroup$
    – Dhruv Kapu
    Jun 14, 2020 at 12:21
0
$\begingroup$

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.

$\endgroup$

Your Answer

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

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