Brain imaging can show whether someone is knowingly committing a crime, or recklessly skirting the law, according to an experimental new study.

The study used functional magnetic resonance imaging, or fMRI, to look inside the brains of 40 subjects who were presented with the scenario of smuggling contraband through a security checkpoint, the scientists report today in The Proceedings of the National Academy of Sciences.

“Our results provide neural evidence of a detectable difference in the mental state of knowledge in contrast to recklessness and suggest, as a proof of principle, the possibility of inferring from brain data in which legally relevant category a person belongs,” they conclude.

The results could point a way toward better understanding motivations that determine punishments—up to and including the death penalty, in some states, the scientists said.

The group of subjects were asked to decide whether to carry the suitcase full of some “valuable content”—though it was never described as “contraband,” they explain. Some decided to take the luggage through the checkpoint, but others did not. Some were presented with unknown risk factors, and a level of uncertainty. Others were presented with situations making clear that they would, or would not, be breaking the law. Their brains—and the electrical activity going on within—were scanned with the fMRI. Machine learning, a form of artificial intelligence, picked out patterns in the complex neural wiring.

The areas that were predictive about knowing the risk were the dorsomedial prefrontal cortex and the medial orbitofrontal cortex, the middle and anterior cingulate cortex, the bilateral superior temporal gyrus and temporoparietal junction, and the bilateral anterior insula.

Reckless or unknown risks were driven by the occipital cortex.

Given the fMRI images, the researchers were able to determine which one of the subjects knew of their “illegal” actions—and which were simply behaving recklessly, they report.

“In principle, we are showing these brains states can be detected when the activity is taking place,” said Read Montague, a Virginia Tech computational neuroscientist and corresponding author on the paper.

However, limitations abounded—especially since there was no penalty truly at stake.

“Our experiment was done in a laboratory setting (with no real risk of going to jail) and participants were given the exact probabilities of events, whereas this may not be the case in ‘real life,’” they write.

“Obviously, in most cases, when someone is committing a crime they are not doing so while inside a scanner,” they add. “As I stands, our classifier represents a proof of concept, and not yet a useable tool.”

How such science would make it into trials of the future would also be a challenge, considering the difficulties in bridging the laboratory and the courtroom, added Montague.

“Scientists and lawyers speak different languages,” he said, in a school statement. “A translation goes on when you bring these groups together that gives new meaning to interdisciplinary.”

Neurobiological defenses have been a part of Western law-and-order systems for centuries, back to the days of “crimes of passion” in the 19th century and earlier. However, the rise of those defenses has been growing at a rocketing rate, to include brain trauma, insanity, blackouts, drugs and other explanations for criminal behavior in American courtrooms.

A massive study by Duke researcher Nita Farahany last year found that more than 1585 judicial opinions cited neurobiological evidence between 2005 and 2012, according to the paper, published in the Journal of Law and Biosciences. The number grew at an accelerating pace: the 250 “brain problem” defenses raised in 2012 was double the number in 2007, Farahany added. The totals amounted to about 5 percent of all murder trials, and 25 percent of death penalty murder cases, they found. Among those cases counted, defendants blamed their actions on brain trauma, addictions and developmental disabilities. They used the neurological disorders to debate their competency to stand trial, attribute their actions to insanity or immaturity (for juvenile defendants), and to argue for lesser sentences.