Smarter IoT Security: Finding Explainable Defenses Against DDoS Attacks

Author: Denis Avetisyan


New research identifies effective deep learning models for detecting distributed denial-of-service attacks targeting Internet of Things devices, prioritizing both performance and interpretability.

The research establishes a methodology for examining the efficacy of pre-trained models in the critical task of detecting Distributed Denial of Service (DDoS) attacks, acknowledging the ongoing need to adapt defenses against evolving network threats.
The research establishes a methodology for examining the efficacy of pre-trained models in the critical task of detecting Distributed Denial of Service (DDoS) attacks, acknowledging the ongoing need to adapt defenses against evolving network threats.

A comparative evaluation of transfer learning approaches demonstrates DenseNet169’s superior balance of accuracy, reliability, and explainability for IoT DDoS detection under resource constraints, with MobileNetV3 offering a strong, efficient alternative.

While deep learning offers promising solutions for securing Internet of Things (IoT) infrastructures against distributed denial-of-service (DDoS) attacks, practical deployment necessitates careful consideration of both performance and model trustworthiness under resource constraints. This study, ‘Explainability-Aware Evaluation of Transfer Learning Models for IoT DDoS Detection Under Resource Constraints’, presents a comprehensive evaluation of seven pre-trained convolutional neural networks, revealing that DenseNet169 achieves the strongest alignment between detection accuracy, reliability, and interpretability. Specifically, DenseNet and MobileNet architectures demonstrated superior reliability and compact attribution patterns when applied to image-based network traffic representations of the CICDDoS2019 dataset. How can these findings inform the development of robust and transparent security solutions for increasingly vulnerable IoT ecosystems?


The Inevitable Expansion of Attack Surfaces

The rapid expansion of the Internet of Things has inadvertently created a significantly broadened attack surface, presenting a growing threat of Distributed Denial of Service (DDoS) attacks. As billions of devices – from smart thermostats and security cameras to industrial sensors – connect to networks, each represents a potential entry point for malicious actors. Unlike traditional DDoS attacks originating from a limited number of compromised computers, IoT-based attacks can leverage massive botnets comprised of these everyday devices, often without the owners’ knowledge. This scale allows attackers to overwhelm target servers with traffic, disrupting services and causing widespread outages. The inherent vulnerabilities in many IoT devices – stemming from weak default passwords, unpatched software, and limited security features – exacerbate this risk, making them easy targets for botnet recruitment and dramatically increasing the potential for devastating, large-scale attacks.

The sheer volume and rapidly changing nature of Internet of Things (IoT) networks present significant challenges to conventional cybersecurity approaches. Traditional security models, designed for static networks with well-defined perimeters, struggle to adapt to the constantly fluctuating topology and diverse range of devices characteristic of IoT deployments. This dynamism-devices joining and leaving the network, varying communication protocols, and the often-limited processing power of IoT endpoints-creates a complex landscape where signature-based detection and static firewalls prove increasingly ineffective. Consequently, critical infrastructure reliant on these interconnected devices-from power grids and water treatment facilities to healthcare systems-faces heightened vulnerability to malicious actors capable of exploiting these systemic weaknesses and launching large-scale disruptions.

Successfully safeguarding Internet of Things (IoT) networks hinges on robust anomaly detection systems, yet achieving this proves challenging due to the intricate nature of data generated by these devices. Unlike traditional networks with predictable traffic, IoT environments exhibit highly variable communication patterns stemming from diverse device types, intermittent connectivity, and unique operational profiles. Consequently, conventional security tools often struggle to differentiate between legitimate activity and malicious behavior, leading to high rates of false positives or, more critically, missed attacks. Advanced techniques, including machine learning algorithms capable of establishing baseline behaviors and identifying deviations, are increasingly necessary. These systems must process vast streams of data, account for the temporal dependencies within network traffic, and adapt to evolving device characteristics to accurately pinpoint anomalous activity and protect critical infrastructure from compromise.

Receiver operating characteristic (ROC) curves demonstrate the performance of pre-trained models in detecting distributed denial-of-service (DDoS) attacks.
Receiver operating characteristic (ROC) curves demonstrate the performance of pre-trained models in detecting distributed denial-of-service (DDoS) attacks.

From Network Data to Visual Deception

The conversion of raw network traffic data into image representations enables the application of convolutional neural networks (CNNs) for anomaly detection by transforming sequential data into a format suitable for spatial analysis. This process typically involves mapping network features – such as packet size, inter-arrival time, and protocol type – to pixel values within an image. The resulting images capture the relationships and patterns present in the network traffic as visual features. CNNs, originally designed for image processing, can then be trained to identify deviations from normal traffic patterns represented as anomalies within these images, offering a robust method for detecting potentially malicious activity or network intrusions.

Image-based traffic representation transforms network data into a format suitable for convolutional neural network (CNN) analysis by encoding packet characteristics as pixel values within an image. This allows CNNs to exploit their inherent capability for spatial pattern recognition; traditionally applied to image data, this strength extends to identifying correlations and anomalies within network traffic patterns that represent specific behaviors or attacks. The conversion process typically involves mapping features like packet size, inter-arrival time, and protocol type to pixel intensities or color channels, creating a visual depiction of network activity over a defined time window. This enables the CNN to learn and recognize complex, multi-dimensional patterns indicative of both normal and anomalous network behavior, exceeding the capabilities of traditional signature-based or statistical anomaly detection methods.

Representing network traffic as a visual signal enables the detection of subtle anomalies through analysis of spatial patterns. Traditional intrusion detection systems often rely on signature-based or statistical methods that may miss low-amplitude or previously unknown threats. Converting network data-such as packet sizes, inter-arrival times, and protocol types-into a visual format, like a grayscale image, allows convolutional neural networks (CNNs) to identify deviations from established baselines. These CNNs are trained to recognize normal traffic patterns; anomalies appear as irregularities in the visual representation, potentially indicating malicious activity like port scanning, data exfiltration, or command-and-control communications. This approach is particularly effective at identifying anomalies that lack clear signatures or are masked by normal network activity.

Network traffic data is transformed into an image representation to leverage the capabilities of pre-trained models.
Network traffic data is transformed into an image representation to leverage the capabilities of pre-trained models.

Lightweight Deep Learning: A Necessary Compromise

Lightweight Convolutional Neural Network (CNN) architectures, including MobileNet, DenseNet, and EfficientNet, are increasingly utilized for network anomaly detection due to their optimized balance of computational efficiency and accuracy. These models employ techniques such as depthwise separable convolutions and bottleneck layers to significantly reduce the number of parameters and floating-point operations compared to traditional CNNs, enabling deployment on resource-constrained devices. This efficiency is critical for real-time network security applications, particularly within Internet of Things (IoT) environments where edge computing is preferred. While maintaining acceptable accuracy levels, these lightweight architectures offer reduced latency and lower energy consumption, making them suitable for continuous monitoring and rapid threat response.

Transfer learning accelerates the deployment of deep learning models for network security in IoT environments by leveraging knowledge gained from pre-training on large, general datasets. Instead of training a model from scratch, which requires substantial data and computational resources, transfer learning utilizes a pre-trained model – such as those based on MobileNet, DenseNet, or EfficientNet – and fine-tunes it with a smaller dataset specific to the target IoT network. This process significantly reduces training time and data requirements, enabling rapid adaptation to the unique characteristics of individual IoT deployments and improving performance with limited labeled data. The technique effectively transfers learned features, such as edge and texture detection, to the new task of anomaly detection within the IoT network, boosting initial accuracy and generalization capability.

Comprehensive evaluation of deep learning models for network security utilizes a suite of performance metrics to assess both classification accuracy and reliability. Accuracy, Precision, Recall, and F1-Score quantify the model’s ability to correctly identify anomalies, while Cohen’s Kappa and Matthews Correlation Coefficient (MCC) measure the agreement between predicted and actual classifications, accounting for chance agreement. Youden’s Index provides a single statistic summarizing the model’s performance across different threshold settings. Recent studies demonstrate that the DenseNet169 architecture achieves approximately 98% accuracy in anomaly detection, accompanied by strong inter-rater reliability as evidenced by a Cohen’s Kappa and MCC value of 0.885, indicating robust and consistent performance.

Performance evaluations of lightweight Convolutional Neural Networks (CNNs) for network security applications indicate a trade-off between inference speed and reliability. MobileNet achieves the lowest latency, recording an inference time of 0.000530 seconds, making it particularly well-suited for deployment on edge devices with limited computational resources. Conversely, DenseNet169 demonstrates a higher degree of reliability, but at a computational cost reflected in its inference time of 0.003050 seconds; this represents a 5.66-fold increase in processing time compared to MobileNet. The selection between these architectures depends on the specific application requirements, prioritizing low latency for real-time threat detection or maximizing reliability for critical security functions.

Confusion matrices reveal the performance of various pre-trained architectures in multi-class DDoS detection, highlighting their ability to correctly identify and classify different attack types.
Confusion matrices reveal the performance of various pre-trained architectures in multi-class DDoS detection, highlighting their ability to correctly identify and classify different attack types.

Peeking Inside the Black Box: Towards Explainable Security

Modern artificial intelligence systems, particularly those focused on network security, often operate as ‘black boxes’, making it difficult to understand why a particular decision was reached. However, techniques like SHAP (SHapley Additive exPlanations) values and Grad-CAM (Gradient-weighted Class Activation Mapping) are illuminating these processes. SHAP values quantify the contribution of each input feature – in this case, aspects of image-based network traffic representation – to the model’s output, essentially revealing which characteristics pushed the prediction in a certain direction. Simultaneously, Grad-CAM generates visual heatmaps highlighting the specific regions within the input image that most influenced the AI’s classification. By superimposing these heatmaps onto the network traffic image, security professionals can directly observe which patterns – perhaps specific packet sizes, communication frequencies, or protocol anomalies – the model is focusing on, offering a powerful method for dissecting complex AI reasoning.

The ability to dissect an AI’s decision-making process offers security analysts crucial validation tools, moving beyond simply accepting a prediction to understanding why it was made. This interpretability isn’t merely about confirming correct classifications; it actively facilitates the detection of biases embedded within the model itself – perhaps a disproportionate flagging of certain network protocols or a sensitivity to specific, benign traffic characteristics. More profoundly, examining the features driving these predictions unveils subtle patterns indicative of emerging attack strategies; a model consistently focusing on unusual header combinations, for instance, might signal a new exploitation technique previously unseen. Consequently, security teams can refine their defenses proactively, addressing vulnerabilities before they are actively exploited, and building a more resilient security infrastructure based on transparent, understandable AI insights.

A robust security posture increasingly relies on artificial intelligence, but simply deploying these systems isn’t enough; understanding how they arrive at conclusions is paramount. When security professionals can decipher the AI’s ‘reasoning’ – the specific data points and patterns influencing its threat assessments – they move beyond reactive responses to proactive fortification. This transparency enables validation of the model’s logic, identification of previously unseen attack vectors, and refinement of security protocols based on the AI’s insights. Consequently, organizations aren’t merely reacting to alerts, but anticipating and neutralizing threats with a level of precision previously unattainable, ultimately bolstering resilience against evolving cyber landscapes and minimizing potential damage.

SHAP analysis reveals the key features influencing the pre-trained models' detection of DDoS attacks.
SHAP analysis reveals the key features influencing the pre-trained models’ detection of DDoS attacks.

The pursuit of elegant solutions in IoT security invariably runs headfirst into the brick wall of reality. This research, diligently evaluating transfer learning models for DDoS detection, merely confirms a familiar truth. DenseNet169 achieving a balance of accuracy and explainability isn’t a breakthrough-it’s a compromise. As Donald Davies observed, “Anything called scalable just hasn’t been tested properly.” The study highlights that even with pre-trained models, resource constraints dictate choices, leading to MobileNetV3 as a viable, if less theoretically perfect, alternative. It’s a pragmatic outcome-better one functioning, understandable system than a hundred beautifully complex ones destined to fail under pressure.

What’s Next?

The pursuit of readily transferable deep learning models for IoT intrusion detection inevitably reveals the uncomfortable truth: each simplification introduces a new failure mode. DenseNet169’s current advantage, while noted, will likely erode as adversarial attacks specifically target its explainability features – or, more prosaically, as production network traffic deviates from the curated datasets. The field will soon discover that ‘explainability’ is merely a moving target, a label appended to whatever post-hoc analysis currently minimizes embarrassment.

Future work, predictably, will focus on automating the generation of ‘robust’ explanations – a task akin to building a self-documenting bug. The emphasis on resource constraints, while pragmatic, risks becoming a self-fulfilling prophecy; efficient models are often efficient at avoiding complex analysis, and thus, potentially, at missing subtle attacks. Model compression, distillation, and pruning are merely temporary reprieves.

Ultimately, the true next step isn’t better models, but a grudging acceptance that reliable anomaly detection requires continuous monitoring, adaptive thresholds, and a dedicated team to investigate every flag – a human firewall. CI is the temple-and it will be tested. Documentation remains a myth invented by managers.


Original article: https://arxiv.org/pdf/2602.22488.pdf

Contact the author: https://www.linkedin.com/in/avetisyan/

See also:

2026-03-01 15:18