When a large network of sensors or machines is monitored for a localized fault, the detector has two problems. First, in a big network random noise alone will produce patches that look anomalous, so the smallest detectable anomaly has to grow with network size. On a line of $n$ nodes this minimum grows like $\log n$. Second, the detector cannot afford to keep every sample from every node in memory. The first problem has a clean theory, the second has a mature engineering toolkit of sketches (compact summaries with provable error), and the two have never been joined. This proposal asks one question: when memory per network is capped at $M$, how large must an anomaly be before a distribution-free detector can still find it, and how does the network's shape change the answer?
Our claim is that the right way to spend limited memory is to follow the network's geometry. We summarize each node's data stream as a short vector of random features, which is a compressed stand-in for a kernel comparison of distributions. We then merge the summaries of neighboring nodes into blocks along a partition that cuts few edges. We predict that the memory-limited detection threshold is set by how much of an anomaly's region falls on block boundaries. That makes the memory cost topology-dependent in a checkable way. On lines, rings and low-dimensional grids, geometry-aligned blocks should keep the optimal $\log n$ threshold down to memory of order $nD/\log n$. Random hashing of nodes, which is the design used in current constant-memory graph sketches, should do strictly worse at the same memory. On expander-like or scale-free graphs, where no low-boundary partition exists, the advantage should disappear. That negative prediction makes the claim falsifiable.
Core Claim
The setting follows Zou, Liang and Poor. Most nodes draw samples from a distribution $p$, and nodes in an unknown connected structure $S$ draw from $q \neq p$. The test compares distributions through the maximum mean discrepancy (MMD), a kernel-based distance between distributions that detects differences in shape and not only in mean. Nonparametric Detection of Geometric Structures Over Networks proves that scanning this statistic over candidate structures is order-optimal on lines, rings and lattices, with minimum structure size $\Omega(\log n)$ on a line. It also shows that rings are harder than lines for large anomalies because the number of candidates stays at $n$ for every interval size. The earlier line-network result, A kernel-based nonparametric test for anomaly detection over line networks, shows that a fixed-size anomaly becomes undetectable as $n$ grows. Both papers motivate this work and supply its statistic. Both also assume every node's samples are stored and compared pairwise, which is the quadratic kernel cost the file lists as an open bottleneck.
We replace stored samples with a running mean of $D$ random Fourier features at each node, following Optimal Rates for Random Fourier Features. Here $\bar\phi_i \in \mathbb{R}^D$ is node $i$'s decayed average feature vector and $\mu_0$ is the reference mean under $p$. We then store only $B$ block-level sums, one for each block $b_j$ of a node partition. The memory is $M = BD$. The scan statistic for a candidate union of blocks $S$ is
$$ T(S) = \Big\| \tfrac{1}{|S|}\textstyle\sum_{i \in S} \bar\phi_i - \mu_0 \Big\|^2 - \hat\beta(S), $$
where $\hat\beta(S)$ is the plug-in bias correction that makes the estimate of squared MMD unbiased. On a line or ring, prefix sums over blocks give each candidate in $O(D)$ time. The conjectured threshold is
$$ I_{\min}(M) \asymp \max\Big\{ \tfrac{\log C_G(n)}{m\,\mathrm{MMD}^2(p,q)},\; h_G\big(\tfrac{nD}{M}\big) \Big\}. $$
In this expression $C_G(n)$ is the number of candidate structures in topology $G$ and $m$ is the number of samples per node. The function $h_G(b)$ gives the smallest anomaly for which blocks of $b$ nodes leave at least half the anomaly inside fully contained blocks. The first term is the known uncompressed noise floor. The second term is the memory penalty, and it is controlled by an isoperimetric property of the anomaly class, meaning how much of a region sits on its boundary.
For a line, $h_G(b) = \Theta(b)$. For a $d$-dimensional grid, $h_G$ grows with a constant that increases with $d$. For graphs without small cuts, $h_G(b)$ is comparable to what random hashing achieves. Separately, the random features are drawn once and shared by all nodes and candidates. The feature dimension needed to preserve the kernel distance should therefore depend on $\mathrm{MMD}(p,q)$ but should be flat in $n$ and in topology. This second prediction can be tested independently of the first.
Relation to Existing Sketch-Based Detectors
Three lines of work already detect anomalies in graph streams under constant memory. Sketch-Based Streaming Anomaly Detection in Dynamic Graphs hashes source and destination nodes separately into a matrix sketch so that dense subgraphs remain dense submatrices. It then finds them greedily and reports AUC of 0.95 to 0.99 on intrusion data. Midas: Microcluster-Based Detector of Anomalies in Edge Streams runs a Chi-squared test on Count-Min-sketched edge counts, with a false-positive bound that holds despite hash collisions. Fast Memory-efficient Anomaly Detection in Streaming Heterogeneous Graphs hashes path fragments into fixed-length bit vectors and clusters them.
All three hash nodes or substructures without regard to where they sit in the network. All three target density or count bursts rather than shape changes in node distributions. None states how sketch size trades against the minimum detectable anomaly. Our proposal differs on each point: it sums node summaries along the network geometry, it uses a nonparametric statistic, and it predicts a memory-threshold law that depends on topology.
The closest method on the kernel side is M-Statistic for Kernel Change-Point Detection. It brings MMD to linear time by comparing blocks and derives analytic false-alarm thresholds. However, it keeps raw sample buffers and has no network structure. We reuse its style of analytic threshold, adapted to a union over candidates.
Near-optimal Anomaly Detection in Graphs using Lovasz Extended Scan Statistic links detectability on general graphs to cut size and effective resistance under Gaussian assumptions. It supplies both the intuition that boundary governs difficulty and the min-cut machinery we use to construct low-boundary partitions on non-grid graphs.
Two further papers constrain the design. The budgeted-kernel literature (Consistent online Gaussian process regression without the sample complexity bottleneck, Multi-Class Pegasos on a Budget) prunes by function-approximation error. As the file notes, it never connects the pruning budget to testing error, and that missing connection is the gap we fill. Optimality of Graph Scanning Statistic for Online Community Detection shows that detection delay grows with background network size even with exact storage. So we do not expect compression to beat the uncompressed floor. We only expect it to match that floor.
Research Program
The theoretical part has three steps. First, prove the upper bound for block-summed random-feature scans on lines, rings and $d$-dimensional lattices. This combines concentration of the $D$-dimensional mean embeddings, uniformly over $C_G(n)$ candidates, with a covering argument: every anomaly of size at least $h_G(b)$ contains a block-aligned candidate carrying most of its signal. Second, prove a matching lower bound. The lower bound shows that no detector restricted to $B$ linear block summaries can beat $h_G(nD/M)$, by constructing anomalies that are split evenly across blocks. Third, analyze random hashing of nodes into $B$ buckets as the topology-oblivious comparison. Our hypothesis is that it dilutes each anomalous node's signal by roughly the bucket load and also destroys connectivity, which inflates the effective candidate count. We will state that result as a conjecture unless the proof closes.
The algorithmic part has two components. The first builds partitions for general graphs by recursive min-cut bisection, reusing the MRF min-cut solvers behind LESS, so that $h_G$ can be measured on graphs that are not grids. The second adds exponential decay to the per-node feature means so that the method runs on streams, together with an analytic threshold in the style of the M-statistic.
Baselines
The naive reference point is node-level testing. Each node keeps its own random-feature MMD against $p$, and the detector raises an alarm if any node exceeds a Bonferroni-corrected threshold. It uses the same $D$ and at least as much memory as our method. A kernel-based nonparametric test for anomaly detection over line networks argues that without aggregation this approach needs fixed-size anomalies to be enormous. Our method beats it if it detects anomalies of order $\log n$ that the naive test misses at matched false-alarm rate.
The accuracy ceiling is the exact, uncompressed MMD scan of Nonparametric Detection of Geometric Structures Over Networks, run on the same synthetic line and ring networks with $n=200$. That paper shows the t-test reaching minimax risk near 0.9 on its equal-mean Gaussian-mixture anomaly. It reports MMD's success qualitatively and gives no numeric risk for the MMD scan. We therefore rerun it ourselves with the same kernel bandwidth and sample counts. "Beating" this baseline is not the goal. Success means matching its empirical risk within a small tolerance at memory $M \approx nD/\log n$, and degrading along the predicted $h_G$ curve below that.
The strongest existing constant-memory competitor is random node hashing in the style of the higher-order Count-Min sketch from Sketch-Based Streaming Anomaly Detection in Dynamic Graphs. On streaming intrusion data it reports AUC 0.95 to 0.99. Midas: Microcluster-Based Detector of Anomalies in Edge Streams reports MIDAS-R AUC 0.977 on DARPA. We run both in their original form on DARPA. We also run a hashed variant that stores the same random-feature sums in $B$ hash buckets, at exactly our memory $M$, with the same number of hash repetitions tuned on held-out normal data under the same compute budget.
The key ablation keeps everything fixed except the partition. It compares geometry-aligned blocks, uniformly random blocks of the same sizes, and hash buckets. This isolates the claim that geometry, rather than aggregation itself, is what buys the memory savings. A second ablation sweeps $D$ at fixed $B$ to separate kernel-approximation loss from coarsening loss.
Why not just…?
Why not just hash nodes into a constant-size sketch, as current graph detectors do? This is the main competitor, and it may be good enough for dense-subgraph attacks. Those attacks are not geometric, and hashing is known to preserve density there. Our claim is narrower. For anomalies that are contiguous in space or network position, random hashing should need a strictly larger anomaly at the same memory. The partition ablation will show whether this holds. If hashing matches geometry-aligned blocks on lattices, the central claim is wrong, and we will report that.
Why not just keep a small reservoir of raw samples per node and run a linear-time MMD? The M-statistic already makes MMD linear in samples (M-Statistic for Kernel Change-Point Detection). However, a reservoir still costs memory per node and gives no aggregation across nodes, so memory stays linear in $n$. We include a reservoir variant at matched memory. It should approach our method only when $M$ is large enough to give every node its own summary, which is exactly the regime where coarsening is unnecessary.
Why not just run a parametric mean or count scan on the blocks? It is cheaper and would work whenever the anomaly shifts the mean. On the equal-mean mixture from Zou, Liang and Poor it should fail, just as their t-test did with risk near 0.9. On real crime and intrusion data the anomalies may well be count shifts. There a Chi-squared block scan in the style of MIDAS is a real threat, and we will report it side by side rather than assume the nonparametric test wins.
Proposed Experiments
The first experiment tests the scaling law directly on synthetic geometries. We use lines, rings and 2D and 3D tori with $n$ from 200 up to $10^5$, following the anomaly design of Nonparametric Detection of Geometric Structures Over Networks. We also use the k-nearest-neighbor and $\epsilon$-random graphs from Near-optimal Anomaly Detection in Graphs using Lovasz Extended Scan Statistic, and add Barabási–Albert and random regular graphs as the expander-like negative control. For each graph and memory $M$ we measure the smallest anomaly size at which the combined false-alarm and miss risk falls below 0.1, and plot it against $nD/M$. There are two decisive checks. First, the measured threshold should follow $h_G$: linear in block size on lines and rings, with a larger constant on higher-dimensional tori. Second, on expanders the gap between geometry-aligned blocks and hashing should shrink toward zero. The required $D$ should be flat across $n$.
The second experiment uses real spatial geometry. We take the Philadelphia and Chicago crime backgrounds with planted clusters, as used by The Kernel Spatial Scan Statistic. That paper reports reaching a Jaccard similarity above 0.8 with about 1000 samples, compared with about 2500 for disk-based scans, using full storage. We report Jaccard similarity and center distance against memory. Success means reaching Jaccard 0.8 at a small fraction of full-storage memory, while random bucketing at the same memory does not.
The third experiment is a stress test on streaming network data. On DARPA we build partitions by min-cut on an initial window of the communication graph and compare AUC and memory against MIDAS-R (0.977) and AnoGraph (0.95 to 0.99). We do not expect to exceed these numbers, because those anomalies are density bursts rather than shape changes. The goal is to learn whether geometry-aligned summaries remain competitive when geometry is weak, and to mark where the method's advantage ends.
References
- Nonparametric Detection of Geometric Structures Over Networks
- A kernel-based nonparametric test for anomaly detection over line networks
- Optimal Rates for Random Fourier Features
- Sketch-Based Streaming Anomaly Detection in Dynamic Graphs
- Midas: Microcluster-Based Detector of Anomalies in Edge Streams
- Fast Memory-efficient Anomaly Detection in Streaming Heterogeneous Graphs
- M-Statistic for Kernel Change-Point Detection
- Near-optimal Anomaly Detection in Graphs using Lovasz Extended Scan Statistic
- Consistent Online Gaussian Process Regression Without the Sample Complexity Bottleneck
- Multi-Class Pegasos on a Budget
- Optimality of Graph Scanning Statistic for Online Community Detection
- The Kernel Spatial Scan Statistic