# Trustworthy AI and Federated Learning for Intrusion Detection in 6G-Connected Smart Buildings
## 8 Performance Evaluation of the Proposed FL-IDS
### Experiment 1  
The data were stratified and divided equally among five clients and the server. This ensured that each client had the same number of data samples and the same label distribution; the setting is represented in Figure 14. This experiment serves as a baseline to determine the number of rounds required to converge to the centralized ML results due to the \"ideal\" data distribution. The best results were obtained with 2200 rounds for the network CNN and 800 round for the sensor CNN; the performance results are summarized in Table 9.  
Upon comparing the results in Table 9 with those in Table 8 under centralized settings, the following differences can be observed:  
* **Network:** The overall results improved. The FPR decreased from 4.76% to 3.24%, while the FNR slightly increased from 0.16% to 0.47%.
* **GPS**: The overall results of this sensor dropped due to the FNR, which increased from 0% to 2%.
* **Garage Door and Motion Light:** These sensors achieved the same results as in the centralized learning scenario, with perfect scores.
* **Fridge and Weather**: In the centralized scenario, these sensors exhibited high false-positive rates (FPRs), which, in a decentralized, setting increased. For the fridge, the FPR changed from 22.22% to 28.79%, while for the weather sensor, it increased from 50% to 63.16%.
* **Thermost**: In the centralized setting, this sensor was the only one to exhibit a low recall behavior, causing false negatives. In the decentralized scenario, the FNR increased from 16.82% to 27.74%. The data pre-processing and engineering system and the data distribution in the original dataset are probably not optimal for this particular sensor, causing poor performance.  
In summary, the transition to a decentralized learning scenario improved the performance of the network CNN significantly by reducing the false-positive rate (FPR). This indicates increased accuracy in detecting malicious activity and suggests the mitigation of the overfitting issues present in the centralized scenario. The sensors' performance  
Figure 14: Experiment 1 settings.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**CNN** & **Rounds** & **Accuracy** & **Precision** & **Recall** & **F1** & **FPR** & **FNR** \\ \hline Network & 2200 & 99.17 & 99.53 & 99.53 & 99.53 & 3.24 & 0.47 \\ \hline GPS & 800 & 96.43 & 98.13 & 97.89 & 98.01 & 0 & 2.11 \\ \hline Fridge & 800 & 97.55 & 97.39 & 100 & 98.68 & 28.79 & 0 \\ \hline Garage door & 800 & 100 & 100 & 100 & 100 & 0 & 0 \\ \hline Weather & 800 & 98.42 & 98.40 & 100 & 99.20 & 63.16 & 0 \\ \hline Thermostat & 800 & 87.99 & 92.34 & 92.34 & 92.34 & 27.74 & 7.66 \\ \hline Motion Light & 800 & 100 & 100 & 100 & 100 & 0 & 0 \\ \hline \hline \end{tabular}
\end{table}
Table 9: Experiment 1 performance results (%).  
remained consistent with the centralized approach. The Motion light and garage door sensors maintained perfect scores, while the the GPS sensor experienced a slight performance decline and the thermostat sensor continued to exhibit challenges. This highlights the effectiveness of FL in maintaining or improving detection capabilities without compromising the system's overall reliability.