Inspiration
We noticed that civil /mining engineers still rely on slow, expensive lab tests to determine the tensile strength of new rocks. A single test can cost hundreds of dollars and delay product timelines by days. We asked ourselves: “What if a web app could give a reliable estimate in seconds using only easily-measured features like density, porosity, CAI and tensile values?” The hackathon’s “real ML, no wrappers” rule was the perfect push to train our own model and show that small-data, open-source pipelines can still deliver industrial value.
What it does
Tensile Strength Predictor is a full-stack web application that:
- Accepts four physical measurements (density, porosity, CAI, tensile) via a clean UI.
- Runs a custom-trained XGBoost model (≈ 2 kB) served by FastAPI.
- Returns an instant tensile-strength estimate and visual confidence range.
- Runs entirely on free cloud tiers (Render + Vercel) with zero LLM APIs.
How we built it
| Layer | Stack & Flow |
|---|---|
| Data | manually created and tested dataset from rock samples (100+ samples) → cleaned & engineered 6 derived features in a Jupyter notebook. |
| Model | XGBoost regressor tuned with Optuna → exported via joblib → 2 kB model.pkl. |
| Backend | FastAPI endpoint (/predict) reproduces exact feature engineering at inference time → Docker → GHCR → Render free tier. |
| Frontend | Vanilla HTML/CSS/JS single page → fetches backend via HTTPS → deployed on Vercel. |
| CI/CD | GitHub Actions auto-builds & pushes Docker image on every main push. |
Everything is MIT-licensed and reproducible from the public repo.
Challenges we ran into
- CORS: Browser pre-flight
OPTIONSrequests were blocked locally; solved with FastAPI’sCORSMiddleware. - Docker push failures on Windows PowerShell due to Execution-Policy; fixed via
Set-ExecutionPolicy RemoteSigned. - Render port detection: had to explicitly expose
8000and setPORT=8000env var. - Model drift risk: ensured training & inference use identical feature engineering code to avoid silent skew.
Accomplishments that we're proud of
- Sample Collected: Collected 100+ samples and tested physical and mechanical properties of sandstone rock samples in lab.
- End-to-end pipeline from raw CSV → trained model → live HTTPS API → responsive UI in < 48 h.
- Sub-100 ms prediction latency on free Render dyno.
- Full open source: model weights, training code, Dockerfiles and infra-as-code (GitHub Actions) all public.
- Zero external AI APIs: every line of ML is ours—no black-box calls.
What we learned
- FastAPI + Docker + Render is a breeze for lightweight Python services.
- Vercel’s Git-linked deploys let us iterate in minutes, not hours.
- Feature-engineering parity between training and inference is non-negotiable—one misplaced log transform silently breaks predictions.
- Free tiers are surprisingly generous for hackathon-scale traffic.
What's next for Tensile Strength Predictor
- Expand dataset to 10 k+ samples across more alloy families.
- ONNX export for ultra-low-latency inference (< 5 ms) at plant edge devices.
- Upload CSV batch mode so engineers can predict hundreds of rows at once.
- Confidence intervals & SHAP explanations to give engineers trust and insight.
- Custom domain + SSL + rate limiting for production use in SMEs.
Built With
- docker
- fastapi
- html
- python
- render
- scikit-learn
- vercel
Log in or sign up for Devpost to join the conversation.