Skip to content

Classifier for CIFAR-10. Grayscaling, HOG, PCA, and RBF SVM. 62% test accuracy. Walkthrough on YouTube: https://youtu.be/gmTweV0eHhk

License

Notifications You must be signed in to change notification settings

LemuelKL/CIFAR10-HOG-PCA-SVM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

CIFAR10-HOG-SVM

Classifier for CIFAR-10. Grayscaling, HOG, PCA, and RBF SVM. 62% test accuracy. This classifier does NOT use any neural network or convolutional filters/layers/kernels.

Running the Code

Google Colab

Add the following code as the first cell:

!pip install scikit-learn-intelex

Then, run the rest of the cells.

Local

Install the following packages:

pip install scikit-learn sklearn-intelex scikit-image numpy matplotlib opencv-python tqdm joblib

Then, run the code.

Dimensionality Reduction

  1. Input 32x32x3 => 3072
  2. Grayscale 32x32x1 => 1024
  3. HOG pixels_per_cell=(8, 8), cells_per_block=(2, 2) => 324
  4. PCA 80% explained variance => 66

Configuration and Hyperparameters

  • Input -> Grayscaling -> HOG -> PCA -> Stardardization + normalization -> SVM
  • Support Vector Machine (SVM) with the radial basis function (KBF) kernel
  • C = 10
  • Scikit-learn modules are used

Time Complexity

  • This training time of this non-linear SVM grows faster than linear time against the number of samples
  • Training takes 3 minutes on Google Colab Free
  • Scoring against the test dataset takes 1 minuite

Accuracy

  • 62% against the test dataset
  • Confusion matrix also available download
    • Good separation between animals and machineries
    • Rather confused between different types of animals (cats vs deer), and different types of machineries (airplanes vs ships)
    • Confused between cats and dogs

About

Classifier for CIFAR-10. Grayscaling, HOG, PCA, and RBF SVM. 62% test accuracy. Walkthrough on YouTube: https://youtu.be/gmTweV0eHhk

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published