The researchers, who published their findings in the journal Nature this week, first trained a neural network using 129,450 photos representing more than 2,000 different types of skin conditions. Using one of Google’s image recognition algorithms, the teams says they were able to train the neural network to identify both malignant and benign skin lesions.

They then worked with 21 human dermatologists, showing them images of some of the most common and deadly forms of skin cancer and asked whether they would recommend treatment based on what they saw.

When they compared the algorithm’s performance with that of the dermatologists, they found the humans performed at the same level as the AI, the researchers said.

We realized it was feasible, not just to do something well, but as well as a human dermatologist

We realized it was feasible, not just to do something well, but as well as a human dermatologist, Sebastian Thrun, of Stanford’s AI Lab, said in a blog post about the study. Thats when our thinking changed.”

Researchers say they are optimistic the technology could eventually be brought to smartphones so it would be available outside of a lab. They believe “it will be relatively easy to transition the algorithm to mobile devices,” opening up the possibility of at-home testing for at least some types of skin cancer. Still, don’t expect to see it on a smartphone in the near future.

Susan Swetter, a professor of dermatology and one of the paper’s co-authors, cautions that “rigorous prospective validation of the algorithm is necessary before it can be implemented in clinical practice, by practitioners and patients alike.

More testing aside, a smartphone version of the program would likely face regulatory hurdles before it could be approved for consumer use.

Still, even the idea of such a system is enough to excite the researchers, who say their findings could impact tests for other conditions as well. Andre Esteva, one of the paper’s co-authors, says the implications could be far-reaching.

Everyone will have a supercomputer in their pockets with a number of sensors in it, including a camera. What if we could use it to visually screen for skin cancer? Or other ailments?