Machine Learning-based "Virtual Soft-Sensor" trained on high-fidelity simulation data representing 450 hours of industrial operation. It predicts ethanol purity in real-time, robustly handling noise and outliers to replace expensive hardware analyzers.
In industrial chemical processing, measuring product purity (e.g., Ethanol concentration) in real-time is often challenging due to the high cost and latency of on-line hardware analyzers.
This project implements a Virtual Soft-Sensor for a binary distillation column. By leveraging a Random Forest Regressor, the system infers the distillate product quality instantly using readily available process variables (Temperatures, Pressures, and Flow Rates).
- 🚀 Real-Time Prediction: Instantly estimates Ethanol Purity based on sensor inputs.
- 📊 Process Insights: Flags production as ON-SPEC (≥98%) or OFF-SPEC and provides reasoning.
- 🌡️ Visual Analytics: Visualizes the column temperature profile to detect anomalies like flooding or drying.
- 💡 Actionable Recommendations: Suggests control actions (e.g., "Increase Reflux Ratio") to operators.
The model is trained on a synthetic dataset generated from a rigorous mathematical model of a binary distillation column. To ensure industrial relevance, the data includes atypical features such as sensor noise, outliers, and missing values, simulating real-world operating conditions.
- Source: Mathematical Simulation of a Distillation Column
- Duration: 450 Hours of continuous operation
- Sampling Rate: Every 0.1 hours (6 minutes)
- Total Samples: ~4,500 data points
The dataset consists of 22 features capturing the thermodynamic state of the column:
| Variable Type | Feature Name | Description | Unit |
|---|---|---|---|
| Control | Pressure |
Column operating pressure | bar |
| State | Temp_Tray_2 ... Temp_Tray_15 |
Temperatures at various tray levels | Kelvin (K) |
| Flow | Liquid_Flow |
Internal liquid flow rate | kmol/h |
| Flow | Vapor_Flow |
Internal vapor flow rate | kmol/h |
| Flow | Distillate_Flow |
Top product flow rate | kmol/h |
| Flow | Bottoms_Flow |
Bottom product flow rate | kmol/h |
| Flow | Feed_Flow |
Input feed flow rate | kmol/h |
| Target 🎯 | Ethanol_Mol |
Molar concentration of ethanol | Mol Fraction |
If you find this approach or data useful, please acknowledge the original dataset creators:
Cote-Ballesteros, J. E., Grisales Palacios, V. H., & Rodriguez-Castellanos, J. E. (2022). Un algoritmo de selección de variables de enfoque híbrido basado en información mutua para aplicaciones de sensores blandos industriales basados en datos. Ciencia E Ingeniería Neogranadina, 32(1), 59–70. https://doi.org/10.18359/rcin.5644
- Core: Python 3.10+
- Machine Learning: Scikit-Learn, Pandas, NumPy
- Web Framework: Flask (Backend), Jinja2
- Frontend: HTML5, TailwindCSS, Chart.js
- MLOps: Joblib for model serialization
Model:
Random Forest Regressor
n_estimators = 150max_depth = 15
- R² Score: > 0.95 (test set)
- MAE: ± 0.005
Based on data-driven optimization, the system reaches ~89% product purity under the following operating conditions:
| Parameter | Value | Unit |
|---|---|---|
| Reflux Flow (L) | 1040.0 | kmol/h |
| Feed Flow (F) | 650.0 | kmol/h |
| Vapor Flow (V) | 1300.0 | kmol/h |
| Distillate (D) | 260.0 | kmol/h |
| Bottoms (B) | 390.0 | kmol/h |
| Bottom Temperature (T14) | 360.0 | K |
| Top Temperature (T2) | 350.8 | K |
📌 Note:
These conditions represent the Golden Batch, indicating maximum efficiency and optimal purity according to the trained model.
distillation-column-monitor-mlops/
├── data/
│ ├── raw/ # Original CSV data (distillation_data.csv)
│ └── processed/ # Cleaned data for training
├── models/
│ └── final/ # Trained model artifacts (.pkl)
├── src/
│ ├── templates/ # HTML Frontend (index.html)
│ ├── app.py # Flask Application Entry Point
│ ├── config.py # Configuration settings
│ ├── data_prep.py # Data Cleaning & Feature Engineering
│ ├── inference.py # Prediction & Business Logic
│ └── train.py # Model Training Script
├── requirements.txt # Project Dependencies
└── README.md- Clone the Repository Bash
git clone https://github.com/Kochipek/Distillation-Column-Soft-Sensor-mlops.git
cd Distillation-Column-Soft-Sensor-mlopsIt is recommended to use a virtual environment to manage dependencies.
macOS / Linux:
python3 -m venv venv
source venv/bin/activateWindows:
python -m venv venv
venv\Scripts\activatepip install -r requirements.txtpython src/data_prep.py
python src/train.pypython src/app.py