MEQuest
Module 7Unit 4 of 57 min

Model Deployment & MLOps

Building an ML model in a Jupyter notebook is only the beginning. MLOps (Machine Learning Operations) is the set of practices that takes a model from prototype to production - and keeps it running reliably. Most failed ML projects in oil and gas fail not because the model was bad, but because deployment and maintenance were underestimated.

The MLOps Lifecycle

1

Experiment Tracking

Log every experiment - datasets used, hyperparameters, metrics, model versions. Tools: MLflow, Weights & Biases, Azure ML Experiments.

2

Model Registry

Store versioned models in a central registry with metadata (training date, accuracy, author). Enables rollback if a new model underperforms.

3

CI/CD Pipelines

Automate testing, validation, and deployment. When a new model is registered and approved, the pipeline automatically deploys it to the production environment.

4

Serving Infrastructure

Deploy models as REST APIs, batch scoring jobs, or edge models. The choice depends on latency requirements - real-time predictions vs overnight batch runs.

5

Monitoring & Retraining

Monitor prediction accuracy, input data distributions, and latency. When performance degrades (model drift), trigger retraining on updated data.

Model Drift in Oil & Gas

Model drift occurs when the statistical properties of the input data change over time, causing the model's predictions to become less accurate. In oil and gas, drift is common because reservoirs and equipment change.

Data Drift

Input distributions change: water cut increases, reservoir pressure declines, new wells with different characteristics come online.

Concept Drift

The relationship between inputs and outputs changes: a workover alters the well's behaviour, a new completion design changes flow dynamics.

Example: An ESP failure prediction model was trained on 3 years of data from 200 wells with conventional completions. When the operator drilled 30 new wells with multi-lateral completions, the model's false alarm rate tripled because the vibration signatures were fundamentally different. The model needed retraining with data from the new completion type to restore accuracy.

Plan for maintenance from day one
Budget and plan for ongoing model maintenance when scoping any ML project. A model that is deployed without a monitoring and retraining strategy will degrade over time and eventually become worse than no model at all. Allocate at least 20-30% of the project effort to MLOps.