Detector: Simulation & Shallow Autoencoder

Cyber Anomaly Detection & Dependency Risk: synthetic telemetry, attack scenarios, and a base-R autoencoder

Unit of observation

One row = one host × one 5-minute window, with that window’s authentication activity for the host’s users joined in. Each simulated host runs for 14 days (4,032 windows) starting on a Monday. Hosts are split, not windows, so the model is always scored on hosts it has never seen:

Set Hosts Windows Use
Training 4 16,128 Fit preprocessing and the autoencoder
Validation (held-out) 4 16,128 Early stopping and the EVT threshold fit
Test, normal 2 8,064 Measure false alarms
Test, attacks 4 (attack pool) 3,120 Measure detection

All data on this site are simulated. Every parameter is in params.yaml and labelled as an assumption.

How to read the table. Each row is one slice of the simulated data. A host is one simulated machine, and a window is five minutes of its activity, so one host over 14 days contributes 4,032 windows. The last column says what each slice is used for. Training data teaches the model what normal looks like. The other slices come from different hosts and are used only to set thresholds and to measure performance.

What the table tells you. The model is always judged on machines it has never seen, which is closer to a real deployment than reusing windows from the same machines. The test set holds 8,064 normal windows and 3,120 attack windows, so attacks make up about 28% of it, far more than on any real network. That proportion flatters some measures, which the Evaluation page corrects for.

Telemetry generator

The original version of this study drew all 16 features independently. With independent, unit-variance inputs, a 4-unit bottleneck can at best keep 4 of 16 dimensions, so the lowest achievable reconstruction error was \(12/16 = 0.75\). That was exactly where the old training curve flattened. The plateau did not show the model learning business patterns. It showed the model hitting the floor for data with no structure to learn.

The generator now has structure. Each feature is driven by shared latent factors through a Gaussian copula:

  • Business activity follows a daily cycle peaking at 13:00, is lower at weekends (30% of the weekday peak), and has AR(1) persistence (\(\phi = 0.5\)).
  • Host workload, plus shared network-volume, authentication-volume and process-activity factors, each AR(1) with \(\phi = 0.5\).
  • Host role, a constant per host, so hosts differ from one another, as real fleets do.

For each window the latent factors plus independent noise give correlated standard-normal scores. pnorm() turns these into uniforms, and the quantile function of each target distribution (qpois, qlnorm, qbeta, …) maps them onto realistic marginals. Three features were added to support a real lateral-movement scenario: new destination hosts, SMB/RDP/WinRM connections and new service creations. That makes \(d = 19\).

Display code
marginal_text <- c(
  auth_failed_logins = "Poisson(1.2)", auth_priv_escalations = "Poisson(0.1)",
  auth_unique_source_ips = "1 + Poisson(2)", auth_off_hours_flag = "Bernoulli(0.08)",
  auth_token_refresh_rate = "Normal(12, 2.5)", auth_new_dest_hosts = "Poisson(0.5)",
  net_bytes_out_kb = "Log-normal(7.5, 0.8)", net_packet_velocity = "Normal(450, 60)",
  net_port_entropy = "Uniform(0.15, 0.45)", net_dns_query_rate = "Poisson(35)",
  net_tls_duration_sec = "5 + Exponential(mean 45)", net_syn_ack_ratio = "Normal(1.02, 0.05)",
  net_smb_rdp_winrm_conns = "Poisson(1.5)", host_cpu_utilization = "100 × Beta(4, 6)",
  host_memory_pressure = "Normal(62, 8)", host_child_process_cnt = "Poisson(8)",
  host_fs_write_bursts = "Poisson(14)", host_active_threads = "Normal(120, 15)",
  host_new_service_creations = "Poisson(0.05)"
)
factor_label <- c(A = "activity", W = "workload", R = "role", G_net = "network volume",
                  G_auth = "auth volume", G_proc = "process activity")
feature_spec |>
  pivot_longer(all_of(latent_names), names_to = "factor", values_to = "loading") |>
  filter(loading != 0) |>
  summarise(drivers = paste0(factor_label[factor], " (", sprintf("%+.2f", loading), ")", collapse = ", "),
            .by = c(feature, plane)) |>
  mutate(marginal = marginal_text[feature], .after = plane) |>
  gt() |>
  tab_header(title = "Simulated Telemetry Features", subtitle = "Marginal distribution and latent-factor loadings") |>
  cols_label(feature = "Feature", plane = "Plane", marginal = "Marginal distribution",
             drivers = "Latent drivers (loading)") |>
  tab_options(table.font.size = 12)
Table 1
Simulated Telemetry Features
Marginal distribution and latent-factor loadings
Feature Plane Marginal distribution Latent drivers (loading)
auth_failed_logins Identity Poisson(1.2) activity (+0.30), auth volume (+0.55)
auth_priv_escalations Identity Poisson(0.1) activity (+0.20), role (+0.30)
auth_unique_source_ips Identity 1 + Poisson(2) activity (+0.35), auth volume (+0.55)
auth_off_hours_flag Identity Bernoulli(0.08) activity (-0.55)
auth_token_refresh_rate Identity Normal(12, 2.5) activity (+0.40), auth volume (+0.15)
auth_new_dest_hosts Identity Poisson(0.5) activity (+0.30), role (+0.30)
net_bytes_out_kb Network Log-normal(7.5, 0.8) activity (+0.50), network volume (+0.55)
net_packet_velocity Network Normal(450, 60) activity (+0.50), network volume (+0.60)
net_port_entropy Network Uniform(0.15, 0.45) activity (+0.20), network volume (+0.20)
net_dns_query_rate Network Poisson(35) activity (+0.50), workload (+0.20)
net_tls_duration_sec Network 5 + Exponential(mean 45) activity (+0.30), network volume (+0.60)
net_syn_ack_ratio Network Normal(1.02, 0.05) network volume (+0.15)
net_smb_rdp_winrm_conns Network Poisson(1.5) activity (+0.40), workload (+0.20), role (+0.30)
host_cpu_utilization Host 100 × Beta(4, 6) activity (+0.30), workload (+0.60), process activity (+0.40)
host_memory_pressure Host Normal(62, 8) activity (+0.20), workload (+0.50)
host_child_process_cnt Host Poisson(8) activity (+0.20), workload (+0.30), process activity (+0.50)
host_fs_write_bursts Host Poisson(14) activity (+0.20), workload (+0.30), process activity (+0.30)
host_active_threads Host Normal(120, 15) activity (+0.30), workload (+0.60), process activity (+0.40)
host_new_service_creations Host Poisson(0.05) workload (+0.20), role (+0.20)

How to read the table. Each row is one simulated telemetry feature, grouped by plane: identity, network or host. “Marginal distribution” is the shape the feature takes on its own, such as a count with a given average. “Latent drivers” lists the hidden factors that move the feature and how strongly, on a scale from −1 to +1. Two features that share a driver tend to rise and fall together, as related measurements do in real systems.

What the table tells you. Almost every feature responds to business activity, so the whole feature set follows the working day. Smaller groups share narrower factors: bytes, packets and TLS session length move together, as do CPU, threads and child processes. That shared structure is what any detector can learn and exploit. A few rare counts, such as new service creations, have almost no shared structure, and they turn out to cause most false alarms later on.

Display code
host1 <- main$study$train
pairs <- tribble(
  ~a,                        ~b,                          ~target,
  "net_bytes_out_kb",        "net_packet_velocity",       0.6,
  "net_bytes_out_kb",        "net_tls_duration_sec",      0.5,
  "auth_failed_logins",      "auth_unique_source_ips",    0.4,
  "host_cpu_utilization",    "host_active_threads",       0.6,
  "host_cpu_utilization",    "host_child_process_cnt",    0.4
)
cor_check <- pairs |>
  mutate(realized = map2_dbl(a, b, \(x, y) train_cor[x, y])) |>
  add_row(a = "auth_off_hours_flag", b = "latent business activity (host 1)", target = -0.3,
          realized = cor(host1$auth_off_hours_flag, host1$activity_index))
cor_check |>
  gt() |>
  tab_header(title = "Target vs Realized Correlations", subtitle = "Spearman correlation on the training windows") |>
  cols_label(a = "Feature", b = "Paired with", target = "Target ρ", realized = "Realized ρ") |>
  fmt_number(c(target, realized), decimals = 2) |>
  tab_options(table.font.size = 12)
Table 2
Target vs Realized Correlations
Spearman correlation on the training windows
Feature Paired with Target ρ Realized ρ
net_bytes_out_kb net_packet_velocity 0.60 0.57
net_bytes_out_kb net_tls_duration_sec 0.50 0.47
auth_failed_logins auth_unique_source_ips 0.40 0.36
host_cpu_utilization host_active_threads 0.60 0.59
host_cpu_utilization host_child_process_cnt 0.40 0.41
auth_off_hours_flag latent business activity (host 1) −0.30 −0.28

How to read the table. Each row pairs two features that the independent review asked to be correlated, as they would be in real telemetry. “Target” is the correlation designed into the simulator, and “Realized” is what the simulated training data actually shows. Correlation runs from −1, where one feature always falls as the other rises, through 0, no relationship, to +1, where the two always move together. The last row compares off-hours logins with overall business activity.

What the table tells you. Every realized correlation lands within 0.04 of its target, so the simulator produces the relationships it was designed to produce. That matters because the original version drew every feature independently, which left a model nothing to learn beyond distance from average. The negative off-hours relationship is also as intended: logins outside working hours happen when the business is quiet, so they are mildly unusual in their own right.

Display code
as_tibble(train_cor, rownames = "x") |>
  pivot_longer(-x, names_to = "y", values_to = "rho") |>
  mutate(x = factor(x, levels = feature_cols), y = factor(y, levels = rev(feature_cols))) |>
  ggplot(aes(x, y, fill = rho)) +
  geom_tile(colour = "white", linewidth = 0.5) +
  scale_fill_gradient2(low = "#e34948", mid = "#f0efec", high = "#2a78d6", midpoint = 0,
                       limits = c(-1, 1), name = "Spearman ρ") +
  labs(title = "Realized Correlation Matrix", subtitle = "Training windows, all four training hosts", x = NULL, y = NULL) +
  theme(axis.text.x = element_text(angle = 60, hjust = 1, size = 9), axis.text.y = element_text(size = 9),
        panel.grid = element_blank())
Figure 1

How to read the plot. Each square shows how strongly two features move together across the training data. Blue means they rise together, red means one rises as the other falls, and pale grey means no relationship. Darker colour means a stronger relationship. The diagonal compares each feature with itself and is always solid blue. The matrix is symmetric, so the lower-left triangle mirrors the upper-right, and reading either half is enough to see the full pattern.

What the plot tells you. The features form blocks: network-volume measures move together, host-process measures move together, and a faint blue wash across almost everything reflects the shared business-activity cycle. Off-hours logins form the only negative row. Rare counts such as privilege escalations and new service creations are nearly unrelated to everything else, so their occasional spikes cannot be predicted from other features. That later drives the heavy tail of normal losses on the Thresholds page.

Display code
host1 |>
  filter(timestamp >= as.POSIXct("2026-01-09", tz = "UTC"), timestamp < as.POSIXct("2026-01-12", tz = "UTC")) |>
  select(timestamp, `Outbound KB` = net_bytes_out_kb, `Failed logins` = auth_failed_logins,
         `CPU utilization (%)` = host_cpu_utilization) |>
  pivot_longer(-timestamp) |>
  mutate(hourly = as.numeric(stats::filter(value, rep(1 / 12, 12), sides = 2)), .by = name) |>
  ggplot(aes(timestamp)) +
  geom_line(aes(y = value), colour = "#c3c2b7", linewidth = 0.3) +
  geom_line(aes(y = hourly), colour = "#2a78d6", linewidth = 1) +
  facet_wrap(~name, ncol = 1, scales = "free_y") +
  scale_x_datetime(date_breaks = "12 hours", date_labels = "%a %H:%M") +
  labs(title = "Three Days of Telemetry for One Host",
       subtitle = "Friday to Sunday; grey = 5-minute windows, blue = 1-hour rolling mean",
       x = NULL, y = NULL)
Figure 2

How to read the plot. Each panel shows one feature for one simulated host from Friday through Sunday. The grey line is the raw value in each five-minute window, and the blue line is a one-hour rolling average that smooths out window-to-window noise so the underlying rhythm is visible. The horizontal axis marks days and times. Each panel has its own vertical scale, because the three features are measured in different units: kilobytes, a count and a percentage.

What the plot tells you. The hourly averages rise during Friday working hours, fall overnight, and show smaller bumps at the weekend. Short runs of high or low values show that busy periods persist from one window to the next. The daily cycle is modest next to the window-to-window noise, as it is in real telemetry. The original simulator had none of this: every row was an independent draw with no notion of time, day or host.

Attack scenarios

Each attack is injected into real normal windows from separate attack-pool hosts, at three intensity tiers with 150 windows per cell. The high tier reproduces the original study’s magnitudes. The low tier is the stealthy case.

Display code
rng <- \(r) sprintf("×%s–%s", r[[1]], r[[2]])
cnt <- \(add, pois) paste0("+", if (add > 0) add else "", if (add > 0 && pois > 0) " + " else "", if (pois > 0) sprintf("Poisson(%s)", pois) else "")
desc <- list(
  data_exfiltration = \(s) sprintf("bytes %s, TLS duration %s, port entropy %s", rng(s$bytes_mult), rng(s$tls_mult), rng(s$entropy_mult)),
  credential_stuffing = \(s) sprintf("source IPs %s, failed logins %s", cnt(s$ips_add, s$ips_pois), cnt(s$fails_add, s$fails_pois)),
  privilege_escalation = \(s) sprintf("privilege escalations +%s", s$priv_add),
  ransomware_staging = \(s) sprintf("child processes %s, file-write bursts %s, DNS %s", cnt(s$child_add, s$child_pois), cnt(s$fs_add, s$fs_pois), rng(s$dns_mult)),
  lateral_movement = \(s) sprintf("new destination hosts %s, SMB/RDP/WinRM %s, new services +%s%s", cnt(s$dest_add, s$dest_pois), cnt(s$smb_add, s$smb_pois), s$svc_add, if (s$svc_prob > 0) sprintf(" + Bernoulli(%s)", s$svc_prob) else "")
)
ls <- cfg$low_and_slow
attack_table <- imap(cfg$attacks, \(a, key) {
  tibble(scenario = a$label, tier = tier_levels, change = map_chr(tier_levels, \(t) desc[[key]](a[[t]])))
}) |>
  bind_rows() |>
  add_row(scenario = ls$label, tier = "low",
          change = sprintf("%d campaigns of %d–%d consecutive windows: bytes %s, TLS %s, port entropy %s",
                           ls$n_campaigns, ls$length[[1]], ls$length[[2]], rng(ls$bytes_mult), rng(ls$tls_mult), rng(ls$entropy_mult)))
attack_table |>
  gt(groupname_col = "scenario") |>
  tab_header(title = "Attack Scenarios by Intensity Tier", subtitle = "Changes applied to a normal window") |>
  cols_label(tier = "Tier", change = "Change applied") |>
  tab_options(table.font.size = 12, row_group.font.weight = "bold")
Table 3
Attack Scenarios by Intensity Tier
Changes applied to a normal window
Tier Change applied
Data Exfiltration
low bytes ×1.5–3, TLS duration ×1.5–3, port entropy ×0.7–0.9
medium bytes ×5–10, TLS duration ×5–10, port entropy ×0.7–0.9
high bytes ×25–60, TLS duration ×8–20, port entropy ×0.7–0.9
Credential Stuffing
low source IPs +4 + Poisson(2), failed logins +1 + Poisson(1)
medium source IPs +15 + Poisson(5), failed logins +3 + Poisson(2)
high source IPs +Poisson(80), failed logins +Poisson(45)
Privilege Escalation
low privilege escalations +1
medium privilege escalations +2
high privilege escalations +4
Ransomware Staging
low child processes +3 + Poisson(2), file-write bursts +6 + Poisson(3), DNS ×1.2–1.6
medium child processes +12 + Poisson(5), file-write bursts +20 + Poisson(10), DNS ×2–4
high child processes +Poisson(35), file-write bursts +Poisson(60), DNS ×4–10
Lateral Movement
low new destination hosts +1 + Poisson(1), SMB/RDP/WinRM +2 + Poisson(1), new services +0 + Bernoulli(0.3)
medium new destination hosts +3 + Poisson(2), SMB/RDP/WinRM +6 + Poisson(3), new services +1
high new destination hosts +10 + Poisson(5), SMB/RDP/WinRM +20 + Poisson(10), new services +3
Low-and-Slow Exfiltration
low 30 campaigns of 12–48 consecutive windows: bytes ×1.5–3, TLS ×1.2–2, port entropy ×0.7–0.9

How to read the table. Each group is one attack type and each row one intensity tier, from low (stealthy) to high (loud). The last column describes how a normal window is altered to create the attack. “×1.5–3” means the feature is multiplied by a random factor between 1.5 and 3, and “+Poisson(2)” means a random count averaging 2 is added. Low-and-slow exfiltration spreads modest changes across one to four hours of consecutive windows.

What the table tells you. The high tier reproduces the original study’s attack sizes, and the low tier is the realistic stealthy case. Three design changes matter. Exfiltration now slightly lowers port entropy instead of pushing it out of range, which had made it trivially separable. Privilege escalation is now its own scenario. The old “zero-day lateral movement” is renamed ransomware staging, which it resembles, and true lateral movement now uses new host-to-host features.

Preprocessing

A recipes pipeline applies a Yeo-Johnson transform and then standardizes each feature to zero mean and unit variance. Both steps are estimated on the training hosts only and applied unchanged to validation and test windows, so no information leaks from evaluation data.

Shallow autoencoder

Architecture. Let \(X \in \mathbb{R}^{N \times d}\) be a batch of \(N\) windows across \(d = 19\) features. The encoder maps to a \(k = 4\)-unit bottleneck with a \(\tanh\) activation, and a linear decoder maps back:

\[Z = \tanh\left(X W_e + \mathbf{1}_N \mathbf{b}_e^\top\right), \qquad \hat{X} = Z W_d + \mathbf{1}_N \mathbf{b}_d^\top,\]

with \(W_e \in \mathbb{R}^{d \times k}\), \(\mathbf{b}_e \in \mathbb{R}^k\), \(W_d \in \mathbb{R}^{k \times d}\), \(\mathbf{b}_d \in \mathbb{R}^d\). One hidden layer with a linear decoder is a shallow autoencoder, close to principal component analysis. The sensitivity table below confirms this.

Loss. Training minimizes the batch mean squared error, and each window is scored by its own mean squared error over features:

\[\mathcal{L}(X, \hat{X}) = \frac{1}{N d}\,\lVert X - \hat{X} \rVert_F^2, \qquad \ell(\mathbf{x}) = \frac{1}{d}\,\lVert \mathbf{x} - \hat{\mathbf{x}} \rVert^2 .\]

Gradients. By matrix calculus,

\[\frac{\partial \mathcal{L}}{\partial \hat{X}} = \frac{2}{N d}(\hat{X} - X), \quad \frac{\partial \mathcal{L}}{\partial W_d} = Z^\top \frac{\partial \mathcal{L}}{\partial \hat{X}}, \quad \frac{\partial \mathcal{L}}{\partial \mathbf{b}_d} = \mathbf{1}_N^\top \frac{\partial \mathcal{L}}{\partial \hat{X}},\]

\[\Delta_Z = \left(\frac{\partial \mathcal{L}}{\partial \hat{X}} W_d^\top\right) \odot (1 - Z^2), \quad \frac{\partial \mathcal{L}}{\partial W_e} = X^\top \Delta_Z, \quad \frac{\partial \mathcal{L}}{\partial \mathbf{b}_e} = \mathbf{1}_N^\top \Delta_Z .\]

Parameters are updated with Adam (bias-corrected first and second moments, learning rate 0.005, batch size 256) from Xavier-initialized weights. Training stops early when validation loss has not improved for 5 epochs, and the best weights are kept. The implementation (R/ae.R) handles any stack of \(\tanh\) layers, which the sensitivity check uses.

Gradient check

Display code
analysis$grad_check |>
  mutate(parameter = case_when(
    model == "Shallow (d-4-d)" & layer == 1 ~ paste0(block, "_e (encoder)"),
    model == "Shallow (d-4-d)" & layer == 2 ~ paste0(block, "_d (decoder)"),
    .default = sprintf("layer %d %s", layer, block)
  )) |>
  select(model, parameter, n_params, rel_error) |>
  gt(groupname_col = "model") |>
  tab_header(title = "Analytic vs Finite-Difference Gradients",
             subtitle = "Central differences, h = 1e-5, on a 32-window batch") |>
  cols_label(parameter = "Parameter block", n_params = "Entries", rel_error = "Relative error") |>
  fmt_scientific(rel_error, decimals = 1) |>
  tab_options(table.font.size = 12, row_group.font.weight = "bold")
Table 4
Analytic vs Finite-Difference Gradients
Central differences, h = 1e-5, on a 32-window batch
Parameter block Entries Relative error
Shallow (d-4-d)
W_e (encoder) 76 1.5 × 10−10
b_e (encoder) 4 2.9 × 10−10
W_d (decoder) 76 1.0 × 10−10
b_d (decoder) 19 2.0 × 10−10
Deeper (d-8-4-8-d)
layer 1 W 152 1.6 × 10−10
layer 1 b 8 3.4 × 10−10
layer 2 W 32 8.1 × 10−11
layer 2 b 4 1.0 × 10−10
layer 3 W 32 1.1 × 10−10
layer 3 b 8 1.2 × 10−10
layer 4 W 152 2.4 × 10−10
layer 4 b 19 1.4 × 10−10

How to read the table. The autoencoder learns by following gradients: formulas that say how to adjust each weight to reduce error. We derived these by hand. Each row compares the hand-derived gradient for one block of weights with a brute-force estimate obtained by nudging every weight slightly and measuring how the error changes. The relative error column shows how far apart the two answers are, as a share of their size.

What the table tells you. The largest disagreement is 3.4e-10, far below the one-in-a-million pass mark, for both the shallow model and the deeper variant. The hand-derived mathematics and the code that implements it agree, so the model is learning what we think it is learning. The unit tests repeat this check automatically every time the project runs, so a later code change cannot silently break the training.

Training

Display code
tibble(epoch = seq_along(m$train_losses), Training = m$train_losses, Validation = m$val_losses) |>
  pivot_longer(-epoch, names_to = "set", values_to = "mse") |>
  ggplot(aes(epoch, mse, colour = set)) +
  geom_hline(yintercept = floor_indep, linetype = "dashed", colour = "#52514e") +
  annotate("text", x = length(m$train_losses) / 2, y = floor_indep, vjust = -0.5, hjust = 0.5, size = 3.5, colour = "#52514e",
           label = sprintf("Floor if features were independent: (d - k)/d = %.3f", floor_indep)) +
  geom_vline(xintercept = m$best_epoch, linetype = "dotted", colour = "#52514e") +
  geom_line(linewidth = 1) +
  scale_colour_manual(values = c(Training = "#2a78d6", Validation = "#eb6834"), name = NULL) +
  labs(title = "Autoencoder Loss Convergence",
       subtitle = sprintf("Mean squared error per epoch; dotted line = best validation epoch (%d)", m$best_epoch),
       x = "Epoch", y = "Mean squared error")
Figure 3

How to read the plot. The horizontal axis counts training passes through the data (epochs), and the vertical axis is the average reconstruction error. Blue is error on the training hosts. Orange is error on held-out validation hosts that the model never trains on. The dashed line is the best any four-unit model could achieve if the features had no shared structure, and the dotted vertical line marks the epoch whose weights were kept.

What the plot tells you. Training error settles at 0.590, well below the no-structure floor of 0.789, so the model has found real shared patterns. Validation error (0.612) is slightly higher, probably because the validation hosts differ in role from the training hosts. A linear principal component analysis with four components reaches almost the same validation error (0.610), so the network is essentially learning what that simpler method learns.

Architecture sensitivity

Display code
analysis$arch_sweep |>
  gt() |>
  tab_header(title = "Architecture Sensitivity", subtitle = "Main seed; same training, validation and test windows") |>
  cols_label(model = "Model", train_mse = "Training MSE", val_mse = "Validation MSE",
             best_epoch = "Best epoch", roc_auc = "ROC AUC (all attacks)") |>
  fmt_number(c(train_mse, val_mse, roc_auc), decimals = 3) |>
  fmt_number(best_epoch, decimals = 0) |>
  sub_missing(missing_text = "–") |>
  tab_options(table.font.size = 12)
Table 5
Architecture Sensitivity
Main seed; same training, validation and test windows
Model Training MSE Validation MSE Best epoch ROC AUC (all attacks)
Shallow d-2-d 0.718 0.753 52 0.811
Shallow d-4-d 0.592 0.611 29 0.792
Shallow d-8-d 0.387 0.390 60 0.768
Deeper d-8-4-8-d 0.504 0.518 60 0.787
PCA, k = 2 (linear reference) 0.717 0.752 – 0.810
PCA, k = 4 (linear reference) 0.589 0.610 – 0.790
PCA, k = 8 (linear reference) 0.386 0.387 – 0.748

How to read the table. Each row is a different model trained on the same data. “d-4-d” means 19 inputs squeezed through 4 internal units and expanded back to 19 outputs, and the deeper model adds a layer on each side. The PCA rows are the linear equivalent with the same number of components. Lower reconstruction error means normal windows are copied more faithfully. ROC AUC measures how well attacks are ranked above normal windows, from 0.5 (chance) to 1.

What the table tells you. Each autoencoder performs much like the PCA of the same size, in error and in detection. Better reconstruction does not mean better detection: the 19-8-19 model reconstructs best but ranks attacks worst of the autoencoders, because it also learns to copy part of the attack signal. The deeper network adds nothing on detection either. We keep the shallow four-unit model and test it against simple baselines on the Evaluation page.