Artificial intelligence (AI) is showing promise in the operating room as new research shows machine-learning can diagnose brain tumors at a fraction of the time it takes expert human pathologists.

According to new research published today in the scientific journal Nature Medicine, a new AI system was able to accurately diagnose a brain tumor in two minutes. The traditional method of sending tissue to a lab, freezing and staining it, then examining it through a microscope typically requires about 20 to 30 minutes or longer for pathologists. The AI-based diagnosis was also about as precise as the standard method, with 94.6 percent accuracy compared to conventional human diagnosis of 93.9 percent.

The new method streamlines the practice of analyzing tissue samples while the patient is still on the operating table. It uses an optical imaging technique called stimulated Raman histology (SRH) to create images that the AI algorithm assesses in less than 150 seconds. The study’s senior author Daniel A. Orringer, associate professor of Neurosurgery at New York University Grossman School of Medicine, helped develop the technique with colleagues at the University of Michigan.

“As surgeons, we’re limited to acting on what we can see; this technology allows us to see what would otherwise be invisible, to improve speed and accuracy in the [operating room], and reduce the risk of misdiagnosis,” Orringer said in a press release. “With this imaging technology, cancer operations are safer and more effective than before.”

The new technique was also able to detect some details that traditional methods might miss, such as the spread of a tumor along nerve fibers, and unlike the conventional approach, the AI method doesn’t destroy the sample so the tissue can be used again for more testing.

But this isn’t the first time machine-learning has shown to beat out humans in cancer diagnosis. Google has recently developed systems that can diagnose breast cancer and lung cancer more efficiently than medical experts.