What are your favorite methods for handling class imbalance in data?

I am particularly interested in the context of convolutional neural network classifier training. One class predominates in the data set far more than the other.

Although I am not sure how I seem to recall reading or hearing that Bayesian optimization can occasionally be used for this. Any sources or clarifications on this?