🔧 Predictive Maintenance with NASA C-MAPSS Dataset
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
git clone https://github.com/aun151214/predictive-maintenance-cmapss.git cd predictive-maintenance-cmapss
python -m venv .venv .venv\Scripts\activate # Windows
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.