Charan Mulagala

MedLens

Photograph a medicine strip and MedLens tells you exactly what it is, finds the same medicine for less, and warns you about combinations that interact.

Year
2026
Built with
Python, PyTorch, ONNX Runtime, RapidOCR, FastAPI, Docker
Code
github.com/M-SaiCharan/medlens
Blister strips of tablets and capsules heaped together, some printed with brand names

The problem

2.9×

The median price spread between brands of the same salt at the same strength in India, and often ten times or more.

India has around 250,000 branded medicines. Most people cannot read a strip, do not know a generic exists, and rarely know which of their medicines interact. MedLens fixes that from a single photo.

How it works

  1. ScanA photo of a strip or box goes through OCR: PaddleOCR models on ONNX Runtime, on the CPU.
  2. CleanLines are tidied and common OCR confusions undone, such as 0 for o and rn for m.
  3. IdentifyA byte-level transformer retriever, trained contrastively, and a fuzzy matcher each propose brands from an index of 242,000 distinct brand names. A reranker weighs the salt, strength and form evidence printed on the strip.
  4. SaveCheaper brands with identical salts, strengths and dosage form, because SR is not a plain tablet, with data-error prices filtered out.
  5. ProtectEvery pair of salts across everything you take is checked against 160,000 documented interactions from DDInter, with severity.
  6. Be honestSalts with no interaction data are shown as unchecked, never as safe.
The front of a blister strip of yellow capsules on a wooden table
The front of a strip: what you hold.
The foil back of a blister strip printed with the drug name, brand and strength several times over
The back: what MedLens reads. The salt, brand, form and strength it looks for, marked here by hand.

Watch it read

One block of the strip above, read the way MedLens reads it: scan the text, undo the usual OCR slips, then pick out what matters.

Close-up of the foil: Venlafaxine, Bluefish XL 150 mg, kapsułki o przedłużonym uwalnianiu, twarde, Venlafaxinum
  1. Scan
  2. Clean
  3. Read
Salt
venlafaxine
Strength
150 mg
Release
extended (XL)
Form
hard capsule
Brand
Bluefish XL

Next, MedLens matches these against 254,000 Indian medicines. That part happens in the app.

A re-enactment of MedLens’s steps on this photograph, written by hand from what the strip says. It is not the app’s output.

Results

Synthetic benchmark: 300 random active medicines, three kinds of input. Equiv@1 means the top result has the same composition and form, which is what the savings and safety checks depend on.
MatcherInputTop-1Top-5Equiv@1Latency
Fuzzy baselinetyped93.0%98.7%94.7%350 ms
OCR brand line77.7%89.3%82.0%354 ms
full strip84.0%95.7%91.7%924 ms
Neural retriever, 0.3M parameterstyped95.7%99.7%96.3%18 ms
OCR brand line78.3%90.0%82.0%16 ms
full strip88.7%96.0%95.7%96 ms
Hybrid, neural and fuzzytyped95.0%99.7%95.7%461 ms
OCR brand line80.7%91.3%84.0%538 ms
full strip88.7%97.3%94.3%1,302 ms

The hybrid is within about a point of the neural matcher at around twenty times the latency, so the app uses the neural matcher when a trained model is present. On brands held out of training, the retriever’s recall matches the brands it saw, so it learned OCR noise rather than the catalogue.

Limits

  • Prices are a 2022 snapshot, and the source lists at most two salts per medicine.
  • About a quarter of salt mentions, mostly India-specific drugs such as nimesulide and aceclofenac, have no DDInter entry. They are flagged as unchecked.
  • The benchmark is synthetic. A hand-labelled set of real strip photos is the next evaluation.

MedLens is an informational tool, not medical advice. Data: A–Z Medicine Dataset of India (CC BY-SA 4.0) and DDInter.

Semantic Video RAGNext case study