{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,10,15]],"date-time":"2026-10-15T20:06:28Z","timestamp":1792094788177,"version":"4.4.0"},"reference-count":32,"publisher":"JMIR Publications Inc.","content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["JMIR AI"],"abstract":"<jats:title>Abstract<\/jats:title>\n                  <jats:sec sec-type=\"background\">\n                    <jats:title>Background<\/jats:title>\n                    <jats:p>Medication adherence remains a significant concern in both clinical practice and public health. Nonadherence to prescribed medication regimens is associated with poorer health outcomes, higher rates of hospitalization, and increased financial burdens on health care systems. Despite its critical role in ensuring treatment efficacy, adherence assessment is still largely dependent on patient self-reports, pharmacy refill records, or caregiver observations\u2014methods that are often subjective, inconsistent, and unreliable. Therefore, there is an urgent need for objective, automated solutions to accurately monitor medication, particularly the information on the pills taken and intake behavior. AI techniques, especially computer vision, are promising solutions; however, their application in assessing medication adherence has several key pitfalls in maintaining robustness under environmental variation that limit their reliability and real-world applicability.<\/jats:p>\n                  <\/jats:sec>\n                  <jats:sec sec-type=\"objective\">\n                    <jats:title>Objective<\/jats:title>\n                    <jats:p>This study aimed to develop a reliable and accurate computer vision framework for pill detection and counting using mobile phone images captured under diverse real-world conditions to support medication adherence assessment.<\/jats:p>\n                  <\/jats:sec>\n                  <jats:sec sec-type=\"methods\">\n                    <jats:title>Methods<\/jats:title>\n                    <jats:p>This study is carried out using a public dataset on pill detection (N=152) and a curated dataset (N=60) on medication adherence assessment. Inspired by mixture of experts (MoE), we propose and implement a robust pill detection framework that integrates two expert-level object detection models, You Only Look Once (YOLOv12) and Faster Region-based Convolutional Neural Network (Faster R-CNN), with a Segment Anything Model (SAM). The pill counting performance was evaluated using mean absolute error (MAE) and accuracy. We further conduct a pilot study on a curated dataset that mimics a subject taking medicine for a period of 20 days. We evaluate sensitivity and specificity in medication adherence assessment.<\/jats:p>\n                  <\/jats:sec>\n                  <jats:sec sec-type=\"results\">\n                    <jats:title>Results<\/jats:title>\n                    <jats:p>\n                      The proposed multimodel framework substantially reduces both error types, achieving a low MAE of 0.167 on the Kaggle test set in pill counting and an accuracy of 0.933 in pill detection. In medication adherence simulation, the proposed framework achieves high accuracy (0.917), sensitivity (0.933), and specificity (0.900), significantly outperforming the evaluated YOLOv12 and Faster R-CNN baselines (\n                      <jats:italic>P<\/jats:italic>\n                      &lt;.05). Performance remained robust on the self-collected dataset in medication-taking scenarios in the settings of household, restaurant, office, and outdoor environments.\n                    <\/jats:p>\n                  <\/jats:sec>\n                  <jats:sec sec-type=\"conclusions\">\n                    <jats:title>Conclusions<\/jats:title>\n                    <jats:p>The proposed framework achieved high performance in pill counting, detection, and simulated medication-adherence classification. This proof-of-concept study has demonstrated the potential to enhance medication adherence among patients and support more reliable treatment monitoring.<\/jats:p>\n                  <\/jats:sec>","DOI":"10.2196\/92528","type":"journal-article","created":{"date-parts":[[2026,8,18]],"date-time":"2026-08-18T19:42:12Z","timestamp":1787082132000},"page":"e92528-e92528","source":"Crossref","is-referenced-by-count":1,"title":["Objective Assessment of Medication Adherence Through Automated Pill Detection Using a Computer Vision Framework: Development and Evaluation Study"],"prefix":"10.2196","volume":"5","author":[{"ORCID":"https:\/\/orcid.org\/0009-0001-9141-2259","authenticated-orcid":false,"given":"Haozhe","family":"Liu","sequence":"first","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-8400-1398","authenticated-orcid":false,"given":"Yaguang","family":"Zheng","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-6891-244X","authenticated-orcid":false,"given":"Bei","family":"Wu","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-3409-3412","authenticated-orcid":false,"given":"Yu","family":"Gan","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"1010","published-online":{"date-parts":[[2026,8,18]]},"reference":[{"issue":"3","key":"R1","doi-asserted-by":"publisher","first-page":"155","DOI":"10.5001\/omj.2011.38","article-title":"Patient medication adherence: measures in daily practice","volume":"26","author":"Jimmy","journal-title":"Oman Med J"},{"issue":"5","key":"R2","doi-asserted-by":"publisher","first-page":"691","DOI":"10.1111\/j.1365-2125.2012.04167.x","article-title":"A new taxonomy for describing and defining adherence to medications","volume":"73","author":"Vrijens","journal-title":"Br J Clin Pharmacol"},{"issue":"3","key":"R3","doi-asserted-by":"publisher","first-page":"207","DOI":"10.1111\/j.1547-5069.2003.tb00001.x","article-title":"Adherence to long-term therapies: evidence for action","volume":"35","author":"Burkhart","journal-title":"J Nurs Scholarsh"},{"issue":"5","key":"R4","doi-asserted-by":"publisher","first-page":"487","DOI":"10.1056\/NEJMra050100","article-title":"Adherence to medication","volume":"353","author":"Osterberg","journal-title":"N Engl J Med"},{"issue":"7","key":"R5","doi-asserted-by":"publisher","first-page":"1124","DOI":"10.1161\/CIRCRESAHA.118.313220","article-title":"Adherence in hypertension","volume":"124","author":"Burnier","journal-title":"Circ Res"},{"key":"R6","doi-asserted-by":"publisher","DOI":"10.2147\/RMHP.S19801","article-title":"Adherence and health care costs","volume":"35","author":"McGuire","journal-title":"RMHP"},{"issue":"1","key":"R7","doi-asserted-by":"publisher","first-page":"153","DOI":"10.3390\/medicina61010153","article-title":"Enhancing therapy adherence: impact on clinical outcomes, healthcare costs, and patient quality of life","volume":"61","author":"Religioni","journal-title":"Medicina (B Aires)"},{"issue":"1","key":"R8","doi-asserted-by":"publisher","first-page":"2","DOI":"10.1177\/003335491212700102","article-title":"Medication adherence: helping patients take their medicines as directed","volume":"127","author":"Benjamin","journal-title":"Public Health Rep"},{"key":"R9","doi-asserted-by":"publisher","DOI":"10.1155\/2015\/217047","article-title":"Medication adherence measures: an overview","volume":"2015","author":"Lam","journal-title":"Biomed Res Int"},{"issue":"4","key":"R10","doi-asserted-by":"publisher","first-page":"470","DOI":"10.1007\/s13142-015-0315-2","article-title":"Self-report measures of medication adherence behavior: recommendations on optimal use","volume":"5","author":"Stirratt","journal-title":"Transl Behav Med"},{"issue":"3","key":"R11","doi-asserted-by":"publisher","first-page":"413","DOI":"10.1345\/aph.1L496","article-title":"Comparison of methods to assess medication adherence and classify nonadherence","volume":"43","author":"Hansen","journal-title":"Ann Pharmacother"},{"issue":"3","key":"R12","doi-asserted-by":"publisher","first-page":"165","DOI":"10.1016\/j.amjopharm.2012.04.004","article-title":"Medication adherence in older adults with cognitive impairment: a systematic evidence-based review","volume":"10","author":"Campbell","journal-title":"Am J Geriatr Pharmacother"},{"key":"R13","doi-asserted-by":"publisher","DOI":"10.21037\/jmai-21-26","article-title":"Application of machine learning in predicting medication adherence of patients with cardiovascular diseases: a systematic review of the literature","volume":"5","author":"Zakeri","journal-title":"J Med Artif Intell"},{"issue":"4","key":"R14","doi-asserted-by":"publisher","DOI":"10.2196\/26993","article-title":"Machine learning and medication adherence: scoping review","volume":"2","author":"Bohlmann","journal-title":"JMIRx Med"},{"issue":"1","key":"R15","doi-asserted-by":"publisher","DOI":"10.1038\/s41746-018-0029-1","article-title":"Scalable and accurate deep learning with electronic health records","volume":"1","author":"Rajkomar","journal-title":"NPJ Digit Med"},{"key":"R16","doi-asserted-by":"publisher","DOI":"10.3389\/fdgth.2021.669869","article-title":"Artificial intelligence solutions to increase medication adherence in patients with non-communicable diseases","volume":"3","author":"Babel","journal-title":"Front Digit Health"},{"issue":"3","key":"R17","doi-asserted-by":"publisher","first-page":"56","DOI":"10.3390\/informatics8030056","article-title":"Application of machine learning methods on patient reported outcome measurements for predicting outcomes: a literature review","volume":"8","author":"Verma","journal-title":"Informatics"},{"issue":"6","key":"R18","doi-asserted-by":"publisher","first-page":"395","DOI":"10.1038\/nrg3208","article-title":"Mining electronic health records: towards better research applications and clinical care","volume":"13","author":"Jensen","journal-title":"Nat Rev Genet"},{"issue":"8","key":"R19","doi-asserted-by":"publisher","DOI":"10.7759\/cureus.90837","article-title":"Assessment of pitfalls in an AI-based pill-counting application","volume":"17","author":"Tanamachi","journal-title":"Cureus"},{"key":"R20","doi-asserted-by":"publisher","DOI":"10.2196\/41043","article-title":"An accurate deep learning-based system for automatic pill identification: model development and validation","volume":"25","author":"Heo","journal-title":"J Med Internet Res"},{"issue":"19","key":"R21","doi-asserted-by":"publisher","first-page":"9065","DOI":"10.3390\/app14199065","article-title":"Combination pattern method using deep learning for pill classification","volume":"14","author":"Kim","journal-title":"Applied Sciences"},{"issue":"1","key":"R22","doi-asserted-by":"publisher","DOI":"10.1186\/s12911-021-01691-8","article-title":"Comparison of RetinaNet, SSD, and YOLO v3 for real-time pill identification","volume":"21","author":"Tan","journal-title":"BMC Med Inform Decis Mak"},{"key":"R23","doi-asserted-by":"crossref","unstructured":"Rahman M Alpaslan N Bhattacharya P . Developing a retrieval based diagnostic aid for automated melanoma recognition of dermoscopic images. Presented at: 2016 IEEE Applied Imagery Pattern Recognition Workshop (AIPR); 1-7; Washington, DC, USA. 2016.[doi: 10.1109\/AIPR.2016.8010594]","DOI":"10.1109\/AIPR.2016.8010594"},{"issue":"1","key":"R24","doi-asserted-by":"publisher","DOI":"10.1038\/s41746-019-0086-0","article-title":"Fast and accurate medication identification","volume":"2","author":"Larios Delgado","journal-title":"NPJ Digit Med"},{"issue":"7","key":"R25","doi-asserted-by":"publisher","first-page":"1410","DOI":"10.1016\/j.pec.2017.02.001","article-title":"Medication adherence: a practical measurement selection guide using case studies","volume":"100","author":"Zullig","journal-title":"Patient Educ Couns"},{"key":"R26","doi-asserted-by":"crossref","unstructured":"Dang B Zhao W Li Y Ma D Yu Q Zhu EY . Real-time pill identification for the visually impaired using deep learning. arXiv. Preprint posted online on May 8, 2024. [doi: 10.48550\/arXiv.2405.05983]","DOI":"10.1109\/CISCE62493.2024.10653353"},{"key":"R27","unstructured":"Shazeer N Mirhoseini A Maziarz K et al. Outrageously large neural networks: the sparsely-gated mixture-of-experts layer. arXiv. Preprint posted online on Jan 23, 2017. [doi: 10.48550\/arXiv.1701.06538]"},{"key":"R28","doi-asserted-by":"crossref","unstructured":"Tian Y Ye Q Doermann D . YOLOv12: attention-centric real-time object detectors. arXiv. Preprint posted online on Feb 18, 2025. [doi: 10.48550\/arXiv.2502.12524]","DOI":"10.52202\/085713-2627"},{"key":"R29","unstructured":"Ren S He K Girshick R Sun J . Faster r-CNN: towards real-time object detection with region proposal networks. arXiv. Preprint posted online on Jun 4, 2015. [doi: 10.48550\/arXiv.1506.01497]"},{"key":"R30","unstructured":"Kirillov A Mintun E Ravi N et al. Segment anything. arXiv. Preprint posted online on Apr 5, 2023. [doi: 10.48550\/arXiv.2304.02643]"},{"key":"R31","unstructured":"Deepak R . Pills detection dataset. Kaggle; 2022. URL: https:\/\/www.kaggle.com\/datasets\/perfect9015\/pillsdetectiondataset [Accessed 18-11-2025]"},{"key":"R32","doi-asserted-by":"crossref","unstructured":"Chen Y Li W Sakaridis C Dai D Van Gool L . Domain adaptive faster r-CNN for object detection in the wild. arXiv. Preprint posted online on Mar 8, 2018. [doi: 10.48550\/arXiv.1803.03243]","DOI":"10.1109\/CVPR.2018.00352"}],"container-title":["JMIR AI"],"original-title":[],"language":"en","deposited":{"date-parts":[[2026,8,18]],"date-time":"2026-08-18T19:42:18Z","timestamp":1787082138000},"score":1,"resource":{"primary":{"URL":"https:\/\/ai.jmir.org\/2026\/1\/e92528"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,8,18]]},"references-count":32,"URL":"https:\/\/doi.org\/10.2196\/92528","relation":{},"ISSN":["2817-1705"],"issn-type":[{"value":"2817-1705","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,8,18]]},"article-number":"v5i3e92528"}}