Optimize hospital bed allocations with reinforcement learning-trained AI

Optimize hospital bed allocations with reinforcement learning-trained AI

Optimizing bed allocation in hospitals based on how patients (randomly) check in is a well-known and complex challenge for which multiple techniques have been used throughout the decades. So much so that it has become a typical example used to teach queue management techniques.

Thanks to the latest autonomous systems developments, it is now possible to develop AI agents with Microsoft Project Bonsai to provide new solutions to this challenging problem.

Under Microsoft guidance, Neal Analytics has developed a SimPy simulation of random patient arrivals and the AI agent, aka “brain,” training curriculum to optimize bed allocation.

The Project Bonsai hospital bed allocation solution is available for anyone to use as-is or to customize as needed. If this solution targets bed allocation, the simulation and AI Agent can easily be adapted for other queue management problems. It includes most processes involving random discrete resources request, length of those resources use (hours to days in most cases for hospital beds), and finite supply.

Examples of such applications include:

  • Managing a set of orders coming from multiple sources (in-store, drive-in, mobile app) at a coffee shop, cafeteria
  • Managing lines at and large-scale buffet-style restaurant operation
  • Optimizing some supply chain, warehousing, or storage processes
  • And many more

As the solution is open-source, Neal Analytics and Microsoft are eager to see where the community will use it to create new exciting solutions leveraging Project Bonsai!

Demo screenshot of simulation of new hospital or wing for 60 days with 200 beds

Simulation of a new hospital or wing for 60 days with 200 beds (GitHub)

To get started, developers and data-scientist have two options:

Using the marketplace entry, a Microsoft-hosted Bonsai free demo workspace pre-populated with the SimPy simulator and inkling codes will be ready-to-use for developers and data scientists to test as-is or after customization.

Alternatively, developers can create their own Bonsai workspace on their internal Azure subscription and import the required Python and Inkling code from Neal’s GitHub repository.

The GitHub repo readme file describes in detail the installation requirements such as Python 3.7+, Bonsai API, etc. For more details, please refer to the readme file.

If needed, Neal Analytics can provide additional support to help customers customize and operationalize the solution to fit their specific situation.

This solution development was made possible thanks to the seminal work of Michael Allen in his “learning hospital” project and the following key contributors: Chris Kahrs (Microsoft) and from the Neal Analytics team: Joe Lanska, Zach Perkel, Jayson Stemmler, Edwin Webster, and Doc Derwin.

Learn more: