AI Cybersecurity Lab

Intrusion and anomaly detection, malware analysis, threat intelligence, phishing, security logs and incident response: defensive experiments that really compute in your browser on synthetic data, with algorithms, datasets, projects and quizzes.

28interactive experiments

Multi-layer perceptron (MLP)

Algorithm Library · Algorithm Deep Learning Runs in the browser

The idea

Layers of non-linear units learning intermediate representations by back-propagation; here a small network with one hidden layer.

The problem it addresses

Non-linear decision boundaries.

Data it needs

Scaled tabular data.

Equations

h=\operatorname{ReLU}(W_1x+b_1),\quad p=\sigma(w_2^\top h+b_2)

Steps

  1. Initialise weights
  2. Forward pass
  3. Compute loss and gradients
  4. Update weights

Pseudocode

mlp.txt
h = relu(X @ W1 + b1); p = sigmoid(h @ w2 + b2)
dz = p - y; dW2 = h.T @ dz; dh = dz[:,None]*w2 * (h>0)
W1 -= lr * X.T @ dh

Strengths

  • High flexibility
  • Captures interactions

Limitations

  • Sensitive to initialisation and scaling
  • Less interpretable
  • Needs more data

Uses in cybersecurity

  • Advanced intrusion detection
  • Comparison against simpler models

Common pitfalls

  • Deeper networks do not always beat trees on tabular data; compare honestly.

Suggested datasets

Related experiments

References

  1. Arp, Quiring, Pendlebury, Warnecke, Pierazzi, Wressnegger, Cavallaro, Rieck (2024). Pitfalls in Machine Learning for Computer Security. Communications of the ACM 67(11), pp. 104-112. doi:10.1145/3643456