[Huawei Developers] Mike-mei:
Optical character recognition (OCR) technology efficiently recognizes and extracts text in images of receipts, business cards, documents, and more, freeing us from the hassle of manually entering and checking text. This tech helps mobile apps cut the cost of information input and boost their usability.

So far, OCR has been applied to numerous fields, including the following:

In transportation scenarios, OCR is used to recognize license plate numbers for easy parking management, smart transportation, policing, and more.

In lifestyle apps, OCR helps extract information from images of licenses, documents, and cards — such as bank cards, passports, and business licenses — as well as road signs.

The technology also works for receipts, which is ideal for banks and tax institutes for recording receipts.

It doesn't stop here. Books, reports, CVs, and contracts. All these paper documents can be saved digitally with the help of OCR.

How HMS Core ML Kit's OCR Service Works​

HMS Core's ML Kit released its OCR service, text recognition, on Jan. 15, 2020, which features abundant APIs. This service can accurately recognize text that is tilted, typeset horizontally or vertically, and curved. Not only that, the service can even precisely present how text is divided among paragraphs.

Text recognition offers both cloud-side and device-side services, to provide privacy protection for recognizing specific cards, licenses, and receipts. The device-side service can perform real-time recognition of text in images or camera streams on the device, and sparse text in images is also supported. The device-side service supports 10 languages: Simplified Chinese, Japanese, Korean, English, Spanish, Portuguese, Italian, German, French, and Russian.

The cloud-side service, by contrast, delivers higher accuracy and supports dense text in images of documents and sparse text in other types of images. This service supports 19 languages: Simplified Chinese, English, Spanish, Portuguese, Italian, German, French, Russian, Japanese, Korean, Polish, Finnish, Norwegian, Swedish, Danish, Turkish, Thai, Arabic, and Hindi. The recognition accuracy for some of the languages is industry-leading.

The OCR service was further improved in ML Kit, providing a lighter device-side model and higher accuracy. The following is a demo screenshot for this service.

View attachment 5751149

How Text Recognition Has Been Improved​

Lighter device-side model, delivering better recognition performance of all supported languages

The device-side service has downsized by 42%, without compromising on KPIs. The memory that the service consumes during runtime has decreased from 19.4 MB to around 11.1 MB.

As a result, the service is now smoother. It has a higher accuracy for recognizing Chinese on the cloud-side, which has increased from 87.62% to 92.95%, higher than the industry average.

Technology Specifications​

OCR is a process in which an electronic device examines a character printed on a paper, by detecting dark or light areas to determine a shape of the character, and then translates the shape into computer text by using a character recognition method. In short, OCR is a technology (designed for printed characters) that converts text in an image into a black-and-white dot matrix image file, and uses recognition software to convert the text in the image for further editing.

In many cases, image text is curved, and therefore the algorithm team for text recognition re-designed the model of this service. They managed to make it support not only horizontal text, but also text that is tilted or curved. With such a capability, the service delivers higher accuracy and usability when it is used in transportation scenarios and more.

Compared with the cloud-side service, however, the device-side service is more suitable when the text to be recognized concerns privacy. The service performance can be affected by factors such as device computation power and power consumption. With these in mind, the team designed the model framework and adopted technologies like quantization and pruning, while reducing the model size to ensure user experience without compromising recognition accuracy.

Performance After Update​

The text recognition service of the updated version performs even better. Its cloud-side service delivers an accuracy that is 7% higher than that of its competitor, with a latency that is 55% of that of its competitor.

As for the device-side service, it has a superior average accuracy and model size. In fact, the recognition accuracy for some minor languages is up to 95%.

View attachment 5751157

Future Updates​

Most OCR solutions now support only printed characters. The text recognition service team from ML Kit is trying to equip it with a capability that allows it to recognize handwriting. In future versions, this service will be able to recognize both printed characters and handwriting.

The number of supported languages will grow to include languages such as Romanian, Malay, Filipino, and more.

The service will be able to analyze the layout so that it can adjust PDF typesetting. By supporting more and more types of content, ML Kit remains committed to honing its AI edge.

In this way, the kit, together with other HMS Core services, will try to meet the tailored needs of apps in different fields.

References​

HMS Core ML Kit home page

HMS Core ML Kit Development Guide