<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Lupu Eduard Adrian on Medium]]></title>
        <description><![CDATA[Stories by Lupu Eduard Adrian on Medium]]></description>
        <link>https://medium.com/@lupu.eduard.adrian?source=rss-33dc207aeb59------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*uLNbkYDQSYPgj915</url>
            <title>Stories by Lupu Eduard Adrian on Medium</title>
            <link>https://medium.com/@lupu.eduard.adrian?source=rss-33dc207aeb59------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 06:22:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lupu.eduard.adrian/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From Paperwork to One Click: How We Tried to Fix Medical Certificates as Students]]></title>
            <link>https://medium.com/@lupu.eduard.adrian/from-paperwork-to-one-click-how-we-tried-to-fix-medical-certificates-as-students-cfe60e4b750d?source=rss-33dc207aeb59------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfe60e4b750d</guid>
            <category><![CDATA[paddleocr]]></category>
            <category><![CDATA[ocr]]></category>
            <category><![CDATA[medical-certificate]]></category>
            <dc:creator><![CDATA[Lupu Eduard Adrian]]></dc:creator>
            <pubDate>Fri, 09 Jan 2026 17:52:07 GMT</pubDate>
            <atom:updated>2026-01-09T17:52:07.746Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5-k_2Itz3a4IrjeY.jpg" /><figcaption><strong><em>Detected fields and regions of interest after automatic document alignment</em></strong></figcaption></figure><p>If you have ever worked in HR in Romania, this scene is probably familiar.</p><p>An employee brings a medical leave certificate.<br>Someone opens Excel.<br>Someone starts typing.</p><p>Dates. Diagnostic codes. Checkboxes.</p><p>One wrong digit and payroll is suddenly blocked.</p><p>We did not start this project because we wanted to build an OCR system.</p><p>We started it because this is still how medical paperwork works in 2025.</p><p>Romanian medical leave certificates, officially called CNAS Certificat de Concediu Medical, are everywhere. And yet, most of them are still processed manually. It is slow, error-prone, and stressful, especially when mistakes affect salaries or legal compliance.</p><p>So we asked ourselves a simple question:</p><p><strong>What if scanning a medical certificate took seconds instead of minutes, and did not send sensitive data to the cloud?</strong></p><p>This project is our attempt to explore that idea.</p><h3>Why this problem matters</h3><p>Medical certificates are not just paperwork.</p><p>They contain extremely sensitive data: personal identification numbers, diagnoses, and health related dates.</p><p>At the same time, most OCR solutions today either:</p><ul><li>struggle with phone photos</li><li>fail on handwritten fields</li><li>or require sending data to external cloud services</li></ul><p>That last point was a deal breaker for us.</p><p>We wanted something that:</p><ul><li>runs entirely offline</li><li>works with real world photos, not perfect scans</li><li>keeps humans in control instead of blindly trusting OCR output</li></ul><p>This is not about replacing people.</p><p>It is about reducing friction in a very human process.</p><h3>A small, local OCR tool</h3><p>What we built is a proof of concept, not a finished product.</p><p>At its core, it is a lightweight Streamlit application that turns photos of Romanian medical certificates into structured data.</p><p>Today, the app can:</p><ul><li>align and straighten photos automatically</li><li>highlight detected fields visually</li><li>extract CNPs, dates, diagnostic codes, and checkboxes</li><li>assign confidence scores and flag uncertain fields</li><li>export results as Excel, CSV, or JSON</li></ul><p>You can try it live here:<br><a href="https://medical-certificate.streamlit.app/">https://medical-certificate.streamlit.app/</a></p><p>The code is open source:<br><a href="https://github.com/EduardLupu/medical-certificate">https://github.com/EduardLupu/medical-certificate</a></p><h3>The real challenge was alignment, not handwriting</h3><p>At first, we assumed handwriting would be the hardest part.</p><p>It turned out that alignment was the real challenge.</p><p>Most certificates arrive as photos taken at odd angles, with shadows, folds, or stamps. Fixed templates break immediately in these conditions.</p><p>Our pipeline starts with geometric alignment using edge detection, contour filtering, and perspective transformation.</p><p>Once the document is normalized to a canonical layout, extraction becomes much more reliable.</p><h3>Why blue ink matters</h3><p>Romanian medical certificates are printed in black, while doctors usually write in blue ink.</p><p>Most OCR pipelines lose this information by converting everything to black and white.</p><p>We chose a different approach.</p><p>For each region of interest, we generate multiple image variants:</p><ul><li>grayscale</li><li>blue ink emphasized</li><li>denoised versions</li></ul><p>Each variant is passed through PaddleOCR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*V4ibebjyuMKWDAk992u85Q.png" /><figcaption>The blue emphasis removes the document grid lines, increasing accuracy.</figcaption></figure><h3>Why a lightweight OCR model was enough</h3><p>One important realization we had early on was that <strong>we did not need a heavy OCR model</strong>.</p><p>Most of the information on medical certificates consists of:</p><ul><li>digits</li><li>short numeric codes</li><li>dates</li><li>very few letters</li></ul><p>Because of this, we chose <strong>PaddleOCR </strong>and the lightweight recognition open-source model: <strong>en_PP-OCRv5_mobile_rec</strong>, with a size of only <strong>7.63 MB.</strong></p><p>More insights about the model available here:<strong> </strong><a href="https://www.paddleocr.ai/latest/index.html">https://www.paddleocr.ai/latest/index.html</a><br><a href="https://github.com/PaddlePaddle/PaddleOCR">https://github.com/PaddlePaddle/PaddleOCR</a></p><p>This model runs fast on CPU, works well offline, and is more than sufficient for recognizing digits and short structured fields.</p><p>Instead of chasing larger, heavier models, we focused on preprocessing, alignment, and validation. That decision gave us better performance with far lower complexity.</p><p>As a result, we focused more on reliable digit extraction and validation than on complex OCR models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*fJw9hqGPIxG2Nr4YvjWL-A.png" /><figcaption>Output after processing a medical certificate</figcaption></figure><h3><strong>Measured quality indicators</strong></h3><p>Although this project is a proof of concept, we evaluated its performance on a small set of anonymized medical certificates.</p><p>We measured field-level accuracy, meaning whether each extracted field exactly matched the expected value after validation.<br>Using the candidate voting approach, we observed:</p><ul><li>over 99% accuracy for printed fields (series and numbers of the certificates)</li><li>around 80–85% accuracy for handwritten digits fields</li><li>near-perfect detection for checkboxes</li></ul><p>These indicators were sufficient to validate the design choices for preprocessing and model selection in this early-stage prototype.</p><h3>Candidate voting</h3><p>Instead of trusting a single OCR result, we let multiple candidates compete.</p><p>Each variant produces text and a confidence score. We validate the format based on field type, such as digit length or date structure.</p><p>The best valid candidate wins.</p><p>This simple idea significantly improved accuracy, especially for handwritten CNPs and dates.</p><p>It is not fancy.<br>It is practical.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*BNtcO-7uMgf0sPkulXjGkw.png" /><figcaption>Each variation will go through the voting system</figcaption></figure><h3>Humans stay in the loop</h3><h3>Humans stay in the loop</h3><p>This was intentional.</p><p>The app does not pretend to be perfect.</p><p>It shows confidence per field, flags suspicious values, and helps reviewers focus only where attention is needed.</p><p>Automation should reduce effort, not hide mistakes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6IvQiFzUr-JEFDe1TMA_OQ.png" /><figcaption><em>Each extracted field is validated and flagged when human review is needed</em></figcaption></figure><h3>What did not work perfectly</h3><p>Since this is a proof of concept, there are clear limitations:</p><ul><li>extreme handwriting is still difficult</li><li>static ROI maps limit flexibility</li><li>the system is tuned mainly for blue ink</li><li>bulk processing is not yet supported</li></ul><p>Acknowledging these limits is part of the project.</p><h3>Where we want to take this next</h3><p>If we were to continue, we would focus on:</p><ul><li>bulk scanning for multiple certificates</li><li>a clean API for payroll integration</li><li>better handwriting accuracy through fine tuning</li><li>dynamic ROI detection</li><li>support for black ink and mixed writing</li><li>internationalization beyond Romania</li></ul><h3>Why we built this as students</h3><p>This project was developed as part of the Software Engineering master’s program at the Faculty of Mathematics and Computer Science, <strong>Babeș-Bolyai University</strong>.</p><p>We are not a company.</p><p>We are not selling anything.</p><p>We are students who looked at a boring, frustrating, real world problem and tried to improve it with technology that respects privacy and respects people.</p><p>If this project saves someone a few minutes, prevents one payroll error, or sparks a better idea, then it already did its job.</p><p>Sometimes, a proof of concept is enough to start a change.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfe60e4b750d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>