Optimizing Optical Character Recognition Within a Physical - Agentic AI System for Flexible Drug Preparation
Issued Date
2025-01-01
Resource Type
Scopus ID
2-s2.0-105040605495
Journal Title
6th Technology Innovation Management and Engineering Science International Conference Times Icon 2025 Proceedings
Rights Holder(s)
SCOPUS
Bibliographic Citation
6th Technology Innovation Management and Engineering Science International Conference Times Icon 2025 Proceedings (2025)
Suggested Citation
Maneechay P., Warinsiriruk E., Wang Y.T. Optimizing Optical Character Recognition Within a Physical - Agentic AI System for Flexible Drug Preparation. 6th Technology Innovation Management and Engineering Science International Conference Times Icon 2025 Proceedings (2025). doi:10.1109/TIMES-iCON67125.2025.11488140 Retrieved from: https://repository.li.mahidol.ac.th/handle/123456789/117191
Title
Optimizing Optical Character Recognition Within a Physical - Agentic AI System for Flexible Drug Preparation
Author(s)
Author's Affiliation
Corresponding Author(s)
Other Contributor(s)
Abstract
The conventional camera-based prescription-label reading process used in existing automated systems has notable limitations in both accuracy and latency. These issues stem primarily from Optical Character Recognition (OCR) pipelines that were not optimized for real-world label characteristics-such as varying font complexity, size, and image quality-resulting in misread text and delays that fail to meet operational requirements. To address these shortcomings, this study developed an improved processing pipeline by comparing the performance of EasyOCR and PyTesseract under image-downscaling conditions ranging from 0.1 to 0.9. In parallel, an integrated N8N-AI Agent workflow was designed to enhance both the speed and accuracy of medication-label extraction. The proposed system combines appropriate pre-processing, selective OCR utilization, and the incorporation of reference data directly within the model. This integration leads to more stable label-reading performance, enabling the system to correctly identify medication names while reducing overall processing time compared with the previous approach. Experimental results show that PyTesseract processes images approximately 5-10 times faster than EasyOCR, whereas EasyOCR consistently delivers higher recognition accuracy. When combined with reference data, the workflow using a system-prompt approach proved more than ten times faster than the CSV-based lookup method. Optimizing the OCR for image complexity, minimizing node count, and applying in-memory processing collectively improved both the responsiveness and accuracy of the system. As a result, the new pipeline operates near real time, reduces bottlenecks associated with redundant file operations, and maintains stable performance across diverse medication-label formats-an essential requirement for reliable deployment in medical environments where precision and consistency are critical.
