ML Surrogate Models for Chemical Reactor Optimization

We design and deploy artificial intelligence systems: from prototype to production-ready solutions. Our team combines expertise in machine learning, data engineering and MLOps to make AI work not in the lab, but in real business.
Showing 1 of 1All 1566 services
ML Surrogate Models for Chemical Reactor Optimization
Complex
from 1 week to 3 months
Frequently Asked Questions

AI Development Areas

AI Solution Development Stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1317
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1226
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    925
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1156
  • image_logo-advance_0.webp
    B2B Advance company logo design
    620
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    894

This is a real case: an ethylene polymerization plant in Nizhnekamsk operated with a yield of 87.3%. The physical model from the reactor supplier had a systematic 4% error due to unaccounted catalyst drift. After implementing a Gaussian Process surrogate updated weekly, we raised yield to 91.1%, reduced energy consumption by 7%, and completed everything within 6 weeks from data collection to first shot. Additional profit from the yield increase amounted to about 4 million rubles per month, and energy savings added another 1.2 million monthly.

The broader problem: rigorous models—Aspen Plus, HYSYS—take minutes to compute, which is unacceptable for online optimization. Laboratory quality control happens once an hour, but the reactor dynamics change every minute. We bridge this gap with machine learning: we build a surrogate that computes in milliseconds and a soft sensor that predicts quality every 60 seconds. Result: yield +2-8%, raw materials −3-10%, MVP implementation in 5-6 weeks. Our experience: 12 projects in chemical and petrochemical industries, all solutions certified under GAMP 5 and 21 CFR Part 11.

Problems We Solve

  • Inaccuracy of physical models. Real reaction kinetics often deviate from theoretical equations. ML models trained on operational data account for these imperfections.
  • High computational cost. Rigorous models (Aspen Plus, HYSYS) take minutes—unsuitable for real-time. Surrogate models deliver predictions in milliseconds.
  • Low frequency of laboratory control. Product quality is measured once an hour. A soft sensor predicts it every minute, allowing prompt mode adjustments.
  • Difficulty of simultaneous optimization of multiple parameters. Bayesian Optimization finds the optimum in 25-30 experiments instead of thousands.

How AI Increases Product Yield?

The key step is building a surrogate model of the process that replaces the simulator. Gaussian Process not only predicts yield but also provides uncertainty. This is critical for safe optimization: we constrain the search to areas with low uncertainty.

from sklearn.preprocessing import StandardScaler
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import Matern

gp_model = GaussianProcessRegressor(
    kernel=Matern(length_scale=1.0, nu=2.5),
    alpha=1e-6,
    normalize_y=True,
    n_restarts_optimizer=10
)
gp_model.fit(X_process_train, y_yield_train)
y_pred, y_std = gp_model.predict(X_new, return_std=True)

For reactors with known kinetics, we use Physics-Informed Neural Network. It trains simultaneously on data and physical equations (Arrhenius, law of mass action). This reduces data requirements and improves physical consistency. Learn more about the method at Physics-informed neural networks.

import torch
import torch.nn as nn

class ChemicalReactorPINN(nn.Module):
    def __init__(self, n_inputs, n_outputs, n_hidden=64):
        super().__init__()
        self.net = nn.Sequential(
            nn.Linear(n_inputs, n_hidden), nn.Tanh(),
            nn.Linear(n_hidden, n_hidden), nn.Tanh(),
            nn.Linear(n_hidden, n_outputs)
        )

    def physics_residual(self, T, c_A, c_B, k0, Ea, R=8.314):
        k = k0 * torch.exp(-Ea / (R * T))
        r_pred = self.net(torch.stack([T, c_A, c_B], dim=1))
        r_physics = k * c_A * c_B
        return torch.mean((r_pred - r_physics)**2)

    def forward(self, x):
        return self.net(x)

Why Surrogate Models Are Faster?

A physical model of a chemical reactor contains thousands of differential equations and takes 1-5 minutes to solve. After training, an ML surrogate executes inference in 1-10 milliseconds. This enables its use in Real-Time Optimization (RTO) loops where setpoints must be recalculated every 1-5 minutes when feed composition changes.

from scipy.optimize import minimize, LinearConstraint

def rto_optimization(surrogate_model, current_feed_composition,
                      product_prices, raw_material_costs):
    def negative_profit(setpoints):
        T, P, reflux_ratio = setpoints
        features = np.concatenate([current_feed_composition, [T, P, reflux_ratio]])
        outputs = surrogate_model.predict([features])[0]
        yield_A, yield_B, energy = outputs
        revenue = yield_A * product_prices['A'] + yield_B * product_prices['B']
        cost = np.dot(current_feed_composition, raw_material_costs) + energy * energy_price
        return -(revenue - cost)

    bounds = [(100, 300), (1, 20), (1.0, 5.0)]
    constraints = [
        {'type': 'ineq', 'fun': lambda x: max_temperature - x[0]},
        {'type': 'ineq', 'fun': lambda x: product_spec_check(surrogate_model, x)}
    ]
    result = minimize(negative_profit, x0=[200, 5, 2.5], bounds=bounds, constraints=constraints)
    return result.x

Soft Sensor: Virtual Quality Analyzer

Laboratory analyses arrive once an hour, but a soft sensor updates the estimate every minute. We use Gradient Boosting and temporal features (lags of 1, 5, 15, 60 minutes). This keeps product quality within tolerance without reagent overuse.

def build_quality_soft_sensor(online_measurements, lab_results):
    features = create_temporal_features(online_measurements, lags=[1, 5, 15, 60])
    model = GradientBoostingRegressor(n_estimators=200, learning_rate=0.05)
    model.fit(features, lab_results)
    return model

Comparison: Traditional APC vs AI Optimization

Parameter Traditional MPC ML-Enhanced RTO
Calculation time 1-5 min (APC) 1-10 ms (surrogate)
Yield accuracy ±3% ±1.5%
Feed adaptation manual automatic
Uncertainty estimation no yes (GP)
Implementation period 6-12 months 1-6 months (MVP in 5 weeks)

How Bayesian Optimization Reduces Experiment Count?

When developing new products, each experiment is expensive—from thousands to hundreds of thousands of rubles. Bayesian Optimization builds a probabilistic model of the objective function and suggests points to test, minimizing the number of trials. In a typical project, we reduce experiments from 500 to 25-30. Learn more about the method at Bayesian optimization.

from bayes_opt import BayesianOptimization

def evaluate_recipe(x1, x2, x3, x4):
    recipe = {'conc_A': x1, 'conc_B': x2, 'temp': x3, 'time': x4}
    result = run_lab_experiment(recipe)
    return result['yield']

optimizer = BayesianOptimization(
    f=evaluate_recipe,
    pbounds={'x1': (0, 1), 'x2': (0, 1), 'x3': (60, 120), 'x4': (0.5, 6)},
    random_state=42
)
optimizer.maximize(init_points=5, n_iter=20)

Work Process

  1. Analytics — collect DCS/SCADA data, laboratory analyses, define applicability limits.
  2. Design — choose ML architecture (Gaussian Process, PINN, Gradient Boosting) and metrics.
  3. Implementation — train surrogate, soft sensor, configure RTO. Pilot run on historical data.
  4. Testing — A/B comparison with current mode, stress tests on anomalies.
  5. Deployment — integration via OPC-DA/UA, containerization (Docker), monitoring.
Implementation Details - Process survey and identification of ML application points. - Development of surrogate model or PINN with uncertainty estimation. - Soft sensor for online quality control. - RTO module with optimizer. - Integration with DCS (Siemens, Honeywell, ABB) and documentation preparation under GAMP 5/21 CFR Part 11. - Staff training and warranty support for 6 months.

Typical Timelines

Stage Timeline
MVP (surrogate + soft sensor + SPC) 5-6 weeks
RTO + PINN + closed-loop quality 4-6 months
DCS integration + validation 2-3 additional months

Cost is calculated individually. Get a consultation for your project — our certified engineers will help select the optimal turnkey solution. Order a pilot project and see results in 5 weeks.