In times of AI and digitalization, however, only 13 % of the companies surveyed (10-500 employees) use a complete Digital travel expense report to1. Even at our company - a software company - travel expense accounting is not yet fully automated. Therefore, in the form of a thesis, we have looked into possible methods of Information extraction to digitize this process.
Lack of standardization hinders automation process
A sub-problem of complete automation is the lack of standardization for invoices about Small amounts - also known as Receipts. This made it difficult to Automated extraction of the searched Data enormous. Time to digitize the process by implementing a system for automatically extracting data from Tank receipts. The system is divided into three sub-problems that need to be solved:
Pre-processing of the input image
The first step in digitizing a document is to convert the printed paper into a file. Either a scanner or a photo camera can be used for this. The result of both processes is an image file. Here is an example taken with a cell phone camera:

To make this image Text extraction to optimize it, this must be included in its Binary representation This is achieved through binarization. The aim of Binarization is that all Pixel only the Values "one" (foreground / font) or "zero" (background). This allows the Separate text from background. The prerequisite for this is an image in greyscale, because binarization attempts to set a threshold for Gray values so that a pixel can be clearly identified as "one" or "zero". Binarization methods can be divided into two approaches: A global approach attempts to find a threshold for the entire image. A local approach, on the other hand, attempts to find a threshold for small sections of the image. But when to use which method? Global approaches are good if the image has a uniform brightness. However, this is not the case based on the photos taken by the camera. We have therefore determined that a local binarization approach must be implemented. After applying a binarization using the Sauvola method - an adaptive binarization process that binarizes documents using locally adaptive threshold values - the image is available in its binary representation:

Another important pre-processing method is the Correction of the tilt angleif the image was scanned or photographed at an angle. This correction can result in a Finding lines of text be greatly simplified. To this end, we have integrated a Line determination is implemented. This searches for contiguous lines of text and displays them as a line. The angle of inclination can then be calculated by averaging all the angles of these lines relative to the x-axis. The document must then be saved in the inverse angle can be rotated. Correcting the angle of inclination improves the Quality the text extraction considerably. See for yourself:


Source: https://www.kress.eu/de/news/309-deutliche-kraftstoffersparnis-erneut-nachgewiesen.html
Reading out the text
The conversion of scanned or photographed images into machine-readable text is called Optical Character Recognition (OCR). This technology makes it possible to have images with textual content recognized by computer systems. A popular solution for this is the open source OCR engine Tesseract. The engine was originally developed by HP and has been maintained and expanded by Google since 20062.
To use Tesseract, the Apache Tika Toolkit can be used. This toolkit offers various parsers for extracting data, including the TesseractOCRParser. It enables the Tesseract OCR engine to be easily coupled to a Java application.
Extraction of relevant information
As the text is now available in machine-readable form, the system has to process the actual Information extraction perform. A library for finding structured information in unstructured text is Apache UIMA (Unstructured Information Management Architecture). The library offers Interfaces to the programming languages C++ and Java. With UIMA you can Annotators which, for example, extract information from unstructured text on the basis of regular expressions.
All components within UIMA communicate using the Common Analysis Structure (CAS). The CAS is a subsystem in UIMA that enables data exchange between UIMA components3. Within the CAS, a TypeSystem which contains all the data types that are to be extracted. In our case of the fuel vouchers, this would be the Data types Sum, Date, Time, Quantity (number of liters), Type (fuel type) and Address. For these data types, the corresponding regular expressions deposited.
In the next step, the document text determined in the previous step is entered into the CAS. The annotator now searches the document text stored in the CAS and saves the start and end position in the text where the respective data type can be found. The CAS can then be searched for these data types, i.e. the structured information. An example of information extraction with Apache UIMA from the document photo (see above) is shown below:

It can be seen that all data can be extracted correctly except for the total amount. This is due to the difficulty of developing a regular expression that does not extract all euro amounts, but only the desired one. An AI system performs better with non-normalized data such as the total amount, as the existing textual context (e.g. the position in the overall text) can be included in the classification.
Conclusion
The system for extracting structured data from tank receipts has thus been completed and facilitates travel expense accounting considerably in the future.
The most important pre-processing steps in the digitization of analogue documents are the Binarization and a subsequent Correction of the tilt angleotherwise text recognition may deliver significantly poorer results. If there are documents with different degrees of brightness, a local binarization process must be used instead of a global binarization process.
The quality of the information extraction depends heavily on the regular expressions developed for the respective Data type off. It can be stated that even in times of Artificial intelligence one rule-based information extraction still has a raison d'être, as many data (such as date and time) are standardized and can therefore be clearly identified. regular expressions can be used to extract information. By connecting the system to the "Business Filemanager" cloud solution, fuel receipts can even be uploaded and read directly while on the move and thus made available to the travel expenses department.
P.S.: We have found a solution that we have not programmed ourselves, but which we use a lot: the Lunchit® app. It's the same approach, only for lunch receipts. Since we started using Lunchit®, we have saved a lot of time in administration. We no longer have to issue meal vouchers and settle them with the restaurants. Another plus point: employees also save time by using the app, as there are no more receipts or tokens to collect, take away and count.
And what about you - are you still typing expense reports manually or are you already digitizing? Share your experiences with us by leaving a comment.
1st source: https://www.vdr-service.de/fileadmin/services-leistungen/fachmedien/geschaeftsreiseanalyse/VDR-Geschaeftsreiseanalyse-2019.pdf


