For a baseball team, choosing the right batting lineup can mean the difference between winning and losing. But determining the best sequence of hitters is complicated, since each individual player’s strengths and weaknesses affect the overall performance of the lineup in ways that can be hard to predict.
Enter the Lineup Optimizer, an online tool that uses advanced math and slick software design to help teams squeeze the most runs possible out of their lineups.
The Lineup Optimizer was originally developed by students Benjamin Buman, Engr ’27, Kiran Shay, Engr ’27, and Jake Rasmussen, Engr ’25, under the mentorship of Anton Dahbura, Engr ’81, ’82 (MSE), ’84 (PhD), founder and director of the Sports Analytics Research Group, or SARG, at the Whiting School.

While the interface is so simple that anyone can use it, the Lineup Optimizer employs combinatorial mathematics to determine the optimal order of a sequence of hitters, modeling the effect that each player’s individual stats have on the group’s collective performance across hundreds of thousands of permutations.
It has already yielded insights that could help teams at all levels, from high school to the major leagues, boost their performance. For instance, while conventional wisdom places faster players first, the Lineup Optimizer suggests that leading with a slugger could generate more runs.
Like the dozens of other student-led projects that have run under the SARG banner since Dahbura established the program in 2014, the students’ tool illustrates how quantitative analysis can help teams make better decisions.
“There’s a transformation process from data to information to knowledge to wisdom,” says Dahbura—a process that can inform and guide virtually all aspects of a sports operation, from the choices that players and coaches make on the field to the ones that executives make in the front office.
As a result, many professional sports teams now have analytics departments that drive improvements in everything from training programs to fan engagement. By combining real-world problems with advanced research methods, SARG aims to mirror the way those departments work while pushing the boundaries of what sports analytics can achieve.
Living the Dream
The roots of modern sports analytics can be traced to Earnshaw Cook, a professor of mechanical engineering at Johns Hopkins who in 1964 published Percentage Baseball, one of the earliest attempts to subject sports data to rigorous mathematical analysis.
At the time, Cook’s approach didn’t win many fans in the professional sports community, which preferred gut feelings to math. But that didn’t stop Dahbura from following in Cook’s scientific footsteps more than a decade later.
Born in Maryland and raised in El Salvador, Dahbura is a lifelong baseball fanatic: He co-founded his high school team; provided Spanish play-by-play commentary for major league radio and television broadcasts while still in his teens; and both coached and played for the Johns Hopkins Blue Jays baseball team. The first computer program he wrote as an undergraduate was a baseball game simulator.
After earning his PhD in electrical engineering at the Whiting School, Dahbura went on to a successful career in industry before returning to Johns Hopkins in 2012 as executive director of the JHU Information Security Institute. But his passion for the national pastime never wavered.

“I’m always thinking about baseball,” he says. In the mid-’90s, Dahbura had begun experimenting with using computer-based techniques to design baseball season schedules—an intricate exercise in combinatorial mathematics that requires balancing the needs and wants of multiple teams in a fair and efficient manner.
Shortly after returning to Johns Hopkins, he gave a seminar on the topic in the Department of Applied Mathematics and Statistics that attracted the attention of Associate Research Professor Donniell Fishkind, Engr ’95 (MSE), ’98 (PhD). The two began recruiting students to apply advanced optimization techniques to baseball scheduling—a project that became known as the Baseball Scheduling Optimization group. (The former now functions as a sister group to SARG.)
Within a few years, the group was using a supercomputer to produce fully optimized schedules for most of the minor leagues, sometimes in a matter of minutes. (For even the most expert human being, the task can take weeks.) After Major League Baseball took over minor league scheduling in 2020, the group began scheduling independent leagues, and it recently began scheduling the country’s top junior hockey league.
Fishkind, who uses his optimization classes as a pipeline for the group, says the opportunity to put students to work on a challenging sports problem was priceless.
“From a pedagogical standpoint, this was living the dream: The students got training in the classroom that had an immediate and sexy application,” he says.
Building an AI Ecosystem
By 2014, Dahbura had begun assigning other kinds of sports-related problems to students and was enjoining other faculty to serve as program mentors. He also began cultivating relationships with professional sports organizations, including the Baltimore Orioles, which has sponsored a variety of SARG projects—including an automated bat measurement system that streamlines the process of tailoring bat sizes more effectively to individual players’ needs while ensuring they remain in compliance with league regulations.
Traditionally, team equipment managers have used calipers and other hand tools to measure bat dimensions—a potentially error-prone process that can take up to an hour per bat. The computer vision system that Kevin Wu, Engr ’26 (BS, MSE), and Jason Sun, Engr ’26 (MSE), devised for the Orioles can do it in seconds, and with 99.8% accuracy. The Orioles subsequently set up a dedicated room to deploy the bat measurement system.
“The Hopkins students are amazing,” says Sig Mejdal, a former NASA engineer who oversees the Orioles’ analytics department. Mejdal keeps a running list of potential SARG projects that could benefit the Orioles while giving students experience in the field. “With the Hopkins group, the Orioles have quite a few very skilled analysts right in their backyard,” he says. “Giving them interesting projects is a no-brainer.”
Today, more than 50 students are engaged in over 20 projects that cover activities ranging from football, soccer, and golf to eSports, marathon running, and Formula One racing. Students do co-ops with teams such as the Orioles and the Ravens, and many go on to professional careers in sports analytics and related fields. When he isn’t helping out part time as SARG’s research program coordinator, for example, Tad Berkery, Engr ’24 (BS, MSE), is a full-time analyst for the Washington Nationals. Other alumni have worked as analysts for the Miami Dolphins, the Cleveland Guardians, and the San Diego Padres.

“With the Hopkins group, the Orioles have quite a few very skilled analysts right in their backyard.”
— Sig Mejdal
Most recently, the group has plunged into AI. Sun, for example, is currently leading 11 students in an effort to develop a sports AI ecosystem that will make it easier for teams, researchers, and even fans to develop and use AI tools.
The students are split into two groups. One is focused on creating AI agents that can perform complex tasks like helping a trainer customize a recovery plan for an injured player. The other is building a platform that developers could use to construct their own bespoke agents. The goal is to make the entire ecosystem publicly available, providing both a development platform and a library of AI agents that anyone can access.
“Currently, building a sports AI tool or agent from scratch takes months. We hope that with our ecosystem, it will only take hours,” says Sun, who believes that will “change what is possible” for sports analytics.
And that, after all, is what SARG is all about.
