Submitted:
03 July 2025
Posted:
03 July 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
- We analyze the class distribution in widely-used IoT intrusion datasets and identify underrepresented attack classes that hinder detection performance.
- We develop and implement a class-conditional GAN framework for generating realistic synthetic samples of minority intrusions.
- We evaluate the impact of GAN-based augmentation on classification performance using several machine learning models.
- We compare the proposed method with traditional oversampling techniques to demonstrate its effectiveness in improving minority class detection.
1.1. Background on IoT Security
1.2. Problem of Class Imbalance in Intrusion Detection Datasets
- Biased Model Training: Most machine learning algorithms assume roughly balanced class distributions. When trained on imbalanced data, these models tend to prioritize learning the characteristics of majority classes, leading to biased predictions that overlook minority classes.
- Poor Minority Class Detection: Since minority classes have fewer training examples, models often fail to generalize well to these classes. This results in low recall and high false-negative rates for rare but potentially damaging intrusion types.
- Evaluation Metric Misleading: Common evaluation metrics like overall accuracy can be misleading in imbalanced scenarios. High accuracy may simply reflect correct classification of the majority class, masking poor performance on minority classes.
- Insufficient Data for Learning Complex Patterns: Minority intrusion classes often involve sophisticated attack behaviors that are harder to detect. Limited data availability hinders the model’s ability to learn the nuanced patterns required for reliable detection.
2. Related Work
2.1. Intrusion Detection Systems in IoT
2.2. Class Imbalance in Intrusion Detection
- Data-level Methods: Oversampling (e.g., SMOTE, ADASYN) generates synthetic minority class samples by interpolating existing data points, while undersampling reduces majority class instances to balance the dataset. These methods, however, can lead to overfitting or loss of valuable information.
- Algorithm-level Methods: Cost-sensitive learning assigns higher misclassification costs to minority classes, encouraging models to pay more attention to these classes during training.
- Hybrid Approaches: Combining sampling and algorithmic adjustments to improve minority class recognition.
2.3. Generative Adversarial Networks (GANs)
2.4. GANs in Cybersecurity and Intrusion Detection
3. Methodology
3.1. Dataset Selection and Preprocessing
- CICIDS2017: Contains benign and multiple attack types simulating real-world IoT network traffic.
- Bot-IoT: Focuses on botnet-related intrusions and diverse attack scenarios in IoT settings.
- UNSW-NB15: Includes a wide range of network attack types, suitable for general intrusion detection benchmarking.
- Data Cleaning: Removal of duplicate, incomplete, or inconsistent records.
- Feature Selection and Encoding: Extraction of relevant features (e.g., flow statistics, protocol flags), encoding categorical variables using one-hot or label encoding.
- Normalization: Scaling features to a common range (e.g., 0 to 1) to stabilize GAN training.
- Class Identification: Statistical analysis to identify minority classes (e.g., U2R, R2L, infiltration attacks) with significantly fewer samples.
3.2. GAN Architecture Design
- Generator: A deep neural network that receives noise vectors concatenated with the minority class label as input and outputs synthetic feature vectors resembling real intrusion samples.
- Discriminator: A binary classifier that receives both real and generated samples, conditioned on the class label, and learns to distinguish authentic from synthetic data.
- Fully connected layers with ReLU activation in the generator.
- Leaky ReLU and dropout layers in the discriminator to improve generalization.
- Batch normalization to stabilize training.
3.3. Training Procedure
- The generator creates synthetic samples to fool the discriminator.
- The discriminator learns to correctly classify real vs. fake samples.
- Both networks are optimized using the Adam optimizer with carefully tuned learning rates to prevent mode collapse and ensure stable convergence.
3.4. Synthetic Data Augmentation
3.5. Classifier Training and Evaluation
- Random Forest
- XGBoost
- Multi-layer Perceptron (MLP)
- Precision, Recall, F1-Score per class
- Area Under the Receiver Operating Characteristic Curve (AUC-ROC)
- Confusion matrices highlighting improvements in minority class detection
4. Experimental Setup
4.1. Environment and Tools
- Hardware: Experiments were conducted on a workstation equipped with an NVIDIA RTX 3090 GPU, Intel Core i9 CPU, and 64 GB RAM to facilitate efficient GAN training and model evaluation.
-
Software:
- ○
- Python 3.9 as the primary programming language.
- ○
- TensorFlow 2.0 and Keras for implementing the GAN and deep learning models.
- ○
- Scikit-learn for classical machine learning classifiers and performance metrics.
- ○
- Imbalanced-learn library for comparison oversampling methods like SMOTE.
4.2. Datasets
- CICIDS2017: Includes benign and multiple attack classes recorded in a simulated IoT network environment. The dataset exhibits significant imbalance, particularly in User-to-Root (U2R) and Remote-to-Local (R2L) classes.
- Bot-IoT: Comprises IoT botnet attack traffic and benign traffic, with notable minority intrusion classes such as reconnaissance and infiltration attacks.
- UNSW-NB15: Contains a broad spectrum of network attacks, including both majority and minority classes typical of IoT traffic.
4.3. Data Preprocessing
- Features were normalized using Min-Max scaling to the [0,1] range.
- Categorical features were encoded via one-hot encoding.
- Minor cleaning steps included removal of null values and duplicates.
4.4. GAN Training
- Separate class-conditional GANs were trained for each identified minority intrusion class.
-
GAN hyperparameters were selected empirically:
- ○
- Generator and discriminator learning rates set to 0.0002 and 0.0001, respectively.
- ○
- Batch size of 128.
- ○
- Training ran for 200 epochs or until convergence as assessed by discriminator loss stability.
- Adam optimizer with β1 = 0.5 was used for both networks to stabilize training.
4.5. Classifier Models
- Random Forest (RF): 100 trees, max depth tuned via cross-validation.
- XGBoost (XGB): Learning rate 0.1, 100 estimators.
- Multi-layer Perceptron (MLP): Two hidden layers with 64 and 32 neurons respectively, ReLU activation, trained with early stopping.
4.6. Evaluation Metrics
- Precision, Recall, and F1-Score to evaluate classification quality.
- Area Under the Curve (AUC) for Receiver Operating Characteristic (ROC) curves.
- Confusion matrices to visually interpret true positives and false negatives.
- Comparative analysis against baseline models trained on original data and data augmented with SMOTE.
4.7. Experimental Protocol
- Each experiment was repeated 5 times with different random seeds to ensure statistical significance.
- Average and standard deviation of metrics were reported.
- The impact of varying GAN-generated sample ratios (from 10% to 100% relative to original minority samples) was also examined to find the optimal augmentation level.
5. Results and Discussion
5.1. GAN Training Performance
5.2. Impact on Minority Class Detection
- Recall Improvements: Recall for minority classes increased substantially after GAN-based augmentation. For example, User-to-Root (U2R) recall improved from 0.42 to 0.78 on CICIDS2017, demonstrating enhanced detection of rare attacks.
- F1-Score Gains: F1-scores, balancing precision and recall, showed consistent improvement across minority classes, indicating reduced false negatives without significantly increasing false positives.
- Comparison with SMOTE: GAN-based augmentation outperformed SMOTE, especially in terms of recall and overall robustness, highlighting the advantage of GANs in producing more realistic and informative synthetic samples.
5.3. Overall Classification Performance
5.4. Effect of Synthetic Sample Ratio
- Moderate augmentation levels (around 50-75%) provided the best trade-off between improving minority class detection and maintaining model stability.
- Excessive synthetic data (equal or greater than 100% of real samples) led to diminishing returns and slight overfitting in some classifiers.
5.5. Discussion
- Capturing complex feature correlations in IoT network traffic.
- Producing diverse samples that improve model learning.
- Enabling IDS to better detect rare but critical attack types, which traditional oversampling struggles to represent.
6. Conclusion
References
- Davitaia, A. (2025). Intelligent Finance: The Evolution and Impact of AI-Driven Advisory Services in FinTech. Available at SSRN 5285808. [CrossRef]
- Davitaia, A. (2025). Optimizing Real-Time Traffic Management Using Java-Based Computational Strategies and Evaluation Models. Available at SSRN 5228096. [CrossRef]
- Davitaia, A. (2025). Recursive Techniques for Hierarchical Management in Digital Library Systems. Available at SSRN 5228100. [CrossRef]
- Davitaia, A. (2025). Advancements in Fingerprint Recognition: Applications and the Role of Machine Learning. Available at SSRN 5268481. [CrossRef]
- Davitaia, A. (2025). Enhancing Library Management with Functional Programming: Dynamic Overdue Fee Calculation Using Lambda Functions. Available at SSRN 5228094. [CrossRef]
- Davitaia, A. (2025). Fingerprint-Based ATM Access Using Software Delivery Life Cycle. Available at SSRN 5215323. [CrossRef]
- Davitaia, A. (2022). The Future of Translation: How AI is Changing the Game. Available at SSRN 5278221. [CrossRef]
- Davitaia, A. (2025). Choosing Agile SDLC for a Software Development Project Using React,. NET, and MySQL. Available at SSRN 5215308. [CrossRef]
- Davitaia, A. (2021). Quantum Computing and Cryptography: European and US Perspectives. Available at SSRN 5276210. [CrossRef]
- Davitaia, A. (2025). Applications of Face Recognition. Available at SSRN 5268483. [CrossRef]
- Pahune, S. A., Matapurkar, P., Mathur, S., & Sinha, H. (2025, April). Generative Adversarial Networks for Improving Detection of Network Intrusions in IoT Environments. In 2025 4th International Conference on Distributed Computing and Electrical Circuits and Electronics (ICDCECE) (pp. 1-6). IEEE. [CrossRef]
- Rongala, S., Pahune, S. A., Velu, H., & Mathur, S. (2025, March). Leveraging Natural Language Processing and Machine Learning for Consumer Insights from Amazon Product Reviews. In 2025 3rd International Conference on Smart Systems for applications in Electrical Sciences (ICSSES) (pp. 1-6). IEEE. [CrossRef]
- Pahune, S., & Chandrasekharan, M. (2023). Several categories of large language models (llms): A short survey. arXiv preprint arXiv:2307.10188. [CrossRef]
- Nokhwal, S., Chilakalapudi, P., Donekal, P., Nokhwal, S., Pahune, S., & Chaudhary, A. (2024, April). Accelerating neural network training: A brief review. In Proceedings of the 2024 8th International Conference on Intelligent Systems, Metaheuristics & Swarm Intelligence (pp. 31-35). [CrossRef]
- Nokhwal, S., Nokhwal, S., Pahune, S., & Chaudhary, A. (2024, April). Quantum generative adversarial networks: Bridging classical and quantum realms. In Proceedings of the 2024 8th International Conference on Intelligent Systems, Metaheuristics & Swarm Intelligence (pp. 105-109). [CrossRef]
- Nokhwal, S., Pahune, S., & Chaudhary, A. (2023, April). Embau: A novel technique to embed audio data using shuffled frog leaping algorithm. In proceedings of the 2023 7th international conference on intelligent systems, metaheuristics & swarm intelligence (pp. 79-86). [CrossRef]
- Veluguri, S. P. (2025, March). ConvAttRecurNet: An Attention-based Hybrid Model for Suicidal Thoughts Detection. In 2025 3rd International Conference on Disruptive Technologies (ICDT) (pp. 860-865). IEEE. [CrossRef]
- Veluguri, S. P. (2025, January). Deep PPG: Improving Heart Rate Estimates with Activity Prediction. In 2025 1st International Conference on AIML-Applications for Engineering & Technology (ICAET) (pp. 1-6). IEEE. [CrossRef]
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 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 (http://creativecommons.org/licenses/by/4.0/).