Skip to main content

Perishability GFM

The Perishability Gap Filling Module determines the perishability classification of food products and identifies combined products (convenience products versus mono products). This classification is essential for downstream modules that calculate storage requirements, transport conditions, and food loss factors.

Quick Reference

PropertyDescription
Runs onRoot node of calculation (recipe level)
DependenciesAddClientNodesGFM, MatchProductNameGFM, IngredientSplitterGFM, NutrientSubdivisionGFM, LinkTermToActivityNodeGFM, AttachFoodTagsGFM, OriginGFM
Key InputFood product glossary tags, ingredient hierarchy
OutputPerishability classification tag, combined/mono product tag
TriggerRuns on every calculation at the root node level

When It Runs

The module triggers when:

  1. Processing reaches the root node of a calculation
  2. All dependency modules have completed their processing
  3. Food products in the graph need perishability classification

Key Output

The module adds two types of glossary tags to food product nodes:

  • Perishability Tag: One of three levels (shelf-stable, perishable, highly perishable)
  • Product Type Tag: Either combined product or mono product classification

Scientific Methodology

Perishability Classification

Food products are classified into three perishability levels based on their shelf life and storage requirements:

LevelTerm External IDDescriptionTypical Products
Shelf-StableEOS_STABLEProducts that can be stored at room temperature for extended periodsDried goods, canned products, grains, oils
PerishableEOS_PERISHABLEProducts requiring controlled storage with moderate shelf lifeDairy, eggs, processed meats
Highly PerishableEOS_HIGH-PERISHABLEProducts requiring immediate refrigeration with short shelf lifeFresh meat, seafood, cut produce

Propagation Rules

The perishability classification follows a bottom-up propagation model through the ingredient hierarchy:

Product Perishability = max(Ingredient Perishabilities)

Propagation Logic:

  1. Leaf ingredients receive perishability from their glossary term definitions
  2. Combined products inherit the highest perishability from their sub-ingredients
  3. Products without explicit perishability default to shelf-stable

Example: A salad bowl containing:

  • Lettuce (highly perishable)
  • Cheese (perishable)
  • Croutons (shelf-stable)

Result: The salad bowl is classified as highly perishable.

Combined Product Classification

The module also determines whether a product is a combined product (convenience product) or a mono product (single ingredient):

ClassificationTerm External IDCriteria
Combined ProductEOS_COMBINED_PRODUCTProduct combines multiple different food product ingredients
Mono ProductEOS_MONO_PRODUCTProduct is a single ingredient or does not combine multiple products

Combined Product Logic:

  • A product is marked as combined if it directly combines multiple food product ingredients
  • The combined product tag propagates upward through the hierarchy
  • Once any sub-ingredient is marked as a combined product, parent products also receive the combined product tag

Implementation Details

Algorithm Overview

The module uses a depth-first traversal with post-order processing to propagate perishability from leaf nodes to the root:

# Pseudocode for perishability propagation
def propagate_perishability(node):
if node has explicit perishability tag:
return node.perishability

sub_perishabilities = []
for sub_node in node.sub_nodes:
sub_perishabilities.append(propagate_perishability(sub_node))

if sub_perishabilities:
return max(sub_perishabilities, key=perishability_order)
else:
return SHELF_STABLE # Default

Perishability Order

Perishability levels are ordered from lowest to highest:

perishability_order = {
"EOS_STABLE": 0, # Lowest perishability
"EOS_PERISHABLE": 1, # Medium perishability
"EOS_HIGH-PERISHABLE": 2 # Highest perishability
}

Source Attribution

When the module assigns a perishability tag, it uses the source eos_assumed to indicate the value was inferred rather than explicitly provided:

GlossaryTermProp(
term_uid=perishability_term.uid,
source=SourceEnum.eos_assumed
)

Dependency Chain

The module waits for these modules to complete before running:

ModuleReason
AddClientNodesGFMClient-specified nodes must be added first
MatchProductNameGFMProducts must be matched to glossary terms
IngredientSplitterGFMComposite ingredients must be split
NutrientSubdivisionGFMNutrient-based subdivisions must be processed
LinkTermToActivityNodeGFMTerms must be linked to activities
AttachFoodTagsGFMFood-specific tags must be attached
OriginGFMOrigin information must be determined

Data Sources

Perishability Glossary Terms

The perishability classification uses terms from the EOS Glossary under the root term EOS_Perishability:

Term External IDDisplay NameDescription
EOS_STABLEShelf-StableProducts with extended room-temperature shelf life
EOS_PERISHABLEPerishableProducts requiring controlled storage
EOS_HIGH-PERISHABLEHighly PerishableProducts requiring immediate refrigeration

Product Type Glossary Terms

The combined/mono product classification uses terms under EOS_Combined_Product_Mono_Product:

Term External IDDisplay NameDescription
EOS_COMBINED_PRODUCTCombined ProductMulti-ingredient convenience product
EOS_MONO_PRODUCTMono ProductSingle ingredient product

Calculation Example

Scenario: A convenience salad bowl recipe with the following structure:

Salad Bowl (no explicit perishability)
├── Fresh Salad (highly perishable)
├── Ready-Made Sauce (no explicit perishability)
│ ├── Milk Powder (shelf-stable)
│ ├── Vinegar (shelf-stable)
│ ├── Oil (shelf-stable)
│ └── Fresh Parsley (highly perishable)
└── Tofu (perishable)

Step 1: Traverse to Leaf Nodes

The algorithm visits all leaf nodes first:

  • Fresh Salad: EOS_HIGH-PERISHABLE (from glossary)
  • Milk Powder: EOS_STABLE (from glossary)
  • Vinegar: EOS_STABLE (from glossary)
  • Oil: EOS_STABLE (from glossary)
  • Fresh Parsley: EOS_HIGH-PERISHABLE (from glossary)
  • Tofu: EOS_PERISHABLE (from glossary)

Step 2: Propagate to Parent Nodes

Ready-Made Sauce:

  • Sub-perishabilities: [stable, stable, stable, highly-perishable]
  • Maximum: EOS_HIGH-PERISHABLE
  • Combined product: Yes (multiple food product ingredients)

Step 3: Propagate to Root

Salad Bowl:

  • Sub-perishabilities: [highly-perishable, highly-perishable, perishable]
  • Maximum: EOS_HIGH-PERISHABLE
  • Combined product: Yes (combines multiple products, and has combined product sub-ingredient)

Final Output

ProductPerishability TagProduct Type Tag
Fresh SaladEOS_HIGH-PERISHABLEEOS_MONO_PRODUCT
Milk PowderEOS_STABLEEOS_MONO_PRODUCT
VinegarEOS_STABLEEOS_MONO_PRODUCT
OilEOS_STABLEEOS_MONO_PRODUCT
Fresh ParsleyEOS_HIGH-PERISHABLEEOS_MONO_PRODUCT
TofuEOS_PERISHABLEEOS_MONO_PRODUCT
Ready-Made SauceEOS_HIGH-PERISHABLE (assumed)EOS_COMBINED_PRODUCT
Salad BowlEOS_HIGH-PERISHABLE (assumed)EOS_COMBINED_PRODUCT

Integration with Other Modules

Downstream Consumers

The perishability classification is used by several downstream modules:

ModuleUsage
Conservation GFMDetermines storage requirements (cooled, frozen, dried)
Transport GFMCalculates cold chain requirements and transport mode feasibility
Food Loss GFMEstimates waste factors based on shelf life

Conservation Rules

The Conservation GFM uses perishability to assign default conservation methods:

  1. Highly Perishable + No Conservation Tag: Assigned "cooled" conservation
  2. Perishable + No Conservation Tag: Assigned "cooled" conservation
  3. Shelf-Stable: No conservation required (room temperature)

Transport Implications

Transport mode selection considers perishability:

  • Highly Perishable: May require air transport for long distances
  • Perishable: Can use refrigerated truck/ship transport
  • Shelf-Stable: No cold chain requirements

Known Limitations

Classification Coverage

  • Not all food products in the glossary have explicit perishability classifications
  • Products without classification default to shelf-stable, which may underestimate cold chain requirements
  • Some processed products may have variable perishability depending on processing method

Conservation Interaction

  • The current model does not account for conservation methods that change perishability (for example, drying highly perishable herbs)
  • Frozen products are handled separately by the Conservation GFM
  • The interaction between perishability and conservation could be more sophisticated

Combined Product Detection

  • The combined product detection is based solely on ingredient structure
  • It does not consider production location differences (convenience products produced at different facilities)
  • EAN/GTIN codes are not yet used to identify industrially produced convenience products

Future Enhancements

Planned improvements include:

  • Tree crawling for glossary tags to improve perishability detection
  • Better integration with conservation methods that alter perishability
  • Location-based convenience product detection
  • Support for product-specific conservation method restrictions

References

  1. EOS Glossary Documentation. Internal Eaternity documentation for glossary term definitions.

  2. Food Storage Guidelines. FDA and EFSA food safety guidelines for storage temperature requirements.

  3. Cold Chain Logistics. Industry standards for perishable food transport and storage.