Edge-FLGuard+: A Federated and Lightweight Anomaly Detection Framework for Securing 5G-Enabled IoT in Smart Homes
Abstract
1. Introduction
- A lightweight edge AI model (e.g., autoencoder or GRU-based) optimized for device heterogeneity.
- A federated learning protocol using FedAvg, enhanced with group-level device clustering to reduce communication.
- Rigorous benchmarking using public datasets (TON_IoT and CIC-IDS2018), with ablation on latency, detection accuracy, model size, and communication overhead.
2. Related Work
2.1. Anomaly Detection in IoT and Smart Home Environments
2.2. Federated Learning for Privacy-Preserving Security
2.3. Lightweight AI and Edge-Aware Architectures
2.4. Positioning This Work
- Model Innovation: Edge-FLGuard+ introduces a new lightweight GRU-based autoencoder architecture that improves performance while reducing memory and computation requirements, in contrast to the earlier LSTM-based models.
- Smart home Focus: The current work targets 5G-enabled smart home environments specifically, rather than generalized IoT deployments.
- Privacy Enhancements: Edge-FLGuard+ incorporates advanced privacy mechanisms including differential privacy and secure aggregation, which were not implemented in Edge-FLGuard.
- Broader Evaluation: The present study includes ablation experiments, quantization analysis, and comparisons with centralized/local baselines—offering a more comprehensive evaluation than the prior work.
2.5. Summary of Relevant Works and Positioning of the Proposed Framework
- Combining edge AI, federated learning, and 5G-specific optimizations into a single cohesive framework tailored for smart home environments;
- Introducing a lightweight GRU-based autoencoder architecture that offers improved detection performance with lower communication overhead;
- Conducting a more comprehensive evaluation, including ablation studies and privacy-preserving mechanisms, not present in earlier studies.
3. System Architecture
3.1. Architectural Overview
- Smart home IoT Devices (Edge Nodes): These include smart thermostats, cameras, voice assistants, etc., each capable of local computation.
- Edge AI Module: Each device or its corresponding gateway runs a lightweight anomaly detection model locally.
- Federated Learning Coordinator: Hosted either on a local hub (e.g., home router with edge server) or cloud-based edge node, this component orchestrates model aggregation.
- 5G Communication Layer: High-speed and low-latency 5G connectivity supports timely model updates and federated rounds. In our architecture, 5G is leveraged specifically to reduce the latency and bandwidth bottlenecks traditionally associated with FL systems, enabling faster convergence and more responsive updates across edge devices.
3.2. Edge AI Model
- Be trainable on-device with low computational cost;
- Handle time-series IoT data;
- Identify deviations in device behavior.
- A 1D convolutional autoencoder (CAE) suitable for compact feature learning from raw data;
- A GRU-based autoencoder, which efficiently captures sequential dependencies in device-generated logs.
3.3. Federated Learning Protocol
- The coordinator initializes a global model.
- Each device trains its local model on locally stored anomaly-labeled data.
- After a training round, devices transmit only their model weights to the coordinator.
- The coordinator aggregates updates (e.g., weighted average) and broadcasts the new global model.
3.4. Privacy-Preserving Mechanisms
- Differential privacy (DP): Local model updates may be perturbed with calibrated noise before upload. This technique helps obscure the contribution of individual data points by adding statistically controlled noise, thereby protecting user-level information during federated training.
- Secure aggregation: The coordinator can apply cryptographic aggregation protocols to prevent reconstruction of individual updates.
- Transport layer security (TLS): All communication between edge devices and the aggregator is encrypted.
4. Methodology
4.1. Dataset Description
- TON_IoT (Telecommunications and Operational Network IoT): This dataset includes telemetry data from smart home devices, operating systems, and network logs. We extract subsets related to smart home traffic, including data from smart lights, thermostats, and door sensors, with both benign and attack scenarios.
- CIC-IDS2018 (Canadian Institute for Cybersecurity—Intrusion Detection System 2018): This dataset contains labeled flows of benign and malicious traffic. For our purposes, we filter for home network-relevant features, such as port scan, brute force SSH, and botnet traffic patterns, emulating a smart home gateway context.
4.2. Data Preprocessing
- Filtering: Select only smart home–relevant logs (e.g., IoT devices, home Wi-Fi, local subnet flows).
- Cleaning: Remove duplicate entries, resolve missing values, and unify timestamp formats.
- Feature Selection: Extract protocol-based (e.g., source/destination port, protocol), time-based (e.g., packet interval), and statistical (e.g., entropy, variance) features.
- Normalization: Apply min–max scaling to numeric features for neural network compatibility.
- Label Encoding: Labels are binary (normal = 0; anomaly = 1).
4.3. Model Architecture
- Input Layer: A time-series window of shape (T, F), where T = 10 time steps and F = 20 selected features.
- GRU Encoder: Two stacked GRU layers:
- ○
- Layer 1: 64 hidden units; dropout = 0.2;
- ○
- Layer 2: 32 hidden units; dropout = 0.2.
- Latent Representation: The final hidden state of the second GRU, forming a 32-dimensional embedding.
- GRU Decoder: Symmetric structure to the encoder, with 32 and 64 GRU units, respectively, followed by a dense projection layer to match input shape.
- Output Layer: Reconstructed time-series window (T, F).
- Loss Function: Mean squared error (MSE) between original and reconstructed sequences.
Listing 1. Pseudocode of the detection phase. |
|
4.4. Federated Learning Setup
- Federated Rounds: 100.
- Clients per Round: 5–10 (simulating active smart home nodes).
- Data Distribution: Non-IID across clients (each device sees distinct behavior profiles).
- Model Updates: Weights transmitted securely after local epochs (typically 2–5 per round).
- Communication: Simulated via 5G emulated links with latency and bandwidth constraints.
- Hardware Specs: Simulated edge devices: 2–4 core CPUs, 2GB RAM; Aggregator: 8-core CPU, 16 GB RAM.
4.5. Baseline Methods for Comparison
- Centralized LSTM Autoencoder: A full data–centralized model trained on all available data.
- Local-only Model: Each client trains an independent GRU autoencoder with no FL.
- FedAvg + CNN Encoder: A variation using lightweight 1D CNN instead of GRU.
- Unsupervised Isolation Forest (centralized and federated): To benchmark traditional ML-based anomaly detectors [5].
5. Experimental Evaluation
5.1. Evaluation Metrics
- Accuracy (Acc): Ratio of correctly classified instances to total instances.
- F1-Score (F1): Harmonic mean of precision and recall, suitable for imbalanced data.
- False Positive Rate (FPR): Measures the rate of benign traffic misclassified as anomalies.
- Inference Latency: Average time per instance for local anomaly detection (on-device).
- Communication Overhead: Volume of data exchanged per federated round (in KB or MB).
5.2. Comparative Results
- Centralized Model (C-AE): A GRU-based autoencoder trained on all data centrally.
- Local-Only Model (L-AE): Edge nodes train independently without collaboration.
- Vanilla Federated Model (F-AE): FL with no optimizations or privacy layers.
5.3. Ablation Study
- Model Size: Compared full GRU model (160 K params) vs. pruned version (90 K params).
- Compression: Tested 8-bit quantized weights vs. floating-point weights.
- Number of FL Rounds: Evaluated convergence under 20, 50, 100, and 200 rounds.
5.4. Discussion
- Scalability:Edge-FLGuard+ supports asynchronous and partial participation. It performed consistently with 5–10 clients, and the system scales to dozens of nodes without performance collapse.
- Privacy Trade-offs:Incorporating differential privacy noise (ε = 5) resulted in a ~1.4% drop in F1-score, but significantly enhanced privacy guarantees.
- Real-World Applicability:The low inference latency (<7 ms) and small memory footprint (<1.2 MB) confirm its suitability for smart home routers and IoT gateways. All experiments were simulated on Raspberry Pi–like edge nodes.
6. Conclusions and Future Work
Future Work
- Cross-Domain Generalization: Investigate transferability of trained models across heterogeneous environments (e.g., smart buildings, smart healthcare).
- Adaptive and Personalized FL Models: Incorporate continual learning and attention-based mechanisms to adapt to evolving device behavior patterns.
- LLM-Integrated Threat Intelligence: Explore the use of large language models (LLMs) for contextual reasoning, anomaly explanation, and threat attribution at the edge.
- Adaptive Monitoring Integration: Future versions of Edge-FLGuard+ could incorporate adaptive data collection and monitoring strategies (e.g., dynamic sampling, context-aware feedback) to further reduce communication and computation costs without sacrificing detection accuracy.
- 5G-Aware Anomaly Detection: Future versions of the framework could incorporate 5G-specific network telemetry (e.g., signal strength, latency spikes, handover frequency) as auxiliary features for anomaly detection. This would enable context-aware threat analysis and potentially improve detection accuracy and responsiveness in highly dynamic network conditions.
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Sarwar, N.; Bajwa, I.S.; Hussain, M.Z.; Ibrahim, M.; Saleem, K. IoT Network Anomaly Detection in Smart Homes Using Machine Learning. IEEE Access 2023, 11, 119462–119480. [Google Scholar] [CrossRef]
- Zhang, Y.; Suleiman, B.; Alibasa, M.J.; Farid, F. Privacy-Aware Anomaly Detection in IoT Environments Using FedGroup: A Group-Based Federated Learning Approach. J. Netw. Syst. Manag. 2024, 32, 20. [Google Scholar] [CrossRef]
- Chatterjee, A.; Ahmed, B.S. IoT Anomaly Detection Methods and Applications: A Survey. Internet Things 2022, 19, 100568. [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]
- Vasiljevic, P.; Matic, M.; Popovic, M. Federated Isolation Forest for Efficient Anomaly Detection on Edge IoT Systems. arXiv 2025, arXiv:2506.05138. [Google Scholar] [CrossRef]
- Ahmed, M.; Naser Mahmood, A.; Hu, J. A Survey of Network Anomaly Detection Techniques. J. Netw. Comput. Appl. 2016, 60, 19–31. [Google Scholar] [CrossRef]
- Doshi, R.; Apthorpe, N.; Feamster, N. Machine Learning DDoS Detection for Consumer Internet of Things Devices. In Proceedings of the 2018 IEEE Security and Privacy Workshops (SPW), San Francisco, CA, USA, 24 May 2018; pp. 29–35. [Google Scholar]
- Kikissagbe, B.R.; Adda, M. Machine Learning-Based Intrusion Detection Methods in IoT Systems: A Comprehensive Review. Electronics 2024, 13, 3601. [Google Scholar] [CrossRef]
- Rajaan, R.; Singh, B.; Choudhary, N. Advancements in IoT Anomaly Detection: Leveraging Machine Learning for Enhanced Security. In Advances in Intelligent Systems Research, Proceedings of the International Conference on Advancements in Computing Technologies and Artificial Intelligence (COMPUTATIA 2025), Jaipur, India, 21–22 February 2025; Vyas, N., Sharma, A., Nayyar, A., Shrivastava, M., Gowda, V.D., Eds.; Atlantis Press International BV: Dordrecht, The Netherlands, 2025; Volume 189, pp. 367–389. ISBN 978-94-6463-699-4. [Google Scholar]
- Cultice, T.; Ionel, D.; Thapliyal, H. Smart Home Sensor Anomaly Detection Using Convolutional Autoencoder Neural Network. In Proceedings of the 2020 IEEE International Symposium on Smart Electronic Systems (iSES) (Formerly iNiS), Chennai, India, 14–16 December 2020; pp. 67–70. [Google Scholar]
- Gosselin, R.; Vieu, L.; Loukil, F.; Benoit, A. Privacy and Security in Federated Learning: A Survey. Appl. Sci. 2022, 12, 9901. [Google Scholar] [CrossRef]
- Zhang, Y.; Zeng, D.; Luo, J.; Xu, Z.; King, I. A Survey of Trustworthy Federated Learning with Perspectives on Security, Robustness, and Privacy. In Proceedings of the ACM Web Conference 2023, New York, NY, USA, 30 April–4 May 2023. [Google Scholar]
- Albogami, N.N. Intelligent Deep Federated Learning Model for Enhancing Security in Internet of Things Enabled Edge Computing Environment. Sci. Rep. 2025, 15, 4041. [Google Scholar] [CrossRef] [PubMed]
- Dritsas, E.; Trigka, M. Federated Learning for IoT: A Survey of Techniques, Challenges, and Applications. J. Sens. Actuator Netw. 2025, 14, 9. [Google Scholar] [CrossRef]
- Mughal, F.R.; He, J.; Das, B.; Dharejo, F.A.; Zhu, N.; Khan, S.B.; Alzahrani, S. Adaptive Federated Learning for Resource-Constrained IoT Devices through Edge Intelligence and Multi-Edge Clustering. Sci. Rep. 2024, 14, 28746. [Google Scholar] [CrossRef] [PubMed]
- Trihinas, D.; Pallis, G.; Dikaiakos, M.D. Low-Cost Adaptive Monitoring Techniques for the Internet of Things. IEEE Trans. Serv. Comput. 2021, 14, 487–501. [Google Scholar] [CrossRef]
- Reis, M.J.C.S. Edge-FLGuard: A Federated Learning Framework for Real-Time Anomaly Detection in 5G-Enabled IoT Ecosystems. Appl. Sci. 2025, 15, 6452. [Google Scholar] [CrossRef]
- Reis, M.J.C.S. AI-Driven Anomaly Detection for Securing IoT Devices in 5G-Enabled Smart Cities. Electronics 2025, 14, 2492. [Google Scholar] [CrossRef]
- Reis, M.J.C.S.; Serôdio, C. Edge AI for Real-Time Anomaly Detection in Smart Homes. Future Internet 2025, 17, 179. [Google Scholar] [CrossRef]
- McMahan, B.; Moore, E.; Ramage, D.; Hampson, S.; Arcas, B.A. Communication-Efficient Learning of Deep Networks from Decentralized Data. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, Fort Lauderdale, FL, USA, 10 April 2017; PMLR. pp. 1273–1282. [Google Scholar]
- Dwork, C.; Roth, A. The Algorithmic Foundations of Differential Privacy. FNT Theor. Comput. Sci. 2013, 9, 211–407. [Google Scholar] [CrossRef]
- Chung, J.; Gulcehre, C.; Cho, K.; Bengio, Y. Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling. arXiv 2014, arXiv:1412.3555. [Google Scholar] [CrossRef]
Study | Domain | Model/FL | Devices | 5G-Aware | Lightweight | Privacy-Preserving | Dataset(s) |
---|---|---|---|---|---|---|---|
Sarwar et al. (2023) [1] | Smart home ML | CNN, RF | Local | — | Moderate | ✗ | Smart home traffic data |
Albogami (2025) [13] | Edge IoT FL | Deep-belief + GJO/DBO | FL | — | Moderate | ✓ | IoT time-series |
Vasiljević et al. (2025) [5] | Edge IoT FL | Isolation Forest | Edge | — | ✓ (<160 KB) | ✓ | Temperature sensors |
Reis (Edge-FLGuard, 2025) [17] | Smart IoT 5G FL | Autoencoder + LSTM | Edge + FL | ✓ | Moderate | ✓ | TON-IoT, CIC-IDS |
Proposed Edge-FLGuard+ | Smart home 5G FL | Lightweight AE/GRU | Edge + FL | ✓ | ✓ (<100 KB) | ✓ (privacy-layer) | TON-IoT, CIC-IDS |
Model | Accuracy | F1-Score | FPR | Latency (ms) | Comm. Overhead (MB/Round) |
---|---|---|---|---|---|
C-AE (Centralized) | 97.1% | 0.962 | 2.3% | — | — |
L-AE (Local Only) | 88.4% | 0.871 | 6.2% | 6.7 | 0 |
F-AE (Vanilla FL) | 95.2% | 0.946 | 3.5% | 7.1 | 3.8 |
Edge-FLGuard+ | 96.4% | 0.954 | 2.6% | 6.8 | 2.1 |
Variant | Accuracy | Comm. Overhead | Convergence Rounds |
---|---|---|---|
Full Model (160 K) | 96.4% | 2.1 MB | ~100 |
Pruned Model (90 K) | 95.6% | 1.3 MB | ~80 |
8-bit Quantized | 94.9% | 0.7 MB | ~120 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the author. 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
Reis, M.J.C.S. Edge-FLGuard+: A Federated and Lightweight Anomaly Detection Framework for Securing 5G-Enabled IoT in Smart Homes. Future Internet 2025, 17, 329. https://doi.org/10.3390/fi17080329
Reis MJCS. Edge-FLGuard+: A Federated and Lightweight Anomaly Detection Framework for Securing 5G-Enabled IoT in Smart Homes. Future Internet. 2025; 17(8):329. https://doi.org/10.3390/fi17080329
Chicago/Turabian StyleReis, Manuel J. C. S. 2025. "Edge-FLGuard+: A Federated and Lightweight Anomaly Detection Framework for Securing 5G-Enabled IoT in Smart Homes" Future Internet 17, no. 8: 329. https://doi.org/10.3390/fi17080329
APA StyleReis, M. J. C. S. (2025). Edge-FLGuard+: A Federated and Lightweight Anomaly Detection Framework for Securing 5G-Enabled IoT in Smart Homes. Future Internet, 17(8), 329. https://doi.org/10.3390/fi17080329