I have an image dataset that I need to segment into directories (train, validation and test) using ImageDataGenerator in TensorFlow/Keras. The dataset is highly imbalanced: enter image description here For this I have decided to do the following in the training set: under-sample the majority class and augment the minority class images. However, this under-sampling would result in the loss of information.

Is there any way to quantify the extent of loss as a result of under-sampling the majority class, in terms of its share in the training set?

  • $\begingroup$ Why would you undersample? That both changes the class frequencies to something unnatural and discards precious data. $\endgroup$
    – Dave
    Commented Nov 24, 2022 at 17:02
  • $\begingroup$ The differences between the percentages of samples in the training set for each class were not TOO big. It was 75% for the majority class vs 85% for minority classes for an eventual 80-10-10 split. However, I had to drop the idea of under-sampling. Though I am still curious if there is a way to determine the extent of information loss due to under-sampling. $\endgroup$ Commented Nov 25, 2022 at 17:46

1 Answer 1


refer article: Entropy and improved k‐nearest neighbor search based under‐sampling (ENU) method to handle class overlap in imbalanced datasets


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.