Scientists at the University of California, Berkeley, have created a machine that can read your mind — sort of.

Associate professor of psychology Jack Gallant and two researchers, Kendrick Kay and Thomas Naselaris, first trained a computer program to recognize which of a set of 1,750 photos Kay and Naselaris were looking at while their brains were scanned by an MRI machine of the sort ordinarily used in hospitals.

To do this, they made unique mathematical models of each photo, most of which were black-and-white images of familiar objects scaled down to only 64 x 64 pixels, not much bigger than the thumbnail images you see in the photo box to the left.

• Click here to visit FOXNews.com's Natural Science Center.

They also took functional MRI images of blood flow in Kay and Naselaris' visual cortices, the areas in the back of their brains that process visual information, while they looked at each photo — and then made unique mathematical models of the brain images as well.

By comparing the two sets of numbers, the computer was able to correlate brain activity to visual information.

In other words, each photo created a unique, recognizable blood-flow "fingerprint" in the subjects' brains.

That's pretty nifty, but so far the team was merely doing work that others had done before.

They then took it a step further. It turns out that definite patterns existed between similar photos and similar brain scans.

Kay and Naselaris were each shown 120 new photos they hadn't seen before while their brains were scanned.

Using the pre-established patterns, the computer was able to match the new scans to the new pictures with an amazing degree of accuracy.

In fact, for one of the test subjects, the scans and photos matched up 92 percent of the time.

For the other, it was 72 percent, but that's still much better than chance. Randomly matching 120 pictures and 120 scans should only be right 0.8 percent of the time.

The team broadened the experiment to include 1,000 new photos and got an accuracy rate of 80 percent, still pretty impressive.

"You can imagine using this for dream analysis, or psychotherapy," Gallant told the Web site of the scientific journal Nature, where the full study paper was published Wednesday.

Still, he cautions that we're a long way from being able to tell what people are thinking, or even seeing if it's not one of a preselected set of images.

"But already," Gallant told HealthDayNews, "this research makes clear that there's a huge amount of information — way more than we have expected — that we can dig out of fMRI signals to get a better understanding of brain function."

• Click on the highlighted links to read reports from Nature, the Daily Telegraph, the Washington Post, the Guardian and Ars Technica.