MauryaHub PYQ Practice

Deep Learning for Computer Vision · Quiz 1 · May 2026

Deep Learning for Computer Vision · Quiz 1 · May 2026

← 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.

13 / 13 published solutions

Question 2 MCQ · 1.0 marks

In the Canny edge detector, which is the correct order of major steps?
6406537043603.
Non-maximum suppression → Gaussian smoothing → gradient computation → hysteresis thresholding
6406537043604.
Gaussian smoothing → gradient computation → non-maximum suppression → hysteresis thresholding
6406537043605.
Gradient computation → Gaussian smoothing → hysteresis thresholding → non-maximum suppression
6406537043606.
Gaussian smoothing → hysteresis thresholding → non-maximum suppression → gradient computation

Published solution

**1. Recall the four sequential stages of the Canny edge detector:** 1. **Gaussian smoothing:** Suppresses high-frequency noise prior to differentiation. 2. **Gradient computation:** Computes edge magnitude and orientation (e.g., via Sobel filters). 3. **Non-maximum suppression (NMS):** Thins wide gradient ridges into single-pixel-wide local maxima along the gradient direction. 4. **Hysteresis thresholding:** Applies dual thresholds to link weak edge pixels connected to strong edge pixels. **Answer: B — Gaussian smoothing → gradient computation → non-maximum suppression → hysteresis thresholding.** A: **Incorrect:** Non-maximum suppression requires gradients and cannot precede Gaussian smoothing. B: **Correct:** Follows the standard Canny pipeline: Gaussian smoothing, gradient computation, non-maximum suppression, and hysteresis thresholding. C: **Incorrect:** Smoothing must happen before gradient computation, and NMS precedes hysteresis thresholding. D: **Incorrect:** Gradient computation must occur immediately after Gaussian smoothing.

Report a correction for Q2

Question 3 MCQ · 1.0 marks

Which is True?
6406537043611.
Nesterov momentum looks ahead and often converges faster than classical momentum.
6406537043612.
large fixed learning rate always speeds convergence.
6406537043613.
Adam uses only a first-moment estimate of gradients.
6406537043614.
None of these.

Published solution

**1. Evaluate each optimization statement:** - **Option A:** Nesterov Accelerated Gradient (NAG) evaluates gradients at the look-ahead point \( \theta_t - \gamma v_{t-1} \), providing an anticipatory correction that typically converges faster than classical momentum. True. - **Option B:** An excessively large fixed learning rate causes divergence rather than faster convergence. False. - **Option C:** Adam uses both first-moment (mean) and second-moment (uncentered variance) gradient estimates. False. - **Option D:** False since Option A is true. **Answer: A — Nesterov momentum looks ahead and often converges faster than classical momentum.** A: **Correct:** Nesterov momentum computes the gradient at the look-ahead position, reducing overshoot and accelerating convergence. B: **Incorrect:** A large fixed learning rate can cause oscillation and divergence. C: **Incorrect:** Adam tracks both first- and second-moment estimates of the gradients. D: **Incorrect:** Option A is true.

Report a correction for Q3

Question 4 MCQ · 1.0 marks

Correct order of SIFT stages is:
6406537043615.
Orientation → Descriptor → Localization → Extrema Detection
6406537043616.
Extrema Detection → Localization → Orientation → Descriptor
6406537043617.
Extrema Detection → Descriptor → Localization → Orientation
6406537043618.
None of these

Published solution

**1. Recall the four stages of the SIFT pipeline:** 1. **Scale-space Extrema Detection** (using Difference-of-Gaussians) 2. **Keypoint Localization** (sub-pixel refinement and edge/low-contrast filtering) 3. **Orientation Assignment** (dominant local gradient orientation) 4. **Keypoint Descriptor** (128-D local gradient histogram) **Answer: B — Extrema Detection → Localization → Orientation → Descriptor.** A: **Incorrect:** Lists the stages in reverse order. B: **Correct:** Matches Lowe's four-stage SIFT pipeline. C: **Incorrect:** The descriptor is computed last, after localization and orientation assignment. D: **Incorrect:** Option B is the exact sequence.

Report a correction for Q4

Question 5 MCQ · 1.0 marks

Which of the following 3 × 3 kernels is separable?
6406537043619.Source diagram or notation
6406537043620.Source diagram or notation
6406537043621.Source diagram or notation
6406537043622.Source diagram or notation

Published solution

**1. Test each \( 3 \times 3 \) kernel for separability (rank 1):** A 2D kernel \( K \) is separable if \( K = u v^T \) for 1D vectors \( u, v \) (rank 1). - **Option C** is the \( 3 \times 3 \) Gaussian smoothing filter: \[ \frac{1}{16} \begin{bmatrix} 1 & 2 & 1 \\ 2 & 4 & 2 \\ 1 & 2 & 1 \end{bmatrix} = \frac{1}{4}\begin{bmatrix} 1 \\ 2 \\ 1 \end{bmatrix} \frac{1}{4}\begin{bmatrix} 1 & 2 & 1 \end{bmatrix} \] which has rank 1 and is separable. Options A, B, and D have rank \( \ge 2 \) and are not separable. **Answer: C.** A: **Incorrect:** Row 3 (`[1, -50, -2]`) is not a scalar multiple of Row 1 (`[1, 0, -1]`), so the matrix is not rank 1. B: **Incorrect:** The 4-neighbor Laplacian kernel has rank 2 and is not separable. C: **Correct:** Factors as the outer product \( \frac{1}{4}[1, 2, 1]^T \times \frac{1}{4}[1, 2, 1] \). D: **Incorrect:** The negative Laplacian kernel has rank 2 and is not separable.

Report a correction for Q5

Question 6 MCQ · 1.0 marks

Consider the following pyTorch code:
Source diagram or notation
6406537043627.
tensor([0.09, 0.24, 0.67])
6406537043628.
tensor([0.09, 0.24, 0.66])
6406537043629.
tensor([0.09, 0.23, 0.68])
6406537043630.
tensor([0.10, 0.27, 0.63])

Published solution

**1. Compute the row-wise softmax of the first row `x[0] = [1., 2., 3.]`:** \[ y[0]_i = \frac{e^{x[0]_i}}{e^1 + e^2 + e^3} \approx \frac{[2.7183,\ 7.3891,\ 20.0855]}{30.1929} \approx [0.0900,\ 0.2447,\ 0.6652] \] Rounding to 2 decimal places (`decimals=2`) yields **`tensor([0.09, 0.24, 0.67])`**. **Answer: A — `tensor([0.09, 0.24, 0.67])`.** A: **Correct:** `[0.0900, 0.2447, 0.6652]` rounds to `[0.09, 0.24, 0.67]`. B: **Incorrect:** `0.6652` rounds to `0.67`, not `0.66`. C: **Incorrect:** `0.2447` rounds to `0.24`, not `0.23`. D: **Incorrect:** Does not match the exponential softmax probabilities.

Report a correction for Q6

Question 7 NAT · 1.0 marks

Source diagram or notation

Published solution

**1. Apply the Integral Image sub-rectangle sum formula:** For the given \( 3 \times 3 \) integral image \( II = \begin{bmatrix} 4 & 9 & 12 \\ 10 & 20 & 30 \\ 15 & 33 & 50 \end{bmatrix} \), the sum of original pixels in rows \( 2..3 \), columns \( 2..3 \) is: \[ S = II(3, 3) - II(1, 3) - II(3, 1) + II(1, 1) = 50 - 12 - 15 + 4 = 27 \] **Answer: 27.**

Report a correction for Q7

Question 8 NAT · 1.0 marks

Source diagram or notation

Published solution

**1. Apply linear contrast stretching to \( [0, 255] \):** From the \( 3 \times 3 \) image \( \begin{bmatrix} 12 & 40 & 210 \\ 75 & 95 & 160 \\ 30 & 120 & 240 \end{bmatrix} \), \( I_{\min} = 12 \), \( I_{\max} = 240 \), and the center pixel is \( I = 95 \): \[ I_{\text{new}} = \frac{95 - 12}{240 - 12} \times 255 = \frac{83}{228} \times 255 \approx 92.83 \to 93 \] **Answer: 93.**

Report a correction for Q8

Question 9 NAT · 1.0 marks

Source diagram or notation

Published solution

**1. Trace the `.ravel()` view in NumPy:** - `arr = np.arange(6).reshape(2, 3)` creates `[[0, 1, 2], [3, 4, 5]]`. - `v = arr.ravel()` returns a 1D view sharing memory with `arr`. - `v[3] = 99` modifies the 4th element (index 3), which is row 1, column 0 (`arr[1, 0]`). Thus `arr[1, 0]` is **99**. **Answer: 99.**

Report a correction for Q9

Question 10 NAT · 1.0 marks

Source diagram or notation

Published solution

**1. Apply the convolution output size formula twice:** With \( K = 7, P = 3, S = 2 \) on a \( 100 \times 100 \) input: - After 1st conv: \( \lfloor (100 - 7 + 6)/2 \rfloor + 1 = 50 \) - After 2nd conv: \( \lfloor (50 - 7 + 6)/2 \rfloor + 1 = 25 \) **Answer: 25.**

Report a correction for Q10

Question 11 NAT · 1.0 marks

The degrees of freedom for affine transformations in 3D is __

Published solution

**1. Count the parameters of a 3D affine transformation:** A 3D affine transformation \( \mathbf{x}' = A\mathbf{x} + \mathbf{t} \) has a \( 3 \times 3 \) linear matrix \( A \) (9 entries) and a \( 3 \times 1 \) translation vector \( \mathbf{t} \) (3 entries), giving: \[ 9 + 3 = 12 \text{ degrees of freedom} \] **Answer: 12.**

Report a correction for Q11

Question 12 NAT · 1.0 marks

Source diagram or notation

Published solution

**1. Extract the \( 3 \times 3 \) patch for output position \( (3, 3) \):** The bottom-right \( 3 \times 3 \) patch (rows 3–5, cols 3–5) of the \( 5 \times 5 \) image is: \[ \begin{bmatrix} 19 & 26 & 28 \\ 22 & 17 & 18 \\ 24 & 20 & 27 \end{bmatrix} \] **2. Sort the 9 values and take the median (5th value):** Sorted: \( 17, 18, 19, 20, \mathbf{22}, 24, 26, 27, 28 \). The median is **22**. **Answer: 22.**

Report a correction for Q12

Question 13 NAT · 1.0 marks

Source diagram or notation

Published solution

**1. Recall the 8-neighbor discrete Laplacian mask:** With \( -1 \) weights on all 8 surrounding neighbors, the center weight must equal **8** so that the sum of all mask coefficients is zero: \[ \begin{bmatrix} -1 & -1 & -1 \\ -1 & 8 & -1 \\ -1 & -1 & -1 \end{bmatrix} \] **Answer: 8.**

Report a correction for Q13

Question 14 NAT · 1.0 marks

Source diagram or notation

Published solution

**1. Compute the eigenvalues of \( M = \begin{bmatrix} 5 & 1 \\ 1 & 2 \end{bmatrix} \):** - \( \lambda_{\max} + \lambda_{\min} = \text{Tr}(M) = 7 \) - \( \lambda_{\max} \lambda_{\min} = \det(M) = 9 \) - \( \lambda_{\max} - \lambda_{\min} = \sqrt{7^2 - 4(9)} = \sqrt{13} \approx 3.60555 \) **2. Compute Straightness:** \[ \text{Straightness} = \frac{\lambda_{\min} - \lambda_{\max}}{\lambda_{\max} + \lambda_{\min}} = \frac{-\sqrt{13}}{7} \approx -0.515 \] **Answer: -0.515.**

Report a correction for Q14