): Deep brain stimulation (DBS) of the anterior nucleus of the thalamus (ANT) is clinically approved for treatment of epilepsy resulting in an average decrease in seizure frequency of 40%, but few patients achieve seizure freedom. Implantable neural stimulators have many parameters, such as stimulation amplitude, frequency and pulse width, which could potentially be tuned to improve efficacy. However, there is no systematic process to guide epileptologists through optimization. Stimulation of ANT in animal models has shown almost immediate changes in excitability in the loop of Papez, which we hypothesize is a biomarker that could be used to optimize stimulation parameters. Medtronic’s DBS Percept system allows for recording during stimulation and streaming the data to a computer for further analysis, which can be used in an optimization loop. Bayesian optimization (BayesOpt) is a machine learning algorithm that is widely used for efficient optimization over a bounded parameter range when acquiring data is expensive and computational time is relatively cheap. We have used BayesOpt for optimizing stimulation settings in animal models and clinical trials. Here we propose to develop an optimization platform where stimulation settings are programmed by a physician using recommended settings from a BayesOpt algorithm to minimize power measured from the patient’s thalamus in the clinic using Percept. Three aims are proposed to develop, test, and validate this approach in an exploratory clinical trial. Aim 1: Develop and test BayesOpt clinical interface with hardware in the loop system. Aim 2: Apply BayesOpt to 20 epilepsy patients treated with the Percept system in a clinical setting to optimize stimulation settings to minimize thalamic activity. Aim 3: Validate optimized settings at home by programming patients with optimized setting and their physician selected setting to test if seizure frequency or power spectral density is significantly lower in the optimized setting. The outcome of this clinical trial will be to establish safety and feasibility of optimization and validation. If successful, this study will be used to power a phase II efficacy trial. The broader impact of this work is that this platform could be used to tune the Percept system, based on different biomarkers, in other diseases, such as Parkinson’s disease, pain, and depression.