An handwritten recognition web app with the use of cgi-scripts
Start of the web app
Recognition of digit
- This webapp consists of two major parts as shown below
- UI logic
- index.html - the actual UI in HTML
- paint.js - Control of HTML Canvas that lets users to write the handwritten digit to be tested
- button-logic.js - handling the AJAX request to those Python CGI neural network scripts
- iteration-slider.js - responsible for the slider that shows training iteration
- Python CGI script to handle the neural network for recognizing handwritten digit
- *-ubyte - actual training set of size 50,000 and test sample set of size 10,000 with total 60,000 28x28 images used by the neural network
- thetas.mat - the actual trained weight matrix used for prediction
- feedforward-prediction-cgi.py - loads the matrix in thetas.mat, and perform feedfoward prediction using the matrix.
- train-handwritten-digit-cgi.py - trains the weight matrix and save it to thetas.mat
- imshow-grayscale-mat.py - saves the raw pixel data under the CGI dir for debugging purpose.
- Proof of concept
- Use of AJAX and JQuery to achieve rich interaction interface.
- Use of HTML Canvas and event-driven programming
- Use of Python CGI script
- Demonstration of practical use of neural network for basic image recognition
- Notes
- One must configure their Apache server to enable the use of CGI script
- In order to have a working training functionality, timeout must be disable for the long loading time that might occur during the NN training stage