Researchers have created an AI that draws what a person in looking at in real time just by reading and decoding their brain waves. Perhaps most impressive of all, the technique is noninvasive, with all the brainwave information gathered through a cyberpunk-looking, electrode-covered electroencephalography (EEG) headset.

“Researchers used to think that studying brain processes via EEG is like figuring out the internal structure of a steam engine by analyzing the smoke left behind by a steam train,” researcher Grigory Rashkov said in a press release. “We did not expect that it contains sufficient information to even partially reconstruct an image observed by a person. Yet it turned out to be quite possible.”

The team, from the Moscow Institute of Physics and Technology and Russian corporation Neurobotics, started their study — available on the preprint server bioRxiv — by placing a cap of electrodes on participants’ scalps so that they could record their brain waves.

They then had each participant watch 20 minutes worth of 10-second-long video fragments. The subject of each fragment fell into one of five categories, and the researchers found they could tell which category of video a participant was watching just by looking at their EEG data.

For the next phase of the research, the scientists developed two neural networks. They trained one to generate images in three of the tested categories from visual “noise,” and the other to turn EEG data into comparable noise. When paired together, the AIs were able to draw surprisingly accurate images of what a person was looking at solely from their real-time EEG data.

“Under present-day technology, the invasive neural interfaces envisioned by Elon Musk face the challenges of complex surgery and rapid deterioration due to natural processes — they oxidize and fail within several months,” Rashkov said. “We hope we can eventually design more affordable neural interfaces that do not require implantation.”

READ MORE: Neural network reconstructs human ‘thoughts’ from brain waves in real time [Moscow Institute of Physics and Technology]

More on AI: What Are YOU Looking At? Mind-Reading AI Knows