Convolutional Neural Networks
- 41Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is machine learning according to the course?
41 questions
- 1
What is machine learning according to the course?
Model answer
Machine learning is a subdomain of computer science that focuses on algorithms that help a computer learn from data without being explicitly programmed.
Explanation
This definition sets the foundation for understanding the field.
- 2
What are the three main types of machine learning?
Model answer
Supervised learning, unsupervised learning, and reinforcement learning.
Explanation
These categories are distinguished by the availability of labels and the learning environment.
- 3
Describe supervised learning and give an example.
Model answer
Supervised learning uses labeled input-output pairs to train a model to predict outputs. Example: classifying images of cats and dogs with labels.
Explanation
The model learns to map inputs to known outputs.
- 4
What is unsupervised learning?
Model answer
Unsupervised learning uses unlabeled data to find patterns or groupings without predefined categories.
Explanation
The model discovers hidden structures in the data.
- 5
Explain reinforcement learning with an analogy.
Model answer
Reinforcement learning involves an agent learning by interacting with an environment, receiving rewards or penalties. Like training a dog: sit gets a treat, bark gets scolded.
Explanation
The agent learns to maximize cumulative reward.
- 6
What is a feature vector in supervised learning?
Model answer
A feature vector is an ordered list of numerical values representing the attributes of a single sample, used as input to a model.
Explanation
It's the input representation for each example.
- 7
Differentiate between qualitative and quantitative data.
Model answer
Qualitative data is categorical (e.g., gender, country), while quantitative data is numerical (e.g., length, temperature).
Explanation
Qualitative has finite categories; quantitative can be measured.
- 8
What is nominal data? Give an example.
Model answer
Nominal data is categorical with no inherent order. Example: country of residence.
Explanation
Categories are not ranked.
- 9
What is ordinal data? Give an example.
Model answer
Ordinal data is categorical with a natural order. Example: happiness ranking (1-5).
Explanation
Order matters, but differences may not be equal.
- 10
Describe the difference between discrete and continuous quantitative data.
Model answer
Discrete data can only take specific values (e.g., number of eggs), while continuous data can take any value within a range (e.g., length of a desk).
Explanation
Discrete is countable; continuous is measurable.
- 11
What is binary classification?
Model answer
Binary classification predicts one of two classes (e.g., hot dog or not hot dog).
Explanation
Only two possible outcomes.
- 12
What is multi-class classification?
Model answer
Multi-class classification predicts one of more than two classes (e.g., classifying among 10 types of food).
Explanation
Multiple (>2) categories.
- 13
What is regression in supervised learning?
Model answer
Regression predicts a continuous value (e.g., price of Ethereum, house price).
Explanation
Output is a real number, not a class.
- 14
Explain the purpose of the training data set.
Model answer
The training data set is used to train the model by feeding it input-output pairs and adjusting weights to minimize loss.
Explanation
It's the largest portion of data used for learning.
- 15
What is the role of the validation data set?
Model answer
The validation data set is used to evaluate different models and select the best one during development (like a test drive).
Explanation
It helps tune hyperparameters and avoid overfitting.
- 16
What is the testing data set used for?
Model answer
The testing data set is used to evaluate the final chosen model's performance on unseen data.
Explanation
It provides an unbiased estimate of generalization.
- 17
What is a loss function?
Model answer
A loss function quantifies the difference between the model's predicted output and the actual target; lower loss means better performance.
Explanation
It guides the learning process.
- 18
Compare L1 loss and L2 loss.
Model answer
L1 loss is linear (penalty = absolute difference), L2 loss is quadratic (penalty = squared difference). L2 penalizes larger errors more heavily.
Explanation
L1 is less sensitive to outliers than L2.
- 19
When is binary cross-entropy loss used?
Model answer
Binary cross-entropy loss is used for binary classification problems where the output is a single probability (0 or 1).
Explanation
It measures the difference between predicted probabilities and true binary labels.
- 20
How is accuracy computed?
Model answer
Accuracy is the ratio of correct predictions to total predictions (e.g., 3 out of 4 correct = 75%).
Explanation
It's a common metric for classification.
- 21
Describe the basic structure of a neural network.
Model answer
A neural network consists of an input layer (features), hidden layers (nodes), and an output layer. Each node computes a weighted sum of inputs plus a bias, then applies an activation function.
Explanation
Multiple layers allow learning complex patterns.
- 22
What is a weight in a neural network?
Model answer
A weight scales the importance of an input to a node; they are adjusted during training to minimize loss.
Explanation
Weights are the parameters the model learns.
- 23
What is the bias in a neural network node?
Model answer
The bias is an additional constant added to the weighted sum, allowing the model to fit data that doesn't pass through the origin (like an x-intercept).
Explanation
Bias shifts the activation function.
- 24
Why are activation functions necessary in neural networks?
Model answer
Activation functions introduce non-linearity, preventing the entire network from collapsing into a linear model and enabling it to learn complex patterns.
Explanation
Without them, multiple layers would be equivalent to a single linear layer.
- 25
List three common activation functions and their shapes.
Model answer
Sigmoid (S-shaped), tanh (S-shaped centered at 0), and ReLU (rectified linear: 0 for negative, linear for positive).
Explanation
ReLU is commonly used because it helps with vanishing gradient.
- 26
Explain gradient descent in simple terms.
Model answer
Gradient descent iteratively adjusts weights by moving in the direction of the negative gradient (downhill) of the loss function to find the minimum.
Explanation
The step size is controlled by the learning rate.
- 27
What is the learning rate in gradient descent?
Model answer
The learning rate (alpha) is a small positive number that determines the size of the weight update step, preventing overshooting the minimum.
Explanation
Typical values are 0.001 or 0.0001.
- 28
What is a convolutional neural network (CNN)?
Model answer
A CNN is a deep learning model that extracts features from images using convolution layers, pooling layers, and then feeds the features into fully connected layers for classification.
Explanation
CNNs are especially effective for image recognition.
- 29
What is a convolution operation in image processing?
Model answer
A convolution slides a small filter (kernel) over the input image, performing element-wise multiplication and summing the results to produce a feature map.
Explanation
It detects patterns like edges.
- 30
What is a filter (or kernel) in a CNN?
Model answer
A filter is a small matrix (e.g., 3imes3) that is convolved with the input to extract features; its weights are learned during training.
Explanation
Different filters detect different features.
- 31
What is the purpose of pooling in a CNN?
Model answer
Pooling reduces the spatial dimensions of the feature maps, making the representation smaller and more manageable, and helps achieve translation invariance.
Explanation
Max pooling takes the maximum value in each window; average pooling takes the average.
- 32
Describe max pooling with a 2imes2 window.
Model answer
Max pooling divides the input into 2imes2 blocks and outputs the maximum value from each block, reducing the size by half.
Explanation
It retains the most prominent features.
- 33
What is a flattening layer in a CNN?
Model answer
The flattening layer converts the 2D feature maps from the last convolutional/pooling layer into a 1D vector to be fed into fully connected layers.
Explanation
It bridges the convolutional part and the dense classifier.
- 34
What is data augmentation? Why is it used?
Model answer
Data augmentation applies random transformations (e.g., flips, rotations) to input images to create more varied training data, improving generalization and reducing overfitting.
Explanation
It artificially expands the dataset size.
- 35
What is dropout and how does it help?
Model answer
Dropout randomly turns off a fraction (e.g., 25%) of neurons during training, forcing the network to learn redundant representations and preventing overfitting.
Explanation
It acts as a regularizer.
- 36
What is a kernel regularizer (e.g., L2)?
Model answer
A kernel regularizer adds a penalty on large kernel weights during training (e.g., L2 adds squared magnitude), limiting weight growth and helping prevent overfitting.
Explanation
It encourages simpler models.
- 37
What library was used to implement the CNN in the course?
Model answer
TensorFlow (with Keras) was used to build and train the CNN.
Explanation
It provides high-level APIs for deep learning.
- 38
What dataset was used for the hot dog classification project?
Model answer
The Food-101 dataset was used, which contains 101 food categories; the hot dog class is label 55.
Explanation
Images were resized to 128x128 pixels.
- 39
How was the data rebalanced for training?
Model answer
The hot dog (label 1) set was upsampled by repeating, and the not hot dog (label 0) set was sampled to match, using
sample_from_datasetswith 50/50 weights.Explanation
Balancing prevents bias toward the majority class.
- 40
What optimizer and loss function were used to compile the model?
Model answer
The Adam optimizer and binary cross-entropy loss (with
from_logits=True) were used because it's binary classification.Explanation
Adam adapts learning rates; binary cross-entropy is appropriate for two classes.
- 41
What accuracy did the final model achieve on the validation set?
Model answer
The final model achieved around 70% accuracy on the validation set (best around 75% with tuning).
Explanation
The baseline is 50% due to balanced classes.

Ask anything
We've read this whole study set, so questions about it get the best answers.