Inspiration

We built MedTwin to simplify the process of finding the right medication dosage by creating a digital twin of the patient, giving patients a safe way to experiment and predict responses before trying them in real life.

A big problem in healthcare is that doctors often don’t know exactly how a patient will respond to prescription medication. The typical process is to start with a light dose, send the patient home, and wait to see if it works. If not, the patient comes back, and the dose is adjusted. This back-and-forth can take weeks or months, delaying effective treatment and adding stress for patients.

To keep our project realistic, we focused on hypertension and lisinopril as treatment. High blood pressure is a common, high-impact condition, but treatment response is highly variable. Some people’s blood pressure drops quickly with a small dose while others need much larger dose, and lifestyle factors like sodium intake, exercise, or even time of day make it even more complicated.

Our project simplifies this process by creating a digital twin powered by clinical trial data and machine learning. Instead of real patients bearing the burden of trial-and-error, the digital twin can simulate outcomes, learn a patient’s unique sensitivity to medication, and guide doctors and patients toward the right dosage and timing more quickly and confidently.

What it does

Patients simply enter their baseline data such as blood pressure, heart rate, age, BMI, and lifestyle factors. From there, our model predicts how that specific patient’s blood pressure and heart rate will respond over time to different lisinopril dosages, schedules, and lifestyle choices.

MedTwin provides:

  • Data input page – where users input their personal health data.
  • Experimentation dashboard – an interactive tool for experimenting different lisinopril dosages and times, running on-demand simulations and visualizing predictions for the next 8 hours.
  • Side effect monitoring page – where patients can log symptoms and see if they cross a predefined threshold doctors suggest for seeking medical attention.
  • Optimal action page – where our model suggests the best next steps for the patient (e.g., dosage amount, timing, exercise) based on our predictions.

By combining these tools, MedTwin helps patients and doctors reduce trial-and-error and enables faster and more personalized treatment decisions.

How we built it

  • Predictive Model:
    We trained a Seq2Seq LSTM on synthetic data generated using patterns specified by research papers (can be easily replaced by clinical trial data when available). The model takes as input a patient’s baseline data, sodium intake, exercise, time of day, and dosage, and predicts blood pressure and heart rate responses for the next 8 hours.

  • Optimization:
    We implemented a brute-force search of all dosages and lifestyle adjustments for this patient with reinforcement learning principles to suggest the optimal dosage and timing. The optimization is guided by a reward function based on predicted blood pressure and heart rate outcomes.

  • Dashboards:
    We built a web interface so patients can enter baseline data, view predicted blood pressure and heart rate curves, monitor side effects against personalized thresholds suggested by doctors, and experiment with dosage and lifestyle inputs.

  • Tech Stack:
    Python (Flask backend), machine learning with LSTMs, Chart.js for visualization, and custom optimization routines.

What's next for MedTwin

  • Expand to other medications and conditions beyond hypertension, broadening the scope and impact of digital twins in personalized medicine.

  • Incorporate more real-world data, such as clinical trial datasets and patient-reported outcomes, to improve the accuracy and reliability of predictions.

  • Add more input factors as medical research advances, capturing new correlations between lifestyle, biology, and blood pressure to refine treatment recommendations.

Right now, the scope of our project is limited by our medical knowledge and available data. If we can collaborate with healthcare professionals and integrate richer clinical expertise, MedTwin has the potential to grow into a powerful platform that supports personalized, data-driven treatment decisions across many areas of healthcare.

Challenges we ran into

  • We couldn’t find open-access datasets for hypertension lisinopril response due to patient privacy regulations, so we had to adjust our project design and invest time into researching how to generate realistic synthetic data.
  • Because of this we also needed to do lots of research to create equations for synthetic data readings to make sure our data was realistic.

Accomplishments we're proud of

  • Successfully trained a functional LSTM model that responds dynamically to changes in baseline factors such as age, BMI, and dosage.
  • Built a system where these model predictions can directly inform treatment suggestions, closing the loop between data, simulation, and decision-making.

Built With

Share this project:

Updates