AI-based expiration date prediction system
Expiry date management is a task where forecast accuracy directly translates into profit. Product write-offs cost manufacturers 5-15% of revenue. Machine learning models that take into account storage conditions, transport history, and biochemical markers reduce write-offs by 30-50%.
Factors of product degradation
Physicochemical processes:
- Fat oxidation: the rate is proportional to temperature and O₂ concentration
- Microbiological growth: Arrhenius model - rate increases exponentially with temperature
- Moisture loss: affects texture and water activity (aW)
- Maillard reaction: chemical degradation upon heating (baked goods, dry foods)
The key principle is TTT (Time-Temperature-Tolerance):
def effective_shelf_life(temp_history, q10=2.0, reference_temp=4.0):
"""
Q10 model: каждые 10°C удваивают скорость порчи
Эффективное время = Σ dt × (Q10)^((T-Tref)/10)
"""
effective_age = 0
for temp, duration_hours in temp_history:
acceleration = q10 ** ((temp - reference_temp) / 10.0)
effective_age += duration_hours * acceleration
return effective_age # часы эффективного старения
ML forecasting models
Regression on sensory data:
- Target variable: days to spoilage (from laboratory testing)
- Features: supply chain temperature history, humidity, Gas Headspace (CO₂, O₂, N₂ in packaging), initial microbial load
- Models: GradientBoosting - best baseline, LSTM for products with continuous temperature history
Sensors and IoT data:
features = {
'mean_temp_24h': rolling_mean(temp, 24),
'max_temp_transport': max(temp_during_transport),
'temp_exceedance_hours': hours_above_threshold(temp, 7.0), # часы выше 7°C
'humidity_avg': mean(humidity),
'initial_microbial_count': lab_cfu_per_g,
'packaging_type': one_hot(['MAP', 'vacuum', 'air']),
'days_since_production': calendar_age,
'effective_age_hours': q10_model_output
}
Dynamic expiration date: A static date on packaging is a worst-case scenario for the worst-case storage conditions. A smart system calculates a customized expiration date based on the product's actual history:
- The product was stored in ideal conditions → 3 more days after the nominal expiration date
- Temperature excess during transportation → remaining shelf life reduced by 40%
Supply chain integration
RFID/NFC tags with temperature logger:
- TempTale, Emerson, Sensitech - chips that record temperature every 5 minutes
- Upon receipt of goods: scanning → automatic calculation of the remaining period
- Sorting in the hall: closer to the end of the product → closer to the buyer (FIFO+ML)
WMS integration: The warehouse management system calculates the remaining shelf life for each pallet/unit. The placement algorithm prioritizes products with the shortest remaining shelf life for shipment.
Dynamic markdown:
def markdown_schedule(remaining_shelf_life_days, nominal_shelf_life, base_price):
"""
За 20% срока до истечения — начинаем скидки
Линейная шкала: -5% → -30% по мере приближения к дате
"""
remaining_pct = remaining_shelf_life_days / nominal_shelf_life
if remaining_pct < 0.2:
discount = 0.05 + (0.2 - remaining_pct) / 0.2 * 0.25
return base_price * (1 - discount)
return base_price
Product categories
Chilled meat and fish: Primary risk group. Q10 ≈ 2-3. Effective temperature history is critical. Integration with sensors on trucks and cold storage units is mandatory.
Dairy products: Pasteurization → the initial microbial load is known. Prediction is based on temperature data + an acidity test (pH drift).
Fresh vegetables and fruits: Ethylene ripening, moisture loss. Additional features: variety, region of origin, post-harvest treatment (1-MCP).
Bakery products: Mold is the main risk. aW (water activity) > 0.85 → risk. Water activity sensors + CO₂ emissions as a proxy.
Quality assessment
Validation protocol:
- Accelerated shelf-life testing (ASLT): storage at elevated temperatures with a specified Q10 → reduces the testing period
- Independent test sample: products from different batches, regions, seasons
- MAPE for the remaining term: target value < 15%
Laboratory verification: At least 5% of batches pass a real-world challenge test to validate the model. If the forecast deviation is > 20%, the Q10 parameters for this category are automatically revised.
Regulatory context
HACCP and ISO 22000: The predictive system does not replace, but rather complements, the HACCP plan. The model's results provide documented justification for shelf life when applying for registration.
FDA 21 CFR Part 11 / EEA TR: Temperature history logs must be protected from editing. Blockchain timestamps or a certified logger with a tamper-evident seal.
Timeframe: Basic Q10 model + integration with temperature loggers + WMS API — 4-5 weeks. ML forecasting by product category + dynamic pricing + full IoT → warehouse → store chain — 3-4 months.







