Concrete Slump & Flow — RandomForest (honest baseline)

GitHub repo: https://github.com/Siddartha-DevOps/ConcreteMix.AI (full source, training pipeline, and parity check)

A scikit-learn multi-output RandomForestRegressor that predicts concrete workability — slump (mm) and flow (mm) — from mix proportions. Trained on the public UCI Concrete Slump Test dataset.

Status: honest, modest baseline — read this before using it. Slump and flow are substantially harder to predict from mix proportions alone than compressive strength: they depend heavily on admixture chemistry, aggregate shape/grading, mixing energy, temperature, and time-since-batching that a 7-number mix vector simply does not capture. On this dataset the model explains only about a third of the variance (slump R² ≈ 0.36, flow R² ≈ 0.38 in 5-fold CV). It is a useful rough directional estimate and a transparent baseline — not a strong result, and not a substitute for a slump test. This is deliberately published at the same rigor as our strength model (R² ≈ 0.88), so the contrast in difficulty is visible rather than hidden.

Training data

  • Dataset: UCI Concrete Slump Test (I-Cheng Yeh). 103 lab mixes. License: CC BY 4.0.
  • Each mix records 7 ingredients → measured SLUMP, FLOW, and 28-day strength (strength is not modeled here). Slump/flow are stored in cm in the source and converted to mm (×10) for this model.
  • The dataset file is vendored in the source repo at app/backend/ml_models/data/slump_test.data.

Evaluation (5-fold cross-validation, n=103)

Honest cross-validated numbers — not training-fit. With only 103 samples, CV is the right estimate and the variance is real.

Target R² (5-fold CV) MAE
Slump 0.362 52.0 mm
Flow 0.384 108.7 mm

For calibration: measured slump spans 0–290 mm and flow spans 200–780 mm in this data, so the MAEs above are a meaningful fraction of the range — this is a coarse estimator, stated plainly. Reproduce by retraining from the vendored dataset with the recipe in app/backend/ml_models/slump_predictor.py (RandomForestRegressor(n_estimators=300, min_samples_leaf=2, random_state=42), KFold(5, shuffle=True, random_state=42)).

Inputs (order matters)

The model consumes a 7-feature vector, standardized by the included scaler.skops (a StandardScaler fit on the dataset):

  1. cement (kg/m³)
  2. blast_furnace_slag (kg/m³)
  3. fly_ash (kg/m³)
  4. water (kg/m³)
  5. superplasticizer (kg/m³)
  6. coarse_aggregate (kg/m³)
  7. fine_aggregate (kg/m³)

Output: a 2-vector [slump_mm, flow_mm]. (No curing age — slump/flow are fresh-concrete properties measured at batching.)

Requirements

The model was trained and serialized with scikit-learn 1.9.0 (verified from the pickle's _sklearn_version). Loading with a different scikit-learn raises InconsistentVersionWarning and can change predictions — pin these exact versions for guaranteed-consistent output:

scikit-learn==1.9.0
skops==0.14.0
numpy==2.4.6
pip install -r requirements.txt   # bundled in this repo

Usage

import numpy as np
from skops.io import load, get_untrusted_types

f = "model.skops"
model = load(f, trusted=get_untrusted_types(file=f))
scaler = load("scaler.skops", trusted=get_untrusted_types(file="scaler.skops"))

# cement, slag, fly_ash, water, SP, coarse, fine
x = np.array([[273, 82, 105, 210, 9, 904, 680]], dtype=float)
slump_mm, flow_mm = model.predict(scaler.transform(x))[0]
print(round(slump_mm, 1), "mm slump /", round(flow_mm, 1), "mm flow")
# -> 232.3 mm slump / 624.9 mm flow

Intended use & limitations

  • Intended: a quick, transparent directional workability estimate during mix design, and an honest baseline for benchmarking better workability models.
  • Not intended: replacing a slump/flow test, QC acceptance, or any code-compliance decision — always confirm with an actual test.
  • Modest accuracy by nature: slump/flow prediction from proportions alone is a hard problem; ~⅓ of variance explained is expected here, not a defect to be optimized away with this feature set.
  • Small dataset (n=103): predictions outside the training distribution (unusual SCM ratios, admixtures, aggregates, or regional materials) are unreliable, and CV scores carry real variance.
  • No admixture chemistry / temperature / time: the dominant drivers of real workability are not in the inputs.
  • No prediction intervals are bundled (point predictions only).

License

  • Model weights: MIT.
  • Training data: UCI dataset under CC BY 4.0 (attribution: I-Cheng Yeh).

Citation

Yeh, I-C. (2007). Modeling slump flow of concrete using second-order regressions and artificial neural networks. Cement and Concrete Composites, 29(6), 474–480. UCI Machine Learning Repository: Concrete Slump Test.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Evaluation results

  • slump R² (5-fold CV) on UCI Concrete Slump Test
    self-reported
    0.362
  • flow R² (5-fold CV) on UCI Concrete Slump Test
    self-reported
    0.384