Saja Sadiq Bakhit, Saleem Lateef, Ali Al‐Naji
The paper describes the design and implementation of a smart pharmacy automation system using a Raspberry Pi 5, integrating a web camera, stepper motor-driven dispensing mechanism, HDMI display, and YOLOv8 for drug recognition with a custom dataset of 1,500 images across ten medication classes. The YOLOv8 model achieves 98% precision, near 1.0 precision and recall, and mAP50/mAP50-95 scores of ~0.99 on the custom dataset, demonstrating high reliability for real-time medication identification and dispensing. The system provides a cost-effective, automated solution for pharmacies, enabling accurate medication dispensing with minimal delay.
Manual medication dispensing in pharmacies remains prone to human errors and is time-intensive, particularly under high patient loads, while existing commercial automation solutions are cost-prohibitive for small to medium-sized pharmacy settings. This paper presents the design and implementation of a cost-effective smart pharmacy automation system leveraging a Raspberry Pi 5 platform. The proposed system integrates a web camera for real-time image acquisition, a stepper motor-driven dispensing mechanism, and an HDMI display for visual feedback of identified medications. To enable accurate drug recognition, we employ the YOLOv8 deep learning object detection algorithm. A custom dataset comprising 1,500 images of ten distinct medication classes—with 150 samples per class, captured under varying illumination conditions (bright, normal, and low light) and three viewing angles—was constructed for model training and evaluation. The dataset was partitioned into 70% training, 20% validation, and 10% testing sets. Experimental results demonstrate that the YOLOv8-based model achieves exceptional performance, with an overall precision of 98%, precision and recall values approaching 1.0, and mAP50 and mAP50-95 scores of approximately 0.99, indicating high reliability for real-time deployment. The entire system, including both hardware and software, is able to accurately identify and dispense medications in an automatic manner with minimal delay. This affordable, on-site alternative to high-cost commercial systems presents an efficient and scalable solution to help decrease dispensing mistakes and enhance workflow in a pharmacy setting with limited resources.