Scene classifier based on k-means algorithm and spatial pyramid matching method
In this implementation, I impleneted a standard k-mean algorithms for generating bag-of-features from training images. And then I use spatial pyramid matching method to generate a vectors of histograms which is used for image classification. I only used 6 classes of images in this implementation and I used 150 keywords for k-mean algorithm. The overall accuracy is around 0.3, Further improvement is possibly by switching the parameters such as the number of centroids. Check papers in the references section for more details.
Visual words of training image
- PIL I use PIL to open and translate images into numpy array
- Numpy I use Numpy to do image convolution and othe scientific calculation.
- pythonCV is my own implementation of some computer vision algorithms, which I use to do gaussian smoothing and convolution.
- SUN I use SUN database for training and classification
Lazebnik, Svetlana, Cordelia Schmid, and Jean Ponce. "Beyond bags of features: Spatial pyramid matching for recognizing natural scene categories." Computer vision and pattern recognition, 2006 IEEE computer society conference on. Vol. 2. IEEE, 2006.