0
0
Computer Visionml~20 mins

Handwriting recognition basics in Computer Vision - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Handwriting Recognition Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the main purpose of preprocessing in handwriting recognition?

In handwriting recognition, preprocessing is an important step before feeding data to the model. What is the main goal of preprocessing?

ATo increase the size of the dataset by creating new handwritten samples
BTo clean and normalize the input images so the model can learn better
CTo train the model faster by reducing the number of layers
DTo convert the handwritten text into audio signals
Attempts:
2 left
💡 Hint

Think about what helps the model understand different handwriting styles better.

Predict Output
intermediate
2:00remaining
Output of a simple handwriting image normalization code

What is the shape of the image after normalization in the code below?

Computer Vision
import numpy as np
from PIL import Image

img = Image.open('handwritten_sample.png').convert('L')
img_resized = img.resize((28, 28))
img_array = np.array(img_resized) / 255.0
print(img_array.shape)
A(28, 28)
B(1, 28, 28)
C(28, 28, 1)
D(784,)
Attempts:
2 left
💡 Hint

Look at how the image is resized and converted to an array.

Model Choice
advanced
2:00remaining
Best model type for recognizing handwritten digits

Which model type is most suitable for recognizing handwritten digits from images?

ALinear Regression
BRecurrent Neural Network (RNN)
CConvolutional Neural Network (CNN)
DK-Means Clustering
Attempts:
2 left
💡 Hint

Think about which model handles images and spatial patterns well.

Metrics
advanced
2:00remaining
Choosing the right metric for handwriting recognition accuracy

Which metric best measures how well a handwriting recognition model correctly identifies digits?

APerplexity
BMean Squared Error
CSilhouette Score
DAccuracy
Attempts:
2 left
💡 Hint

Consider a metric that counts correct predictions over total predictions.

🔧 Debug
expert
2:00remaining
Why does this handwriting recognition model fail to improve accuracy?

Consider this training loop for a handwriting recognition model. Why does the accuracy stay low after many epochs?

for epoch in range(10):
    for images, labels in train_loader:
        outputs = model(images)
        loss = criterion(outputs, labels)
        optimizer.zero_grad()
        loss.backward()
        optimizer.step()
    print(f'Epoch {epoch+1}, Loss: {loss.item()}')
AThe model is not set to training mode, so dropout and batch norm behave incorrectly
BThe optimizer.zero_grad() is called after loss.backward(), causing gradient accumulation
CThe loss is not computed using the correct labels tensor shape
DThe print statement is inside the inner loop, causing too many outputs
Attempts:
2 left
💡 Hint

Think about what happens if the model is not told it is training.