Class imbalance should not throw you off balance: Choosing the right classifiers and performance metrics for brain decoding with imbalanced data
Open accessThe DOI matches its Crossref record; 88 of the 88 references it cites were found in a registry or an index.
Abstract
Machine learning (ML) is increasingly used in cognitive, computational and clinical neuroscience. The reliable and efficient application of ML requires a sound understanding of its subtleties and limitations. Training ML models on datasets with imbalanced classes is a particularly common problem, and it can have severe consequences if not adequately addressed. With the neuroscience ML user in mind, this paper provides a didactic assessment of the class imbalance problem and illustrates its impact through systematic manipulation of data imbalance ratios in (i) simulated data and (ii) brain data recorded with electroencephalography (EEG), magnetoencephalography (MEG) and functional magnetic resonance imaging (fMRI). Our results illustrate how the widely-used Accuracy (Acc) metric, which measures the overall proportion of successful predictions, yields misleadingly high performances, as class imbalance increases. Because Acc weights the per-class ratios of correct predictions proportionally to class size, it largely disregards the performance on the minority class. A binary classification model that learns to systematically vote for the majority class will yield an artificially high decoding accuracy that directly reflects the imbalance between the two classes, rather than any genuine generalizable ability to discriminate between them. We show that other evaluation metrics such as the Area Under the Curve (AUC) of the Receiver Operating Characteristic (ROC), and the less common Balanced Accuracy (BAcc) metric - defined as the arithmetic mean between sensitivity and specificity, provide more reliable performance evaluations for imbalanced data. Our findings also highlight the robustness of Random Forest (RF), and the benefits of using stratified cross-validation and hyperprameter optimization to tackle data imbalance. Critically, for neuroscience ML applications that seek to minimize overall classification error, we recommend the routine use of BAcc, which in the specific case of balanced data is equivalent to using standard Acc, and readily extends to multi-class settings. Importantly, we present a list of recommendations for dealing with imbalanced data, as well as open-source code to allow the neuroscience community to replicate and extend our observations and explore alternative approaches to coping with imbalanced data.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
Breiman, L. (2001) · Machine Learning · doi:10.1023/a:1010933404324 · Cited by 133,538
Scikit-learn: Machine Learning in Python
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Müller, A., Nothman, J., Louppe, G., et al. (2012) · arXiv · doi:10.48550/arxiv.1201.0490 · Cited by 71,016
Cortes, C., & Vapnik, V. (1995) · Machine Learning · doi:10.1007/bf00994018 · Cited by 59,421
Matplotlib: a 2D graphics environment
Hunter, J. D. (2007) · Computing in Science & Engineering · doi:10.1109/mcse.2007.55 · Cited by 39,249
SMOTE synthetic minority over-sampling technique
Chawla, N. V., Bowyer, K. W., Hall, L. O., & Kegelmeyer, W. P. (2002) · Journal of Artificial Intelligence Research · doi:10.1613/jair.953 · Cited by 32,865
Goldberger, A. L., Amaral, L. A. N., Glass, L., Hausdorff, J. M., Ivanov, P. C., Mark, R. G., Mietus, J. E., Moody, G. B., Peng, C.-K., & Stanley, H. E. (2000) · Circulation · doi:10.1161/01.cir.101.23.e215 · Cited by 14,809
He, H., & Garcia, E. A. (2009) · IEEE Transactions on Knowledge and Data Engineering · doi:10.1109/tkde.2008.239 · Cited by 10,359
Ensemble methods in machine learning
Dietterich, T. G. (2000) · Lecture Notes in Computer Science · doi:10.1007/3-540-45014-9_1 · Cited by 8,408
seaborn: statistical data visualization
Waskom, M. (2021) · Journal of Open Source Software · doi:10.21105/joss.03021 · Cited by 7,310
UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction
McInnes, L., Healy, J., & Melville, J. (2018) · arXiv · doi:10.48550/arxiv.1802.03426 · Cited by 7,101
Distributed and overlapping representations of faces and objects in ventral temporal cortex
Haxby, J. V., Gobbini, M. I., Furey, M. L., Ishai, A., Schouten, J. L., & Pietrini, P. (2001) · Science · doi:10.1126/science.1063736 · Cited by 3,940
MEG and EEG data analysis with MNE-Python
Gramfort, A. (2013) · Frontiers in Neuroscience · doi:10.3389/fnins.2013.00267 · Cited by 3,784
The class imbalance problem: A systematic study1
Japkowicz, N., & Stephen, S. (2002) · Intelligent Data Analysis · doi:10.3233/ida-2002-6504 · Cited by 3,295
On hyperparameter optimization of machine learning algorithms: Theory and practice
Yang, L., & Shami, A. (2020) · Neurocomputing · doi:10.1016/j.neucom.2020.07.061 · Cited by 3,232
Sagi, O., & Rokach, L. (2018) · WIREs Data Mining and Knowledge Discovery · doi:10.1002/widm.1249 · Cited by 3,103
A systematic study of the class imbalance problem in convolutional neural networks
Buda, M., Maki, A., & Mazurowski, M. A. (2018) · Neural Networks · doi:10.1016/j.neunet.2018.07.011 · Cited by 3,088
Survey on deep learning with class imbalance
Johnson, J. M., & Khoshgoftaar, T. M. (2019) · Journal of Big Data · doi:10.1186/s40537-019-0192-5 · Cited by 3,032
BCI2000: A General-Purpose Brain-Computer Interface (BCI) System
Schalk, G., McFarland, D. J., Hinterberger, T., Birbaumer, N., & Wolpaw, J. R. (2004) · IEEE Transactions on Biomedical Engineering · doi:10.1109/tbme.2004.827072 · Cited by 3,024
The Regression Analysis of Binary Sequences
Cox, D. R. (1958) · Journal of the Royal Statistical Society Series B: Statistical Methodology · doi:10.1111/j.2517-6161.1958.tb00292.x · Cited by 2,813
Exploratory Undersampling for Class-Imbalance Learning
Liu, X.-Y., Wu, J., & Zhou, Z.-H. (2009) · IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics) · doi:10.1109/tsmcb.2008.2007853 · Cited by 2,465
Learning from imbalanced data: open challenges and future directions
Krawczyk, B. (2016) · Progress in Artificial Intelligence · doi:10.1007/s13748-016-0094-0 · Cited by 2,459
Machine learning for neuroimaging with scikit-learn
Abraham, A., Pedregosa, F., Eickenberg, M., Gervais, P., Mueller, A., Kossaifi, J., Gramfort, A., Thirion, B., & Varoquaux, G. (2014) · Frontiers in Neuroinformatics · doi:10.3389/fninf.2014.00014 · Cited by 2,384
Learning from class-imbalanced data: Review of methods and applications
Haixiang, G., Yijing, L., Shang, J., Mingyun, G., Yuanyue, H., & Bing, G. (2017) · Expert Systems with Applications · doi:10.1016/j.eswa.2016.12.035 · Cited by 2,377
A Simple Generalisation of the Area Under the ROC Curve for Multiple Class Classification Problems
Hand, D. J., & Till, R. J. (2001) · Machine Learning · doi:10.1023/a:1010920819831 · Cited by 2,276
SMOTE for Learning from Imbalanced Data: Progress and Challenges, Marking the 15-year Anniversary
Fernandez, A., Garcia, S., Herrera, F., & Chawla, N. V. (2018) · Journal of Artificial Intelligence Research · doi:10.1613/jair.1.11192 · Cited by 2,219
Editorial: special issue on learning from imbalanced data sets
Chawla, N. V., Japkowicz, N., & Kotcz, A. (2004) · ACM SIGKDD Explorations Newsletter · doi:10.1145/1007730.1007733 · Cited by 2,063
The Balanced Accuracy and Its Posterior Distribution
Brodersen, K. H., Ong, C. S., Stephan, K. E., & Buhmann, J. M. (2010) · 2010 20th International Conference on Pattern Recognition · doi:10.1109/icpr.2010.764 · Cited by 1,816
CLASSIFICATION OF IMBALANCED DATA: A REVIEW
SUN, Y., WONG, A. K. C., & KAMEL, M. S. (2009) · International Journal of Pattern Recognition and Artificial Intelligence · doi:10.1142/s0218001409007326 · Cited by 1,692
Machine learning classifiers and fMRI: A tutorial overview
Pereira, F., Mitchell, T., & Botvinick, M. (2009) · NeuroImage · doi:10.1016/j.neuroimage.2008.11.007 · Cited by 1,624
Neuroscience-Inspired Artificial Intelligence
Hassabis, D., Kumaran, D., Summerfield, C., & Botvinick, M. (2017) · Neuron · doi:10.1016/j.neuron.2017.06.011 · Cited by 1,557
THE BERGER RHYTHM: POTENTIAL CHANGES FROM THE OCCIPITAL LOBES IN MAN
ADRIAN, E. D., & MATTHEWS, B. H. C. (1934) · Brain · doi:10.1093/brain/57.4.355 · Cited by 1,396
2010 20th International Conference on Pattern Recognition
(2010) · doi:10.1109/icpr16097.2010 · Cited by 1,171
Luque, A., Carrasco, A., Martín, A., & de las Heras, A. (2019) · Pattern Recognition · doi:10.1016/j.patcog.2019.02.023 · Cited by 1,128
EEG differences between eyes-closed and eyes-open resting conditions
Barry, R. J., Clarke, A. R., Johnstone, S. J., Magee, C. A., & Rushby, J. A. (2007) · Clinical Neurophysiology · doi:10.1016/j.clinph.2007.07.028 · Cited by 1,077
A deep learning framework for neuroscience
Richards, B. A., Lillicrap, T. P., Beaudoin, P., Bengio, Y., Bogacz, R., Christensen, A., Clopath, C., Costa, R. P., de Berker, A., Ganguli, S., et al. (2019) · Nature Neuroscience · doi:10.1038/s41593-019-0520-2 · Cited by 1,027
Simulation physiologischer Regelkreise mit der objektorientierten Modellbibliothek “HumanLib”
Brunberg, A., Spillner, J., Autschbach, R., & Abel, D. (2011) · auto · doi:10.1524/auto.2011.0951 · Cited by 1,008
Data imbalance in classification: Experimental evaluation
Thabtah, F., Hammoud, S., Kamalov, F., & Gonsalves, A. (2020) · Information Sciences · doi:10.1016/j.ins.2019.11.004 · Cited by 850
Facing Imbalanced Data--Recommendations for the Use of Performance Metrics
Jeni, L. A., Cohn, J. F., & De La Torre, F. (2013) · 2013 Humaine Association Conference on Affective Computing and Intelligent Interaction · doi:10.1109/acii.2013.47 · Cited by 790
Taylor, J. R., Williams, N., Cusack, R., Auer, T., Shafto, M. A., Dixon, M., Tyler, L. K., Cam-CAN, & Henson, R. N. (2017) · NeuroImage · doi:10.1016/j.neuroimage.2015.09.018 · Cited by 782
Grootswagers, T., Wardle, S. G., & Carlson, T. A. (2017) · Journal of Cognitive Neuroscience · doi:10.1162/jocn_a_01068 · Cited by 727
Da Corte, M., & Baptista, J. (2025) · OASIcs : OpenAccess Series in Informatics · doi:10.4230/oasics.slate.2025.1 · Cited by 722
Cam-CAN, Shafto, M. A., Tyler, L. K., Dixon, M., Taylor, J. R., Rowe, J. B., Cusack, R., Calder, A. J., Marslen-Wilson, W. D., Duncan, J., et al. (2014) · BMC Neurology · doi:10.1186/s12883-014-0204-1 · Cited by 707
Computational rationality: A converging paradigm for intelligence in brains, minds, and machines
Gershman, S. J., Horvitz, E. J., & Tenenbaum, J. B. (2015) · Science · doi:10.1126/science.aac6076 · Cited by 673
Introduction to machine learning for brain imaging
Lemm, S., Blankertz, B., Dickhaus, T., & Müller, K.-R. (2011) · NeuroImage · doi:10.1016/j.neuroimage.2010.11.004 · Cited by 630
Combrisson, E., & Jerbi, K. (2015) · Journal of Neuroscience Methods · doi:10.1016/j.jneumeth.2015.01.010 · Cited by 599
Self-citationApplications of machine learning to diagnosis and treatment of neurodegenerative diseases
Myszczynska, M. A., Ojamies, P. N., Lacoste, A. M. B., Neil, D., Saffari, A., Mead, R., Hautbergue, G. M., Holbrook, J. D., & Ferraiuolo, L. (2020) · Nature Reviews Neurology · doi:10.1038/s41582-020-0377-8 · Cited by 595
The 2007 International Joint Conference on Neural Networks
(2007) · 2007 International Joint Conference on Neural Networks · doi:10.1109/ijcnn.2007.4370894 · Cited by 575
Permutation Tests for Studying Classifier Performance
Ojala, M., & Garriga, G. C. (2009) · 2009 Ninth IEEE International Conference on Data Mining · doi:10.1109/icdm.2009.108 · Cited by 555
Hebart, M. N., Görgen, K., & Haynes, J.-D. (2015) · Frontiers in Neuroinformatics · doi:10.3389/fninf.2014.00088 · Cited by 437
Artificial Neural Networks for Neuroscientists: A Primer
Yang, G. R., & Wang, X.-J. (2020) · Neuron · doi:10.1016/j.neuron.2020.09.005 · Cited by 376
A review of automatic selection methods for machine learning algorithms and hyper-parameter values
Luo, G. (2016) · Network Modeling Analysis in Health Informatics and Bioinformatics · doi:10.1007/s13721-016-0125-6 · Cited by 357
Machine Learning for Neural Decoding
Glaser, J. I., Benjamin, A. S., Chowdhury, R. H., Perich, M. G., Miller, L. E., & Kording, K. P. (2020) · eneuro · doi:10.1523/eneuro.0506-19.2020 · Cited by 319
An improved algorithm for neural network classification of imbalanced training sets
Anand, R., Mehrotra, K. G., Mohan, C. K., & Ranka, S. (1993) · IEEE Transactions on Neural Networks · doi:10.1109/72.286891 · Cited by 262
Evaluating Machine Learning Models and Their Diagnostic Value
Varoquaux, G., & Colliot, O. (2023) · Neuromethods · doi:10.1007/978-1-0716-3195-9_20 · Cited by 242
(2000) · Lecture Notes in Computer Science · doi:10.1007/3-540-45014-9 · Cited by 236
Analysis of sampling techniques for imbalanced data: An n = 648 ADNI study
Dubey, R., Zhou, J., Wang, Y., Thompson, P. M., & Ye, J. (2014) · NeuroImage · doi:10.1016/j.neuroimage.2013.10.005 · Cited by 204
Class Weights Random Forest Algorithm for Processing Class Imbalanced Medical Data
Zhu, M., Xia, J., Jin, X., Yan, M., Cai, G., Yan, J., & Ning, G. (2018) · IEEE Access · doi:10.1109/access.2018.2789428 · Cited by 191
Class imbalance revisited: a new experimental setup to assess the performance of treatment methods
Prati, R. C., Batista, G. E. A. P. A., & Silva, D. F. (2015) · Knowledge and Information Systems · doi:10.1007/s10115-014-0794-3 · Cited by 181
From ERPs to MVPA Using the Amsterdam Decoding and Modeling Toolbox (ADAM)
Fahrenfort, J. J., van Driel, J., van Gaal, S., & Olivers, C. N. L. (2018) · Frontiers in Neuroscience · doi:10.3389/fnins.2018.00368 · Cited by 176
Hyperparameter optimization in learning systems
Andonie, R. (2019) · Journal of Membrane Computing · doi:10.1007/s41965-019-00023-0 · Cited by 175
The roles of supervised machine learning in systems neuroscience
Glaser, J. I., Benjamin, A. S., Farhoodi, R., & Kording, K. P. (2019) · Progress in Neurobiology · doi:10.1016/j.pneurobio.2019.01.008 · Cited by 174
A Novel Ensemble Method for Imbalanced Data Learning: Bagging of Extrapolation-SMOTE SVM
Wang, Q., Luo, Z., Huang, J., Feng, Y., & Liu, Z. (2017) · Computational Intelligence and Neuroscience · doi:10.1155/2017/1827016 · Cited by 174
Cross-validation Metrics for Evaluating Classification Performance on Imbalanced Data
Wardhani, N. W. S., Rochayani, M. Y., Iriany, A., Sulistyono, A. D., & Lestantyo, P. (2019) · 2019 International Conference on Computer, Control, Informatics and its Applications (IC3INA) · doi:10.1109/ic3ina48034.2019.8949568 · Cited by 166
I tried a bunch of things: The dangers of unexpected overfitting in classification of brain data
Hosseini, M., Powell, M., Collins, J., Callahan-Flintoft, C., Jones, W., Bowman, H., & Wyble, B. (2020) · Neuroscience & Biobehavioral Reviews · doi:10.1016/j.neubiorev.2020.09.036 · Cited by 165
Macpherson, T., Churchland, A., Sejnowski, T., DiCarlo, J., Kamitani, Y., Takahashi, H., & Hikida, T. (2021) · Neural Networks · doi:10.1016/j.neunet.2021.09.018 · Cited by 144
STATISTICAL PATTERN RECOGNITION
Fukunaga, K. (1993) · WORLD SCIENTIFIC eBooks · doi:10.1142/9789814343138_0002 · Cited by 136
Using human brain activity to guide machine learning
Fong, R., Scheirer, W. J., & Cox, D. (2018) · Scientific Reports · doi:10.1038/s41598-018-23618-6 · Cited by 127
Buchlak, Q. D., Esmaili, N., Leveque, J., Bennett, C. C., Farrokhi, F. R., & Piccardi, M. (2021) · Journal of Clinical Neuroscience · doi:10.1016/j.jocn.2021.04.043 · Cited by 123
Vluymans, S. (2018) · Studies in computational intelligence · doi:10.1007/978-3-030-04663-7_4 · Cited by 120
A Novel Performance Measure for Machine Learning Classification
Gong, M. (2021) · International Journal of Managing Information Technology · doi:10.5121/ijmit.2021.13101 · Cited by 90
Okuda, S., Miura, T., Inoue, Y., ADACHI, T., & Eiraku, M. (2018) · Scientific Reports · doi:10.1038/s41598-018-20678-6 · Cited by 77
Bode, S., Feuerriegel, D., Bennett, D., & Alday, P. M. (2018) · Neuroinformatics · doi:10.1007/s12021-018-9375-z · Cited by 74
Master Your Metrics with Calibration
Siblini, W., Fréry, J., He-Guelton, L., Oblé, F., & Wang, Y. (2020) · Lecture notes in computer science · doi:10.1007/978-3-030-44584-3_36 · Cited by 71
The Mutual Inspirations of Machine Learning and Neuroscience
Helmstaedter, M. N. (2015) · Neuron · doi:10.1016/j.neuron.2015.03.031 · Cited by 69
Methods to integrate multinormals and compute classification measuresPreprint
Das, A., & Geisler, W. S. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2012.14331 · Cited by 64
Gamma distribution-based sampling for imbalanced data
Kamalov, F., & Denisov, D. (2020) · Knowledge-Based Systems · doi:10.1016/j.knosys.2020.106368 · Cited by 60
Meaning and expected surfaces combine to guide attention during visual search in scenes
Peacock, C. E., Cronin, D. A., Hayes, T. R., & Henderson, J. M. (2021) · Journal of Vision · doi:10.1167/jov.21.11.1 · Cited by 56
Straube, S., & Krell, M. M. (2014) · Frontiers in Computational Neuroscience · doi:10.3389/fncom.2014.00043 · Cited by 56
Graa, O., & Rekik, I. (2019) · Journal of Neuroscience Methods · doi:10.1016/j.jneumeth.2019.108344 · Cited by 30
Modelling a stable classifier for handling large scale data with noise and imbalance
Akila, S., & Reddy, U. S. (2017) · International Conference on Computational Intelligence in Data Science (ICCIDS) · doi:10.1109/iccids.2017.8272643 · Cited by 30
Hahn, T., Marquand, A. F., Plichta, M. M., Ehlis, A., Schecklmann, M. W., Dresler, T., Jarczok, T. A., Eirich, E., Leonhard, C., Reif, A., et al. (2013) · Human Brain Mapping · doi:10.1002/hbm.21497 · Cited by 27
Data Imbalance in Autism Pre-Diagnosis Classification Systems: An Experimental Study
Abdelhamid, N., Padmavathy, A., Peebles, D., Thabtah, F., & Goulder-Horobin, D. (2020) · Journal of Information & Knowledge Management · doi:10.1142/s0219649220400146 · Cited by 22
Complementary Learning Fuzzy Neural Network: An Approach to Imbalanced Dataset
Tan, T. Z., Ng, G. S., & Quek, C. H. (2007) · IEEE International Conference on Neural Networks/IEEE ... International Conference on Neural Networks · doi:10.1109/ijcnn.2007.4371318 · Cited by 9
Imbalanced classification: an objective-oriented reviewPreprint
Yang, F., Zhou, M., & Tong, X. (2020) · arXiv (Cornell University) · Cited by 5
Neural decoding on imbalanced calcium imaging data with a network of support vector machines
Lee, K., Wu, X., Lee, Y., Lin, D., Bhattacharyya, S. S., & Chen, R. (2020) · Advanced Robotics · doi:10.1080/01691864.2020.1863259 · Cited by 5
Electroencephalography and Magnetoencephalography
Corsi, M. (2022) · HAL · doi:10.1007/978-1-0716-3195-9
Metadata
- Authors
- Thölke, P., Mantilla-Ramos, Y.-J., Abdelhedi, H., Maschke, C., Dehgan, A., Harel, Y., Kemtur, A., Mekki Berrada, L., Sahraoui, M., Young, T., Bellemare Pépin, A., El Khantour, C., Landry, M., Pascarella, A., Hadid, V., Combrisson, E., O’Byrne, J., & Jerbi, K.
- Venue
- NeuroImage
- Publisher
- Elsevier BV
- Published
- 2023-08
- Volume
- 277
- Pages
- 120253
- ISSN
- 1053-8119 (ISSN-L)
- OpenAlex
- W4382196087
- Cited by
- 227
- References
- 88
- FWCI
- 19.94
- Type
- journal article
- Language
- en
- Open access
- gold
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.