Federated learning provides a natural framework for Remaining Useful Life (RUL) estimation when run-to-failure data are distributed across organizations. Its practical use is nevertheless complicated by client heterogeneity, scarce local data, and the unequal consequences of prediction errors: overestimating RUL can postpone maintenance beyond failure, while conventional federated objectives penalize early and late predictions symmetrically.
FLARE (Federated Learning with Anticipation-aware REcovery) is a backbone-agnostic method that uses each client's signed validation error to reduce the influence of late-biased updates and selectively activate an anticipation-aware recovery objective. This encourages safer global predictions while adding negligible communication and computational overhead over FedAvg. Across the benchmark tasks, FLARE provides the most consistent behavior; its LSTM instantiation achieves the best average rank on both RMSE and NASA Score.
| Path | Contents |
|---|---|
system/main.py |
Experiment CLI and algorithm selection |
system/config/best_args.yaml |
Configurations selected in Tables A4, A5, and A6 |
system/flcore/datasets/ |
C-MAPSS windows, scaling, RMSE, and NASA score |
system/flcore/trainmodel/ |
Paper architectures and Chronos-Bolt+LoRA adapter |
system/flcore/clients/, servers/ |
Federated training implementations |
dataset/FedCMAPSS/tasks.json |
Versioned tasks A--E and ten fixed splits |
private/fedcmapss_dataset_create.py |
Raw C-MAPSS preprocessing |
Plotting scripts, sweeps, sweep results, test utilities, trained model
checkpoints, and the original PFLlib classification benchmark are deliberately
excluded. A run writes only its metric history and configuration to
metrics.json below the selected --results-root.
Supported paper methods are FedAvg_RUL, FedProx_RUL, FedDyn_RUL,
FedCross_RUL, SCAFFOLD_RUL, FLARE_RUL, PEFT_RUL, FedMA_RUL,
FedPer_RUL, GHDR_FL_RUL, FedLabSync_RUL, and FedCov_RUL.
Python 3.10 or 3.11 is recommended.
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txtGPU execution is selected by default and falls back to CPU when CUDA is not
available. Pass --device cpu to select CPU explicitly.
To evaluate FLARE under realistic conditions, we introduce FedCMAPSSv2, an extension of the FedCMAPSS benchmark built on NASA C-MAPSS. FedCMAPSS defines five reproducible federated scenarios, from an IID baseline to domain, label, and feature skew and an extreme few-shot setting. FedCMAPSSv2 retains these scenarios while introducing fixed, client-level validation partitions for principled model and hyperparameter selection without test leakage. It also revises the few-shot setting (Task E) to use 40 clients, each with one training trajectory and a distinct validation trajectory.
Across the five tasks, this repository compares established federated
optimizers, RUL-specific approaches, conventional neural architectures, and a
LoRA-adapted time-series foundation model. The tracked
dataset/FedCMAPSS/tasks.json contains the exact FedCMAPSSv2 assignments and
supersedes the splits released with the original FedCMAPSS paper.
Experiments expect this layout:
dataset/FedCMAPSS/
├── cmapss_processed_train_data.csv
├── cmapss_processed_test_data.csv
└── tasks.json
tasks.json is tracked by Git. The two processed CSV files are local because
together they are about 45 MB. Download the official NASA C-MAPSS archive and
generate them from the repository root:
mkdir -p /tmp/flare-cmapss private/dataset dataset/FedCMAPSS
curl -L \
"https://phm-datasets.s3.amazonaws.com/NASA/6.+Turbofan+Engine+Degradation+Simulation+Data+Set.zip" \
-o /tmp/flare-cmapss/nasa-cmapss.zip
unzip -j -o /tmp/flare-cmapss/nasa-cmapss.zip \
-d /tmp/flare-cmapss
unzip -j -o /tmp/flare-cmapss/CMAPSSData.zip \
-d private/dataset
python private/fedcmapss_dataset_create.py
cp output/cmapss_processed_train_data.csv \
output/cmapss_processed_test_data.csv \
dataset/FedCMAPSS/The archive is published by the NASA Prognostics Center of
Excellence.
The preprocessing script also creates output/tasks.json; use the tracked
file for the exact FedCMAPSSv2 partitions used in the FLARE experiments.
Tasks are A, B, C, D, and E; each has splits 0 through 9. Select
them with --task and --split.
This command runs the Task A, split 0 FedAvg+LSTM configuration selected for the paper:
python system/main.py \
--dataset FedCMAPSSWindow \
--data_root dataset/FedCMAPSS/ \
--task A \
--split 0 \
--model LSTM_RUL \
--algorithm FedAvg_RUL \
--best_args \
--global_rounds 100 \
--eval_gap 10 \
--results-root results--best_args loads the entry at
algorithm -> task -> model from system/config/best_args.yaml. Explicit CLI
arguments take precedence over YAML values. For example, Arunan et al. on Task
B resolves FedMA_RUL/B/LSTM_RUL, which supplies learning rate 0.005 and
five local epochs:
python system/main.py \
--task B --split 0 \
--model LSTM_RUL \
--algorithm FedMA_RUL \
--best_argsUse --dry-run to load the dataset, instantiate the model, server, and all
clients, and validate a configuration without training:
python system/main.py \
--task A --split 0 \
--model Chen_CNN_RUL \
--algorithm FLARE_RUL \
--best_args --dry-runReported metrics are normalized MSE, RMSE in cycles, and the cumulative asymmetric NASA score. Lower is better for all three.
Tables A4 uses LSTM_RUL and Chen_CNN_RUL with FedAvg, FedProx, FedDyn,
FedCross, SCAFFOLD, and FLARE. Table A5 uses PEFT_TS_RUL, a
Chronos-Bolt-small backbone with LoRA, with PEFT_RUL (FedAvg) and
FLARE_RUL.
Table A6 labels map to an architecture and a method as follows:
| Table A6 label | --model |
--algorithm |
YAML entry |
|---|---|---|---|
| Arunan et al. | LSTM_RUL |
FedMA_RUL |
FedMA_RUL/<TASK>/LSTM_RUL |
| Chen et al. | RNN_RUL |
FedAvg_RUL |
FedAvg_RUL/<TASK>/RNN_RUL |
| S.V. et al. → FedAvg | MLP_LSTM_MLP_RUL |
FedAvg_RUL |
FedAvg_RUL/<TASK>/MLP_LSTM_MLP_RUL |
| S.V. et al. → FedPer | MLP_LSTM_MLP_RUL |
FedPer_RUL |
FedPer_RUL/<TASK>/MLP_LSTM_MLP_RUL |
| GHDR | GHDR_RUL |
GHDR_FL_RUL |
GHDR_FL_RUL/<TASK>/GHDR_RUL |
| FedLabSync | RNN_RUL |
FedLabSync_RUL |
FedLabSync_RUL/<TASK>/RNN_RUL |
| FedCov | FedCovNet_RUL |
FedCov_RUL |
FedCov_RUL/<TASK>/FedCovNet_RUL |
| Barbosa et al. | LSTM_v2_RUL |
FedAvg_RUL |
FedAvg_RUL/<TASK>/LSTM_v2_RUL |
Table A6 has no FedLabSync result for Task C, so that YAML entry is
intentionally absent. --best_args reports an error for unsupported
combinations instead of silently choosing other values. A task-specific entry
is shared by all ten splits; the split is not part of the YAML lookup.
FLARE performs soft trust-weighted aggregation and client recovery with a proximal objective. Its selected settings are:
flare_asym_late(lambda_latein the paper), the late-prediction penalty;flare_prox_mu(mu), the recovery proximity coefficient;flare_trust_alpha(alpha), the soft trust sharpness.
python system/main.py \
--task C --split 0 \
--model LSTM_RUL \
--algorithm FLARE_RUL \
--best_args \
--global_rounds 100For the Chronos+LoRA variant from Table A5, change the model:
python system/main.py \
--task C --split 0 \
--model PEFT_TS_RUL \
--algorithm FLARE_RUL \
--best_args \
--global_rounds 100The first Chronos execution downloads the pretrained
amazon/chronos-bolt-small weights through the chronos-forecasting package.
- The default seed is
0; use--seedto change it. - Keep
dataset/FedCMAPSS/tasks.jsonunchanged for the published partitions. - Use
--best_argsfor the selected table configuration and pass the desired--global_roundsexplicitly. - Run outputs are ignored by Git. Preserve the resulting
metrics.jsonseparately when collecting final results. - Weights & Biases logging is optional through
--wandb-log; it is not needed to run the experiments.
FLARE derives its federated training structure from PFLlib. See LICENSE for the repository license.
