Artificial intelligence (AI) is all around you, if it isn’t affecting your job, it is a part of your phone. In what might be a kick-start to doomsday, scientists have developed AI, which might be able tell what you are thinking by reading your brain scans.

A research team from the Carnegie Mellon university has deconstructed the human brain’s complex thoughts by reverse-engineering brain scans from a functional magnetic resonance imaging (fMRI) machine and using AI to predict what an individual is thinking at a point of time. The AI might be the key to studying the building blocks used by the brain for complex thoughts.

Read: Humans vs. AI: The History And Future Of Artificial Intelligence

“One of the big advances of the human brain was the ability to combine individual concepts into complex thoughts, to think not just of ‘bananas,’ but ‘I like to eat bananas in evening with my friends. We have finally developed a way to see thoughts of that complexity in the fMRI signal. The discovery of this correspondence between thoughts and brain activation patterns tells us what the thoughts are built of,” said psychology professor Marcel Just, the lead author of the study titled, “Predicting the Brain Activation Pattern Associated With the Propositional Content of a Sentence: Modeling Neural Representations of Events and States,” published 22, June. 

For the study, the research team examined brain scans, which were taken while the subjects were responding to 240 complex events such as social interactions and emotional triggers. After training the algorithm, they tested it on the brain scans taken while responding to these events and in 239 out of 240 cases, the algorithm was not only able to predict the thought triggering the brain scan, but even the order of the particular sentence formed by an individual in response to such events. The total rate of accuracy for the algorithm was a massive 87 percent. Furthermore, the AI-based algorithm was also able to reconstruct thoughts triggered by a particular sentence.

That being said, what the algorithm needs is consistent data. If your thoughts are not consistent with the regular data it depends on, you just might have a chance to trick it.

Simply explained, scientists have successfully demonstrated the use of AI to not just deconstruct and interpret a human thought in a situation, but even recreate that thought using the stimuli. While how the brain works in entirety is still not known, AI will be able to accurately predict the responses and thoughts of regular people in particular situations.

If you haven’t worried about the rise of the machines before, now might be a great time to see it happening.

Read: Will AI Take Your Job? Vinod Khosla Says Artificial Intelligence Could Replace Oncologists In The Future

While the AI algorithm is currently just a part of research, it is not difficult to imagine a robot equipped with such technology along with the ability to scan brains, say a miniature fMRI machine. This might even be done using a supercomputer linked with scanners to predict thoughts, like Skynet.