In August 2011, a can of Great Value peas joined the nonperishables in my pantry, one of several panic purchases as Hurricane Irene barreled toward my home on the northeast US coast. But the emergency passed, and the can, with its unassuming blue-on-white outline font, remains on my shelf seven years later.

Its continued presence raises a dilemma in the form of a clearly legible stamp: “BEST BY 12/31/14.” Should I toss it? Can canned peas go bad? How would I know if they had?

Such confusion, common in many a cupboard, drives an enormous amount of food waste: About 40 percent of food in the US gets trashed, often due to belief that a gone-by date on a package means the food is not safe.

That’s partly to do with those date stamps themselves. Foods prone to microbial growth, such as raw meat and cold cuts, get a “use by” date assertively worded to indicate that after it, they may be hazardous, and some of these are mandated by state laws (or Federal law, in the case of baby formula). But stamps on shelf-stable products — “best before,” “best if used by,” “enjoy by,” “expires on” — reflect peak quality, not safety. And often, both types of date stamps fail to reflect a product’s actual shelf life.

Many countries have simplified food packaging to carry a use-by date (for when a product might actually go bad) or a best-before date (reflecting when it might start to become less palatable). US manufacturing groups recently announced voluntary guidelines to adopt such nomenclature. But this may not help much to reduce food waste. “Even in Australia” — where the two-stamp system has been in place for years — “consumers don’t know the difference between ‘use by’ and ‘best before,’ ” says Tom Ross, a predictive food microbiologist at the University of Tasmania. “I had to figure it out after 20 years of being a professional food scientist.”

A better solution — and more effective waste reduction — could come from a flurry of progress in the science of determining and tracking shelf life, say Ross and other experts. Driven by advances in informatics, sensor technologies and chemical analysis, such improvements could lead to more accurate date stamps or one day even render them moot. “It’s a bit of a revolution,” says Ross. “Miniaturization, automation, rapid diagnostics — it’s all coming to the fore.”

Bad food basics

Food can go bad in various ways, says Tiny van Boekel, a food technologist at Wageningen University in the Netherlands. Most obvious is microbial spoilage — the growth of bacteria, viruses or mold. Many of these smell awful but aren’t pathogenic; a swig of spoiled milk may make you want to throw up, but if it’s pasteurized it won’t make you ill. Other contaminations are truly dangerous: bacteria such as salmonella, listeria or certain strains of E. coli, for example — the stuff that “use by” dates were made for.

There’s biochemical spoilage, such as enzymatic degradation of pectins and starches as fruit ripens past the point of tastiness. Then there’s chemical spoilage: processes such as lipid oxidation or the so-called Maillard reaction that cause taste changes or browning in food.

In the past, scientists determined the risk of microbial growth experimentally. “The traditional approach would have been to make the food, stick it somewhere and watch what happens to it over time,” says Ross. But microbes grow predictably under known conditions — salt levels, humidity, acidity and, especially, temperature — and so over the past two or three decades researchers have amassed enormous amounts of data that food manufacturers can draw on to estimate shelf lives. They can then do trials to check that the predictions hold up.

For many shelf-stable foods — say, cookies or protein bars — changes in taste, smell or texture are the first signs of spoilage, says Maria Corradini, a food scientist at the University of Guelph in Canada. Scientists are faced with the tough task of pinning down the responsible sensory attributes. This involves corralling human guinea pigs for a food test, then finding a molecular correlate to whatever quality the testers identify as unpleasant — and tracking its change over time. Manufacturers then use mathematical modeling to calculate when a product will have deteriorated to the point where a target percentage of consumers won’t like it anymore.

In some cases, scientists also determine how quickly key attributes in a product deteriorate. “If you have a powdered drink that is supposed to deliver a certain amount of vitamin, the degradation of that vitamin determines shelf life,” says Corradini. Researchers have gotten dramatically better at determining such decay, thanks to better and more complex mathematical modeling and to improved analytical chemistry techniques such as spectroscopy and near-infrared radiation that can capture the kinetics of those reactions more quickly and easily.

Trouble in transit

Unfortunately, predicting shelf life then starting the clock won’t result in ironclad “use by” and “best by” dates. That’s because a static date, stamped when a food is first packaged, doesn’t capture what happens on the way to the store and after purchase. Temperature mishandling is especially rampant, whether due to disrupted refrigeration in the shipping container, a nighttime power failure at the grocery store or a consumer who doesn’t immediately put groceries away. “One hour of milk sitting out on the counter in summer, when the temperature is about 85 degrees [Fahrenheit], is equivalent to three days in the refrigerator,” says Theodore Labuza, a food scientist at the University of Minnesota.

Some food producers have tried to address this issue, particularly for perishables, by using detection labels called time temperature integrators that change color when the package experiences a temperature spike. These indicators have been around since the 1970s, but early versions could only reveal that the temperature had changed — not for how long, or by how much. The industry has now begun to embrace a new generation of temperature detectors that can reveal a product’s temperature history in more detail.

CREDIT: COURTESY OF VITSAB INTERNATIONAL AB

Other strategies for detecting molecular compounds that foods release as they deteriorate offer a more robust, chemistry-based solution. Many are in development. Corradini, for example, is using a method called luminescence spectroscopy to measure the so-called spectral fingerprint — patterns of light emitted across different wavelengths — of spinach, kale and other vegetables. Chlorophyll and other substances in these greens naturally emit fluorescence, and her group is trying to correlate the amount of detected fluorescence to the food’s freshness. “They are kind of internal reporters to what happens in the food,” Corradini says of the spectral patterns.

In principle, these technologies are advanced enough that for some foods, at least, a handheld device or mobile phone app could produce a readout on freshness almost instantly, with an accuracy well beyond what a static date stamp could provide. As sensors detecting specific molecules come online, companies could use them to ship produce at just the right stage of ripeness to arrive at its best at the supermarket, or to determine when, and how far, food can be shipped to maximize shelf time.

Of course, molecular detection of this kind is only as good as the underlying experimental data and mathematical modeling that allow food scientists to predict how environmental conditions such as heat or moisture affect specific markers. But that’s improving too. Companies are also beginning to use an encrypted and decentralized ledger of continuously updated information — known as blockchain technology — to follow a food’s journey through the world, in real time.

As the industry refines this compendium of tools over the next several years, they may replace date stamps entirely, or supplement them in some “smart” way. You can bet, though, that my can of peas is staying in the cupboard until whenever I need it. Unless it’s corroded or swollen — a sign of potentially fatal contamination with the microbe Clostridium botulinum — its contents are most likely fine, says Ross. And if in doubt, there’s a low-tech remedy: Boil thoroughly before eating.