[Paper Review] Julearn: an easy-to-use library for leakage-free evaluation and inspection of ML models
Julearn is an open-source Python library that simplifies machine learning pipeline development for researchers by enforcing leakage-free evaluation through nested cross-validation and confound regression. It enables non-experts to build, validate, and inspect generalizable models with minimal risk of overfitting or data leakage, as demonstrated through three neuroscience-based case studies using real neuroimaging data.
The fast-paced development of machine learning (ML) methods coupled with its increasing adoption in research poses challenges for researchers without extensive training in ML. In neuroscience, for example, ML can help understand brain-behavior relationships, diagnose diseases, and develop biomarkers using various data sources like magnetic resonance imaging and electroencephalography. The primary objective of ML is to build models that can make accurate predictions on unseen data. Researchers aim to prove the existence of such generalizable models by evaluating performance using techniques such as cross-validation (CV), which uses systematic subsampling to estimate the generalization performance. Choosing a CV scheme and evaluating an ML pipeline can be challenging and, if used improperly, can lead to overestimated results and incorrect interpretations. We created julearn, an open-source Python library, that allow researchers to design and evaluate complex ML pipelines without encountering in common pitfalls. In this manuscript, we present the rationale behind julearn's design, its core features, and showcase three examples of previously-published research projects that can be easily implemented using this novel library. Julearn aims to simplify the entry into the ML world by providing an easy-to-use environment with built in guards against some of the most common ML pitfalls. With its design, unique features and simple interface, it poses as a useful Python-based library for research projects.
Motivation & Objective
- To address the challenge of improper machine learning evaluation in neuroscience research, where data leakage and flawed cross-validation can lead to overestimated model performance.
- To provide a user-friendly, accessible tool for domain experts without extensive ML training to design and validate machine learning pipelines.
- To embed safeguards—such as nested cross-validation and confound regression—directly into the library to prevent common pitfalls in model evaluation.
- To enable researchers to build and inspect generalizable models using real-world neuroimaging datasets like ADNI, HCP-YA, and IXI.
- To offer a lightweight, transparent alternative to AutoML tools, prioritizing interpretability and control over automated hyperparameter tuning.
Proposed method
- The library implements a scikit-learn-compatible estimator interface, allowing seamless integration with existing ML workflows.
- It enforces nested cross-validation by default, separating the hyperparameter search from the final performance evaluation to prevent data leakage.
- It includes built-in confound regression modules to remove spurious correlations from predictors, especially critical in neuroimaging data.
- The library supports a wide range of ML models, including SVM, Random Forest, GPR, and XGBoost, with consistent evaluation interfaces.
- It provides a simple, high-level API for defining pipelines with preprocessing, feature selection, and model training in a single chain.
- The design emphasizes transparency and interpretability, avoiding black-box automation in favor of user control and auditability.

Experimental results
Research questions
- RQ1Can a user-friendly ML library reduce the risk of data leakage and overfitting in neuroscience research without requiring deep ML expertise?
- RQ2How effectively can julearn replicate and streamline complex, publication-quality ML pipelines from prior neuroscience studies?
- RQ3To what extent does nested cross-validation in julearn improve the reliability of generalization performance estimates compared to standard CV practices?
- RQ4Can julearn support confound regression in neuroimaging data while maintaining model interpretability and performance?
- RQ5How does julearn compare to existing AutoML and domain-specific ML libraries in terms of usability, control, and safety in biomedical research?
Key findings
- Julearn successfully replicates three previously published neuroscience studies using real datasets (ADNI, HCP-YA, IXI), demonstrating its ability to reproduce published results with minimal code.
- The library's default use of nested cross-validation significantly reduces the risk of optimistic performance estimates compared to standard cross-validation practices.
- Confounding variables such as global signal and head motion were effectively removed using julearn’s built-in confound regression module, improving model robustness.
- The library enables researchers to build and evaluate complex ML pipelines with a single, intuitive API, reducing the likelihood of implementation errors.
- Julearn’s design allows for full transparency and auditability, making it suitable for reproducible and publication-ready research in neuroscience.
- The library has been adopted by early users in neuroscience and neuroimaging communities, validating its usability and practical value in real research workflows.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.