Introduction
Artificial Intelligence is currently a great driver of innovation, and you might be hearing the words generative AI a lot. But what is generative AI, and what other types of AI are there?
While recent discussions often center around the captivating abilities of generative AI, it's essential to acknowledge the significance of other forms or AI, such as discriminative or predictive AI, which are a part of numerous practical applications - from diagnosing diseases to credit scoring and recommending what other movies you might watch or what other items you might want to put in your basket.
Part of a good practitioner’s or executive’s toolbox is to understand the differences between different AI types, and know when to use generative AI or a form of discriminative AI. This blogpost aims to clarify these distinctions, shedding light on the importance of each AI type and guiding users in making informed decisions about their implementation.
1. Generative versus discriminative AI in 3 metaphors
If you have played with generative AI you know it can generate content of various types. In contrast, discriminative AI focuses on analyzing and categorizing existing data, making predictions or decisions by identifying patterns and differences within the data it's given. In essence, while generative AI is about producing new things, discriminative AI is about understanding and classification.
Let’s look at this in 3 metaphors, before delving deeper into how generative and predictive AI work.
Imagine a detective and an artist. The detective (Discriminative AI) is skilled at analyzing clues and evidence to identify and categorize what's already there. Just as a detective examines details to decide if a suspect is guilty or not, discriminative AI looks at input data to classify it or make predictions. It's all about discerning and distinguishing between different pieces of information.
On the other hand, the artist (Generative AI) creates something new from a blank canvas. Like an artist drawing from imagination, generative AI builds new data instances or ideas that didn't exist before, based on its learning of other existing ideas and data instances. This initial training is essential, because generative AI creates something like the things it has seen before. Generative AI models learn to produce outputs that are similar to their training data. However, they don't just replicate; they interpolate and sometimes extrapolate based on the learned patterns and structures, creating new, unique instances. (this is what you will hear more of: generative AI doesn't just mimic what it has seen; it learns the underlying probability distributions of the data).
As any metaphor is bound to be an imperfect mapping to the concepts we are conveying, let’s look at a second metaphor. Imagine a librarian and a novelist. The librarian (Discriminative AI) is an organizer and identifier. They sort and categorize books, deciding where each one belongs based on its characteristics. Similarly, discriminative AI analyzes and categorizes data, determining what category or label fits the input it receives. The novelist (Generative AI) on the other hand is a creator, crafting new stories and worlds from their imagination. Like a novelist writing a new book, generative AI creates new data or content that didn't exist before, drawing from its vast learning and understanding of patterns and structures. It's the author of new information, not just an organizer.
And let’s have a look at a third imperfect metaphor for this - that of a museum curator and a painter or sculptor. The museum curator has an expert eye for detail and a deep understanding of art history. They scrutinize each piece, determining its origin, style, artist, and the period it represents. With this knowledge, they organize and classify the artworks, guiding visitors through a coherent narrative of art history. Similarly, discriminative AI analyzes and sorts through data, identifying patterns and categorizing information based on what it has learned. It's about understanding and placing data into the correct boxes, much like a curator decides how to categorize and display art pieces to best tell their stories. (The metaphor is imperfect of course because curators also tell stories, help certain interpretations, which is in a way a creative function.)
Now think of the painter (an embodiment of generative AI). She starts with a blank canvas or a block of raw material and, through her skill and imagination, creates something new and original. She draws inspiration from the world around her, her experiences, but what she produces can be unique. This process mirrors generative AI, which, after absorbing vast amounts of information and learning underlying patterns, generates new data instances, designs, or content.
2. Discriminative versus generative AI - key characteristics
2.1 Discriminative AI
Discriminative AI is a type of artificial intelligence focused on making accurate predictions and classifications based on input data. In our metaphors we talked about it as the detective, the librarian, the museum curator. Discriminative models analyze and interpret the data to identify patterns, classify information, or forecast future outcomes. They are particularly good at understanding the relationships between different features and the outcomes they're trying to predict.
Let’s look at these key functions - identifying patterns, classifying information and forecasting future outcomes and see how this applies in the real work with some use cases.
2.2. Identifying patterns is essentially about finding regularities or trends in data. In simple terms, it's like noticing that every time it rains, the streets get wet. You've identified a pattern: rain leads to wet streets. In the context of AI, this process involves algorithms sifting through large amounts of data to discover these kinds of connections or trends, which might not be immediately obvious to humans. Let’s see some use cases.
Your credit card rejects a transaction, because the AI system has identified a pattern of behavior that is inconsistent with your usual spending habits, such as attempting a high-value purchase in a foreign country late at night, which matches common characteristics of fraudulent activities. This is a Use Case in Credit Card Fraud Detection. Discriminative AI is implemented to help in this case. How does the process work?
It all starts with data collection, where the system amasses extensive transaction data, including both legitimate and fraudulent examples, noting details like transaction time, amount, and location. The AI then moves to pattern recognition, analyzing this data to pinpoint irregularities or trends that signify potential fraud, such as transactions at unusual hours, sudden high-value purchases, or activity in unexpected locations. Finally, in the detection phase, the AI continuously monitors new transactions. If a transaction exhibits characteristics similar to those of known fraudulent activities, the system flags it for review, preventing potential fraud. This process is a quintessential example of discriminative AI in action, where it's trained to recognize and act upon specific patterns indicative of fraud.
Let’s look at another use case of identifying behavioural patterns in e-commerce. An e-commerce platform wants to enhance its recommendation engine to provide better, more personalized suggestions to its users. They implement an AI that tracks and analyzes user behavior on the site, identifying patterns in browsing and purchasing. It notices, for instance, that users who buy pet food often browse pet toys and accessories shortly afterward. It also recognizes a pattern where late-night shoppers are more likely to purchase entertainment-related products. By identifying these and other patterns, the AI can predict future behavior and make proactive, personalized recommendations, such as suggesting pet toys to someone who just bought dog food or highlighting movies and games to those browsing late at night. This not only improves the user experience by making relevant suggestions but also increases sales and customer satisfaction.
What techniques are used for identifying patterns? The techniques are many. But here are two possible techniques for the use cases we talked about:
Use Case: Credit Card Fraud Detection - Technique: Neural Networks - Neural networks can learn complex patterns in transaction data that might indicate fraudulent activity. They can process a large number of inputs such as transaction amount, location, time, and frequency to identify suspicious patterns that deviate from a user's typical spending behavior.
Use Case: Customer Segmentation in Marketing - Technique: Decision Trees - Decision trees can help in segmenting customers based on various attributes like age, purchase history, and preferences. They can identify patterns in customer behavior that can be crucial for targeted marketing campaigns.
2.3 Classifying Information
Classifying information is about assigning data to predefined categories or labels based on its characteristics. It is like sorting different fruits into baskets labeled "apples," "oranges," and "bananas" based on their features like color, shape, and taste (though of course when using AI it can happen with hundreds of baskets at the same time, and in some AI types without knowing what the initial baskets are). As an AI key functionality, this involves algorithms analyzing data and deciding which category or label best fits each data instance. Let's look at some use cases that illustrate this.
Consider the classical case of classification: email spam filtering. Your inbox remains largely free of junk mail because the AI system has been trained to classify incoming emails as "spam" or "not spam." This is a Use Case in Email Spam Filtering. How does this system work effectively?
Initially, the system is fed a large dataset of emails that are already labeled as spam or not spam. It analyzes these emails, learning from features such as sender's address, subject line, and the frequency of certain words or phrases. Once the learning phase is complete, the AI applies this knowledge to new, incoming emails. If an email's characteristics closely match the learned spam patterns, it's classified as spam and filtered out, ensuring your inbox remains clutter-free. This is a prime example of classifying information, where the AI is trained to categorize data into distinct groups.
Let's explore another use case: Medical Diagnosis. In this scenario, an AI system assists healthcare professionals by classifying patient data into diagnostic categories. How does this system function?
The system begins with a comprehensive dataset of patient records, including symptoms, test results, and diagnoses. It employs techniques to understand and recognize patterns associated with various medical conditions. When new patient data is input, the AI analyzes it and classifies it into a diagnostic category, such as "diabetes" or "no diabetes." This helps doctors in diagnosing and treating patients more effectively and efficiently.
A variety of AI techniques can be used for classifying information? Here are just two techniques that could be applied to the use cases mentioned:
Use Case: Email Spam Filtering - Technique: Support Vector Machines (SVM): SVMs are powerful tools for classification, especially in high-dimensional spaces. They work by finding the best boundary that separates data into categories, which makes them very effective for text classification tasks like spam detection.
Use Case: Medical Diagnosis - Technique: Random Forest: Random Forest is an ensemble learning method that operates by constructing multiple decision trees during training. Each acting as an individual classifier. You can think of these trees as of a panel of medical experts. They each review the patient's data (the nodes, which represent various symptoms and test results) and then each proposes its diagnosis (a vote for a particular class). The final diagnosis is determined by the majority vote or the most common outcome among all the trees. This technique is especially useful when dealing with complex data structures and a large number of features, as often found in medical data.
In summary, classifying information is a critical task in AI, enabling systems to make sense of data by organizing it into predefined categories. Classification can take many forms: from distinguishing between friendly and malicious network traffic in cybersecurity, to categorizing news articles by topics for media outlets. Techniques like SVM and Random Forest are among the tools that make this possible, each bringing its strengths to different types of classification challenges.
2.4 Forecasting future outcomes (prediction)
Forecasting future outcomes is about predicting what will happen next based on historical and current data. It's like a weather forecaster predicting rain tomorrow based on today's humidity levels and wind patterns. In AI, forecasting involves algorithms that analyze past and present data to make predictions about future events or conditions. This is a crucial task in many industries, from finance to meteorology. Here's how it plays out in specific use cases.
Consider the case of Stock Price Prediction. Investors are keen on knowing whether the price of a particular stock will rise or fall in the future. This is where an AI system comes into play. How does it assist in this complex task?
The system starts by collecting vast amounts of historical stock price data and market indicators. It then employs Gradient Boosting Machines, a powerful predictive technique. These machines learn from the historical data, identifying trends and patterns that influence stock prices. They make predictions about future stock prices by considering these patterns and the current market conditions. By doing so, they provide investors with insights that aid in making informed investment decisions.
For weather prediction, one might use RNNs and LSTMs - forms of neural networks specifically designed to handle sequential data. They are capable of learning patterns over time, which makes them exceptionally suited for tasks like weather forecasting where past and present data are used to predict future conditions.
They are many other example uses of prediction. In energy sectors, AI predicts demand and supply fluctuations, aiding in efficient grid management and renewable resource allocation. The prediction function is a key function of discriminative AI.
And while we have talked about identifying patterns, classification and prediction separately, it is more likely you will encounter mixed use cases. For instance, in the field of finance, AI not only predicts market trends but also classifies investment risks, combining pattern identification with predictive analytics. In agriculture, AI predicts crop yields by analyzing weather patterns and soil conditions, while also classifying plant health from drone-captured images. In urban planning, predictive models forecast population growth and traffic flow, aiding in the efficient design of cities, while simultaneously classifying areas based on land use.
For now it is important to remember that if a problem or the solution you are proposing has anything to do with pattern identification, classification or prediction, you are most likely dealing with discriminative AI and its methods.
So what about generative AI? What are its main use cases and methods, and how does generative AI look like in action? Read the second part of this blogpost to find out.
Introduction
Generative versus discriminative AI in 3 metaphors
Let’s look at this in 3 metaphors, before delving deeper into how generative and predictive AI work