Concrete Compressive Strength — RandomForest

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

A scikit-learn RandomForestRegressor that predicts concrete compressive strength (MPa) from mix proportions and curing age. Trained on the public UCI Concrete Compressive Strength dataset.

Status: honest baseline. This is a reproducible model on a well-known public benchmark — not a proprietary or state-of-the-art model. It is useful as a fast strength estimate and as a transparent baseline; it is not a substitute for laboratory testing or code-compliance verification.

Training data

  • Dataset: UCI Concrete Compressive Strength (I-Cheng Yeh). 1,030 lab samples. License: CC BY 4.0.
  • Split: 824 train / 206 test, train_test_split(test_size=0.2, random_state=42).
  • The dataset CSV is vendored in the source repo at app/backend/ml_models/data/concrete_uci.csv.

Evaluation (held-out test set, n=206)

Metric Value
0.8795
RMSE 5.573 MPa
MAE 3.906 MPa

These numbers are independently reproducible — run python scripts/reproduce_metrics.py in the source repo (retrains and asserts a match against the committed metrics).

Inputs (order matters)

The model consumes an 8-feature vector, standardized by the included scaler.skops (a StandardScaler fit on the training set):

  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³)
  8. age (days)

Output: predicted compressive strength in MPa.

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, age
x = np.array([[380, 0, 0, 175, 6, 1000, 780, 28]], dtype=float)
strength_mpa = float(model.predict(scaler.transform(x))[0])
print(round(strength_mpa, 1), "MPa")

Intended use & limitations

  • Intended: quick strength estimates during mix design, teaching/insight, and as a transparent baseline for benchmarking.
  • Not intended: structural sign-off, QC acceptance, or code compliance — always confirm with lab breaks.
  • Distribution shift: trained on one public lab dataset with specific materials; predictions outside that distribution (unusual SCM ratios, admixtures, aggregates, or regional materials) are unreliable.
  • Uncertainty: the source application serves calibrated conformal prediction intervals around this model; those are not bundled in this artifact (point predictions only here).
  • No field calibration: lab-cured cylinder data; field strength differs.

License

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

Citation

Yeh, I-C. (1998). Modeling of strength of high-performance concrete using artificial neural networks. Cement and Concrete Research, 28(12), 1797–1808. UCI Machine Learning Repository: Concrete Compressive Strength.

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

Evaluation results