AeroGuard
Can we see an aircraft engine failure coming before it happens?
A predictive maintenance system for aircraft engines, built end to end on NASA's N-CMAPSS data: GPU features, an XGBoost + autoencoder pair that also spots never-seen failures, a decision engine (OK, WATCH, URGENT), a live API and the MLOps chain. On 39 test engines never seen before: all 39 failures warned, about 40 flights ahead.
- My role
- Personal project, end to end: data, models, API, deployment and MLOps
- Platforms
- AI, Web
- Stack
- Python
- XGBoost
- TensorFlow
- Deep learning
- RAPIDS cuDF
- Scikit-learn
- SHAP
- Optuna
- MLflow
- ONNX
- NVIDIA Triton
- FastAPI
- Streamlit
- Docker
- GitHub Actions
- pytest
- Hugging Face
- pandas
- NumPy
- Matplotlib
- Machine learning
Situation
39 / 39test engines, never seen before, warned about 40 flights before failure
An aircraft engine wears out slowly, flight after flight, and an unexpected failure grounds the aircraft: it costs far more than a planned repair. AeroGuard watches each engine after every flight through 14 sensors (temperatures, pressures, shaft speeds, fuel flow) and compares what it sees with how a healthy engine behaves.
Sensors along the engine (P = pressure, T = temperature, N = shaft speed, Wf = fuel flow). P21, P15, T48 and T50 carry most of the wear signal.
The data: NASA’s N-CMAPSS dataset, 99 simulated turbofan engines flying real flight profiles: 9 files, 7 failure families, 7,473 flights, reduced to 126 features per flight.
Each line is one engine: T48 stays flat, then takes off in the last 30 to 40 flights. The whole point: spot that take-off as early as possible.
Three goals: detect the onset of a failure as early as possible, identify the affected component, and spot failures never seen in training.
Personal project, built end to end and documented version by version, from a simple statistical detector (v0) to the deployed application (v7).
Product
After every flight, AeroGuard answers a single question: what should the maintenance team do?
- OK: nothing to report.
- WATCH: an early or isolated sign, the engine should be watched.
- URGENT: wear confirmed, plan an inspection, with the sensors to check first (for instance T48 and T50).
What it offers:
- A live API (FastAPI): send a flight, get the decision. The fleet is sorted by urgency and each engine keeps its history.
- A dashboard (Streamlit): the state of the whole fleet, each engine’s history and the system’s health (version, inference mode, data drift).
- Try it yourself: the Colab notebook sends a real NASA test engine, never seen in training, flight by flight to the live API. The decision moves from OK to WATCH to URGENT: on this engine, the alert is confirmed 46 flights before failure, with T48, T50 and P24 as the sensors to inspect.
Fig. 01 The dashboard: the most urgent engines first and, for each one, the wear probability and the autoencoder error, flight after flight.
System
- GPU-accelerated data (NVIDIA RAPIDS cuDF): reading the NASA files, residuals against a healthy engine, then 126 features per flight and per phase (climb, cruise). Up to ×19.5 faster than pandas.
- Two complementary models: XGBoost on GPU for known wear (training ×4.3 faster than on CPU), and a TensorFlow autoencoder trained on healthy flights only, for anything out of the ordinary.
- A decision engine that turns both signals into OK, WATCH or URGENT, with the sensors involved.
- A FastAPI API with three interchangeable inference modes: ONNX Runtime (about 5 ms median), NVIDIA Triton (×5 throughput under load) or local Keras. The API’s decisions match the notebook’s exactly (76 / 76).
- MLOps: MLflow model registry (the production model is loaded by its
@championalias), GitHub Actions CI/CD (Ruff, 361 tests, Docker image scanned with Trivy, published then deployed on Render), JSON logs and data-drift monitoring (PSI) with an automatic weekly report.
One request, end to end
Model & data
From simplest to strongest
Every model is judged on engines never seen before, with a leak-free split by engine: 49 for training, 11 for validation, 39 for the final test, opened only once.
| Version | Model | On the 39 test engines |
|---|---|---|
| v2 | Logistic regression | 39 / 39 warned, 54 false alarms |
| v3 | XGBoost on GPU | 39 / 39, about 40 flights ahead, 28 false alarms; component identified for 37 / 39 |
| v4 | Dense network, 1D CNN | behind XGBoost (F1 0.823 and 0.743 versus 0.852) |
| v5 | XGBoost + autoencoder hybrid | 39 / 39, 40.8 flights ahead, and it spots never-seen failures |
The never-seen failure
A supervised model only recognises what it has learned: without any “fan” engine in training, XGBoost warns only 2 out of 4. The autoencoder, trained on healthy flights and compared with the first 10 flights of each engine, warns them all: 4 / 4.
One failure family is removed from training each time: left, engines warned (higher is better); right, false alarms. Blue: XGBoost alone, orange: the hybrid. Figure labels are in French.
Explaining every alert
Each XGBoost decision is broken down sensor by sensor with SHAP, computed on GPU (×11.7). The temperatures around the turbines, T50 and T48 during climb, trigger the alert: the physical signature of a worn turbine.
The decision engine
Three test engines, flight after flight: wear probability and the decided level (green OK, orange WATCH, red URGENT). Time moves to the right, 0 = failure.
What didn’t work, and why it helps
- A GAN to create rare-failure flights: it reproduces each feature but breaks physics, and a simple classifier spots 100% of its fake flights. Neither the GAN nor SMOTE brings a proven gain: the production model stays in place.
- The 1D CNN on raw signals matches XGBoost on turbines but misses the fan. With 49 training engines, good physical features beat deep learning.
Limitations
- The component diagnosis is probably optimistic: SHAP showed part of it relies on P2, a sensor that reveals the NASA file rather than the failure.
- Engine history lives in the API’s memory: it is lost when the free server restarts.