Machine learning to improve physical fitness

By Andrew Vallejo

Berkeley Master of Engineering
5 min readMar 25, 2020


Screenshots of the CAL Fit app.
Screenshots of the CAL Fit app.

A crucial tool for improving your workout routine could be machine learning, or the collection of data from various sources in order to make accurate predictions and better our understanding of the world around us.

A team of professors and graduate students from UC Berkeley and UCSF is developing CAL Fit, a physical fitness phone app that uses machine learning to give the user personalized goals.

Man with grey hair in a grey suit.
Professor Anil Aswani.

“The app we have learns by comparing the goals the user is given to the response the user makes to these goals and then optimizes the goals based on this relationship,” said Professor Anil Aswani, an assistant professor in Industrial Engineering and Operations Research (IEOR) at UC Berkeley and one of the lead members of this team.

In other words, if the user fails to meet a goal on a given day, CAL Fit will give the user an easier goal the following day. If the user succeeds, the app will make the next goal more challenging. This approach gives the user reachable and encouraging goals, while still challenging the user to improve their fitness.

“There is an understanding from behavioral psychology that if people meet goals today, it will boost their self-efficacy and confidence, and they will be able to meet a more challenging goal the next day,” Aswani added.

Most fitness apps on the market today give the user constant goals of eight or ten thousand steps per day and do not adjust to the person’s ability to keep up with the goals. An inactive person may find these goals unreasonably difficult, become discouraged, and stop using the app altogether. Likewise, these goals may be too easy for an athletic person who is used to walking or running many miles a day.

In contrast, CAL Fit may give a person a lower goal one day that they successfully meet to increase their confidence so that they continue to use the app and meet more challenging goals in the future.

Woman wearing black exercise clothing with her hands on her knees.
The ultimate goal is to maximize fitness for all people.

Aswani’s app records not only the user’s ability to keep up with the goals, but also the intensity of physical activity, the time it occurred, the user’s weight, and even attendance at counseling sessions on how to improve diet or increase physical activity.

Some people may have a higher “upper bar” for how much physical activity they can do, based on factors such as age, health, and motivation. The team also targets challenges that specific groups face on a daily basis that may affect their health, such as pregnant women or ethnic minorities. Aswani’s app takes these differences into account and adjusts the goals accordingly, with the ultimate aim of maximizing fitness for all people.

The team has conducted two studies to determine the effectiveness of their adaptive goals versus constant goals. In a small study of approximately 15 UC Berkeley students, the team randomly split the students into two groups. The team gave one group a version of the app with constant goals of 10 thousand steps a day. The other group received a version of the app with adaptive, personalized goals. After 10 weeks, the students with the personalized goals walked on average about 2000 more steps per day, which corresponds to approximately one more mile per day. A larger study of 64 UC Berkeley staff members produced similar results; people with the adaptive goals walked around 1000 steps, or a half-mile, more per day. The team is currently working on a larger clinical trial that will include a diverse group of hundreds of people in order to gain more conclusive results about the usefulness of CAL Fit.

These promising results have great implications according to Aswani: “If you can get very mild improvements in physical activity and weight loss — for instance 5 percent body weight loss for someone who is overweight — this greatly reduces their risk of developing diabetes.”

Man running outside.
Those with personalized goals walked on average 1000–2000 more steps per day.

Currently, Aswani’s team is expanding CAL Fit to include blood pressure data. They are focusing on the differences and commonalities between groups at risk for pre-diabetes, high blood pressure, and other cardiovascular diseases.

In addition to blood pressure, the team plans to incorporate cognitive data in order to target people at risk for Alzheimer’s disease. Aswani’s hope stems from the fact that “There are some hypotheses that physical activity and cognitive decline, in particular Alzheimer’s, may have some relationships.” Alzheimer’s disease affects more than 3 million people per year. Even small improvements to cognitive health on a national level could have a crucial impact on American society.

Aswani predicts that the methodology used to design CAL Fit could also be applied to help people budget for food and make more healthy dietary decisions. Factors such as time and money may have a large impact on healthy meals. However, these new expansions will be challenging and may come with some limitations. “There are some problems that we just can’t solve with apps,” said Aswani.

Ultimately, Anil Aswani and his team have shown that simple phone apps have the potential to transform the health industry. By improving the health of the country as a whole, healthcare costs and burdens on society will be reduced.

“As a nation, we are facing unprecedented pressures on the health of the population and the cost of healthcare,” said Aswani. “If we can build tools that can help people be healthier and reduce some of these healthcare spending pressures, there is a real chance to help a lot of people.”

“There is a real chance to help a lot of people.” — Anil Aswani

The work that engineers do shapes the world around us. But given the technical nature of that work, non-engineers may not always realize the impact and reach of engineering research. In E185: The Art of STEM Communication, students learn about and practice written and verbal communication skills that can bring the world of engineering to a broader audience. They spend the semester researching projects within the College of Engineering, interviewing professors and graduate students, and ultimately writing about and presenting that work for a general audience. This piece is one of the outcomes of the Fall 2019 E185 course.



Berkeley Master of Engineering

Master of Engineering at UC Berkeley with a focus on leadership. Learn more about the program through our publication.