Home Blog Generative Models: Human-Understandable Explanations for AI Decision-Making

Generative Models: Human-Understandable Explanations for AI Decision-Making

Published: April 10, 2023
Writer at Plat.AI
Writer: Sona Poghosyan
Editor at Plat.AI
Editor: Ani Mosinyan
Reviewer at Plat.AI
Reviewer: Alek Kotolyan

Artificial Intelligence (AI) systems are increasingly utilized in our daily lives, but the opacity of their decision-making processes can raise ethical concerns and questions about their reliability. To address this issue, researchers are exploring the use of generative models for Explainable AI (XAI).

Explainable AI (XAI) is an approach to developing artificial intelligence (AI) systems that can be easily understood and interpreted by humans. XAI systems are designed to provide clear explanations of how they arrived at their decisions or recommendations so that users can understand the rationale behind them. XAI techniques include visualization tools, natural language processing, and other methods to make AI systems more interpretable and explainable.

Generative models are AI models that can create new data similar to a training dataset. In the context of XAI, these models can generate explanations for AI decision-making in a way that is easy for humans to understand. This can help build trust in AI systems and ensure they make ethical and fair decisions.

This article aims to provide an overview of generative models for XAI. More specifically, we will examine different generative models, including Variational Autoencoders (VAEs) and Generative Adversarial Networks (GANs), and discuss how they can be used for XAI.

What Is a Discriminative Model?

A discriminative model is typically trained using supervised machine learning, where the model is given input data that is labeled with the correct output category. This allows the model to learn to identify patterns in the input data that are associated with each category without needing to understand the underlying generative process that produced the data.

Some common examples of discriminative models include Support Vector Machines (SVMs), Logistic Regression, and Artificial Neural Networks. Let’s explore them one by one.

Support Vector Machines (SVMs)

Support Vector Machines (SVMs) are a type of machine learning algorithm used for classification and regression tasks. SVMs use discriminative modeling to learn a decision boundary that separates different classes of data. This boundary is chosen to maximize the margin between the decision boundary and the closest data points, which helps ensure that the SVM can generalize well to new data. Here are a couple of tasks SVMs can be used for:

  • Image Classification: SVMs have been used to classify images into different categories, such as identifying whether an image contains a cat or a dog.
  • Sentiment Analysis: SVMs have been used to classify text data, such as reviews or social media posts, into positive or negative sentiments.
  • Bioinformatics: SVMs have been used to classify genetic data and identify patterns that may be associated with a specific disease.
  • Finance: SVMs have been used to predict stock prices and identify potential investment opportunities.
  • Computer Vision: SVMs have been used to detect objects in images and identify specific features of interest.

One representative example of generative modeling methods that can be used with SVM is the Gaussian mixture model (GMM) combined with SVM for classification tasks.

In GMM, the data is modeled as a mixture of several Gaussian distributions. Each Gaussian represents a cluster of data points, and the mixture weights determine the importance of each Gaussian. By estimating the parameters of the Gaussian distributions, GMM can generate new data points with similar characteristics to the original data.

To use GMM with SVM, data analysts first train a GMM on the training data to learn the underlying distribution of the data. Then, they use the GMM to generate synthetic data points, which are added to the training set to augment the dataset. Finally, they train an SVM on the augmented dataset to improve the classification performance.

For example, let’s say we have a dataset of images of cats and dogs, and we want to train an SVM classifier to distinguish between them. We can use GMM to generate synthetic images of cats and dogs with similar characteristics to the original images but with some variations. These synthetic images can be added to the training set to increase the size of the dataset, which can improve the generalization performance of the SVM classifier.

Logistic Regression

Logistic regression is a statistical machine-learning algorithm used for classification tasks. It is a type of regression analysis used when the dependent variable is binary or categorical. Logistic regression aims to predict the probability of a specific outcome based on input features.

Logistic Regression

In logistic regression, the output is a logistic function that maps the input features to a probability value between zero and one. This probability can then be used to classify the input data into one of two or more classes.

Logistic regression is widely used in many different fields, including the following:

  • Healthcare: Logistic regression can predict the likelihood of a patient developing a particular disease based on their medical history and other risk factors such as age, gender, and family history.
  • Marketing: Logistic regression can predict which customers are more likely to buy a certain product or service.
  • Finance: Logistic regression can predict the likelihood of a loan default based on the borrower’s credit history and other factors such as income, loan amount, employment status, and debt-to-income ratio.
  • Social Sciences: Logistic regression can predict outcomes in political elections, analyze survey data, and study human behavior.

A representative example of how logistic regression provides explanations for humans is by analyzing the relationship between the predictors and the predicted outcome in terms of odds ratios.

For instance, consider a dataset with information about the gender, age, and smoking status of a group of patients and whether they have developed lung cancer. Medical providers can use logistic regression to model the probability of a patient developing lung cancer based on these predictors.

After fitting the logistic regression model, doctors can interpret the model’s coefficients as the change in the log odds of developing lung cancer associated with a unit change in each predictor. To make these results more interpretable for humans, medical professionals can exponentiate these coefficients to obtain odds ratios.

For example, let’s say that the logistic regression model estimates a coefficient of 0.5 for smoking status, which means that for every additional pack per year of smoking, the log odds of developing lung cancer increase by 0.5. Providers can exponentiate this coefficient to obtain the odds ratio, which tells them how likely a patient is to develop lung cancer if they smoke one additional pack a year compared to a patient who doesn’t smoke.

Suppose the odds ratio associated with smoking status is 1.6. This means that a patient who smokes one additional pack a year is 1.6 times more likely to develop lung cancer compared to a patient who doesn’t smoke after controlling for the effects of other predictors in the model.

By presenting odds ratios for each predictor, the model can provide easy explanations for humans to understand and interpret. These explanations can help healthcare providers and patients make informed decisions and take appropriate actions based on the results of the logistic regression model.

Artificial Neural Networks 

Artificial Neural Networks (ANNs) are machine learning algorithms inspired by the structure and function of the human brain. ANNs are composed of layers of interconnected nodes, or neurons, that process information and make predictions based on input data.

In ANNs, the input data is passed through the network, and the weights of the connections between neurons are adjusted during training to improve the accuracy of the model’s predictions. ANNs can be used for various tasks, including classification, regression, and pattern recognition. Here are a few fields ANN is used in:

Transportation 

ANNs can optimize traffic flow, predict travel times, and improve public transit. ANNs can be used to model the interactions between vehicles, pedestrians, and other elements in a transportation network to optimize traffic flow. For example, ANNs can predict traffic volume and congestion levels at different times of day and adjust traffic signals and other controls to improve traffic flow and reduce congestion.

Manufacturing

ANNs can optimize manufacturing processes and identify product defects. ANNs can be used to optimize various manufacturing processes such as machining, assembly, and quality control. For instance, ANNs can analyze data from sensors and other sources to identify patterns in the production process and adjust parameters such as temperature, pressure, or speed.

Education

ANNs can be used to personalize learning, predict student performance, and identify students who may need additional support. ANNs can be used to personalize learning by analyzing data on student performance, preferences, and interests. For example, ANNs can be used to recommend learning materials, activities, and assessments tailored to individual students’ needs and learning styles. Furthermore, ANNs can be used to predict student performance based on various factors, such as previous academic data, demographic data, and socio-economic status. This can help educators identify students who may be at risk of falling behind and provide them with additional support.

One way that ANNs can provide explanations for humans to understand is through a technique called “feature visualization.” Feature visualization involves generating visual representations of the patterns learned by the ANN to understand how the ANN is making its predictions.

For example, in image recognition, ANNs can learn to recognize different features of an image, such as edges, textures, or shapes, and use those features to classify the image into different categories. By visualizing these features, researchers can gain insight into how the ANN recognizes objects in images and identifies which features are most important for accurate classification.

What Is a Generative Model? 

A generative model is a type of unsupervised machine learning algorithm that aims to learn the underlying structure of a dataset to generate new samples that are similar to the original data. Unlike supervised learning, where the algorithm is trained on labeled data, generative models do not require labeled data, making them useful for tasks such as image and speech recognition. 

Common examples of generative deep learning are generative adversarial networks, variational autoencoders, and autoregressive models. So let’s dive deeper into these three.

Generative Adversarial Networks 

Generative Adversarial Networks (GANs) are generative models that use two neural networks, a generator, and a discriminator, to create new samples that are similar to the original data. 

The generator network creates new samples by taking random noise as input and generating data that is similar to the original data. The discriminator network tries to distinguish between the generated samples and the original data. 

The two networks are trained together in an adversarial manner, with the generator trying to fool the discriminator and the discriminator trying to correctly classify the generated samples.

GANs have shown great promise in a variety of fields, including the following:

  • Image and video generation: GANs can generate new images and videos that are similar to the original data. They have been used to create realistic images of faces, landscapes, and even entire cities.
  • Data augmentation: GANs can be used to generate new samples of data that can be used to augment existing datasets. This can be useful in tasks such as image recognition and natural language processing, where having a large dataset can improve performance.
  • Text generation: GANs can be used to generate new text that is similar to the original data. They have been used to create realistic-sounding news articles, chatbot conversations, and even entire books.
  • Style transfer: GANs can be used to transfer one image’s style to another. This can be useful in tasks such as photo editing and artistic expression.

While GANs are not typically used to provide explanations in the traditional sense, they can be used to generate visualizations that help humans understand complex data. For example, GANs have been used in medical imaging to create realistic 3D visualizations of organs and tissue structures from medical scans. These visualizations can help doctors and researchers better understand the body’s internal structures and identify potential issues or abnormalities.

In another example, GANs have been used to generate realistic images of cars, which can be helpful in the design process. By training a GAN on a dataset of car images, designers can develop new car designs that are similar to the training data but have unique features. This can help designers explore different design possibilities and features.

Variational Autoencoders 

Variational autoencoders (VAEs) are machine learning algorithms that can generate new data similar to existing data. They work by compressing the existing data into a smaller representation and then developing new data based on that compressed representation.

Variational Autoencoders 

VAEs are often used when a lot of data is available, but it is not labeled or categorized. For example, they can generate new images, remove noise from images, or detect unusual patterns in large datasets.

By learning the probability distribution over the compressed data, VAEs can generate new samples that are similar to the original data but not identical. This makes them useful for tasks like creating new artwork or music or exploring new variations on existing data.

VAEs have shown promise in a variety of fields, including the following:

  • Data compression: VAEs can compress data into a lower-dimensional representation that captures the most important features of the data. This can be useful in tasks such as image and video compression, where having a smaller file size is desirable.
  • Anomaly detection: VAEs can detect anomalies in data by comparing the reconstruction error of a given sample to the reconstruction errors of other samples in the dataset. This can be useful in tasks such as fraud detection and medical diagnoses.
  • Natural language processing: VAEs can generate new text that is similar to the original data. They have been used to create realistic-sounding news articles, chatbot conversations, and even entire books.
  • Robotics: VAEs can learn a compact representation of the robot’s environment, which can be used to plan trajectories and execute tasks.

Autoregressive Models 

Autoregressive models are based on the idea that past values of a time series can be used to predict its future values. In other words, they assume a relationship between a variable’s past values and its future values.

Autoregressive models work by fitting a mathematical equation to the time series data, which describes the relationship between the past values of the variable and its future values. The model then uses this equation to predict future values based on the past values of the variable.

Autoregressive models are widely used in many fields, including the following:

  • Finance: Autoregressive models forecast stock prices, exchange rates, and other financial time series. To use an autoregressive model for forecasting, historical data on the time series is collected and analyzed to identify patterns and trends in the data. The model parameters are then estimated using a technique such as maximum likelihood estimation or least squares regression. Once the model parameters are estimated, the model can be used to forecast future values of the time series. For example, in the case of stock prices, the autoregressive model would use past stock prices to predict future prices.
  • Weather forecasting: Autoregressive models predict future weather conditions based on past weather data.
  • Speech recognition: Autoregressive models recognize speech by predicting the next sound based on past sounds.
  • Signal processing: Autoregressive models are used to model and predict signals such as audio signals, EEG signals, and seismic signals.

One example of how autoregressive models can provide explanations is in the field of natural language processing. By training an autoregressive model on a large corpus of text, it is possible to generate new text that is similar in style and content to the training data. However, the generated text can sometimes be difficult for humans to interpret, especially if the model generates text that is different from what we expect.

To address this issue, researchers have developed techniques for visualizing the internal workings of autoregressive models. For example, one approach is to generate a heat map that shows the importance of each input token for generating each output token. This can help humans understand which parts of the input data are most important for developing each part of the output data.

Differences Between Generative and Discriminative Models

Generative models try to understand the underlying structure of the data by learning how the input features and output labels are related. This understanding is then used to generate new data that is similar to the original training data.

On the other hand, discriminative models only focus on learning the boundary between different data classes. They do not try to understand the underlying structure of the data, but instead, they try to classify new data based on what they have learned from the training data.

In simpler terms, a generative model tries to understand how the data was generated and then uses that knowledge to create new data, while a discriminative model only tries to classify the data based on what it has learned.

Generative Model Example

Let’s say you have a dataset of images of cats. A generative model would try to understand the underlying patterns and characteristics of these images to generate new images of cats that look realistic and believable, even though they may not have existed in the original dataset. In this case, a generative model could be a Variational Autoencoder (VAE), a type of neural network that learns to encode and decode images.

Discriminative Model Example 

Continuing with the same dataset of cat images, a discriminative model would only focus on identifying whether a given image contains a cat based on the features it has learned from the dataset. In this case, a discriminative model could be a Convolutional Neural Network (CNN), a type of neural network that learns to classify images.

Generative models can be helpful for tasks such as data generation and density estimation, but they are often more complex and computationally expensive. For example, generative models like GANs have been used to create realistic images that don’t exist in real life, while VAEs have been used to generate realistic and varied sentence completions in natural language processing tasks. 

Discriminative models, on the other hand, are generally simpler and more efficient, but they are better suited for classification tasks. Some examples of classification tasks where discriminative models are commonly used include:

  • Image classification – distinguishing between different objects or scenes in an image, such as classifying images of animals, plants, or buildings.
  • Sentiment analysis – determining the sentiment or emotion conveyed in a text, such as classifying tweets or product reviews as positive or negative.
  • Spam filtering – classifying emails as spam or not based on their content.
  • Fraud detection – identifying fraudulent transactions or activities, such as classifying credit card transactions as legitimate or fraudulent.

Key Takeaways 

  • AI systems are integrated into our daily lives, but their decision-making processes can raise ethical concerns and questions about reliability.
  • Researchers are exploring the use of generative models for Explainable AI (XAI) to provide explanations for AI decision-making in a way that is easy for humans to understand.
  • Generative models try to understand the underlying structure of the data by learning how the input features and output labels are related to each other.
  • Discriminative models only focus on learning the boundary between different data classes and classifying new data based on what they have learned from the training data.
  • SVMs, Logistic Regression, and Artificial Neural Networks are examples of discriminative models, while Generative Adversarial Networks (GANs) and Variational Autoencoders (VAEs) are examples of generative models.

Sum Up

As Artificial Intelligence (AI) systems become more prevalent in our daily lives, there is a growing need for Explainable AI (XAI) that can offer clear and comprehensive explanations for their decision-making processes. 

This is where generative models come in. Generative models are AI models that can create new data similar to a training dataset, and they can be used to generate explanations for AI decision-making in a way that is easy for humans to understand. Discriminative models, on the other hand, only focus on learning the boundary between different data classes, and they are generally simpler and more efficient.

Try our real-time predictive modeling engine and create your first custom model in five minutes – no coding necessary!

  • Fully operational AI with automated model building and deployment
  • Data preprocessing and analysis tools
  • Custom modeling solutions
  • Actionable analytics
  • A personalized approach to real-time decision making
By signing up, you agree to our Terms & Conditions and Privacy Policy.


Sona Poghosyan

WriterSona is a skilled writer, editor, and proofreader with years of experience in media and IT. Her work can be found in various tech, finance, and lifestyle publications. In her free time, she enjoys reading and writing about all things film and literature.


Recent Blogs