How to Fix Image Classification When One Class Is Rare?
An ML engineer is tuning an image classification model that shows poor performance on one of two available classes during prediction. Analysis reveals that the images whose class the model performed poorly on represent an extremely small fraction of the whole training dataset. The ML engineer must improve the model’s performance. Which solution will meet this requirement?
Community Insight
The question tests imbalance handling for image data plus metric choice; the trap is applying SMOTE, which is built for numeric feature vectors, to raw images or optimizing accuracy on a skewed dataset.
This MLA-C01 scenario tests how to handle severe class imbalance in an image classification model that performs poorly on an underrepresented class. The correct approach combines F1-score optimization with image augmentation of the minority class, not SMOTE on raw pixels.
Many candidates choose accuracy plus augmentation or SMOTE, but accuracy is misleading under class imbalance and SMOTE interpolates numeric features rather than creating realistic image variations.
Community Discussion (2 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Option B addresses both halves of the problem. Because one class is an extremely small fraction of the training data, accuracy can look high while the model still ignores or misclassifies the minority class; F1 score balances precision and recall and therefore gives a much better signal for the rare class. Image augmentation is the appropriate resampling technique for image data because operations such as rotation, flipping, cropping, and color jitter create new, label-preserving samples of the less common class. Together, F1 optimization and minority-class augmentation directly improve the model's ability to recognize the underrepresented class without fabricating unrealistic pixel patterns.
Why the Other Options Are Wrong
Option A uses image augmentation correctly but optimizes for accuracy, which is exactly the metric that hides poor minority-class performance in an imbalanced dataset. Options C and D rely on Synthetic Minority Oversampling Technique (SMOTE), which interpolates between numeric feature vectors; applying it to raw images produces blended pixel values that do not correspond to realistic images. Option C also combines SMOTE with the wrong metric, accuracy, so it fails on both counts. Option D pairs the right metric, F1, with an inappropriate oversampling method for image data.
Community Comment Notes
Mohamed_Tareq explains that F1 score balances precision and recall and is preferable when the minority class matters, while noting that "SMOTE is primarily designed for numerical feature vectors" rather than raw image data. Alabi frames the scenario as a class imbalance problem: image classification with one extremely underrepresented class and poor performance on that minority class. The community reasoning therefore converges on image augmentation with F1 optimization, matching the analysis above.
Exam Strategy
When an MLA-C01 question mentions imbalance, first identify the data type and the evaluation metric. For image data, prefer augmentation over SMOTE, and prefer F1 or recall-oriented metrics over accuracy when the minority class is the business concern.
Frequently Asked Questions
Why is SMOTE inappropriate for the rare image class in this scenario?
SMOTE interpolates between numeric feature vectors, so applying it to raw pixels often creates unrealistic blended images rather than meaningful variations of the minority class.
Why optimize for F1 score instead of accuracy?
With one extremely small class, high accuracy can hide poor minority-class predictions; F1 balances precision and recall so improvement on the rare class is actually measured.
Related Analysis
Practice All MLA-C01 Questions
Access 115 questions with complete answers and detailed explanations.
View Full MLA-C01 Practice Test →