## 4 Intrusion Detection Systems Based on Federated Learning
### Comparative Analysis of Federated-Learning-Based Intrusion Detection Systems
#### 4.1.3 The Federated-Learning-Based Intrusion Detection Systems for Specific Areas
It should be noted that a secure gRPC channel is used for communication between the clients and the server. The results of the experiments show that the FELIDS system accuracy is close to the centralized model after 50 rounds, but it preserves the privacy of the client's data. It also should be noticed that there is a gap in accuracy between the best and worst clients, especially for the non-IID case. Additionally, in the paper, the time complexity (linear, depends on the number of clients, layers, number of local epochs, number of local examples for the client and aggregated local models parameters) and power consumption (quadratic complexity, depends on the total federated rounds, the total number of clients, the time, the energy power of client and server) were evaluated. It was tested on the experiments using the Intel CPU Core i5-6300U @ 2.4 GHz, 8.00 GB of RAM, and Ubuntu 20.04.3 LTS. The experiments showed that the time and energy consumption grow with number of clients and rounds, but do not depend on the data distribution technique. According to the experiments, the most efficient method in terms of time and energy consumption is DNN. _Used metrics_:  
* Time complexity;
* Power consumption;
* True positive (the number of correctly classified as attacks attack samples);
* False positive (the number of wrongly classified as attacks benign samples);
* True negative (the number of correctly classified benign samples);
* False negative (the number of wrongly classified as benign attacks samples). * Accuracy (the ratio of correct classifications number to the total input number), which is calculated as the ratio of (true positive + true negative) to the (true positive + true negative + false positive + false negative);
* Precision (the ratio of correct attack classifications to the total number of attack results predicted), which is calculated as the ratio of true positive to the (true positive + false positive);
* Recall (the ratio of correct attack classifications to the total number of all samples that should have been identified as attacks), which is calculated as the ratio of true positive to the (true positive + false negative);
* F1-score (the harmonic mean between precision and recall), which is calculated as the ratio of (precision \(\times\) recall) to the (precision + recall) multiplied by two. _Advantages_:  
* Implemented;
* The MQTTset dataset that contains MQTT-protocol-based communications between IoT devices is used for the experiments;
* The time complexity and power consumption are calculated;
* The time complexity and power consumption are evaluated on the experiments;
* Two data partition cases are considered;
* The results are close to the centralized model's accuracy while preserving data privacy. _Limitations_: Limited application area--agricultural Internet of Things; the gap between the performance results for the best and worst clients, especially for the non-IID case. The results of comparison are summarized in Table 1.  
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Ref. ** & **FL Architecture** & **Dataset** & **Attacks** & **Data Partition** & **ML Method** & **Implement-Tation** & **Conducted Experiments and Best Accuracy** & **Used Metrics** \\ \hline \multirow{4}{*}{[20]} & \multirow{4}{*}{contralized} & \multirow{4}{*}{[20]}