An offline handwriting recognition pen like hardware and tensorflow based model implementation that will type what you write with it. Right now it supports english alphabets and numbers. That are 62 symbols!
The circuitry used by a mouse for recognizing and tracking movement have been embedded in the structure of a pen . Thus ,when you use the pen to write the CNN converts them to letters and produces a typed result.
- Convolution Layer
- 16 3x3 Filters
- Max Pool
- 3x3 Same Padding
- Rectified Linear Unit
- Convolution Layer
- 10 3x3 Filters
- Max Pool
- 2x2 Same Padding
- Rectified Linear Unit
- Inception 16 filters
- Fully Connected
- 1 Hidden Layer, 500 Neurons
- TanH activation
- Softmax Layer
Yes, Model structure is stored seperately in models/cnn.py
. Train.py
expects following function from a model script
def create_network(img_height, img_width, num_classes)
And it should return x, y, y_true, optimizer
train.py
has been designed to aid this by using preconfigured values and training method. You can expect a detailed explanation of different parameters by typing train.py --help
.
examples
train.py --show
- Show loaded training data
train.py --train
- Train model
train.py --restore save/validations
- Test model
We're using public dataset Chars74K
- It contains 62 classes [A-Za-z0-9]
- It has 55 samples per class
- All images are of fixed resolution 1200x900
You can download and unzip dataset by running dataset.sh
shell script.
We're are preprocessing dataset because of various reasons
- We can reduce dimensions
- We can eliminate empty spaces
- We don't need 3 channels
- Samples are not properly scaled
- Too big to fit into memory and train on home pc
- Bounding box calculation
- Samples croping
- Reducing channels
- Scale to fit properly in maximum bounding box
- Dimensions Reduction
You can preprocess data after downloading dataset by executing python normalize.py
- It expects that system has all the dependencies installed
pip3 install -r requirements.txt
bash ./dataset.sh
python normalize.py
It will create two files normalized-train.bin
& normalized-val.bin
under dataset
directory.
This is a part of Academic Project Report under Practical Training (COE-320) at NSIT.
- Arko Gupta
- Aryan Singh
- Aman Priyadarshi
MIT © Aman Priyadarshi