~/shanegraffiti.com/research/d2h-ad
Shane Graffiti Inc. Semantic Adversarial Research Division 2026

DENSITY &
DISTANCE
IN HYPERDIMENSIONAL
SPACE

D2H-AD is a novel anomaly detection framework built on Hyperdimensional Computing a brain-inspired paradigm encoding information as high-dimensional binary vectors. Unlike prior HDC approaches relying on reconstruction error or single prototype distance, D2H-AD fuses local density estimation and relative distance metrics computed directly in hyperdimensional space. The result: a non-linear decision boundary that catches both isolated outliers and small anomalous clusters that single-metric methods miss, with no labeled training data required and sub-millisecond inference suitability for edge hardware.

Division Semantic Adversarial Research
Domain Anomaly Detection / Edge AI
Published arXiv 2606.13754 2026
Key Result Outperforms all 5 baselines, every dataset
read
Hyperdimensional Computing Anomaly Detection Density-Based Scoring One-Class Classification IoT Security Edge AI TinyML Binary Hypervectors Hamming Distance XOR Binding Training-Free Inference ROC-AUC 0.985 Hyperdimensional Computing Anomaly Detection Density-Based Scoring One-Class Classification IoT Security Edge AI TinyML Binary Hypervectors Hamming Distance XOR Binding Training-Free Inference ROC-AUC 0.985
~/d2h-ad/motivation
§ 1.0 Why Hyperdimensional Computing

Traditional anomaly detection SVMs, Isolation Forests, Autoencoders breaks down at the edge. SVMs require quadratic kernel matrices. Autoencoders need 10–100 gradient epochs, millions of floating-point parameters, and fail when anomalies lie near the learned manifold. Isolation Forests work in original feature space where the curse of dimensionality degrades every distance metric they rely on.

HDC represents data as high-dimensional binary vectors (D = 10,000). Distance concentrates stably. Noise tolerance is structurally guaranteed binary hypervectors survive up to 25% bit flips without degrading similarity structure. And the entire compute stack reduces to XOR, popcount, integer addition, and majority vote: operations that map to digital logic without floating-point units.

Binding ⊗
Element-wise XOR of two hypervectors. Produces a dissimilar composite that is approximately invertible: hi ⊗ (hi ⊗ hj) ≈ hj. Encodes feature identity alongside feature value.
Bundling +
Element-wise summation followed by majority vote. Aggregates multiple hypervectors into a composite similar to all constituents. The bundled vector encodes a data point's complete feature profile.
Quasi-Orthogonality
At D = 10,000, independently generated binary vectors concentrate around D/2 Hamming distance with exponentially high probability. This guarantees meaningful separation between distinct encoded representations.
Level Hypervectors
Continuous values quantized into K intervals. Adjacent levels share D/K flipped bits nearby values encode nearby hypervectors. Ordinal structure is preserved in hyperdimensional space without any learned embedding.
read
~/d2h-ad/encoding
§ 2.0 Phase I Encoding

Every data point is a vector of n features. The encoding phase maps each point to a binary hypervector of dimension D = 10,000 in a single deterministic pass no gradient descent, no iteration, no training data required.

01
Base Hypervector Assignment
Each feature fj is assigned a unique random binary vector B.HVj ∈ {0,1}D, sampled from Bernoulli(0.5). Base vectors for different features are approximately orthogonal expected Hamming distance D/2 ensuring that feature identity is independently encoded.
02
Level Hypervector Creation
The feature range [fmin, fmax] is divided into K = 32 uniform intervals. L.HV1 is generated randomly; each subsequent L.HV is produced by flipping D/K random bits of L.HVℓ−1. Adjacent levels differ by exactly D/K bits, preserving ordinal proximity in hyperdimensional space.
03
Binding Feature Value + Identity
For each feature, the base hypervector and its corresponding level hypervector are XOR-bound: hi = B.HVi ⊕ L.HVj. This single operation simultaneously encodes what the feature is and what value it holds.
04
Bundling + Binarization
Feature hypervectors are summed element-wise across all n features, then binarized by majority vote at threshold n/2. The result is a single binary hypervector H′ ∈ {0,1}D encoding the entire data point. The encoding is stable, reproducible, and executes in O(mnD) time linear in all dimensions.
read
~/d2h-ad/detection
§ 3.0 Phase II Anomaly Detection

The core innovation. Prior HDC anomaly detectors use a single metric: HDAD reconstructs from a prototype; ODHD measures distance to a class hypervector. D2H-AD computes two complementary metrics in hyperdimensional space and fuses them multiplicatively creating a non-linear decision boundary that neither metric achieves alone.

Density Metric ρ
Local Density
ρi = Σj χ(D(xi, xj) − dc), where dc is the 10th percentile of all pairwise distances. Counts the number of hypervectors within a cutoff radius. Points in dense normal regions score high. Isolated points score near zero.
Distance Metric δ
Minimum Distance to Denser
δi = minj : ρji D(xi, xj). The minimum Hamming distance from point i to any denser point. For the globally densest point, δ is set to the maximum pairwise distance. Points far from any dense cluster score high.
Anomaly Score Multiplicative Fusion Ai = δi / ρi // large δ: far from any denser cluster // small ρ: sparse local neighborhood // their ratio amplifies both simultaneously normal points score near zero // Label(i) = anomaly if Ai > τ, normal otherwise

Classical density methods (DBSCAN, LOF) operate in original feature space where high dimensionality degrades every distance metric. D2H-AD exploits the concentration of measure in D = 10,000 dimensional space where Hamming distances are stable by construction. The fusion is computed on the same distance matrix already built for density estimation no extra overhead.

read
~/d2h-ad/results
§ 4.0 Results Five Datasets, Five Baselines

Evaluated on five ODDS benchmark datasets against HDAD, ODHD, One-Class SVM, Isolation Forest, and Autoencoder. D2H-AD achieves the highest ROC-AUC and F1 score in every single comparison. All p-values < 0.05 (Wilcoxon) and p ≪ 0.001 (t-test) across five runs per dataset.

0.985
LYMPHO AUC
0.982
SATI2 AUC
0.928
WBC AUC
0.872
CARDIO AUC
0.837
MNIST AUC
5.9%
Avg Gain vs Best Ablation
ROC-AUC All Methods, All Datasets
Method WBC MNIST CARDIO LYMPHO SATI2
D2H-AD 0.928 0.837 0.872 0.985 0.982
ODHD 0.916 0.791 0.857 0.983 0.934
Isolation Forest 0.859 0.761 0.868 0.796 0.890
Autoencoder 0.849 0.695 0.861 0.610 0.851
HDAD 0.825 0.781 0.828 0.852 0.931
One-Class SVM 0.829 0.741 0.770 0.796 0.760
read
~/d2h-ad/ablation
§ 5.0 The HDC Contribution Is Real

The ablation isolates what hyperdimensional encoding itself contributes, independent of the density-distance scoring mechanism. A Euclidean baseline applies the identical A = δ/ρ formula in L2-normalized original feature space. D2H-AD beats it on every dataset by an average of 5.4% ROC-AUC.

Ablation Component Isolation Distance Only: AUC avg 0.839 Density Only: AUC avg 0.864 Euclidean δ/ρ: AUC avg ~0.887 D2H-AD Full: AUC avg 0.921 ← +5.4% over Euclidean baseline // The hyperdimensional space itself contributes discriminative power // Density × Distance synergy is non-additive fusion amplifies both

The WBC (6.2%) and MNIST (6.9%) gains are the largest precisely the datasets with complex or overlapping class boundaries where low-dimensional distance metrics degrade fastest. This is concentration of measure doing its work: in D = 10,000 dimensions, normal and anomalous neighborhoods separate naturally.

read
~/d2h-ad/edge-deployment
§ 6.0 Edge Deployment Architecture

D2H-AD is not only competitive it is architecturally designed for hardware that cannot run deep learning. The entire inference stack operates without floating-point arithmetic. Memory scales linearly at O(mD + nD) bits. For typical datasets this is orders of magnitude smaller than autoencoder parameter stores.

Encoding Complexity
O(mnD) linear in samples, features, and dimension. No iterative refinement. No convergence monitoring. Single-pass, deterministic, reproducible from fixed seed.
Detection Complexity
O(m²D) baseline for exhaustive pairwise distance, reducible to O(mkD) with approximate nearest-neighbor methods. Density and score steps are O(m²) and O(m) respectively.
vs Autoencoder
Autoencoders: 10–100 epochs, gradient descent, 10–100 MB floating-point parameter stores, reconstruction errors that fail near manifold. D2H-AD: single pass, binary ops, linear memory, no manifold assumption.
vs One-Class SVM
OC-SVM requires solving a quadratic programming problem with O(m³) worst-case kernel complexity. D2H-AD eliminates all iterative optimization time-to-deployment collapses to encoding time.
Hardware Primitives
XOR for binding. Integer addition for bundling. Popcount for Hamming distance. Majority vote for binarization. All map to digital logic without FPUs FPGA sub-microsecond inference is within reach.
Generalization Gap
LOATO protocol: one anomaly subtype withheld per fold. D2H-AD degrades only −1.8% average AUC versus −3.1% (ODHD), −4.2% (Autoencoder). Density-distance in HDC space captures structural deviation, not memorized signatures.
read
~/conclusion
$ query: what does D2H-AD change // HDC anomaly detection no longer needs a prototype or reconstruction. // Density and distance fuse in hyperdimensional space. // The symbolic and the geometric collapse into a single score. $ query: what does this cost // No labels. No gradient descent. No floating-point hardware. // Single pass. Linear memory. Sub-millisecond edge inference profile. $ query: what is the actual result // Best ROC-AUC on all 5 benchmark datasets. Every time. // −1.8% generalization gap smallest of any method tested. // One framework. No differentiability required. Runs at the edge.
read

THE
ANOMALY
SCORE
DOESN'T
NEED A
PROTOTYPE.

read