Sentinel

Spot unusual periods and the sensors behind them; your data stays in this browser.

Sentinel in half a minute

How Sentinel learns normal and how to read an alert.

Read the transcript

A machine has dozens of sensors. A failing seal rarely breaks one limit. It quietly changes how the sensors move together. Sentinel learns normal operation from the first part of your data. Then it scores every row with three methods, and raises an alert only when the deviation persists. For each alert you see which sensors carried the deviation, so you know where to look first. Load a CSV, or try a built-in scenario. Everything runs in your browser.

Narration: synthetic voice (Piper, voice “Joe”, CC0 public domain). Captions are burned into the video.

In three steps.

Learns normal
Scores every row
Shows why
1

Data

Pick a scenario. All are mathematically generated examples, not real plant data.

My own sensor table

Drop a CSV file here

Numeric columns are sensors; a date column becomes the time axis.

Record details
2

Settings

Sensitivity

Alarm rate accepted during normal operation (): low 0.1% · balanced 1% · high 3%. High sensitivity gives more alarms.

Advanced settings
60%
3
Methods

Timeline: deviation index

Above 1: limit crossed. Drag to zoom.

Unusual periods

Pick one to see the reasons below.

Which sensors drove it?

Bars: each sensor’s share. Small charts: each against its normal band.

Normal-region map: T² and SPE

Points are rows; faint ones are training. Outside the box: over limit.

Export

How do I read the result?

  1. Line: deviation index
  2. Dashed line: the limit (1)
  3. Red band: alarm period
  4. Green box: normal region
  5. Colour strip: darker, further from normal
Sentinel says “unusual”, never “faulty”: the engineer decides the cause, and a fault in the training part is treated as normal.

How it computes

Seven steps: set aside the training part, learn normal, score with three methods, combine into one index, watch slow drift separately, filter short blips, and split the cause across the sensors.

  1. The training part and preparation

    training · 60%testfirst rowlast row

    The first part of the table is taken as “normal”; everything is measured against it. Empty cells are filled with that sensor’s median in the training part.

    Technical detail
    ntrain=max(40,⌊N·r⌋)n_{\mathrm{train}} = \max\left( 40,\; \lfloor N \cdot r \rfloor \right)

    Training is the first rows in file order, not a random sample.

    zj=xj−μjσjz_j = \frac{x_j - \mu_j}{\sigma_j}

    For PCA each sensor is scaled by its training mean and sample standard deviation (σ = 1 if σ ≈ 0).

    SettingValueNote
    Training share r0.60adjustable 30–90%
    Usable sensor> 5 valuesat most 30% empty, not constant; 2–24 sensors
    Row limits60 – 20,000at least 60 rows, at least 40 training rows

    Source sentinel/sentinel.js · forge/import.js

  2. Isolation Forest

    00.510c(256)≈10.220mean path length E[h]sisolated fast: unusualisolated late: typical

    It tries to separate a row from the others with random cuts. An unusual row is alone after a few cuts; a typical row needs many.

    Technical detail
    s(x)=2−E[h(x)]c(ψ)s(x) = 2^{-\frac{E[h(x)]}{c(\psi)}}c(n)=2(ln(n−1)+γ)−2(n−1)nc(n) = 2 \left( \ln(n - 1) + \gamma \right) - \frac{2(n - 1)}{n}
    h(x)h(x)
    cuts x passes before it is alone in one tree (+ c(size) for the leaf it ends in)
    c(ψ)c(\psi)
    mean path length in a random tree of ψ rows; it scales the score 10.24
    γ\gamma
    Euler–Mascheroni 0.5772
    SettingValueNote
    Trees100seed 42
    ψ256subsample per tree; maximum depth ⌈log₂ψ⌉ = 8
    Fit≤ 4,096training rows chosen at even spacing; each cut is uniform between the node’s min and max

    Source dev/native/kutupml.c · wasm/kutupml.js

  3. PCA · Hotelling T² · SPE

    main directionhigh T²high SPE
    Schematic: two sensors, one main direction.

    It learns how the sensors normally move together. T² measures how far a row goes along those usual directions; SPE measures how far it steps outside them, i.e. how much the relationship between sensors broke.

    Technical detail
    R=VΛV⊤R = V \Lambda V^{\top}ti=vi⊤z(i=1…k)t_i = \mathbf{v}_i^{\top} \mathbf{z} \quad (i = 1 \ldots k)

    R: the training correlation matrix; eigen-decomposition by the Jacobi method.

    k=min{k:∑i≤kλi∑iλi≥0.9}k = \min \left\{ k : \frac{\sum_{i \le k} \lambda_i}{\sum_{i} \lambda_i} \ge 0.9 \right\}

    The fewest components that explain 90% of the variance (at most C − 1).

    T2=∑i=1kti2λiT^2 = \sum_{i=1}^{k} \frac{t_i^2}{\lambda_i}SPE=‖z−∑i=1ktivi‖2\mathrm{SPE} = \left\lVert \mathbf{z} - \sum_{i=1}^{k} t_i \mathbf{v}_i \right\rVert^2
    λi,vi\lambda_i,\; \mathbf{v}_i
    i-th eigenvalue and eigenvector (i-th main direction and its variance)
    z\mathbf{z}
    the row’s scaled sensor values

    Source dev/native/kutupml.c · sentinel/sentinel.js

  4. One deviation index

    m_kτ_k01As_kscoreindex

    The three methods score on different scales. Each is rescaled so its training median is 0 and its training threshold is 1; the index is the largest of them. Above 1 is beyond the limit.

    Technical detail
    At=max(0,maxksk,t−mkτk−mk)A_t = \max\left( 0,\; \max_{k} \frac{s_{k,t} - m_k}{\tau_k - m_k} \right)

    k: the selected methods (IF, T², SPE).

    mk=Qk(0.5)m_k = Q_k(0.5)τk=Qk(1−b)\tau_k = Q_k(1 - b)

    Q_k: linear-interpolated quantile of method k’s scores over the training rows.

    bb
    alarm budget (sensitivity): low / balanced / high 0.001 · 0.01 · 0.03

    The budget is per method: each method crosses on roughly a share b of training rows, so the flagged share in training lies between b and (number of methods) × b. Thresholds are computed on the rows the models were fitted on, not on held-out data.

    Source sentinel/sentinel.js · tool-ui.js

  5. Slow drift: EWMA

    01060120rowEWMA limitthin: index A · thick: EWMA
    Schematic: after row 60 the index rises a little; single rows stay under 1, the EWMA crosses its limit.

    In a small but lasting drift, single rows may never cross the limit. An exponentially weighted moving average (EWMA) of the index accumulates the drift and flags rows once it crosses its own limit.

    Technical detail
    et=λAt+(1−λ)et−1e_t = \lambda A_t + (1 - \lambda) \, e_{t-1}e−1=A‾traine_{-1} = \overline{A}_{\mathrm{train}}
    ℓe=max(e¯+4σe,1.05Qe(0.995))\ell_e = \max\left( \bar{e} + 4 \sigma_e,\; 1.05 \, Q_e(0.995) \right)

    ℓ_e: the EWMA limit. ē, σ_e, Q_e: from the e values of training rows after row 30.

    λ\lambda
    weight; smaller means longer memory 0.1

    Flag: A ≥ 1, or (row ≥ 30 and e > ℓ_e).

    Source sentinel/sentinel.js

  6. From flags to periods

    period: 5 flagged rowsblipblip

    Single-row blips do not raise an alert. Flagged rows are joined even with up to two unflagged rows between them; a run with at least 3 flagged rows becomes an “unusual period”.

    Technical detail
    SettingValueNote
    Persistence3fewest flagged rows for a period (1–8)
    Bridge≤ 2unflagged rows allowed in between
    Kind0.3“drift” if rows with A ≥ 1 are at most 30% of the EWMA flags, else “sudden”
    OngoingN − max(3, 2%)if the last period ends after this row the verdict is “Attention”

    Source sentinel/sentinel.js

  7. Which sensors?

    For each period, T² and SPE are split across the sensors: how much each sensor added to the row’s distance from normal. The shares are averaged over the period’s rows, weighted by the index.

    Technical detail
    Tj2=zj∑i=1kvjitiλiT^2_j = z_j \sum_{i=1}^{k} \frac{v_{ji} \, t_i}{\lambda_i}SPEj=rj2\mathrm{SPE}_j = r_j^2

    Σ_j T²_j = T², Σ_j SPE_j = SPE; r: the residual PCA cannot explain.

    sharej=∑twt(12Tj,t2+∑lTl,t2++12SPEj,t+∑lSPEl,t+)∑twt\mathrm{share}_j = \frac{\sum_t w_t \left( \frac{1}{2} \frac{T^{2+}_{j,t}}{\sum_l T^{2+}_{l,t}} + \frac{1}{2} \frac{\mathrm{SPE}^{+}_{j,t}}{\sum_l \mathrm{SPE}^{+}_{l,t}} \right)}{\sum_t w_t}wt=max(0.05,At)w_t = \max(0.05, A_t)

    Rows: every ⌊length/40⌋-th row of the period with A ≥ 0.5. With PCA off, Isolation Forest occlusion is used instead: how much the score falls when one sensor is set to its training median.

    Source sentinel/sentinel.js · dev/native/kutupml.c

Terms used on this page

Isolation Forest
The easier it is to isolate a row with random splits, the more unusual it is. A row separated in few splits scores high.
Hotelling T²
How far a row sits inside the main directions of normal operation. It rises when sensors keep their usual relationships but take unusually large values.
SPE (Q)
How far a row falls outside the plane of normal relationships. It rises when the usual relationships between sensors break.
EWMA
A moving average of the deviation index that weights recent values more (λ = 0.1). It shows small but persistent drifts earlier than single rows do.
Deviation index
0 = typical normal, 1 = the limit of normal, above 1 = beyond the limit. The highest of the selected methods is used.
Persistence
How many flagged rows an alert needs; up to two unflagged rows may sit between them. A larger value filters single-row blips.
Training part
The first part the model learns as “normal”. It should contain no faults.
Alarm budget
The share of training rows each method may cross: low 0.1%, balanced 1%, high 3%. The threshold is the (1 − budget) quantile of the training scores.

Frequently asked

What kind of anomaly does Sentinel find?

Rows and periods where several sensors together depart from the learned normal operation. It also catches cases where each sensor is within its own limits but the combination is unusual.

Is “unusual” the same as “faulty”?

No. Sentinel only says a row departs from the normal it learned. A commissioning step, a product change or maintenance also look unusual. The engineer decides the cause; the per-sensor shares for each period support that review.

Is my data uploaded?

No. The table is processed in your browser by a WebAssembly module written in C. Nothing is sent anywhere and it is gone when you close the page. Files you export stay with you.

What if the training part contains faulty data?

The model then treats that behaviour as normal and may miss similar events later. Check that the training part really represents normal operation; Sentinel also shows the alarm rate inside the training part.

How many rows and sensors are needed?

At least 60 rows (40 of them training) and two to twenty-four numeric sensors; in practice a few hundred normal rows are advised. Sentinel reads up to 20,000 rows. Isolation Forest and PCA are fitted on at most 4,096 training rows chosen at even spacing; thresholds and the EWMA use every training row.

Go deeper.

Full library

Related questions

All questions
ASP Dijital

Start with a production problem.

Let’s review your data source, your existing system and the decision you want to improve.

Discuss your project ↗