We've all goofed up and flubbed up things we've previously done time and again.

It turns out the root of these brain farts may be a special kind of abnormal brain activity that begins up to 30 seconds before a mistake even happens.

The solution to such screw-ups could be a kind of mind-reading hat, a device to predict and even prevent mindless errors that can threaten lives.

When people blunder after performing the same task over and over, scientists had suspected that such lapses were due to momentary hiccups in concentration. Still, little was known about what the brain was actually doing before such errors.

To investigate further, the brains of volunteers were scanned as they performed a monotonous task — repetitively pushing buttons that matched images flashed at them.

Scientists astonished

Unexpectedly, before volunteers made errors, their brains started displaying abnormal behavior ... up to a half-minute beforehand.

"We thought initially that it would be quite remarkable if we were to find abnormal activity six or so seconds ahead," said researcher Tom Eichele, a neuroscientist at the University of Bergen in Norway. "That the entire process spans across a much longer timescale was quite astonishing and spooked us, such that we checked this finding over and over again."

One set of brain regions that is normally active only when a person is awake and relaxed began firing up — in other words, it's as if the brain started resting. At the same time, another group of brain regions that is usually lively when a person is sustaining effort on a task began toning down. After people made and detected any mistakes, the abnormal behavior went away.

The international team of researchers suspects this abnormal behavior is the result of the brain attempting to save effort on a task. When the brain goes too far, errors occur.

"We did not find much evidence that the brain is just getting tired. However, I don't think that we understand it well enough to bet all our money yet," Eichele said.

Fix it

If portable devices could detect this abnormal brain activity before an accident happened, they could save lives — say, by sounding an alert before a slip is made while driving a car or operating a piece of machinery in a factory.

The problem is the researchers scanned the brains of volunteers using functional MRI. This conventionally has patients lying down in a large tube while slowly getting probed with powerful magnetic fields and radio wave pulses — not exactly ideal helping people in everyday situations.

However, if such abnormal brain activity can get detected simply using electrodes on the scalp, then brain-scanning caps under development for video games and other applications might work, Eichele said. "It, at least, does not seem technically impossible," he told LiveScience.

Even if a mind-reading hat can detect this abnormal brain activity, there may be too many brain waves to decipher out any early warning signals, Eichele cautioned. "It might give out warnings all the time, which would be helpful, or not give you any warning, which is also not helpful," he said. "We have to figure out how sensitive and how specific we can go."

Eichele and his colleagues soon hope to see if electrodes on the scalp can detect these signals. "We might also take experiments into virtual reality — virtual car driving, virtual piloting — to look for these signals," he said.

The scientists detailed their findings online April 21 in the journal Proceedings of the Natural Academy of Sciences.