An open API service indexing awesome lists of open source software.

https://github.com/aun151214/predictive-maintenance-cmapss

Predictive Maintenance on NASA C-MAPSS dataset using LSTM, GRU, and Transformer architectures.
https://github.com/aun151214/predictive-maintenance-cmapss

cmapss deep-learning gru keras lstm machine-learning predictive-maintenance tensorflow transformer turbofan

Last synced: 27 days ago
JSON representation

Predictive Maintenance on NASA C-MAPSS dataset using LSTM, GRU, and Transformer architectures.

Awesome Lists containing this project

README

          

πŸ”§ Predictive Maintenance with NASA C-MAPSS Dataset

![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
![Python](https://img.shields.io/badge/python-3.11-blue.svg) ![TensorFlow](https://img.shields.io/badge/TensorFlow-2.x-orange.svg) ![scikit-learn](https://img.shields.io/badge/scikit--learn-1.3-green.svg) ![Status](https://img.shields.io/badge/Status-Completed-brightgreen.svg)

This project implements predictive maintenance using the NASA C-MAPSS Turbofan Engine Degradation Datasets (FD001–FD004).
The goal is to predict the Remaining Useful Life (RUL) of engines before failure.

We benchmark multiple models, from classical ML to deep learning (LSTM, GRU, Transformer).

πŸ“‚ Project Structure
predictive-maintenance-cmapss/
β”‚
β”œβ”€β”€ data/
β”‚ β”œβ”€β”€ raw/ # Original C-MAPSS dataset (train/test/RUL txt files)
β”‚ └── processed/ # Preprocessed pickles (.pkl) generated by preprocessing
β”‚
β”œβ”€β”€ models/ # Saved trained models (.keras)
β”œβ”€β”€ results/ # Model evaluation outputs (CSV, plots, reports)
β”‚ β”œβ”€β”€ final_report.pdf # Auto-generated summary report
β”‚ └── final_report.md # Markdown summary of results
β”‚
β”œβ”€β”€ notebooks/ # Jupyter notebooks for exploration
β”‚ β”œβ”€β”€ 01_exploration.ipynb
β”‚ β”œβ”€β”€ 02_preprocessing.ipynb
β”‚ β”œβ”€β”€ 03_baseline_models.ipynb
β”‚ β”œβ”€β”€ 04_deep_learning_models.ipynb
β”‚ β”œβ”€β”€ 05_other_dl_models.ipynb
β”‚ └── 07_transformer_fd001.ipynb
β”‚
β”œβ”€β”€ src/ # Training, evaluation, preprocessing scripts
β”‚ β”œβ”€β”€ 02_preprocessing.py
β”‚ β”œβ”€β”€ train.py
β”‚ β”œβ”€β”€ evaluate.py
β”‚ β”œβ”€β”€ aggregate_results.py
β”‚ └── utils.py
β”‚
β”œβ”€β”€ run_all.bat # Full automation: preprocess β†’ train β†’ evaluate β†’ report
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .gitignore
└── README.md

πŸ“Š Results

Performance is reported across all four subsets (FD001–FD004):

| Model | Dataset | RMSE | MAE | RΒ² |
| ----------- | ------- | ------ | ----- | ------ |
| LSTM | FD001 | 63.61 | 50.67 | -0.358 |
| LSTM | FD002 | 68.73 | 54.47 | -0.339 |
| LSTM | FD003 | 87.25 | 63.52 | -0.162 |
| LSTM | FD004 | 102.05 | 76.52 | -0.311 |
| GRU | FD001 | 63.62 | 50.67 | -0.358 |
| GRU | FD002 | 68.37 | 54.17 | -0.325 |
| GRU | FD003 | 87.21 | 63.49 | -0.161 |
| GRU | FD004 | 102.11 | 76.57 | -0.313 |
| Transformer | FD001 | 47.59 | 36.94 | 0.240 |
| Transformer | FD002 | 52.94 | 41.11 | 0.206 |
| Transformer | FD003 | 69.67 | 53.07 | 0.259 |
| Transformer | FD004 | 80.61 | 59.30 | 0.182 |

πŸ“„ See the final_report.pdf for full details with tables & charts.

πŸ“₯ Dataset Setup

The dataset comes from NASA’s C-MAPSS Turbofan Engine Degradation Simulation.

πŸ”— Download here: NASA Prognostics Data Repository

After downloading:

Extract files into data/raw/

data/raw/
β”œβ”€β”€ train_FD001.txt
β”œβ”€β”€ test_FD001.txt
β”œβ”€β”€ RUL_FD001.txt
β”œβ”€β”€ train_FD002.txt
β”œβ”€β”€ ...

Run preprocessing:

python src/02_preprocessing.py

This will generate .pkl files under data/processed/.

βš™οΈ Installation
# Clone repo
git clone https://github.com/aun151214/predictive-maintenance-cmapss.git
cd predictive-maintenance-cmapss

# Create environment
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Linux/Mac

# Install dependencies
pip install -r requirements.txt

πŸš€ Usage
πŸ”Ή Train a Model
python src/train.py --model lstm --dataset FD001 --epochs 100 --batch_size 64
python src/train.py --model gru --dataset FD002 --epochs 100
python src/train.py --model transformer --dataset FD004 --epochs 100

πŸ”Ή Evaluate a Model
python src/evaluate.py --model lstm --dataset FD001

πŸ”Ή Run Full Pipeline (all models, all datasets, auto-report)
.\run_all.bat

This will:

Preprocess datasets

Train & evaluate all models on FD001–FD004

Save trained models in models/

Save results in results/

Auto-generate final_report.pdf & final_report.md

πŸ“ˆ Key Insights

Transformer performed best overall on FD001–FD004 (positive RΒ²).

LSTM and GRU underperformed on FD002–FD004 in this run, suggesting tuning/data augmentation needed.

Pipeline is fully automated β†’ reproducible for any new dataset.

πŸ“œ License

This project is released under the MIT License.