Showing posts with label training data. Show all posts
Showing posts with label training data. Show all posts

Thursday, September 26, 2013

Datasets : for the love of OCR

I am back to post some information about the data I used.
There is a lot of training data available 'out there'. Initially, I looked into the FIRE dataset from RISOT, thanks to +Abhishek Gupta , and it might be good for testing purposes. But it is difficult to be used for training, as the associated font information is not available.
However, here is a link to some data I generated/used.
Also, for testing, most of images I used were obtained by a simple Google Image search, with relevant keywords, like "bangla newspaper" or "bangla poster".
Since Google uses bubble filters, I suggest everyone to use the generic Google site to get over the country defaults, and log out of their Google accounts or use an incognito/private window. This should ensure some consistency in the search results over all platforms, geological and temporal differences, as well as user preferences. However, it is not of the utmost importance, and just a suggestion.

Tuesday, September 17, 2013

Final Report : Part 2

At the beginning of the project, I spent some time finalising the tools I would be using.
Having done so, I started with the pre-processor, and finally, by the mid-term, a working prototype of the Whitewashing code was completed.

During this period, I also realised how difficult it was to generate good data for training/testing purposes. They were awful in the begining, when I got the results for whole words instead of characters. But gradually the quality improved. During these trials, I tried out various methods for generating the data and eventually the box files, some of them are :

  1.  Ari's trainer  helped a lot in learning about the training procedure
  2.  OCR chopper was easy to use to make box files, but not always accurate. It needed lots of manual editing.
  3. BoxMaker was similar to OCR chopper, but more flexible in terms of size
  4.  I also tried with some data from Parichit 
  5.  Open source icr , a project related to Ari's project mentioned above, was somewhat helpful.
  6. Some amazing work at Silpa inspired and motivated me, but i ended up not using them because I felt they were not very easy to incorporate in the project.
  7. Debayan's Tesseract Indic project has been a great help and provided me with much required guidance to get started.
After having tried all the methods, I took the decision to use Cairo-Pango in combination, and though had some problem initially, finally it worked out.

Further reading made it clear that I should always jumble up and mix the characters in a training set. I took it one step further, and decided to mix up even the sizes of the different images. And for that, I wrote another script. This helps in better training.
For the final leg of this, I was trying to make a  python script, but it was not working. In the end, I switched to using ImageMagick as it does the trick with a single command. There was no point in making things more complicated than necessary.

Along with this, I continued my work on testing various filters on different types of documents. I will publish it in the next post.

Sunday, September 15, 2013

code clean up

It was bugging me to put up the whole code in a single file, specially after having used a very nice, modular  structure in the notebooks.  So I spent the day scrubbing, and finally I have split them up in manageable parts, and pushed everything to the repository.
Also included with the code is instructions on how to use them, and my personal views and suggestion at some points, in the form of README files.
In the future, I would like to continue and maybe develop a GUI to make it easier to use.  
However, it's time to stop coding, and start documenting whatever is left. 

Sunday, September 1, 2013

more training data

Still a bit irregular with the updates, but finally I have some more training data that is about 80% ready.
Also, I am working on a separate script to generate the test image for producing the test data and hence, the 20% incompleteness in the new data. A preliminary version of the same is already in the repository.
However, I expect this script to be complete by next Thursday, and then have the final matrix by next Sunday night.
After that, as I have been reminded by my mentor again, I should focus on preparing the final report.
It's sad, but harsh reality, that OCR projects never seem to turn out enough data. I plan to publish at least 2 sets of training data I generated during this summer in some way through the repository. Though, the stock data still seems to perform better.
Also, I need to start working on an outline plan for the final report. Lots of work to do in a seemingly short period of time, maybe more so because it coincides with some period of health issues and then re-opening of school. It is one of the points I would like to mention in the GSoC review, but of course as my personal opinion. 
The most important factor right now is not to loose motivation and carry on with the project. So Long.

Thursday, July 18, 2013

some quick training

The last two days, I decided to go with my impulse and try generating some training data. Now I have a good grasp on the Tesseract commands for generating the required files, but still need deeper understanding about the clustering part. Amazingly, the long and tedious training procedure at the original documentation doesn't look so difficult after staring at it for almost 3 months.
However, after testing with the new data, no miracle happened, and while it managed to detect the language correctly, the accuracy wasn't worth mentioning.
Next step, I will generate some training data with the WhiteWashing algorithm and see how it fares.
But now, off to documentation.
So Long.

Wednesday, July 3, 2013

workaround for Pango

Having tried to make pango work on windows  for over a week now, I have finally given up, and have switched to Fedora.
On Fedora, it took a little over 3 minutes to install the dependencies and get everything up and running. more reasons to love Linux.
Anyway, the first trial of generating the images looks like this.
It is good in itself, but still needs work, and I need to synchronise the same fonts between my windows and Fedora environment, a silly mistake on my part to not take care of it already.
Coding for the clipping algorithm is about 30 % done. Right now, I am looking into connected-component analysis to see if it will work.
I plan to fix the fonts, and then work on the connected-component for the rest of the week.
So Long.