AI knows when you're going to die. But unlike in sci-fi movies, that information could end up saving lives.

A new?paper published in?Nature?suggests that feeding electronic health record data to a deep learning model could substantially improve the accuracy of projected outcomes.

In trials using data from two US hospitals, researchers were able to show that these algorithms could predict a patient's length of stay and time of discharge, but also the time of death.

The neural network described in the study uses an immense amount of data, such as a patient's vitals and medical history, to make its predictions.

A new algorithm lines up previous events of each patient's records into a timeline, which allowed the deep learning model to pinpoint future outcomes, including time of death.

The neural network even includes handwritten notes, comments, and scribbles on old charts to make its predictions. And all of these calculations are done in record time, of course.

What can we do with this information, besides fear the inevitable? Hospitals could find new ways to prioritize patient care, adjust treatment plans, and catch medical emergencies before they even occur.

It could also free up healthcare workers, who would no longer have to manipulate the data into a standardized, legible format.