Sexuality, political leanings and intelligence can be gleaned from the things people choose to "like" on Facebook, a study suggests.

Researchers at Cambridge University used algorithms to predict religion, politics, race and sexual orientation based on activity on the social networking site.

The research in the journal PNAS forms surprisingly accurate personal portraits, researchers said.

But privacy campaigners said the findings are a cause for concern for users.

The study used 58,000 volunteers who alongside their Facebook "likes" and demographic information also took part in psychometric testing to highlight personality traits.

The Facebook likes were fed into algorithms and matched with information from the personality tests.

The algorithms proved 88% accurate for determining male sexuality, while Christians and Muslims were correctly identified in 82% of cases, and relationship status and substance abuse was predicted with an accuracy between 65% and 73%.

The links or pages users liked rarely explicitly revealed these attributes. For example, fewer than 5% of gay users had likes for, say, gay marriage. Instead, the algorithms created personal profiles by aggregating likes such as music and TV shows.

It also threw up some surprising conclusions about some users, depending on their activity.

"Curly fries correlated with high intelligence and people who liked the Dark Knight tended to have fewer Facebook friends," said author David Stillwell.

Nick Pickles, director of privacy campaign group Big Brother Watch, said the study should ring alarm bells for those who trust pri-vacy settings on such sites.