Weekly GenAI Nugget 2 — Understanding GAN, one of the most widely used Gen AI models using a simple story. A visit to the Grocery store
In the previous post, I introduced the basics of AI and how it relates to GENAI. Today, I will briefly explain how GenAI evolved over-time and share a short story to illustrate the main architecture behind GenAI.
Roots of GenAI
GenAI has its roots in the 1950s, when the concepts of artificial intelligence and machine learning (ML) were emerging. IT pioneers like Alan Turing and John McCarthy contributed to the foundation of GenAI by proposing early models of computation based on the idea that machines could emulate human intelligence.
The field progressed and in 2014, Ian Goodfellow and his colleagues at the University of Montreal invented generative adversarial networks or GANs. Since then, GANs have become the most popular generative AI model.
GAN is a machine learning algorithm that pits two neural networks — generator and discriminator — against each other, hence the “adversarial” part. The competition between two neural networks takes the form of a zero-sum game, where one agent’s gain is another agent’s loss.
Pic source — https://learnopencv.com/generative-and-discriminative-models/
In a non-technical language:
- Generative models can generate new data instances.
- Discriminative models the decision boundary between the classes
Story to explain GAN
Imagine that you are a parent who wants to test your children’s knowledge of vegetables. You have visited a grocery store with your two kids and just returned home and bought a variety of fresh produce, including a cauliflower. You decide to ask your children a simple question by showing a cauliflower on the table: “Is this a pumpkin or a cauliflower?”
One of your children, let’s call her A, is very creative and likes to draw. She quickly grabs a piece of paper and sketch images of both a pumpkin and a cauliflower. She compares the shapes, sizes, colours, and textures of the two vegetables and try to match them with the one you are holding. After a few moments, she confidently declares, “It’s a cauliflower.”
The other child, let’s call him B, is very observant and has a good memory. He recalls the different vegetables he saw at the store and the features that distinguished them. He remembers that pumpkins are orange, round, and have a stem, while cauliflowers are white, irregular, and have green leaves. He looks at the vegetable you are holding and instantly replies, “Cauliflower.”
In this scenario, both children successfully identified the vegetable, but their approaches differed greatly. A, akin to a generative model, employed their ability to generate representations of both options before deciding. B, resembling a discriminative model, relied on the distinct properties they had observed to classify the vegetable.
My previous story
Introduction to AI, ML, DL, Generative AI and NLP and the relationship between them (with a focus on GenAI).— https://medium.com/@amitadhiman3001/introduction-to-ai-ml-dl-generative-ai-and-nlp-and-the-relationship-between-them-with-a-focus-c21ff10bbfad