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
The problem
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
- ScanA photo of a strip or box goes through OCR: PaddleOCR models on ONNX Runtime, on the CPU.
- CleanLines are tidied and common OCR confusions undone, such as 0 for o and rn for m.
- 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.
- SaveCheaper brands with identical salts, strengths and dosage form, because SR is not a plain tablet, with data-error prices filtered out.
- ProtectEvery pair of salts across everything you take is checked against 160,000 documented interactions from DDInter, with severity.
- Be honestSalts with no interaction data are shown as unchecked, never as safe.


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.
- Scan
- Clean
- 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
| Matcher | Input | Top-1 | Top-5 | Equiv@1 | Latency |
|---|---|---|---|---|---|
| Fuzzy baseline | typed | 93.0% | 98.7% | 94.7% | 350 ms |
| OCR brand line | 77.7% | 89.3% | 82.0% | 354 ms | |
| full strip | 84.0% | 95.7% | 91.7% | 924 ms | |
| Neural retriever, 0.3M parameters | typed | 95.7% | 99.7% | 96.3% | 18 ms |
| OCR brand line | 78.3% | 90.0% | 82.0% | 16 ms | |
| full strip | 88.7% | 96.0% | 95.7% | 96 ms | |
| Hybrid, neural and fuzzy | typed | 95.0% | 99.7% | 95.7% | 461 ms |
| OCR brand line | 80.7% | 91.3% | 84.0% | 538 ms | |
| full strip | 88.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.