1. Home
  2. Explore
  3. Computer Science
  4. Deep Learning for Computer Vision

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Deep Learning for Computer Vision

  • 73Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Tensor Fundamentals

What is a tensor in TensorFlow?

73 questions

  1. 1

    What is a tensor in TensorFlow?

    1. A

      A data structure only used for images

    2. B

      A multi-dimensional array that is the core data structure in TensorFlow

    3. C

      A 2-dimensional array of numbers

    4. D

      A one-dimensional vector of numbers

    Correct answer
    B

    A multi-dimensional array that is the core data structure in TensorFlow

    Explanation

    Tensors are multi-dimensional arrays (0D scalar, 1D vector, 2D matrix, etc.) and are the core data structure in TensorFlow.

  2. 2

    Which TensorFlow function is used to create a constant tensor?

    1. A

      tf.variable

    2. B

      tf.tensor

    3. C

      tf.create

    4. D

      tf.constant

    Correct answer
    D

    tf.constant

    Explanation

    tf.constant is used to create a constant tensor with a fixed value.

  3. 3

    How can you create a tensor of all ones with shape (3, 4)?

    1. A

      tf.eye(3, 4)

    2. B

      tf.constant(1, shape=(3, 4))

    3. C

      tf.fill(dims=(3, 4), value=1)

    4. D

      tf.ones(shape=(3, 4))

    Correct answer
    D

    tf.ones(shape=(3, 4))

    Explanation

    tf.ones creates a tensor of all ones with the specified shape.

  4. 4

    What does the shape of a tensor represent?

    1. A

      The number of dimensions and the size of each dimension

    2. B

      The data type of the tensor elements

    3. C

      The number of elements in the tensor

    4. D

      The rank of the tensor only

    Correct answer
    A

    The number of dimensions and the size of each dimension

    Explanation

    Shape specifies the number of dimensions and the size of each dimension.

  5. 5

    Given a 2D tensor t with shape (3,4), how do you slice the first two rows and all columns?

    1. A

      t[0:2, 0:4]

    2. B

      t[0:2]

    3. C

      t[0:2, :]

    4. D

      t[:2, :]

    Correct answer
    C

    t[0:2, :]

    Explanation

    Slicing uses start:stop for each dimension; t[0:2, :] selects rows 0 and 1 and all columns.

  6. 6

    What does broadcasting allow in TensorFlow?

    1. A

      Creating multiple tensors simultaneously

    2. B

      Converting tensors to numpy arrays automatically

    3. C

      Performing operations on tensors of different shapes by automatically expanding dimensions

    4. D

      Sending tensor data over a network

    Correct answer
    C

    Performing operations on tensors of different shapes by automatically expanding dimensions

    Explanation

    Broadcasting enables element-wise operations on tensors with different shapes by virtually replicating smaller tensors.

  7. 7

    Which operation performs matrix multiplication in TensorFlow?

    1. A

      tf.matmul

    2. B

      tf.multiply

    3. C

      tf.dot

    4. D

      tf.linalg.matmul

    Correct answer
    D

    tf.linalg.matmul

    Explanation

    tf.linalg.matmul is used for matrix multiplication. (In practice, tf.matmul is also an alias, but the documented function is tf.linalg.matmul.)

  8. 8

    What is a ragged tensor used for?

    1. A

      Tensors with string data

    2. B

      Tensors with many zero elements

    3. C

      Tensors that are only partially initialized

    4. D

      Tensors with varying lengths along one dimension

    Correct answer
    D

    Tensors with varying lengths along one dimension

    Explanation

    Ragged tensors handle non-rectangular data where rows may have different lengths.

  9. 9

    Which method on a tf.Variable updates its value by adding a specified value?

    1. A

      update

    2. B

      add

    3. C

      assign

    4. D

      assign_add

    Correct answer
    D

    assign_add

    Explanation

    assign_add performs an in-place addition to the variable's current value.

  10. 10

    What does tf.cast do?

    1. A

      Performs a mathematical operation

    2. B

      Converts a tensor to a different data type

    3. C

      Creates a new tensor from a list

    4. D

      Reshapes a tensor

    Correct answer
    B

    Converts a tensor to a different data type

    Explanation

    tf.cast changes the data type of a tensor, e.g., from int32 to float32.

  11. 11

    In the linear regression model for car price prediction, what is the purpose of the Normalization layer?

    1. A

      To add noise to the data

    2. B

      To normalize input features to have mean 0 and variance 1

    3. C

      To convert categorical data to numerical

    4. D

      To reduce the number of features

    Correct answer
    B

    To normalize input features to have mean 0 and variance 1

    Explanation

    The Normalization layer scales features to zero mean and unit variance, which helps training.

  12. 12

    What does the Dense layer implement?

    1. A

      Y = activation(W * X + B)

    2. B

      Y = W * X + B

    3. C

      Y = X^2

    4. D

      Y = max(0, X)

    Correct answer
    B

    Y = W * X + B

    Explanation

    A Dense layer computes Y = W*X + B (linear transformation) before an optional activation.

  13. 13

    Which loss function is most robust to outliers in regression?

    1. A

      Mean Squared Error

    2. B

      Mean Absolute Error

    3. C

      Binary Cross-Entropy

    4. D

      Huber Loss

    Correct answer
    B

    Mean Absolute Error

    Explanation

    MAE treats all errors linearly, so it is less sensitive to outliers than MSE.

  14. 14

    What is the effect of a very high learning rate in gradient descent?

    1. A

      Slow convergence

    2. B

      Oscillation or divergence

    3. C

      Faster convergence to optimal solution

    4. D

      No effect on training

    Correct answer
    B

    Oscillation or divergence

    Explanation

    A high learning rate can cause the loss to oscillate or diverge.

  15. 15

    In the machine learning lifecycle, what is the purpose of the validation set?

    1. A

      Final evaluation of model performance

    2. B

      Tuning model hyperparameters during development

    3. C

      Training the model

    4. D

      Data augmentation

    Correct answer
    B

    Tuning model hyperparameters during development

    Explanation

    The validation set is used during training to evaluate performance on unseen data and tune hyperparameters.

  16. 16

    Which optimizer combines the benefits of AdaGrad and RMSProp?

    1. A

      SGD

    2. B

      Adam

    3. C

      RMSProp

    4. D

      Adagrad

    Correct answer
    B

    Adam

    Explanation

    Adam (Adaptive Moment Estimation) combines AdaGrad's handling of sparse gradients and RMSProp's adaptation of learning rates.

  17. 17

    What does underfitting indicate about the model?

    1. A

      The model performs well on both train and test sets

    2. B

      The model is too complex and memorizes data

    3. C

      The model is too simple to capture patterns in data

    4. D

      The model has too many parameters

    Correct answer
    C

    The model is too simple to capture patterns in data

    Explanation

    Underfitting occurs when the model cannot capture the underlying trend, often due to simplicity.

  18. 18

    Which method can help address underfitting in a neural network?

    1. A

      Increasing dropout rate

    2. B

      Adding more layers and neurons

    3. C

      Reducing the number of training epochs

    4. D

      Using a smaller learning rate

    Correct answer
    B

    Adding more layers and neurons

    Explanation

    Adding more layers or neurons increases model capacity to learn complex patterns.

  19. 19

    What is the shape of an image tensor in TensorFlow?

    1. A

      (height, width, channels)

    2. B

      (height, width)

    3. C

      (channels, height, width)

    4. D

      (batch, height, width, channels)

    Correct answer
    D

    (batch, height, width, channels)

    Explanation

    Images are typically represented as tensors of shape (batch_size, height, width, channels) in TensorFlow.

  20. 20

    What is the role of the kernel in a convolutional layer?

    1. A

      To reduce the spatial dimensions of the input

    2. B

      To slide over the input and produce a feature map

    3. C

      To introduce non-linearity

    4. D

      To normalize the output

    Correct answer
    B

    To slide over the input and produce a feature map

    Explanation

    A kernel (filter) slides over the input and computes dot products to produce a feature map.

  21. 21

    What does the padding parameter 'same' in a convolutional layer do?

    1. A

      Pads input so that output size equals input size

    2. B

      Removes border pixels

    3. C

      Adds zeros to the output

    4. D

      No padding; output size may shrink

    Correct answer
    A

    Pads input so that output size equals input size

    Explanation

    With 'same' padding, the output spatial dimensions are the same as input (when stride=1) by adding zeros around the border.

  22. 22

    What is the purpose of a pooling layer?

    1. A

      To introduce non-linearity

    2. B

      To reduce spatial dimensions and extract dominant features

    3. C

      To add more channels

    4. D

      To increase spatial dimensions

    Correct answer
    B

    To reduce spatial dimensions and extract dominant features

    Explanation

    Pooling downsamples the feature maps, reducing spatial size and making features more invariant to small translations.

  23. 23

    Which loss function is standard for binary classification?

    1. A

      Mean Squared Error

    2. B

      Hinge Loss

    3. C

      Categorical Cross-Entropy

    4. D

      Binary Cross-Entropy

    Correct answer
    D

    Binary Cross-Entropy

    Explanation

    Binary cross-entropy is used for two-class classification problems.

  24. 24

    Why is precision often more important than accuracy when class imbalance exists?

    1. A

      Precision measures the proportion of true positives among positive predictions, which is more meaningful when negatives dominate

    2. B

      Accuracy is not used in classification

    3. C

      Precision and accuracy are identical

    4. D

      Accuracy measures only true positives

    Correct answer
    A

    Precision measures the proportion of true positives among positive predictions, which is more meaningful when negatives dominate

    Explanation

    In imbalanced datasets, accuracy can be misleading; precision focuses on the correctness of positive predictions.

  25. 25

    What does the Flatten layer do in a CNN?

    1. A

      Converts a 2D feature map into a 1D vector

    2. B

      Reduces the number of channels

    3. C

      Increases spatial dimensions

    4. D

      Applies a non-linear activation

    Correct answer
    A

    Converts a 2D feature map into a 1D vector

    Explanation

    The Flatten layer reshapes the multi-dimensional output from convolutional/pooling layers into a 1D vector for fully connected layers.

  26. 26

    How can you save a trained Keras model to a file?

    1. A

      model.save('model.h5')

    2. B

      model.export('model.h5')

    3. C

      model.save_model('model.h5')

    4. D

      tf.saved_model.save(model, 'model.h5')

    Correct answer
    A

    model.save('model.h5')

    Explanation

    model.save('path') saves the entire model (architecture, weights, optimizer state) in HDF5 or SavedModel format.

  27. 27

    Which Keras model API allows creating models with multiple inputs and outputs?

    1. A

      Functional API

    2. B

      All of the above

    3. C

      Sequential API

    4. D

      Model Subclassing

    Correct answer
    A

    Functional API

    Explanation

    The Functional API supports non-linear topologies like multiple inputs, multiple outputs, and shared layers.

  28. 28

    What is the purpose of tf.GradientTape?

    1. A

      To compute gradients automatically during forward pass

    2. B

      To create a computational graph

    3. C

      To update model weights

    4. D

      To record operations for automatic differentiation

    Correct answer
    D

    To record operations for automatic differentiation

    Explanation

    GradientTape records operations for subsequent gradient computation.

  29. 29

    What does the @tf.function decorator do?

    1. A

      Adds automatic differentiation to a function

    2. B

      Creates a new layer

    3. C

      Compiles a Python function into a TensorFlow graph for faster execution

    4. D

      Converts a function to run in eager mode

    Correct answer
    C

    Compiles a Python function into a TensorFlow graph for faster execution

    Explanation

    tf.function traces the function and builds a computational graph, improving performance and portability.

  30. 30

    Which callback stops training when a monitored metric stops improving?

    1. A

      EarlyStopping

    2. B

      ModelCheckpoint

    3. C

      ReduceLROnPlateau

    4. D

      LearningRateScheduler

    Correct answer
    A

    EarlyStopping

    Explanation

    EarlyStopping monitors a metric (e.g., validation loss) and stops training if no improvement for a specified number of epochs.

  31. 31

    What is the purpose of the ModelCheckpoint callback?

    1. A

      To stop training early

    2. B

      To adjust the learning rate

    3. C

      To save the model weights at specific intervals or when a metric improves

    4. D

      To log training metrics for visualization

    Correct answer
    C

    To save the model weights at specific intervals or when a metric improves

    Explanation

    ModelCheckpoint saves the model (or weights) periodically, often when validation performance improves.

  32. 32

    What does TensorBoard allow you to visualize?

    1. A

      Training metrics, model graphs, and performance profiling

    2. B

      Only hyperparameter tuning results

    3. C

      Only loss curves

    4. D

      Only the model architecture

    Correct answer
    A

    Training metrics, model graphs, and performance profiling

    Explanation

    TensorBoard provides a suite of visualization tools for experiment tracking, including metrics, graphs, and profiling.

  33. 33

    What is Mixup data augmentation?

    1. A

      Randomly erasing parts of an image

    2. B

      Rotating images by random angles

    3. C

      Flipping images horizontally

    4. D

      Creating a new sample by mixing two images and their labels linearly

    Correct answer
    D

    Creating a new sample by mixing two images and their labels linearly

    Explanation

    Mixup creates a weighted combination of two images and their labels: new_x = lambda*x1 + (1-lambda)x2, new_y = lambday1 + (1-lambda)*y2.

  34. 34

    What is the primary benefit of using TensorFlow Records?

    1. A

      Automatic data augmentation

    2. B

      Support for only image data

    3. C

      Increased model accuracy

    4. D

      Efficient binary format for data storage and faster loading

    Correct answer
    D

    Efficient binary format for data storage and faster loading

    Explanation

    TFRecords are a binary format that allows efficient serialization and faster data pipeline performance.

  35. 35

    How can you create a custom metric in Keras?

    1. A

      Both A and B

    2. B

      By defining a function and passing it to model.compile

    3. C

      Custom metrics are not supported

    4. D

      By subclassing tf.keras.metrics.Metric

    Correct answer
    A

    Both A and B

    Explanation

    Custom metrics can be functions or subclasses of Metric that implement update_state and result methods.

  36. 36

    What is overfitting in machine learning?

    1. A

      Model performs equally well on all datasets

    2. B

      Model has a high bias

    3. C

      Model performs well on training data but poorly on unseen data

    4. D

      Model is too simple to learn patterns

    Correct answer
    C

    Model performs well on training data but poorly on unseen data

    Explanation

    Overfitting occurs when the model learns noise in training data and fails to generalize.

  37. 37

    Which of the following is a common cause of overfitting?

    1. A

      Too much training data

    2. B

      Model is too complex for the amount of data

    3. C

      Using dropout layers

    4. D

      Using a very small learning rate

    Correct answer
    B

    Model is too complex for the amount of data

    Explanation

    Overfitting often happens when the model has too many parameters relative to the dataset size.

  38. 38

    How does data augmentation help prevent overfitting?

    1. A

      By reducing the number of training examples

    2. B

      By simplifying the data preprocessing

    3. C

      By artificially increasing the diversity of training data

    4. D

      By decreasing model complexity

    Correct answer
    C

    By artificially increasing the diversity of training data

    Explanation

    Augmentation applies random transformations to create new training samples, making the model more robust.

  39. 39

    What does dropout do during training?

    1. A

      Increases the learning rate

    2. B

      Drops a fraction of neurons to reduce overfitting

    3. C

      Adds noise to the labels

    4. D

      Removes low-variance features

    Correct answer
    B

    Drops a fraction of neurons to reduce overfitting

    Explanation

    Dropout randomly sets a fraction of activations to zero, preventing co-adaptation and acting as regularization.

  40. 40

    What is L2 regularization?

    1. A

      Multiplying weights by a constant less than 1

    2. B

      Adding a penalty proportional to the absolute value of the weights

    3. C

      Adding a penalty proportional to the square of the weights to the loss function

    4. D

      Removing layers with small weights

    Correct answer
    C

    Adding a penalty proportional to the square of the weights to the loss function

    Explanation

    L2 regularization (weight decay) adds the sum of squared weights to the loss, encouraging smaller weights.

  41. 41

    Which activation function is typically used for the output layer in multi-class classification?

    1. A

      ReLU

    2. B

      Softmax

    3. C

      Tanh

    4. D

      Sigmoid

    Correct answer
    B

    Softmax

    Explanation

    Softmax converts logits into a probability distribution over classes that sums to 1.

  42. 42

    What is the appropriate loss function for multi-class classification with integer labels?

    1. A

      SparseCategoricalCrossentropy

    2. B

      BinaryCrossentropy

    3. C

      CategoricalCrossentropy

    4. D

      MeanSquaredError

    Correct answer
    A

    SparseCategoricalCrossentropy

    Explanation

    SparseCategoricalCrossentropy is used when labels are integers (not one-hot encoded).

  43. 43

    What does TopK categorical accuracy measure?

    1. A

      Accuracy for the top K classes in the dataset

    2. B

      Precision at top K

    3. C

      Accuracy when the true class is among the top-K predicted classes

    4. D

      Accuracy when only the top-1 prediction is correct

    Correct answer
    C

    Accuracy when the true class is among the top-K predicted classes

    Explanation

    Top-K accuracy checks if the correct label appears in the top K predictions.

  44. 44

    What is the file format for HDF5 model files?

    1. A

      A format specific to TensorFlow

    2. B

      A compressed archive of model weights

    3. C

      A text-based format for model architecture

    4. D

      A format for storing numerical arrays and trained models in a hierarchical structure

    Correct answer
    D

    A format for storing numerical arrays and trained models in a hierarchical structure

    Explanation

    HDF5 (Hierarchical Data Format) is a binary format for storing large numerical datasets and neural network models.

  45. 45

    Which CNN architecture introduced residual blocks to enable training of very deep networks?

    1. A

      MobileNet

    2. B

      VGGNet

    3. C

      ResNet

    4. D

      AlexNet

    Correct answer
    C

    ResNet

    Explanation

    ResNet introduced skip connections (residual blocks) to mitigate the vanishing gradient problem.

  46. 46

    What is a key characteristic of VGGNet?

    1. A

      Uses large 11x11 filters

    2. B

      Includes residual connections

    3. C

      Stacks many layers with small 3x3 filters

    4. D

      Uses depthwise separable convolutions

    Correct answer
    C

    Stacks many layers with small 3x3 filters

    Explanation

    VGGNet showed that using multiple small 3x3 filters is more effective than larger filters.

  47. 47

    What is the main innovation of MobileNet?

    1. A

      Using multiple GPUs for training

    2. B

      Compound scaling of depth, width, and resolution

    3. C

      Deep residual learning

    4. D

      Depthwise separable convolutions for efficiency

    Correct answer
    D

    Depthwise separable convolutions for efficiency

    Explanation

    MobileNet uses depthwise separable convolutions to reduce computational cost.

  48. 48

    Which architecture uses compound scaling to uniformly scale depth, width, and resolution?

    1. A

      AlexNet

    2. B

      MobileNet

    3. C

      EfficientNet

    4. D

      ResNet

    Correct answer
    C

    EfficientNet

    Explanation

    EfficientNet's compound scaling method scales all three dimensions simultaneously for optimal performance.

  49. 49

    In transfer learning, what is the typical first step after loading a pre-trained model?

    1. A

      Replace the final classification layers and freeze the base model

    2. B

      Only fine-tune the first few layers

    3. C

      Unfreeze all layers and train with a high learning rate

    4. D

      Train from scratch on the new dataset

    Correct answer
    A

    Replace the final classification layers and freeze the base model

    Explanation

    First, the pre-trained base is used as a feature extractor (frozen), and new dense layers are added and trained.

  50. 50

    What is fine-tuning in the context of transfer learning?

    1. A

      Training only the new classifier layers

    2. B

      Using the pre-trained model without any training

    3. C

      Replacing all layers with new ones

    4. D

      Unfreezing some or all layers of the pre-trained model and training with a low learning rate

    Correct answer
    D

    Unfreezing some or all layers of the pre-trained model and training with a low learning rate

    Explanation

    Fine-tuning involves unfreezing parts of the base model and training them with a small learning rate to adapt to the new task.

  51. 51

    What do early layers in a CNN typically learn?

    1. A

      High-level concepts like faces

    2. B

      Final classification probabilities

    3. C

      Object parts like wheels and eyes

    4. D

      Low-level features like edges and colors

    Correct answer
    D

    Low-level features like edges and colors

    Explanation

    Early layers capture simple patterns like edges, colors, and textures.

  52. 52

    How does Grad-CAM generate a heatmap for a model's prediction?

    1. A

      By averaging all feature maps

    2. B

      By computing the gradient of the target class score with respect to the final convolutional feature maps

    3. C

      By backpropagating through the fully connected layers only

    4. D

      By using the last pooling layer's output

    Correct answer
    B

    By computing the gradient of the target class score with respect to the final convolutional feature maps

    Explanation

    Grad-CAM uses the gradients flowing into the last convolutional layer to produce a localization map.

  53. 53

    In Vision Transformers, how is an image processed?

    1. A

      By applying a large convolutional filter

    2. B

      By using recurrent neural networks

    3. C

      By splitting into fixed-size patches and linearly projecting them to embeddings

    4. D

      As a single vector of pixel values

    Correct answer
    C

    By splitting into fixed-size patches and linearly projecting them to embeddings

    Explanation

    ViTs divide the image into patches (e.g., 16x16), flatten each, and project to a sequence of patch embeddings with added positional embeddings.

  54. 54

    What is the role of the class embedding in a Vision Transformer?

    1. A

      It is the average of all patch embeddings

    2. B

      It is a learnable token prepended to the patch sequence used for classification

    3. C

      It represents the number of classes

    4. D

      It replaces the positional embeddings

    Correct answer
    B

    It is a learnable token prepended to the patch sequence used for classification

    Explanation

    A special [CLS] token (class embedding) is added to the sequence; its final representation is used for classification.

  55. 55

    Why do Vision Transformers often require large-scale pre-training?

    1. A

      Because they have fewer parameters than CNNs

    2. B

      Because they lack the inductive biases of CNNs (locality, translation equivariance)

    3. C

      Because they cannot use transfer learning

    4. D

      Because they only work with very large images

    Correct answer
    B

    Because they lack the inductive biases of CNNs (locality, translation equivariance)

    Explanation

    ViTs lack built-in spatial priors, so they need large datasets to learn these patterns from scratch.

  56. 56

    What is the ONNX format used for?

    1. A

      An open format for exchanging models between different deep learning frameworks

    2. B

      A format for compressing images

    3. C

      A format for training data

    4. D

      Saving trained models in a framework-specific format

    Correct answer
    A

    An open format for exchanging models between different deep learning frameworks

    Explanation

    ONNX (Open Neural Network Exchange) allows interoperability between frameworks like TensorFlow and PyTorch.

  57. 57

    What is quantization in the context of model deployment?

    1. A

      Reducing the number of layers in the model

    2. B

      Splitting the model into multiple parts

    3. C

      Increasing the model precision to 64-bit

    4. D

      Converting model weights from 32-bit floats to lower-bit representations

    Correct answer
    D

    Converting model weights from 32-bit floats to lower-bit representations

    Explanation

    Quantization reduces memory and speeds up inference by using smaller data types like 8-bit integers.

  58. 58

    What is Quantization-Aware Training (QAT)?

    1. A

      Only using quantized data for training

    2. B

      Simulating quantization effects during training to produce a model more robust to quantization

    3. C

      Training a model with full precision then quantizing it

    4. D

      A method to reduce training time

    Correct answer
    B

    Simulating quantization effects during training to produce a model more robust to quantization

    Explanation

    QAT incorporates quantization error into training, resulting in better accuracy after quantization.

  59. 59

    Which TensorFlow library is used for deploying models on mobile and IoT devices?

    1. A

      TensorFlow Lite

    2. B

      TensorFlow Extended (TFX)

    3. C

      TensorFlow.js

    4. D

      TensorFlow Serving

    Correct answer
    A

    TensorFlow Lite

    Explanation

    TensorFlow Lite is designed for on-device inference with reduced model size and optimized performance.

  60. 60

    What is FastAPI used for in the deployment pipeline?

    1. A

      Creating a REST API for serving model predictions

    2. B

      Visualizing model metrics

    3. C

      Storing training data

    4. D

      Training machine learning models

    Correct answer
    A

    Creating a REST API for serving model predictions

    Explanation

    FastAPI is a web framework for building APIs; it serves model predictions via HTTP endpoints.

  61. 61

    What is the purpose of load testing with Locust?

    1. A

      To measure model accuracy under different conditions

    2. B

      To simulate multiple users accessing the API simultaneously to test performance

    3. C

      To generate training data

    4. D

      To reduce the model size

    Correct answer
    B

    To simulate multiple users accessing the API simultaneously to test performance

    Explanation

    Locust creates simulated users to stress-test the API and find bottlenecks.

  62. 62

    In YOLO, how is the input image divided?

    1. A

      Into overlapping patches

    2. B

      By region proposals

    3. C

      By using a sliding window

    4. D

      Into a grid of equal cells

    Correct answer
    D

    Into a grid of equal cells

    Explanation

    YOLO divides the image into an SxS grid; each cell is responsible for predicting objects whose center falls in that cell.

  63. 63

    What does each grid cell in YOLO predict?

    1. A

      Only a confidence score

    2. B

      Only class probabilities

    3. C

      One bounding box and class

    4. D

      B bounding boxes, confidence scores, and class probabilities

    Correct answer
    D

    B bounding boxes, confidence scores, and class probabilities

    Explanation

    Each cell predicts B bounding boxes, each with a confidence, and C class probabilities, outputting a tensor of shape SxSx(B*5+C).

  64. 64

    In YOLO, how are bounding box coordinates encoded relative to the grid cell?

    1. A

      x,y are relative to the cell; width and height are relative to the image

    2. B

      All coordinates are absolute pixel values

    3. C

      Coordinates are normalized by the image dimensions

    4. D

      x,y are relative to the image; width and height are relative to the cell

    Correct answer
    A

    x,y are relative to the cell; width and height are relative to the image

    Explanation

    The center (x,y) is offset within the cell (0-1), and width/height are scaled by image dimensions.

  65. 65

    What component of the YOLO loss penalizes incorrect bounding box dimensions?

    1. A

      Objectness loss

    2. B

      No-objectness loss

    3. C

      Coordinate loss

    4. D

      Classification loss

    Correct answer
    C

    Coordinate loss

    Explanation

    The coordinate loss measures error in predicted box center, width, and height.

  66. 66

    What metric is used to determine which predicted box is responsible for an object in YOLO?

    1. A

      Euclidean distance between centers

    2. B

      Mean squared error

    3. C

      Intersection over Union (IoU)

    4. D

      Cosine similarity

    Correct answer
    C

    Intersection over Union (IoU)

    Explanation

    IoU measures overlap between ground truth and predicted boxes; the box with highest IoU is assigned to the object.

  67. 67

    What is the purpose of Non-Max Suppression (NMS) in object detection?

    1. A

      To classify detected objects

    2. B

      To refine bounding box coordinates

    3. C

      To eliminate duplicate bounding boxes by suppressing low-confidence overlapping boxes

    4. D

      To increase the number of detections

    Correct answer
    C

    To eliminate duplicate bounding boxes by suppressing low-confidence overlapping boxes

    Explanation

    NMS selects the highest-confidence box and suppresses other boxes with high IoU overlap.

  68. 68

    What is the key difference between a standard autoencoder and a variational autoencoder (VAE)?

    1. A

      VAE outputs parameters of a probability distribution (mean and variance) and uses the reparameterization trick

    2. B

      VAE outputs a deterministic latent code

    3. C

      VAE does not use an encoder

    4. D

      VAE only works with images

    Correct answer
    A

    VAE outputs parameters of a probability distribution (mean and variance) and uses the reparameterization trick

    Explanation

    VAE encodes input as a distribution (mean, log variance) and samples latent vectors using z = mean + sigma*epsilon.

  69. 69

    What does the KL divergence term in the VAE loss function do?

    1. A

      Regularizes the latent space to approximate a standard normal distribution

    2. B

      Reconstructs the input image

    3. C

      Measures the accuracy of the decoder

    4. D

      Increases the variance of the encoder

    Correct answer
    A

    Regularizes the latent space to approximate a standard normal distribution

    Explanation

    KL divergence encourages the learned distribution to be close to a prior (typically standard normal), enabling smooth interpolation.

  70. 70

    In a Generative Adversarial Network (GAN), what is the goal of the generator?

    1. A

      To reconstruct the input

    2. B

      To distinguish real from fake data

    3. C

      To generate realistic data that can fool the discriminator

    4. D

      To classify data into categories

    Correct answer
    C

    To generate realistic data that can fool the discriminator

    Explanation

    The generator creates synthetic data to maximize the discriminator's error.

  71. 71

    What is the training objective of a GAN?

    1. A

      Train both networks to reconstruct the input

    2. B

      Maximize the generator loss and minimize the discriminator loss

    3. C

      Minimize a combined loss of generator and discriminator

    4. D

      A min-max game where the generator tries to fool the discriminator, and the discriminator tries to not be fooled

    Correct answer
    D

    A min-max game where the generator tries to fool the discriminator, and the discriminator tries to not be fooled

    Explanation

    The GAN minimax objective: generator minimizes log(1-D(G(z))), discriminator maximizes log(D(x)) + log(1-D(G(z))).

  72. 72

    Which of the following is a tip for stable GAN training?

    1. A

      Train discriminator for many steps per generator step

    2. B

      Use label smoothing (e.g., replace 1s with 0.9 for real labels)

    3. C

      Remove activation functions

    4. D

      Use a high learning rate

    Correct answer
    B

    Use label smoothing (e.g., replace 1s with 0.9 for real labels)

    Explanation

    Label smoothing (soft labels) prevents the discriminator from being overconfident and improves training stability.

  73. 73

    What activation function is recommended in DCGAN for the discriminator (except output)?

    1. A

      Sigmoid

    2. B

      Leaky ReLU

    3. C

      Tanh

    4. D

      ReLU

    Correct answer
    B

    Leaky ReLU

    Explanation

    Leaky ReLU is recommended to avoid sparse gradients in the discriminator; it allows a small gradient for negative inputs.

Question 1 of 73
Question 1 of 73

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent