This is a simple OCR system that can recognize handwritten digits using an Artificial Neural Network (ANN).
The system consists of:
- A web-based interface for drawing digits
- A client-side JavaScript component for handling user interactions
- A Python server that processes requests
- A neural network implementation for OCR
- Python 3.6+
- NumPy
- A web browser
- Install the required Python packages:
pip install numpy
- Start the server:
python server.py
- Open a web browser and navigate to:
http://localhost:5000
- Draw a digit on the canvas and:
- Enter the digit value in the text field and click "Train" to train the network
- Click "Test" to have the network predict the digit
- Click "Reset" to clear the canvas
- The user draws a digit on the canvas
- The drawing is converted to a 20x20 pixel representation (400 values)
- This data is sent to the server
- The neural network processes the data and returns a prediction
The neural network design can be experimented with using:
python neural_network_design.py
This will test different numbers of hidden nodes and report the performance of each configuration.
ocr.html: The web interfaceocr.js: Client-side JavaScript for handling user interactionsocr.css: Styling for the web interfaceserver.py: Python server that handles requestsocr.py: Neural network implementationneural_network_design.py: Script for experimenting with network design