# Aggregation Strategy on Federated Machine Learning Algorithm for Collaborative Predictive Maintenance

^{*}

^{†}

## Abstract

**:**

## 1. Introduction

#### 1.1. Motivation

#### 1.2. Contributions

- This work proposes two federated models (FedSVM and FedLSTM) for collaborative PM, which provide a distributed model at FL edge devices. A communication graph describes the communication between the edge devices and the local server in each factory. This is achieved by activating these models in asynchronous mode. The server does not need to wait to collect parameters and can perform with comparable results to a centralized algorithm.
- FedSVM utilizes a federated support vector machine (SVM) model in each edge device to classify PM strategies. It could predict labels that mentioned the need to do maintenance for one asset as an edge device at the cloud level without violating privacy. In preprocessing of the data before they are fed to the model, a moving average strategy has been implemented, which causes FedSVM to use a kind of memory inside its process. This federated method is reliable and fast enough for online applications such as PM.
- FedLSTM utilizes a federated long short term memory (LSTM) model in each edge device to predict the absolute values of an asset’s RUL. This method is useful for learning from sequence data in each edge device. By applying the moving average strategy, the number of consecutive blocks in FedLSTM is reduced compared to without it, which significantly affects the training time of the model at the fog level.
- These methods ensure that edge devices only exchange model parameters with the fog servers and the fog servers send them to the cloud server for aggregation. As well as they help speed up the local model convergence time because edge devices are sometimes unable to quickly and instantly access the cloud server, leading to delays in exchanging model updates.
- FedSVM and FedLSTM are evaluated against a case study of RUL prediction for CMAPSS in a simulated collaborative PM. CMAPSS is a very well-known and benchmark dataset in RUL prediction. The results of these federal methods are compared with centralized approaches to model performance, communication resource utilization, and model convergence time.

## 2. Related Work

#### 2.1. Machine Learning at the Edge, Fog, and Cloud Levels

#### 2.2. DML for Collaborative PM

## 3. System Model

#### 3.1. Network Model

#### 3.2. Federated Learning Process

- Broadcasting from cloud server: Cloud server broadcasts the global model parameter ${w}_{cloud}^{t}$ to all fog servers through a wireless link in the $t\mathrm{th}$ round.
- Fog updating phase: All fog servers update their model parameters with the received parameters from the cloud.
- Broadcasting from local fog server: Fog servers broadcast the updated model parameters ${w}_{fog,j}^{t}$ to all edge devices located at factory site number j through a wireless link.
- Edge device updating phase: After receiving the fog level model parameter, each edge device $i\in \mathcal{N}$ in factory $j\in \mathcal{M}$ trains its local model by applying E epochs of a kind of optimization algorithms such as SGD and Adam. The iteration for SGD becomes$$\begin{array}{c}\hfill {\mathit{w}}_{i,j}^{t+1}={\mathit{w}}_{i,j}^{t}-\eta \nabla {f}_{i}^{j}\left({\mathit{w}}_{i,j}^{t}\right),\end{array}$$
- Aggregating on fog: After E iterations on the edge devices in each factory, once receiving all the local model parameters, the fog server aggregates them and obtains an updated model, which is known as a synchronous method.$$\begin{array}{c}\hfill {\mathit{w}}_{fog,j}^{t+1}=\sum _{i=1}^{{N}_{j}}\frac{{D}_{i}^{j}}{{D}^{j}}{\mathit{w}}_{i,j}^{t+1},\end{array}$$
- Aggregating on cloud: The model parameter aggregation on the cloud happens once in a while. The number of communication rounds between cloud and fogs is much lower than the number of communication rounds between edge devices and fogs (${T}_{G}<<{T}_{l}^{j}$). Therefore, when the cloud requests an update, a simple averaging with different weights (${A}_{j}$) depending on the size of the factory is performed on all fog parameters$$\begin{array}{c}\hfill {\mathit{w}}_{cloud}^{t+1}=\sum _{j=1}^{M}{A}_{j}{\mathit{w}}_{fog,j}^{t+1},\end{array}$$

Algorithm 1: Federation on the edge, fog, and coud. |

## 4. FedSVM and FedLSTM: Proposed Architecture

#### 4.1. FedSVM

#### 4.2. FedLSTM

## 5. Structure of Performance Evaluation

#### 5.1. Distributing CMAPSS for a Collaborative PM

#### 5.2. Data Preprocessing

#### 5.2.1. Feature Selection

#### 5.2.2. Moving Window Strategy

#### 5.3. Evaluating Metrics

## 6. Experimental Results and Discussion

#### 6.1. FedSVM results

#### 6.2. FedLSTM Results

#### 6.3. Model Aggregation Analysis

- Edge-iid: The training data from labels 1 and 7 are identically distributed between the ten edge devices.
- Edge-non-iid: The training data of label 1 are distributed among edge numbers 1 to 5 under one fog server, and training data of label 7 are distributed among edge numbers 6 to 10 under another fog server.

## 7. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## Abbreviations

PM | Predictive Maintenance |

ML | Machine Learning |

FL | Federated Learning |

SVM | Support Vector Machine |

LSTM | Long Short Term Memory |

FedSVM | Federated Support Vector Machine |

FedLSTM | Federated Long-Short Term Memory |

RUL | Remaining Useful Life |

DML | Distributed Machine Learning |

Non-iid | Not Independent and Identically Distributed |

CNNs | Convolutional Neural Networks |

FSVRG | Federated Stochastic Variance Reduced Gradient |

RNN | Recurrent Neural Network |

RMSE | Root MEan Square Error |

SF | Scoring Factor |

## References

- Manyika, J.; Chui, M.; Bisson, P.; Woetzel, J.; Dobbs, R.; Bughin, J.; Aharon, D. The Internet of Things: Mapping the Value Beyond the Hype; McKinsey Global Institute; McKinsey & Company: Atlanta, GA, USA, 2015. [Google Scholar]
- Mahdavinejad, M.S.; Rezvan, M.; Barekatain, M.; Adibi, P.; Barnaghi, P.; Sheth, A.P. Machine learning for Internet of Things data analysis: A survey. Digit. Commun. Netw.
**2018**, 4, 161–175. [Google Scholar] [CrossRef] - Alli, A.A.; Alam, M.M. The fog cloud of things: A survey on concepts, architecture, standards, tools, and applications. Internet Things
**2020**, 9, 100177. [Google Scholar] [CrossRef] - Firouzi, F.; Farahani, B.; Marinšek, A. The convergence and interplay of edge, fog, and cloud in the AI-driven Internet of Things (IoT). Inf. Syst.
**2021**, 107, 101840. [Google Scholar] [CrossRef] - Aceto, G.; Persico, V.; Pescapé, A. A survey on information and communication technologies for industry 4.0: State-of-the-art, taxonomies, perspectives, and challenges. IEEE Commun. Surv. Tutor.
**2019**, 21, 3467–3501. [Google Scholar] [CrossRef] - Teoh, Y.K.; Gill, S.S.; Parlikad, A.K. IoT and Fog Computing based Predictive Maintenance Model for Effective Asset Management in Industry 4.0 using Machine Learning. IEEE Internet Things J.
**2021**. [Google Scholar] [CrossRef] - De Donno, M.; Tange, K.; Dragoni, N. Foundations and evolution of modern computing paradigms: Cloud, iot, edge, and fog. IEEE Access
**2019**, 7, 150936–150948. [Google Scholar] [CrossRef] - Zeng, Q.; Du, Y.; Huang, K.; Leung, K.K. Energy-efficient radio resource allocation for federated edge learning. In Proceedings of the 2020 IEEE International Conference on Communications Workshops (ICC Workshops), Dublin, Ireland, 7–11 June 2020; pp. 1–6. [Google Scholar]
- Konečný, J.; McMahan, B.; Ramage, D. Federated optimization: Distributed optimization beyond the datacenter. arXiv
**2015**, arXiv:1511.03575. [Google Scholar] - Zhu, H.; Xu, J.; Liu, S.; Jin, Y. Federated Learning on Non-IID Data: A Survey. arXiv
**2021**, arXiv:2106.06843. [Google Scholar] [CrossRef] - Aledhari, M.; Razzak, R.; Parizi, R.M.; Saeed, F. Federated learning: A survey on enabling technologies, protocols, and applications. IEEE Access
**2020**, 8, 140699–140725. [Google Scholar] [CrossRef] - Yang, Q.; Liu, Y.; Chen, T.; Tong, Y. Federated machine learning: Concept and applications. ACM Trans. Intell. Syst. Technol. (TIST)
**2019**, 10, 1–19. [Google Scholar] [CrossRef] - Bharti, S.; Mcgibney, A. Privacy-Aware Resource Sharing in Cross-Device Federated Model Training for Collaborative Predictive Maintenance. IEEE Access
**2021**, 9, 120367–120379. [Google Scholar] [CrossRef] - Cortes, C.; Vapnik, V. Support-vector networks. Mach. Learn.
**1995**, 20, 273–297. [Google Scholar] [CrossRef] - Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput.
**1997**, 9, 1735–1780. [Google Scholar] [CrossRef] [PubMed] - Zhu, G.; Liu, D.; Du, Y.; You, C.; Zhang, J.; Huang, K. Toward an intelligent edge: Wireless communication meets machine learning. IEEE Commun. Mag.
**2020**, 58, 19–25. [Google Scholar] [CrossRef] [Green Version] - Lakhan, A.; Mastoi, Q.U.A.; Elhoseny, M.; Memon, M.S.; Mohammed, M.A. Deep neural network-based application partitioning and scheduling for hospitals and medical enterprises using IoT assisted mobile fog cloud. Enterp. Inf. Syst.
**2021**, 16, 1–23. [Google Scholar] [CrossRef] - Aburukba, R.O.; AliKarrar, M.; Landolsi, T.; El-Fakih, K. Scheduling Internet of Things requests to minimize latency in hybrid Fog-Cloud computing. Future Gener. Compure Syst.
**2020**, 111, 539–551. [Google Scholar] [CrossRef] - Bierzynski, K.; Escobar, A.; Eberl, M. Cloud, fog and edge: Cooperation for the future? In Proceedings of the 2017 Second International Conference on Fog and Mobile Edge Computing (FMEC), Valencia, Spain, 8–11 May 2017; pp. 62–67. [Google Scholar]
- Verbraeken, J.; Wolting, M.; Katzy, J.; Kloppenburg, J.; Verbelen, T.; Rellermeyer, J.S. A survey on distributed machine learning. ACM Comput. Surv. (CSUR)
**2020**, 53, 1–33. [Google Scholar] [CrossRef] [Green Version] - Wang, S.; Tuor, T.; Salonidis, T.; Leung, K.K.; Makaya, C.; He, T.; Chan, K. When edge meets learning: Adaptive control for resource-constrained distributed machine learning. In Proceedings of the IEEE INFOCOM 2018-IEEE Conference on Computer Communications, Honolulu, HI, USA, 16–19 April 2018; pp. 63–71. [Google Scholar]
- Zhang, C.; Xie, Y.; Bai, H.; Yu, B.; Li, W.; Gao, Y. A survey on federated learning. Knowl. Based Syst.
**2021**, 216, 106775. [Google Scholar] [CrossRef] - Shi, Y.; Yang, K.; Jiang, T.; Zhang, J.; Letaief, K.B. Communication-efficient edge AI: Algorithms and systems. IEEE Commun. Surv. Tutor.
**2020**, 22, 2167–2191. [Google Scholar] [CrossRef] - Lim, W.Y.B.; Luong, N.C.; Hoang, D.T.; Jiao, Y.; Liang, Y.C.; Yang, Q.; Niyato, D.; Miao, C. Federated learning in mobile edge networks: A comprehensive survey. IEEE Commun. Surv. Tutor.
**2020**, 22, 2031–2063. [Google Scholar] [CrossRef] [Green Version] - Nilsson, A.; Smith, S.; Ulm, G.; Gustavsson, E.; Jirstrand, M. A performance evaluation of federated learning algorithms. In Proceedings of the Second Workshop on Distributed Infrastructures for Deep Learning, Rennes, France, 10–11 December 2018; pp. 1–8. [Google Scholar]
- Konečný, J.; McMahan, H.B.; Ramage, D.; Richtárik, P. Federated optimization: Distributed machine learning for on-device intelligence. arXiv
**2016**, arXiv:1610.02527. [Google Scholar] - Li, T.; Sahu, A.K.; Zaheer, M.; Sanjabi, M.; Talwalkar, A.; Smith, V. Federated optimization in heterogeneous networks. arXiv
**2018**, arXiv:1812.06127. [Google Scholar] - Liu, L.; Zhang, J.; Song, S.H.; Letaief, K.B. Client-edge-cloud hierarchical federated learning. In Proceedings of the ICC 2020-2020 IEEE International Conference on Communications (ICC), Dublin, Ireland, 7–11 June 2020; pp. 1–6. [Google Scholar]
- Xu, B.; Xia, W.; Wen, W.; Zhao, H.; Zhu, H. Optimized Edge Aggregation for Hierarchical Federated Learning. In Proceedings of the 2021 IEEE 94th Vehicular Technology Conference (VTC2021-Fall), Norman, OK, USA, 27–30 September 2021; pp. 1–5. [Google Scholar]
- Mohr, M.; Becker, C.; Möller, R.; Richter, M. Towards collaborative predictive maintenance leveraging private cross-company data. In INFORMATIK 2020; Gesellschaft für Informatik: Bonn, Germany, 2021; pp. 427–432. [Google Scholar] [CrossRef]
- Park, D.; Kim, S.; An, Y.; Jung, J.Y. LiReD: A light-weight real-time fault detection system for edge computing using LSTM recurrent neural networks. Sensors
**2018**, 18, 2110. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Chen, B.; Wan, J.; Celesti, A.; Li, D.; Abbas, H.; Zhang, Q. Edge computing in IoT-based manufacturing. IEEE Commun. Mag.
**2018**, 56, 103–109. [Google Scholar] [CrossRef] - Ge, N.; Li, G.; Zhang, L.; Liu, Y. Failure prediction in production line based on federated learning: An empirical study. J. Intell. Manuf.
**2021**, 1–18. [Google Scholar] [CrossRef] - Sater, R.A.; Hamza, A.B. A federated learning approach to anomaly detection in smart buildings. ACM Trans. Internet Things
**2021**, 2, 1–23. [Google Scholar] [CrossRef] - Liu, Y.; Garg, S.; Nie, J.; Zhang, Y.; Xiong, Z.; Kang, J.; Hossain, M.S. Deep anomaly detection for time-series data in industrial iot: A communication-efficient on-device federated learning approach. IEEE Internet Things J.
**2020**, 8, 6348–6358. [Google Scholar] [CrossRef] - Saxena, A.; Goebel, K. Turbofan Engine Degradation Simulation Data Set, NASA Ames Prognostics Data Repository; NASA Ames Research Center: Moffett Field, CA, USA, 2008. Available online: https://data.nasa.gov/Aerospace/CMAPSS-Jet-Engine-Simulated-Data/ff5v-kuh6/ (accessed on 22 July 2022).
- Available online: https://github.com/ali-bemani/Collaborative-PM-at-the-edge-fog-and-cloud-levels.git (accessed on 22 July 2022).
- Li, X.; Ding, Q.; Sun, J.Q. Remaining useful life estimation in prognostics using deep convolution neural networks. Reliab. Eng. Syst. Saf.
**2018**, 172, 1–11. [Google Scholar] [CrossRef] [Green Version] - Sateesh Babu, G.; Zhao, P.; Li, X.L. Deep convolutional neural network based regression approach for estimation of remaining useful life. In International Conference on Database Systems for Advanced Applications; Springer: Cham, Switzerland, 2016; pp. 214–228. [Google Scholar]
- Zhang, C.; Lim, P.; Qin, A.K.; Tan, K.C. Multiobjective deep belief networks ensemble for remaining useful life estimation in prognostics. IEEE Trans. Neural Netw. Learn. Syst.
**2016**, 28, 2306–2318. [Google Scholar] [CrossRef] - Zhang, X.; Xiao, P.; Yang, Y.; Cheng, Y.; Chen, B.; Gao, D.; Liu, W.; Huang, Z. Remaining useful life estimation using CNN-XGB with extended time window. IEEE Access
**2019**, 7, 154386–154397. [Google Scholar] [CrossRef]

**Figure 6.**Undirected graph of communication between edge devices and fog servers for synchronous FL.

**Figure 7.**Undirected graph of communication between edge devices and fog servers for asynchronous FL, edge devices 5 and 6 play the fog roll.

**Figure 9.**Convergence time of syncronous FedSVM based on the communication of Figure 6 with different optimizer.

**Figure 10.**Four example of labeled RUL predictions for the testing engine based on the synchronous FedSVM model.

**Figure 11.**Convergence time of syncronous FedLSTM based on the communication of Figure 6.

**Figure 12.**Four example of RUL predictions for the testing engine based on the synchronous FedLSTM model.

Approach | Ref | Key Ideas |
---|---|---|

Distributed data communication constraints | [16] | Wireless communication in edge learning |

[17] | Deep neural network for fog-cloud based with adopting dynamic changes in resource variation | |

[18] | Genetic algorithm for scheduling to minimize overall latency | |

ML at the Edge, Fog, and Cloud levels | [19] | Distributed ML and challenges for implementing (Hardware, security, privacy, and communication) |

[20] | A fruitful survey on distributed machine learning | |

[21] | Proposed distributed gradient descent algorithm which fits for non-iid data | |

Federated ML concepts and applications | [9] | Stochastic method with variance reduction for solving the problem on federated learning |

[10] | Challenges of non-iid Data to Model Training on horizontal and vertical FL | |

[11] | Overview of FL, technologies, protocols and applications | |

[12] | Horizontal federated learning, vertical federated learning, and federated transfer learning | |

[22] | Analyzing Fl regarding data partitioning, privacy, model, and communication | |

Federated optimization algorithms | [25] | FedAvg, FedProx, CO-OP, FSVRG |

[26] | FSVRG on fog or cloud | |

[27] | FedProx | |

Distribution strategies and hierarchical FL | [28] | Hierarchical FL based on the number of aggregations compared to number of iterations (epochs) |

[29] | Hierarchical FL to minimize training loss and latency | |

Distributed ML for collaborative PM scenarios | [30] | Distributed PM algorithm based on FL and blockchain |

[13] | Cross-device FL for collaborative PM | |

[31] | Real-time fault detection system for edge computing | |

[32] | Edge computing in IoT based manufacturing | |

[33] | Federated SVM for horizontal FL and federated random forest for vertical FL | |

[34] | Novel FL algorithm for the LSTM model for anomaly detection | |

[35] | Combination of CNN and LSTM in distributed anomaly detection applications |

Optimizer | Evaluation Metrics | Dataset | |||
---|---|---|---|---|---|

FD001 | FD002 | FD003 | FD004 | ||

GD | Runtime (s) | 61.6 | 150 | 69 | 143.5 |

Final acc (%) | 92.4 | 77.9 | 94.2 | 78.4 | |

SGD | Runtime (s) | 18.9 | 43 | 20.5 | 45.5 |

Final acc (%) | 92.5 | 78.9 | 92.2 | 71.7 | |

FSVRG | Runtime (s) | 140 | 362 | 161 | 337 |

Final acc (%) | 90.3 | 74 | 91.7 | 86.8 |

Optimizer | Evaluation Metrics | Dataset | |||
---|---|---|---|---|---|

FD001 | FD002 | FD003 | FD004 | ||

GD | Runtime (s) | 61.8 | 145 | 68.6 | 141.4 |

Final acc (%) | 92.2 | 77.2 | 93.8 | 77.1 | |

SGD | Runtime (s) | 19.8 | 42.5 | 21.4 | 43 |

Final acc (%) | 90 | 77.5 | 92.1 | 83.1 |

Num of Epoch | Evaluation Metrics | Dataset | |||
---|---|---|---|---|---|

FD001 | FD002 | FD003 | FD004 | ||

1 | RMSE | 13.33 | 22.83 | 12.57 | 25.1 |

SF | 242 | 226 | 156 | 560 | |

2 | RMSE | 15.47 | 22.4 | 10.73 | 26.25 |

SF | 720 | 690 | 2469 | 470 | |

3 | RMSE | 15.53 | 22.93 | 9.7 | 24.85 |

SF | 690 | 348 | 617 | 202 | |

4 | RMSE | 14.5 | 21.68 | 9.65 | 17.14 |

SF | 709 | 753 | 895 | 337 |

Num of Epoch | Evaluation Metrics | Dataset | |||
---|---|---|---|---|---|

FD001 | FD002 | FD003 | FD004 | ||

1 | RMSE | 16.14 | 22.11 | 14.68 | 29.5 |

SF | 174 | 2877 | 1452 | 492 | |

2 | RMSE | 16.01 | 21.15 | 11.8 | 26.4 |

SF | 2097 | 2039 | 2769 | 3167 | |

3 | RMSE | 15.81 | 21.16 | 11.87 | 26.1 |

SF | 410 | 1852 | 2796 | 2535 | |

4 | RMSE | 15.36 | 22.29 | 11.85 | 27.1 |

SF | 1147 | 1473 | 5026 | 2650 |

Prediction Model | Evaluation Metrics | Dataset | |||
---|---|---|---|---|---|

FD001 | FD002 | FD003 | FD004 | ||

DCNN [38] | RMSE | 12.61 | 22.36 | 12.64 | 23.31 |

SF | 273 | 10412 | 284 | 12466 | |

Deep CNN [39] | RMSE | 18.45 | 30.29 | 19.81 | 29.16 |

SF | 1286 | 13570 | 1596 | 7886 | |

MODBNE [40] | RMSE | 15.04 | 25.05 | 12.51 | 28.66 |

SF | 334 | 5585 | 6557 | 6557 | |

CNN-XGB [41] | RMSE | 12.61 | 19.61 | 13.01 | 19.41 |

SF | 224 | 2525 | 279 | 2930 |

Optimizer | Evaluation Metrics | MNIST | |||
---|---|---|---|---|---|

Synchronous | Asynchronous | ||||

iid | Non-iid | iid | Non-iid | ||

GD | Runtime (s) | 109.84 | 97.15 | 93.89 | 86.26 |

Final acc (%) | 97.41 | 97.31 | 97.41 | 97.32 | |

SGD | Runtime (s) | 1.52 | 1.61 | 2.37 | 2.36 |

Final acc (%) | 97.69 | 97.32 | 96.86 | 96.76 | |

SGD | Runtime (s) | 328.93 | 332.68 | - | - |

Final acc (%) | 96.95 | 96.23 | - | - |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Bemani, A.; Björsell, N.
Aggregation Strategy on Federated Machine Learning Algorithm for Collaborative Predictive Maintenance. *Sensors* **2022**, *22*, 6252.
https://doi.org/10.3390/s22166252

**AMA Style**

Bemani A, Björsell N.
Aggregation Strategy on Federated Machine Learning Algorithm for Collaborative Predictive Maintenance. *Sensors*. 2022; 22(16):6252.
https://doi.org/10.3390/s22166252

**Chicago/Turabian Style**

Bemani, Ali, and Niclas Björsell.
2022. "Aggregation Strategy on Federated Machine Learning Algorithm for Collaborative Predictive Maintenance" *Sensors* 22, no. 16: 6252.
https://doi.org/10.3390/s22166252