How adderalfox/nids-with-dqn works
This repository is a binary network intrusion detector trained with Deep Q-Learning on UNSW-NB15. Its principal workflow is to preprocess the training data, create an environment and DQN agent, train through repeated action/reward steps, and save a model. The README also describes evaluation by classification metrics and adaptive detection as product capabilities; the available excerpts do not establish how the test script uses the saved model or implements those capabilities, so those links are left unverified.
Main entry points: train.py Training loop · preprocess.py Feature preprocessing · dqn_agent.py DQN agent · dqn_nids_model.pth Trained model
Components 11
Traffic data
- Training traffic
UNSW_NB15_training-set.csv - Testing traffic
UNSW_NB15_testing-set.csv - Feature preprocessing
preprocess.py
RL training
- Training loop
train.py - Detection environment
nids_env.py - DQN agent
dqn_agent.py - Replay learning
dqn_agent.py
Models and evaluation
- Training checkpoints
- Trained model
dqn_nids_model.pth - Metric evaluation
test.py
Other components
- Model operator
Connections 16
- Model operator → Training loop: starts training
train.py - Training loop → Feature preprocessing: calls
train.py - Training traffic → Feature preprocessing: loads
- Testing traffic → Feature preprocessing: loads
- Feature preprocessing → Training loop: returns features
train.py - Training loop → Detection environment: creates
train.py - Training loop → DQN agent: creates
train.py - Training loop → Detection environment: resets and steps
train.py - Training loop → DQN agent: selects actions
train.py - Training loop → DQN agent: stores transitions
train.py - Training loop → Replay learning: trains periodically
train.py - DQN agent → Replay learning: updates networks
dqn_agent.py - Training loop → Training checkpoints: saves checkpoints
train.py - Training loop → Trained model: saves weights
train.py - Model operator → Metric evaluation: evaluates metrics
README.md - Trained model → Metric evaluation: evaluates with