Imagine you're thinking of a goldfish.

Now, what if artificial intelligence could interpret what you're thinking and turn that into an AI-generated image of a goldfish – or at least a pretty close version of it?

It may sound like something out of science-fiction, but a preprint study published in November tried to do exactly that, producing some fascinating AI-generated images in the process.

The images you'll see below on the left show the reference image that was shown to participants in the study. The images on the right are what the AI generated after parsing the participants' brain scans.

Leopard and a bat on the left images on the left look bear-like and toad like to an AI, on the right
Photos on the left are the images participants were shown. On the right are the images AI generated. (Seeing Beyond the Brain study)

The images show that the technology – designed to reconstruct images from reading recorded human brain activity – isn't perfect. But a team of researchers from Stanford University, the National University of Singapore, and the Chinese University of Hong Kong is getting closer to being able to achieve this feat.

In an experiment, the team collected data of participants' brain activity while they were shown pictures. While the team of researchers collected samples from many participants, the study published AI photo results from only one of the participants involved with the study.

Dog and bench on the left look like a bear and desk to AI, on the right
Photos on the left are the images participants were shown. On the right are the images AI generated. (Seeing Beyond the Brain study)

The researchers found that the AI was able to generate images that matched the original photos' attributes – such as color and texture – and overall theme 84 percent of the time, NBC reported.

An AI model was then fed the data, and reconstructed images based on the participants' thoughts while they were inside a functional magnetic resonance imaging (fMRI) machine. The team published their findings – including the resulting pictures – in a paper in November.

The team's work is focused on understanding activity from human brain scans, and ultimately using that data to decipher what a person is thinking. But in order to generate these images, the AI model used in the experiment had to go through hours of training.

Giraffe and a kite on the left look like a weird horse and a plane on the right
Photos on the left are the images participants were shown. On the right are the images AI generated. (Seeing Beyond the Brain study)

The AI model, known as Mind-Vis, was trained on a large pre-existing dataset with over 160,000 brain scans.

For the second part of its training, the AI was trained on another dataset from a small group of participants whose brain activity was recorded by an fMRI machine as they were shown images.

From this, the AI model learned to link specific brain activities with visualizing image features – such as color, shape, texture. To train the AI model, each participants' brain activity also had to be measured for 20 hours, NBC reported.

For the actual experiment, participants inside of an fMRI machine were once again shown a series of new images, and their brain activity was recorded by the machine. After all that, the AI was able to generate images based on assessments it made from participants' brain activity.

A lute and a kitchen on the left looks like a pen and a workshop on the right
Photos on the left are the images participants were shown. On the right are the images AI generated. (Seeing Beyond the Brain study)

This experiment is just one of several similar brain activity and AI-image experiments that have cropped up in the last few years.

In early March, Vice reported about a group of researchers from Japan's Osaka University who conducted an experiment with similar aims. The results of their experiment were released in December. But in their paper, the researchers explained their study didn't involve training an AI model to create the images.

In 2019, Futurism reported about an experiment from a team in Russia where an AI sketches what a person, who is wearing an electrode cap, is seeing at that moment.

Gold fish and an owl looks like a brown fish-like thing and a strangely eared ape on the right
Photos on the left are the images participants were shown. On the right are the images AI generated. (Seeing Beyond the Brain study)

The technology still has a ways to go before it can be widely used. But Zijiao Chen, a doctoral student at the National University of Singapore and one of the researchers on the study, wrote in an email to Insider that as the technology is further developed, it could be used in medicine, psychology, and neuroscience.

Treatments for people with neurological disorders could potentially be created with this technology, Chen wrote. For example, people who are not able to verbally communicate could communicate instead with their thoughts.

Chen wrote that her team hopes that, as the technology improves, people will eventually be able to "control a computer by just thinking of the commands instead of typing on the keyboards".

In a perfect world, Chen added that we could even get to a point where phones are no longer needed to communicate. Instead, people could send messages just by thinking.

This article was originally published by Business Insider.

More from Business Insider: