Even in 2023, the Christian Mutuality (LCM) receives about 40,000 mostly handwritten doctor’s certificates per day. These certificates contain information regarding the patient, the reason(s) for the doctor’s visit, and the amount to be paid for the doctor’s consult. Part of the amount is refunded by the LCM. The data of the doctor’s certificates must be digitized before they can be processed. For handwritten certificates, this requires manual labour to read from the certificate and input the data in the applications and databases. Automating the process of reading and transcribing the handwritten text reduces labour cost and speeds up the processing of the certificates.
An intelligent solution
The solution is based on artificial intelligence (AI), augmented with advanced image processing. It is capable of automatically reading and transcribing close to 20% of all A-type doctor’s certificates.
This results in a serious manual labour reduction and a significant shortening of the processing time, without loss of quality. Speedier refunds thus result in happier customers.
The AI is tuned in such a way that it does not make more mistakes than humans do, and it is monitored over time to ensure its quality does not deteriorate. Every now and then the AI needs to retrain to maintain its high standard and to handle previously unseen data.
“Thanks to the handwriting AI, we are now capable of automatically processing nearly 20% of all A-type doctor’s certificates, which greatly enhances and speeds up our patient reimbursement process.”
Roel De Spiegeleer, ICT director LCM
The “Landsbond der Christelijke Mutualiteiten” (LCM), or Christian Mutuality (CM) for short, is a Belgian health insurance fund that groups nineteen regional health insurance funds. With its four and a half million members, CM is the largest health insurance fund in the country. Its mission is “keeping healthcare affordable for everyone”.
More info on cm.be
2-step approach
Reading handwriting on forms requires a two-step approach:
1. Finding the text
Finding the text uses advanced image processing techniques. Doctors don’t tend to write between the lines, and they don’t use the same writer’s style. Therefore, a set of algorithms is used to detect text boundaries and to homogenize the text’s look and feel.
The image-processing algorithms are also required to extract a good training set for the AI models. Examples of such algorithms are:
- Fetching the boundary box of a region of interest (ROI)
- Detecting the number of text lines within the ROI
- The splitting of text into words
- Creating uniform pen thickness of the text
- Suppression of background noise
Reduction of colours - Matching against templates
- Alignments
2. Reading the text
Once found on the image, the reading of the text is performed by custom-trained AI, based on neural networks and optimized for handwriting. The architecture of the neural network combines recurrent and convolutional layers.
The custom-trained AI performs much better than available third-party generalized models, because they are trained for the specific business case and know the business jargon very well.
Both the image processing, which is CPU-intensive, and the transcribing of the handwriting, which is RAM-intensive, are offered as configurable, stateless micro-services accessible through a RESTfull API. They are integrated with a front-end and back-end application, and orchestration through an external workflow engine.
The production system is run completely in the local data centre. The AI model trainings are performed using Vertex AI on the Google Cloud Platform.
Applied Technologies
The microservices are written in Python and run using Flask servers within Docker containers in an OpenShift (Kubernetes) environment. This ensures horizontal scaling and optimized tuning for either the image processing towards CPU, or transcriptions towards RAM.
The image processing algorithms are built on standard Python libraries, such as OpenCV. The AI is built using TensorFlow and is trained using Google Vertex AI on the Google Cloud Platform. The AI monitoring and quality assurance is executed on a Looker Studio dashboard on the Google Cloud Platform.
Additional technologies are used for small dedicated tasks that support the AI solution. These include:
- Tesseract OCR for the recognition of non-handwritten text;
- Google Vision API for the recognition of handwritten text for which no custom model can be trained and for which no self-learning AI can be built;
- YOLO for finding non-text objects on a form, such as stamps or signatures.
All code is integrated with the in-house software release management based on GitLab, Jenkins and Nexus.
A team within a team
LCM maintains a framework contract with Cronos Public Services, the sub-domain of the Cronos Group that bundles and facilitates the expertise of its sub-companies for public services. Thanks to Cronos and Vectr.Consulting, the Tensr team was integrated in the LCM development teams with the task of introducing everything AI-related that was needed for reading the doctor’s handwriting, including the continuous AI monitoring and learning capabilities. This was the largest project within the LCM to integrate such an AI within its back-end infrastructure.