IT sounds like something straight out of science fiction - using people's memories to recreate faces they have seen in stunningly accurate detail.

But now Scottish neuroscientists have perfected a technique which allows them to do just that, conjuring a startling likeness in 3D based solely on a person's recollections.

And the technology could one day revolutionise the way police prepare composite e-fits of suspects, with witnesses able to provide a lifelike image of a face in a matter of hours.

It could also allow people to create a new look for themselves on social media, making themselves look younger or older at the touch of a button.

In a world first, a team from the University of Glasgow "reverse engineered" the information stored in people's brains when looking at a familiar face to produce a 3D model of the person being thought about.

The Herald:

The real face, right, and the computer recreation, left

Professor Philippe Schyns, visual cognition expert at the university's Institute of Neuroscience and Psychology, said that the study would be a cornerstone for greater understanding of the brain mechanisms of face identification, and could have applications for AI, gaming technology and eyewitness testimony.

READ MORE: Big Brother fear as CCTV to use face scanning software

He said: "It's difficult to understand what information people store in their memory when they recognise familiar faces, but we have developed a tool which has essentially given us a method to do just that.

"By reverse engineering the information that characterises someone's identity, and then mathematically representing it, we were then able to render it graphically."

The scientists from the University of Glasgow studied how 14 colleagues recognised the faces of four other boffins by looking for the specific facial information each person used to identify them from memory.

Volunteers were given a 'basic face' which matched the same age, gender and ethnicity of the person they were trying to recollect, and researchers began looking for the information which defines the "essence" of that person's identity.

READ MORE: Glasgow urged to let public see how it plans to use £1.2m face-scan CCTV system

They would then be given a set of six similar faces and asked to pick the one which most resembled the person in their mind.

The Herald:

The University of Glasgow

In the experiment, the researchers asked observers to rate the resemblance between a remembered familiar face, and randomly generated faces that shared factors of sex, age and ethnicity, but with random identity information.

Each time the face had a subtle difference, which provided a data point for the scientists to extrapolate. Over an exhaustive process - each subject had to view 1,800 images - the team were able to build up a database of information to draw on.

By studying how the volunteers' brains remembered faces, the scientists designed a computer model which was able to "crack the code"" of what defines visual identity, and then generate a likeness.

Across many trials, this led them to be able to reconstruct the information which is specific to the identity of an individual in someone else's memory.

Prof Schyns said that the technology had a number of practical applications, but would not be put to work solving crimes just yet.

READ MORE: Black hole ‘Event Horizon’ image captured for first time

He said: "It was a surprise we were able to render the faces so accurately, and we were pleased it worked so well.

"It is something which could be used by the police, but it would mean a lot more work for the person who is doing the efit.

"They would have to set out 10,000 images in total to get the level of precision we have achieved here."

However, the technology now exists and will be refined in time, meaning one day it could be a new weapon in the fight against crime

Prof Schyns said: "We are working to get it [the time needed to apply the test] down. It takes about three hours fir a volunteer to go through the test and it could be used by a witness if they are prepared to go through 1,800 trials."

As well as identification, the scientists were then able to use the mathematical model to generate new faces by taking the identity information unique to the familiar faces and altering it to change their age, sex, ethnicity or a combination of those factors.

At a touch of a button, they could show what the person would like like with their gender reversed, if they were 20 years older, or younger, or belonged to a different ethnic group.

The Herald:

The technology could be used for games like Tekken

Prof Schyns said that the technology could also be used in the gaming industry to provide realistic faces for crowd scenes, or to give people the perfect lifelike 'avatar' for social media.

It would also be able to be used to create a base face which could then be altered as the user desired - swapping their gender, making them more beautiful, or altering their age.

The paper, "Modelling Face Memory Reveals Task-Generalizable Representations", is published in the scientific journal Nature Human Behaviour.