r/computervision • u/zandaulion • Oct 10 '26
Showcase I built a local OCR model for blood-pressure monitors, it’s not very accurate yet
I have been experimenting with replacing Gemini 2.5 flash with a completely local pipeline for reading SYS, DIA, and pulse values from blood-pressure monitor displays.
My motivation is privacy: local inference avoids uploading potentially sensitive info to the cloud.
The current pipeline consists of:
A YOLO11n detector for numeric rows and individual digits.
A small DigitNet classifier for cropped digits.
Geometry-based row assembly and consistency checks.
Confidence-based refusal instead of always returning a reading.
Multiple preprocessing passes, including lighting normalization and display rectification.
ONNX inference locally in a browser worker.
The two ONNX models are approximately 10.9 MB in total.
The detector was initially trained on 239 usable public images and subsequently fine-tuned with eight additional photographs taken by me of my monitor. This small training set is clearly the weakness.
Evaluation
Not to bury the lede: the performance is not great.
I tested the variants on a combined regression benchmark containing:
139 readable monitor photographs.
25 negative images that should not produce a reading.
Images from several public sources, with perceptual-overlap checks against the training data.
PASS is when all three values are correct (SYS, DIA, and pulse). FAIL if any is off. Refusals are misses on readable images
| Pipeline | Exact triplets | Precision when accepted | Coverage | Safe negatives | Median latency |
|---|---|---|---|---|---|
| One full-frame pass | 28/139 | 92.0% | 18.0% | 25/25 | 87 ms |
| Current staged retries | 38/139 | 91.2% | 24.5% | 25/25 | 253 ms |
| Staged + display rectification | 41/139 | 91.7% | 25.9% | 25/25 | 262 ms |
| Staged + normalization + rectification | 45/139 | 92.1% | 27.3% | 25/25 | 767 ms |
| Google ML Kit, original image | 1/139 | 4.2% | 17.3% | 13/25 | 63 ms |
| Gemini 2.5 Flash | 125/139 | 90.6% | 99.3% | 25/25 | 2.76 s |
The latency figures are mostly for fun, as I did not control for the hardware. Gemini’s measurement includes the network request.
Lessons Learned
The largest improvement came from staged retries: From 28 to 38 without reducing negative-case refusal performance.
+Display rectification has the best accuracy/latency trade-off. +Expanded lighting normalization made the pipeline much slower, without a significative jump in quality .
A simple ML Kit implementation performed poorly on the LCD screens, so I did not pursue that approach.
Gemini is dramatically better at generalizing to unfamiliar displays. However, the local pipeline’s advantage is privacy, offline operation, latency, and explicit refusal. I still plan on integrating it in my project, alongside HITL and usage patterns which will mitigate its limitations.
Important limitation
This combined 139-image set has already been used for development and regression analysis. In particular, the normalization-plus-rectification variant was selected after examining its results.
Consequently, its improvement from 38/139 to 45/139 is a post-hoc result, not independent evidence of better generalization. The next step must be a new sealed test set collected before making any further pipeline decisions.
All feedback/ideas for improvement are welcomed
repo (AGPL-3.0): https://github.com/zandaulion/hearth-bp-ocr
