TY - GEN
T1 - Optimizing Optical Character Recognition Within a Physical - Agentic AI System for Flexible Drug Preparation
AU - Maneechay, Pradujthep
AU - Warinsiriruk, Eakkachai
AU - Wang, Yin Tien
N1 - Publisher Copyright:
© 2025 IEEE.
PY - 2025
Y1 - 2025
N2 - 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.
AB - 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.
KW - Agentic AI
KW - Artificial Intelligence
KW - N8N
KW - OCR
KW - Physical AI
UR - https://www.scopus.com/pages/publications/105040605495
U2 - 10.1109/TIMES-iCON67125.2025.11488140
DO - 10.1109/TIMES-iCON67125.2025.11488140
M3 - Conference contribution
AN - SCOPUS:105040605495
T3 - 6th Technology Innovation Management and Engineering Science International Conference, TIMES-iCON 2025 - Proceedings
BT - 6th Technology Innovation Management and Engineering Science International Conference, TIMES-iCON 2025 - Proceedings
PB - Institute of Electrical and Electronics Engineers Inc.
T2 - 6th Technology Innovation Management and Engineering Science International Conference, TIMES-iCON 2025
Y2 - 10 December 2025 through 12 December 2025
ER -