Kenya Coffee School (KCS)

RoastLogic™ SaaS

🤖 AI Roast Correction Algorithm Specification

Version 1.0 – Advanced Roasting Certification Engine

Aligned with structured roast standards referenced by the Specialty Coffee Association and optimized for Kenyan high-density coffees (820–850 g/L).


1️⃣ PURPOSE

The AI Roast Correction Engine (RCE) is designed to:

  • Detect roast curve anomalies in real-time or post-roast
  • Predict underdevelopment, overdevelopment, or baking
  • Recommend corrective gas/airflow adjustments
  • Improve DTR accuracy (target 20–23%)
  • Stabilize RoR pattern
  • Reduce defect frequency
  • Increase certification pass probability

2️⃣ SYSTEM INPUT VARIABLES

2.1 Green Coffee Variables

  • Density (g/L)
  • Moisture %
  • Water activity (optional)
  • Screen size
  • Processing type (Washed, Honey, Natural)

2.2 Roast Process Variables

  • Batch size (kg)
  • Charge temperature
  • Turning point time & temp
  • Bean temperature curve (per second/minute)
  • RoR curve
  • Gas % per time segment
  • Airflow level per time segment
  • First crack time & temp
  • Drop time & temp
  • Total roast time
  • Development time

2.3 Sensory Validation (Post-Roast)

  • Aroma score
  • Acidity score
  • Sweetness score
  • Balance score
  • Defect notes

3️⃣ CORE ANALYTICAL MODULES


🔥 MODULE 1: DTR OPTIMIZATION ENGINE

Formula


DTR = \frac{Development Time}{Total Roast Time} \times 100

Logic Rules

IF DTR < 18%
→ Flag: Underdevelopment risk
→ Suggest: +15–30 sec development

IF DTR > 25%
→ Flag: Overdevelopment risk
→ Suggest: Reduce drop temp 2–4°C

IF Density > 840 g/L AND DTR < 20%
→ Suggest extended Maillard (+20 sec before first crack)


📈 MODULE 2: RoR STABILITY ANALYZER

Detection Logic

A. RoR Crash

Condition: RoR drop >5°C/min within 30 sec

Correction:

  • Reduce airflow at mid-Maillard
  • Maintain gas slightly longer

B. RoR Flick

Condition: RoR spike >4°C/min after first crack

Correction:

  • Reduce gas 10–15% at FC onset
  • Increase airflow slightly

C. Baking Pattern

Condition: RoR flat <3°C/min for >90 sec

Correction:

  • Increase gas early in Maillard
  • Shorten total roast time

D. Scorching Risk

Condition: High charge temp + steep early RoR (>20°C/min)

Correction:

  • Reduce charge temp by 3–5°C
  • Increase drum speed or airflow

4️⃣ DENSITY-BASED PREDICTIVE MODEL

Input: Density (g/L)

IF Density 820–830
→ Base charge profile

IF Density 830–840
→ +2°C charge
→ Extend Maillard 15 sec

IF Density 840–850
→ +3–5°C charge
→ Controlled early gas
→ Maintain airflow balance


5️⃣ SHRINKAGE OPTIMIZATION MODULE

Formula


Shrinkage\% = \frac{Green - Roasted}{Green} \times 100

Target: 14.5–16.5%

IF Shrinkage < 13%
→ Likely underdeveloped

IF Shrinkage > 18%
→ Overdevelopment risk

Algorithm correlates shrinkage with DTR and drop temp.


6️⃣ SENSORY CORRELATION MODEL

The system uses weighted regression mapping:

Roast VariableSensory Impact
High RoR earlyReduced sweetness
Long MaillardIncreased body
Stable declineImproved balance
FlickBitterness

Machine learning refinement:

  • Collect historical roast + sensory data
  • Train predictive model to suggest:
    • “Increase development 20 sec for improved sweetness”
    • “Reduce drop temp 2°C to protect acidity”

7️⃣ AI RECOMMENDATION OUTPUT FORMAT

After roast upload, user receives:

📊 Technical Report

  • DTR status: 19.2% (Below Target)
  • RoR Flick detected at 8:45
  • Drop temp 205°C (+3°C above tolerance)

🤖 AI Suggestions

  • Reduce gas 12% at 1st crack
  • Extend development +18 sec
  • Reduce charge by 2°C
  • Increase airflow at minute 6

🎯 Predicted Outcome

  • Improved sweetness +0.8 sensory points
  • Reduced bitterness probability
  • DTR adjusted to 21.5%

8️⃣ CERTIFICATION INTEGRATION

The AI engine contributes to:

  • 15% RoR Stability score
  • 10% DTR Accuracy score
  • 20% Profile Accuracy score

System tracks:

  • Improvement rate per student
  • Consistency index
  • Pass probability indicator

9️⃣ MACHINE LEARNING ARCHITECTURE

Phase 1 – Rule-Based Engine

  • Deterministic if/then corrections
  • Density-driven adjustments
  • Static tolerance bands

Phase 2 – Supervised Learning

  • Train on KCS roast database
  • Regression models:
    • XGBoost
    • Random Forest
  • Predict sensory outcome from roast data

Phase 3 – Reinforcement Learning

  • System tests micro-adjustments
  • Learns optimal roast strategy per density cluster

🔟 ANOMALY SCORING SYSTEM

Score range: 0–100

MetricWeight
RoR Stability40%
DTR Accuracy20%
Drop Temp Precision15%
Shrinkage Target10%
Density Adjustment Compliance15%

≥85 = Professional level
≥92 = Master Level Calibration


11️⃣ EDGE CASE HANDLING

  • Extremely low density (<780 g/L)
  • Very small batches (<1kg)
  • Dark roast intentional profiles
  • High altitude roastery variations

Algorithm adjusts tolerance bands accordingly.


12️⃣ PERFORMANCE TARGETS

  • Real-time anomaly detection <500ms
  • Post-roast analysis <3 seconds
  • 95% anomaly detection accuracy (target)
  • ≥10% improvement in average DTR accuracy within 3 months

13️⃣ DATA STORAGE STRUCTURE

Each roast stores:

  • Full temperature time series
  • RoR time series
  • Correction recommendations
  • Instructor override
  • Sensory validation feedback

This feeds continuous ML model refinement.


14️⃣ FUTURE EVOLUTION

  • IoT live roaster sensor integration
  • Auto-gas modulation suggestions
  • Roast fingerprint marketplace
  • Green lot predictive modeling
  • Africa-wide roast benchmark index

STRATEGIC IMPACT

The AI Roast Correction Engine:

  • Elevates KCS certification rigor
  • Reduces training time
  • Improves production consistency
  • Strengthens Kenya’s roast-origin leadership
  • Builds continental roast intelligence database