Ocular Biometry OCR: a machine learning algorithm leveraging optical character recognition to extract intra ocular lens biometry measurements

Anish Salvi, Leo Arnal, Kevin Ly, Gabriel Ferreira, Sophia Y. Wang, Curtis P. Langlotz, Vinit Mahajan, Chase A. LudwigFrontiers Artif. Intell 2024 · DOI

Abstract

In clinical ophthalmology, ocular biometry measurements are essential for disease prediction and surgical planning. However, these data are often trapped in static PDF reports, creating a significant manual transcription bottleneck for large-scale research. This paper introduces Ocular Biometry OCR, a specialized machine learning pipeline designed to automate the extraction of these metrics. By combining open-source OCR frameworks with multimodal large language models (LLMs), the system achieves over 98% accuracy, transforming unstructured clinical reports into research-ready datasets.

Introduction

Ocular biometry—encompassing measurements such as axial length (AL), anterior chamber depth (ACD), and corneal curvature (K)—is foundational for managing conditions like myopia and retinal detachment. Despite their importance, these metrics are typically generated by proprietary hardware and stored as non-searchable PDF files or physical printouts within Electronic Health Records (EHRs). Manually transcribing these thousands of records is labor-intensive and error-prone. Ocular Biometry OCR addresses this "last mile" data challenge by providing an automated, high-fidelity extraction solution.

Methods

The Ocular Biometry OCR pipeline consists of five distinct stages designed to ensure data integrity and clinical relevance:

  1. Cropping: Reports are windowed to isolate biometric data, effectively excluding Protected Health Information (PHI).
  2. Extraction: The system utilizes two parallel models: PaddleOCR (an open-source framework) and Google’s Gemini Pro Vision (a multimodal LLM).
  3. Post-processing: Raw OCR output is parsed into structured key-value pairs.
  4. Rule-Based Correction: To mitigate common OCR errors (e.g., misidentifying the degree symbol '°' as '0'), the algorithm applies geometric rules based on ophthalmic physics, such as verifying the relationship between corneal angles.
  5. Error Selection: The pipeline evaluates multiple extraction windows and selects the result with the highest data completeness.
Overview of the Ocular Biometry OCR pipeline, illustrating the process from report cropping to structured data output.

Datasets

The algorithm was validated using a large-scale cohort of 6,685 clinical reports from 4,378 unique patients at Stanford Health Care. The dataset included reports from three major biometer models:

  • Lenstar LS 900: 2,965 reports.
  • IOL Master 700: 3,616 reports.
  • IOL Master 500: 104 reports (used for ground-truth manual annotation).

Key Insights

The "Zero vs. Degree" Challenge

A critical finding was the consistent failure of standard OCR models to distinguish between medical symbols and numbers. The implementation of a "rules-based safety net"—checking if K1 and K2 angles are approximately 90 degrees apart—was vital for maintaining clinical accuracy.

Model Performance: Open-Source vs. Commercial

While Gemini Pro Vision offers advanced reasoning, PaddleOCR demonstrated superior consistency in maintaining the physical layout of the document. Gemini occasionally suffered from "hallucinations" or out-of-order text extraction, whereas PaddleOCR's deterministic approach proved more reliable for structured tabular data.

Results

The pipeline demonstrated exceptional reliability and accuracy across all hardware platforms:

  • Inter-model Agreement: The system achieved agreement scores (on a 0 to 1 scale) of 0.985 for Lenstar, 0.999 for IOLM 500, and 0.998 for IOLM 700.
  • Ground Truth Validation: Against human-annotated data, Gemini achieved a perfect 1.000 agreement score, with PaddleOCR at 0.999.
  • Data Retrieval: Valid biometric values were successfully extracted in over 99% of cases across all datasets.

Limitations and Future Work

Currently, the pipeline requires manual configuration of "windows" for different report layouts. Future iterations aim to automate this layout detection. Additionally, the risk of LLM hallucinations necessitates strict validation protocols. The researchers intend to apply this structured data to train predictive models for retinal complications, moving from automated extraction to proactive clinical decision support.

Summary updated

BibTeX
@article{salvi2024ocular,
  author = {Anish Salvi and Leo Arnal and Kevin Ly and Gabriel Ferreira and Sophia Y. Wang and Curtis P. Langlotz and Vinit Mahajan and Chase A. Ludwig},
  title = {{Ocular Biometry OCR: a machine learning algorithm leveraging optical character recognition to extract intra ocular lens biometry measurements}},
  journal = {Frontiers Artif. Intell.},
  year = {2024},
  doi = {10.3389/frai.2024.1428716},
}
Figure