0
0
Computer Visionml~10 mins

Why CNNs dominate image classification in Computer Vision - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the main CNN layer used for image classification.

Computer Vision
from tensorflow.keras.layers import [1]
Drag options to blanks, or click blank then click option'
AConv2D
BDropout
CLSTM
DDense
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing Dense instead of Conv2D because Dense is for fully connected layers.
Selecting LSTM which is for sequence data, not images.
2fill in blank
medium

Complete the code to add a convolutional layer with 32 filters and a 3x3 kernel.

Computer Vision
model.add(Conv2D([1], kernel_size=(3, 3), activation='relu'))
Drag options to blanks, or click blank then click option'
A128
B32
C64
D16
Attempts:
3 left
💡 Hint
Common Mistakes
Using 16 filters which might be too few for good feature extraction.
Choosing 128 filters which is usually for deeper layers.
3fill in blank
hard

Fix the error in the code to correctly flatten the output before the dense layer.

Computer Vision
model.add([1]())
Drag options to blanks, or click blank then click option'
AMaxPooling2D
BConv2D
CFlatten
DDropout
Attempts:
3 left
💡 Hint
Common Mistakes
Using Conv2D again which expects 2D input.
Using MaxPooling2D which reduces spatial size but does not flatten.
4fill in blank
hard

Fill both blanks to compile the CNN model with Adam optimizer and categorical crossentropy loss.

Computer Vision
model.compile(optimizer=[1], loss=[2], metrics=['accuracy'])
Drag options to blanks, or click blank then click option'
A'adam'
B'sgd'
C'categorical_crossentropy'
D'mean_squared_error'
Attempts:
3 left
💡 Hint
Common Mistakes
Using SGD optimizer which can work but is less common for beginners.
Using mean squared error loss which is for regression, not classification.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps image labels to their counts if count is greater than 10.

Computer Vision
label_counts = { [1]: [2] for [3] in labels if labels[[3]] > 10 }
Drag options to blanks, or click blank then click option'
Alabel
Blabels[label]
Dcount
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'count' as loop variable which is undefined.
Swapping keys and values in the dictionary comprehension.