All Case Studies
Computer Vision
Bag of Visual Words for Image Classification
Classifying cats, chairs and cameras with SIFT, KMeans, KNN & SVM.
202595% Best class accuracy (SVM)
OVERVIEW
The Project
A Bag of Visual Words (BoVW) pipeline for image classification using handcrafted SIFT descriptors, KMeans clustering, and KNN/SVM classifiers, classifying images of three object categories: cats, chairs, and cameras.
Objectives
Tools & Technologies
PythonOpenCVSIFTKMeansKNN & SVMMatplotlib
FIGURES
Charts & Graphs


METHODOLOGY
The Approach
1
Load images and convert to grayscale; extract SIFT keypoints and descriptors into a feature pool.
2
Cluster all descriptors with KMeans (k = 200) — each centre becomes a visual word.
3
Encode each image as a histogram of visual words.
4
Train KNN (k = 5) and a linear SVM on the histograms, then predict on unseen images.
OUTCOME
Results & Learnings
Key Learnings
- BoVW works effectively with SIFT and simple classifiers.
- Clustering + classical ML can build powerful vision systems.
