# Ghana Currency Recognition System
Automatic Recognition of Ghanaian Currency Notes using Machine Learning and Image Processing.
Built with **React** (frontend) · **Flask** (backend API) · **TensorFlow / MobileNetV2** (CNN model)
---
## Project Structure
```
Ghana-currency projects/
├── backend/
│ ├── app.py ← Flask REST API
│ ├── requirements.txt
│ ├── .env
│ ├── model/
│ │ ├── train.py ← CNN training script
│ │ ├── class_names.json ← auto-generated during training
│ │ └── ghana_currency_model.h5 ← auto-generated after training
│ └── utils/
│ └── preprocess.py ← shared image preprocessing helpers
├── frontend/
│ ├── public/index.html
│ ├── src/
│ │ ├── App.jsx / App.css
│ │ ├── index.js / index.css
│ │ └── components/
│ │ ├── Header.jsx / Header.css
│ │ ├── ImageUploader.jsx / ImageUploader.css
│ │ ├── ResultDisplay.jsx / ResultDisplay.css
│ │ └── ConfidenceBar.jsx / ConfidenceBar.css
│ ├── package.json
│ └── .env
├── dataset/ ← put your note images here (see below)
└── README.md
```
---
## Step 1 — Prepare the Dataset
Create one sub-folder per denomination inside `dataset/`:
```
dataset/
1_GHS/
img001.jpg
img002.jpg
...
2_GHS/
5_GHS/
10_GHS/
20_GHS/
50_GHS/
100_GHS/
200_GHS/
```
**Minimum recommended:** 100–200 images per denomination for acceptable accuracy.
**Tips:** Vary lighting, angle, background, and distance when capturing images.
---
## Step 2 — Train the Model
```bash
# From the project root
cd "Ghana-currency projects"
# Install Python dependencies
pip install -r backend/requirements.txt
# Train (this may take 20-60 minutes depending on your hardware)
python backend/model/train.py
```
After training the following files are created automatically:
- `backend/model/ghana_currency_model.h5` — trained model weights
- `backend/model/class_names.json` — list of recognised classes
- `backend/model/plots/tr …