Cat vs Dog Classifier using SVM | Prodigy Internship Task 3
Internship: Machine Learning Virtual Internship by Prodigy Infotech
Task: PRODIGY_ML_03
This project implements a binary image classifier that distinguishes between cats and dogs using the Support Vector Machine (SVM) algorithm.
It is the third task of the internship and provided valuable hands-on experience in machine learning workflows and SVM model tuning.
- Labeled every image in the
trainfolder based on file name prefixes. - Converted images to grayscale for uniform color structure.
- Extracted HOG (Histogram of Oriented Gradients) features for robust representation.
- Split data into 80% training and 20% testing, with shuffling.
- Created a smaller subset of the data to run GridSearchCV for hyperparameter tuning.
- Trained the final model using the best parameters from GridSearchCV.
- Achieved an accuracy of ~78% on the test set.
- Displayed and predicted test images directly in the Jupyter Notebook.
- Saved the trained model using
picklefor later use.
Used Tkinter to build a graphical user interface allowing users to:
- Upload an image
- Predict whether the image is of a cat or a dog
This project helped me understand key machine learning concepts such as:
- Feature extraction (HOG)
- Train-test split
- Model selection and evaluation
- Hyperparameter tuning using GridSearchCV
- Model deployment via GUI
If you have come this far, checkout my other projects also, if you want you can connect me.
Author: Mithun