Predicting Medication Adherence Among Chronic Disease Patients in Ghana Using Explainable Machine Learning: A Retrospective EMR-Based Study
This study developed and validated an explainable, context-aware machine learning framework using electronic medical record data from a Ghanaian hospital that successfully predicts medication adherence among chronic disease patients with high accuracy (89.5%) and identified a compact, resource-efficient feature set suitable for deployment in low-resource health systems.
Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
In the quiet rhythm of managing a chronic illness, the most critical step often happens not in a doctor's office, but in the privacy of a patient's home. Taking medication exactly as prescribed is the bridge between a diagnosis and a life well-lived, yet for millions of people around the world, that bridge remains incomplete. This gap between what a doctor prescribes and what a patient actually takes is known as medication non-adherence. It is a complex problem shaped by forgetfulness, confusing instructions, and the side effects of treatment, but in many developing nations, it is driven by something far more tangible: the cost of medicine and the reliability of the supply chain. When a patient cannot afford a refill or cannot find the drug on the shelf, the treatment plan collapses, leading to preventable complications and early death.
To solve this, doctors and researchers have begun turning to computers, using machine learning to spot patterns in patient data that human eyes might miss. These systems look at records of who is taking their medicine and who is not, searching for the specific mix of factors that leads to skipping a dose. However, most of these computer models were built in wealthy countries where insurance covers costs and pharmacies are always stocked. When these models are applied to places like Ghana, where health insurance is not universal and out-of-pocket costs can be a heavy burden, they often fail. They miss the local realities that dictate whether a person can stay on their treatment. A new study from Ghana seeks to fix this by building a model that understands the specific economic and social landscape of its patients, using data that reflects their actual lives rather than an idealized version of healthcare.
Researchers at Presbyterian Hospital in Agogo, Ghana, set out to create a tool that could predict which patients were likely to stop taking their medication for chronic conditions like high blood pressure and diabetes. They gathered records from 1,772 adult patients who had visited the hospital over a six-month period. Instead of relying on patients to remember how many pills they took, the team used a precise method called the Proportion of Days Covered. This approach looks at the dates of every prescription refill to calculate exactly how many days a patient had a supply of their medicine. If a patient had enough medication for at least 80 percent of the time, they were considered adherent; anything less meant they were at risk.
The team started by feeding a computer program standard information about these patients: their age, gender, whether they had health insurance, the number of medicines they were prescribed, and the estimated cost of those medicines. They tested five different types of computer algorithms, ranging from simple statistical methods to more complex neural networks, to see which one could best predict who would be adherent and who would not. The results were promising, with the best individual models correctly identifying adherence patterns about 88 percent of the time. But the researchers knew that standard data was not enough to capture the full picture of life in Ghana.
To make the model smarter, the team added six new, custom-made pieces of information that reflected the specific challenges of their local environment. They created features that combined different factors, such as multiplying a patient's age by the number of medicines they took to see if older patients struggled more with complex regimens. They also calculated a "price burden" specifically for patients without insurance, recognizing that the cost of medicine hits the uninsured much harder. By teaching the computer to look at these interactions, they allowed the model to understand that a high cost might not matter to an insured patient, but could be a dealbreaker for someone paying out of pocket.
When they combined these new, context-aware features with a technique called a stacked ensemble—where multiple computer models work together to vote on a final answer—the prediction accuracy improved. The best model correctly classified patients 89.5 percent of the time. More importantly, the researchers used a method called SHAP to open the "black box" of the computer's decision-making. This allowed them to see exactly which factors were driving the predictions. They found that the most powerful predictors were not just age or gender, but the patient's insurance status, the interaction between their age and the complexity of their medication, and whether they had other chronic health conditions. This confirmed that financial access and treatment complexity were the primary forces shaping adherence in this community.
The study also explored how to make this tool practical for hospitals with limited resources. They tested whether the model could work with fewer pieces of data, simulating a scenario where a clinic might not have access to every single detail about a patient. They discovered that a model using just seven key features performed almost as well as the full model, and even a version with only three features—insurance status, the age-medication interaction, and chronic comorbidity status—retained most of its predictive power. This suggests that in resource-limited settings, doctors do not need a massive database to identify at-risk patients; a small, focused set of information is enough to flag those who need help.
However, the researchers were careful to note the limits of their findings. The data came from a single hospital, and the model was not tested on patients from other regions or countries, so it is not yet known if it would work everywhere. They also found that while using a technique to balance the data helped the model find more non-adherent patients, it made the overall predictions slightly less accurate. In the end, they chose the model trained on the original, unbalanced data because it offered the best overall reliability. The study concludes that while machine learning holds great promise for improving health in Ghana, these tools must be built with local realities in mind. By focusing on the specific barriers of cost and insurance, and by keeping the models simple enough to be used with limited data, researchers have created a path toward identifying patients who need support before they stop taking their life-saving medicines.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.