Technical Whitepaper

AEGIS-SIGMA: Mathematical Foundations of Harmonic Anomaly Detection

This technical whitepaper outlines the mathematical and geometric frameworks governing the Aegis-SIGMA machine learning anomaly detection engine. By moving away from flat, linear analysis, the engine introduces a self-similar, multi-layered architecture designed to maximize harmonic coherence and map system state changes across a logarithmic spiral.

1. System State Modeling: The Spiral Vector Space

Standard network monitoring represents state variables (packet rates, connection latency, CPU usage, and cryptographical entropy) as independent elements in a Cartesian coordinates space $\mathbb{R}^d$. This traditional representation assumes time is linear, ignoring recursive patterns and the historical momentum of network behaviors.

Aegis-SIGMA transforms the physical feature vector $\mathbf{x} \in \mathbb{R}^d$ into a Harmonic Spiral Vector Space $\mathcal{H}$, mapping the data along an unfolding logarithmic spiral governed by the Golden Ratio, $\varphi$:

$$\varphi = \frac{1+\sqrt{5}}{2} \approx 1.6180339887$$

The time parameter $t$ is mapped as an angular coordinate $\theta = t \pmod{2\pi}$ on a complex plane, where the radius $r(\theta)$ scales proportionally with Fibonacci-based recursive progression:

$$r(\theta) = a \cdot e^{b\theta}$$

where the growth factor $b$ is calibrated to the natural growth rate of the Golden Spiral:

$$b = \frac{2 \ln(\varphi)}{\pi} \approx 0.3063489$$

Any system state observation $\mathbf{S}_t$ is represented as a complex-valued tensor that preserves its historical context. The state does not exist as an isolated point, but rather as an accumulation of the preceding states, defined recursively using a Fibonacci-weighted decaying window:

$$\mathbf{S}_t = \sum_{k=0}^{K} w_k \mathbf{x}_{t-k}$$

where the weights $w_k$ correspond to normalized inverse Fibonacci values to preserve the influence of historical trajectory:

$$w_k = \frac{1 / F_{k+2}}{\sum_{j=0}^{K} (1 / F_{j+2})}$$

This transformation guarantees that every instantaneous state evaluation carries the mathematical memory of its own evolution.

2. Mathematical Definition of Coherence vs. Noise

The anomaly detection engine functions by determining the structural coherence of $\mathbf{S}_t$ relative to a dynamically updating Harmonic Baseline Space $\mathcal{B}$.

We define the Spectral Coherence Score $\mathcal{C}(\mathbf{S}_t)$ using the projection of the current state onto the eigenspace of the historical covariance matrix $K_{\mathcal{B}}$:

$$\mathcal{C}(\mathbf{S}_t) = \frac{\langle \mathbf{S}_t, P_{\mathcal{B}} \mathbf{S}_t \rangle}{\Vert\mathbf{S}_t\Vert \, \Vert P_{\mathcal{B}} \mathbf{S}_t\Vert}$$

Where $P_{\mathcal{B}}$ is the projection operator onto the $k$-dominant eigenvectors of the system covariance matrix.

If the state vector aligns with the natural resonance of the baseline, the angle between them approaches zero, yielding:

$$\mathcal{C}(\mathbf{S}_t) \to 1 \quad \text{(Harmonic Coherence — Legitimate Traffic)}$$

Conversely, anomalous intrusions, DDoS floods, and credential stuffing introduce high-entropy, chaotic vectors that do not align with the baseline eigenspace. This misalignment drives the projection ratio down:

$$\mathcal{C}(\mathbf{S}_t) \to 0 \quad \text{(Disharmonic Noise — Threat Profile)}$$

3. Deep Sequence Analysis: Fibonacci-Scaled Transformer Attention (RTAN)

For long-term temporal dependencies (such as detecting slow-dripping APTs or distributed lateral movement), Aegis-SIGMA implements a deep neural sequence model. Rather than utilizing standard Recurrent Neural Networks (RNNs) which suffer from gradient vanishing, or standard Transformers which process sequences flatly, Aegis-SIGMA uses a Recursive Temporal Attention Network (RTAN).

This network processes a sequential sequence of state vectors $\mathbf{X} = (\mathbf{S}_{t-T}, \dots, \mathbf{S}_t)$ using an attention mechanism where temporal distance scaling is mathematically governed by the Golden Ratio.

[ Input Sequence: S_t-T, ..., S_t ]
           │
           ▼
┌─────────────────────────────┐
│ Query, Key, Value Matrices  │
│     (W_Q, W_K, W_V)         │
└──────────────┬──────────────┘
               │
               ▼
┌─────────────────────────────┐
│  Fibonacci Decay Matrix D   │
│  (Scales temporal weights)  │
└──────────────┬──────────────┘
               │
               ▼
┌─────────────────────────────┐
│ Harmonic Scaled Attention   │
│   (Phi-Weighted Softmax)    │
└─────────────────────────────┘

3.1 Mathematical Formulation of Harmonic Attention

In standard scaled dot-product attention, the similarity between queries $\mathbf{Q}$ and keys $\mathbf{K}$ is calculated uniformly. In Aegis-SIGMA's Harmonic Attention layer, we introduce a temporal distance decay matrix $\mathbf{D} \in \mathbb{R}^{T \times T}$ whose components decay according to consecutive Fibonacci steps, mapping spatial-temporal distance directly onto the Golden Spiral:

$$\mathbf{D}_{i, j} = \varphi^{-\vert{}i-j\vert{}}$$

Given projection weight matrices $\mathbf{W}_Q, \mathbf{W}_K, \mathbf{W}_V \in \mathbb{R}^{d \times d_k}$, the sequence is projected into Query ($\mathbf{Q}$), Key ($\mathbf{K}$), and Value ($\mathbf{V}$) spaces:

$$\mathbf{Q} = \mathbf{X}\mathbf{W}_Q, \quad \mathbf{K} = \mathbf{X}\mathbf{W}_K, \quad \mathbf{V} = \mathbf{X}\mathbf{W}_V$$

The Fibonacci-Scaled Attention matrix $\mathbf{A}$ is then calculated by multiplying the raw attention matrix with the geometric distance decay operator $\mathbf{D}$:

$$\mathbf{A}(\mathbf{Q}, \mathbf{K}, \mathbf{V}) = \text{softmax}\left( \frac{\mathbf{Q}\mathbf{K}^{\mathsf{T}}}{\sqrt{d_k}} \odot \mathbf{D} \right) \mathbf{V}$$

Where $\odot$ represents the Hadamard (element-wise) product. The division by $\sqrt{d_k}$ preserves variance scaling. $\mathbf{D}$ acts as an inductive bias, forcing the neural network to prioritize temporal intervals that land on key harmonic nodes (such as distances of 1, 2, 3, 5, 8, 13 steps back) while ignoring chaotic, high-frequency temporal noise.

3.2 Gated Recurrent Fusion & Normalization

The output of the attention mechanism passes through a gated residual layer that uses a Phi-based split to blend the raw attention output $\mathbf{H}_t$ with the prior hidden state $\mathbf{h}_{t-1}$:

$$\mathbf{z}_t = \sigma(\mathbf{W}_z \mathbf{x}_t + \mathbf{U}_z \mathbf{h}_{t-1})$$ $$\mathbf{h}_t = (1 - \mathbf{z}_t) \odot \mathbf{h}_{t-1} + \mathbf{z}_t \odot \tanh(\mathbf{W}_h \mathbf{x}_t + \mathbf{U}_h (\mathbf{r}_t \odot \mathbf{h}_{t-1}))$$

To guarantee numerical stability and preserve structural alignment across layers, we apply Layer Normalization scaled by the golden ratio:

$$\text{LN}(\mathbf{h}_t) = \varphi \cdot \left( \frac{\mathbf{h}_t - \mu_t}{\sqrt{\sigma_t^2 + \epsilon}} \right) + \mathbf{\beta}$$

By anchoring the weights, attention scales, and normalization coefficients to $\varphi$ and the Fibonacci sequence, the deeper layers of the neural network remain immune to chaotic gradient explosions. This mathematical design ensures that the model only converges on signals that display true temporal coherence.

4. Recursive Partitioning & Path-Length Mechanics

To perform fast, real-time edge processing, Aegis-SIGMA implements a custom Recursive Isolation Forest to partition the vector space.

Anomalies represent states of high disharmony that exist in isolated, low-density regions of the space $\mathcal{H}$. By randomly partitioning the space, these anomalous vectors are isolated near the root of the tree structures, resulting in shorter path lengths.

             [Root Node]
           /            \
    (Split 1)        (Split 1)
     /      \         /      \
[Anomaly]   ...     ...     ...
(Path=1)

For a given data point $\mathbf{x}$, the anomaly score $s(\mathbf{x}, n)$ over an ensemble of $n$ isolation trees is formulated as:

$$s(\mathbf{x}, n) = 2^{-\frac{\mathbb{E}(h(\mathbf{x}))}{c(n)}}$$

Where:
$h(\mathbf{x})$ is the path length of observation $\mathbf{x}$, measured by the number of edges traversed from the root node to a terminating leaf node.
$\mathbb{E}(h(\mathbf{x}))$ is the expected path length of $\mathbf{x}$ across the entire ensemble of trees.
$c(n)$ is the average path length of an unsuccessful search in a Binary Search Tree (BST) built from $n$ nodes, which serves as the normalization constant:

$$c(n) = 2 \ln(n - 1) + \gamma - \frac{2(n - 1)}{n}$$

Here, $\gamma \approx 0.5772156649$ represents Euler's constant.

Interpretation of the Anomaly Score:

  • $\mathbb{E}(h(\mathbf{x})) \to 0 \implies s \to 1$: The point isolates instantly. It is highly disharmonic (an outlier).
  • $\mathbb{E}(h(\mathbf{x})) > c(n) \implies s < 0.5$: The point requires deep partitioning to isolate. It sits safely within the high-density, coherent baseline.

5. Anomaly Thresholding and Self-Updating Loop

To maintain real-time accuracy without human intervention, Aegis-SIGMA continuously updates its understanding of "harmony." It achieves this via a secondary, ultra-fast Gradient Boosting Machine (LightGBM) optimization loop running alongside the isolation trees.

The model optimizes a customized Objective Loss Function $\mathcal{L}$ that penalizes false negatives on system state transitions, using Gradient-based One-Side Sampling (GOSS) to accelerate training at the network edge:

$$\mathcal{L}(y, \hat{y}) = \sum_{i=1}^{M} \left( y_i \ln\left(1 + e^{-\hat{y}_i}\right) + (1 - y_i) \ln\left(1 + e^{\hat{y}_i}\right) \right) + \Omega(f)$$

Where $\Omega(f)$ is the regularization penalty governing tree complexity, ensuring the engine remains mathematically lightweight enough to run natively inside our mobile VPN gateway:

$$\Omega(f) = \gamma T + \frac{1}{2} \lambda \sum_{j=1}^{T} w_j^2$$

Through this dual-engine approach — combining recursive spatial isolation with high-speed gradient boosting — Aegis-SIGMA achieves a self-similar, highly adaptive protective field that grows, learns, and scales alongside your digital footprint.

Summary Calibration Standards

METRICTARGET STANDARDMATHEMATICAL ALIGNMENT
Real-time Latency< 5 ms (Edge)Local C Matrix Execution
Anomaly CutoffScore $\geq$ 0.75BST Normalized Expected Depth
Sequence WindowT = 55, 89, 144Fibonacci Memory Steps

— Technical Whitepaper v4.0. PDF version available on request.