- MNIST-based CNN model
- Real-time digit segmentation
- Confidence scoring
- Image preprocessing pipeline
# Clone repository
git clone https://github.com/TrendoD/digit-recognition
cd digit-recognition
# Set up environment
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
mkdir data\raw models\saved_models results# Run training with default parameters
python src/model/train_model.py
# Optional arguments for advanced users:
# python src/model/train_model.py --epochs 20 --batch_size 64# Run comprehensive evaluation
python src/model/evaluate_model.py
# Results will be saved in:
# - results/evaluation/confusion_matrix.png
# - Console output shows precision/recall metricsOnly 1 Image Prediction:
Run with:
python digit_recognizer.py --image_path path/to/your_image.pngDirektori Full Predictions :
Run with :
python digit_recognizer.py --dir path/to/your_folderQ: Getting "No such file" errors? A: Ensure:
- Model file exists in models/saved_models/
- Test images are in data/raw/
- All directories are created
Q: Low confidence predictions? A: Ensure input images:
- Have clear contrast
- Digits are centered
- Background is uniform
- Image size > 100x50 pixels