
(saved) training data set based on which the decision about the observation’s abnormality
shall be made. To keep the rule scalable (and fitting in limited machine memory), only its
subset can be stored instead. In the case of Mahalanobis depth, only parameters (center
vector and scatter matrix) need to be saved, and no data at all.
It is important to keep attention on this operational aspect when underlining suitability
of data depth for anomaly detection in industrial context in the following Section 1.2, and
focus on this aspect later in Section 5.
1.2 Industrial context
Regard the following example simulating industrial data. Think of a (potential) production
line that manufactures certain items. On several stages of the production process, measure-
ments are taken on each of the items to ensure the quality of the produced pieces. These
measurements can be numerous if the line is well automatized, or rare if this is not the case.
If—for each item—these measurements can be assembled in a vector (of length d), then the
item can be represented as a multivariate observation xin an Euclidean space (x∈Rd),
and the entire manufacturing process as a data set in the same space ({x1, ..., xn} ⊂ Rd).
Regard Figure 1, left. For visualization purposes, let us restrict to two measurements,
whence each produced item is represented by an observation with two variables (=measure-
ments). To construct an anomaly detection rule, a subset of production data is taken as a
training set, which can itself contain anomalies or not; this corresponds to the 500 black
pixels, let us denote them Xtr ={x1, ..., x500} ⊂ R2. 8 new observations are now to be
labeled either as normal observation or as anomalies, namely four green dots (correspond-
ing to normal items), three red pluses and cross (anomalies). While in this bivariate visual
case with d= 2 it is trivially resolved by a simple visual inspection, the task becomes much
more complicated once dincreases.
The simplest, though still frequently applied approach, is to define validation band for
each measurement, i.e., upper and lower bound for each variable: this rule is depicted by
black dashed lines parallel to variables’ axes and—if well calibrated—allows to identify three
out of four anomalies (red pluses) and is computationally extremely fast (computation, as
well as following item’s production, can even stop after crossing any of the bounds):
gbox(x|Xtr) = (anomaly (=1) ,if x/∈Tj=1,...,d(Hj,lj∩Hj,hj),
normal (=0) ,otherwise.(1)
with l1, h1, ..., ld, hdbeing lower and upper validation bounds (calibrated using Xtr) for
each axis and Hj,a ={y∈Rd|y⊤ej≤a},Hj,b ={y∈Rd|y⊤ej≥b}where ejis the
orthant of the jth axis. The fourth anomaly (red cross) remains invisible for rule (1).
Obviously, this fourth anomaly can be identified using rule based on Mahalanobis depth
DMah, defined later by (7)
gMah(x|Xtr) = (anomaly ,if DMah(x|Xtr )< tMah,Xtr ,
normal ,otherwise.(2)
where tMah,Xtr is chosen based on Xtr(= 0.075) in a way that the Mahalanobis depth
contour is largest not to exceed the variable-wise validation bounds. While rule (2) easily
3