<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.0 20040830//EN" "journalpublishing.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="2.0" xml:lang="en" article-type="research-article"><front><journal-meta><journal-id journal-id-type="nlm-ta">JMIR AI</journal-id><journal-id journal-id-type="publisher-id">ai</journal-id><journal-id journal-id-type="index">41</journal-id><journal-title>JMIR AI</journal-title><abbrev-journal-title>JMIR AI</abbrev-journal-title><issn pub-type="epub">2817-1705</issn><publisher><publisher-name>JMIR Publications</publisher-name><publisher-loc>Toronto, Canada</publisher-loc></publisher></journal-meta><article-meta><article-id pub-id-type="publisher-id">v5i1e92528</article-id><article-id pub-id-type="doi">10.2196/92528</article-id><article-categories><subj-group subj-group-type="heading"><subject>Original Paper</subject></subj-group></article-categories><title-group><article-title>Objective Assessment of Medication Adherence Through Automated Pill Detection Using a Computer Vision Framework: Development and Evaluation Study</article-title></title-group><contrib-group><contrib contrib-type="author"><name name-style="western"><surname>Liu</surname><given-names>Haozhe</given-names></name><degrees>MS</degrees><xref ref-type="aff" rid="aff1">1</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Zheng</surname><given-names>Yaguang</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff2">2</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Wu</surname><given-names>Bei</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff3">3</xref></contrib><contrib contrib-type="author" corresp="yes"><name name-style="western"><surname>Gan</surname><given-names>Yu</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff4">4</xref><xref ref-type="aff" rid="aff5">5</xref></contrib></contrib-group><aff id="aff1"><institution>Department of Biomedical Engineering, Stevens Institute of Technology</institution><addr-line>Hoboken</addr-line><addr-line>NJ</addr-line><country>United States</country></aff><aff id="aff2"><institution>Rory Meyers College of Nursing, New York University</institution><addr-line>New York</addr-line><addr-line>NY</addr-line><country>United States</country></aff><aff id="aff3"><institution>Faculty of Arts and Science, New York University Shanghai</institution><addr-line>Shanghai</addr-line><country>China</country></aff><aff id="aff4"><institution>Fischell Department of Bioengineering, University of Maryland</institution><addr-line>3102 A. James Clark Hall</addr-line><addr-line>College Park</addr-line><addr-line>MD</addr-line><country>United States</country></aff><aff id="aff5"><institution>Artificial Intelligence Interdisciplinary Institute at Maryland, University of Maryland</institution><addr-line>College Park</addr-line><addr-line>MD</addr-line><country>United States</country></aff><contrib-group><contrib contrib-type="editor"><name name-style="western"><surname>Steenstra</surname><given-names>Ivan</given-names></name></contrib></contrib-group><contrib-group><contrib contrib-type="reviewer"><name name-style="western"><surname>Pinto</surname><given-names>Gabriel</given-names></name></contrib><contrib contrib-type="reviewer"><name name-style="western"><surname>Cook</surname><given-names>Paul</given-names></name></contrib></contrib-group><author-notes><corresp>Correspondence to Yu Gan, PhD, Fischell Department of Bioengineering, University of Maryland, 3102 A. James Clark Hall, College Park, MD, 20742, United States, 1 2012165593; <email>yugan@umd.edu</email></corresp></author-notes><pub-date pub-type="collection"><year>2026</year></pub-date><pub-date pub-type="epub"><day>18</day><month>8</month><year>2026</year></pub-date><volume>5</volume><elocation-id>e92528</elocation-id><history><date date-type="received"><day>30</day><month>01</month><year>2026</year></date><date date-type="rev-recd"><day>13</day><month>07</month><year>2026</year></date><date date-type="accepted"><day>13</day><month>07</month><year>2026</year></date></history><copyright-statement>&#x00A9; Haozhe Liu, Yaguang Zheng, Bei Wu, Yu Gan. Originally published in JMIR AI (<ext-link ext-link-type="uri" xlink:href="https://ai.jmir.org">https://ai.jmir.org</ext-link>), 18.8.2026. </copyright-statement><copyright-year>2026</copyright-year><license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by/4.0/"><p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (<ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</ext-link>), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work, first published in JMIR AI, is properly cited. The complete bibliographic information, a link to the original publication on <ext-link ext-link-type="uri" xlink:href="https://www.ai.jmir.org/">https://www.ai.jmir.org/</ext-link>, as well as this copyright and license information must be included.</p></license><self-uri xlink:type="simple" xlink:href="https://ai.jmir.org/2026/1/e92528"/><abstract><sec><title>Background</title><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&#x2014;methods 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.</p></sec><sec><title>Objective</title><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.</p></sec><sec sec-type="methods"><title>Methods</title><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.</p></sec><sec sec-type="results"><title>Results</title><p>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 (<italic>P</italic>&#x003C;.05). Performance remained robust on the self-collected dataset in medication-taking scenarios in the settings of household, restaurant, office, and outdoor environments.</p></sec><sec sec-type="conclusions"><title>Conclusions</title><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.</p></sec></abstract><kwd-group><kwd>medication adherence</kwd><kwd>pill detection</kwd><kwd>pill counting</kwd><kwd>computer vision</kwd><kwd>digital health</kwd><kwd>Object Detection</kwd><kwd>Image Segmentation</kwd></kwd-group></article-meta></front><body><sec id="s1" sec-type="intro"><title>Introduction</title><sec id="s1-1"><title>Background</title><p>Medication adherence refers to the degree individuals follow prescribed medication regimens in terms of timing, dosage, and frequency [<xref ref-type="bibr" rid="ref1">1</xref>]. Adherence to the treatment regimen is a critical determinant of treatment effectiveness and long-term health outcomes [<xref ref-type="bibr" rid="ref2">2</xref>]. Medication nonadherence remains a significant concern in clinical practice and public health, particularly for patients with chronic conditions such as diabetes, hypertension, and cardiovascular disease [<xref ref-type="bibr" rid="ref3">3</xref>-<xref ref-type="bibr" rid="ref5">5</xref>]. Nonadherence to prescribed medication regimens contributes to poorer health outcomes, increased rates of hospitalization, and substantial financial burdens on both patients and the health care system [<xref ref-type="bibr" rid="ref6">6</xref>,<xref ref-type="bibr" rid="ref7">7</xref>]. Prior studies have estimated that nonadherence to prescribed medications is associated with approximately 125,000 preventable deaths annually and contributes to US $100&#x2010;300 billion when both direct and indirect costs are included [<xref ref-type="bibr" rid="ref8">8</xref>].</p><p>Given the critical role adherence plays in treatment efficacy, accurately assessing medication adherence is essential. However, current monitoring approaches are largely based on patient self-reports, pharmacy refill data, or caregiver observation [<xref ref-type="bibr" rid="ref9">9</xref>]. These methods are often unreliable, subjective, and prone to recall bias [<xref ref-type="bibr" rid="ref10">10</xref>,<xref ref-type="bibr" rid="ref11">11</xref>]. This challenge is further intensified by the growing number of older adults with cognitive impairment, who may have even greater difficulty managing complex medication regimens [<xref ref-type="bibr" rid="ref12">12</xref>]. As a result, there is an urgent need for objective, automated solutions to assess medication intake behavior accurately.</p></sec><sec id="s1-2"><title>AI in Medication Adherence</title><p>AI is a promising approach to objectively assessing medication adherence. Several studies have applied machine learning methods (eg, supervised learning, deep learning) to classify adherence status using self-reported adherence questionnaires [<xref ref-type="bibr" rid="ref13">13</xref>-<xref ref-type="bibr" rid="ref15">15</xref>] but such approaches remain highly dependent on self-reported input and can therefore be dramatically affected by reporting inaccuracies. Recently, computer vision models that analyze image- and video-based data provided by patients, such as photographs or short recordings of medications, have gained increasing attention. These models are particularly relevant in the management of noncommunicable diseases, such as cancer, cardiovascular disease, chronic respiratory disease, and diabetes [<xref ref-type="bibr" rid="ref16">16</xref>]. By automatically detecting and counting pills, identifying medication containers, or tracking medication-taking behaviors over time, these approaches attempt to provide a more objective and scalable means of adherence verification [<xref ref-type="bibr" rid="ref17">17</xref>,<xref ref-type="bibr" rid="ref18">18</xref>]. Among those tasks, pill detection and counting is one of the most critical tasks, as it reflects the dose of the medicine that is taken. Compared with patient-reported methods, vision-based deep learning techniques reduce reliance on patient self-reporting, offering the potential for more accurate, timely, and continuous assessment of medication adherence in real-world settings.</p><p>Presently, researchers have identified several key pitfalls of AI-based pill counting applications that limit their reliability and real-world usability [<xref ref-type="bibr" rid="ref19">19</xref>]. These challenges include sensitivity to lighting variation, background clutter, pill overlap and orientations, among others. Such limitations can lead to inaccurate pill counts and reduce the effectiveness of vision-based approaches for medication adherence assessment in unconstrained real-world settings.</p></sec><sec id="s1-3"><title>Goal of This Study</title><p>To address these limitations, this study aims to develop a reliable and accurate computer vision framework for pill detection and counting under diverse real-world imaging conditions to support objective medication adherence assessment. Specifically, we evaluate whether a multimodel design that integrates complementary object detectors, segmentation-based refinement, redundancy removal, and geometric validation can improve pill-counting accuracy and dose-level adherence classification compared with individual detector baselines.</p></sec><sec id="s1-4"><title>Related Work</title><sec id="s1-4-1"><title>Medication Adherence Monitoring Technologies</title><p>A range of technologies has been developed to monitor medication adherence, including self-reported questionnaires, pill counts, pharmacy refill records, caregiver observations, and electronic medication monitoring devices [<xref ref-type="bibr" rid="ref9">9</xref>-<xref ref-type="bibr" rid="ref11">11</xref>,<xref ref-type="bibr" rid="ref19">19</xref>,<xref ref-type="bibr" rid="ref20">20</xref>]. Although useful in clinical practice and research, many of these approaches provide only indirect or proxy measurements of medication-taking behavior; for example, self-reports are affected by recall and social-desirability bias, and pharmacy refill records confirm acquisition rather than correct dosing. Electronic monitoring systems, smart pill bottles, and smart medication adherence products can log container-opening events, reminders, dispensing records, or alerts [<xref ref-type="bibr" rid="ref19">19</xref>,<xref ref-type="bibr" rid="ref21">21</xref>] but these signals do not verify that the correct number of pills was removed, counted, or ingested. Existing adherence monitoring methods therefore remain limited when the goal is to directly assess dose-level medication intake.</p></sec><sec id="s1-4-2"><title>AI-Based Pill Identification, Detection, and Counting</title><p>Computer vision has been widely studied for pill identification, detection, and verification. Public challenges and deep learning methods have enabled matching of consumer pill images to reference images and improved pill identification from mobile or consumer-quality photographs [<xref ref-type="bibr" rid="ref22">22</xref>-<xref ref-type="bibr" rid="ref24">24</xref>]. These studies demonstrate the feasibility of AI-based pill image analysis but most target pill identity recognition rather than dose-level adherence assessment. Other work has addressed pill localization, verification, or counting in more structured settings, such as hospital pharmacy workflows, device-based pill verification, and general pill-counting applications [<xref ref-type="bibr" rid="ref19">19</xref>,<xref ref-type="bibr" rid="ref25">25</xref>,<xref ref-type="bibr" rid="ref26">26</xref>]. While relevant to pill detection and medication safety, daily-life pill counting for dose-level adherence assessment remains underexplored. In this study, we focus on whether the visible pill count in patient-captured still images matches the prescribed dosage under realistic daily conditions.</p></sec></sec></sec><sec id="s2" sec-type="methods"><title>Methods</title><sec id="s2-1"><title>Development of Computer Vision Models</title><p>We develop a multimodel framework that integrates two well-established object detection models and one segmentation model, inspired by the concept of Mixture of Experts (MoE) [<xref ref-type="bibr" rid="ref27">27</xref>]. As shown in <xref ref-type="fig" rid="figure1">Figure 1</xref>, three models You Only Look Once (YOLOv12) [<xref ref-type="bibr" rid="ref28">28</xref>], Faster Region-based Convolutional Neural Network (Faster R-CNN) [<xref ref-type="bibr" rid="ref29">29</xref>], and Segment Anything Model (SAM) [<xref ref-type="bibr" rid="ref30">30</xref>] serve as three experts for decision making. Two stages are involved, where the first stage roughly identifies the region of interest within the human hand, and the second stage refines pill counts within the candidate regions via pixel-wise segmentation. In the first stage, two individual detectors aim to reduce reliance on a single detection paradigm and improve coverage across heterogeneous visual patterns. In the second stage, a detection-guided segmentation strategy leverages the generalization capability of SAM, a foundation model trained on large-scale real-world image data, to enable robust segmentation across diverse imaging conditions without requiring task-specific training. This modular design supports reliable performance in complex real-world environments and facilitates adaptation to different medication-taking scenarios. Potential regions of interest identified in the first stage are used as prompts to generate pill masks, which substantially reduces the computational cost of SAM while enabling efficient and accurate segmentation. This mask generation step enables accurate delineation of object boundaries and contributes to robust pill detection under complex real-world photographing conditions while supporting real-time inference. Those two stages are optimized using redundant detection removal after object detection and shape smoothness check after pill segmentation. If the intersection over union (IoU) between two segmentation masks exceeded 0.8, the corresponding bounding box detections are considered to represent the same pill instance and are merged into a single detection, and the mask with the higher confidence score and greater geometric plausibility is retained. To further suppress false positives caused by background artifacts, a shape smoothness check module is developed to confirm the segmented region follows the round shape of a medical pill.</p><fig position="float" id="figure1"><label>Figure 1.</label><caption><p>Overview of the proposed framework for medication adherence. Faster R-CNN: Faster Region-based Convolutional Neural Network; YOLOv12: You Only Look Once version 12.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="ai_v5i1e92528_fig01.png"/></fig><p>Specifically, YOLOv12 and Faster R-CNN are applied in parallel and independently to each input image, and their candidate bounding boxes are combined into a unified candidate region set rather than being processed sequentially. Each candidate box is then used as a prompt for SAM to generate a corresponding segmentation mask, and disagreements between the two detectors are resolved after segmentation through the mask-level redundancy removal and geometric shape validation described above, which prevents the same pill from being counted multiple times. This detector-prompted SAM strategy enables the framework to refine candidate pill regions at the pixel level while preserving the complementary detection patterns of the one-stage and two-stage detectors.</p></sec><sec id="s2-2"><title>Dataset Collection</title><p>We use a public dataset to evaluate the performance of pill detection and counting and a self-collected dataset to evaluate the performance of medication adherence assessment. A total of 152 images were obtained from a publicly available Kaggle dataset [<xref ref-type="bibr" rid="ref31">31</xref>]. The dataset is randomly split into 10:2:3 for training, validation, and testing. We further evaluate our framework in a longitudinal medication adherence scenario. Specifically, the medication adherence scenarios cover four representative environment settings (ie, home, office, restaurant, and outdoor). The curated longitudinal medication adherence dataset included 60 images simulating a 20-day medication-taking scenario with three doses per day. The prescribed dose was four pills per image. Among these images, 30 were adherent cases with exactly four visible pills, and 30 were non-adherent cases with pill counts differing from the prescribed dose, including 18 under-dosing cases (1&#x2010;3 pills), 1 missed-dose case (0 pills), and 11 over-dosing cases (5 or more pills). The non-adherent cases had true pill counts of 0 (n=1), 1 (n=4), 2 (n=9), 3 (n=5), 5 (n=5), 6 (n=2), 7 (n=1), 8 (n=1), 9 (n=1), and 10 (n=1). This distribution was used to evaluate whether the framework could distinguish correct dosing from under-dosing and over-dosing errors.</p></sec><sec id="s2-3"><title>Evaluation Metrics</title><p>We directly evaluate the performance of pill counting and detection at both pill level and dosage (ie, image) level. At pill level, we evaluate the pill counting performance using mean absolute error (MAE), defined as the absolute difference between predicted and reference pill counts. At dosage level, we evaluate the accuracy on whether the entire image can be correctly identified or not. At both levels, we compare performance with the conventional AI models, Faster R-CNN and YOLOv12. For longitudinal study, we focus on assessing adherence vs non-adherence. Specifically, we evaluate sensitivity and specificity. Sensitivity is measured as the percentage of times correctly identifying adherence. In contrast, specificity is measured as the percentage of times correctly identifying non-adherence (eg, if one takes five pills rather than the required dosage of four, our AI model can identify that the number of pills is five, then it is correctly classified as non-adherence). For both evaluations, the ground truth is human annotation on number of pills in the image.</p></sec><sec id="s2-4"><title>Statistical Analysis</title><p>Because the proposed framework and the baseline models (YOLOv12 and Faster R-CNN) were evaluated on the same images, paired statistical tests were used, and all comparisons were performed separately for the public Kaggle pill-detection dataset and the longitudinal medication-adherence dataset. For dosage-level (image-level) accuracy, the exact McNemar test was applied to the paired correct and incorrect classification outcomes of the proposed framework and each baseline, so that only discordant image pairs, those classified correctly by one method but not the other, contributed to the test statistic; because the number of discordant image pairs was small, the exact binomial form of the McNemar test was used rather than the <italic>&#x03C7;</italic><sup>2</sup> approximation. For pill counting, the per-image absolute counting error, defined as the absolute difference between the predicted and reference pill counts, was compared between the proposed framework and each baseline using the Wilcoxon signed-rank test, a non-parametric paired test that does not assume normally distributed differences. The same paired-testing procedure was applied to the adherence classification outcomes in the longitudinal medication-adherence dataset. All tests were two-sided, and statistical significance was defined as <italic>P</italic>&#x003C;.05.</p></sec><sec id="s2-5"><title>Ethical Considerations</title><p>This study used a publicly available pill image dataset and a curated simulated medication-adherence dataset created for prototype evaluation. Ethics approval was not required because the study did not involve patient participants, identifiable individuals, protected health information, clinical records, or real medication-use behavior. The curated images were collected only to simulate pill-counting and dose-level adherence scenarios for technical evaluation of the proposed computer vision framework.</p></sec></sec><sec id="s3" sec-type="results"><title>Results</title><sec id="s3-1"><title>Overall Performance in Pill Detection and Pill Counting</title><p>The proposed multi-model framework achieves a dosage-level accuracy of 0.933 with a pill-level MAE of 0.167, as shown in <xref ref-type="table" rid="table1">Table 1</xref>. Compared with single-model baselines on the same image set, Faster R-CNN achieved an accuracy of 0.733 with an MAE of 0.300, while YOLOv12 achieved an accuracy of 0.767 with the same MAE of 0.300. The proposed pill detection framework achieved higher accuracy than the comparison models. Specifically, it significantly outperformed Faster R-CNN, with McNemar test showing (<italic>P</italic>=.02) and the Wilcoxon signed-rank test showing (<italic>P</italic>=.03). It also significantly outperformed YOLOv12, with McNemar test showing (<italic>P</italic>=.02) and the Wilcoxon signed-rank test showing (<italic>P</italic>=.03). Since all reported <italic>P</italic> values were below .05, these results indicate that the performance improvements of the proposed framework over both baseline models were statistically significant. The highest accuracy and lowest MAE obtained from our framework indicates a superior performance over existing single AI models in pill counting. We also conducted an ablation study to evaluate the contribution of each component, as shown in <xref ref-type="table" rid="table1">Table 1</xref>. The individual detectors achieved an MAE of 0.300 and dosage-level accuracies of 0.733&#x2010;0.767. Combining the two detectors with SAM-based refinement and mask-level redundancy removal reduced the MAE to 0.200 and increased the accuracy to 0.900, and adding geometric shape validation in the full framework further reduced the MAE to 0.167 and increased the accuracy to 0.933.</p><table-wrap id="t1" position="float"><label>Table 1.</label><caption><p>Pill detection performance and ablation study on the Kaggle test set, reporting pill-counting MAE<sup><xref ref-type="table-fn" rid="table1fn1">a</xref></sup> and dosage-level accuracy.</p></caption><table id="table1" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Method</td><td align="left" valign="bottom">SAM<sup><xref ref-type="table-fn" rid="table1fn2">b</xref></sup> refinement</td><td align="left" valign="bottom">Redundancy removal</td><td align="left" valign="bottom">Shape check</td><td align="left" valign="bottom">MAE</td><td align="left" valign="bottom">Accuracy</td></tr></thead><tbody><tr><td align="left" valign="top">YOLOv12<sup><xref ref-type="table-fn" rid="table1fn3">c</xref></sup></td><td align="left" valign="top">No</td><td align="left" valign="top">No</td><td align="left" valign="top">No</td><td align="left" valign="top">0.300</td><td align="left" valign="top">0.767</td></tr><tr><td align="left" valign="top">Faster R-CNN<sup><xref ref-type="table-fn" rid="table1fn4">d</xref></sup></td><td align="left" valign="top">No</td><td align="left" valign="top">No</td><td align="left" valign="top">No</td><td align="left" valign="top">0.300</td><td align="left" valign="top">0.733</td></tr><tr><td align="left" valign="top">YOLOv12 &#x0026; Faster R-CNN+ SAM + Redundancy removal</td><td align="left" valign="top">Yes</td><td align="left" valign="top">Yes</td><td align="left" valign="top">No</td><td align="left" valign="top">0.200</td><td align="left" valign="top">0.900</td></tr><tr><td align="left" valign="top">Full proposed method</td><td align="left" valign="top">Yes</td><td align="left" valign="top">Yes</td><td align="left" valign="top">Yes</td><td align="left" valign="top">0.167</td><td align="left" valign="top">0.933</td></tr></tbody></table><table-wrap-foot><fn id="table1fn1"><p><sup>a</sup>MAE: mean absolute error.</p></fn><fn id="table1fn2"><p><sup>b</sup>SAM: segment anything model.</p></fn><fn id="table1fn3"><p><sup>c</sup>YOLOv12: You Only Look Once version 12.</p></fn><fn id="table1fn4"><p><sup>d</sup>R-CNN: region-based convolutional neural network.</p></fn></table-wrap-foot></table-wrap><p>The detailed distribution of pill-count errors for Faster R-CNN, YOLOv12, and the proposed method on the test dataset is listed in <xref ref-type="fig" rid="figure2">Figure 2</xref>. We find that most misdetection cases deviate from the ground truth by only a small number of pills &#x00B1;1.</p><fig position="float" id="figure2"><label>Figure 2.</label><caption><p>Evaluation of the proposed method&#x2019;s performance compared to Faster R-CNN and YOLOv12 on the test dataset. Faster R-CNN: Faster Region-based Convolutional Neural Network; YOLOv12: You Only Look Once version 12.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="ai_v5i1e92528_fig02.png"/></fig><p>Representative results are shown in <xref ref-type="fig" rid="figure3">Figure 3</xref>. Faster R-CNN frequently misclassifies background regions with pill-like appearance as pills and occasionally fails to detect all pills in the scene (<xref ref-type="fig" rid="figure3">Figure 3A</xref>). YOLOv12 reduces background false positives but tends to generate multiple overlapping bounding boxes for the same pill when pills are closely clustered, leading to over-counting errors as shown in <xref ref-type="fig" rid="figure3">Figure 3B</xref>. <xref ref-type="fig" rid="figure3">Figure 3C</xref> illustrates the segmentation results produced by SAM using detection bounding boxes as prompts, which provide improved boundary delineation but do not directly resolve redundancy or misclassification issues. By integrating individual detections from YOLOv12 and Faster R-CNN with SAM-based refinement and geometric validation, the proposed framework (<xref ref-type="fig" rid="figure3">Figure 3D</xref>) effectively suppresses redundant detections and removes spurious background regions, resulting in more accurate pill localization and counting.</p><fig position="float" id="figure3"><label>Figure 3.</label><caption><p>(<bold>A</bold>) Faster R-CNN detection results; (<bold>B</bold>) YOLOv12 detection results; (<bold>C</bold>) SAM segmentation results using bounding boxes as prompts; (<bold>D</bold>) Detection results from our improved multimodel framework. R-CNN: Faster Region-based Convolutional Neural Network; SAM: segment anything model; YOLOv12: You Only Look Once version 12.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="ai_v5i1e92528_fig03.png"/></fig></sec><sec id="s3-2"><title>Longitudinal Medication Adherence Assessment</title><p>Adherence assessment examines whether we can automatically determine if the subject follows the prescription (ie, four pills per dose) from the image. As illustrated in <xref ref-type="table" rid="table2">Table 2</xref>, the proposed multimodel framework achieved an overall accuracy of 91.67%, with a sensitivity of 93.33% for detecting adherent cases and a specificity of 90.00% for identifying nonadherent cases. In comparison, we observe that YOLOv12 and Faster R-CNN show limited generalizability when evaluated in adherence simulation test on real-world datasets. This observation is consistent with prior findings showing that standard Faster R-CNN detectors often experience significant performance degradation under real-world domain shifts [<xref ref-type="bibr" rid="ref32">32</xref>]. By incorporating the SAM foundation model trained on large-scale real-world data, the proposed framework demonstrates robustness across diverse real-world imaging conditions. Notably, the Faster R-CNN has much lower performance in our curated dataset than in <xref ref-type="table" rid="table1">Table 1</xref>, because it has limited generalizability to identify pills obtained in various scenarios, such as outdoor, office, restaurant, etc. This pilot study shows that the proposed framework can robustly support automated medication adherence assessment by accurately distinguishing compliant and noncompliant pill-taking behaviors in real-world imaging conditions.</p><table-wrap id="t2" position="float"><label>Table 2.</label><caption><p>Adherence assessment performance on curated dataset.</p></caption><table id="table2" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Metrics</td><td align="left" valign="bottom">Proposed</td><td align="left" valign="bottom">YOLOv12<sup><xref ref-type="table-fn" rid="table2fn1">a</xref></sup></td><td align="left" valign="bottom">Faster R-CNN<sup><xref ref-type="table-fn" rid="table2fn2">b</xref></sup></td></tr></thead><tbody><tr><td align="left" valign="top">Accuracy</td><td align="left" valign="top">0.917</td><td align="left" valign="top">0.600</td><td align="left" valign="top">0.183</td></tr><tr><td align="left" valign="top">Sensitivity</td><td align="left" valign="top">0.933</td><td align="left" valign="top">0.467</td><td align="left" valign="top">0.067</td></tr><tr><td align="left" valign="top">Specificity</td><td align="left" valign="top">0.900</td><td align="left" valign="top">0.733</td><td align="left" valign="top">0.300</td></tr></tbody></table><table-wrap-foot><fn id="table2fn1"><p><sup>a</sup>YOLOv12: You Only Look Once version 12.</p></fn><fn id="table2fn2"><p><sup>b</sup>R-CNN: Region-based Convolutional Neural Network</p></fn></table-wrap-foot></table-wrap><p>We additionally evaluated the proposed framework across common pill-taking environments that represent typical medication-taking scenarios. Pill images were collected in diverse locations frequently encountered in daily life, such as at home, office, outdoor, and restaurant. Those images cover scenarios that are dark (<xref ref-type="fig" rid="figure4">Figure 4A</xref>) and bright (<xref ref-type="fig" rid="figure4">Figure 4B</xref>). The shape of pills is also included in capsules (<xref ref-type="fig" rid="figure4">Figure 4A</xref>), round (<xref ref-type="fig" rid="figure4">Figure 4A</xref>), triangles (<xref ref-type="fig" rid="figure4">Figure 4B</xref>), and oblong (<xref ref-type="fig" rid="figure4">Figure 4C,D</xref>). As shown in <xref ref-type="fig" rid="figure4">Figure 4</xref>, our framework correctly identified number of pills among those scenarios. These experiments show the stability under realistic environmental variations beyond controlled test conditions. The results also show capability of detecting pills that are occluded. The proposed framework consistently maintained reliable detection and counting performance across these scenarios.</p><fig position="float" id="figure4"><label>Figure 4.</label><caption><p>Representative examples of pill detection results in common real-world medication-taking environments, including (A) home, (B) office, (C) outdoor, and D) restaurant settings.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="ai_v5i1e92528_fig04.png"/></fig></sec></sec><sec id="s4" sec-type="discussion"><title>Discussion</title><sec id="s4-1"><title>Summary</title><p>This proof-of-concept study developed and evaluated a multimodel computer vision framework for pill detection and counting to support objective medication adherence assessment. The proposed framework achieved low pill-counting error and high dosage-level classification accuracy on both a public pill dataset and a curated longitudinal adherence simulation. These findings suggest that combining YOLOv12, Faster R-CNN, SAM-based segmentation refinement, redundancy removal, and geometric validation can improve still-image-based pill counting under daily-life imaging conditions.</p><p>The proposed approach addresses an important gap in medication adherence monitoring. Many existing adherence monitoring methods rely on indirect or proxy-based signals, such as self-report, pharmacy refill records, caregiver observation, electronic monitoring devices, and smart pill bottles. Although useful, these methods may not directly verify the visible pill count or dose-level correctness. In this study, the proposed framework outperformed the evaluated YOLOv12 and Faster R-CNN baselines, suggesting its potential for detecting both under-dosing and over-dosing scenarios.</p></sec><sec id="s4-2"><title>Limitations</title><p>This study has several limitations. First, the adherence scenario was simulated and did not involve real patient medication-taking behavior. Second, the curated dataset was modest in size and included limited pill appearances and imaging environments. Third, the current framework evaluates visible pill count but does not verify actual ingestion. Future studies should validate this approach in larger real-world human-subject cohorts and explore integration with longitudinal, privacy-preserving adherence monitoring workflows.</p></sec><sec id="s4-3"><title>Conclusions</title><p>This study presents a multimodel computer vision framework for objective, image-based medication adherence assessment. The results suggest that still-image-based pill detection and counting may serve as a useful component of scalable digital health tools for dose-level adherence monitoring. Larger real-world studies are needed to evaluate generalizability, usability, and clinical integration.</p></sec></sec></body><back><ack><p>GPT-5 (OpenAI) were used only for language editing and grammar refinement. All scientific content, analyses, interpretations, and conclusions were developed, verified, and approved by the authors. The authors take full responsibility for the content of the manuscript.</p><p/></ack><notes><sec><title>Funding</title><p>This material is based upon work supported by the National Science Foundation under Award No. 2239810.</p></sec></notes><fn-group><fn fn-type="conflict"><p>None declared.</p></fn></fn-group><glossary><title>Abbreviations</title><def-list><def-item><term id="abb1">AI</term><def><p>Artificial Intelligence</p></def></def-item><def-item><term id="abb2">IoU</term><def><p>intersection over union</p></def></def-item><def-item><term id="abb3">MAE</term><def><p>Mean Absolute Error</p></def></def-item><def-item><term id="abb4">MoE</term><def><p>Mixture of Experts</p></def></def-item><def-item><term id="abb5">R-CNN</term><def><p>Region-based Convolutional Neural Network</p></def></def-item><def-item><term id="abb6">SAM</term><def><p>Segment Anything Model</p></def></def-item><def-item><term id="abb7">YOLOv12</term><def><p>You Only Look Once version 12</p></def></def-item></def-list></glossary><ref-list><title>References</title><ref id="ref1"><label>1</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Jimmy</surname><given-names>B</given-names> </name><name name-style="western"><surname>Jose</surname><given-names>J</given-names> </name></person-group><article-title>Patient medication adherence: measures in daily practice</article-title><source>Oman Med J</source><year>2011</year><month>05</month><volume>26</volume><issue>3</issue><fpage>155</fpage><lpage>159</lpage><pub-id pub-id-type="doi">10.5001/omj.2011.38</pub-id><pub-id pub-id-type="medline">22043406</pub-id></nlm-citation></ref><ref id="ref2"><label>2</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Vrijens</surname><given-names>B</given-names> </name><name name-style="western"><surname>De Geest</surname><given-names>S</given-names> </name><name name-style="western"><surname>Hughes</surname><given-names>DA</given-names> </name><etal/></person-group><article-title>A new taxonomy for describing and defining adherence to medications</article-title><source>Br J Clin Pharmacol</source><year>2012</year><month>05</month><volume>73</volume><issue>5</issue><fpage>691</fpage><lpage>705</lpage><pub-id pub-id-type="doi">10.1111/j.1365-2125.2012.04167.x</pub-id><pub-id pub-id-type="medline">22486599</pub-id></nlm-citation></ref><ref id="ref3"><label>3</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Burkhart</surname><given-names>PV</given-names> </name><name name-style="western"><surname>Sabat&#x00E9;</surname><given-names>E</given-names> </name></person-group><article-title>Adherence to long-term therapies: evidence for action</article-title><source>J Nurs Scholarsh</source><year>2003</year><volume>35</volume><issue>3</issue><fpage>207</fpage><pub-id pub-id-type="doi">10.1111/j.1547-5069.2003.tb00001.x</pub-id><pub-id pub-id-type="medline">14562485</pub-id></nlm-citation></ref><ref id="ref4"><label>4</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Osterberg</surname><given-names>L</given-names> </name><name name-style="western"><surname>Blaschke</surname><given-names>T</given-names> </name></person-group><article-title>Adherence to medication</article-title><source>N Engl J Med</source><year>2005</year><month>08</month><day>4</day><volume>353</volume><issue>5</issue><fpage>487</fpage><lpage>497</lpage><pub-id pub-id-type="doi">10.1056/NEJMra050100</pub-id><pub-id pub-id-type="medline">16079372</pub-id></nlm-citation></ref><ref id="ref5"><label>5</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Burnier</surname><given-names>M</given-names> </name><name name-style="western"><surname>Egan</surname><given-names>BM</given-names> </name></person-group><article-title>Adherence in hypertension</article-title><source>Circ Res</source><year>2019</year><month>03</month><day>29</day><volume>124</volume><issue>7</issue><fpage>1124</fpage><lpage>1140</lpage><pub-id pub-id-type="doi">10.1161/CIRCRESAHA.118.313220</pub-id><pub-id pub-id-type="medline">30920917</pub-id></nlm-citation></ref><ref id="ref6"><label>6</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>McGuire</surname><given-names>M</given-names> </name></person-group><article-title>Adherence and health care costs</article-title><source>RMHP</source><year>2014</year><month>02</month><volume>35</volume><fpage>35</fpage><pub-id pub-id-type="doi">10.2147/RMHP.S19801</pub-id></nlm-citation></ref><ref id="ref7"><label>7</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Religioni</surname><given-names>U</given-names> </name><name name-style="western"><surname>Barrios-Rodr&#x00ED;guez</surname><given-names>R</given-names> </name><name name-style="western"><surname>Requena</surname><given-names>P</given-names> </name><name name-style="western"><surname>Borowska</surname><given-names>M</given-names> </name><name name-style="western"><surname>Ostrowski</surname><given-names>J</given-names> </name></person-group><article-title>Enhancing therapy adherence: impact on clinical outcomes, healthcare costs, and patient quality of life</article-title><source>Medicina (B Aires)</source><year>2025</year><month>01</month><day>17</day><volume>61</volume><issue>1</issue><fpage>153</fpage><pub-id pub-id-type="doi">10.3390/medicina61010153</pub-id></nlm-citation></ref><ref id="ref8"><label>8</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Benjamin</surname><given-names>RM</given-names> </name></person-group><article-title>Medication adherence: helping patients take their medicines as directed</article-title><source>Public Health Rep</source><year>2012</year><volume>127</volume><issue>1</issue><fpage>2</fpage><lpage>3</lpage><pub-id pub-id-type="doi">10.1177/003335491212700102</pub-id><pub-id pub-id-type="medline">22298918</pub-id></nlm-citation></ref><ref id="ref9"><label>9</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Lam</surname><given-names>WY</given-names> </name><name name-style="western"><surname>Fresco</surname><given-names>P</given-names> </name></person-group><article-title>Medication adherence measures: an overview</article-title><source>Biomed Res Int</source><year>2015</year><volume>2015</volume><fpage>217047</fpage><pub-id pub-id-type="doi">10.1155/2015/217047</pub-id><pub-id pub-id-type="medline">26539470</pub-id></nlm-citation></ref><ref id="ref10"><label>10</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Stirratt</surname><given-names>MJ</given-names> </name><name name-style="western"><surname>Dunbar-Jacob</surname><given-names>J</given-names> </name><name name-style="western"><surname>Crane</surname><given-names>HM</given-names> </name><etal/></person-group><article-title>Self-report measures of medication adherence behavior: recommendations on optimal use</article-title><source>Transl Behav Med</source><year>2015</year><month>12</month><volume>5</volume><issue>4</issue><fpage>470</fpage><lpage>482</lpage><pub-id pub-id-type="doi">10.1007/s13142-015-0315-2</pub-id><pub-id pub-id-type="medline">26622919</pub-id></nlm-citation></ref><ref id="ref11"><label>11</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Hansen</surname><given-names>RA</given-names> </name><name name-style="western"><surname>Kim</surname><given-names>MM</given-names> </name><name name-style="western"><surname>Song</surname><given-names>L</given-names> </name><name name-style="western"><surname>Tu</surname><given-names>W</given-names> </name><name name-style="western"><surname>Wu</surname><given-names>J</given-names> </name><name name-style="western"><surname>Murray</surname><given-names>MD</given-names> </name></person-group><article-title>Comparison of methods to assess medication adherence and classify nonadherence</article-title><source>Ann Pharmacother</source><year>2009</year><month>03</month><volume>43</volume><issue>3</issue><fpage>413</fpage><lpage>422</lpage><pub-id pub-id-type="doi">10.1345/aph.1L496</pub-id><pub-id pub-id-type="medline">19261962</pub-id></nlm-citation></ref><ref id="ref12"><label>12</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Campbell</surname><given-names>NL</given-names> </name><name name-style="western"><surname>Boustani</surname><given-names>MA</given-names> </name><name name-style="western"><surname>Skopelja</surname><given-names>EN</given-names> </name><name name-style="western"><surname>Gao</surname><given-names>S</given-names> </name><name name-style="western"><surname>Unverzagt</surname><given-names>FW</given-names> </name><name name-style="western"><surname>Murray</surname><given-names>MD</given-names> </name></person-group><article-title>Medication adherence in older adults with cognitive impairment: a systematic evidence-based review</article-title><source>Am J Geriatr Pharmacother</source><year>2012</year><month>06</month><volume>10</volume><issue>3</issue><fpage>165</fpage><lpage>177</lpage><pub-id pub-id-type="doi">10.1016/j.amjopharm.2012.04.004</pub-id><pub-id pub-id-type="medline">22657941</pub-id></nlm-citation></ref><ref id="ref13"><label>13</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Zakeri</surname><given-names>M</given-names> </name><name name-style="western"><surname>Sansgiry</surname><given-names>SS</given-names> </name><name name-style="western"><surname>Abughosh</surname><given-names>SM</given-names> </name></person-group><article-title>Application of machine learning in predicting medication adherence of patients with cardiovascular diseases: a systematic review of the literature</article-title><source>J Med Artif Intell</source><year>2022</year><month>03</month><volume>5</volume><fpage>5</fpage><lpage>5</lpage><pub-id pub-id-type="doi">10.21037/jmai-21-26</pub-id></nlm-citation></ref><ref id="ref14"><label>14</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Bohlmann</surname><given-names>A</given-names> </name><name name-style="western"><surname>Mostafa</surname><given-names>J</given-names> </name><name name-style="western"><surname>Kumar</surname><given-names>M</given-names> </name></person-group><article-title>Machine learning and medication adherence: scoping review</article-title><source>JMIRx Med</source><year>2021</year><month>11</month><day>24</day><volume>2</volume><issue>4</issue><fpage>e26993</fpage><pub-id pub-id-type="doi">10.2196/26993</pub-id><pub-id pub-id-type="medline">37725549</pub-id></nlm-citation></ref><ref id="ref15"><label>15</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Rajkomar</surname><given-names>A</given-names> </name><name name-style="western"><surname>Oren</surname><given-names>E</given-names> </name><name name-style="western"><surname>Chen</surname><given-names>K</given-names> </name><etal/></person-group><article-title>Scalable and accurate deep learning with electronic health records</article-title><source>NPJ Digit Med</source><year>2018</year><volume>1</volume><issue>1</issue><fpage>18</fpage><pub-id pub-id-type="doi">10.1038/s41746-018-0029-1</pub-id><pub-id pub-id-type="medline">31304302</pub-id></nlm-citation></ref><ref id="ref16"><label>16</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Babel</surname><given-names>A</given-names> </name><name name-style="western"><surname>Taneja</surname><given-names>R</given-names> </name><name name-style="western"><surname>Mondello Malvestiti</surname><given-names>F</given-names> </name><name name-style="western"><surname>Monaco</surname><given-names>A</given-names> </name><name name-style="western"><surname>Donde</surname><given-names>S</given-names> </name></person-group><article-title>Artificial intelligence solutions to increase medication adherence in patients with non-communicable diseases</article-title><source>Front Digit Health</source><year>2021</year><volume>3</volume><fpage>669869</fpage><pub-id pub-id-type="doi">10.3389/fdgth.2021.669869</pub-id><pub-id pub-id-type="medline">34713142</pub-id></nlm-citation></ref><ref id="ref17"><label>17</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Verma</surname><given-names>D</given-names> </name><name name-style="western"><surname>Bach</surname><given-names>K</given-names> </name><name name-style="western"><surname>Mork</surname><given-names>PJ</given-names> </name></person-group><article-title>Application of machine learning methods on patient reported outcome measurements for predicting outcomes: a literature review</article-title><source>Informatics</source><year>2021</year><month>08</month><day>25</day><volume>8</volume><issue>3</issue><fpage>56</fpage><pub-id pub-id-type="doi">10.3390/informatics8030056</pub-id></nlm-citation></ref><ref id="ref18"><label>18</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Jensen</surname><given-names>PB</given-names> </name><name name-style="western"><surname>Jensen</surname><given-names>LJ</given-names> </name><name name-style="western"><surname>Brunak</surname><given-names>S</given-names> </name></person-group><article-title>Mining electronic health records: towards better research applications and clinical care</article-title><source>Nat Rev Genet</source><year>2012</year><month>05</month><day>2</day><volume>13</volume><issue>6</issue><fpage>395</fpage><lpage>405</lpage><pub-id pub-id-type="doi">10.1038/nrg3208</pub-id><pub-id pub-id-type="medline">22549152</pub-id></nlm-citation></ref><ref id="ref19"><label>19</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Tanamachi</surname><given-names>N</given-names> </name><name name-style="western"><surname>Amemiya</surname><given-names>T</given-names> </name><name name-style="western"><surname>Tomita</surname><given-names>T</given-names> </name></person-group><article-title>Assessment of pitfalls in an AI-based pill-counting application</article-title><source>Cureus</source><year>2025</year><month>08</month><volume>17</volume><issue>8</issue><fpage>e90837</fpage><pub-id pub-id-type="doi">10.7759/cureus.90837</pub-id><pub-id pub-id-type="medline">40995287</pub-id></nlm-citation></ref><ref id="ref20"><label>20</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Heo</surname><given-names>J</given-names> </name><name name-style="western"><surname>Kang</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Lee</surname><given-names>S</given-names> </name><name name-style="western"><surname>Jeong</surname><given-names>DH</given-names> </name><name name-style="western"><surname>Kim</surname><given-names>KM</given-names> </name></person-group><article-title>An accurate deep learning-based system for automatic pill identification: model development and validation</article-title><source>J Med Internet Res</source><year>2023</year><month>01</month><day>13</day><volume>25</volume><fpage>e41043</fpage><pub-id pub-id-type="doi">10.2196/41043</pub-id><pub-id pub-id-type="medline">36637893</pub-id></nlm-citation></ref><ref id="ref21"><label>21</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Kim</surname><given-names>S</given-names> </name><name name-style="western"><surname>Park</surname><given-names>EY</given-names> </name><name name-style="western"><surname>Kim</surname><given-names>JS</given-names> </name><name name-style="western"><surname>Ihm</surname><given-names>SY</given-names> </name></person-group><article-title>Combination pattern method using deep learning for pill classification</article-title><source>Applied Sciences</source><year>2024</year><month>10</month><day>8</day><volume>14</volume><issue>19</issue><fpage>9065</fpage><pub-id pub-id-type="doi">10.3390/app14199065</pub-id></nlm-citation></ref><ref id="ref22"><label>22</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Tan</surname><given-names>L</given-names> </name><name name-style="western"><surname>Huangfu</surname><given-names>T</given-names> </name><name name-style="western"><surname>Wu</surname><given-names>L</given-names> </name><name name-style="western"><surname>Chen</surname><given-names>W</given-names> </name></person-group><article-title>Comparison of RetinaNet, SSD, and YOLO v3 for real-time pill identification</article-title><source>BMC Med Inform Decis Mak</source><year>2021</year><month>11</month><day>22</day><volume>21</volume><issue>1</issue><fpage>324</fpage><pub-id pub-id-type="doi">10.1186/s12911-021-01691-8</pub-id><pub-id pub-id-type="medline">34809632</pub-id></nlm-citation></ref><ref id="ref23"><label>23</label><nlm-citation citation-type="confproc"><person-group person-group-type="author"><name name-style="western"><surname>Rahman</surname><given-names>M</given-names> </name><name name-style="western"><surname>Alpaslan</surname><given-names>N</given-names> </name><name name-style="western"><surname>Bhattacharya</surname><given-names>P</given-names> </name></person-group><article-title>Developing a retrieval based diagnostic aid for automated melanoma recognition of dermoscopic images</article-title><year>2016</year><conf-name>2016 IEEE Applied Imagery Pattern Recognition Workshop (AIPR)</conf-name><conf-loc>Washington, DC, USA</conf-loc><fpage>1</fpage><lpage>7</lpage><pub-id pub-id-type="doi">10.1109/AIPR.2016.8010594</pub-id></nlm-citation></ref><ref id="ref24"><label>24</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Larios Delgado</surname><given-names>N</given-names> </name><name name-style="western"><surname>Usuyama</surname><given-names>N</given-names> </name><name name-style="western"><surname>Hall</surname><given-names>AK</given-names> </name><etal/></person-group><article-title>Fast and accurate medication identification</article-title><source>NPJ Digit Med</source><year>2019</year><volume>2</volume><issue>1</issue><fpage>10</fpage><pub-id pub-id-type="doi">10.1038/s41746-019-0086-0</pub-id><pub-id pub-id-type="medline">31304359</pub-id></nlm-citation></ref><ref id="ref25"><label>25</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Zullig</surname><given-names>LL</given-names> </name><name name-style="western"><surname>Mendys</surname><given-names>P</given-names> </name><name name-style="western"><surname>Bosworth</surname><given-names>HB</given-names> </name></person-group><article-title>Medication adherence: a practical measurement selection guide using case studies</article-title><source>Patient Educ Couns</source><year>2017</year><month>07</month><volume>100</volume><issue>7</issue><fpage>1410</fpage><lpage>1414</lpage><pub-id pub-id-type="doi">10.1016/j.pec.2017.02.001</pub-id><pub-id pub-id-type="medline">28214168</pub-id></nlm-citation></ref><ref id="ref26"><label>26</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Dang</surname><given-names>B</given-names> </name><name name-style="western"><surname>Zhao</surname><given-names>W</given-names> </name><name name-style="western"><surname>Li</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Ma</surname><given-names>D</given-names> </name><name name-style="western"><surname>Yu</surname><given-names>Q</given-names> </name><name name-style="western"><surname>Zhu</surname><given-names>EY</given-names> </name></person-group><article-title>Real-time pill identification for the visually impaired using deep learning</article-title><source>arXiv</source><comment>Preprint posted online on  May 8, 2024</comment><pub-id pub-id-type="doi">10.48550/arXiv.2405.05983</pub-id></nlm-citation></ref><ref id="ref27"><label>27</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Shazeer</surname><given-names>N</given-names> </name><name name-style="western"><surname>Mirhoseini</surname><given-names>A</given-names> </name><name name-style="western"><surname>Maziarz</surname><given-names>K</given-names> </name><etal/></person-group><article-title>Outrageously large neural networks: the sparsely-gated mixture-of-experts layer</article-title><source>arXiv</source><comment>Preprint posted online on  Jan 23, 2017</comment><pub-id pub-id-type="doi">10.48550/arXiv.1701.06538</pub-id></nlm-citation></ref><ref id="ref28"><label>28</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Tian</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Ye</surname><given-names>Q</given-names> </name><name name-style="western"><surname>Doermann</surname><given-names>D</given-names> </name></person-group><article-title>YOLOv12: attention-centric real-time object detectors</article-title><source>arXiv</source><comment>Preprint posted online on  Feb 18, 2025</comment><pub-id pub-id-type="doi">10.48550/arXiv.2502.12524</pub-id></nlm-citation></ref><ref id="ref29"><label>29</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Ren</surname><given-names>S</given-names> </name><name name-style="western"><surname>He</surname><given-names>K</given-names> </name><name name-style="western"><surname>Girshick</surname><given-names>R</given-names> </name><name name-style="western"><surname>Sun</surname><given-names>J</given-names> </name></person-group><article-title>Faster r-CNN: towards real-time object detection with region proposal networks</article-title><source>arXiv</source><comment>Preprint posted online on  Jun 4, 2015</comment><pub-id pub-id-type="doi">10.48550/arXiv.1506.01497</pub-id></nlm-citation></ref><ref id="ref30"><label>30</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Kirillov</surname><given-names>A</given-names> </name><name name-style="western"><surname>Mintun</surname><given-names>E</given-names> </name><name name-style="western"><surname>Ravi</surname><given-names>N</given-names> </name><etal/></person-group><article-title>Segment anything</article-title><source>arXiv</source><comment>Preprint posted online on  Apr 5, 2023</comment><pub-id pub-id-type="doi">10.48550/arXiv.2304.02643</pub-id></nlm-citation></ref><ref id="ref31"><label>31</label><nlm-citation citation-type="web"><person-group person-group-type="author"><name name-style="western"><surname>Deepak</surname><given-names>R</given-names> </name></person-group><article-title>Pills detection dataset</article-title><year>2022</year><access-date>2025-11-18</access-date><publisher-name>Kaggle</publisher-name><comment><ext-link ext-link-type="uri" xlink:href="https://www.kaggle.com/datasets/perfect9015/pillsdetectiondataset">https://www.kaggle.com/datasets/perfect9015/pillsdetectiondataset</ext-link></comment></nlm-citation></ref><ref id="ref32"><label>32</label><nlm-citation citation-type="other"><person-group person-group-type="author"><name name-style="western"><surname>Chen</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Li</surname><given-names>W</given-names> </name><name name-style="western"><surname>Sakaridis</surname><given-names>C</given-names> </name><name name-style="western"><surname>Dai</surname><given-names>D</given-names> </name><name name-style="western"><surname>Van Gool</surname><given-names>L</given-names> </name></person-group><article-title>Domain adaptive faster r-CNN for object detection in the wild</article-title><source>arXiv</source><comment>Preprint posted online on  Mar 8, 2018</comment><pub-id pub-id-type="doi">10.48550/arXiv.1803.03243</pub-id></nlm-citation></ref></ref-list></back></article>