Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Banknote Authentication Classifier

A Python-based machine learning application that classifies banknotes as either Authentic or Counterfeit using wavelet transform features extracted from images.


📌 Project Overview

This project explores and compares the classification performance of multiple supervised machine learning algorithms:

  • Perceptron (Linear classifier)
  • Support Vector Machines (SVM)
  • Gaussian Naive Bayes (GaussianNB)
  • $k$-Nearest Neighbors ($k$-NN) (with $k=1$)

Note: While originally based on a lecture demonstration from CS50's Introduction to Artificial Intelligence with Python, this implementation has been expanded to explore and benchmark multiple machine learning classifiers independently.


📂 Code Variations

To explore different approaches to handling datasets, this repository contains two implementations:

  1. banknotes1.py: Manually splits the dataset into training and testing sets using custom Python logic.
  2. banknotes2.py: Uses Scikit-Learn's built-in train_test_split function to partition the dataset.

📊 Dataset Features

The dataset (banknotes.csv) contains numerical data points extracted from images of genuine and counterfeit banknotes:

  1. Variance of Wavelet Transformed image (float)
  2. Skewness of Wavelet Transformed image (float)
  3. Curtosis of Wavelet Transformed image (float)
  4. Entropy of image (float)
  5. Class / Label: 0 (Authentic) or 1 (Counterfeit)

💻 Setup & Usage

1. Prerequisites

Install the required machine learning library:

pip install scikit-learn

2. Run the Code

You can run either of the implementations depending on the splitting method you want to test:

# Run the manual split version
python banknotes1.py

# Run the train_test_split version
python banknotes2.py

*To experiment with different models, simply uncomment your preferred classifier inside banknotes1.py or banknotes2.py (e.g., swapping GaussianNB(), SVC(), or Perceptron() with KNeighborsClassifier).


📈 Results

The execution outputs highlight the model's predictions and accuracy across the different setups:

Banknotes Run 1 Banknotes Run 2

About

An evaluation of multiple classification models (Perceptron, SVM, Naive Bayes, k-NN) using banknote wavelet features to distinguish genuine currency from counterfeits.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages