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

AI Cybersecurity Lab

Algorithm Library

Detailed pages for each algorithm and a live comparison table that runs algorithms on synthetic data and measures performance in your browser.

  • 37Items

This lab is educational and defensive only: experiments run in your browser with real computation but on synthetic data, and every experiment is explicitly labelled (real training, simulation or demonstration). Numbers are not real-system performance, and no file is executed and no link is opened.

Algorithms

Supervised Learning (6)

Supervised Learning Runs in the browser

Logistic regression

Estimates the probability that a sample is an attack with a sigmoid over a weighted sum of features, trained by gradient descent on cross-entropy loss.

Details
Supervised Learning Runs in the browser

k-Nearest Neighbours

Labels a sample by the majority of its k nearest training neighbours under Euclidean distance after scaling.

Details
Supervised Learning Runs in the browser

Gaussian Naive Bayes

Assumes features are conditionally independent given the class and Gaussian, then applies Bayes’ rule.

Details
Supervised Learning Runs in the browser

Decision tree

Splits the space with successive threshold rules, choosing at each node the split that reduces Gini impurity most.

Details
Supervised Learning Runs in the browser

Linear SVM (Pegasos)

Finds a maximum-margin separating hyperplane, trained here with Pegasos stochastic gradient descent on the hinge loss.

Details
Supervised Learning Explained only

Flow feature engineering

Turning packets into flow records with features such as duration, bytes, SYN ratio, ports and entropy.

Details

NLP Models (5)

NLP Models Runs in the browser

Multinomial Naive Bayes

Models word counts per class and applies Bayes’ rule; the traditional choice for short-text classification.

Details
NLP Models Runs in the browser

TF-IDF

Weights a word by its frequency in the document and its rarity across documents, so distinctive words stand out.

Details
NLP Models Runs in the browser

URL lexical features

Analysing the URL as characters: length, dots, symbols, “@”, path depth and domain entropy, with no connection.

Details
NLP Models Explained only

Word embeddings

Represent words as dense vectors placing similar meanings near each other.

Details
NLP Models Explained only

BERT and DistilBERT

Transformer language models fine-tuned for text classification; DistilBERT is a smaller, faster distilled version.

Details

Ensemble Learning (4)

Ensemble Learning Runs in the browser

Random forest

Builds many decision trees on bootstrap samples and random feature subsets, then votes or averages their probabilities.

Details
Ensemble Learning Runs in the browser

Gradient boosting (simplified)

Adds small trees sequentially, each correcting the errors of the ensemble so far with a step along the loss gradient.

Details
Ensemble Learning Explained only

XGBoost

An optimised gradient-boosted-trees implementation with explicit regularisation; very common on tabular data.

Details
Ensemble Learning Explained only

LightGBM

Gradient-boosted trees growing leaf-wise and using feature bundling for faster training.

Details

Deep Learning (6)

Deep Learning Runs in the browser

Multi-layer perceptron (MLP)

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

Details
Deep Learning Explained only

Transformers for text

Use self-attention to represent word context and serve in email and report classification.

Details
Deep Learning Explained only

Variational autoencoder (VAE)

A probabilistic autoencoder learning a latent distribution; likelihood or reconstruction error serves as the anomaly score.

Details
Deep Learning Explained only

LSTM autoencoder

Compresses a time sequence with LSTM units and reconstructs it; a large reconstruction error signals an unusual sequence.

Details

Unsupervised Learning (5)

Unsupervised Learning Runs in the browser

Isolation Forest

Isolates points with random splits; anomalies are isolated with fewer splits, so shortness of the average path length measures anomaly.

Details
Unsupervised Learning Runs in the browser

Local Outlier Factor (LOF)

Compares a point’s local density with that of its neighbours; a point sparser than its neighbours gets a higher score.

Details
Unsupervised Learning Runs in the browser

DBSCAN

Groups dense points into clusters and treats points far from every cluster as noise/anomalies.

Details
Unsupervised Learning Runs in the browser

Autoencoder

A network that compresses the input to a small code and reconstructs it; a large reconstruction error signals an unseen pattern.

Details

Semi-Supervised Learning (1)

Rule-based and statistical (non-learning; extra to the eight) (6)

Rule-based and statistical (non-learning; extra to the eight) Runs in the browser

Robust z-score

Measures distance from the median in units of the median absolute deviation (MAD) so the statistics are not distorted by the outliers themselves.

Details
Rule-based and statistical (non-learning; extra to the eight) Runs in the browser

Indicator risk scoring (weighted sum)

Combines factors such as reliability, sightings, recency, asset value and campaign with analyst-set weights.

Details
Rule-based and statistical (non-learning; extra to the eight) Runs in the browser

Incident priority scoring

Ranks incidents by severity, asset value and detection confidence and compares them with a simple manual order.

Details
Rule-based and statistical (non-learning; extra to the eight) Runs in the browser

DGA detection with entropy and lexical features

Measures a domain name’s entropy, length and digit ratio; algorithmically generated names are usually more random. Compared with learned models.

Details
Rule-based and statistical (non-learning; extra to the eight) Explained only

Handling class imbalance

Attacks are usually rare; handle it with recall, PR-AUC, re-weighting and threshold tuning instead of accuracy.

Details

Explainable AI (2)

Explainable AI Runs in the browser

Permutation importance

Measures the drop in performance when one feature’s values are shuffled, showing how much the model depends on it.

Details
Explainable AI Runs in the browser

Shapley values (Monte-Carlo estimate)

Distributes the gap between a prediction and a baseline over features as the average marginal contribution over random orderings. A SHAP-style estimate, not the SHAP library.

Details

Graph Neural Networks (2)