ML Plan: Aggregate Blend Optimization
Context
Problem: Designing an aggregate blend that meets gradation specifications requires trial-and-error adjustment of source percentages. Engineers manually tweak blend ratios, check against specs, and iterate.
Goal: Given available aggregate sources and target gradation specifications, automatically suggest optimal blend percentages that meet spec requirements.
Data Available: 100+ historical mix designs with aggregate source data and blend percentages.
What It Predicts
| Output |
Description |
| Recommended Blend |
Percentage for each source (e.g., Coarse: 45%, Fine: 35%, RAP: 20%) |
| Spec Compliance |
Pass/fail for each control sieve |
| Bailey Ratios |
Predicted CA, FAc, FAf for the blend |
| Optimization Score |
How well blend meets targets |
| Alternatives |
2-3 alternative blends with trade-offs |
Data Requirements
| Category |
Fields |
| Available Sources |
List of AggregateSource records with gradations |
| Target Specification |
GradationSpecification limits (min/max per sieve) |
| Design Parameters |
NMAS, target Bailey ratios (optional) |
| Constraints |
Min/max % for each source, required RAP %, etc. |
Historical Data for Training
- Past blend decisions (which sources, what percentages)
- Resulting gradation compliance
- Bailey ratio outcomes
- Volumetric results (VMA achieved)
Implementation Approach
This is Primarily an Optimization Problem, Not ML
Key insight: Unlike other predictions, blend optimization has a closed-form solution. The gradation of a blend is simply a weighted average of source gradations.
Approach: Use constrained optimization (not ML) with optional ML-enhanced objectives.
Algorithm
def optimize_blend(
sources: List[AggregateSource],
target_spec: GradationSpecification,
constraints: BlendConstraints,
objectives: BlendObjectives
) -> BlendResult:
"""
Minimize: deviation from spec targets + penalty for poor Bailey ratios
Subject to: spec limits, source constraints, sum to 100%
"""
# Decision variables: percentage for each source
# Constraints:
# - Sum of percentages = 100%
# - Each source within min/max bounds
# - Blended gradation within spec limits
# Objective:
# - Minimize deviation from spec midpoints
# - Maximize margin from spec limits (robustness)
# - Target ideal Bailey ratios
# - Minimize cost (if source costs provided)
Where ML Can Help
- Learn Ideal Bailey Ratios: Train on historical data to learn what ratios led to good VMA
- Predict Workability: Learn which blends were easy vs. difficult to compact
- Cost Optimization: Learn trade-offs between cheaper sources and performance
Service Architecture
/app/services/
blend_optimizer.py # Core optimization algorithm
ml/
blend_scorer.py # ML-enhanced scoring of candidate blends
Decision Variables
x[i] = percentage of source i in blend (0-100)
Constraints
# Sum to 100%
sum(x[i]) = 100
# Source bounds
min_pct[i] <= x[i] <= max_pct[i]
# Gradation limits (for each sieve s)
spec_min[s] <= sum(x[i] * gradation[i][s]) / 100 <= spec_max[s]
# RAP limit (if applicable)
sum(x[i] for i in rap_sources) <= max_rap_pct
Objective
minimize:
+ w1 * sum((blend[s] - spec_midpoint[s])^2) # deviation from ideal
+ w2 * sum(max(0, spec_min[s] - blend[s] + margin)) # margin penalty
+ w3 * bailey_penalty(blend) # deviation from ideal ratios
+ w4 * cost(blend) # material cost (optional)
API Endpoints
| Endpoint |
Method |
Description |
/api/blend/optimize |
POST |
Get optimal blend recommendation |
/api/blend/evaluate |
POST |
Evaluate a proposed blend |
/api/blend/compare |
POST |
Compare multiple blend options |
Request Example
{
"sources": [
{"id": "src-1", "name": "3/4 Crushed", "gradation": {...}},
{"id": "src-2", "name": "Manufactured Sand", "gradation": {...}},
{"id": "src-3", "name": "RAP", "gradation": {...}, "ac_content": 4.8}
],
"target_spec": "S3",
"constraints": {
"rap_max_pct": 25,
"source_bounds": {
"src-1": {"min": 30, "max": 60},
"src-2": {"min": 20, "max": 50}
}
},
"objectives": {
"target_bailey_ca": 0.75,
"minimize_cost": true
}
}
Response Example
{
"recommended_blend": {
"src-1": 42,
"src-2": 38,
"src-3": 20
},
"resulting_gradation": {...},
"spec_compliance": {
"all_pass": true,
"margins": {"19mm": 5.2, "9.5mm": 3.1, ...}
},
"bailey_ratios": {
"ca_ratio": 0.74,
"fa_c": 0.43,
"fa_f": 0.41
},
"alternatives": [
{"blend": {...}, "trade_off": "Lower cost, tighter margin on No. 8"},
{"blend": {...}, "trade_off": "Better Bailey ratios, higher RAP"}
]
}
UI Integration
- Source Selection: Select available aggregate sources
- "Optimize Blend" Button: Calculate recommended percentages
- Interactive Sliders: Manually adjust while seeing real-time gradation plot
- Spec Compliance Chart: Visual pass/fail for each sieve
- Bailey Analysis Panel: Show ratios with recommended ranges
Visualization
- Gradation curve with spec band overlay
- Blend pie chart
- Sensitivity analysis (what if I change this source by 5%?)
Implementation Steps
| Step |
Description |
| 1 |
Implement core optimizer using scipy.optimize |
| 2 |
Add Bailey ratio calculation to objective |
| 3 |
Create API endpoint |
| 4 |
Build interactive UI with real-time updates |
| 5 |
Add ML scoring for workability prediction |
Verification
- Unit tests: Optimizer finds valid solutions for known problems
- Historical validation: Run optimizer on past designs, compare to actual blends
- Engineer review: Have engineers evaluate recommendations
- A/B comparison: Track time-to-design with vs. without optimizer
Value Proposition
| Metric |
Current |
With Optimizer |
| Time to develop blend |
1-2 hours |
5-10 minutes |
| Spec compliance checking |
Manual |
Automatic |
| Bailey ratio optimization |
Often skipped |
Built-in |
| Alternative exploration |
Limited |
Systematic |
Technical Notes
Solver Choice
- scipy.optimize.minimize with SLSQP method
- Handles equality and inequality constraints
- Fast enough for interactive use (<1 second)
Existing Code to Leverage
calculate_combined_gradation() in SuperpaveMixDesignVersion
run_bailey_analysis() in bailey_method.py
GradationSpecification model for spec limits
Timeline
| Week |
Focus |
| 1 |
Core optimizer implementation |
| 2 |
API and basic testing |
| 3 |
UI integration |
| 4 |
ML enhancements (optional) |