Skip to content

A python implementation of multi-class image classification using bag of words technique and SVM classifier.

Notifications You must be signed in to change notification settings

mo-shaffei/bag-of-visual-words_image-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bag-of-visual-words_image-classification

A python implementation of multi-class image classification using bag of visual words technique and SVM classifier.

Description: Training images are used to build a bag of words by extracting features from each image using Histogram of Oriented Gradients(hog) algorithm. Then, the features extracted from all the training images are clustered, using Kmean, into the desired number of clusters to create the bag of words.

The dataset is created by using the obtained bag of words to create a histogram of features for each image in the training images. The histogram is then normalized and the label of each image is obtained, using the directory name of the image.

SVM classifier is trained using the dataset that we created, and then tested using test images. The process of creating test dataset is the same as the process described for the training data.

A confusion matrix is produced using the test results and the accuracy, mean of confusion matrix diagonal, is calculated.

Instructions: Use link to download the dataset. Unzip the file in the same directory as the scripts.

Run main.py.

About

A python implementation of multi-class image classification using bag of words technique and SVM classifier.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages