Skip to content

02 / Selected work

Scientific ML

ML-guided polymer discovery loop

A didactic scientific study that uses physics-informed synthetic data and surrogate models to decide which formulations deserve a lab budget.

Python · NumPy · pandas · scikit-learn · matplotlib

Trade-off view: Pareto front approximation of elongation versus tensile strength

Context

polymer-ml-lab is a public, notebook-led study. It is not an industrial R&D deployment and it does not use proprietary lab measurements. The premise is scientific and didactic: use ML to shrink a theoretical search space before anyone spends experimental budget.

This is the clearest public bridge from physics engineering to data systems: constraints first, then measurement (even if simulated), then a decision.

Problem

Formulation spaces are large. Tensile strength, elongation, and thermal resistance pull in different directions. A team that tests at random burns time. A team that only follows folklore may never see the Pareto surface. The project asks how to propose a small set of candidates that are physically plausible and worth confirming.

Architecture

The documented loop:

  1. Define a constrained formulation sandbox (base, additives, process variables, mass balance ≈ 100 wt%).
  2. Generate pseudo-lab data with physics-inspired equations plus controlled noise.
  3. Train surrogates (linear baselines vs Random Forest), including a low-data regime.
  4. Generate candidates with constrained search and Upper Confidence Bound (UCB) scoring.
  5. Simulate measuring those candidates, append, retrain, watch the Pareto front.
FormulationsSurrogatesUCB policyCandidates
Constraint → score → choose

Code is split between ordered notebooks (01 data generation, 02 modeling, 03 optimization) and src/data_generation.py so sampling is not trapped in a notebook.

Data / inputs

There is no confidential polymer dataset. Bounds, samplers, and a lab-simulation helper live in code. Generated tables can be cached locally and are gitignored by default. Trends the README expects: filler raises tensile strength and hurts elongation; plasticizer does the opposite; temperature has a bell-shaped optimum.

Engineering decisions

  • Physics in the generator, not as a vibe. Mass balance and process limits are encoded so the model cannot recommend nonsense formulations as freely.
  • Baselines before clever models. Linear models sit next to Random Forest so “ML helped” is comparable, not theatrical.
  • Uncertainty-aware reading of low-data regimes. The write-up emphasizes not trusting overconfident recommendations when samples are few.
  • UCB as the decision policy. Exploration versus exploitation is explicit: the loop is allowed to visit novel regions, not only the current best.
  • Notebooks as lab books. Each notebook ends with notes pointing to the next step. Reproducibility is the product.

Implementation

Environment: NumPy, pandas, scikit-learn, matplotlib, seaborn. Run notebooks in order, or call python -m src.data_generation. A helper strips notebook outputs before version control so diffs stay readable.

Challenges

  • Synthetic data only approximates a lab. The README is clear: real measurements should replace or fine-tune the same notebooks (Gaussian processes are listed as a future surrogate).
  • Optimization is heuristic search, not a full Bayesian optimization stack. That is an honest limitation, not a hidden one.
  • Extra industrial constraints (cost, aging, rheology) are named as missing, not silently assumed.

Results

From the project README, as a synthetic study, not a factory trial:

  • Random Forest surrogates stayed robust when data was throttled to about 20–30 samples.
  • The UCB loop narrowed the Pareto front in roughly three iterations.
  • On the order of the top ~5% of theoretical candidates would be sent to the (simulated) lab.

I will not translate those figures into “we cut lab cost by X% at company Y.”

What I learned

Measure before optimizing: even in a toy loop, you compare a linear baseline and you watch uncertainty. Systems > tools: the value is the closed loop (generate → score → choose → measure), not the choice of forest versus network.

Grain matters here too. A formulation vector is not a recommended experiment until it has survived constraints and a policy. Mixing those grains is how a notebook becomes an overconfident slide.

Stack

Python, NumPy, pandas, scikit-learn, matplotlib, seaborn, Jupyter.

Repository

github.com/carlosdcorona/polymer-ml-lab