MauryaHub PYQ Practice

Deep Learning Practice · End Term · Jan 2026 · FN

Deep Learning Practice · End Term · Jan 2026 FN

← Course papers · Start practice / exam

Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.

22 / 22 published solutions

Question 2 NAT · 1.0 marks

Read the following configuration file and code snippet related to training and annotations in a YOLO model, and answer the given subquestions. A dataset configuration file (YAML) is defined as: path: /data/helmet_dataset train: images/train val: images/val nc: 5 names: [’helmet’, ’no_helmet’, ’person’,’car’, ’truck’] A sample annotation in YOLO format is given below: 2 0.25 0.60 0.40 0.20 This represents: classid, xcenter, ycenter,width, height. Assume the corresponding image has dimensions: 640 (width) × 480 (height).
Based on the YAML configuration file, what is the total number of object classes the model is trained to detect?

Published solution

**1. Read the configuration:** nc is the number of detection classes. The file states nc: 5. **2. Verify against the names:** helmet, no_helmet, person, car and truck are five distinct class names. Their zero-based class IDs are 0 through 4. **3. Conclude:** The model is trained for five object classes. The class ID 2 in one annotation identifies person; it is not the total number of classes. **Answer: 5.**

Report a correction for Q2

Question 3 NAT · 2.0 marks

Read the following configuration file and code snippet related to training and annotations in a YOLO model, and answer the given subquestions. A dataset configuration file (YAML) is defined as: path: /data/helmet_dataset train: images/train val: images/val nc: 5 names: [’helmet’, ’no_helmet’, ’person’,’car’, ’truck’] A sample annotation in YOLO format is given below: 2 0.25 0.60 0.40 0.20 This represents: classid, xcenter, ycenter,width, height. Assume the corresponding image has dimensions: 640 (width) × 480 (height).
What is the x-coordinate (in pixels) of the center of the bounding box?

Published solution

**1. Identify the coordinate format:** YOLO annotation coordinates are normalized by the image dimensions. The supplied x-center is 0.25 and the image width is 640 pixels. **2. Convert to pixels:** \[x_c=x_{c,\mathrm{norm}}W=0.25\times640=160\text{ pixels}.\] **3. Check:** One quarter of a 640-pixel width is 160 pixels from the left edge. Image height is not used for an x-coordinate. **Answer: 160.**

Report a correction for Q3

Question 4 NAT · 2.0 marks

Read the following configuration file and code snippet related to training and annotations in a YOLO model, and answer the given subquestions. A dataset configuration file (YAML) is defined as: path: /data/helmet_dataset train: images/train val: images/val nc: 5 names: [’helmet’, ’no_helmet’, ’person’,’car’, ’truck’] A sample annotation in YOLO format is given below: 2 0.25 0.60 0.40 0.20 This represents: classid, xcenter, ycenter,width, height. Assume the corresponding image has dimensions: 640 (width) × 480 (height).
What is the x-coordinate (in pixels) of the top-left corner of the bounding box?

Published solution

**1. Convert center and width:** The x-center is \(0.25\times640=160\) pixels. The normalized box width is 0.40, giving \(w=0.40\times640=256\) pixels. **2. Move half a width left:** The top-left corner has \[x_{\min}=x_c-\frac{w}{2}=160-\frac{256}{2}=160-128=32\text{ pixels}.\] **3. Check:** The right edge is \(160+128=288\); the width \(288-32=256\) agrees with the annotation. **Answer: 32.**

Report a correction for Q4

Question 5 NAT · 5.0 marks

Consider a convolutional neural network with an input image of size 84 × 84 × 3. The architecture consists of the following layers: 1.A convolutional layer with 16 filters of size 4 × 4, a stride of 2, and no padding. 2. A ReLU activation layer. 3. A second convolutional layer with 32 filters of size 2×2, a stride of 2, and no padding. 4. A flattening layer. What is the dimension of the resulting flattened layer?

Published solution

**1. Use the convolution size formula:** For input size \(n\), kernel \(k\), stride \(s\), padding \(p\) and unit dilation, \[n_{\mathrm{out}}=\left\lfloor\frac{n+2p-k}{s}\right\rfloor+1.\] **2. First convolution:** \(\lfloor(84-4)/2\rfloor+1=41\). Sixteen filters produce \(41\times41\times16\). ReLU changes values but not dimensions. **3. Second convolution:** \(\lfloor(41-2)/2\rfloor+1=19+1=20\). Thirty-two filters produce \(20\times20\times32\). **4. Flatten:** Multiplying all non-batch dimensions gives \(20\times20\times32=12{,}800\) features per image. **Answer: 12800.**

Report a correction for Q5

Question 6 NAT · 5.0 marks

A bottleneck layer in a ResNet receives an input feature map of dimensions 14×14×1024. We apply a 1×1 convolution layer with 256 filters to reduce dimensionality. Calculate the total number of multiplications required for this operation. (Give answer in millions, e.g., if 65,452,123, write 65.45).

Published solution

**1. Understand a 1-by-1 convolution:** At one spatial position, one output filter multiplies each of the 1,024 input-channel values by a weight. Thus each output value needs 1,024 multiplications. **2. Count output values:** There are \(14\times14=196\) spatial positions and 256 output channels, giving \(196\times256=50{,}176\) output values. **3. Multiply:** \[196\times256\times1{,}024=51{,}380{,}224\text{ multiplications}.\] In millions this is 51.380224, rounded to 51.38. Bias additions are not multiplications. **Answer: 51.38.**

Report a correction for Q6

Question 7 NAT · 5.0 marks

A modified YOLO-style architecture divides an image into a 13 × 13 grid (S = 13). If the model is designed to predict B = 3 bounding boxes per grid cell and is trained to recognize C = 80 distinct classes (similar to COCO dataset), what is the depth (number of channels) of the final output tensor?

Published solution

**1. Identify the intended YOLO output convention:** In the original YOLO-style grid formulation, each cell predicts B bounding boxes with five values per box: x, y, width, height and confidence. It also predicts one set of C class probabilities shared by the cell. **2. Compute channels per cell:** \[D=5B+C=5(3)+80=95.\] **3. Distinguish depth from total size:** The tensor is \(13\times13\times95\); its depth is 95, rather than the product of all three dimensions. **Convention note:** This uses cell-shared class probabilities. A detector predicting separate class scores for every box would use a different formula, such as \(B(5+C)\). The question’s intended formulation is the original grid convention. **Answer: 95.**

Report a correction for Q7

Question 8 NAT · 5.0 marks

In the VGG16 architecture, consider the second convolutional layer of the first block. It takes an input with 64 channels and applies 64 filters of size 3 × 3. Calculate the total number of weights (excluding bias) for this specific layer.

Published solution

**1. Count one filter’s weights:** A 3-by-3 filter spans all 64 input channels, so it contains \(3\times3\times64=576\) weights. **2. Count all filters:** There are 64 output filters: \[N=64\times576=64\times64\times3\times3=36{,}864.\] **3. Exclude biases:** The question asks only for weights. Including one bias per filter would add 64, but those are not counted. **Answer: 36864.**

Report a correction for Q8

Question 9 MSQ · 5.0 marks

When fine-tuning a large vision model (e.g., a pre-trained ResNet or Vision Transformer) for a specific competition dataset, which of the following techniques are most effective for improving training efficiency (speed and memory usage)?
6406536961832.
Mixed Precision Training (FP16): Using 16-bit floating-point numbers instead of 32-bit for certain operations to speed up computation and reduce GPU memory consumption.
6406536961833.
Freeze the Backbone: Keeping the early layers of the pre-trained model non- trainable (requires grad=False) and only training the final classification head.
6406536961834.
Increase Batch Size: Utilizing larger batches improves training efficiency by lowering memory usage.
6406536961835.
Data Prefetching: Using multiple CPU workers (e.g., num workers > 0 in PyTorch) to load and augment data in the background while the GPU processes the current batch.

Published solution

**1. Reduce training storage/work:** Mixed precision uses lower-precision tensors where appropriate. Freezing a backbone avoids storing its parameter gradients and optimizer states, although its forward computation is still required. **2. Keep the GPU supplied:** Background data workers and prefetching can overlap loading/augmentation with GPU work, reducing idle time when input loading is a bottleneck. **3. Evaluate batch size carefully:** A larger batch may improve throughput if it fits, but normally uses more activation memory. It does not lower memory usage as claimed in C. **Answer: A, B, D — Selected: Mixed Precision Training (FP16): Using 16-bit floating-point numbers instead of 32-bit for certain operations to speed up computation and reduce GPU memory consumption.; Freeze the Backbone: Keeping the early layers of the pre-trained model non- trainable (requires grad=False) and only training the final classification head.; Data Prefetching: Using multiple CPU workers (e.g., num workers > 0 in PyTorch) to load and augment data in the background while the GPU processes the current batch.** A: **Correct:** Suitable lower-precision operations can reduce memory and improve speed on compatible hardware. B: **Correct:** Training only the head avoids updating and storing optimizer state for the frozen backbone. C: **Incorrect:** Larger batches normally increase memory demand; throughput gains do not imply lower memory use. D: **Correct:** Background workers can overlap input preparation with GPU computation.

Report a correction for Q9

Question 10 MSQ · 5.0 marks

When training a deep learning model for a vision competition (such as a ”Cat vs Dog” classifier or a YOLO detector), which of the following statements correctly describe the technical practices for managing hardware and model state?
6406536961836.
To utilize a GPU in PyTorch, you must explicitly move both the model parameters and the input data tensors to the same device (e.g.,.to(’cuda’)).
6406536961837.
Saving a model using torch.save(model.state dict(), PATH) is generally preferred over saving the entire model object because it only stores the learnable parameters (weights and biases).
6406536961838.
When resuming training or performing inference, you must first instantiate the model architecture and then load the weights using model.load state dict(torch.load(PATH, map location=device)).
6406536961839.
The state dict of a model includes the architecture's source code, allowing the weights to be loaded onto a completely different model class without errors.

Published solution

**1. Match device placement:** PyTorch operations require compatible tensors and model parameters on the same device. Move both to the selected GPU for GPU execution. **2. Save model state:** A state_dict stores parameter tensors and persistent buffers, such as batch-normalization statistics. It does not store the architecture’s Python source code. Saving this state is generally more portable than serializing a whole model object. **3. Restore appropriately:** Instantiate a compatible model class, load the state dictionary and use evaluation mode for inference. To resume training faithfully, also restore optimizer/scheduler states and other required training state. **Precision note:** B says “only learnable parameters”, but state_dict also includes persistent buffers. Its intended comparison with a whole-model pickle remains the standard recommended practice. **Answer: A, B, C — Selected: To utilize a GPU in PyTorch, you must explicitly move both the model parameters and the input data tensors to the same device (e.g.,.to(’cuda’)).; Saving a model using torch.save(model.state dict(), PATH) is generally preferred over saving the entire model object because it only stores the learnable parameters (weights and biases).; When resuming training or performing inference, you must first instantiate the model architecture and then load the weights using model.load state dict(torch.load(PATH, map location=device)).** A: **Correct:** Both the network and its tensor inputs must be placed on the selected compatible device. B: **Correct:** Saving a state dictionary is preferred here; it includes weights and persistent buffers, rather than architecture source. C: **Correct:** Loading a state dictionary requires a compatible instantiated architecture; full training resumption also needs optimizer state. D: **Incorrect:** A state dictionary does not contain source code and cannot generally load into an unrelated architecture.

Report a correction for Q10

Question 11 MSQ · 5.0 marks

Consider the following Python code snippet using the Ultralytics YOLOv8 API: from ultralytics import YOLO model = YOLO("yolov8n.pt") for name, module in model.model.named_modules(): print(name, type(module)) Based on the architecture of YOLOv8, which of the following statements correctly describe the model?
6406536961840.
The model predicts object locations directly without using predefined anchor boxes.
6406536961841.
The model uses separate components within its detection head for classification and bounding box regression.
6406536961842.
The model performs detection in a single forward pass without a separate proposal stage.
6406536961843.
The model internally generates region proposals using a Region Proposal Network (RPN) before classification.

Published solution

**1. Identify the detector:** YOLOv8 is a one-stage detector. Its detection head uses an anchor-free design instead of predefined anchor-box templates. **2. Separate predictions:** The detection head has separate paths/components for class prediction and bounding-box regression. Both operate on shared feature maps within the detector forward pass. **3. Contrast two-stage detection:** An RPN first proposing regions is characteristic of Faster R-CNN, rather than standard YOLOv8. **Answer: A, B, C — Selected: The model predicts object locations directly without using predefined anchor boxes.; The model uses separate components within its detection head for classification and bounding box regression.; The model performs detection in a single forward pass without a separate proposal stage.** A: **Correct:** YOLOv8 uses anchor-free detection, although feature-map reference points are still used. B: **Correct:** Its decoupled head separates classification and localization predictions. C: **Correct:** It predicts detections through a one-stage network without an RPN proposal stage. D: **Incorrect:** A separate RPN is not part of the standard YOLOv8 pipeline.

Report a correction for Q11

Question 12 MSQ · 5.0 marks

Which of the following loss components are typically used in SRGAN (Super-Resolution GAN) to achieve photo-realistic results?
6406536961844.
Adversarial Loss: To encourage the generator to produce solutions on the natural image manifold.
6406536961845.
Content (Perceptual) Loss: Based on feature maps from a pre-trained VGG network.
6406536961846.
Pixel-wise MSE only: To strictly maximize PSNR.
6406536961847.
Classification Loss: To classify the image into 1000 classes.

Published solution

**1. Explain the goal:** Super-resolution reconstructs a high-resolution image from a low-resolution input. Matching average pixel values alone can produce overly smooth images. **2. Use perceptual content loss:** Compare generated and target images through feature maps of a pretrained network such as VGG. This encourages perceptually meaningful structure. **3. Add adversarial loss:** A discriminator teaches the generator to produce images that look like natural high-resolution examples. SRGAN combines this with content loss; it is not merely a pixel-MSE system or an ImageNet classifier. **Answer: A, B — Selected: Adversarial Loss: To encourage the generator to produce solutions on the natural image manifold.; Content (Perceptual) Loss: Based on feature maps from a pre-trained VGG network.** A: **Correct:** Adversarial training encourages natural-looking high-resolution textures. B: **Correct:** VGG-feature content loss compares perceptual structure rather than only individual pixels. C: **Incorrect:** Pixel MSE alone does not describe SRGAN’s perceptual/adversarial objective. D: **Incorrect:** The pretrained network supplies features; the task is not 1,000-way classification.

Report a correction for Q12

Question 13 MSQ · 5.0 marks

Regarding the U-Net architecture, which is widely used for tasks like medical image segmentation and can be adapted for depth estimation:
6406536961848.
It features a symmetric architecture consisting of a contracting path (encoder) and an expansive path (decoder).
6406536961849.
Skip connections concatenate high-resolution features from the contracting path directly to the up sampled features in the expansive path.
6406536961850.
The expansive path uses transposed convolutions (or up-convolutions) to increase the spatial resolution of the feature maps.
6406536961851.
It relies on Global Average Pooling at every layer to ensure that spatial information is discarded in favor of global context.

Published solution

**1. Follow the encoder:** U-Net’s contracting path reduces resolution while learning increasingly rich features. **2. Follow the decoder:** Its expansive path upsamples the features to recover a dense spatial prediction, such as a segmentation mask. The original architecture uses up-convolutions/transposed convolutions. **3. Recover local detail:** Skip connections concatenate matching-resolution encoder features with decoder features, helping retain boundaries and localization. Discarding spatial information at every layer would undermine pixel-level prediction. **Answer: A, B, C — Selected: It features a symmetric architecture consisting of a contracting path (encoder) and an expansive path (decoder).; Skip connections concatenate high-resolution features from the contracting path directly to the up sampled features in the expansive path.; The expansive path uses transposed convolutions (or up-convolutions) to increase the spatial resolution of the feature maps.** A: **Correct:** The encoder-decoder arrangement contracts and then expands spatial resolution. B: **Correct:** Concatenated skip features restore fine localization details. C: **Correct:** Upsampling operations increase the decoder feature-map resolution. D: **Incorrect:** Repeated global pooling would remove the spatial layout needed for segmentation.

Report a correction for Q13

Question 14 MSQ · 5.0 marks

Consider the following code: model = torchvision.models.detection.fasterrcnn_resnet50_fpn(pretrained=True) images = [torch.randn(3, 600, 800)] outputs = model(images) Unlike YOLO-based models, the number of bounding boxes in outputs[0]['boxes'] varies for each image. What architectural characteristic of the model explains this behavior?
6406536961852.
The model generates a variable number of region proposals based on the image content.
6406536961853.
The model filters region proposals using confidence scores and non maximum suppression.
6406536961854.
The model uses a fixed grid structure to predict bounding boxes.
6406536961855.
The model predicts a constant number of bounding boxes for every image.

Published solution

**1. Identify the two stages:** Faster R-CNN generates candidate object regions and then classifies/refines them. Proposal and detection filtering depend on image content and scores. **2. Filter candidates:** Confidence thresholds, top-k selection and non-maximum suppression remove low-confidence and duplicate boxes. The remaining count can differ between images, even though the network imposes maximum proposal/detection limits. **3. Interpret the code as inference:** To run the example, call model.eval() before passing only images. The default training mode expects targets. The question is describing its inference outputs. **Important distinction:** YOLO inference can also return a variable number of final detections after filtering. This behavior is not exclusive to Faster R-CNN. **Answer: A, B — Selected: The model generates a variable number of region proposals based on the image content.; The model filters region proposals using confidence scores and non maximum suppression.** A: **Correct:** Content-dependent proposal scoring/filtering leads to a variable set of useful regions within configured limits. B: **Correct:** Score filtering and non-maximum suppression change the final detection count. C: **Incorrect:** A fixed-grid prediction scheme does not describe Faster R-CNN’s region-based architecture. D: **Incorrect:** Its returned final box count need not be constant.

Report a correction for Q14

Question 15 MSQ · 5.0 marks

Which of the following statements correctly describe the characteristics and motivations of the Inception (GoogLeNet) architecture?
6406536961856.
It uses Inception modules that apply multiple filter sizes (1×1, 3×3, 5×5) in parallel to capture multi-scale features.
6406536961857.
It utilizes 1×1 convolutions as bottleneck layers to reduce dimensionality before computationally expensive operations.
6406536961858.
It incorporates Auxiliary Classifiers in intermediate layers to inject additional gradient signal and combat the vanishing gradient problem.
6406536961859.
It relies exclusively on stacking 3 × 3 filters to achieve its receptive field, similar to the VGGNet design philosophy.

Published solution

**1. Capture multiple scales:** Inception modules apply parallel branches with different filter sizes and pooling. Their outputs are combined, allowing the network to capture patterns at multiple scales. **2. Control computation:** A 1-by-1 convolution reduces channel depth before expensive 3-by-3 or 5-by-5 operations, reducing their multiplication and parameter counts. **3. Support training:** Original GoogLeNet includes intermediate auxiliary classifiers that provide extra training signal and regularization. Its parallel multi-scale design differs from VGG’s primarily stacked 3-by-3 filters. **Answer: A, B, C — Selected: It uses Inception modules that apply multiple filter sizes (1×1, 3×3, 5×5) in parallel to capture multi-scale features.; It utilizes 1×1 convolutions as bottleneck layers to reduce dimensionality before computationally expensive operations.; It incorporates Auxiliary Classifiers in intermediate layers to inject additional gradient signal and combat the vanishing gradient problem.** A: **Correct:** Parallel filters of several sizes capture features at different spatial scales. B: **Correct:** Channel bottlenecks reduce the cost of subsequent larger filters. C: **Correct:** Auxiliary training heads provide additional gradient signal during training. D: **Incorrect:** GoogLeNet is not exclusively a chain of 3-by-3 convolutions.

Report a correction for Q15

Question 16 MSQ · 5.0 marks

In the context of Convolutional Neural Networks (CNNs), what is the primary mechanism that allows the network to handle inputs of varying spatial sizes while maintaining a fixed number of parameters, a characteristic that distinguishes them from standard Multi-Layer Perceptrons (MLPs)?
6406536961860.
Neurons are connected only to a local region of the input.
6406536961861.
Max Pooling: Reducing the spatial resolution to a single pixel before the first hidden layer.
6406536961862.
Parameter Sharing: Using the same set of weights (filters) across different spatial locations of the input.
6406536961863.
Fully Connected Layers: Replacing all convolutional layers with dense layers to increase the receptive field.

Published solution

**1. Describe a convolutional filter:** A small filter connects to a local patch and then slides across many image positions. **2. Explain parameter sharing:** The same filter weights are reused at every location. A convolution has \(k_hk_wC_{\mathrm{in}}C_{\mathrm{out}}\) weights, independent of image width and height. Increasing spatial size therefore increases output computation, rather than the filter parameter count. **3. State the scope:** Local connectivity and shared parameters allow convolutional feature extractors to process different spatial sizes. A later flatten-and-dense head can still impose a fixed input size; adaptive/global pooling is often used to remove that restriction. **Answer: A, C — Selected: Neurons are connected only to a local region of the input.; Parameter Sharing: Using the same set of weights (filters) across different spatial locations of the input.** A: **Correct:** Local receptive fields avoid separate dense connections to every image pixel. B: **Incorrect:** Max pooling does not normally reduce the image to one pixel before the first hidden layer. C: **Correct:** Reusing a filter across all positions is the central reason parameter count is independent of image size. D: **Incorrect:** Flattened fully connected layers generally depend on a fixed number of input values.

Report a correction for Q16

Question 17 MCQ · 5.0 marks

The first layer of the VGG16 model is a Conv2d with kernel = 3, stride = 1, padding = 1. Consider the following Python code snippet using PyTorch and a pre-trained VGG16 model to process an input image: import torch import torch.nn as nn from torchvision import models model = models.vgg16(pretrained=True) feature_extractor = model.features[0] input_image = torch.randn(1, 3, 224, 224) output = feature_extractor(input_image) print(output.shape) What will be the shape of the output tensor printed by this code?
6406536961864.
torch.Size([1, 3, 224, 224])
6406536961865.
torch.Size([1, 64, 112, 112])
6406536961866.
torch.Size([1, 64, 224, 224])
6406536961867.
torch.Size([1, 64, 222, 222])

Published solution

**1. Read the first VGG16 layer:** It has 64 filters, a 3-by-3 kernel, stride 1 and padding 1. The input shape is batch 1, channels 3, height 224, width 224. **2. Compute spatial output:** \[\left\lfloor\frac{224+2(1)-3}{1}\right\rfloor+1=224.\] Both height and width remain 224. **3. Set output channels:** Sixty-four filters produce 64 channels, so the output is torch.Size([1, 64, 224, 224]). No pooling layer is applied by model.features[0]. **Answer: C — Selected: torch.Size([1, 64, 224, 224]).** A: **Incorrect:** The output has 64 channels, not the original three. B: **Incorrect:** A stride-one padded convolution does not halve the spatial dimensions. C: **Correct:** Batch size stays one, filter count gives 64 channels and padding preserves 224-by-224 size. D: **Incorrect:** A 222-by-222 output would correspond to no padding.

Report a correction for Q17

Question 18 MCQ · 5.0 marks

In the ResNet (Residual Network) architecture, 1 × 1 convolutions are frequently used in the ”bottleneck” building block. Beyond dimensionality reduction, what is an additional benefit of using these layers compared to a standard building block?
6406536961868.
They allow the network to increase the spatial resolution of feature maps to recover lost details.
6406536961869.
They allow for the addition of non-linearity (via activation functions) without increasing the receptive field or computational cost excessively.
6406536961870.
They are used to perform Max Pooling operations within the residual mapping.
6406536961871.
They eliminate the need for skip connections by allowing gradients to flow through the 1 × 1 filters instead.

Published solution

**1. Describe the operation:** A 1-by-1 convolution mixes input channels independently at each spatial position. **2. Add expressive power efficiently:** Placing an activation such as ReLU after it introduces another nonlinear transformation without directly enlarging the spatial receptive field. Compared with a larger kernel at the same channel widths, the 1-by-1 convolution is relatively inexpensive. **3. Keep the residual design:** It can reduce or restore channel width in a bottleneck, while the skip connection still provides the residual learning path. The convolution alone is linear; the following activation supplies the nonlinearity. **Answer: B — Selected: They allow for the addition of non-linearity (via activation functions) without increasing the receptive field or computational cost excessively.** A: **Incorrect:** A standard stride-one 1-by-1 convolution does not upsample spatial dimensions. B: **Correct:** A cheap channel-mixing layer followed by an activation adds nonlinear modeling capacity. C: **Incorrect:** Convolution is a learned weighted operation, not max pooling. D: **Incorrect:** Bottleneck blocks still rely on residual skip connections.

Report a correction for Q18

Question 19 MCQ · 5.0 marks

In the YOLO (You Only Look Once) framework, if multiple bounding boxes are predicted by a single grid cell for the same object, how does the algorithm determine which specific bounding box is responsible for that prediction during the training process? It is observed that the number of bounding boxes printed varies for different input images. Which of the following statements best explains this behavior?
6406536961872.
All predicted boxes for that cell are responsible and updated simultaneously.
6406536961873.
The bounding box that has the highest class probability score.
6406536961874.
The bounding box that has the highest Intersection over Union (IoU) with the ground truth.
6406536961875.
The bounding box that is physically closest to the center of the image.

Published solution

**1. Use the original YOLO training rule:** When several box predictors in a cell could represent an object, one predictor is assigned responsibility for that ground-truth object. **2. Compare overlap:** Intersection over Union is \[\mathrm{IoU}=\frac{\text{intersection area}}{\text{union area}}.\] The predictor with the highest IoU with the ground-truth box receives responsibility under this original rule. **3. Separate the extra sentence:** The printed question also mentions varying output counts. That relates to inference filtering, not this training-assignment rule. Modern YOLO versions can use more elaborate assignment strategies; C answers the stated classic responsibility question. **Answer: C — Selected: The bounding box that has the highest Intersection over Union (IoU) with the ground truth.** A: **Incorrect:** The classic rule assigns one responsible predictor for an object, rather than every box in the cell. B: **Incorrect:** Class confidence alone does not measure localization overlap with the true box. C: **Correct:** Maximum overlap identifies the responsible predictor in the original YOLO rule. D: **Incorrect:** Distance from the image center is not the assignment criterion.

Report a correction for Q19

Question 20 MCQ · 5.0 marks

Consider the following code snippet using a YOLO-based object detection model: from ultralytics import YOLO model = YOLO("yolov8n.pt") results = model("image.jpg") boxes = results[0].boxes.xyxy print(boxes.shape) It is observed that the number of bounding boxes printed varies for different input images. Which of the following statements best explains this behavior?
6406536961876.
The model divides the image into a fixed grid and always predicts a fixed number of boxes.
6406536961877.
The model filters predictions based on confidence scores and non maximum suppression, resulting in a variable number of final detections.
6406536961878.
The model uses a Region Proposal Network (RPN) to generate candidate regions before prediction.
6406536961879.
The number of bounding boxes is fixed by the number of classes in the dataset.

Published solution

**1. Separate raw candidates from returned detections:** The network evaluates many candidate locations. results[0].boxes contains the detections retained after postprocessing, rather than every raw network output. **2. Filter predictions:** Low-confidence predictions are discarded. Non-maximum suppression removes redundant overlapping boxes for the same object/class according to the configured settings. **3. Interpret shape:** boxes.xyxy has shape \((N,4)\), with four corner coordinates per retained box. Different images can contain different numbers of confidently detected objects, so N varies. **Answer: B — Selected: The model filters predictions based on confidence scores and non maximum suppression, resulting in a variable number of final detections.** A: **Incorrect:** A fixed candidate layout does not imply a fixed count after postprocessing. B: **Correct:** Confidence filtering and suppression make the final detection count image-dependent. C: **Incorrect:** YOLOv8 is not a two-stage RPN detector. D: **Incorrect:** A class can have zero, one or many detected instances; class count does not fix N.

Report a correction for Q20

Question 21 MCQ · 5.0 marks

In the SRResNet and SRGAN architectures for image super-resolution, which specialized layer is used to upsample the feature maps by rearranging elements from the channel dimension into the spatial dimension?
6406536961880.
The Max Pooling layer with a stride of 2.
6406536961881.
The Bilinear Interpolation layer for smooth scaling.
6406536961882.
The Pixel Shuffle (Sub-pixel Convolution) layer.
6406536961883.
The Global Average Pooling layer to reduce spatial dimensions.

Published solution

**1. Describe the rearrangement:** Pixel Shuffle moves values from channel positions into spatial positions, increasing image resolution. **2. State the shape rule:** For scale factor \(r\), it maps \[(B,Cr^2,H,W)\longrightarrow(B,C,rH,rW).\] For example, four channel groups can be rearranged into a two-times increase in both height and width. **3. Apply it to super-resolution:** SRResNet and SRGAN use sub-pixel convolution blocks, with learned convolutional features followed by Pixel Shuffle, to produce high-resolution outputs. **Answer: C — Selected: The Pixel Shuffle (Sub-pixel Convolution) layer.** A: **Incorrect:** Max pooling downsamples rather than rearranging channels for upsampling. B: **Incorrect:** Bilinear interpolation computes interpolated values; it is a different operation. C: **Correct:** Pixel Shuffle is the channel-to-spatial rearrangement used in sub-pixel upsampling. D: **Incorrect:** Global average pooling collapses spatial dimensions.

Report a correction for Q21

Question 22 MCQ · 5.0 marks

In the Fast R-CNN architecture, which component is responsible for extracting a fixed-size feature vector from a shared convolutional feature map for each region proposal?
6406536961884.
The Region Proposal Network (RPN) which generates anchors.
6406536961885.
The Region of Interest (RoI) Pooling layer.
6406536961886.
A stack of three 3 × 3 convolutional layers.
6406536961887.
The Global Average Pooling layer used in GoogLeNet.

Published solution

**1. Identify the size problem:** Region proposals cover different-sized rectangles in a shared convolutional feature map. A dense classifier needs a consistent input size for every proposal. **2. Apply RoI pooling:** The proposal region is divided into a fixed grid of bins. Pooling within each bin produces the same spatial output size regardless of the proposal’s original dimensions. **3. Feed the detection head:** The fixed-size region features support classification and bounding-box regression. Fast R-CNN uses supplied proposals; the RPN belongs to Faster R-CNN. **Answer: B — Selected: The Region of Interest (RoI) Pooling layer.** A: **Incorrect:** An RPN generates proposals in Faster R-CNN; it is not the fixed-size feature extraction step. B: **Correct:** RoI pooling converts each variable-size proposal region into a fixed-size feature representation. C: **Incorrect:** A generic convolution stack alone does not normalize arbitrary proposal sizes. D: **Incorrect:** Global average pooling over the whole image would not preserve separate proposal-specific features.

Report a correction for Q22

Question 23 MCQ · 5.0 marks

In the GoogLeNet (Inception v1) architecture, 1 × 1 convolutions (bottleneck layers) are applied before larger 3 × 3 and 5 × 5 convolutions. What is the primary motivation for including these 1 × 1 filters within an Inception module?
6406536961888.
Transposed Convolution.
6406536961889.
To reduce the dimensionality (depth) of feature maps to manage computational complexity.
6406536961890.
To replace the need for skip connections and solve the degradation problem.
6406536961891.
To strictly enforce a mean of 0 and variance of 1 across the channel dimension.

Published solution

**1. Identify the expensive operation:** A k-by-k convolution costs roughly \(HWk^2C_{\mathrm{in}}C_{\mathrm{out}}\) multiplications. Large input channel depth makes 3-by-3 and 5-by-5 branches expensive. **2. Insert a bottleneck:** A 1-by-1 convolution first reduces channel count from \(C_{\mathrm{in}}\) to a smaller value. The larger filter then operates on this narrower representation. **3. Explain the benefit:** This makes parallel multi-scale branches practical within a manageable compute and parameter budget. The layer can also be followed by a nonlinearity, but channel reduction is the primary motivation here. **Answer: B — Selected: To reduce the dimensionality (depth) of feature maps to manage computational complexity.** A: **Incorrect:** A standard 1-by-1 bottleneck is not a transposed convolution. B: **Correct:** Reducing channel depth lowers the cost of the subsequent larger convolutions. C: **Incorrect:** Residual skip connections address a different design concern. D: **Incorrect:** A learned convolution does not enforce zero mean/unit variance; normalization layers serve that role.

Report a correction for Q23