AI to Detect the Threats Firewalls Ignore
An attacker only has to be right once. A defender has to be right every time, and works with limited time against the attacker’s unlimited time. This is the defender’s dilemma, and it’s the starting point of the talk: can AI flip that equation by cutting detection time, alert volume, and exposure to zero-day attacks?
What is a NIDS?
A Network Intrusion Detection System is the second line of defense: it catches what the firewall let through. It sits between the network and the SIEM, ultimately feeding the SOC — and it shouldn’t be confused with a HIDS, which watches the host instead of the network.
There are two detection paradigms, and they’re complementary rather than competing:
- Signatures: fast and precise, but blind to zero-days and dependent on manual updates.
- Anomalies: catch the unknown through machine learning, at the cost of more false positives and higher latency.
In practice, a robust NIDS chains both: signatures for the known, anomalies for what signatures can’t see.
From theory to code: UNSW-NB15
For the hands-on part we used the UNSW-NB15 dataset (Australian Centre for Cyber Security), with 49 features per network connection (IPs, ports, protocol, state…). Using pandas for loading and scikit-learn/PyTorch for modeling, we compared six approaches on the same binary classification problem (normal traffic vs. attack):
| Model | Accuracy | Precision | Recall | F1 |
|---|---|---|---|---|
| Random Forest | 0.951 | 0.964 | 0.960 | 0.962 |
| XGBoost | 0.941 | 0.963 | 0.944 | 0.953 |
| Simple Neural Network | 0.926 | 0.930 | 0.956 | 0.943 |
| K-Nearest Neighbors | 0.919 | 0.939 | 0.934 | 0.937 |
| SVM (linear kernel, 10%) | 0.893 | 0.858 | 0.999 | 0.923 |
| Autoencoder | 0.738 | 0.859 | 0.706 | 0.775 |
A few quick takeaways from the benchmark:
- Random Forest wins on overall balance — still hard to beat as a baseline on tabular network data.
- The SVM misses almost no attacks (recall 0.999), but at the cost of many false positives — the kind of trade-off a real SOC has to decide on explicitly.
- The autoencoder, trained only on normal traffic to detect anomalies via reconstruction error, performs worse here than the supervised models — consistent with the “catches the unknown, but worse and slower” trade-off from the signatures-vs-anomalies picture.
Where this is headed
We closed with four threads that will shape the next generation of NIDS: adversarial attacks (what happens when the detector itself is the target?), XAI (a SOC can’t act on an alert it can’t explain), LLMs in the SOC (natural-language triage and alert correlation), and agentic AI (systems that don’t just alert, but investigate and respond).
AI doesn’t replace the firewall or the analyst. It empowers them.