Code-Based Versus AutoML Methods for Pill Recognition in Clinical Settings: Comparative Performance Study
Clinical Snapshot
PICO Framework
| P — Population | Solid oral dosage forms (pills) from 30 commonly dispensed medications in clinical settings |
| I — Intervention | Code-based pill recognition using Ultralytics YOLO11 |
| C — Comparator | Three cloud-based AutoML platforms (Amazon Rekognition Custom Labels, Google Vertex AI AutoML Vision, Microsoft Azure Custom Vision) |
| O — Outcomes | Accuracy, precision, recall, mean average precision, training costs, training time, and deployment feasibility across multiple clinical datasets |
Bottom Line
This comparative study demonstrates that automated pill recognition technology shows promise for reducing medication errors in clinical settings, but no single platform dominates across all environments. YOLO11 offers flexibility and cost-effectiveness but requires technical expertise, while AutoML platforms provide easier implementation at higher costs but with less predictable performance. The substantial variation in accuracy across real-world clinical datasets (20.62%-90%) highlights the critical need for rigorous validation with representative data before clinical deployment. Healthcare organisations considering implementation should prioritise platforms based on their specific performance requirements, available technical resources, and budget constraints. Given the potential patient safety implications, any deployment should include comprehensive validation protocols and fail-safe mechanisms to prevent medication errors.
Key Findings
P Value: Not reported
Effect Size: Performance varied significantly across platforms and clinical environments (20.62%-90% accuracy)
Primary Outcome: Accuracy on verification dataset ranged from 80.83% (YOLO11) to 91.60% (Google Vertex AI)
Nnt Or Sensitivity: YOLO11 achieved near-perfect precision (0.95-1.00) and mean average precision scores
Confidence Interval: Not reported
Clinical Application
Implementation feasible but requires careful platform selection based on technical resources, budget constraints, and performance requirements Relevant to Australian hospitals and community pharmacies; would need validation with PBS-listed medications and compliance with TGA digital health requirements Hospital pharmacies and clinical settings requiring automated medication verification
Abstract
BACKGROUND: Visual identification and verification of medications during dispensing and administration are prone to human error, particularly in high-pressure and high-volume clinical settings. Misidentification can lead to medication errors, posing risks to patient safety and placing a burden on health care systems. Recent advances in computer vision and object detection offer promising solutions for automated solid oral dosage form (pill) recognition. However, comprehensive studies comparing code-based and no-code (automated machine learning [AutoML]) approaches for pill recognition are lacking. OBJECTIVE: This study aimed to evaluate and compare the performance, cost, usability, and deployment feasibility of pill recognition models developed with Ultralytics YOLO11 and 3 cloud-based AutoML platforms (Amazon Rekognition Custom Labels, Google Vertex artificial intelligence [AI] AutoML Vision, and Microsoft Azure Custom Vision) using multiple datasets, including real-world clinical images. METHODS: Five training subsets of increasing size (1230, 3450, 7380, 14,400, and 26,880 images) from 30 commonly dispensed medications were used to train models on YOLO11 and 3 AutoML platforms. Models were evaluated on 6 datasets from different environments: clinical images from 3 hospitals, a verification dataset, a laboratory dataset, and an exhaustive testing set. Performance metrics, including accuracy, precision, recall, and mean average precision, were calculated. We evaluated the impact of training data size on performance and benchmarked training time, platform costs, and limitations. RESULTS: No single platform dominated across all test environments. On the verification dataset (optimal conditions), accuracy ranged from 80.83% (YOLO11) to 91.60% (Google Vertex AI) when trained with the full training dataset. YOLO11 showed consistent performance improvement with increasing training data (accuracy: 63.06%-80.83%) and achieved near-perfect precision and mean average precision scores (0.95-1.00). Google Vertex AI reached above 90% accuracy on 3 training subsets but showed unpredictable declines. Amazon Rekognition maintained near-perfect precision (0.92-1.00) but had the highest false negative rates (up to 0.74), missing many pills. Custom Vision demonstrated steady performance improvements (77.08%-85.62% accuracy) but lagged behind other AutoML platforms, probably due to its older YOLOv2-based architecture. On clinical datasets, accuracy fluctuated (20.62%-90%) depending on the dataset and platform. Training costs and time varied: YOLO11 (open-source), Microsoft Azure (US $9.50-US $28.60, allowed user-predefined training duration), Google Vertex AI (US $69.30 with consistent 2.5-3-hour training times), and Amazon Rekognition (US $5.43-US $43.89 with size-dependent training time scaling, reaching nearly 40 hours on the full 26,880-image dataset). CONCLUSIONS: Each platform offers distinct advantages and trade-offs: YOLO11 provides the highest flexibility and lowest platform costs but requires technical expertise, while AutoML platforms can offer high performance at a higher cost but with limited user control, introducing unpredictability. The performance variations demonstrate that successful clinical deployment requires careful platform selection based on specific performance requirements, budget constraints, and available technical resources, followed by rigorous validation using real-world, representative data to ensure patient safety in clinical workflows.
References
- 1.Ashraf, A. R., Rádli, R., Vörösházi, Z., & Fittler, A. (2026). Code-Based Versus AutoML Methods for Pill Recognition in Clinical Settings: Comparative Performance Study. JMIR Medical Informatics, 12(1), e79160. https://doi.org/10.2196/79160
Related Research
European journal of hospital pharmacy : science and practice
Unit dose drug dispensing systems in hospitals: a systematic review of medication error reduction and cost-effectiveness
25 June 2026
European journal of hospital pharmacy : science and practice
A collaborative telepharmacy model for dispensing and informed delivery from hospital to community pharmacies
26 Apr 2026
American journal of health-system pharmacy : AJHP : official journal of the American Society of Health-System Pharmacists
Evaluating medication record creation before and after an electronic health record transition
24 Apr 2026
This content is for educational purposes for healthcare professionals only and does not constitute clinical advice. Clinical decisions should be based on individual patient assessment, current guidelines, and appropriate specialist consultation. Editorial Standards · Privacy Policy · Terms of Service