Github: https://github.com/yaowang2026-cloud/ML2026/tree/final_submission

Inspiration

Maternal health records are often captured on paper forms, and turning those records into structured digital data requires manually reading and entering information field by field.

These forms can also vary in quality. A photo may be clear or blurry, handwriting may be difficult to interpret, and some information may simply be missing.

We built MidWise around one key idea: even when the input is inconsistent, the output and verification workflow should remain consistent.

Our goal is to reduce manual transcription while keeping the midwife in control whenever information is uncertain.

What it does

Midwise is a chat-style web app built for a phone. MidWise transforms photos of paper maternal-health records into consistent, structured, human-verified data.

A midwife can take photos or upload multiple images belonging to one patient record. MidWise analyzes the pages and maps the information into the same 31 predefined registry fields, regardless of the number or appearance of the uploaded pages.

The input does not have to be perfect. If handwriting is difficult to read, a photo is unclear, or information cannot be found, MidWise does not change its output format or simply guess. Every field still follows the same structured workflow and is classified using statuses such as KNOWN, NEEDS_REVIEW, ILLEGIBLE, or NOT_PROVIDED.

For the user, these results are organized into three simple groups:

  • Accepted: information that has sufficient supporting evidence and passes the application's checks.
  • Review: information that may have been identified but needs the midwife's verification.
  • Missing: information that was not provided and requires the midwife to decide whether to enter a value or leave it blank.

This means that a clearer document may require very little intervention, while a difficult handwritten or blurry document may require more review but both ultimately follow the same workflow and produce the same structured registry format.

For uncertain fields, MidWise shows the extracted value together with its supporting evidence. The midwife can confirm it or enter a correction. Missing information can be entered manually or explicitly left blank.

The patient ID must also be confirmed before the record can be completed. Once the required decisions are resolved, the information is transformed into a consistent structured record that can be viewed in the registry dataset and exported as CSV.

The interface works in French and English, and works online and offline both. Moreover, shows live progress per page, and includes a dataset viewer with CSV download.

How we built it

MidWise uses a Python/Flask backend with a mobile-friendly interface built using JavaScript, HTML and CSS.

For local processing, we use Qwen3.5:9b through Ollama. Each uploaded image is transcribed, and the information across the pages is then analyzed together and mapped into our fixed 31-field registry schema.

We designed the system so that model output does not automatically become final registry data.

The AI extracts and interprets the information, while Python validation rules check the resulting values and evidence. If a supposedly known value does not pass those checks or does not have sufficient supporting evidence, it is routed to the review workflow instead of being silently accepted.
The midwife can also enter corrections naturally. MidWise interprets the correction for that specific registry field, validates the resulting value, and still requires confirmation when appropriate.

Safe saving: Sessions are stored in SQLite, so reloading restores the record. CSV export is atomic, and saving the same record twice adds no duplicate row.

MidWise also supports an optional OpenAI online mode, while local processing remains available through Ollama.

Challenges we ran into

One of our biggest challenges was that real document input is not consistent. Photos can have different levels of clarity, handwriting can be difficult to interpret, and information can be incomplete.

We realized that trying to force the AI to produce an answer for every field would make the system less trustworthy.

Instead, we focused on making the output consistent even when the input is not. Whether a page is clear, blurry, handwritten, or incomplete, MidWise always maps the result into the same registry structure and the same Accepted, Review, and Missing workflow. Uncertainty therefore becomes something the system explicitly handles rather than hides.

Another challenge was ensuring that a plausible AI prediction was not automatically treated as correct. We added evidence checking, deterministic validation, and human confirmation so that uncertain information is directed back to the midwife.

Accomplishments that we're proud of

We're proud that MidWise goes beyond simply performing OCR. We built an end-to-end workflow that can take multiple photographs of a paper maternal record and transform them into a consistent 31-field digital record, while explicitly handling uncertainty.

What we're most proud of is that the workflow remains consistent even when the quality of the input changes. Clear information can move quickly through the system, while unclear, handwritten, illegible, or missing information is surfaced for human attention rather than silently guessed.

The result is a system where AI reduces repetitive transcription while the healthcare professional remains responsible for the information that requires judgment. The model reads. The code checks. The midwife decides.

What we learned

We learned that document digitization is not just about extracting as much information as possible. In a healthcare workflow, it is equally important to know when the system is uncertain. Instead of trying to eliminate uncertainty, we designed MidWise to manage it consistently. No matter the quality of the original image, every piece of information eventually enters the same structured workflow. That helped us think about AI less as an automatic decision-maker and more as a tool that can reduce repetitive work while directing human attention to the information that needs it most.

What's next for MidWise

Next, we would evaluate MidWise on a larger labeled dataset to measure field-level extraction accuracy and, importantly, how effectively the system identifies information that should be reviewed. We would also continue improving recognition of difficult handwriting and low-quality photographs. Future development would include a stronger offline-first workflow, encrypted local storage, patient matching across multiple visits, authentication, and additional privacy and security protections for real-world deployment.

Built With

Share this project:

Updates