Balanced Batch Generation for Imbalanced Datasets