This project focuses on classifying images into two categories: spiral and wave. The project uses several machine learning models for this task, including Random Forest, Support Vector Machine (SVM), Naive Bayes, and K-Nearest Neighbors (KNN). It employs Histogram of Oriented Gradients (HOG) for feature extraction from the images. Additionally, an ensemble Voting Classifier is used to improve classification accuracy by combining the strengths of individual models.
- Image Loading & Display: Visualizes the training and testing images.
- Feature Extraction: HOG features are extracted from images resized to 128x128 pixels.
- Model Training:
- Random Forest
- Support Vector Machine (SVM)
- Naive Bayes
- K-Nearest Neighbors (KNN)
- Random Forest
- Hyperparameter Tuning: Performed for SVM and Naive Bayes classifiers.
- Model Evaluation: Accuracy metrics are used to evaluate the performance of each model.
- Voting Classifier: An ensemble model that combines all classifiers for improved performance.
- Dataset
The dataset includes images categorized into two classes:
- spiral
- wave
Each class has separate directories for training and testing data.
- Best Alpha for Naive Bayes: 0.1
- Spiral Naive Bayes Accuracy: 76.67%
- Wave Naive Bayes Accuracy: 70%
- Spiral Random Forest Accuracy: 76.67%
- Wave Random Forest Accuracy: 70%
- KNN Accuracy: 83.33%
- SVM Accuracy: 73.33%
- Voting Classifier Accuracy: 80%