Improving Drug Safety

Main question:

Can I use ML applied to heart rate data (time series) of test subjects to show who is using beta blockers?


  1. What preprocessing should be applied?
  2. Is it preferable to work with features or is it better to let a neural network learn the raw data?
  3. Does a Classifier provide better results for this question than an Auto-encoder?
  4. Is it possible to quantify with a Python model to what extent the Main Question can be answered positively?

1 Introduction

Every year there are 41,000 hospital admissions related to medication insecurity. According to a publication by the Utrecht Institute for Pharmaceutical Sciences, this could have been avoided in 19,000 cases. An amount of 85 million euros is involved. Drug insecurity has its origins in various facets of the medication process, such as; interactions, double medication, poor cognition, but also adherence to therapy play an important role in this. The elderly, people with a low SES and minorities are an extra vulnerable group because the intake instructions are not fully understood or carried out correctly.

Hospitals, general practitioners, nursing homes and home care are confronted daily with the consequences of this lack of medication. Annovating and SmartMed therefore propose a joint project to continuously monitor the patient by means of biofeedback from fitness trackers and to teach the effects of (the use of) medication on the heart in a completely new and innovative way in an artificially intelligent model. This model can then be used to detect unsafe situations so that monitoring, intervention, modification,
can be delayed or discontinued. Within the framework of the project proposed here, the heart rate (HR) and heart rate variability (HRV) signal from fitness trackers of participating patients will be ‘learned’ into an AI model in a mathematical computer model. The new AI model can be used to provide a solution in four situations of drug insecurity described below.

1.1 Lack of compliance (adherence)

Lower compliance will generally lead to underuse of medication. Certainly in conditions with an almost asymptomatic course, such as hypertension and hypercholesterolemia, good adherence to therapy is difficult to achieve in practice. This may be even more common in the low SES group. Patterns from HR and HRV signals will, according to the firm expectation of cardiologist Dhr. v.d. Bilt van Annovating B.V can be an important predictor for the degree of compliance with medication use. SmartMed already provides 20,000 patients who are connected to monitor their medication use with a SmartMed app (both IOS and Android). The App currently provides, among other things, the presentation of the Current Medication Overview (AMO). This AMO is composed of requested medication dispensations from the LSP (Landelijk Schakel Punt) and the dispensing information from the patient’s affiliated pharmacy. The administration times are defined from the AMO. Patients will then receive a notification via the SmartMed App around the planned administration times to take the medication. The intakes can be confirmed by the patient. This information will be linked to the fitness tracker data collected by Annovating. Through this link and the development of an AI model, a relationship can be established between patterns in HR and HRV and therapy adherence.

1.2 Overdose control

Overdose can be caused by incorrect use of medication in which the patient, often unconsciously, takes too high doses of medication. Even when taking medication according to prescription, too high blood levels of a drug can arise because, for example, the drug is less well excreted by the liver or kidneys, sex differences or differences in the weight of the patient. This can also be caused by poor organ function or by the increased or decreased presence of liver enzymes that promote or inhibit the excretion of drugs from the blood.
For example, it is known that in some situations the heart rate also decreases due to renal dysfunction. Beta blockers enhance the further decrease in heart rate. However, due to the renal dysfunction, the beta-blockers are removed more slowly, eventually leading to overdose and a vicious circle. Especially in elderly patients who use beta-blockers in combination with other medications that affect the kidney function, this can lead to life-threatening situations. Especially if dehydration occurs in warmer weather or illness and the excretion of medication by the kidneys is even further reduced, the risk of overdose is greater again.

1.3 Interactions

Elderly people with cardiovascular disorders (such as heart failure or hypertension) are often dependent on the use of multi-medication. This creates a risk of interaction between medicines, which can have serious consequences for the patient. A pharmacist is responsible for pointing out potentially unsafe combinations of medication to the practitioner. A doctor has the mandate to disregard this advice in special situations. But whoever bears responsibility, neither the practitioner nor the pharmacist observes through patient biofeedback what actually happens to the patient. In this project, we use biofeedback with a fitness tracker to objectively determine whether multi-medication leads to dangerous patterns in HR and/or HRV signals or in parameters derived from them.
An example: If a patient is treated with a diuretic for high blood pressure or heart failure, this may affect the potassium level in the blood. If the patient also uses digoxin, a drug prescribed by cardiologists for heart failure and cardiac arrhythmias, serious heart problems can occur due to reduced kidney function or a low potassium level. By monitoring patterns in HR and HRV, these effects of drug interactions on the improper functioning of the heart may be detected early. This may prevent hospital admissions or fatal consequences. It is also known that with a commonly prescribed drug for depression and anxiety disorders (citalopram), undesirable cardiovascular effects can occur. This drug is commonly prescribed for the elderly. In addition, the risk of side effects is even greater because this group more often suffers from reduced liver or kidney function.

1.4 Incorrectly prescribed medication

Often ‘safe’ use of medication is derived from proper compliance. But this statement of ‘safe use of medication’ is only a derivative of the treatment goal that the doctor intended with the pharmacotherapeutic treatment. Namely; adherence to a therapy that has the right goal but has an unexpected negative effect on the body cannot be regarded as ‘safe’. However, this cannot be verified without biofeedback.
For example, there are several administration apps available that can support patients in closely following a prescribed therapy in the home situation. But these administration apps only give a notification when the medication needs to be taken. With these administration apps it is impossible to actually determine whether the medication has actually been taken and whether it has had any undesirable effect on the body. Because in the end, however, it is about achieving a treatment goal. So faithfully taking incorrectly prescribed medication in many cases does not lead to the treatment goal.
Through permanent monitoring of heart rate by means of a fitness tracker, incorrectly prescribed medication with a harmful effect on the heart can probably be detected in time and replaced by a more suitable alternative.

2. Annovating B.V

Annovating B.V ( has existed since 2017 and was founded by Ir. Auke de Leeuw. Mr. de Leeuw has an academic background in aerospace and has been active in company management and commercial technical positions for more than 20 years. Since 2017, Mr De Leeuw has been involved with Annovating in the development of medical ICT and artificial intelligence. Annovating B.V develops and manages the data platform https:\\ and now also facilitates research in the Haga hospital and at TU Delft. Core activity At the moment, the development of software is to detect bosom fibrillation from data from fitness trackers. Annovatie also uses artificial intelligence for this. As a business partner in Annovation, Mr Ivo van der Bilt, cardiologist and also head of the Cardiology department of the Haga Hospital. Annovation also works together with mvautomatization of Mr. Vegt. MVAutomatization takes care of the management of the database and all server side applications of annovation to keep existing services operational.

Hani Al-Ers is a researcher in the field of human-machine interactions. He completed his PhD at the Delft University of Technology at the Interactive Intelligence group of the Faculty Computer Science (EEMCS). Philips Research in Eindhoven sponsored his project which was aimed at improving the user experience of Philips tv sets. He completed 2 post-docs at the Delft University of Technology, during which he managed international consortia on topics such as an improved quality of life for the elderly. Currently, he is conducting research in the field of health and education and he leads the Research Education activities at the Dutch Innovation Factory.