BUDAPEST: A Fast and Reliable Bayesian Algorithm for TMS Threshold Estimation with an Open-Source GUI and Human Validation

This study introduces and validates BUDAPEST, a novel Bayesian adaptive algorithm with an open-source GUI that enables rapid, reliable, and user-controlled motor threshold estimation for transcranial magnetic stimulation using significantly fewer pulses than conventional methods.

Bhutto, D. F., Kim, E., Pajankar, N., Vahedifard, F., Daneshzand, M., Edwards, D., Nummenmaa, A.

Published 2026-03-04
📖 5 min read🧠 Deep dive
⚕️

This is an AI-generated explanation of a preprint that has not been peer-reviewed. It is not medical advice. Do not make health decisions based on this content. Read full disclaimer

The Big Picture: Finding the "Goldilocks" Volume

Imagine you are trying to find the perfect volume setting on a radio. If the volume is too low, you can't hear the music (no muscle response). If it's too high, it's blasting and uncomfortable (too much stimulation). You need to find that "just right" spot, known in the medical world as the Motor Threshold (MT).

For doctors using Transcranial Magnetic Stimulation (TMS)—a technique that uses magnetic pulses to wake up parts of the brain—knowing this exact "volume" is crucial. It ensures the treatment works without hurting the patient.

The Problem: The Old Way is Slow and Clunky

Traditionally, finding this threshold was like playing a very slow, tedious game of "Hot and Cold."

  • The Old Method (5-out-of-10): A doctor would zap the brain, check if the muscle twitched, then zap it again. They had to do this 50 to 75 times just to get a rough idea. It took a long time, was boring for the patient, and sometimes the doctor would get confused by the results, leading to a wrong guess.
  • The "PEST" Method: Scientists tried to make this faster using a computer algorithm called PEST. It was quicker, but it was a bit "dumb." If it got a lucky early twitch, it might get overconfident and guess the volume was too low, then keep guessing low even when the patient stopped twitching. It was like a GPS that gets stuck in a traffic jam and refuses to reroute.

The Solution: Introducing BUDAPEST

The authors of this paper created a new, smarter algorithm called BUDAPEST (Bayesian Uncertainty Dynamic Algorithm for Parameter Estimation by Sequential Testing).

Think of BUDAPEST as a smart, cautious detective instead of a guessing game.

1. How it Works: The "Fuzzy Map" Analogy

Imagine the doctor doesn't know the exact volume. Instead of guessing a single number, BUDAPEST draws a fuzzy map of possibilities.

  • Start: The map is wide and blurry. "The volume could be anywhere between 30% and 70%."
  • The Test: The machine gives a small zap.
  • The Update:
    • If the muscle twitches, the detective says, "Okay, it's definitely not below 40%." The blurry map shrinks and shifts up.
    • If the muscle stays still, the detective says, "Okay, it's probably not above 60%." The map shrinks and shifts down.
  • The Magic: With every single zap, the map gets sharper and more focused. BUDAPEST doesn't just guess; it calculates the probability of the answer. It knows exactly how sure it is.

2. The "Stop Button" Control

The best part is that the human doctor gets to decide when to stop.

  • High Precision Mode: "I need to be 99% sure." The algorithm keeps zapping until the map is razor-sharp.
  • Speed Mode: "I just need a good estimate quickly." The algorithm stops as soon as the map is "good enough."
  • The Result: It usually finds the answer in about 10 zaps (down from 50–75), and it rarely makes the "stuck in traffic" mistakes that the old methods did.

The Experiment: Did it Work?

The researchers tested this in two ways:

  1. Virtual Simulations: They created 10,000 fake patients on a computer. BUDAPEST was incredibly accurate, finding the right "volume" with very little error, even when they started with a completely wrong guess.
  2. Real Humans: They tested it on real people.
    • Resting vs. Active: They tested when the hand was relaxed (Resting) and when the person was squeezing a coin (Active).
    • Reliability: They came back the next day to test again. The "Resting" results were very consistent (like a reliable clock). The "Active" results varied a bit more (because squeezing a coin is harder to do exactly the same way twice), but the algorithm handled it perfectly.

The Toolkit: A User-Friendly Dashboard

The researchers didn't just write code; they built a Graphical User Interface (GUI).

  • Imagine a dashboard on a car. As the algorithm runs, you see a graph on the screen. You can watch the "fuzzy map" shrink in real-time.
  • It tells the doctor exactly when the machine is confident enough to stop.
  • It even talks to the TMS machine automatically, so the doctor doesn't have to manually press buttons for every zap.

Why This Matters

  • For Patients: The procedure is much shorter (saving time and reducing discomfort).
  • For Doctors: It removes the guesswork and human error. It's like having a co-pilot that never gets tired or confused.
  • For Science: It allows for "Motor Mapping" (drawing a map of the whole brain's motor area) to happen quickly. Instead of taking an hour to map one spot, they can map a whole grid of spots in minutes.

The Bottom Line

BUDAPEST is a smarter, faster, and more reliable way to find the perfect brain stimulation dose. It turns a tedious, error-prone guessing game into a precise, data-driven process, making TMS treatments safer and more accessible for everyone.

Get papers like this in your inbox

Personalized daily or weekly digests matching your interests. Gists or technical summaries, in your language.

Try Digest →