Skip to content

Python scripts for segmentation of cursive handwritten image, and recognizing the characters using a CNN based model

License

Notifications You must be signed in to change notification settings

RiteshKH/Cursive_handwriting_recognition

Repository files navigation

Python scripts for segmentation of cursive handwritten image, and recognizing the characters using a CNN based model

Handwriting recognition is one of the challenging and difficult problems. A number of papers have been published with research detailing new techniques for the classification of handwritten numerals and words. In most of the research, the text recognition is carried out by passing each small part of segmented text directly to a neural network based model. This technique relies on the accuracy of model and confidence values for verification of correctness which is very slow & difficult to implement. The technique proposed here is a simple and unique set of algorithms for text recognition which primarily focuses on the character segmentation. The algorithm involves the preprocessing, segmentation, model building and recognition steps.

Instructions

All the python scripts can be independently executed. The following order needs to be maintained.

  • image-straighten.py (optional) This module is used for slant-correction of the images. If the image is already straightened, no need to execute this. slant_correction

  • segmentation.py : This takes in the desired image from the folder sample_image, and performs segmentation operation. This includes word and character segmentation, stored in the result/characters folder.

word_segment top_contour char_segment

  • center-align.py : This takes in the segmented character images, adds padding, resizes and center aligns the images, ready to be fed to the model for prediction. The standardized images are stored in result/image folder.

image_standardization

  • model_build.py : This module builds the CNN model using Keras. The training and testing data is taken from gzip. The model is saved in the same folder. If the model exists, it is used for future recognition. If not, a new model is built.

model_architecture

  • recognition.py : This uses the model built to recognise the characters in the images. The images and their predicted output from the model is displayed together.

Future work:

  • Few characters missing in segmentation, needs fixes.
  • The accuracy of the model is low as of now. Needs more training.
  • Use of transfer learning using models like Resnet, or ensemble methods, may give better results.

About

Python scripts for segmentation of cursive handwritten image, and recognizing the characters using a CNN based model

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages