MauryaHub PYQ Practice

Deep Learning for Computer Vision · Quiz 1 · Jan 2026

Deep Learning for Computer Vision · Quiz 1 · Jan 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 / 14 published solutions

Question 2 MCQ · 1.0 marks

In the Canny edge detector, which is the correct order of major steps?
6406536373687.
Non-maximum suppression → Gaussian smoothing → gradient computation → hysteresis thresholding
6406536373688.
Gaussian smoothing → gradient computation → non-maximum suppression → hysteresis thresholding
6406536373689.
Gradient computation → Gaussian smoothing → hysteresis thresholding → non-maximum suppression
6406536373690.
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:** Convolve the image with a Gaussian filter to suppress high-frequency noise before taking derivatives. 2. **Gradient computation:** Compute intensity gradient magnitude and orientation (e.g., using Sobel operators). 3. **Non-maximum suppression (NMS):** Thin wide gradient ridges into 1-pixel-wide candidate edges by keeping only local maxima along the gradient direction. 4. **Hysteresis thresholding:** Use high and low thresholds (\( T_{\text{high}}, T_{\text{low}} \)) to accept strong edges and connect weak edges that touch strong edges. **Answer: B — Gaussian smoothing → gradient computation → non-maximum suppression → hysteresis thresholding.** A: **Incorrect:** Non-maximum suppression cannot be performed before computing the image gradients. B: **Correct:** Follows the exact Canny pipeline: noise reduction (Gaussian), gradient calculation, edge thinning (NMS), and edge tracking (hysteresis). C: **Incorrect:** Smoothing must precede gradient computation to prevent noise amplification, and NMS precedes hysteresis thresholding. D: **Incorrect:** Gradients must be computed right after smoothing before NMS or thresholding can occur.

Report a correction for Q2

Question 3 MCQ · 1.0 marks

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

Published solution

**1. Evaluate each statement about optimization algorithms:** - **Option A:** Nesterov Accelerated Gradient (NAG) evaluates the gradient at the 'look-ahead' position \( \theta_t - \gamma v_{t-1} \) rather than the current position \( \theta_t \). This anticipatory correction prevents overshooting and typically yields faster convergence than classical momentum. True. - **Option B:** An overly large fixed learning rate causes oscillations or divergence rather than faster convergence. False. - **Option C:** Adam (Adaptive Moment Estimation) maintains **both** a first-moment estimate (exponentially decaying average of gradients) and a second-moment estimate (exponentially decaying average of squared gradients). 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 parameter position, reducing oscillations and speeding up convergence. B: **Incorrect:** A large fixed learning rate can overshoot minima and cause the loss to diverge. C: **Incorrect:** Adam tracks both first-moment (mean) and second-moment (uncentered variance) estimates of the gradients. D: **Incorrect:** Statement A is true.

Report a correction for Q3

Question 4 MCQ · 1.0 marks

Correct order of SIFT stages is:
6406536373700.
Orientation → Descriptor → Localization → Extrema Detection
6406536373701.
Extrema Detection → Localization → Orientation → Descriptor
6406536373702.
Extrema Detection → Descriptor → Localization → Orientation
6406536373703.
None of these.

Published solution

**1. Recall the four stages of the SIFT (Scale-Invariant Feature Transform) pipeline:** 1. **Scale-space Extrema Detection:** Search over Difference-of-Gaussian (DoG) scale space to identify candidate interest points across scales and spatial locations. 2. **Keypoint Localization:** Refine candidate locations to sub-pixel accuracy and reject low-contrast points and poorly localized edge responses. 3. **Orientation Assignment:** Assign one or more dominant gradient orientations to each keypoint to achieve rotation invariance. 4. **Keypoint Descriptor:** Compute a 128-dimensional local gradient histogram descriptor relative to the keypoint's scale and orientation. **Answer: B — Extrema Detection → Localization → Orientation → Descriptor.** A: **Incorrect:** Reverses the entire SIFT pipeline; you cannot assign orientation before detecting keypoints. B: **Correct:** Matches Lowe's four-stage SIFT pipeline in exact order. C: **Incorrect:** The descriptor is computed last, after keypoint localization and orientation assignment. D: **Incorrect:** Option B gives the exact order.

Report a correction for Q4

Question 5 MCQ · 1.0 marks

Which of the following 3 × 3 kernels is separable?
6406536373704.Source diagram or notation
6406536373705.Source diagram or notation
6406536373706.Source diagram or notation
6406536373707.Source diagram or notation

Published solution

**1. Define a separable 2D kernel:** A \( 3 \times 3 \) matrix \( K \) is separable if and only if it has rank 1, meaning it can be written as the outer product of a \( 3 \times 1 \) column vector \( u \) and a \( 1 \times 3 \) row vector \( v^T \) (\( K = u v^T \), so every row is a scalar multiple of the first row). **2. Check each option:** - **Option A:** \( \begin{bmatrix} 1 & 0 & -1 \\ 2 & 0 & -2 \\ 1 & -50 & -2 \end{bmatrix} \). Row 3 is not a multiple of Row 1. Not separable. - **Option B:** \( \begin{bmatrix} 0 & -1 & 0 \\ -1 & 4 & -1 \\ 0 & -1 & 0 \end{bmatrix} \) (4-neighbor Laplacian). Row 2 is not a multiple of Row 1 (rank 2). Not separable. - **Option C:** \( \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} \cdot \frac{1}{4}\begin{bmatrix} 1 & 2 & 1 \end{bmatrix} \) (the \( 3 \times 3 \) Gaussian smoothing kernel). Every row is a multiple of \( [1, 2, 1] \) (rank 1), so it is **separable**. - **Option D:** \( \begin{bmatrix} 0 & 1 & 0 \\ 1 & -4 & 1 \\ 0 & 1 & 0 \end{bmatrix} \) (Laplacian). Rank 2, not separable. **Answer: C.** A: **Incorrect:** The third row \( [1, -50, -2] \) is not proportional to \( [1, 0, -1] \), so the matrix rank is greater than 1. B: **Incorrect:** The 2D Laplacian kernel has rank 2 and cannot be factored as a single outer product \( u v^T \). C: **Correct:** The \( 3 \times 3 \) Gaussian kernel \( \frac{1}{16}\begin{bmatrix}1&2&1\\2&4&2\\1&2&1\end{bmatrix} \) factors into \( \frac{1}{4}[1,2,1]^T \times \frac{1}{4}[1,2,1] \). D: **Incorrect:** The negative Laplacian kernel also 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
6406536373712.
tensor([0.09, 0.24, 0.67])
6406536373713.
tensor([0.09, 0.24, 0.66])
6406536373714.
tensor([0.09, 0.23, 0.68])
6406536373715.
tensor([0.10, 0.27, 0.63])

Published solution

**1. Trace the PyTorch code:** The code defines: - `x = torch.tensor([[1., 2., 3.], [4., 5., 6.]])` - `y = torch.softmax(x, dim=1)` (applies softmax across columns for each row independently). - `print(torch.round(y[0], decimals=2))` **2. Calculate the softmax of the first row \( x[0] = [1.0, 2.0, 3.0] \):** \[ y[0]_i = \frac{e^{x[0]_i}}{e^1 + e^2 + e^3} \] - \( e^1 \approx 2.71828 \) - \( e^2 \approx 7.38906 \) - \( e^3 \approx 20.08554 \) - Sum: \( 2.71828 + 7.38906 + 20.08554 = 30.19288 \) Dividing each term by \( 30.19288 \): - \( y[0]_0 = 2.71828 / 30.19288 \approx 0.09003 \to 0.09 \) - \( y[0]_1 = 7.38906 / 30.19288 \approx 0.24473 \to 0.24 \) - \( y[0]_2 = 20.08554 / 30.19288 \approx 0.66524 \to 0.67 \) **Answer: A — `tensor([0.09, 0.24, 0.67])`.** A: **Correct:** \( [e^1, e^2, e^3] / (e^1 + e^2 + e^3) \approx [0.0900, 0.2447, 0.6652] \), which rounds to `[0.09, 0.24, 0.67]`. B: **Incorrect:** \( 0.6652 \) rounds to \( 0.67 \), not \( 0.66 \) (and probabilities sum to \( 1.00 \)). C: **Incorrect:** \( e^2 / (e^1 + e^2 + e^3) \approx 0.2447 \) rounds to \( 0.24 \), not \( 0.23 \). D: **Incorrect:** Does not match the exponential softmax values of `[1., 2., 3.]`.

Report a correction for Q6

Question 7 NAT · 1.0 marks

Source diagram or notation

Published solution

**1. Understand the Integral Image (Summed-Area Table) formula:** Given the \( 3 \times 3 \) integral image: \[ II = \begin{bmatrix} 4 & 9 & 12 \\ 10 & 20 & 30 \\ 15 & 33 & 50 \end{bmatrix} \] The sum of original pixel intensities over the sub-rectangle spanning rows \( 2..3 \) and columns \( 2..3 \) (1-based indexing) is given by inclusion-exclusion: \[ S = II(3, 3) - II(1, 3) - II(3, 1) + II(1, 1) \] **2. Substitute the entries from \( II \):** \[ S = 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. Identify the minimum, maximum, and central pixel intensity:** From the given \( 3 \times 3 \) image matrix: \[ I = \begin{bmatrix} 12 & 40 & 210 \\ 75 & 95 & 160 \\ 30 & 120 & 240 \end{bmatrix} \] - Minimum intensity: \( I_{\min} = 12 \) - Maximum intensity: \( I_{\max} = 240 \) - Central pixel intensity: \( I(2,2) = 95 \) **2. Apply the linear contrast stretching formula to \( [0, 255] \):** \[ I_{\text{new}} = \frac{I - I_{\min}}{I_{\max} - I_{\min}} \times 255 = \frac{95 - 12}{240 - 12} \times 255 = \frac{83}{228} \times 255 \approx 92.8289 \] **3. Round to the nearest integer:** Rounding \( 92.8289 \) to the nearest integer gives \( 93 \). **Answer: 93.**

Report a correction for Q8

Question 9 NAT · 1.0 marks

Source diagram or notation

Published solution

**1. Trace the NumPy array assignment:** - `arr = np.array([[9, 8], [7, 6]])` creates a \( 2 \times 2 \) array. - `alias = arr` does **not** copy the array; `alias` and `arr` point to the exact same underlying array object in memory. - `alias[1, 1] = 0` modifies the element at row 1, column 1 in-place to `0`. **2. Conclude:** Because `arr` and `alias` reference the same array, `arr[1, 1]` is now `0`. **Answer: 0.**

Report a correction for Q9

Question 10 NAT · 1.0 marks

Source diagram or notation

Published solution

**1. Trace the NumPy `.ravel()` view behavior:** - `arr = np.arange(6).reshape(2, 3)` creates: \[ \text{arr} = \begin{bmatrix} 0 & 1 & 2 \\ 3 & 4 & 5 \end{bmatrix} \] - `v = arr.ravel()` returns a contiguous 1D **view** of `arr` (sharing the same memory buffer): `[0, 1, 2, 3, 4, 5]`. - `v[3] = 99` modifies index 3 of the flattened view, which corresponds to row \( 3 // 3 = 1 \), column \( 3 \bmod 3 = 0 \) of `arr`. **2. Conclude:** Therefore, `arr[1, 0]` becomes `99`. **Answer: 99.**

Report a correction for Q10

Question 11 NAT · 1.0 marks

Source diagram or notation

Published solution

**1. Recall the spatial output size formula for a 2D convolution:** For input size \( W \), kernel size \( K = 7 \), padding \( P = 3 \), and stride \( S = 2 \): \[ W_{\text{out}} = \left\lfloor \frac{W - K + 2P}{S} \right\rfloor + 1 \] **2. Apply the formula across the two successive convolutions:** - **After the 1st convolution (\( W = 100 \)):** \[ W_1 = \left\lfloor \frac{100 - 7 + 2(3)}{2} \right\rfloor + 1 = \left\lfloor \frac{99}{2} \right\rfloor + 1 = 49 + 1 = 50 \] - **After the 2nd convolution (\( W_1 = 50 \)):** \[ W_2 = \left\lfloor \frac{50 - 7 + 2(3)}{2} \right\rfloor + 1 = \left\lfloor \frac{49}{2} \right\rfloor + 1 = 24 + 1 = 25 \] Thus, the resulting spatial dimension is \( 25 \times 25 \) (value `25`). **Answer: 25.**

Report a correction for Q11

Question 12 NAT · 1.0 marks

The sum of the degrees of freedom for translation and affine transformations in 3D is __

Published solution

**1. Analyze the degrees of freedom (DoF) in 3D:** - A 3D translation vector \( \mathbf{t} \in \mathbb{R}^3 \) has \( 3 \) degrees of freedom. - A 3D linear transformation matrix \( A \in \mathbb{R}^{3 \times 3} \) has \( 9 \) degrees of freedom. - A 3D affine transformation \( \mathbf{x}' = A\mathbf{x} + \mathbf{t} \) combines the 9 linear parameters and the 3 translation parameters, giving a total of: \[ 9 + 3 = 12 \text{ degrees of freedom} \] **2. Note on wording:** The official key is `12` (representing the combined degrees of freedom of the translation and linear/affine components that make up a 3D affine transformation; if 3D translation (3 DoF) and a full 3D affine transformation (12 DoF) are summed separately, the literal sum is \( 3 + 12 = 15 \)). **Answer: 12.**

Report a correction for Q12

Question 13 NAT · 1.0 marks

Source diagram or notation

Published solution

**1. Identify the \( 3 \times 3 \) window corresponding to output position \( (3, 3) \):** When applying a \( 3 \times 3 \) filter with stride 1 and no padding to a \( 5 \times 5 \) image, the output is a \( 3 \times 3 \) matrix. Position \( (3, 3) \) (1-based, bottom-right entry of the \( 3 \times 3 \) output) corresponds to the bottom-right \( 3 \times 3 \) patch of the \( 5 \times 5 \) input image (rows 3 to 5, columns 3 to 5): \[ \begin{bmatrix} 19 & 26 & 28 \\ 22 & 17 & 18 \\ 24 & 20 & 27 \end{bmatrix} \] **2. Sort the 9 values in ascending order to find the median:** \[ 17,\ 18,\ 19,\ 20,\ \mathbf{22},\ 24,\ 26,\ 27,\ 28 \] The 5th (middle) element is \( 22 \). **Answer: 22.**

Report a correction for Q13

Question 14 NAT · 1.0 marks

Source diagram or notation

Published solution

**1. Recall the 8-neighbor discrete Laplacian kernel:** When including all 8 immediate neighbors (horizontal, vertical, and diagonal) with weight \( -1 \) around the center pixel (or positive center with negative surround so the sum of all 9 weights equals zero), the \( 3 \times 3 \) discrete Laplacian mask is: \[ L_8 = \begin{bmatrix} -1 & -1 & -1 \\ -1 & 8 & -1 \\ -1 & -1 & -1 \end{bmatrix} \] **2. Conclude:** To balance the 8 surrounding \( -1 \) weights so the filter response on a constant region is zero, the middle (center) element is \( 8 \). **Answer: 8.**

Report a correction for Q14

Question 15 NAT · 1.0 marks

Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q15