Skip to the content

NHS AI Lab develops tool to predict length of hospital stays


Mark Say Managing Editor

Get UKAuthority News


The NHS AI Lab and Gloucestershire Hospitals NHS Foundation Trust have developed an AI tool to predict which patients are likely to have a lengthy stay in hospital.

They have developed a long stay risk score algorithm with the aim of helping hospital teams to make a better assessment of patients when they are admitted.

The skunkworks team at the AI Lab has worked with AI specialist Polygeist on a proof of concept under the Home Office Accelerated Capability Environment programme and made the open source code for the tool available on GitHub.

In an NHSX blogpost on the project, Guiseppe Sollazzo, head of AI skunkworks, said the business intelligence team at Gloucestershire Hospitals came up with the idea for the project to address two significant problems: the long periods for which many beds are occupied; and the likelihood of worse outcomes for patients the longer they stay.

The trust has reported that more than 30% of bed days in its acute hospitals are taken by long stayers and they have a higher mortality rate than other patients.

Sollazzo said the solution pitched by Polygeist is based on a generative adversarial networks (GAN) algorithm and makes it possible to assess the risk, profiled and quantified, of a patient becoming a long term hospital stayer – classified as 21 days or more.

It also made it possible to  identify factors predictive of long stayers.


The Gloucestershire team has reported that the initial model has detected two-thirds of long stayers at the time of arrival or soon afterwards, which promises to have a positive impact on patient care and flow in the hospitals.

There are now plans to integrate the model’s output tables into the trust’s electron patient record system for evaluation with clinicians.

The AI Lab and the trust have encouraged others to experiment with the tool and are in discussion about how they can test it further.

Image from iStock, gorodenkoff

Register For Alerts

Keep informed - Get the latest news about the use of technology, digital & data for the public good in your inbox from UKAuthority.