bioRxiv · 10.64898/2026.08.08.743648
Reinforcement Learning via Brain Feedback for real-time fMRI-based adaptive stimulus generation
Abstract
Traditional fMRI studies rely on predefined task paradigms, where fixed stimulus designs limit the flexibility with which brain-stimulus relationships can be explored. Here, we introduce Reinforcement Learning via Brain Feedback (RLBF), a framework and open-source software package for adaptive stimulus optimization using real-time fMRI. RLBF reverses the conventional direction of inference by using neural responses to guide the exploration of stimulus spaces through reinforcement learning, enabling optimization of predefined brain targets such as regional activity or multivariate neural signatures. The accompanying Python-based software provides a modular framework integrating real-time fMRI data processing, reinforcement learning agents, adaptive stimulus generation, simulation-based testing, and experiment monitoring. Its flexible architecture allows researchers to customize preprocessing pipelines, reward functions, stimulus spaces, and RL strategies for diverse closed-loop neuroimaging applications. We validate the framework in a proof-of-concept study (N=10), demonstrating real-time optimization of a simple visual stimulus space by adapting checkerboard contrast and frequency to maximize primary visual cortex (V1) responses within a single 10-minute fMRI session. RLBF provides an extensible foundation for brain-guided stimulus optimization and enables new approaches for investigating neural specificity, individualized brain-stimulus relationships, and adaptive experimental design.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Gallitto, G., Englert, R., Kincses, B., Kotikalapudi, R., Li, J., Hoffschlag, K., Ali, S., Bingel, U., Spisak, T.. 2026-08-17. Reinforcement Learning via Brain Feedback for real-time fMRI-based adaptive stimulus generation. https://doi.org/10.64898/2026.08.08.743648
Cite the original work for its findings. Save a collection to share your selection of sources.