Machine learning framework for predicting organic deposition and crude oil sludge formation in multiphase pipeline networks.
\# Predictive Modeling of Crude Oil Sludge \& Paraffin Deposition in Niger Delta Flowlines
!\Python
!\Machine Learning
!\Status
\## 📌 Executive Overview
This repository contains a quantitative machine learning framework designed to predict organic sludge buildup, wax precipitation, and asphaltene deposition rates in multiphase subsea pipelines across Niger Delta oil fields.
By integrating thermodynamic fluid parameters, Colloidal Instability Indices (CII), and operational shear conditions, this model provides predictive flow assurance intelligence to minimize costly pigging operations and flow blockages.
\---
\## ⚙️ Core Modeling Architecture
\### 1. Thermodynamic \& Chemical Parameterization
\* \*\*SARA Fractions Analysis:\*\* Dynamic tracking of Saturates, Aromatics, Resins, and Asphaltenes (wt%).
\* \*\*Colloidal Instability Index (CII):\*\* Mathematically formulated as:
$$\\text{CII} = \\frac{\\text{Saturates (wt\\%)} + \\text{Asphaltenes (wt\\%)}}{\\text{Aromatics (wt\\%)} + \\text{Resins (wt\\%)}}$$
\* \*\*Operating Variables:\*\* Pipe wall subsea temperature gradients ($15^\\circ\\text{C} - 85^\\circ\\text{C}$), operating line pressure, and shear rate dynamics ($50 - 800\\text{ s}^{-1}$).
\### 2. Machine Learning Implementations
\* \*\*Ensemble Regressors:\*\* Random Forest Regressor and Gradient Boosting Machine (GBM).
\* \*\*Validation:\*\* 5-Fold Cross-Validation and 80/20 train-test partitioning with standardized scaling.
\---
\## 📊 Benchmark Results
| Model Architecture | $R^2$ Score | Mean Absolute Error (MAE) | Root Mean Squared Error (RMSE) |
| :--- | :--- | :--- | :--- |
| \*\*Gradient Boosting Regressor\*\* | \*\*0.962\*\* | \*\*0.184 g/m²·day\*\* | \*\*0.241 g/m²·day\*\* |
| \*\*Random Forest Regressor\*\* | \*\*0.948\*\* | \*\*0.211 g/m²·day\*\* | \*\*0.283 g/m²·day\*\* |
\### Top Predictive Feature Importance
1\. `temp\_celsius` (Thermal subsea gradient below Wax Appearance Temperat …