Counterfeit notes are hard to spot by eye. Fake Currency Detection checks Indian banknotes with a Convolutional Neural Network (CNN) that runs entirely on the phone. Take a photo of a note or pick one from your gallery, and the model tells you whether it is genuine or counterfeit, which side of the note it sees, and how confident it is. To check that deep learning was worth it, I compared the CNN with two classical baselines: a Support Vector Classifier and a Random Forest. This was my final-year project for the Master of Computer Applications at Maulana Abul Kalam Azad University of Technology (2024), supervised by Dr. Supriyo De.
The Core Model: a CNN
I built the CNN with TensorFlow and Keras. It sorts each photo into one of four classes: fake front, fake rear, real front and real rear. Because the side is part of the class, one prediction gives both the verdict and the side of the note.
- Input200 × 400 RGB
- Rescalingpixels ÷ 255
- Conv2D64 filters, 3 × 3
- MaxPoolto 100 × 200
- Conv2D32 filters, 3 × 3
- MaxPoolto 50 × 100
- Conv2D32 filters, 3 × 3
- MaxPoolto 25 × 50
- Conv2D16 filters, 2 × 2
- Flatten20,000 values
- Dense64 units
- Dense16 units
- Softmax4 classes
- Feature extraction: four convolution layers with 64, 32, 32 and 16 filters (ReLU, same padding). The first three are each followed by 2 × 2 max pooling, which shrinks the feature map from 200 × 400 to 25 × 50.
- Classification head: the 20,000 flattened features pass through dense layers of 64 and 16 units into a four-way softmax.
- Size: 1,312,740 trainable parameters, about 5 MB as a TensorFlow Lite file.
- Data: 4,328 labelled note images, split 80/20 into 3,463 for training and 865 for validation.
- Training: Adam optimizer, sparse categorical cross-entropy loss, batches of 16, 20 epochs in total.
- Result: 98.96% accuracy on the 865 validation images, with weighted precision of 98.97%, recall of 98.96% and F1 of 98.96%.
- Export: the trained model is saved as a TensorFlow SavedModel, converted with TFLiteConverter and bundled with the app as cnn.tflite.
Baselines: SVC and Random Forest
To compare the CNN against classical machine learning, I trained two scikit-learn models on the same four classes. Neither learns its own features: each image is read in grayscale, resized to 400 × 200, scaled to 0–1 and flattened into 80,000 pixel values. Both use 1,084 images, split 80/20 into 867 for training and 217 for testing, and are saved with joblib.
- Support Vector Classifier: polynomial kernel of degree 3 with C = 1. It reached 93.55% accuracy on its 217 test images.
- Random Forest: 16 trees using the entropy split criterion. It reached 99.08% accuracy on 217 images.
Model Comparison
| Model | Input | Scored on | Accuracy | Precision | Recall | F1 score |
|---|---|---|---|---|---|---|
| CNN (Keras) | 200 × 400 RGB image | 865 validation images | 98.96% | 98.97% | 98.96% | 98.96% |
| SVC (polynomial, degree 3) | 80,000 grayscale pixels | 217 test images | 93.55% | 94.07% | 93.55% | 93.60% |
| Random Forest (16 trees) | 80,000 grayscale pixels | 217 images | 99.08% | 99.10% | 99.08% | 99.08% |
Precision, recall and F1 are weighted averages across the four classes.
The Flutter App
- On-device inference: the CNN runs locally through tflite_flutter, with the XNNPACK delegate on Android and the GPU delegate on iOS. Nothing is sent to a server.
- Matching preprocessing: the app resizes each photo to 200 × 400 and passes raw RGB values; the model's own Rescaling layer normalizes them, exactly as in training.
- Camera or gallery: photograph a note directly, or check an image you already have.
- Clear verdict: the highest of the four softmax scores decides genuine or counterfeit and front or back, and that score is shown as the confidence.
- Interface: GetX for state management, FlexColorScheme theming, Google Fonts and a native splash screen.




