Skip to content

An application for detection and classification of new indian currency notes using bag of visual words and random forest

Notifications You must be signed in to change notification settings

anilsathyan7/indian-currency-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Indian-Currency-Classification

An application for classifying new indian currency notes using random forest classifier. It is implemented with the help of opencv and scikit-learn library. The dataset used for training consists of 1050 images of new currency notes(INR). It includes denominations of 10, 20, 50, 100, 200, 500 and 2000 rupees notes(i.e. 7 classes with 150 each).

Here we use hu moments(shape), haralick(texture) and colour histogram(colour) as global features and bag of visual words(BOVW) with SIFT as a local feature descriptor. It is then trained using a random forest classifier using scikit-learn library.

Finally during inference, we extract the rectangular ROI's from the preprocessed image using opencv(cropped rotated contours) and predicts the class labels using the trained random forest model.

Dependencies

  • Python3, Scikit-learn
  • Opencv+contrib, Mahotas
  • Pickle, Joblib

Demo

How to run

python bovw.py # Feature extraction
python hyper_train.py # Hyperparameter tuning
python train.py # Model training
python predict.py # Model inference
python currency.py # Currency classification

Training Results

Best Parameters:-

bootstrap=True, criterion='gini',
min_samples_leaf=1, min_samples_split=2,
min_weight_fraction_leaf=0.0, n_estimators=200,
n_jobs=-1,verbose=1

Cross Validation Accuracy: 0.98 (+/- 0.01)

Confusion Matrix:-

10 20 50 100 200 500 2000
10 28 0 1 0 2 0 0
20 0 24 0 0 0 1 0
50 0 0 27 0 0 0 0
100 0 0 0 32 0 0 0
200 2 0 0 0 31 0 0
500 0 1 0 0 0 26 0
2000 0 0 0 0 0 0 35

Sample Output

Screenshot

Versioning

Version 1.0

Authors

Anil Sathyan

Acknowledgments

About

An application for detection and classification of new indian currency notes using bag of visual words and random forest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages