Let’s say you’re training a model to detect a disease from chest X-rays. You collect a dataset with 1000 image, but only 50 actually show the disease.
Now here’s the catch: if your model simply predicts “normal” for every image, it will still be 95% accurate.
So what’s going on here?
This is what we call class imbalance, when one category in your data appears far more often than another. In many real-world problems, especially in healthcare, the “important” cases (like a disease) are actually the rare ones.
The problem is that most machine learning models are designed to minimize overall error. So naturally, they focus on getting the majority class right. In this case, that means learning to predict “normal” very well, while quietly ignoring the minority class.
From a practical standpoint, this is a big issue. In medical settings, missing a positive case can have serious consequences. That’s why accuracy alone can be misleading. Metrics like sensitivity (how well the model detects positives) become much more important when dealing with imbalanced data.
There are a few ways to deal with this. You can try to rebalance the dataset by adding more minority examples or reducing the majority ones. You can also change how the model is trained so that it “cares more” about the rare cases. Another approach is to improve how the model learns patterns in general, so it can still recognize important signals even when examples are limited.
This idea shows up a lot in medical imaging. Most scans are normal, but the goal is to catch the abnormal ones, which makes class imbalance a core challenge rather than just a minor inconvenience.
Now using class imbalance in a sentence:
Serious example – “Because of class imbalance, the model achieved high accuracy but had poor sensitivity for detecting positive cases.”
Less serious – “Our group project has serious class imbalance, one person does all the work while the rest of us just show up at the end.”
