✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more
Andrii Bidochko
  • Updated: August 22, 2026
  • 6 min read

Machine Learning-Based Cyber Defense for Cloud Infrastructure: An Adaptive Deep Q-Network Architecture for Intelligent Intrusion Detection and Automated Threat Mitigation

{{

Direct Answer

The paper introduces an adaptive cyber‑defense framework that uses a Deep Q‑Network (DQN) to detect intrusions and automatically mitigate threats in cloud infrastructures. By treating security actions as reinforcement‑learning decisions, the system achieves near‑perfect detection accuracy while responding to attacks in under 20 ms, making it viable for real‑time cloud protection.

Background: Why This Problem Is Hard

Cloud environments host a constantly shifting mix of workloads, multi‑tenant traffic, and dynamic scaling, which together create a fertile ground for sophisticated cyber‑attacks. Traditional intrusion‑detection systems (IDS) rely on static signatures or supervised classifiers that struggle with:

  • Zero‑day variants: New attack patterns that were not present in the training data.
  • High false‑positive rates: Over‑alerting overwhelms security operations centers (SOCs) and leads to alert fatigue.
  • Latency constraints: Cloud services demand sub‑second reaction times; many ML models introduce processing delays that are unacceptable for live traffic.
  • Adaptation gap: Attackers continuously evolve tactics, yet most defenses are updated only on a periodic schedule.

These bottlenecks mean that existing approaches—decision trees, support vector machines, random forests, XGBoost, and even deep multilayer perceptrons—cannot simultaneously guarantee high detection quality, low latency, and autonomous response. The research community therefore seeks a method that learns to act, not just to classify.

What the Researchers Propose

The authors present a reinforcement‑learning (RL) driven architecture called Adaptive DQN‑Based Cyber Defense. At a conceptual level, the framework consists of three interacting agents:

  1. Environment Simulator: Mirrors the cloud network, feeding real‑time traffic features (e.g., packet size, protocol flags) into the learning loop.
  2. Deep Q‑Network Agent: Observes the environment state, selects a defensive action (e.g., block IP, isolate VM, trigger a firewall rule), and receives a reward based on the outcome (successful mitigation vs. missed attack).
  3. Policy Updater: Continuously refines the Q‑function using experience replay, ensuring that the agent improves its decision‑making over time.

Key design choices include:

  • Using the CICIDS2017 dataset for initial training, then validating on the UNSW‑NB15 dataset to test cross‑domain generalization.
  • Applying feature engineering (one‑hot encoding, normalization, and temporal aggregation) to transform raw network logs into a compact state vector.
  • Reward shaping that penalizes false positives heavily, encouraging the agent to be precise while still aggressive against true threats.

How It Works in Practice

The operational workflow can be broken down into four stages:

1. Data Ingestion & Pre‑Processing

Network sensors stream flow records into a preprocessing pipeline that extracts 78 salient features per connection. Missing values are imputed, categorical fields are one‑hot encoded, and all features are scaled to a [0,1] range.

2. State Construction

Every 15 ms a sliding window aggregates the most recent feature vectors, producing a state representation that captures both instantaneous and short‑term temporal patterns.

3. Action Selection via DQN

The DQN, a convolutional‑augmented feed‑forward network, receives the state and outputs Q‑values for a discrete action set:

  • Allow traffic (no‑op)
  • Throttle bandwidth
  • Block source IP
  • Isolate affected VM
  • Trigger automated forensic capture

The policy follows an ε‑greedy strategy: most of the time it picks the highest‑valued action, but occasionally explores random actions to avoid local optima.

4. Feedback & Learning

After the action is applied, the environment returns a reward:

  • +1 for correctly stopping an attack.
  • -0.5 for a false positive (unnecessary block).
  • -1 for a false negative (missed intrusion).

These experiences are stored in a replay buffer. Periodically, mini‑batches are sampled to update the network weights via gradient descent, stabilizing learning with a target network.

What Sets This Approach Apart

  • Closed‑loop autonomy: The system not only flags anomalies but also executes mitigation actions without human intervention.
  • Adaptive policy: Continuous reinforcement learning enables the defense to evolve as attackers change tactics.
  • Latency‑aware design: The entire perception‑action cycle completes in roughly 15 ms, satisfying real‑time cloud SLAs.

Evaluation & Results

The authors benchmarked the DQN against five conventional classifiers on two datasets. Evaluation metrics focused on detection quality, false‑positive/negative rates, and operational latency.

Test Scenarios

  • CICIDS2017: 2.8 million labeled flows covering DoS, DDoS, infiltration, and botnet attacks.
  • UNSW‑NB15: 2.5 million flows with a broader set of modern attack vectors, used solely for external validation.

Key Findings

  • Detection performance: The DQN achieved 99.72 % accuracy, 99.68 % precision, 99.65 % recall, and an F1‑score of 99.66 %.
  • ROC‑AUC: 0.999, indicating near‑perfect discrimination between benign and malicious traffic.
  • False‑positive/negative rates: 0.31 % and 0.35 % respectively—substantially lower than the best traditional model (Random Forest at 1.2 % FP, 1.5 % FN).
  • Latency: Average decision latency of 15 ms, compared to 48 ms for the XGBoost baseline.
  • Mitigation success: In a simulated live‑cloud testbed, the framework automatically neutralized 99.54 % of attacks within the first 30 ms of detection.

These results demonstrate that reinforcement learning can close the gap between detection and response, delivering both high fidelity and speed.

Why This Matters for AI Systems and Agents

For practitioners building AI‑driven security agents, the study offers three actionable takeaways:

  • Policy‑centric design: Treating security as a sequential decision problem aligns with the broader trend of autonomous agents that learn from interaction, simplifying integration with existing orchestration platforms.
  • Scalable learning loops: The experience‑replay mechanism can be extended to multi‑tenant clouds, where each tenant contributes anonymized traffic to a shared buffer, accelerating collective learning.
  • Real‑time constraints as a first‑class citizen: The 15 ms latency benchmark sets a practical target for any AI component that must operate within cloud SLAs.

Organizations can embed the DQN module into their security stack via APIs, allowing it to complement signature‑based IDS, SIEM correlation engines, and cloud‑native firewalls. The approach also dovetails with emerging UBOS platform overview, where AI agents orchestrate workflow automation across heterogeneous services.

What Comes Next

While the results are compelling, several limitations remain:

  • State representation granularity: The current feature set captures only packet‑level attributes; incorporating host‑level telemetry (CPU, memory, process logs) could improve detection of lateral movement.
  • Reward engineering: The binary reward scheme may oversimplify complex business impacts; future work could integrate cost‑aware rewards that reflect SLA violations.
  • Robustness to adversarial RL attacks: An attacker that manipulates the reward signal could potentially poison the policy; defensive mechanisms such as reward‑regularization need exploration.

Potential research directions include:

  1. Extending the framework to a multi‑agent setting where several DQNs coordinate across different cloud regions.
  2. Hybridizing model‑based RL with symbolic reasoning to provide explainable mitigation actions.
  3. Deploying the system in a serverless environment, leveraging Enterprise AI platform by UBOS for elastic scaling.

Practitioners interested in prototyping the architecture can start with the OpenAI ChatGPT integration to prototype policy queries, then evolve toward a full DQN implementation.

References

For the full technical details, see the original arXiv paper.

Illustration

Diagram of the Adaptive DQN-Based Cyber Defense Architecture

Call to Action

Ready to explore AI‑powered security for your cloud workloads? Visit the UBOS homepage to learn how their platform can accelerate the deployment of autonomous defense agents.

| replace(‘{{IMAGE_URL}}’, ‘https://generated-image-url.com/image.png’) }}


Andrii Bidochko

CTO UBOS

Andrii Bidochko is an AI entrepreneur and researcher focused on AI agents, reinforcement learning, and autonomous systems. He writes about the technologies shaping the future of machine intelligence, from frontier models and agent architectures to real-world AI applications.

Sign up for our newsletter

Stay up to date with the roadmap progress, announcements and exclusive discounts feel free to sign up with your email.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.