PHOTONAI
activeA high-level Python API for designing, optimizing, and evaluating machine learning pipelines — built for applied science, especially neuroimaging.
Machine learning in applied science often requires the same tedious work: assembling preprocessing steps, selecting algorithms, running nested cross-validation, and optimizing hyperparameters — all while avoiding data leakage and ensuring reproducible, unbiased performance estimates. PHOTONAI is built to handle that scaffolding so researchers can focus on the science.
What it does
PHOTONAI provides a declarative interface for building ML pipelines. You define a sequence of processing and learning elements, specify a hyperparameter search space, pick a cross-validation and optimization strategy, and PHOTONAI handles the rest — including parallelization, result logging, and export of trained models for external validation.
Key capabilities:
- Flexible pipelines — combine elements from scikit-learn, Keras, imbalanced-learn, or custom implementations in sequential or parallel streams
- Hyperparameter optimization — grid search, random search, and Bayesian optimization (scikit-optimize, SMAC3) with a unified interface
- Unbiased evaluation — nested cross-validation is first-class, not an afterthought
- PHOTONAI Explorer — a web app for visualizing training, optimization, and evaluation results
- Neuroimaging module — direct support for multimodal MRI data
- Graph module — extends the framework for graph-based ML on connectome data
Background
PHOTONAI grew out of a need within our lab to make rigorous, reproducible ML pipelines accessible to researchers without deep engineering backgrounds. It has been used across a range of neuroimaging studies and forms the backbone of several published analyses in our group.