Inspiration

After the 2024 Noto Peninsula earthquake in Japan, a medical team at one shelter found that 31 of about 300 people would run out of their oral medicine within 7 days. Nobody knew which 31 until the team asked every person, one at a time (reported in the J Nippon Med Sch medical association journal, 2024;20(3):156). The information needed is already printed on every pharmacy label: how many were dispensed and how many to take a day. It is just never turned into "days left".

What it does

  1. You take a photo of a pharmacy label, or tap one of three built-in sample labels.
  2. An OCR model reads the label inside the browser. A parser proposes the drug name, strength, quantity and how many you take per day.
  3. Every field shows a confidence badge and the cropped piece of the photo it was read from. Save stays locked until you tick "I checked these values against the label".
  4. The list is sorted so the first medicine to run out is on top, under a headline such as "7 days until your first medicine runs out". You choose how many days ahead it warns you.
  5. An emergency card puts medicines, strengths, schedule, days left, allergies and a contact on one screen. You can print it, download it as text, or show a QR code that holds the same plain text.

It gives no medical advice and checks no interactions. There are no accounts and no server. A "Delete all data" button wipes everything.

How AI is used in the project

The AI in the app is Tesseract's LSTM OCR model, running through tesseract.js as WebAssembly in a web worker. It runs on the user's device, and the model files are served from the same site, so a label photo never leaves the phone and the app keeps working offline.

The parser after the OCR is rule-based on purpose. A language model can produce a plausible number that is not on the label, and here a wrong number is worse than a missing one. When the parser sees "as needed", "1 to 2 tablets", or two quantities that disagree, it returns no value and says why, and the person types it in.

AI tools I used while building (disclosure)

I used Claude (Anthropic) as an AI coding assistant for writing and refactoring code and tests. I chose the problem, decided what the app must refuse to do, and checked the results. This is also stated in the README.

How I built it

Plain HTML, CSS and JavaScript modules, with no framework and no build step. OCR, parser, days-left arithmetic, emergency card and storage are separate files so each can be tested alone. A service worker caches the app and the 11 MB of OCR files after the first scan. It is hosted on GitHub Pages. Built in November 2026, inside the hackathon period.

Does it work? (measured)

  • I ran the real OCR and the real parser on 12 synthetic label images: 3 label layouts, each clean, rotated on a dark surface, blurred JPEG, and low resolution. Drug name, strength, dose and times per day were right on 12 of 12. Quantity was right on 11 of 12. In the one miss the OCR lost the number and the parser reported "not found" instead of guessing.
  • 48 unit tests pass. 12 of them check that the parser refuses to guess.
  • A browser end-to-end test scans all three samples, checks the sorting and the emergency card, and repeats a scan with the network turned off.

Please read these numbers with care. The images are synthetic, there are only 3 layouts, and I wrote the parser after designing them. It has not been tested on real labels, phone cameras or curved bottles.

Challenges

  • OCR errors cluster on the small digits that matter most. Swaps like 0/O and 1/l had to be fixed only in context, or real numbers turned into letters.
  • "Twice daily" also contains "daily". Frequencies have to be matched most-specific-first and then blanked out.
  • 4 tablets at 1/7 per day has to be 28 days, not 27. Floating point needed care.

What I learned

The hard part of reading a label is ambiguity, not the clean case. I also learned to measure before claiming: the accuracy table in the README was the first time I saw exactly where the OCR fails. And I learned the cost of privacy in megabytes. Shipping the model with the page is 11 MB, and what it buys is that nothing is uploaded.

What's next

  • Test with real labels and phone cameras, with people's permission.
  • Japanese labels. The problem I started from happened in Japan, and the app reads English only for now.
  • Liquids, patches and insulin pens, which are not counted in tablets.

Built With

Share this project:

Updates

Submission history