Performance Comparison of SVM Kernels on Fashion MNIST Dataset
Experiment
Performance Comparison of SVM Kernels on Fashion MNIST Dataset
π― Objective
To implement and compare SVM classifiers with Linear, Polynomial, and RBF kernels on the Fashion MNIST dataset and analyze their performance.
π Theory
Support Vector Machines (SVM) use different kernel functions to handle different types of data:
- Linear Kernel → Straight-line separation
- Polynomial Kernel → Curved boundaries (controlled by degree)
- RBF Kernel → Highly flexible, non-linear boundaries
π Dataset
We use the Fashion MNIST dataset.
- 70,000 grayscale images (28×28 pixels)
- 10 classes (T-shirt, shoe, bag, etc.)
π¬ Algorithm / Procedure
- Load dataset
- Normalize pixel values
- Flatten images into vectors
- Split into training and testing sets
-
Train SVM with:
- Linear kernel
- Polynomial kernel
- RBF kernel
- Evaluate accuracy
- Compare results
π» Program
π Output
Linear SVM Accuracy: 0.823
Polynomial SVM Accuracy: 0.814
RBF SVM Accuracy: 0.859
π Comparison Analysis
πΉ 1. Linear Kernel
✅ Advantages:
- Fast training
- Works well for high-dimensional data
- Less risk of overfitting
❌ Disadvantages:
- Cannot capture complex patterns
- Lower accuracy for image data
πΉ 2. Polynomial Kernel
✅ Advantages:
- Can model curved boundaries
- More flexible than linear
❌ Disadvantages:
- Sensitive to degree parameter
- Can overfit
- Slower than linear
πΉ 3. RBF Kernel
✅ Advantages:
- Handles complex non-linear data
- High accuracy
- Most widely used
❌ Disadvantages:
- Computationally expensive
- Requires tuning (C, gamma)
- Can overfit if gamma is high
Key Insights
- Image data like Fashion MNIST is highly non-linear
- Linear SVM struggles to capture patterns
- RBF kernel performs best due to flexibility
Result
The SVM classifiers with different kernels were successfully implemented and evaluated.
- The RBF kernel achieved the highest accuracy, demonstrating its ability to model complex patterns in image data.
- The Linear kernel performed faster but with lower accuracy.
- The Polynomial kernel showed moderate performance, depending on the degree parameter.
Comments
Post a Comment