Discovering the Fascinating Possibilities of AI
Let’s play a game - can you guess what these portraits have in common?
They all depict non-existent people. All these images were created by artificial intelligence. We could say, that AI “dreamed” those people up.
How can a machine make up people’s faces?
The genius idea came from Ian Goodfellow, who was a PhD student back then in 2014, when he and his colleagues published a paper on this topic. He suggested a concept known as GAN – generative adversary networks. Generative because they generate -> create results (images) and adversary because the two networks act as opponents – they are “playing a game” against each other. One of the networks wants to generate an image which looks realistic, and the other network has the task of telling if the image is generated by the network or if it is in fact an original image from the data set of real photos.
To better explain this concept we can use the popular forger and critic metaphor, which I personally find very useful. Imagine the following: one of the “players” (the deep learning network) wants to forge paintings, trying to imitate artworks, while the other one acts as an art critic, who he wants to be able to distinguish which painting is an original and which one is a forgery. So the forger begins his job by randomly creating images, and the critic assesses if the image is an original or forged. In our case, original would mean that the image comes from the original data set with portraits of real people. After each turn, both of the players become better at their job, ideally resulting in a situation when the forger creates images so good, that the critic has no way of telling if the painting is real or fake and thus will guess with a success rate of 50%, being right equally often as being wrong.
Want to get more specific?
The first network has the role of a generator – it uses input in the form of randomly sampled noise vector from a normal distribution and creates an output in the form of images, which is then fed to the other network. This one’s role is called discriminator because it tries to tell apart a fake input from a real one. The generator is continuously learning through the feedback of the discriminator, and vice-versa.
Building on this idea, a few years later, NVIDIA, the company you might know for designing and manufacturing graphics processing units, developed the styleGAN algorithm. Also, they made their code open-source in 2019. But to train a GAN, you need very large data sets so that the networks can learn from them. In the case of styleGAN, portraits of celebrities as well as creative commons license photographs from Flickr were used. NVIDIA were so nice and made available also the already trained model so that those interested could skip the time-consuming process of training the networks and jump to generating images right away.
At first, the images created by the styleGAN model resembled something straight out of Lovecraft’s Necronomicon, but be the judge yourself:
But as always, progress cannot be stopped and the new styleGAN2 model improved the results significantly, producing the images we fooled you with in the introduction to this article.
If you would like to try and guess which person exists in the real world and which maybe only in Matrix, go and try at this aptly named page: whichfaceisreal.com
After you gave it a go, here are some tips on how we can tell them apart (for now) only by looking for visual clues, the so called artifacts.
How to tell them apart
Be on the lookout for weird looking background. Since the whole training of the networks is focused on depicting realistic faces of people, the background generated has a tendency to be suspiciously distorted, blurred, at times it might contain the occasional monster.
This has been always a big problem, depicting such an extraordinarily detail-heavy body part like hair is tricky and many times, the image contains detached strains of hair seemingly growing out of uncommon parts of the face or hair looking as if it was painted with a thick brush, not having the appropriate pattern.
It seems that styleGAN has a hard time with generating pieces that go in pairs, like earrings. So if you see non-matching earrings, eyes looking in different directions, or glasses having mismatching frame shapes it could be a sign of AI doing its business.
- Water droplets
A dead giveaway that you re not looking on a real persons photo is seeing blobs that look like drops of water. These appear most commonly on parts of the image where the background borders the face.
The styleGAN model has problem when shifting the angle with which a person is facing the image. So at times, the teeth do not shift accordingly, remaining in the same position as if the person was facing the camera directly.
And what if the algorithms get even better?
In 2018 the new styleGAN made improvements, leading to some of those artifacts not happening anymore. Does this mean in the near future we wont be able to tell them apart by simply observing them with naked eye? Probably yes. But worry not, in order for AI to claim its reign and declare us their overlord will still have to fool mathematicians.
In a simple mathematical analysis of the pixels, images generated by the AI reveal themselves through suspicious patterns. When you convert images created by deep neural network algorithms into a frequency representation, you can easily recognize the because of their grid-resembling pattern. This discovery was made by Joel Frank and his team at the Ruhr-Universität Bochum.
In the discrete cosine transformation, the image is expressed as the sum of many different cosine functions, the researchers explain. While natural images consist mainly of low-frequency functions, artificially generated images show different types of artifacts in the high-frequency range.
It seems to be a structural problem of all deep learning algorithms, explains Frank. "We assume that the artifacts described in our study will always show whether the image is a deep-fake image created with machine learning".
So, you heard the man. There is no need to worry… for now.
Originally coming from a marketing background, decided to turn her life around and immerse herself into the wonderful exciting and most importantly – never boring world of technology and web development. Proud employee at MA-NO . Easily loses track of time when enjoying working on code. Big fan of Placebo, cats and pizza.
In today’s article we will write about how to make a working form that upon hitting that submit button will be functional and send the email (to you as a…
It is highly probable that while browsing the Internet, everyone of us has at some point stumbled upon a deepfake video. Deepfakes usually depict well-known people doing really improbable things…
Recently a strange video published on YouTube caused a controversy – it was a funny take on Queen Elizabeth’s traditional Christmas message created by Channel 4, a British public-service television broadcaster. They…
To be able to navigate the Internet, to enter a website and have it show us all the content we want and search for, certain functions and characteristics are necessary.…
Times are hard now, that humanity once more stumbled into a terrible pandemic. But in comparison to the poor folks back in 1918 when the Spanish flu was on wreaking havoc,…
Today we are going to study some concepts closely related to hashmaps. The concepts we are going to see are hashing and collisions. Hashing The idea of hashing with chaining is to…
The term Artificial Intelligence (AI), "the intelligence of the machines", unifies two words that, a priori, could not be associated, since the term intelligence is attributed to the faculty of…
It is 40 years since the first spam e-mail was sent. Surely most of the readers of this blog had not yet been born, as well as annoying mail with which we are bombarded in…
One of the things you always hear when you are talking to someone related to the M.L. world is that, one must learn Python because the vast majority of the…
Artificial Intelligence or AI is a trend in technology and has been the main topic of many philosophical debates as to where this field will lead us as humanity. This time…
The impetus and desire we have to launch our online store can be counterproductive if we have not defined a pre-launch strategy. If we are determined to launch our ecommerce…
If you run a small business, make no mistake: local search is imperative for your success. You might have lofty dreams of attracting the world to your website, but it’s…