Deep Learning
Deep Learning
1. Define deep learning. How does it differ from traditional machine learning?
a. Deep learning is a part of machine learning that uses neural networks with
many layers to process and analyze large amounts of data. Unlike traditional
machine learning, which often requires manual feature extraction, deep
learning automatically learns patterns.
2. What are activation functions in neural networks?
a. Activation functions decide if a neuron should activate or not. They add non-
linearity, helping the model learn complex patterns. Examples are ReLU,
Sigmoid, and Tanh.
3. What is the vanishing gradient problem?
a. In very deep networks, gradients become extremely small as they move
backward, causing the earlier layers to learn very slowly or not at all. It slows
training.
4. Supervised, unsupervised, and reinforcement learning:
a. Supervised: Uses labeled data (e.g., a photo of a cat labeled as "cat").
b. Unsupervised: Finds patterns in unlabeled data (e.g., grouping similar
photos).
c. Reinforcement: Learns by trial and error, like training a robot to walk.
5. What is overfitting?
a. When a model performs well on training data but poorly on new data, it has
overfit, meaning it "memorized" instead of learning.
6. Optimization algorithms:
a. Examples are SGD (Stochastic Gradient Descent), Adam, and RMSProp.
These help improve the model during training.
7. Difference between feedforward and RNN:
a. Feedforward networks process data only in one direction. RNNs can handle
sequential data (e.g., text, time series) by remembering past inputs.
8. What are epochs, batches, and iterations?
a. Epoch: One complete pass through the data.
b. Batch: A small subset of data used for training in one step.
c. Iteration: One update of the model using a batch.
9. What is the learning rate?
a. It’s how much the model adjusts with each step. A high rate learns quickly
but can overshoot, while a low rate learns slowly.
Section B
An image classification model identifies objects in images and categorizes them into
predefined classes. A common architecture used is a Convolutional Neural Network
(CNN).
• Steps to Build:
o Data Preprocessing: Clean and normalize the image data. Augment data by
rotating or flipping images to improve model generalization.
o Architecture: Start with convolutional layers to extract features, followed by
pooling layers to reduce data size. End with fully connected layers for
classification.
o Training: Feed the model labeled images and adjust weights using
backpropagation and an optimizer like Adam.
o Evaluation: Use metrics like accuracy, precision, and recall on test data to
measure performance.
Example: Classifying images of cats, dogs, and birds by training the model on thousands
of labeled images.
2. Attention Mechanisms
Attention mechanisms allow deep learning models to focus on the most relevant parts of
the input data. Instead of treating all inputs equally, the model assigns different "weights"
to different parts.
• How It Works: In tasks like translation, certain words in a sentence are more
important than others. Attention helps the model focus on key words while ignoring
less relevant ones.
• Applications:
o Language Translation: Focus on specific words for accurate translation.
o Image Captioning: Highlight important parts of an image to generate
meaningful descriptions.
Example: Translating “She sells seashells” into French. The model focuses on each word’s
meaning and its placement in the sentence to produce accurate output.
3. Autoencoders
Autoencoders are neural networks used for compression and reconstruction. They have
two parts:
Pretraining involves training a model on one task and fine-tuning it for another.
Example: Pre-training a language model on general internet data and fine-tuning it for
medical text analysis.
5. Ethical Implications
• Bias in Data: Models trained on biased data can make unfair decisions.
o Example: A hiring model might discriminate if trained on historical data that
excludes certain groups.
• Privacy Concerns: Using sensitive data like medical records raises privacy issues.
• Job Displacement: Automation could replace jobs in industries like manufacturing
or customer service.
The Internet of Things (IoT) generates massive amounts of data, and deep learning can
analyze this data for actionable insights.
• Applications:
o Predictive Maintenance: Monitor factory machines and predict failures
before they occur.
o Smart Homes: Analyze sensor data to adjust lighting or temperature
automatically.
Example: Analyzing vibration data from wind turbines to predict mechanical failures.
7. U-Net Architecture
U-Net is widely used for image segmentation tasks, especially in medical imaging.
• How It Works:
o U-Net combines low-resolution (context) and high-resolution (details)
features.
o It uses a "U" shape where the contracting path extracts features and the
expanding path reconstructs the segmented image.
In RL, an agent learns by interacting with an environment, receiving rewards for good
actions and penalties for bad ones.
• Steps:
o The agent takes an action.
o The environment responds with a new state and reward.
o The agent adjusts its strategy to maximize rewards over time.
• Applications:
o Robotics: Training robots to walk or pick objects.
o Game Playing: Beating humans in games like Chess or Go.
XAI makes AI decisions understandable to humans. This is crucial for trust and
accountability.
• Techniques:
o SHAP (SHapley Additive Explanations): Shows how much each input
contributed to the output.
o LIME (Local Interpretable Model-Agnostic Explanations): Explains
individual predictions by approximating them with simpler models.
• Applications:
o Healthcare: Explaining why a model diagnosed a patient with a condition.
o Finance: Clarifying why a loan application was approved or rejected.
Example: Showing which features (e.g., income, credit score) influenced a loan decision.
Section C
An image classification model identifies objects in images and categorizes them into
predefined classes. A common architecture used is a Convolutional Neural Network
(CNN).
• Steps to Build:
o Data Preprocessing: Clean and normalize the image data. Augment data by
rotating or flipping images to improve model generalization.
o Architecture: Start with convolutional layers to extract features, followed by
pooling layers to reduce data size. End with fully connected layers for
classification.
o Training: Feed the model labeled images and adjust weights using
backpropagation and an optimizer like Adam.
o Evaluation: Use metrics like accuracy, precision, and recall on test data to
measure performance.
Example: Classifying images of cats, dogs, and birds by training the model on thousands
of labeled images.
2. Attention Mechanisms
Attention mechanisms allow deep learning models to focus on the most relevant parts of
the input data. Instead of treating all inputs equally, the model assigns different "weights"
to different parts.
• How It Works: In tasks like translation, certain words in a sentence are more
important than others. Attention helps the model focus on key words while ignoring
less relevant ones.
• Applications:
o Language Translation: Focus on specific words for accurate translation.
o Image Captioning: Highlight important parts of an image to generate
meaningful descriptions.
Example: Translating “She sells seashells” into French. The model focuses on each word’s
meaning and its placement in the sentence to produce accurate output.
3. Autoencoders
Autoencoders are neural networks used for compression and reconstruction. They have
two parts:
• Encoder: Compresses input into a smaller representation (latent space).
• Decoder: Reconstructs the input from the compressed representation.
• Applications:
o Dimensionality Reduction: Reduce data size while keeping essential
information.
o Anomaly Detection: Identify outliers in data by looking for inputs that can’t
be reconstructed well.
o Denoising: Remove noise from images or signals.
Pretraining involves training a model on one task and fine-tuning it for another.
Example: Pre-training a language model on general internet data and fine-tuning it for
medical text analysis.
5. Ethical Implications
• Bias in Data: Models trained on biased data can make unfair decisions.
o Example: A hiring model might discriminate if trained on historical data that
excludes certain groups.
• Privacy Concerns: Using sensitive data like medical records raises privacy issues.
• Job Displacement: Automation could replace jobs in industries like manufacturing
or customer service.
The Internet of Things (IoT) generates massive amounts of data, and deep learning can
analyze this data for actionable insights.
• Applications:
o Predictive Maintenance: Monitor factory machines and predict failures
before they occur.
o Smart Homes: Analyze sensor data to adjust lighting or temperature
automatically.
Example: Analyzing vibration data from wind turbines to predict mechanical failures.
7. U-Net Architecture
U-Net is widely used for image segmentation tasks, especially in medical imaging.
• How It Works:
o U-Net combines low-resolution (context) and high-resolution (details)
features.
o It uses a "U" shape where the contracting path extracts features and the
expanding path reconstructs the segmented image.
In RL, an agent learns by interacting with an environment, receiving rewards for good
actions and penalties for bad ones.
• Steps:
o The agent takes an action.
o The environment responds with a new state and reward.
o The agent adjusts its strategy to maximize rewards over time.
• Applications:
o Robotics: Training robots to walk or pick objects.
o Game Playing: Beating humans in games like Chess or Go.
XAI makes AI decisions understandable to humans. This is crucial for trust and
accountability.
• Techniques:
o SHAP (SHapley Additive Explanations): Shows how much each input
contributed to the output.
o LIME (Local Interpretable Model-Agnostic Explanations): Explains
individual predictions by approximating them with simpler models.
• Applications:
o Healthcare: Explaining why a model diagnosed a patient with a condition.
o Finance: Clarifying why a loan application was approved or rejected.
Example: Showing which features (e.g., income, credit score) influenced a loan decision.