IoT Oil Production Verification
ML Engineer (Research)
About the Project
This is doctoral research on verifying reported oil production using machine learning, built as an IoT-ML-cloud framework. The system predicts net oil production in barrels per day from IoT sensor readings across four Nigerian oil stations. The framing matters: this is not forecasting for planning purposes, it is verification — the model's prediction is compared against reported figures so that discrepancies can be flagged for investigation. It spans nine notebooks, a trained model registry, and a FastAPI service that exposes the models for station-level querying.
What It's Made Of
Notebook pipeline
9 notebooks · ingestion to SHAP
The research spine, in sequence: ingestion, exploratory analysis, feature engineering, baselines, tree models, classification, recurrent models, evaluation, and SHAP explainability. Kept as ordered notebooks rather than a single script so each stage's output and reasoning is inspectable by an examiner, which is a requirement of the work and not a convenience.
Feature engineering & leakage control
Lagged features · four stations
Where the result is won or lost. Sensor data has many features correlated with the target at the same timestamp, so inputs are lagged deliberately to stop the model reading the answer from a same-timestamp reading. This is also where the cross-station split lives: three Cawthorne stations for training, Alakiri held out entirely.
Model registry
XGBoost vs LSTM/GRU · SHAP
Trained models saved for comparison rather than overwritten, so gradient-boosted trees can be scored head-to-head against LSTM and GRU recurrent networks to test whether sequence modelling earns its added complexity. SHAP attributions are stored alongside, because the output is used to question a reported number and must be defensible per-prediction.
Serving API
FastAPI · Alembic · tests
A FastAPI service exposing the trained models for station-level querying, with Alembic migrations and a test suite, so verification can be run against new readings rather than only inside a notebook. A Next.js frontend for station-level visualisation is the planned next piece.
Key Highlights
- Trained on three Cawthorne stations and held out Alakiri entirely, testing whether the model generalizes to a station it has never seen
- Built a nine-notebook pipeline: ingestion, EDA, feature engineering, baselines, tree models, classification, RNN, evaluation, and SHAP explainability
- Controlled for target leakage by lagging features, so the model cannot read the answer from a same-timestamp reading
- Compared gradient-boosted trees against LSTM/GRU recurrent networks to test whether sequence modelling earned its added complexity
- Used SHAP to attribute predictions to specific sensor readings — necessary when the output is used to question a reported number
- Wrapped the models in a FastAPI service with Alembic migrations and tests, with a Next.js frontend planned for station-level visualization
Technical Challenges
Cross-station generalization was the honest hard test. A model trained and validated on the same stations scores well and tells you nothing about whether it works at a new site, so holding out Alakiri entirely was the only result worth reporting. Leakage was the other constant risk — sensor data has many features correlated with the target at the same timestamp, so lagging inputs was essential to avoid a model that looks excellent and has learned nothing useful.