Reproduction of paper: "Remaining Useful Life Prediction Method for Turbofan Engines Based on Graph Neural Networks"
IEEE Sensors Journal, Vol. 25, No. 8, 15 April 2025
This repository implements the Adaptive Dynamic Fusion Graph (ADFG) neural network for predicting the Remaining Useful Life (RUL) of turbofan engines using the NASA C-MAPSS dataset.
- Multi-Scale CNN (MSCNN): Extracts multi-level hidden features from sensor data
- Dynamic Graph Construction: Builds KNN-based adjacency matrices with Graph Autoencoder
- Adaptive Fusion Mechanism: GRU-like fusion of prior knowledge and dynamic similarity graphs
- Graph Attention Network (GAT): Aggregates spatial features across sensors
- Temporal Attention + BiGRU: Captures temporal dependencies in sequences
Paper-Reproduction/
├── src/ # Source code
│ ├── configs/ # Configuration files
│ │ └── default.yaml
│ ├── data/ # Data processing
│ │ ├── cmapss_loader.py # Data loading
│ │ ├── normalization.py # Normalization strategies
│ │ └── dataset.py # PyTorch Dataset
│ ├── models/ # Model components
│ │ ├── mscnn.py # Multi-scale CNN
│ │ ├── graph_builder.py # Dynamic graph (KNN + GAE)
│ │ ├── adaptive_fusion.py# Adaptive fusion module
│ │ ├── gat.py # Graph attention layer
│ │ ├── temporal.py # Temporal attention + BiGRU
│ │ └── adfg.py # Full ADFG model
│ ├── utils/ # Utilities
│ │ ├── metrics.py # RMSE & NASA Score
│ │ ├── logger.py # Experiment logging
│ │ └── seed.py # Random seed & device
│ ├── trainer.py # Training loop
│ └── run.py # Main entry point
├── examples/ # Example scripts
│ ├── run_fd001.py # Quick start for FD001
│ ├── run_all_datasets.py # Run all 4 datasets
│ └── tune_fd001_fd003.py # Hyperparameter tuning
├── experiments/ # Experiment logs (auto-generated)
├── demo/ # Reference implementation
├── paper/ # Original paper PDF
├── requirements.txt
└── README.md
git clone https://github.com/YOUR_USERNAME/Paper-Reproduction.git
cd Paper-Reproduction# Using venv
python -m venv venv
source venv/bin/activate # Linux/macOS
# venv\Scripts\activate # Windows
# Or using conda
conda create -n adfg python=3.10
conda activate adfgpip install -r requirements.txtThis project uses the NASA C-MAPSS (Commercial Modular Aero-Propulsion System Simulation) dataset.
Download from Kaggle: NASA C-MAPSS Dataset
After downloading, extract and place the files:
mkdir -p CMAPSSData
# Extract downloaded archive to CMAPSSData/
# Should contain: train_FD00*.txt, test_FD00*.txt, RUL_FD00*.txt| Subset | Train Engines | Test Engines | Operating Conditions | Fault Modes |
|---|---|---|---|---|
| FD001 | 100 | 100 | 1 | 1 (HPC) |
| FD002 | 260 | 259 | 6 | 1 (HPC) |
| FD003 | 100 | 100 | 1 | 2 (HPC+Fan) |
| FD004 | 249 | 248 | 6 | 2 (HPC+Fan) |
python examples/run_fd001.pypython examples/run_all_datasets.py# Default configuration
python -m src.run --fd FD001
# Custom parameters
python -m src.run --fd FD003 --epochs 100 --lr 0.001 --exp-name my_experiment
# Using config file
python -m src.run --config src/configs/custom.yamlInput: Sensor time series (B, T, N, S)
│
┌───────────────▼───────────────┐
│ MSCNN (Multi-Scale CNN) │
│ kernels: [1, 3, 5, 7] │
└───────────────┬───────────────┘
│ (B, T, N, F)
┌───────────────▼───────────────┐
│ Dynamic Graph Construction │
│ KNN + Graph Autoencoder │
└───────────────┬───────────────┘
│
┌───────────────▼───────────────┐
│ Adaptive Fusion (GRU-like) │
│ A''' = Z⊙H + (1-Z)⊙A' │
└───────────────┬───────────────┘
│
┌───────────────▼───────────────┐
│ Graph Attention Network │
│ Multi-head attention │
└───────────────┬───────────────┘
│ (B, T, N, F')
┌───────────────▼───────────────┐
│ Temporal Attention + BiGRU │
│ Sequence modeling │
└───────────────┬───────────────┘
│
▼
Output: RUL (B,)
The adaptive fusion module (Equations 5-9 in the paper) combines prior knowledge graph and dynamic similarity graph:
Δ = ||A' - A''||_F # (5) Frobenius norm
Z_t = σ(W_Z · Δ + B_1) # (6) Update gate
R_t = σ(W_R · Δ + B_2) # (7) Reset gate
H_t = tanh(W_H · A'' + W'_H · R_t + B_3) # (8) Candidate state
A''' = Z_t ⊙ H_t + (1 - Z_t) ⊙ A' # (9) Fused output
Note:
W_HandW'_Hare independent learnable parameter matrices.
Each experiment automatically creates a folder in experiments/ containing:
| File | Description |
|---|---|
config.yaml |
Experiment configuration |
metrics.csv |
Training metrics per epoch |
best_model.pt |
Best model checkpoint |
history.json |
Complete training history |
summary.txt |
Runtime logs |
report.txt |
Final experiment report |
| Dataset | Target RMSE | Target Score |
|---|---|---|
| FD001 | 10-11 | ~200 |
| FD002 | ~13 | ~500 |
| FD003 | 10-11 | ~250 |
| FD004 | ~14 | ~600 |
window_size: 30-40 # Larger window
seq_len: 10-15 # Sequence length
k: 5-7 # KNN neighbors
epochs: 80-100 # More epochs
scheduler:
enabled: true
type: cosinewindow_size: 15-20 # Smaller window
k: 8-10 # More KNN neighbors
normalization: cond_zscore # Condition-based normalization (default)python examples/tune_fd001_fd003.pytorch>=2.0.0
numpy>=1.21.0
pandas>=1.3.0
scikit-learn>=1.0.0
pyyaml>=6.0
tqdm>=4.62.0
@article{cao2025remaining,
title={Remaining Useful Life Prediction Method for Turbofan Engines
Based on Graph Neural Networks},
author={Cao, Xiangang and Cheng, Boyang and Yang, Xin and
Duan, Yong and Gao, Jiajun},
journal={IEEE Sensors Journal},
volume={25},
number={8},
year={2025},
publisher={IEEE}
}This project is licensed under the MIT License - see the LICENSE file for details.
- NASA for the C-MAPSS dataset
- Original paper authors for the ADFG architecture