One of the most common causes of death in hospitals is acute kidney injury, or AKI, the sudden loss of function in this vital blood-cleaning organ. AKI, formerly called acute renal failure, struck almost four million people in the U.S. in 2014 alone, according to the Centers for Disease Control and Prevention, and it contributes to hundreds of thousands of deaths per year. Survivors often need expensive dialysis for months or years afterward. Hoping to prevent kidney injury from happening in the first place, researchers have developed an artificial-intelligence program that can identify at-risk patients days in advance.

Preventing AKI is challenging because its causes vary widely. “It typically occurs during major surgery or complications to surgery and from sepsis,” says Joseph Vassalotti, a nephrologist and chief medical officer at the National Kidney Foundation, who was not involved in developing the new program. “Some medications can cause acute kidney injury due to side effects or immune response.” Other causes include urinary-tract blockages, burn complications and heart attacks—all of which frequently occur in hospitals.

AKI can happen fast—and with very little warning. An increase in a waste product called creatinine in the blood marks an acute decline in renal function, but by the time doctors can detect a creatinine spike, the injury has already occurred. Often caregivers can only mitigate the damage.

So researchers at DeepMind Health, a subsidiary of Google’s artificial-intelligence company DeepMind, and their colleagues turned to AI. They designed an artificial-intelligence algorithm to identify factors that suggest someone is at risk of AKI—and to predict it 48 hours before it happens. The algorithm predicted overall AKI cases with 55.8 percent accuracy, but in cases severe enough to later require dialysis, the figure was 90.2 percent. The work was described in a study published Wednesday in Nature.

To train their algorithm, the study’s authors fed it a sample of 703,782 adults’ anonymized electronic health records from the U.S. Department of Veterans Affairs (VA). These data included more than 600,000 different health indicators that the AI model could use. Among them were blood-test results, vital signs, prescriptions and past procedures, as well as process-related information such as transfers between wards or admissions to an intensive care unit. First, the researchers had to narrow down which of these factors were irrelevant and which were potential danger signs. “We used the power of deep learning to find the right signals in the data,” says Nenad Tomašev, a research engineer at DeepMind. Ultimately they identified 4,000 relevant factors that could play a role in predicting AKI.

By examining these indicators, the algorithm can calculate whether a patient might be at risk well before renal damage occurs. “Clinicians being able to move from reactive to the ability to predict [AKI] two days before—that’s due to the richness of the data,” says Dominic King, product lead of DeepMind Health. The study’s authors suggest doctors could use that extra time to prevent or alleviate the harm. For example, they might take protective measures such as providing more intravenous fluids or diuretics or making sure the medication being used is not toxic to a patient’s kidneys. Clinicians could also more quickly address complications associated with the loss of kidney function.

Although he calls the study “promising,” Vassalotti says he is skeptical this AI could work in a typical hospital setting. And, he notes, VA health records are more dense with information than typical medical records, and patients are well tracked across treatment facilities (which is exactly why the DeepMind researchers wanted to work with these data). So would this algorithm be as effective in a more common situation, in which a clinician lacks prehospitalization medical records?

Vassalotti also points out two other areas of concern with the DeepMind researchers’ work: the low number of women included (just 6 percent of the sample) and a lot of false-positive results. “They need to refine [the algorithm] with additional studies to have fewer false positives,” he says. King counters that the false positives are not a “real, tangible concern,” because about half of them were either correct positive IDs of kidney damage—just predicted more than 48 hours in advance—or were “trailing false positives,” which means “there was just an AKI episode, and the model keeps predicting an increased risk for some time after that.” Of the remaining 50 percent, the majority occurred in people with a preexisting renal problem.

The researchers behind the new paper say this program is an early but important milestone in using AI in clinical settings and that they now need to refine their model. Eventually they plan to try applying it to other health care predictions. “Sepsis, liver failure, diabetes complications,” King says. “We see huge potential that [this algorithm] could be applied to other preventable conditions.”