0
0
Computer Visionml~20 mins

Super-resolution basics in Computer Vision - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Super-resolution Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:00remaining
What is the main goal of super-resolution in computer vision?

Super-resolution is a technique used in computer vision. What is its main goal?

ATo increase the resolution of an image by adding more pixels and details
BTo reduce the size of an image without losing quality
CTo convert a color image into grayscale
DTo detect objects within an image
Attempts:
2 left
💡 Hint

Think about what happens when you zoom into a blurry photo and want it clearer.

Model Choice
intermediate
1:30remaining
Which model type is commonly used for image super-resolution?

Which of the following model types is most commonly used to perform image super-resolution?

AConvolutional Neural Networks (CNNs)
BK-Nearest Neighbors (KNN)
CSupport Vector Machines (SVMs)
DRecurrent Neural Networks (RNNs)
Attempts:
2 left
💡 Hint

Think about models good at processing images and spatial data.

Predict Output
advanced
2:00remaining
Output shape after upsampling in super-resolution model

Consider this PyTorch code snippet for a super-resolution model. What is the shape of the output tensor?

Computer Vision
import torch
import torch.nn as nn

class SimpleSR(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 64, kernel_size=3, padding=1)
        self.upsample = nn.PixelShuffle(upscale_factor=2)
        self.conv_out = nn.Conv2d(16, 3, kernel_size=3, padding=1)

    def forward(self, x):
        x = self.conv(x)  # shape: (batch, 64, H, W)
        x = self.upsample(x)  # shape: (batch, 16, 2*H, 2*W)
        x = self.conv_out(x)  # shape: (batch, 3, 2*H, 2*W)
        return x

input_tensor = torch.randn(1, 3, 24, 24)
model = SimpleSR()
output = model(input_tensor)
output.shape
Atorch.Size([1, 64, 48, 48])
Btorch.Size([1, 3, 24, 24])
Ctorch.Size([1, 3, 48, 48])
Dtorch.Size([1, 16, 48, 48])
Attempts:
2 left
💡 Hint

PixelShuffle with upscale_factor=2 doubles height and width but reduces channels accordingly.

Metrics
advanced
1:30remaining
Which metric best measures super-resolution image quality?

Which metric is most commonly used to measure the quality of super-resolution images compared to the original high-resolution images?

AF1 Score
BPeak Signal-to-Noise Ratio (PSNR)
CMean Squared Error (MSE)
DAccuracy
Attempts:
2 left
💡 Hint

Think about a metric that compares pixel differences but on a logarithmic scale.

🔧 Debug
expert
2:30remaining
Why does this super-resolution model training loss not decrease?

Given the following training loop for a super-resolution model, why might the loss not decrease during training?

Computer Vision
import torch
import torch.nn as nn
import torch.optim as optim

model = nn.Sequential(
    nn.Conv2d(3, 64, 3, padding=1),
    nn.ReLU(),
    nn.Conv2d(64, 3, 3, padding=1)
)

criterion = nn.MSELoss()
optimizer = optim.Adam(model.parameters(), lr=0.001)

input_lr = torch.randn(1, 3, 24, 24)  # low-res input
target_hr = torch.randn(1, 3, 48, 48)  # high-res target

for epoch in range(5):
    optimizer.zero_grad()
    output = model(input_lr)
    loss = criterion(output, target_hr)
    loss.backward()
    optimizer.step()
    print(f"Epoch {epoch+1}, Loss: {loss.item():.4f}")
AThe optimizer Adam is not compatible with Conv2d layers
BThe learning rate is too high causing unstable training
CThe loss function MSELoss is not suitable for super-resolution
DThe model output shape (1,3,24,24) does not match target shape (1,3,48,48), causing poor learning
Attempts:
2 left
💡 Hint

Check if the model output size matches the target size for loss calculation.