Projects

Research and software

My work connects clinical sequence modelling, clinical decision support, patient education, tools for scientific discovery and research software. The common aim is to make complex evidence more useful for medical research and patient care.

Updated

Stages describe public development status, not completeness or clinical readiness. Milestones are dated public outputs.

Clinical sequence modelling

Understanding patterns in electronic health records, alone and linked with other data such as retinal images, and their value for medical research.

ASCEND

generative records

Transformer models that learn how patients’ health records unfold over time, used to study risk, treatment response and patterns of disease.

Aim. To build models of routine electronic health records that can forecast a patient’s future care — diagnoses, prescriptions and laboratory values, and when they occur — and that can be asked what would be expected to happen if a different treatment were started. If such a model reproduces known drug effects from observational data, it becomes a single tool for studying treatment response across many drugs and outcomes, including questions that trials have not addressed.

Approach. Each patient’s record is represented as a time-stamped sequence of coded events and measurements. ASCENDgpt (2025) used phenotype-aware tokens and an encoder model for cardiovascular risk prediction. FlatASCEND (2026) moved to a compact autoregressive generator that predicts both the next event and its timing, and tested whether simulated treatment starts reproduce known pharmacological associations; a companion study used sparse autoencoders to decompose the model’s internal representations into interpretable clinical features. Current work (ASCEND-GEN) trains one generative model on UK primary-care records and evaluates it against target-trial-style emulations of drug starts across 15 drug classes and six routine outcomes (HbA1c, blood pressure, LDL cholesterol, eGFR, weight and potassium). Rather than fitting a separate model for each question, it builds time-dependent drug-response dynamics into the model itself. Because the model generates futures, the same history can be given twice with a different treatment started each time, and the two futures compared. Two kinds of known answer are used as checks, never for training: published patterns of differential drug response (for example from the Exeter work of Dennis and colleagues), and benchmarks in which a made-up drug effect is planted in real records. Current work asks whether the model recovers differences in treatment response between people, not just average effects.

Latest public milestone · · preprintInterpreting clinical sequence models
Read the interpretability preprint →

ORCA

records as language

Treating coded health records as a language, so that clinical sequences from different health systems can be read, compared and translated.

Aim. Coded health records are produced jointly by clinicians, laboratories and administrative processes. ORCA asks whether these sequences behave like a language, with measurable statistical structure, and whether that structure can be used to align records from different health systems and to translate between coded records and plain English. A shared, system-independent representation of clinical situations would make it easier to compare populations, transfer models between settings and interpret what a model has learned.

Approach. The first phase applied tools from computational linguistics and information theory — frequency and entropy analysis, cross-system alignment, and translation between coded sequences and English — to sequence models trained on records from several health systems. The current phase (ORCA-JEPA) trains joint-embedding predictive (JEPA-style) models on natively coded records from UK and US health systems together, without telling the model which codes mean the same thing. It tests whether patients in the same clinical situation land in the same region of the shared representation whichever system recorded them, using held-out code mappings only as a check, comparison groups matched on age, sex and amount of data, and links to clinical text.

PRIMA-HD

records and retinal images
Set-up

An exemplar project in Glasgow's Trusted Research Environment that links diabetes records with eye-screening images, to test whether the two together predict outcomes better than either alone.

Aim. People with diabetes in Greater Glasgow and Clyde have rich linked records and regular retinal photographs, but these are rarely analysed together. PRIMA-HD (Pluripotent Representations for Integrated Multimodal Analysis of Healthcare Data) aims to learn each person's care journey from their records, to compare model-predicted outcomes of real treatment choices with what randomised trials found, and to test whether adding retinal images improves prediction. It is also a test of how this kind of work can be done safely inside a Trusted Research Environment.

Approach. Inside the NHS Greater Glasgow and Clyde / University of Glasgow Trusted Research Environment, SCI-Diabetes records are linked with prescribing, laboratory, hospital and death records and diabetic eye-screening images for adults with type 1 or type 2 diabetes. Each record becomes a time-ordered sequence for a generative model of the kind developed in ASCEND, with forecasts compared against statistical models chosen in advance. A retinal foundation model turns each screening photograph into a summary placed on the person's timeline, and prediction of retinopathy progression, kidney disease, cardiovascular events and death is compared with and without images. Trial results are used only to check the model, never to train it. Analysis code goes into the TRE, patient-level data never leave it, and only aggregate results and models that pass disclosure and memorisation checks can be released.

Phenotype fingerprinting

rare phenotype retrieval

Using patterns in clinical records to find patients with rare or under-recognised conditions earlier.

Aim. Many clinically important conditions are rare, inconsistently coded or recognised late. The aim is to identify patients with under-recognised phenotypes earlier, starting from small, carefully characterised case sets rather than large labelled cohorts.

Approach. Expert-characterised cases define a “fingerprint” in the representation space of a clinical sequence model. The fingerprint is then used to retrieve patients with similar trajectories in larger routine-care populations, before the condition is evident from diagnostic codes. Representations from autoregressive and JEPA-style models are to be compared with patient-similarity and weak-supervision baselines.

Clinical decision support

Bringing guideline evidence to the individual patient, with every recommendation traceable to its source.

ValidAct

verified decision support

Guideline-grounded decision support for diabetes care: patient-specific answers in which every statement quotes the guideline evidence it rests on.

Aim. Clinical guidelines are long, frequently updated and hard to apply to an individual patient with several conditions and treatments. ValidAct aims to give clinicians patient-specific management suggestions that handle this nuance, while making every statement traceable to the guideline evidence behind it, so that unsupported or contradicted advice is flagged rather than presented as fact.

Approach. Guidance (for example NICE guidance on type 1 and type 2 diabetes, lipid modification and hypertension, ADA–EASD and JBDS guidelines, and drug summaries of product characteristics) is curated offline as whole recommendations in their original wording, with notes on whom each applies to and what it does not cover; it is never reduced to hard-coded rules. For a given patient, a language model reasons over the retrieved recommendations and the patient's record, quoting its source for every statement. Separate checks then match every quotation word for word against the source, test whether each statement applies to this patient, name the facts the answer depends on, and mark where the sources run out. The answer is grouped as applying to this patient, conditional on a fact to check, not applicable, or not covered by the sources. A complementary line trains a small open model on answers ValidAct has already checked, to teach it to use the evidence it is shown rather than to memorise guidance. Development uses synthetic cases, with MyWay Digital Health and support from Scottish Enterprise.

Patient education

Helping people understand and manage their condition between consultations.

Adaptive learning

learning between consultations
Planned

Adaptive learning tools that find what a person already knows and teach the gaps, being adapted from other subjects to diabetes education.

Aim. Most of diabetes is managed by people themselves, between appointments. Structured education works, but information given once is quickly forgotten and people start from very different places. The aim is education that adapts to each person's understanding, not to clicks, and complements educators, structured programmes and peer support rather than replacing them.

Approach. Short placement questions map what someone already understands; familiar ground is summarised and time is spent where understanding is weakest. The tools build on established learning principles: retrieval practice rather than rereading, spacing, and inner feedback, in which people compare their own attempt with a model answer (after David Nicol). Formats borrowed carefully from social media (short cards, visible progress and a reason to return) make the material worth coming back to, without endless feeds or streak pressure. The framework is already in use for non-clinical subjects; its adaptation to diabetes is planned and has not been tested with patients.

Scientific discovery systems

Making scientific literature and possible research directions easier to explore.

NEXUS

method transfer

Predicting where a method from one field could solve a problem in another, and testing the most promising candidates.

Aim. Many advances come from applying a method developed in one field to a problem in another, but these opportunities are mostly found by chance. NEXUS aims to learn from the history of such transfers to identify new, high-value method–problem combinations, and to record what happens when they are tested — including negative and untestable results — so that each cycle improves the next.

Approach. The unit of analysis is the first genuine application of a published method to a published problem, distinguished from papers that merely mention both. These events are mined from large, time-stamped literature corpora, and models trained only on information available before a cut-off date predict which new combinations are likely to occur and to be useful. Candidates are checked for novelty, tractable ones are tested in faithful experiments, and every outcome is kept in a ledger. Predicted method–problem pairs are preregistered before they are tested, so that the predictor is judged prospectively. Current work concentrates on reliable extraction of methods and problems from papers, starting in cardiovascular and other clinical domains.

Physarum

mapping research directions

Tools for mapping possible research directions around a project’s frontier and supporting scientific judgement.

Aim. When a research project reaches an uncertain point, the useful next step is rarely a single obvious task. Physarum aims to make that uncertainty explicit: to map plausible directions, record which were pursued and which were rejected, and help the researcher decide where to push next.

Approach. Named after the slime mould that finds efficient paths by extending and reinforcing exploratory tendrils, Physarum launches bounded groups of AI “scout” agents to explore the space around a project’s current frontier: methods, prior literature, risks and possible studies. Their findings are sorted into routes to pursue, verify, park or avoid, and kept as a persistent map, so that routes can be reinforced or retired as results come in. The researcher remains the decision-maker.

glucose.ai

AI methods in diabetes research
Public release

A living map of how machine-learning and AI methods are applied in diabetes and metabolic research: papers, methods, clinical tasks and adoption trends, updated daily.

Aim. Research applying AI to diabetes is growing quickly and is spread across clinical journals, preprint servers and computer-science venues. glucose.ai aims to show not just what is being published, but which methods are being applied to which clinical problems, how that pattern is changing, and where methods are well established or still untested.

Approach. An automated pipeline collects new papers daily from PubMed, arXiv, bioRxiv, medRxiv, OpenAlex and Semantic Scholar, removes duplicates and extracts full text where available. Each paper is classified by the methods it uses and the clinical task it addresses, against a structured ontology, and embedded with a scientific-document language model for semantic search and maps of the field. Dashboards and bibliometrics then track the adoption of methods over time.

Explore glucose.ai →

Research software

Software that helps research remain connected and usable over time.

trial-emulation

target trial emulation in Python
Public release

An open-source Python package for target trial emulation, ported and adapted from the TrialEmulation R package and published on PyPI.

Aim. Target trial emulation estimates treatment effects from observational data by specifying the randomised trial that would answer the question and then emulating it in routinely collected records. The aim is to make this established method available to the Python data-science and machine-learning ecosystem used for much electronic health record research, so that it can sit in the same pipelines as data preparation and modelling.

Approach. The package reimplements the TrialEmulation R package in Python and modifies it for that ecosystem. Longitudinal person-time data are expanded into a sequence of nested emulated trials, and marginal structural models are fitted by weighted pooled logistic regression, with inverse-probability weights for treatment switching and informative censoring. It supports intention-to-treat, per-protocol and as-treated estimands, cluster-robust variance and case-control sampling for large datasets. It works with pandas, NumPy and statsmodels, accepts R-style formulas, and uses C++ extensions for the computationally intensive steps. It is released under the Apache 2.0 licence.

trial-emulation on PyPI →

pi / Cog workflows

research memory

Tools for connecting research sources, experiments and synthesis, so useful work is easier to organise and revisit.

Aim. Long-running research involves many threads — papers, experiments, meetings, code and decisions — that are easy to lose. The aim is to keep them connected, so that work can be resumed, checked and built on.

Approach. Cog is a locally maintained knowledge base in which AI agents ingest sources, maintain linked summary pages, search curated literature collections and record project state, decisions and results with their provenance. It runs on open coding-agent tooling (pi) and supports structured workflows for literature review, planning, independent review of results and handover between work sessions.