Performance-efficiency trade-offs in OCR-LLM frameworks for key information extraction from drug packaging
摘要
Efficient and accurate extraction of critical information from drug packaging is essential for pharmaceutical and healthcare applications, yet manual processing is inefficient and large AI models require prohibitive resources. This study investigates the performance and efficiency trade-offs of a two-stage framework combining Optical Character Recognition (OCR) with lightweight Large Language Models (LLMs) for key information extraction on consumer-grade hardware. The pipeline employs PP-OCR v3 for text recognition, shown to significantly outperform EasyOCR and Tesseract in both character- and word-level accuracy, and evaluates three lightweight LLMs (Gemma 3-4B, Llama 3.2-3B, and Mistral-7B) for structured information extraction. A comprehensive evaluation was conducted using multidimensional metrics, including OCR accuracy, LLM extraction performance (Precision, Recall, F1-score with 95% confidence intervals), and system efficiency (LLM processing time, total latency, and GPU utilization). Results show that PP-OCR v3 achieves the highest OCR accuracy (91.31% character-level, 87.03% word-level). Among the LLMs, Mistral-7B attains the highest precision (85.18%) but incurs the longest total processing time (3.05 s) and highest GPU usage (89.42%). Llama 3.2-3B is the fastest (1.83 s) but yields the lowest F1-score (74.77%). Gemma 3-4B offers the best balance, achieving the highest overall F1-score (81.67%) with moderate latency (2.32 s) and the lowest GPU utilization (75.51%). These findings demonstrate that accurate OCR-LLM pipelines can be deployed on consumer hardware, and that optimal model selection depends on application needs–favoring Gemma 3-4B for balanced performance, Mistral-7B for precision-critical scenarios, and Llama 3.2-3B for latency-constrained environments.