A Python-based machine learning application that classifies banknotes as either Authentic or Counterfeit using wavelet transform features extracted from images.
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.
To explore different approaches to handling datasets, this repository contains two implementations:
banknotes1.py: Manually splits the dataset into training and testing sets using custom Python logic.banknotes2.py: Uses Scikit-Learn's built-intrain_test_splitfunction to partition the dataset.
The dataset (banknotes.csv) contains numerical data points extracted from images of genuine and counterfeit banknotes:
- Variance of Wavelet Transformed image (float)
- Skewness of Wavelet Transformed image (float)
- Curtosis of Wavelet Transformed image (float)
- Entropy of image (float)
- Class / Label:
0(Authentic) or1(Counterfeit)
Install the required machine learning library:
pip install scikit-learn
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).
The execution outputs highlight the model's predictions and accuracy across the different setups:

