A creepy AI transfers the facial expressions of one person to another to create eerily realistic 'deep fake' videos.

The software accurately flips a segment of one video - such as the mouth of a character - to the style of another to create life-like fake clips.

A video produced by the team transferred the mouth movements of British comedian John Oliver onto the face of US talk-show host Stephen Colbert.

Researchers warned the technology could be used to create fake news clips that falsely put words into the mouths of politicians or other powerful figures.

Scroll down for video

An AI transfers the facial expressions of one person to another to create eerily realistic 'deep fake' videos. It was able to flip the mouth movements of several celebrities (input) onto other well-know figures (output) to make them appear as if they were saying things they weren't

Scientists at Carnegie Mellon University in Pittsburgh developed a new type of AI called a Recycle-GAN for their study.

It builds on a type of AI algorithm called a GAN, which stands for generative adversarial network.

GANs pit one AI against another, with the first generating new videos and the second one analysing and rating their quality before sending it back to the original bot.

Over thousands of calculations, the pair eventually become adept at their given task.

The new study added an extra step to make a GAN that created incredibly realistic fake videos.

The new method cycles between the two - like translating English speech into Spanish and then the Spanish back into English, to check it still makes sense.

The technology could one day be useful for movie producers, making jobs such as dubbing or converting black-and-white films to colour a breeze.

But researchers also acknowledged that face-swapping AIs hold potentially disastrous consequences if used in the wrong hands.

'It was an eye opener to all of us in the field that such fakes would be created and have such an impact,' said study coauthor Aayush Bansal.

'Finding ways to detect them will be important moving forward.'

HOW DOES FACE-SWAPPING AI WORK? A team led by Stanford University scientists has created an AI that can swap the facial movements of a person in one video to the subject of another. The AI works by first analysing the intricate facial movements of a target, whose likeness will be used in the fake video. It picks out the target's head tilts, eye motion, mouth details, blinks and learns their typical movements. The software then analyses these same landmarks on a face in a source video - the one whose movements will be swapped to the target. After it captures the nuanced facial movements of the source, the AI reproduces them using the target's own, natural expressions. This creates a strikingly realistic fake clip because the target's normal face movements and ticks are emulated. The AI learns using an Adverserial Neural Network, a relatively new type of AI that rapidly trains itself to recognise patterns in data. Two AIs are pitched against one another, one to create, the other to analyse, in a string of millions of back-and-forth adjustments. This makes the learning process quicker and more accurate than if a human were to analyse each of the AI's attempts. Advertisement

This is not the first time a GAN has been used to make fake videos of celebrities.

A shocking deep fake video that appeared to show former US President Barack Obama calling Donald Trump a 'total and complete dips***' went viral in April.

Comedian and actor Jordan Peele made the video to warn the US public about videos faked using AI.

The technology could one day be useful for movie producers, making jobs such as dubbing or converting black-and-white films to colour a breeze

Peele's voice and mouth were digitally inserted into the video using sophisticated technology powered by artificial intelligence, called 'deepfakes'.

'We're entering an era in which our enemies can make it look like anyone is saying anything at any point in time — even if they would never say those things,' 'Obama' said in the video.

'So, for instance, they could have me say things like, I don't know, [Black Panther's] Killmonger was right, or Ben Carson is in the sunken place.

'Or, how about this: Simply, President Trump is a total and complete dipshit'.