Skip to Content
Applied SciencesApplied Sciences
  • Article
  • Open Access

30 January 2026

16 Pages

Enhancing Network Security with Generative AI on Jetson Orin Nano

,
and
1
Department of Computer Science and Systems, University of La Laguna, 38270 La Laguna, Spain
2
Faculty of Science, Agriculture, Business and Law, School of Science and Technology, University of New England, Armidale, NSW 2351, Australia
*
Authors to whom correspondence should be addressed.

Abstract

This study presents an edge-based intrusion detection methodology designed to enhance cybersecurity in Internet of Things environments, which remain highly vulnerable to complex attacks. The approach employs an Auxiliary Classifier Generative Adversarial Network capable of classifying network traffic in real-time while simultaneously generating high-fidelity synthetic data within a unified framework. The model is implemented in TensorFlow and deployed on the energy-efficient NVIDIA Jetson Orin Nano, demonstrating the feasibility of executing advanced deep learning models at the edge. Training is conducted on network traffic collected from diverse IoT devices, with preprocessing focused on TCP-based threats. The integration of an auxiliary classifier enables the generation of labeled synthetic samples that mitigate data scarcity and improve supervised learning under imbalanced conditions. Experimental results demonstrate strong detection performance, achieving a precision of 0.89 and a recall of 0.97 using the standard 0.5 decision threshold inherent to the sigmoid-based binary classifier, indicating an effective balance between intrusion detection capability and false-positive reduction, which is critical for reliable operation in IoT scenarios. The generative component enhances data augmentation, robustness, and generalization. These results show that combining generative adversarial learning with edge computing provides a scalable and effective approach for IoT security. Future work will focus on stabilizing training procedures and refining hyperparameters to improve detection performance while maintaining high precision.

1. Introduction

The Internet of Things has quietly reshaped everyday connectivity. Ordinary devices now join a vast global network, a change that brings real gains in efficiency and convenience to daily life [1]. However, those same links also create notable cybersecurity challenges [2]. IoT devices increasingly draw the attention of malicious actors, and as a result both the devices and the networks that support them remain exposed to significant risk.
Such attacks may result in unauthorized access to sensitive information, whether personal records or proprietary business data [3]. Privacy can be compromised and critical infrastructure systems placed in danger. A major concern is the possibility of attackers gaining control over IoT devices [4]. Once control is obtained, devices may be manipulated or confidential data extracted, with consequences ranging from data theft to physical harm.
Many IoT devices lack strong security protections and remain vulnerable to different attack vectors. Common examples include malware infections [5], Denial of Service attacks [6], Distributed Denial of Service attacks [7], and Man in the Middle attacks [8]. Exploiting these weaknesses undermines the integrity, confidentiality, and availability of IoT systems.
The widespread use of IoT in healthcare, transportation, and energy increases the stakes. Cyberattacks [9] in these domains can disrupt essential services, cause financial losses, and threaten public safety. As devices become more integrated into critical infrastructures, the societal impact of successful attacks grows [10].
Addressing these challenges requires proactive strategies and advanced security technologies that can adapt as threats evolve. Machine learning provides practical tools to reinforce device protection. These approaches help preserve the integrity and resilience of interconnected IoT systems, even under resource constraints and shifting attack patterns.
This study explores the use of generative artificial intelligence to strengthen cybersecurity. A machine learning based intrusion detection system is proposed with the goals of real-time operation, high accuracy and low energy use. Traditional approaches often demand substantial power. The proposed solution relies on the NVIDIA Jetson Orin Nano [11] to enable efficient edge processing.
Despite the advances in machine learning-based intrusion detection, several challenges remain when deploying these solutions on resource-constrained IoT devices. Traditional IDS approaches often require substantial computational resources, making them unsuitable for such edge devices. Additionally, cybersecurity datasets are frequently scarce or highly imbalanced, which can hinder the training of accurate detection models. Furthermore, achieving real-time on-device processing is critical to reduce detection latency and enable timely response to threats, yet it remains a significant challenge for conventional approaches. The proposed AC-GAN framework directly addresses these pain points by providing a lightweight, generative-classification model capable of efficient edge deployment, handling data scarcity, and supporting real-time anomaly detection on constrained IoT devices.
The paper is organized as follows. The Section 2 introduces the device, protocol, and performance metrics. The Section 3 reviews relevant literature. The Section 4 describes the methodology. The Section 5 presents the implementation and testing. The Section 6 analyzes the findings. Finally, the paper concludes with remarks.

2. Preliminaries

2.1. Transmission Control Protocol

IoT deployments are especially exposed to attacks that exploit TCP behavior. A common scenario involves botnets that flood a target with TCP requests until the service becomes unresponsive. Figure 1 illustrates such a DoS attack [12] where a Botmaster commands many compromised devices to overwhelm a victim. The effect is immediate and often hard to recover from.
Figure 1. DoS Attacks Performed by a Botnet.
Session hijacking represents a different threat. In that case an attacker intercepts an active TCP session and tampers with the traffic between a device and a server. The result can be unauthorized access to sensitive information or manipulation of device behavior. SYN flood attacks follow a simpler pattern. A steady stream of SYN requests consumes connection resources and prevents legitimate clients from establishing sessions.
These exploits take advantage of weaknesses in TCP implementations and of the constrained nature of many IoT devices. Limited memory and processing power make it difficult to deploy strong protections on every endpoint. To reduce exposure, a combination of measures is required. Hardening TCP stacks, enforcing strict session management and deploying anomaly detection at the edge help. Network level controls such as rate limiting and traffic filtering add another layer of defense. Together, device level improvements and network controls make successful attacks harder and limit their impact.

2.2. Performance Metrics

To evaluate the proposed model, standard performance metrics were employed, including Accuracy, Precision, Recall, and F1-score, calculated based on the confusion matrix components (True Positives, True Negatives, False Positives, and False Negatives).

2.3. Generative Adversarial Networks

Generative Adversarial Networks (GANs) [13] propose a novel framework for training generative models through adversarial processes. A GAN consists of two neural networks, called the generator and the discriminator, which are trained simultaneously via a minimax optimization problem. The discriminator outputs D ( x ) , the probability that a sample x is real, and  D ( G ( z ) ) , the probability that a generated sample is classified as real. This adversarial framework encourages the generator to approximate the underlying data distribution until the discriminator can no longer distinguish real from generated samples.
While standard GANs are effective for data synthesis, in this work we adopt the Auxiliary Classifier GAN (AC-GAN) to incorporate class-conditional information, as described below.

2.3.1. Generator (G)

The generator is responsible for mapping a random noise vector z ∼ p z ( z ) from a prior distribution to the data space x, aiming to produce samples G ( z ) that are indistinguishable from real data. Its objective is to learn the underlying distribution of the real data and generate plausible synthetic data points.

2.3.2. Discriminator (D)

The discriminator is a binary classifier that takes both real data x from the true distribution p data ( x ) and generated data G ( z ) from the generator, and attempts to distinguish between the two. The discriminator is trained to maximize the probability of correctly classifying real versus generated data.

2.3.3. Loss Function

The loss function has a central role in shaping adversarial training for GANs. It captures the opposing aims of the two networks and sets the rules of engagement. Through this measure, both generator and discriminator receive feedback that drives gradual improvement.
In practice the loss quantifies how well each network meets its goal. The discriminator tries to tell real data apart from generated samples. The generator attempts to create samples that look real enough to deceive the discriminator. This push and pull defines the learning dynamics. The formal definition of the objective function used to train GANs is as follows:
min G max D V ( D , G ) = E x ∼ p data ( x ) [ log D ( x ) ] + E z ∼ p z ( z ) [ log ( 1 − D ( G ( z ) ) ) ]
where:
  • x: A sample from the distribution of real data, denoted as p data ( x ) .
  • z: A sample from the prior distribution p z ( z ) , which is typically a Gaussian or Uniform distribution.
  • E [ x ] : The expected value of a random variable x, representing the average or mean value when sampled from its probability distribution.
  • D ( x ) : The probability that the sample x is from the real data distribution rather than the generated data. D ( x ) outputs a value close to 1 for real data and close to 0 for generated data.
The discriminator has a simple but demanding task. It must tell real samples apart from those produced by the generator. Training adjusts the model so that true examples receive high scores, denoted by D ( x ) . At the same time the goal is to lower the score assigned to generated outputs G ( z ) . In practice this means the discriminator learns to separate genuine observations from synthetic ones.
The generator follows an opposing objective. Success is measured by the ability to produce samples that the discriminator treats as real. In mathematical terms the aim is to increase D ( G ( z ) ) . As the generator improves the discriminator must become more selective to keep detecting the fakes.
Updates alternate between the two networks. First the discriminator is trained using both real and generated examples. Then its parameters are held fixed while the generator is updated. This cycle repeats and both models improve over time.
Early in training the generator often produces poor samples and the discriminator rejects them easily. That situation can cause saturation of the term log 1 − D ( G ( z ) ) where gradients become very small and learning stalls. To reduce this problem the generator’s objective is commonly changed to maximize log D ( G ( z ) ) . This modification supplies stronger gradients at the start and helps the generator learn more effectively.

2.3.4. Auxiliary Classifier Generative Adversarial Network

The Auxiliary Classifier Generative Adversarial Network (AC-GAN), introduced by Odena et al. [14], is an extension of the conventional Generative Adversarial Network that incorporates class-conditional information into the adversarial learning process. In addition to distinguishing between real and synthetic samples, the discriminator in an AC-GAN is equipped with an auxiliary classification head that predicts the class label associated with each input sample. This dual objective enables the model to jointly learn data generation and supervised classification within a single framework.
In this study, TensorFlow was selected to implement the AC-GAN due to its mature support for deep learning architectures, efficient optimization routines, and extensive ecosystem for generative modeling. These features facilitate the construction, training, and fine-tuning of both the generator and the discriminator networks.
The generator in an AC-GAN receives both a latent noise vector and a target class label as input, and its objective is to produce synthetic samples that are not only indistinguishable from real data but also consistent with the specified class. The discriminator, in turn, outputs two predictions: one assessing whether the input sample is real or generated, and another estimating its class label. This dual feedback mechanism encourages the generator to capture class-specific data distributions more accurately than standard GAN formulations.
More specifically, the latent noise vector is sampled from a predefined distribution and combined with a class-conditioning vector, typically represented using one-hot encoding. This combined input is then processed by the generator through a sequence of fully connected transformations to produce a synthetic feature vector with the same dimensionality as the original data.
The discriminator processes each input sample through a set of shared hidden layers before branching into two separate output heads. One head performs binary discrimination between real and generated samples, while the other acts as an auxiliary classifier that predicts the class label of the input. This architectural separation enables the discriminator to provide both adversarial and class-discriminative feedback during training.
The inclusion of an auxiliary classifier provides several advantages for intrusion detection tasks. It promotes the generation of high-fidelity labeled synthetic samples, which are particularly valuable in scenarios where labeled data are limited or highly imbalanced. Moreover, by explicitly modeling class information during adversarial training, the AC-GAN enhances the discriminative power of the learned representations. This makes the approach well suited for supervised network traffic classification and data augmentation in cybersecurity applications.

2.4. Model Architecture

Both generator and discriminator are implemented as fully connected feedforward networks. The generator uses ReLU activations in hidden layers and a sigmoid activation in the output layer to produce normalized feature values. The discriminator uses ReLU activations and sigmoid outputs for both authenticity and class prediction. Training alternates between updating the discriminator and the generator, with the discriminator frozen when updating the generator.
From a structural perspective, the generator is composed of a stack of one or more fully connected hidden layers, where the number of layers and neurons per layer can be configured according to the dimensionality of the latent space and the target feature representation. Rectified Linear Unit (ReLU) activation functions are applied in all hidden layers to promote stable gradient propagation and efficient learning. The output layer applies a sigmoid activation function to ensure that generated feature values remain within a bounded range consistent with normalized input data.
The discriminator follows a similar fully connected design and consists of multiple shared hidden layers with configurable widths. These shared layers are followed by two parallel output branches: an authenticity branch that performs binary real/fake discrimination and an auxiliary classification branch that predicts the class label of the input sample. ReLU activations are used throughout the shared hidden layers, while sigmoid activation functions are applied at both output branches.
This architectural formulation is independent of a specific dataset or experimental configuration and can be adapted by adjusting the depth and width of the networks to accommodate different feature dimensionalities, class cardinalities, and application requirements.

2.5. Edge Computing

From a cybersecurity perspective, Edge Computing offers substantial advantages for intrusion detection and threat mitigation. Local analysis of network traffic allows faster detection of malicious behavior, reducing response time and limiting the propagation of attacks. Moreover, sensitive data can be analyzed locally without being exposed to external networks, improving privacy and compliance with data protection requirements.
Edge devices are typically constrained in terms of power consumption, memory, and computational capacity. Therefore, deploying efficient and lightweight machine learning models is essential. Advances in embedded hardware have made it feasible to perform inference with AI models at the edge. In this context, Edge Computing provides a suitable platform for real-time intrusion detection systems that combine high performance with energy efficiency, making it particularly relevant for securing IoT infrastructures.

3. Related Work

There is limited literature addressing the approach to enhance the security of IoT devices through the implementation of machine learning-based intrusion detection systems. Below are highlighted the few works most related to the topic of this paper.
The work [15] investigates the use of Generative Adversarial Networks (GANs) for synthetic data generation in the context of network intrusion detection systems. It reviews popular GAN architectures and evaluates several tabular GAN models, including CTGAN, CopulaGAN, and TableGAN, for generating synthetic IDS data. Through quantitative and qualitative evaluations, the study highlights the potential of GAN-based approaches to address data scarcity and privacy issues in cybersecurity, while also discussing the limitations of current models for tabular network data synthesis. Additionally, various types of GANs have been used in intrusion detection systems, including ACGANs, while not focusing specifically on IoT applications [16,17].
The study presented in [18] addresses the limitations of traditional machine learning approaches for Distributed Denial-of-Service (DDoS) attack detection by proposing a hybrid deep learning–based framework. The proposed AE-MLP model combines an Autoencoder for automatic feature extraction with a Multi-Layer Perceptron for attack classification. By utilizing the compressed feature representations generated by the Autoencoder, the model reduces noise and computational overhead while improving the robustness of the classification process. The experimental evaluation highlights the potential of hybrid deep learning architectures to enhance DDoS detection and classification in large-scale and high-dimensional network traffic environments.
The work [19] proposes a low-complexity convolutional neural network for intrusion detection in in-vehicle networks. The model extracts and fuses features from network messages efficiently, reducing computational requirements while maintaining robust detection performance. This approach demonstrates the potential of lightweight deep learning architectures for real-time intrusion detection in resource-constrained automotive environments.
The paper [20] surveys intrusion detection system methods for in-vehicle networks and performs a categorization based on the deep network architecture used. It explores how deep learning methodologies are employed to develop various intrusion detection system models for enhanced performance and discusses their potential benefits and drawbacks.
The review article [21] provides an analysis of machine learning and deep learning techniques used in creating intrusion detection systems to protect in-vehicle networks from potential cyber threats.
The novelty of the proposed approach lies in the integration of an Auxiliary Classifier GAN (AC-GAN) for both data generation and classification, specifically deployed on the NVIDIA Jetson Orin Nano to enable efficient real-time intrusion detection in IoT environments. Unlike previous works that either focus on GAN-based data augmentation, MLP optimization, or edge computing IDS independently, our framework simultaneously addresses data scarcity and imbalance, high computational cost, and the need for low-latency processing on resource-constrained devices. This combination allows the model to maintain high detection accuracy while operating efficiently at the edge, providing a unique and practical solution for IoT cybersecurity that previous studies do not fully achieve.

4. Methodology

The Auxiliary Classifier Generative Adversarial Network (AC-GAN) [22] is particularly useful in domains where generating labeled data is essential for training and evaluating predictive models. In network traffic analysis, AC-GAN can generate synthetic traffic samples along with their corresponding labels, facilitating the training of classifiers and anomaly detection systems. By combining data generation with classification, AC-GAN enhances the capacity to create high-quality synthetic datasets that preserve underlying patterns of real data [23].
For the current study, the experiment began with the preparation of the dataset. Features were separated from labels, and numerical scaling was applied to ensure that all values fell within an appropriate range for the generator’s activation functions. This step is crucial for stable GAN training and prevents gradient saturation during backpropagation.
Two primary components of AC-GAN were constructed: the generator and the discriminator. The generator consists of multiple fully connected layers, which map a latent noise vector into the feature space of network traffic. Its objective is to generate synthetic samples that resemble real traffic in both distribution and label. The discriminator, conversely, is a dual-output network designed to evaluate whether a given sample is real or generated while simultaneously predicting the class label (benign or attack). This dual-output architecture allows the discriminator to provide feedback for both authenticity and classification, guiding the generator to produce label-consistent samples [24].
The training process integrates both networks in an adversarial setting. During each iteration, a batch of real TCP traffic samples is selected, and a batch of synthetic samples is generated by the generator. The discriminator is then trained to correctly distinguish real samples from synthetic ones while predicting their class labels. Subsequently, the discriminator weights are frozen, and the generator is updated to produce samples that both deceive the discriminator and match the target class label. These steps are repeated iteratively over 20,000 epochs, resulting in gradual improvement of both networks.
Throughout training, the evolution of discriminator and generator losses is continuously monitored. Initially, the discriminator loss is high, reflecting its difficulty in distinguishing between early, low-quality generated samples and real data. Similarly, the generator loss is elevated at the start, as generated samples are crude and easily rejected. As training progresses, losses decrease and fluctuate due to the dynamic interaction between the two networks. These oscillations are characteristic of adversarial training and indicate a moving balance between competing objectives rather than failure.
The quality of the generated samples was periodically evaluated against real traffic data to verify that synthetic examples accurately captured the statistical patterns and distributions necessary for classification, as illustrated in Figure 2.
Figure 2. Workflow of the generative AI-based security approach for IoT environments deployed on the Jetson Orin Nano platform.

5. Experiments

5.1. Dataset

The experiments employed the CICIoT2023 dataset [25], a comprehensive benchmark for intrusion detection in IoT networks. The dataset includes network traffic from 105 IoT devices under both benign and attack scenarios.
A subset of TCP flow-based features was selected to construct the input for the AC-GAN model. These features include flags, packet counts, connection duration, and header lengths (Table 1).
Table 1. Selected TCP Flow-Based Features.
The study focuses on DoS and DDoS attacks, considering only TCP-based variants. The specific attack types analyzed include TCP flood, SYN flood, ACK fragmentation, RSTFIN flood, PSHACK flood, HTTP flood, SlowLoris, and SynonymousIP flood. These attack variants were chosen due to their prevalence in IoT networks and their suitability for real-time detection on resource-constrained edge devices such as the Jetson Orin Nano.
Figure 2 illustrates the system pipeline, showing the flow from data collection and TCP feature extraction to AC-GAN input construction and attack classification on the Jetson Orin Nano. The key novelty of the proposed approach lies in the integration of AC-GAN for both data generation and classification, enabling efficient real-time intrusion detection on resource-constrained edge devices. Unlike prior works that address data augmentation, model optimization, or edge deployment independently, this framework simultaneously tackles data scarcity, class imbalance, and low-latency processing, providing a unique and practical solution for IoT cybersecurity.

5.2. Data Preprocessing

The raw network traffic dataset was first filtered to retain only TCP connections, focusing the analysis on flows governed by the Transmission Control Protocol. Only samples corresponding to DoS attacks and benign traffic were selected as target classes. Exploratory data analysis (EDA) was performed to assess dataset quality, including identification and treatment of missing values, detection of outliers, and removal of anomalous records that could bias model training. Feature distributions were examined to verify consistency and detect potential class imbalances. To prevent information leakage, the dataset was randomly divided into training (70%), validation (15%), and test (15%) sets using a fixed random seed, keeping flows from the same device session together to ensure no flow appears in more than one split. For balanced training, a subset of 10,000 samples was selected from the training set, consisting of 5000 benign and 5000 attack instances. Numerical features were scaled to the range [ 0 ,   1 ] using a Min–Max scaler fitted only on the training data, which was then applied to the validation and test sets. Categorical features such as TCP flags were numerically encoded where necessary.

5.3. Experimental Setup

The AC-GAN model was implemented using TensorFlow. The generator consists of two dense layers with 128 and 256 units (ReLU activations) and a sigmoid output layer, while the discriminator has two dense layers with 256 and 128 units (ReLU activations) and a sigmoid output for real/fake discrimination. The auxiliary classifier predicts class labels simultaneously.
Training was conducted using a batch size of 64 for 20,000 epochs with the Adam optimizer for both the generator and discriminator (learning rate 2 × 10 − 4 , β 1 = 0.5 , β 2 = 0.999 ). Binary cross-entropy loss was applied to both the adversarial and auxiliary classification outputs, providing effective gradients for adversarial learning.
The model was developed and trained using the Python programming language version 3.12.3 within the Jupyter Notebook environment, version 7.2.2, on a workstation equipped with 32 GB RAM, an Intel i7 CPU, and Intel UHD Graphics 620 with 128 MB dedicated VRAM. Training required approximately 10 h, demonstrating reasonable computational efficiency. After training, the model was exported in pickle format and imported into the Jetson Orin Nano for edge deployment. Notably, the model required only 20 epochs to achieve an accuracy exceeding 90%, using a classification threshold of 0.5 to determine accurate class assignments, indicating rapid convergence and effective learning of class-conditional patterns.
The use of AC-GAN for generating synthetic attack data has been shown to be effective in cybersecurity applications. For example, Klinkhamhom et al. [26] reported that AC-GAN achieved the highest F1-score in detecting minority-class attacks compared to GAN and CGAN. These results support the ability of AC-GAN to generate high-quality, class-aware synthetic data, addressing class imbalance and improving classifier performance, while maintaining efficiency suitable for edge computing scenarios on the Jetson Orin Nano.

5.4. Results

The evolution of the discriminator and generator losses throughout the training process is illustrated in Figure 3. The loss curves display oscillatory behavior that is characteristic of adversarial learning, reflecting the competitive interaction between the generator and the discriminator. As training progresses, both networks continuously adapt to each other, resulting in alternating improvements rather than monotonic convergence.
Figure 3. Discriminator vs. Generator Losses during AC-GAN Training.
At the early stages of training, the discriminator loss remains relatively high, indicating its initial difficulty in distinguishing between real and synthetic samples generated by the unrefined generator. Similarly, the generator loss is elevated, as early synthetic samples are easily identified as fake. Over time, the losses decrease and fluctuate within a narrower range, suggesting that the generator produces increasingly realistic samples while the discriminator becomes more selective.
These oscillations are not indicative of training instability but instead represent a dynamic equilibrium between the generator and the discriminator, which jointly perform adversarial discrimination and auxiliary classification. Such behavior is commonly observed in well-trained AC-GAN models and suggests that the framework effectively learns meaningful feature representations from network traffic data while maintaining adversarial balance.
The performance of the AC-GAN model was evaluated using standard classification metrics: accuracy, precision, recall, F1-score, and AUC. Table 2 summarizes the results, showing that the model achieves high accuracy and strong detection capabilities for DoS and DDoS attacks based on TCP traffic.
Table 2. Performance comparison of AC-GAN with MLP and Random Forest classifiers.
For comparison purposes, two widely used supervised learning classifiers, namely a Multi-Layer Perceptron (MLP) and a Random Forest (RF), were implemented in Python using the scikit-learn library. A grid search strategy was applied to tune their main hyperparameters in order to ensure a fair and reproducible comparison with the proposed AC-GAN approach.
For the Random Forest classifier, the number of decision trees was varied between 100, 200, and 300, while all other parameters were kept at their default values. The best performance reported in Table 2 was obtained when using 300 trees.
For the MLP classifier, several neural network architectures were evaluated by varying both the number of hidden layers and the number of neurons per layer. The tested configurations included single-layer and multi-layer networks with 20, 50, and 100 neurons per layer. The best results were achieved with an MLP architecture composed of two hidden layers with 50 neurons each, which is the configuration reported in Table 2. Training was performed using standard backpropagation with default optimization settings provided by the scikit-learn implementation.
AC-GAN achieved the highest recall and F1-score among the evaluated methods, indicating its ability to correctly identify a larger proportion of attack instances. High recall was particularly important in cybersecurity, as it reduced the likelihood of undetected attacks. The improved F1-score reflected a balanced performance between precision and recall, showing that AC-GAN not only detected more attacks but also maintained a relatively low rate of false positives. These results provided a quantitative assessment of AC-GAN’s effectiveness compared to alternative methods, supporting its suitability for accurate and reliable intrusion detection.
Figure 4 presents the Receiver Operating Characteristic (ROC) curve and confusion matrix for AC-GAN, further validating its performance. The ROC curve lies well above the diagonal line representing random guessing, and the AUC of 0.97 indicates excellent discriminative capability. The confusion matrix shows high recall, with a moderate number of false positives that can be mitigated through additional post-processing.
Figure 4. AC-GAN Performance Evaluation.

5.5. Real-Time Implementation

For practical deployment, the trained AC-GAN model was exported and integrated into a Python-based packet analysis workflow using Scapy. Scapy provides extensive functionality for packet generation, capture, and decoding across TCP/IP protocols, making it ideal for real-time traffic analysis.
The real-time operation of the AC-GAN model was flow-based, meaning that incoming packets were not classified individually but were aggregated into network flows. Each flow was identified by the standard 5-tuple: source IP, destination IP, source port, destination port, and protocol. As packets arrived, the system updated the corresponding flow’s statistics, including features such as total duration, packet counts, and TCP flags. Features that could not be derived from a single packet, like duration and cumulative counts, were incrementally computed for the flow in real-time.
Once the flow feature vector was updated, it was reshaped and normalized using the MinMaxScaler fitted during training. The normalized vector was then fed into the AC-GAN discriminator, which assigned a label to the flow. Depending on the prediction, the system either raised an alert for a detected DoS attack or logged the flow as benign. This approach enabled accurate flow-level classification while maintaining real-time processing capability for incoming traffic.
Figure 5 illustrates the classification workflow, while Figure 6 shows its application for DoS prevention.
Figure 5. Network Traffic Classification using AC-GAN on Jetson Orin Nano.
Figure 6. DoS Prevention via Real-Time Network Traffic Classification.
Normalization of the flow feature vector ensured consistency with the training phase, keeping feature magnitudes within the expected range and allowing the AC-GAN discriminator to operate reliably.
Algorithm 1 summarizes the real-time TCP flow classification pipeline implemented on the edge device. The algorithm requires a pre-trained AC-GAN model M and a Min–Max scaler S fitted exclusively on the training data. These components are loaded prior to deployment and remain fixed during real-time operation, ensuring consistent preprocessing and inference behavior. Incoming TCP packets are continuously captured from the network interface and processed sequentially by the system. Each packet is mapped to its corresponding network flow using the standard 5-tuple identifier (source IP, destination IP, source port, destination port, and protocol). For each active flow, cumulative statistics are incrementally updated, including connection duration, packet counts, header-related attributes, and TCP flag occurrences. This flow-based aggregation enables the extraction of temporal and statistical features that cannot be derived from individual packets. Once the flow feature vector is updated, it is reshaped into the format expected by the neural network and normalized using the Min–Max scaler S , ensuring consistency with the data distribution observed during training. The normalized feature vector is then passed to the discriminator component of the AC-GAN model, which simultaneously performs adversarial discrimination and auxiliary classification to predict whether the observed flow corresponds to benign traffic or a denial-of-service attack. Based on the predicted label, the system triggers an alert in the presence of a detected attack or logs the flow as benign otherwise. This continuous processing loop enables real-time, flow-level intrusion detection and makes the proposed approach suitable for deployment on resource-constrained edge platforms such as the Jetson Orin Nano.
To evaluate the practical feasibility of deploying the AC-GAN model on edge devices, key performance metrics were measured on the NVIDIA Jetson Orin Nano, including inference latency, throughput, CPU utilization, memory consumption, power draw, and model size. The model was deployed using the Python/Scapy workflow, and all measurements were collected under CPU-only execution of the classification branch.
Throughput was approximately 2500–3500 flows per minute, which is typical of edge network conditions and reflects the model’s compact architecture and flow-based processing requirements. CPU utilization averaged 20% on the six-core Arm Cortex-A78AE processor, primarily handling packet capture, flow aggregation, and feature extraction. Total memory usage remained moderate at approximately 300 MB under sustained load, accounting for the AC-GAN model, runtime libraries, and intermediate feature representations. Power consumption was estimated at 10–12 W, consistent with prior benchmarking studies of AI workloads on the NVIDIA Jetson Orin Nano [27].
Algorithm 1 Real-Time TCP Flow Classification using AC-GAN
Require: 
Pre-trained AC-GAN model M , MinMaxScaler S
  1:
for each captured TCP packet p do
  2:
Map p to its corresponding flow in the flow Table (5-tuple: src IP, dst IP, src port, dst port, protocol)
  3:
Update cumulative flow features f (duration, header length, TCP flags, packet counts, etc.)
  4:
Reshape f into a feature vector
  5:
Normalize f using S : f ′ = S ( f )
  6:
Predict flow label using AC-GAN: y = M ( f ′ )
  7:
if y indicates DoS attack then
  8:
Raise alert: “[ALERT] DoS attack detected from flow p . s r c → p . d s t ”
  9:
else
10:
Log benign flow: “[INFO] Benign flow from p . s r c → p . d s t ”
11:
end if
12:
end for
Inference latency was measured at approximately 1 s per network flow, corresponding to CPU-only execution of the lightweight classification branch. While higher than millisecond-level packet-based IDS solutions, this flow-based latency is sufficient for timely detection of anomalies in IoT networks and aligns with benchmark measurements reported on Jetson Orin hardware [28].
These results demonstrate that the proposed AC-GAN framework achieves a favorable balance between real-time classification performance, low memory footprint, moderate power consumption, and compact model size, confirming its suitability for operational deployment on the Jetson Orin Nano in IoT security scenarios.

6. Discussion and Results

The performance analysis of the AC-GAN highlights clear strengths, particularly in contexts where high recall is critical, such as intrusion detection systems (IDS). The model demonstrates reliable behavior in detecting almost all positive instances, which is essential for applications where missing a threat carries a high risk.
Precision reached 0.89, indicating that nearly nine out of ten instances predicted as positive are indeed true positives. While this is slightly lower than perfect precision, it represents a reasonable trade-off given the very high recall of 0.97, meaning that the model captures almost all actual positive cases with very few false negatives. The resulting F1-score of 0.93 reflects a strong overall balance between precision and recall.
Overall accuracy is 0.92, which confirms that the model correctly classifies the vast majority of instances. The AUC of 0.97 further demonstrates excellent discriminative power, showing that the classifier can effectively rank positive instances higher than negative ones across a wide range of thresholds. This high AUC confirms the robustness of the AC-GAN’s learned representations and supports its suitability for IDS applications.
The AC-GAN’s combined generative and discriminative design helps explain these results. By learning complex data distributions, the model achieves high recall while maintaining solid precision. The generative component additionally offers the opportunity for data augmentation, generating realistic synthetic samples to enrich training sets, particularly useful when datasets are imbalanced or labeled data are scarce. This capability improves generalization and reduces overfitting, which is crucial for handling diverse and evolving network traffic.
Despite the strong recall, the model does generate some false positives (FP = 153 in the confusion matrix), which is reflected in the slightly lower precision. In the context of an IDS, this trade-off is acceptable, as false positives are typically less critical than false negatives. Nevertheless, further refinement, such as threshold tuning, architectural adjustments, or ensemble techniques, could help reduce false positives while retaining the model’s high recall.
The AC-GAN is particularly well suited to network traffic classification due to its ability to model nonlinear and evolving patterns. Its dual objective design enables confident class assignment and adversarial refinement of internal representations, enhancing resilience to subtle or novel traffic behaviors.
Future research could explore integrating optimization strategies based on deep reinforcement learning (DRL) for dynamic adaptation in time-varying edge environments, inspired by recent works [29,30]. Such approaches may enhance the flexibility of the dual-processor architecture, mitigate multipath interference in edge signal processing (thereby improving effective feature detection reliability and NRTC classification accuracy), and optimize dynamic model selection mechanisms, for example through adaptive CNN model switching. Incorporating these methods may further strengthen the adaptability, robustness, and operational efficiency of AC-GAN-based intrusion detection systems in evolving IoT and edge networks.
Additionally, techniques demonstrated in edge-deployed deep neural networks [31] for efficient real-time inference, resource-aware execution, and lightweight model design may provide insights for applying AC-GAN to other network attack detection tasks, while maintaining low latency and reduced computational overhead for deployment on energy-constrained edge devices.

7. Conclusions

This work presented the application of Auxiliary Classifier GANs (AC-GANs) for detecting suspicious network traffic in IoT environments. By combining generative modeling with classification, the proposed approach not only improves anomaly detection, especially in scenarios with limited labeled data, but also enhances classifier robustness through synthetic data generation and augmentation. The generated samples effectively enrich minority classes and introduce variability, helping the model adapt to evolving attack patterns.
Real-time deployment on resource-constrained edge devices, such as the Jetson Orin Nano, demonstrates the practical feasibility of the approach. The system provides high-precision alerts with minimal false positives, enabling proactive threat detection and immediate response. Flow-based feature aggregation ensures that the model captures meaningful traffic patterns without sacrificing latency or throughput, making it suitable for operational IoT networks.
The proposed framework represents a flexible and scalable solution for network defense. By combining data generation with classification, it strengthens anomaly detection, supports continuous learning, and mitigates the challenges posed by scarce labeled datasets. Future research will consider leveraging DRL-based optimization techniques for non-orthogonal ISAC systems to further improve the adaptability of the dual-processor architecture in dynamic edge scenarios. These strategies could optimize model selection, mitigate multipath interference, and enhance real-time decision-making, thereby increasing the overall flexibility, reliability, and efficiency of AC-GAN-based intrusion detection in operational IoT environments.

Author Contributions

Conceptualization, J.D.-G., C.C.-G. and L.B.; methodology, J.D.-G., C.C.-G. and L.B.; software, J.D.-G., C.C.-G. and L.B.; validation, J.D.-G., C.C.-G. and L.B.; formal analysis, J.D.-G., C.C.-G. and L.B.; investigation, J.D.-G., C.C.-G. and L.B.; resources, J.D.-G., C.C.-G. and L.B.; data curation, J.D.-G., C.C.-G. and L.B.; writing—original draft preparation, J.D.-G., C.C.-G. and L.B.; writing—review and editing, J.D.-G., C.C.-G. and L.B.; visualization, J.D.-G., C.C.-G. and L.B.; supervision, J.D.-G., C.C.-G. and L.B.; project administration, J.D.-G., C.C.-G. and L.B. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by the Recovery, Transformation and Resilience Plan, financed by the European Union (Next Generation EU) under the strategic project C064/23 SCITALA (INCIBE-ULL).

Institutional Review Board Statement

Not applicable.

Data Availability Statement

Data are available on request from the corresponding author.

Acknowledgments

This research has been possible thanks to the SCITALA C064/23 project, the Cybersecurity Chair at the University of La Laguna, INCIBE, and the European Union NextGenerationEU/PRTR.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Zhao, J.; Huang, F.; Hu, H.; Liao, L.; Wang, D.; Fan, L. User security authentication protocol in multi gateway scenarios of the Internet of Things. Ad Hoc Netw. 2024, 156, 103427. [Google Scholar] [CrossRef] [Scilit]
  2. Diaz-Gorrin, J.; Caballero-Gil, P.; Caballero-Gil, C. Real-time personalized detection of cyberbullying and online harassment in social networks using Jetson Nano. In Proceedings of the 2024 11th International Conference on Social Networks Analysis, Management and Security (SNAMS), Gran Canaria, Spain, 9–11 December 2024; pp. 189–196. [Google Scholar] [CrossRef] [Scilit]
  3. Bandekar, A.; Javaid, A.Y. Cyber-attack mitigation and impact analysis for low-power IoT devices. In Proceedings of the 2017 IEEE 7th Annual International Conference on CYBER Technology in Automation, Control, and Intelligent Systems (CYBER), Honolulu, HI, USA, 31 July–4 August 2017; pp. 1631–1636. [Google Scholar] [CrossRef] [Scilit]
  4. Li, Y.; Yang, Y.; Yu, X.; Yang, T.; Dong, L.; Wang, W. IoT-APIScanner: Detecting API unauthorized access vulnerabilities of IoT platform. In Proceedings of the 2020 29th International Conference on Computer Communications and Networks (ICCCN), Honolulu, HI, USA, 3–6 August 2020; pp. 1–5. [Google Scholar] [CrossRef] [Scilit]
  5. Dinakarrao, S.M.P.; Guo, X.; Sayadi, H.; Nowzari, C.; Sasan, A.; Rafatirad, S.; Zhao, L.; Homayoun, H. Cognitive and scalable technique for securing IoT networks against malware epidemics. IEEE Access 2020, 8, 138508–138528. [Google Scholar] [CrossRef] [Scilit]
  6. Soryal, J.; Saadawi, T. IEEE 802.11 DoS attack detection and mitigation utilizing cross layer design. Ad Hoc Netw. 2014, 14, 71–83. [Google Scholar] [CrossRef] [Scilit]
  7. Rohit, M.H.; Fahim, S.M.; Khan, A.H.A. Mitigating and detecting DDoS attack on IoT environment. In Proceedings of the 2019 IEEE International Conference on Robotics, Automation, Artificial-Intelligence and Internet-of-Things (RAAICON), Dhaka, Bangladesh, 29 November–1 December 2019; pp. 5–8. [Google Scholar] [CrossRef] [Scilit]
  8. K., S.; V., S.; Singh, A.; R., A.; Saxena, H.; S., S.S. Detection and mitigation of man-in-the-middle attack in IoT through alternate routing. In Proceedings of the 2022 6th International Conference on Computing Methodologies and Communication (ICCMC), Erode, India, 29–31 March 2022; pp. 341–345. [Google Scholar] [CrossRef] [Scilit]
  9. Sangwan, U.; Chhillar, R.S. A Detailed Comparative Study on Cybersecurity in IoT Environment. Int. J. Syst. Assur. Eng. Manag. 2026. [Google Scholar] [CrossRef] [Scilit]
  10. Diaz-Gorrin, J.; Caballero-Gil, P. Phishing and spam prevention powered by Jetson Nano. In Proceedings of the ICEUTE–CISIS 2024. International Joint Conferences, Salamanca, Spain, 9–11 October 2024; Lecture Notes in Networks and Systems. Springer: Cham, Switzerland, 2024; Volume 957. [Google Scholar] [CrossRef] [Scilit]
  11. Kim, S.; Kim, C.; Kim, S. Improving Performance of Real-Time Object Detection in Edge Device Through Concurrent Multi-Frame Processing. IEEE Access 2025, 13, 1522–1533. [Google Scholar] [CrossRef] [Scilit]
  12. Altulaihan, E.; Almaiah, M.A.; Aljughaiman, A. Anomaly Detection IDS for Detecting DoS Attacks in IoT Networks Based on Machine Learning Algorithms. Sensors 2024, 24, 713. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  13. Goodfellow, I.; Pouget-Abadie, J.; Mirza, M.; Xu, B.; Warde-Farley, D.; Ozair, S.; Courville, A.; Bengio, Y. Generative Adversarial Nets. In Proceedings of the Advances in Neural Information Processing Systems 27 (NIPS 2014), Montréal, QC, Canada, 8–13 December 2014; Available online: https://proceedings.neurips.cc/paper_files/paper/2014/file/f033ed80deb0234979a61f95710dbe25-Paper.pdf (accessed on 22 January 2026).
  14. Odena, A.; Olah, C.; Shlens, J. Conditional Image Synthesis with Auxiliary Classifier GANs. In Proceedings of the 34th International Conference on Machine Learning, Sydney, NSW, Australia, 6–11 August 2017; pp. 2642–2651. Available online: https://proceedings.mlr.press/v70/odena17a.html (accessed on 30 December 2025).
  15. Bourou, S.; El Saer, A.; Velivassaki, T.-H.; Voulkidis, A.; Zahariadis, T. A Review of Tabular Data Synthesis Using GANs on an IDS Dataset. Information 2021, 12, 375. [Google Scholar] [CrossRef] [Scilit]
  16. Zhang, K.; Qin, H.; Jin, Y.; Wang, H.; Yu, X. Auxiliary classifier generative adversarial network assisted intrusion detection system. IEEE Access 2022, 10, 104321–104331. [Google Scholar] [CrossRef] [Scilit]
  17. Zhao, Y.; Li, H.; Wang, Z.; Chen, X. Graph neural network-enhanced auxiliary classifier generative adversarial network framework for robust intrusion detection. Sensors 2024, 24, 3187. [Google Scholar] [CrossRef] [Scilit]
  18. Wei, Y.; Jang-Jaccard, J.; Sabrina, F.; Singh, A.; Xu, W.; Camtepe, S. AE-MLP: A Hybrid Deep Learning Approach for DDoS Detection and Classification. IEEE Access 2021, 9, 146810–146821. [Google Scholar] [CrossRef] [Scilit]
  19. Im, H.; Lee, S. TinyML-Based Intrusion Detection System for In-Vehicle Network Using Convolutional Neural Network on Embedded Devices. IEEE Embed. Syst. Lett. 2025, 17, 67–70. [Google Scholar] [CrossRef] [Scilit]
  20. Luo, F.; Wang, J.; Zhang, X.; Jiang, Y.; Li, Z.; Luo, C. In-vehicle network intrusion detection systems: A systematic survey of deep learning-based approaches. PeerJ Comput. Sci. 2023, 9, e1648. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  21. Almehdhar, M.; Albaseer, A.; Khan, M.A.; Abdallah, M.; Menouar, H.; Al-Kuwari, S.; Al-Fuqaha, A. Deep learning in the fast lane: A survey on advanced intrusion detection systems for intelligent vehicle networks. IEEE Open J. Veh. Technol. 2024, 5, 869–906. [Google Scholar]
  22. Haghbin, Y.; Badiei, M.H.; Tran, N.H.; Piran, M.J. Resilient Federated Adversarial Learning with Auxiliary-Classifier GANs and Probabilistic Synthesis for Heterogeneous Environments. IEEE Trans. Netw. Serv. Manag. 2025, 22, 4998–5014. [Google Scholar] [CrossRef] [Scilit]
  23. Liu, F.; Li, Y.; Zheng, Y. Time Series Data Generation Method with High Reliability Based on ACGAN. Entropy 2025, 27, 111. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  24. Li, J.; Zong, W.; Chow, Y.-W.; Susilo, W. Mitigating Class Imbalance in Network Intrusion Detection with Feature-Regularized GANs. Future Internet 2025, 17, 216. [Google Scholar] [CrossRef] [Scilit]
  25. Neto, E.C.P.; Dadkhah, S.; Ferreira, R.; Zohourian, A.; Lu, R.; Ghorbani, A.A. CICIoT2023: A real-time dataset and benchmark for large-scale attacks in IoT environment. Sensors 2023, 23, 5941. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  26. Klinkhamhom, C.; Wuttidittachotti, P.; Boonyopakorn, P. Comparative Evaluation of GAN, CGAN, and ACGAN for Intrusion Detection in Cybersecurity. In Proceedings of the 2025 International Technical Conference on Circuits/Systems, Computers, and Communications (ITC-CSCC), Seoul, Republic of Korea, 7–10 June 2025; pp. 1–4. [Google Scholar] [CrossRef] [Scilit]
  27. Minott, D.; Siddiqui, S.; Haddad, R.J. Benchmarking Edge AI Platforms: Performance Analysis of NVIDIA Jetson and Raspberry Pi 5 with Coral TPU. In Proceedings of the 2025 IEEE SoutheastCon, Concord, NC, USA, 22–30 March 2025; pp. 1384–1389. [Google Scholar] [CrossRef] [Scilit]
  28. Shah, M.; Chaudhari, J.; Raval, M.S.; Divakaran, S. Performance Evaluation and Analysis of Deep Learning Based Season-Aware Atmospheric Correction Model on Nvidia Jetson AGX Orin. In Proceedings of the 2025 IEEE International Geoscience and Remote Sensing Symposium (IGARSS), Brisbane, QLD, Australia, 3–8 August 2025; pp. 1616–1620. [Google Scholar] [CrossRef] [Scilit]
  29. Ma, Z.; Zhang, R.; Ai, B.; Lian, Z.; Zeng, L.; Niyato, D.; Peng, Y. Deep Reinforcement Learning for Energy Efficiency Maximization in RSMA-IRS-Assisted ISAC System. IEEE Trans. Veh. Technol. 2025, 74, 18273–18278. [Google Scholar] [CrossRef] [Scilit]
  30. Ma, Z.; Liang, Y.; Zhu, Q.; Zheng, J.; Lian, Z.; Zeng, L.; Fu, C.; Peng, Y.; Ai, B. Hybrid-RIS-Assisted Cellular ISAC Networks for UAV-Enabled Low-Altitude Economy via Deep Reinforcement Learning with Mixture-of-Experts. IEEE Trans. Cogn. Commun. Netw. 2026, 12, 3875–3888. [Google Scholar] [CrossRef] [Scilit]
  31. Jiang, D.; Wang, H.; Li, T.; Gouda, M.A.; Zhou, B. Real-Time Tracker of Chicken for Poultry Based on Attention Mechanism-Enhanced YOLO-Chicken Algorithm. Comput. Electron. Agric. 2025, 237, 110640. [Google Scholar] [CrossRef] [Scilit]
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.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.