Humans have 25 different taste receptors that register a range of bitter chemical compounds in everything from coffee and beer to dark chocolate and medicine. And yet, while humans can easily recognize bitterness, predicting whether a chemical compound will taste bitter is no simple task. Now, researchers have developed BitterPredict, a machine learning tool that predicts whether a chemical tastes bitter. The approach, described in Scientific Reports, could help food scientists and pharmaceutical developers pick up on the bitter drivers in their products.

Bitter compounds are incredibly diverse, notes chemosensory scientist and co-author Masha Niv of the Hebrew University of Jerusalem. They can be ions, peptides, glucosinolates, and more. So the researchers began by compiling a set of known non bitter compounds drawn from the scientific literature, as well as a set of known bitter ones drawn primarily from BitterDB, a database that Niv curates. They then used these compounds to build BitterPredict, which evaluates the relationship between bitterness and physical and chemical characters like molecular mass, bond number, and electric charge. And because bitterness is sometimes linked to poisons, BitterPredict also considers indicators of toxicity, such as possessing a similar structure to a molecule known to cross the blood-brain barrier. By associating particular combinations of characters with bitterness, the model can then predict whether a new compound is bitter.

The team tested the model using the sets of known bitter and non bitter chemicals and found that it could correctly classified a compound as bitter or not around 80 percent of the time. Compounds with positive charges were more likely to be bitter while water soluble ones were more likely not to be. But no single trait could predict bitterness alone. Indeed, the team’s approach is interesting because it shows how multiple chemical properties can combine to make a compound taste bitter, says chemist Matthew Hartings of American University.

Niv also used BitterPredict to explore a random set of around 30,000 molecules, as well as additional sets of molecules found in food, drugs, and natural products (primarily derived from plants). The tool predicted that around 40 percent of the random and food sets were bitter, as well as 66 percent of the drug and 77 percent of the natural product sets.

Niv doesn’t know why bitterness is so abundant in nature. But one possibility stems from an arms race between plants and herbivores. “The evolutionary idea is that plants evolved toxic compounds to not be eaten,” she explains. “Then we evolved the ability to identify toxic compounds by bitter taste receptors. Then maybe some of these compounds are no longer toxic because being bitter is enough to not be eaten.”

The ability to predict bitterness could be powerful. Pharmaceutical companies have already contacted Niv about her new tool. If a medication tastes bad, a patient might resist taking it. An HIV drug was recalled in Uganda, for example, because the pills were so bitter that many patients stopped treatment. Pharmaceutical companies would like to know early on if the drugs they’re developing are bitter pills to swallow. “In food, it’s also really important to understand which component is responsible for a bitter taste, especially in cases where you get bitterness that is undesirable in milk and soy products,” says Niv.

Hartings sees other applications. “These types of studies speak more broadly to questions about how our nervous system works, how we experience flavor, how our cells interact with the molecules that come in contact with them,” he says. “It’s a much more interesting question than ‘Is it bitter or not?’” Still, he’s excited about Niv’s next question: How bitter is it? Niv’s group is collecting more data so they can begin to predict the intensity of bitterness.

For researchers who want to test their own compounds, the team shares the BitterPredict code and they plan to make the tool available on a publicly accessible server in the near future.