News for hackers. Stuff that matters.
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by pault on Thursday November 09, 2017 @02:21PM (#15665078)
I had to research the commercial OCR market recently for a client project. It's abysmal. Most of the solutions are horrendously overpriced, windows only enterprise packages, and the ones that I was able to try out bordered on unusable (bad results and terrible UI). Since OCR is basically "hello world" for tensorflow, I don't understand why these incumbents haven't been wiped off the map.
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by staticautomatic on Thursday November 09, 2017 @03:15PM (#15665509)
Lots of reasons they haven't been wiped off the map.

1. Full page OCR is trivial these days. Anyone who's just doing full-page OCR has no business using one of these commercial offerings. The commercial stuff is really for extraction of structured info from unstructured and semi-structured documents. ABBYY and Nuance are the only ones with products that can handle it. There are alternatives for simple capture tasks (like DocParser), but not for complex ones.

2. ABBYY and Nuance have a lot of IP in the space on lock.

3. The market for complex data extraction (at least the kind of stuff I do) may not actually be big enough for smaller players to bother pursuing (most new players are going after tasks of intermediate difficulty, like invoice and receipt capture).

4. There's still a need for on-prem style solutions for people doing huge volumes (hundreds of thousands of pages a year), whereas most of the new market entrants are cloud only.

5. I haven't used Nuance's stuff much but ABBYY's products are actually incredibly robust under the hood-- stuff you wouldn't want to build yourself unless you absolutely had to. FlexiCapture will do 95%+ accuracy out of the box (on a character by character basis) with no human verification.

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by derefr on Thursday November 09, 2017 @04:55PM (#15666158)
> Anyone who's just doing full-page OCR has no business using one of these commercial offerings.

So what are you supposed to use for full-page OCR?

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by rb2018 on Friday November 10, 2017 @04:53AM (#15668923)
As far as hosted solutions go, the best are Google Cloud Vision, Azure OCR and OCr.space

You can compare all three here: https://ocr.space/compare-ocr-software

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by ocrcustomserver on Thursday November 09, 2017 @08:50PM (#15667335)
For an opensource solution that uses Tesseract, check out ocrmypdf: https://github.com/jbarlow83/OCRmyPDF
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by ocrcustomserver on Thursday November 09, 2017 @10:49PM (#15667803)
I wouldn't say that full page OCR is trivial. Using an opensource solution (99% based on Tesseract) is going to get you ok-ish results if your input is relatively clean (no complex layout, scanned documents from a flatbed scanner, standard fonts) and you don't care about speed. If you care about recognition accuracy then Tesseract isn't going to cut it (at least not without some serious effort).

Replying to points 1 and 3: For smaller players and/or complex tasks you can always implement your own custom parser.

I'm doing work as a contractor in this space.

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by staticautomatic on Friday November 10, 2017 @12:59PM (#15671650)
I agree with you that Tesseract isn't great out of the box, but if you aren't doing huge volumes, there are plenty of cloud options available.

Respectfully, I disagree about this being a parsing issue. The whole reason so-called "zonal ocr" exists is because of the challenges of reliably inferring the structure of a document at parsing time. Yes, there are some kinds of documents where parsing logic alone will suffice, but for more complex tasks you need what ABBYY and Nuance are selling.

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by ocrcustomserver on Saturday November 11, 2017 @08:30PM (#15679189)
Just to be sure that we're talking about the same thing, by "custom parser" I meant implementing your own barebones "zonal OCR" functionality with just the features that are needed for the specific problem.

I think it boils down to the needs of each individual application.

Some cases have a lot of templates and need the "automatic fuzzy matching" functionality and the extra bells and whistles.

But smaller players often deal with just a handful of relatively simple templates where FlexiCapture would just be overkill (not to mention a couple of other problems that I'm covering at the end of the post). This is of course not an easy task because you need someone who can design and implement an end to end system that possibly involves image processing, "zonal OCR", include an OCR engine and also perform reliable text extraction from images/PDFs (extracting text from PDFs is tricky). It's way easier for a non developer to think about what rulesets/logic to apply and not having to think about the image processing/OCR bits. I think that is one of the main selling points of FlexiCapture. It abstracts the OCR bits so that the system designer can think about the problem itself, design a spec and think about the logic the logic. Do you need deskewing of documents? Click a button and you get deskewing.

Which brings me to the second point. The products sold by ABBYY/Nuance are meant to be used by integrators (no programming needed other than the occasional VB.net script), not image processing specialists/developers. In my (biased) opinion, it makes more sense for some businesses to go the custom route instead of investing in FlexiCapture.

There is also FlexiCapture Engine that is meant for developers. This has the same problems as the other offerings by ABBYY (I don't know about Nuance but I suspect it's the same):

  - expensive
  - vendor lock-in
  - ridiculous extra costs for things like "cloud/VM license", exporting to PDF, etc.
  - limits on how many pages you can process per year or in total (complex licensing schemes)
  - ABBYY really wants to sell you their own cluster/cloud management services which is all proprietary
  - limited flexibility in implementing distributed services, costs that add up fast, you have to be trained in their own stack
Can you provide an example where you think that a custom solution would not work? I'm curious.
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by staticautomatic on Sunday November 12, 2017 @03:28PM (#15682480)
First of all, why don't you shoot me an email at [email protected] and we can talk further. In a nutshell, it would have been way more expensive and difficult for us to roll our own than even the high cost of a FlexiCapture license. But here's a reasonably complete explanation of the build vs buy analysis we did.

1. FlexiCapture makes pre-processing incredibly painless and training-free. Beyond the usual binarization stuff, we extensively use the built in auto-rotation and cleanup (skew, noise, speckle, etc.).

2. Templating is really the big win for FlexiCapture. I have not seen anything else with a template GUI that comes close to being as usable, robust, or simple. That's really important to us because we build a LOT of templates. I have a really hard time imagining having to code them.

3. FlexiCapture's template engine is super strong for the kinds of documents we work with, which is mainly complex repeating groups with nested structures. It's also really good at handling both photos of documents (e.g. mobile) and scans. One thing it also offers that I haven't seen elsewhere in a turnkey product or existing platform is the ability to define zones in purely relative terms without absolute positions. I don't know about Nuance but I've not seen any other template GUI that will allow you to spec something like "look for either this word or a two-line string containing these words in the upper left quadrant of the document."

4. There's a dearth of zonal ocr frameworks. Outside of ABBY and Nuance's SDK's, the only one I'm even aware of is OpenKM, and I don't write Java. The FlexiCapture Engine SDK is a terrible beast. The documentation is horrible, it's Windows only, and it's all COM objects.

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by computerex on Thursday November 09, 2017 @03:44PM (#15665722)
OCR is not "hello world" for tensorflow. The entire article is devoted to actually developing the OCR pipeline. They ported the model over to tensorflow as a secondary thing.
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by wwarner on Thursday November 09, 2017 @04:42PM (#15666083)
Character recognition might be "hello world" but full page OCR definitely is not. When I read the article and think about all the obstacles dropbox overcame, it looks like a pretty huge achievement. I can tell you, it would take me a lot longer than 8 months do pull it off.
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by Drdrdrq on Thursday November 09, 2017 @05:52PM (#15666433)
I am certain they had a team on this, I just wonder what its size was. Quite an achievement!
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by sidlls on Thursday November 09, 2017 @02:52PM (#15665336)
OCR for really basic documents might be "hello world", but as usual real world practical applications have all sorts of interesting things that make this a harder problem than it seems.
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by amelius on Thursday November 09, 2017 @06:21PM (#15666600)
> Since OCR is basically "hello world" for tensorflow [...]

In that case ... it would be nice if Tensorflow had OCR as one of its examples/tutorials.

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by acdha on Thursday November 09, 2017 @02:40PM (#15665251)
> Since OCR is basically "hello world" for tensorflow, I don't understand why these incumbents haven't been wiped off the map.

Do you have an example of anyone working on that? I think those packages have a lot of inertia because you can buy a product with an API, documentation, etc. Something which says “Learn TensorFlow & enough AI to be dangerous” is going to be hard to get in the door at many large organizations so this might be an area where a solid open-source project could have a significant impact.

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by slap_shot on Thursday November 09, 2017 @03:07PM (#15665453)
The parent post is not implying that companies adopt Tensorflow themselves and solve this problem. The post is implying that a competitor come in to the market using the newer, better technology, and replace them with a better product (with an API, documentation, etc).

This issue here is that industries become stagnant when it appears difficult/costly to introduce a new product in that market. You usually need significant a technical and/or social change to occur before incumbents can be displaced. In this case, it was a technical change.

The other part of the issue is that investors want "0 to 1" ideas to invest in, and founders often chase those ideas. In reality, we need more "1.0 to 1.5" products, especially in crowded markets.

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by acdha on Thursday November 09, 2017 @05:20PM (#15666300)
I think your last point is correct: there's a huge gap between the kind of “hello world” demo the original poster was talking about and a product-level tool which has reasonable training data and performance across a non-trivial range of documents.

I think that getting there is a lot more work than OP anticipated.

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by pault on Friday November 10, 2017 @01:05PM (#15671696)
OP here; yes, you've summed it up perfectly.
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by phren0logy on Thursday November 09, 2017 @02:30PM (#15665167)
I recently looked at a number of packages, and the best option in my opinion is ABBYY Finereader Pro for Mac. The mac version can easily be automated with Hazel or Automator, which adds features that cost +$400 more for the PC. The results are worlds better than Acrobat.
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by philipkglass on Thursday November 09, 2017 @02:38PM (#15665241)
When I did my big project I was using the cheap standard edition of Finereader on (virtualized) Windows, and I built an automated pipeline for it with a combination of AutoHotkey, pdftk, Multivalent pdf tools, and Python.

I too tried the Acrobat OCR first and found it to be vastly inferior. One surprise was that (at the time at least) the OCR-by-Acrobat files were not only much less accurate in the text layer, but the file size also bloated up surprisingly.

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by ocrcustomserver on Thursday November 09, 2017 @10:33PM (#15667727)
Some thoughts (adding to staticautomatic's post):

1. There is no dataset/competition like ImageNet for OCR.

2. Most people/conferences/universities are going after natural images and "computer vision" problems. OCR is its own animal and while it shares some concepts with computer vision it's not the same thing.

3. A lot of IP, knowledge and talent locked up in a handful of very old companies doing this for a long time. ABBYY is for OCR what Google + Facebook are for deep learning (maybe more).

4. OCR is kind of a niche, a lot of knowledge is not available to many people outside of a few insiders (ABBYY/Nuance, universities, research labs, OCR conferences). I'm sure Google uses it a lot internally (e.g. Google Street View numbers etc.).

5. The incumbents don't just do OCR. They do preprocessing (computer vision/image processing) + OCR + NLP.

6. Hard to find data. ABBYY Finereader supports 190 languages. Collecting this data is no easy task.

I'm probably missing other reasons as well, but this is just off the top of my head.

That being said, I'm sure that there's going to be a lot of progress in the OCR + deep learning space soon.

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by rb2018 on Friday November 10, 2017 @04:59AM (#15668934)
>Since OCR is basically "hello world" for tensorflow,

This is a strong statement. Do you have any links to code or documentation that implements high-quality OCR with tensorflow?

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by pault on Friday November 10, 2017 @01:00PM (#15671665)
Not high quality. But since MNIST is typically used as a baseline reference, I was surprised that more advanced character recognition wasn't a staple in the field. From the tensorflow introduction[0]: "When one learns how to program, there's a tradition that the first thing you do is print 'Hello World.' Just like programming has Hello World, machine learning has MNIST."

I realize that this is a result of my lack of knowledge about the field, but the ML hype train makes it easy to overestimate the capabilities of deep learning as a layperson.

[0] https://www.tensorflow.org/get_started/mnist/beginners

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by bflesch on Thursday November 09, 2017 @02:23PM (#15665092)
Because for example Abby replaces the image with an PDF with invisible text overlays. I think it is a bit more complicated once you account for the formatting of documents.
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by milesokeefe on Thursday November 09, 2017 @02:36PM (#15665223)
Abbyy has had that ability for a longer period of time so it may be more accurate, but this is something tesseract supports[1]. In fact I'd say most OCR systems support it with varying degrees of accuracy.

[1]:https://github.com/tesseract-ocr/tesseract/wiki/FAQ#how-do-i...

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by RandomBookmarks on Friday November 10, 2017 @05:23AM (#15669004)
The ability to create searchable PDFs is very useful and convenient. But creating searchable PDFs does not require a deep understanding of the document format (like column detection etc). You just place the words at the right coordinates of their bounding boxes. You can test this for example here: https://ocr.space - select the option to create a searchable PDF. It works even for the most complex documents.

Now, creating a Word document from a scan is a different beast because it requires layout analysis. This is where Abbyy with its long experience still has a good lead.

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by pault on Thursday November 09, 2017 @02:36PM (#15665227)
My issue was that I needed one that exposes an API for doing OCR on pictures taken from mobile devices. It was really difficult to find non-desktop packages.
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by staticautomatic on Thursday November 09, 2017 @03:28PM (#15665614)
Out of curiosity, what did you need beyond something like OpenCV/Metal + Tesseract?
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by pault on Thursday November 09, 2017 @04:39PM (#15666065)
The client needed an OCR solution for supplier invoices with a variety of layouts and a combination of printed and hand-written characters, and didn't have the budget for a bespoke solution. To be fair, it's a very hard problem, I was just surprised that given all the much hyped recent advancements in deep learning for computer vision, most of the solutions in the market seem to be running on decades old technology.
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by ocrcustomserver on Thursday November 09, 2017 @10:19PM (#15667677)
Well it is more complex than it appears.

Extracting data from documents requires a solution which uses OCR but is a different product (e.g. ABBYY FlexiCapture).

This is most commonly referred to as zonal OCR and comes with the added functionality of handling multiple templates, defining zones/fields, specifying special rules for fields, verification process for manual inspection (e.g. triggered when the image receives a low confidence recognition score) etc. This is different and more complex than a product that does full page OCR (e.g. ABBYY Finereader).

Handwritten OCR is a whole different story. The products that do zonal OCR will fail to recognize handwritten text, unless it's in boxes (PDF forms). I'm working on a prototype that can handle handwritten text outside of boxes too.

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by criddell on Thursday November 09, 2017 @04:09PM (#15665892)
Do you know what Evernote uses? Although I don't really use it anymore, when I did, I was astonished at how will it found and indexed text.
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by ocrcustomserver on Thursday November 09, 2017 @11:08PM (#15667886)
They use multiple OCR engines. Some developed in-house and some proprietary ones. A blog post mentions I.R.I.S. as one of the proprietary ones.

They don't offer OCR publicly, instead, they generate a list of possible candidates to match against search queries (fuzzy matching).

From one of the blog posts: "Employing multiple reco engines is important not only because they specialize on different types of text and languages, but also as this allows to implement ‘voting’ mechanism — analyzing word alternatives created by diverse engines for the same word allows for better suppression of false recognitions and giving more confidence to consensus variants."

More: http://blog.evernote.com/tech/2013/07/18/how-evernotes-image...

http://blog.evernote.com/tech/2011/11/01/even-grittier-detai...

http://blog.evernote.com/tech/2011/09/30/evernote-indexing-s...

Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by jhayward on Thursday November 09, 2017 @04:38PM (#15666061)
If I recall, they don't do traditional OCR, rather they build a term probability database that lets them do matching on search terms. Both Evernote and ABBYY seem to have ties to a specific Russian research group.
Re:Creating a Modern OCR Pipeline Using Computer Vision and ... by romuloab42 on Thursday November 09, 2017 @06:32PM (#15666665)
I know you are talking about Desktop OCR, but I had a very good experience with Google Vision API. On my previous gig we were trying to automate receipt scanning, and it gave very good results with no previous image manipulation whatsoever (meaning, no special camera alignment, lighting condition, rotation, skewing, etc).

It was not perfect, but I was very impressed with the quality, speed, and price.