MedPackID: An Indonesian Benchmark Dataset for Medicine Packaging and Pill Detection Using YOLOv8n and Faster R-CNN
Main Article Content
Qory Hidayati
Hendra Kusuma
Muhammad Attamimi
Background: Reliable image-based medicine recognition is necessary to support safer medication handling, reduce identification errors, and improve automated access to pharmaceutical information. However, its performance may degrade when medicine packaging, pills, and printed text vary across acquisition conditions.
Aims: This study aimed to develop MedPackID as a public Indonesian benchmark for medicine packaging and pill detection and to establish reproducible detection and conditional recognition baselines.
Methods: MedPackID contains 1,444 consumer-device images and 1,540 manually reviewed bounding boxes collected at one site using one smartphone under varied illumination, viewpoint, orientation, scale, background clutter, and partial occlusion. YOLOv8n and Faster R-CNN were evaluated for object detection. Detected packaging regions were processed using EasyOCR, text normalization, and fuzzy matching, whereas detected pill regions were evaluated using ResNet-18 embeddings and cosine-similarity retrieval.
Results: On the frozen test partition, YOLOv8n achieved mAP@0.5 of 0.968 and mAP@0.5:0.95 of 0.707, compared with 0.909 and 0.645 for Faster R-CNN. Packaging retrieval achieved 90.98% Top-1 accuracy, while closed-set pill retrieval achieved 85.4% Top-1 accuracy. MedPackID provides a reproducible regional benchmark for pharmaceutical object detection and conditional recognition. The results establish within-dataset reference performance rather than clinical validity or generalization to unseen medicine identities, devices, or acquisition sites.
Baek, Y., Lee, B., Han, D., Yun, S., & Lee, H. (2019). Character region awareness for text detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (pp. 9365–9374). https://doi.org/10.1109/CVPR.2019.00959
Drobac, S., & Lindén, K. (2020). Optical character recognition with neural networks and post-correction with finite state methods. International Journal on Document Analysis and Recognition, 23(4), 279–295. https://doi.org/10.1007/s10032-020-00359-9
Everingham, M., Van Gool, L., Williams, C. K. I., Winn, J., & Zisserman, A. (2010). The PASCAL Visual Object Classes (VOC) challenge. International Journal of Computer Vision, 88(2), 303–338. https://doi.org/10.1007/s11263-009-0275-4
He, K., Zhang, X., Ren, S., & Sun, J. (2016). Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (pp. 770–778). https://doi.org/10.1109/CVPR.2016.90
Hidayati, Q., Kusuma, H., & Attamimi, M. (2026). MedPackID: A dataset of medicine packaging and pills in Indonesia. Mendeley Data, Version 1. . URL http://dx.doi. org/10.17632/d23kndp3sv.1. Version 1
JaidedAI. (2020). EasyOCR: Ready-to-use optical character recognition [Computer software]. GitHub. https://github.com/JaidedAI/EasyOCR
Levenshtein, V. I. (1966). Binary codes capable of correcting deletions, insertions, and reversals. Soviet Physics Doklady, 10(8), 707–710.
Lin, T. Y., Dollár, P., Girshick, R., He, K., Hariharan, B., & Belongie, S. (2017). Feature pyramid networks for object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (pp. 2117–2125). https://doi.org/10.1109/CVPR.2017.106
Lin, T. Y., Maire, M., Belongie, S., Bourdev, L., Girshick, R., Hays, J., Perona, P., Ramanan, D., Zitnick, C. L., & Dollár, P. (2014). Microsoft COCO: Common objects in context. In Computer Vision – ECCV 2014 (Lecture Notes in Computer Science, Vol. 8693, pp. 740–755). Springer. https://doi.org/10.1007/978-3-319-10602-1_48
My, L. N. T., Le, V. T., Vo, T., & Hoang, V. T. (2025). A comprehensive review of pill image recognition. Computers, Materials & Continua, 82(3), 3693–3740. https://doi.org/10.32604/cmc.2025.060793
Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., Desmaison, A., Köpf, A., Yang, E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B., Fang, L., Bai, J., & Chintala, S. (2019). PyTorch: An imperative style, high-performance deep learning library. Advances in Neural Information Processing Systems, 32, 8024–8035.
RapidFuzz Project. (2020). RapidFuzz: Rapid fuzzy string matching in Python and C++ [Computer software]. GitHub. https://github.com/rapidfuzz/RapidFuzz
Redmon, J., Divvala, S., Girshick, R., & Farhadi, A. (2016). You only look once: Unified, real-time object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (pp. 779–788). https://doi.org/10.1109/CVPR.2016.91
Ren, S., He, K., Girshick, R., & Sun, J. (2015). Faster R-CNN: Towards real-time object detection with region proposal networks. Advances in Neural Information Processing Systems, 28, 91–99.
Russakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., Huang, Z., Karpathy, A., Khosla, A., Bernstein, M., Berg, A. C., & Fei-Fei, L. (2015). ImageNet large scale visual recognition challenge. International Journal of Computer Vision, 115(3), 211–252. https://doi.org/10.1007/s11263-015-0816-y
Salton, G., Wong, A., & Yang, C. S. (1975). A vector space model for automatic indexing. Communications of the ACM, 18(11), 613–620. https://doi.org/10.1145/361219.361220
Shi, B., Bai, X., & Yao, C. (2017). An end-to-end trainable neural network for image-based sequence recognition and its application to scene text recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(11), 2298–2304. https://doi.org/10.1109/TPAMI.2016.2646371
Sokolova, M., & Lapalme, G. (2009). A systematic analysis of performance measures for classification tasks. Information Processing & Management, 45(4), 427–437. https://doi.org/10.1016/j.ipm.2009.03.002
Torchvision Contributors. (2026). Torchvision: Datasets, model architectures, and image transformations for computer vision [Computer software]. GitHub. https://github.com/pytorch/vision
Torralba, A., & Efros, A. A. (2011). Unbiased look at dataset bias. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (pp. 1521–1528). https://doi.org/10.1109/CVPR.2011.5995347
Tzutalin. (2024). LabelImg: Graphical image annotation tool [Computer software]. GitHub. https://github.com/HumanSignal/labelImg
Ultralytics. (2023). Ultralytics YOLOv8 [Computer software]. GitHub. https://github.com/ultralytics/ultralytics
Usuyama, N., Larios Delgado, N., Hall, A. K., & Lundin, J. (2020). ePillID dataset: A low-shot fine-grained benchmark for pill identification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (pp. 3971–3977). https://doi.org/10.1109/CVPRW50498.2020.00463
World Health Organization. (2024). Medication without harm: Policy brief. World Health Organization. https://www.who.int/publications/i/item/9789240062764
Yaniv, Z., Faruque, J., Howe, S., Dunn, K., Sharlip, D., Bond, A., Perillan, P., Bodenreider, O., Ackerman, M. J., & Yoo, T. S. (2016). The National Library of Medicine Pill Image Recognition Challenge: An initial report. In Proceedings of the IEEE Applied Imagery Pattern Recognition Workshop (pp. 1–9). https://doi.org/10.1109/AIPR.2016.8010584
Yue, X., Lyu, B., Li, H., Meng, L., & Furumoto, K. (2021). Real-time medicine packet recognition system in dispensing medicines for the elderly. Measurement: Sensors, 18, 100072. https://doi.org/10.1016/j.measen.2021.100072
Tan, L., Huangfu, T., Wu, L., & Chen, W. (2021). Comparison of RetinaNet, SSD, and YOLO v3 for real-time pill identification. BMC Medical Informatics and Decision Making, 21, 324. https://doi.org/10.1186/s12911-021-01691-8
Singh, L. G., & Middleton, S. E. (2025). Tabular context-aware optical character recognition and tabular data reconstruction for historical records. International Journal on Document Analysis and Recognition (IJDAR), 28(3), 357–376. https://doi.org/10.1007/s10032-025-00543-9
Qory Hidayati , Department of Electrical Engineering, Faculty of Intelligent Electrical and Informatics Technology (F-ELECTICS), Institut Teknologi Sepuluh Nopember, Surabaya, Indonesia
Department of Electrical Engineering, Balikpapan State Polytechnic, Balikpapan, Indonesia







