You want to train a model to classify images of cats and dogs. Which model architecture is best suited for this task?
Think about which model type is designed to capture spatial patterns in images.
CNNs are designed to detect patterns in images by using convolutional layers that scan for features like edges and shapes. Linear regression and RNNs are not suitable for image data, and KNN with raw pixels usually performs poorly.
You are training an image classifier on a dataset of 10,000 images. Which batch size is most likely to balance training speed and model performance?
Consider a batch size that allows efficient computation and stable updates.
Batch sizes like 32 or 64 are commonly used because they provide a good balance between noisy updates (small batches) and slow computation (very large batches). Batch size 1 is slow and noisy; full batch is slow and may not generalize well.
You trained an image classifier on a dataset where 90% of images are class A and 10% are class B. The model predicts class A for all images. What is the accuracy and why is it misleading?
Think about what happens if the model always predicts the majority class.
The model predicts class A for all images, so it is correct 90% of the time. However, it never detects class B, so accuracy is misleading. Other metrics like recall or F1-score are needed.
You trained an image classifier and see training accuracy of 98% but validation accuracy of 60%. What is the most likely cause?
Think about why training accuracy is high but validation accuracy is low.
High training accuracy and low validation accuracy usually means overfitting: the model memorizes training examples but does not generalize well to new data.
You want to train an image classifier but have only 500 labeled images. Which approach best improves model performance?
Think about how to leverage knowledge from large datasets when you have few images.
Transfer learning uses a pretrained CNN trained on large datasets to extract useful features. Fine-tuning it on your small dataset improves performance compared to training from scratch.