arXiv(opens in a new tab)Computer ScienceOct 2017Cited by 2 papers on PaperVantage

Manuscript Offprint

arXiv:1710.05381

A systematic study of the class imbalance problem in convolutional neural networks

M. Buda, A. Maki, M. Mazurowski

Abstract

In this study, we systematically investigate the impact of class imbalance on classification performance of convolutional neural networks (CNNs) and compare frequently used methods to address the issue. Class imbalance is a common problem that has been comprehensively studied in classical machine learning, yet very limited systematic research is available in the context of deep learning. In our study, we use three benchmark datasets of increasing complexity, MNIST, CIFAR-10 and ImageNet, to investigate the effects of imbalance on classification and perform an extensive comparison of several methods to address the issue: oversampling, undersampling, two-phase training, and thresholding that compensates for prior class probabilities. Our main evaluation metric is area under the receiver operating characteristic curve (ROC AUC) adjusted to multi-class tasks since overall accuracy metric is associated with notable difficulties in the context of imbalanced data. Based on results from our experiments we conclude that (i) the effect of class imbalance on classification performance is detrimental; (ii) the method of addressing class imbalance that emerged as dominant in almost all analyzed scenarios was oversampling; (iii) oversampling should be applied to the level that completely eliminates the imbalance, whereas the optimal undersampling ratio depends on the extent of imbalance; (iv) as opposed to some classical machine learning models, oversampling does not cause overfitting of CNNs; (v) thresholding should be applied to compensate for prior class probabilities when overall number of properly classified cases is of interest.

Keywords: Class Imbalance, Convolutional Neural Networks, Deep Learning, Image Classification

1 Introduction

Convolutional neural networks (CNNs) are gaining significance in a number of machine learning application domains and are currently contributing to the state of the art in the field of computer vision, which includes tasks such as object detection, image classification, and segmentation. They are also widely used in natural language processing or speech recognition where they are replacing or improving classical machine learning models [1]. CNNs integrate automatic feature extraction and discriminative classifier in one model, which is the main difference between them and traditional machine learning techniques. This property allows CNNs to learn hierarchical representations [2]. The standard CNN is built with fully connected layers and a number of blocks consisting of convolutions, activation function layer and max pooling [3, 4, 5]. The complex nature of CNNs requires a significant computational power for training and evaluation of the networks, which is addressed with the help of modern graphical processing units (GPUs).

A common problem in real life applications of deep learning based classifiers is that some classes have a significantly higher number of examples in the training set than other classes. This difference is referred to as class imbalance. There are plenty of examples in domains like computer vision [6, 7, 8, 9, 10], medical diagnosis [11, 12], fraud detection [13] and others [14, 15, 16] where this issue is highly significant and the frequency of one class (e.g., cancer) can be 1000 times less than another class (e.g., healthy patient). It has been established that class imbalance can have significant detrimental effect on training traditional classifiers [17] including multi-layer perceptrons [18]. It affects both convergence during the training phase and generalization of a model on the test set. While the issue very likely also affects deep learning, no systematic study on the topic is available.

Methods of dealing with imbalance are well studied for classical machine learning models [19, 17, 20, 18]. The most straightforward and common approach is the use of sampling methods. Those methods operate on the data itself (rather than the model) to increase its balance. Widely used and proven to be robust is oversampling [21]. Another option is undersampling. Naïve version, called random majority undersampling, simply removes a random portion of examples from majority classes [17]. The issue of class imbalance can be also tackled on the level of the classifier. In such case, the learning algorithms are modified, e.g. by introducing different weights to misclassification of examples from different classes [22] or explicitly adjusting prior class probabilities [23].

Some previous studies showed results on cost sensitive learning of deep neural networks [24, 25, 26]. New kinds of loss function for neural networks training were also developed [27]. Recently, a new method for CNNs was introduced that trains the network in two-phases in which the network is trained on the balanced data first and then the output layers are fine-tuned [28]. While little systematic analysis of imbalance and methods to deal with it is available for deep learning, researchers employ some methods that might be addressing the problem likely based on intuition, some internal tests, and systematic results available for traditional machine learning. Based on our review of the literature, the method most commonly applied in deep learning is oversampling.

The reminder of this paper is organized as follows. Section 2 gives an overview of methods to address the problem of imbalance. In Section 3 we describe the experimental setup. It provides details about compared methods, datasets and models used for evaluation. Then, in Section 4 we present the results from our experiments and compare methods. Finally, Section 5 concludes the paper.

References (60)

  • Recent advances in convolutional neural networks
  • Visualizing and understanding convolutional networks
  • Backpropagation applied to handwritten zip code recognition
  • Imagenet classification with deep convolutional neural networks
  • Very Deep Convolutional Networks for Large-Scale Image Recognition
  • The inaturalist challenge 2017 dataset (opens arXiv in a new tab)
  • Sun database: Large-scale scene recognition from abbey to zoo
  • A hybrid pansharpening approach and multiscale object-based image analysis for mapping diseased pine and oak trees
  • Machine learning for the detection of oil spills in satellite radar images
  • Automated annotation of coral reef survey images
  • An approach to imbalanced data sets based on changing rule strength
  • The problem of bias in training data in regression problems in medical decision support
  • Toward scalable learning with non-uniform class and cost distributions: A case study in credit card fraud detection
  • Classification and knowledge discovery in protein databases
  • Improving minority class prediction using case-specific feature weights
  • Learning from class-imbalanced data: Review of methods and applications
  • The class imbalance problem: A systematic study
  • Training neural network classifiers for medical decision making: The effects of imbalanced datasets on classification performance
  • Data mining for direct marketing: Problems and solutions
  • Training cost-sensitive neural networks with methods addressing the class imbalance problem
  • Neural network classification and prior class probabilities
  • Cost sensitive learning of deep feature representations from imbalanced data (opens arXiv in a new tab)
  • Towards effective classification of imbalanced data with convolutional neural networks
  • Cost-aware pre-training for multiclass cost-sensitive deep learning (opens arXiv in a new tab)
  • Training deep neural networks on imbalanced data sets
  • Brain tumor segmentation with deep neural networks
  • Learning from imbalanced data
  • Age and gender classification using convolutional neural networks
  • Deep learning for digital pathology image analysis: A comprehensive tutorial with selected use cases
  • Detection of concealed cars in complex cargo x-ray imagery using deep learning
  • Smote: synthetic minority over-sampling technique
  • A hybrid classifier combining smote with pso to estimate 5-year survivability of breast cancer patients
  • Borderline-smote: a new over-sampling method in imbalanced data sets learning
  • Class imbalances versus small disjuncts
  • Learning from imbalanced data sets with boosting and data generation: the databoost-im approach
  • Relay backpropagation for effective learning of deep convolutional neural networks
  • why under-sampling beats over-sampling
  • one-sided selection
  • On the relation of performance to editing in nearest neighbor rules
  • Restricted decontamination for the imbalanced training sample problem
  • Neural network classifiers estimate bayesian a posteriori probabilities
  • Nonlinear autoassociation is not equivalent to pca
  • Novelty detection using auto-associative neural network
  • The novelty detection approach for different degrees of class imbalance
  • Exploratory undersampling for class-imbalance learning
  • Smoteboost: Improving prediction of the minority class in boosting
  • Gradient-based learning applied to document recognition
  • Learning multiple layers of features from tiny images
  • International Journal of Computer Vision, 115(3):211–252, 2015
  • Caffe: Convolutional architecture for fast feature embedding
  • Understanding the difficulty of training deep feedforward neural networks
  • Maxout networks
  • Striving for Simplicity: The All Convolutional Net
  • Imagenet pre-trained models with batch normalization (opens arXiv in a new tab)
  • Deep residual learning for image recognition
  • Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift
  • Delving deep into rectifiers: Surpassing human-level performance on imagenet classification
  • Machine learning in python
  • Auc: a statistically consistent and more discriminating measure than accuracy
  • Tree induction for probability-based ranking