← All work
AcademicSeptember 2024 to May 2025With a university hospital ultrasound department

MVTE Recurrence Prediction

An explainable model that helps doctors estimate whether a patient's blood clot disease will come back.

0.93weighted F1 on the test set
37 / 46recurrence cases detected in the test set
15 msinference time per prediction
SHAP chart of the most influential clinical variables

The need

Venous thromboembolic disease covers deep vein thrombosis and pulmonary embolism. Anticoagulants prevent new clots but raise the risk of bleeding, so doctors must weigh the risk of recurrence against the risk of treatment for each patient.

The hospital’s request changed during the project: it now wanted a model doctors could understand and question, since a score with no justification does not fit medical practice. So we restarted the AI work from scratch and built on the existing application.

What I owned

The whole AI pipeline, as part of a team of five: understanding the medical data, preprocessing, modelling, evaluation, explainability and integration into the application.

The solution

A binary classifier predicts recurrence from clinical and demographic variables, and returns a probability along with the reasons behind it.

Data
1,881 patient recordsClinical and demographic variables
Preprocessing
Cleaning and encoding80/20 stratified splitSMOTENC oversamplingRobustScaler
Six models compared
XGBoostRandom ForestSVMKNNLogistic regressionNeural network
Decision support
Tuned threshold of 0.32SHAP global viewLIME per patient
Models were compared on the same preprocessed data.

How it was built

Three decisions matter most:

  • Handling imbalance. Under 15% of patients recur. A plain model scores high accuracy but misses them, so we used SMOTENC, which respects both categorical and numeric variables.
  • Tuning the threshold. The decision threshold was set from the precision-recall curve to maximise F1, ending at 0.32 and not the default 0.5.
  • Explaining decisions. SHAP checks that the model’s drivers make medical sense. LIME justifies each individual prediction for the doctor.
Precision-recall curve, with the chosen threshold of 0.32.
XGBoost on the test set: 37 of 46 recurrence cases detected.

Results

  • XGBoost was the best model, with a weighted F1 of 0.93 and accuracy of 0.93.
  • On the rare class that matters, it detected 37 of 46 recurrences, with an F1 of 0.73 for that class. This is the honest measure of performance, since the weighted score is lifted by the majority class.
  • Fast enough for live use, at about 15 ms per prediction.
  • XGBoost covers almost the whole radar, with high scores on every axis, while Random Forest gives up ground on the recurrence class.
  • The most influential variables, such as years of risk exposure, treatment duration and BMI, are consistent with clinical knowledge.
XGBoost, the winning model.
Random Forest, a close rival.
LIME explanation for a single patient: which variables pushed the prediction, and in which direction.