This is a post on behalf of the students Grace, Omar, and Aidan who performed this work.
Over this summer, our team of three undergraduate students in Lehigh Mountaintop Research developed a new Bayesian Optimization (BO) module as part of the ongoing STEM Visualizations initiative. This project continues our mission to build interactive, research-inspired educational tools using Bokeh, enabling students to learn complex engineering and data-science concepts through direct experimentation and visualization.
This work extends the STEM Visualizations collection that our advisor has previously shared on the Bokeh Discourse ( here and here )
Unlike the earlier SEIR and Biodegradability Classification modules, which rely on manual one-variable-at-a-time (OVAT) experimentation, the Bayesian Optimization module introduces learners to intelligent, data-efficient search: a core idea in modern experimental design and machine learning.
Module Overview
The module centers on a simplified Photobioreactor (PBR) simulator, where the learner’s objective is to maximize Lutein concentration by tuning five continuous parameters:
-
Initial biomass concentration (Cxâ‚€)
-
Initial nitrate concentration (CNâ‚€)
-
Inlet flow rate (Fᵢₙ)
-
Inlet nitrate concentration (CNᵢₙ)
-
Incident light intensity (Iâ‚€)
The app guides users through an iterative optimization loop, showing how Bayesian Optimization alternates between exploration and exploitation:
-
Surrogate Modeling – The module employs Gaussian Processes implemented with scikit-optimize (skopt) to approximate the unknown objective function. The surrogate model produces both a mean prediction and an uncertainty estimate across the five-dimensional parameter space.
-
Acquisition Function – Users explore how strategies such as Expected Improvement (EI) or gp_hedge choose the next experiment by balancing predicted performance and model uncertainty.
-
Experimental Evaluation – The chosen parameters are evaluated by the PBR simulator (the “black-box” function), and the resulting Lutein output is fed back to update the Gaussian Process model for the next iteration.
Two Learning Modes
The Bayesian Optimization module provides two complementary modes designed for both education and research exploration:
1. Educative Module
In this guided mode, learners interact with the built-in Photobioreactor simulator to visualize how Bayesian Optimization efficiently discovers an optimum compared with random search. The interface displays evolving confidence surfaces and convergence progress in real time.
2. Research Application Module
This advanced mode allows users to define custom input parameters, search ranges, and objective functions, generalizing the tool beyond chemical-engineering contexts. It emphasizes the inner mechanics of BO: how surrogate models and acquisition functions interact dynamically across iterations.
Watch Full Demo below:

Learning Outcomes and Impact
Through these two modes, the module demonstrates how Bayesian Optimization drastically reduces the number of experimental trials required to find an optimum. In test cases, the optimizer consistently locates the global maximum in the 5D parameter space using far fewer evaluations than random or grid search: mirroring how modern engineering research accelerates discovery through data-driven methods.
Developed using Bokeh, scikit-optimize, and standard scientific Python libraries, this module represents the most advanced pedagogical tool in our STEM Visualizations series to date. Working largely independently, our team relied extensively on Bokeh’s documentation, prior project frameworks, and community resources to design an intuitive, interactive interface that bridges machine learning research and classroom learning.
Our team of undergraduates consists of:
Grace-lilie Acheampong (LinkedIn / Github)
Aidan Arnold (LinkedIn / Github)
And our mentors:
Srinivas Rangarajan (Website)
Raghuram Thiagarajan (LinkedIn / Github / @swamilikes2code )
Joseph Menicucci (Bio)
All of the STEM Visualizations modules can be found on our website.
We are looking to collect student feedback to further improve our module and showcase the usage of inquiry-based learning in engineering classrooms through a paper.