Using AI to predict long-term hospital stays: an AI Skunkworks proof of concept

A rapid innovation project with Gloucestershire Hospitals poses interesting questions about outcomes for patients who experience long stays in hospital. Giuseppe Sollazzo, head of AI Skunkworks, explains the learnings from this project and how to engage with the team.

NHS staff making a hospital bed

Giuseppe leads the AI Skunkworks team at the NHS AI Lab, running trial AI projects to explore the use of AI for health and social care.

The AI Skunkworks team is always on the lookout for well-defined problems that impact colleagues in all professions in the NHS and could benefit from an AI approach. Some of these problems are in the clinical space, while others are more administrative in nature. Great problems are the ones that allow us to trial ideas in AI that can help us and our partners learn something about the safe adoption of AI in healthcare.

Predicting long stays with Gloucestershire Hospitals Trust

When the Business Intelligence team at Gloucestershire Hospitals Trust came to us with the idea of using AI to address the issue of hospital long-term stayers (patients who stay in hospital for longer than 21 days) we felt we had a great opportunity in front of us.

The problem of long stayers is an important one that affects the NHS in two obvious ways: beds will stay occupied for a long period of time requiring resources to manage; and there is a connection between the length of a bed stay and the likelihood of worse outcomes, with longer stays generally meaning that a patient will do less well.

Sarah Hammond, Associate CIO, and Joe Green, Deputy Head of BI, report that more than 30% of bed days in all of Gloucestershire acute Hospitals are used by long stayers, who sadly have a greater mortality rate during or soon after their hospital stay, and are more likely to return. The ability to identify and intervene early can make a real difference to these patients.

Studies show that many patients who stay in hospital for extended periods experience negative outcomes. According to the Journal of Gerontology “Ten days of bed rest in hospital leads to the equivalent of 10 years ageing in the muscles of people over 80” (Kortbein et al 2004). Long stays also create problems for busy hospitals because beds stay occupied for longer and require extra resources to manage.

These longer length of stays are often avoidable, as one study showed 60% of immobile older patients had no medical reason that required bed rest (Graf 2006, American Journal of Nursing).

It is therefore very important to understand which patients will be most at risk of staying in hospital for a long time, and the Gloucestershire Hospitals team had an inkling that in their data there could be a way to improve the ability to make this prediction with some form of AI.

Our aim was to develop a proof-of-concept for a long stay risk score algorithm. Would it be possible to predict a patient’s length of stay the minute they arrive at the front door?

What we did

To address this project, we worked for 12 weeks in 6 sprints with technology suppliers from the Accelerated Capability Environment (ACE), a company called Polygeist. They pitched a solution to us that really captured our interest because of its novelty and its potential to help us and our partners understand what it means to use machine learning in production. The solution, based on an innovative AI algorithm called “Generative Adversarial Networks” (GANs), created a proof-of-concept tool that allows the team to view a patient with their risk of becoming a long-term hospital stayer profiled and quantified.

The tool has now been released as open source and we hope that this will help others experiment with this new type of technology. If you work in a NHS Trust and wish to explore how to adapt this library in your context, please get in touch with the team.

Our vision

The longstayers project was a good fit for our AI Skunkworks way of working:

  • It comes with the right amount of data
  • It is pitched by a team that understands the problem well and can provide product ownership
  • It is well understood and there are traditional techniques in place to address it
  • It challenges AI to provide a better solution and find ways to put it into production
  • There are shared learning opportunities and we can make it available to others by sharing code through open source releases

The AI Skunkworks vision is that organisations in the health and care system are able, through practical experience, to understand, build, buy, deploy, support, and challenge AI solutions.

Graphic text saying the AI Skunkworks vision

NHS AI Lab Skunkworks vision

What’s next for long stay prediction?

Working on projects like this allows us to really understand how to apply a modern machine learning algorithm to a forecasting problem that afflicts hospitals and patients in the NHS.

Importantly for the AI Skunkworks programme, we need to be able to compare the performance of AI products with those of more traditional techniques. More importantly, we must also be able to explore what it means to take a model like this and put it in production, trying to answer questions such as “what skills should a clinical informatics team have in order to manage the model and keep it relevant and accurate?”. This is what is generally referred to as MLOps, and is an important part of the questions we help our partners explore, as the management of AI solutions is still at an early stage.

Although this is a proof-of-concept (a pilot study) The team at Gloucestershire Hospitals is keen to heed the lessons learned by working together, and taking the next steps to understand what technical, compliance, and logistical requirements are necessary to adopt it.

They said: “Our aim was to develop a proof-of-concept for a long stay risk score algorithm. Would it be possible to predict a patient’s length of stay the minute they arrive at the front door? The initial long stay risk model successfully detects two-thirds of long stayers at time of arrival, or very soon after.”

These results are exciting. They could have a real impact on patient care and flow. The team reports: “We will soon begin taking the model output tables, which run every 15 minutes, into our electronic patient record system to test and evaluate with clinicians.“

We are now in discussion with Gloucestershire Hospitals on how to support them in their journey in testing the model further and adopting it safely, while we prepare to support other organisations considering a similar approach.

Get in touch

Does this project capture your attention?

Who’s who

This project is a collaboration between NHSX, Gloucestershire Hospitals NHS Foundation Trust, Polygeist and the Home Office’s Accelerated Capability Environment (ACE). The AI Lab Skunkworks exists within the NHS AI Lab to support the health and care community to rapidly progress ideas from the conceptual stage to a proof of concept.

The NHS AI Lab is working with the Home Office programme: Accelerated Capability Environment (ACE) to develop some of its skunkworks projects, providing access to a large pool of talented and experienced suppliers who pitch their own vision for the project.

Accelerated Capability Environment (ACE) is part of the Homeland Security Group within the Home Office. It provides access to more than 250 organisations from across industry, academia and the third sector who collaborate to bring the right blend of capabilities to a given challenge. Most of these are small and medium-sized enterprises (SMEs) offering cutting-edge specialist expertise.

ACE is designed to bring innovation at pace, accelerating the process from defining a problem to developing a solution and delivering practical impact to just 10 to 12 weeks.

Polygeist, a software company specialising in state-scale analytics, builds world-leading AI technology for defence, national security, law enforcement, and healthcare customers. The team for this project was able to produce a live system, producing insights, from a standing start, in 12 weeks.