Next Article in Journal
A Fully Automated Pipeline for a Robust Conjunctival Hyperemia Estimation
Next Article in Special Issue
Online Forecasting and Anomaly Detection Based on the ARIMA Model
Previous Article in Journal
Numerical Modeling of Crack Growth under Mixed-Mode Loading
Previous Article in Special Issue
Outlier Detection with Explanations on Music Streaming Data: A Case Study with Danmark Music Group Ltd.
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Low-Cost Active Anomaly Detection with Switching Latency

Research Center of Smart Networks and Systems, School of Information Science and Technology, Fudan University, Shanghai 200433, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2021, 11(7), 2976; https://doi.org/10.3390/app11072976
Submission received: 7 February 2021 / Revised: 20 March 2021 / Accepted: 24 March 2021 / Published: 26 March 2021
(This article belongs to the Special Issue Unsupervised Anomaly Detection)

Abstract

:
Consider the problem of detecting anomalies among multiple stochastic processes. Each anomaly incurs a cost per unit time until it is identified. Due to the resource constraints, the decision-maker can select one process to probe and obtain a noisy observation. Each observation and switching across processes accompany a certain time delay. Our objective is to find a sequential inference strategy that minimizes the expected cumulative cost incurred by all the anomalies during the entire detection procedure under the error constraints. We develop a deterministic policy to solve the problem within the framework of the active hypothesis testing model. We prove that the proposed algorithm is asymptotic optimal in terms of minimizing the expected cumulative costs when the ratio of the single-switching delay to the single-observation delay is much smaller than the declaration threshold and is order-optimal when the ratio is comparable to the threshold. Not only is the proposed policy optimal in the asymptotic regime, but numerical simulations also demonstrate its excellent performance in the finite regime.

1. Introduction

Consider the problem of detecting a fixed number of anomalies among multiple processes. Each process may be in a normal or an abnormal state (note that the processes in an abnormal state are the anomalies, and our basic goal is to find out all the abnormal processes), and the state of each process does not change during the detection procedure. If the process is in an abnormal state, it incurs a certain cost per unit time and the normal processes do not incur any cost. Once the state of the abnormal process is identified, the corresponding abnormal process stops incurring costs. At each time, only one process can be probed and a noisy observation is obtained from the process. Each probe takes a certain time, and switching across processes will also bring a certain time delay. Since abnormal processes are identified at different times, the duration of each abnormal process continuing incurring costs is also different. We take the cumulative cost incurred by all the abnormal processes during the entire detection procedure as a measurement. Our objective is to find an active inference strategy, consisting of a selection rule governing which process to probe at each time, a stopping rule on when to terminate the detection procedure, and a decision rule on the final detection outcome, that minimizes the expected cumulative cost under reliability constraints.
The problem considered here can find applications in attack and intrusion localization in a cyber network, anomaly detection in sensor networks, event detection in power systems, and more. For example, consider detecting attacked components (which can be seen as anomalies) among a cyber network consisting of multiple components (such as routers and paths). An intrusion detection system (IDS) monitors the traffic over the components to detect Denial of Service (DoS) attacks (such attacks aim to flood the component with useless traffic to make it unavailable to its intended users until it is identified and repaired). Since the attacked components are flooded by massive useless traffic and can not work as normal, the per-time-costs of the abnormal components are the corresponding expected normal traffic (packets per unit time) over the component. Until it is found and repaired, the abnormal component will continue incurring costs. Due to resource constraints, only one component can be probed at each time. Each probe and switch across components bring a certain time delay. The objective is to minimize the expected cumulative cost incurred by all the attacked components during the entire detection procedure, in another word, to minimize the expected number of cumulative transmitted failed packets in the system during the DoS attack.

1.1. Related Work

The anomaly detection problem studied in this paper can be regarded as a variation of the Sequential Hypothesis Testing (SHT) problem [1] for a single process. Differing from the classic hypothesis testing problem with fixed sample size, SHT allows decision-maker to stop sampling from the process based on the gathered observations, which reduces the sample size without compromising the detection performance. The SHT problem was pioneered in [1] by Wald, who established the Sequential Probability Ratio Test (SPRT) for simple binary hypothesis testing and showed its optimality in terms of minimizing the expected sample size under error probability constraints. Various extensions for testing M-ary hypothesis or composite hypothesis for a single process were studied in [2,3,4], where asymptotically optimal performance can be obtained as the error constraints approach zero. The recent application and modification of the SPRT can be found in [5,6,7,8], where the SPRT was modified based on the fuzzy hypotheses [5], or was used to identify and diagnose the latent leakage faults for the pneumatic units [6], track multiple targets [7], or to determine software reliability [8].
Since the decision-maker can choose which process to probe at each time based on the past observations, the anomaly detection problem has a connection with the sequential design of experiments problem studied by Chernoff in 1959 [9] named as the Active Hypothesis Testing (AHT) problem. Compared with SPRT where the observation action under each hypothesis is fixed, active hypothesis testing allows the decision-maker to choose different experiments to conduct at each time and infer the state of the probed process. The test developed by Chernoff (referred to as Chernoff test) is a randomized test that generates random actions based on historical observations. The actions, consequently the test statistics of log-likelihood ratio, thus become independent and identically distributed over time, allowing asymptotic analysis of the stopping time on the test statistic. Chernoff’s work has been extended in various directions. It should be mentioned that Bessler [10] generated Chernoff’s work to general multiple hypotheses testing. Naghshvar and Javidi in [11,12,13,14,15] studied this sequential problem from the perspective of minimizing Bayesian risk considering the detection error and detection delay. Specifically, in [11], they established the lower bounds for the Bayesian risk which characterize the fundamental limits on the maximum achievable information acquisition rate and the optimal reliability. They further investigated the roles of information utility [13], performance bounds [14], and sequentiality and adaptivity [15] in active hypothesis testing problem separately. Recently, K. Cohen and Q. Zhao et al. [16,17,18,19,20] studied the AHT problem for anomaly detection of detecting anomalous processes among a fixed number of processes. In these studies, they were aimed at finding a sequential search strategy for the anomaly detection problem that minimizes the expected detection time subject to an error probability constraint. Specifically, in [16], in contrast to the random policies advocated in the Chernoff test, they introduced a simple deterministic model which offers the same asymptotic optimality yet with significant performance gain in the finite regime and considerable reduction in implementation complexity. In [17,18], Wang and Cohen considered the AHT model for the anomaly detection scenario where there are a few anomalous processes among a large number of processes, based on a binary-tree structured detection space. They further consider the anomaly detection problem in the scenario where the processes are heterogeneous [19] and the composite hypothesis case in which the observations follow a common distribution with an unknown parameter [20].
These above studies have focused on minimizing the expected sample size while we focus on minimizing the expected cumulative cost in this paper. When there is only one anomaly, minimizing the cumulative cost is equivalent to minimizing the sample size, because there is one and only one process incurring cost per unit time during the entire detection procedure. With multiple processes, however, minimizing the expected sample size based on the existing methods is no longer sufficient, since the abnormal process will stop incurring cost once its state is identified, which makes the cumulative per-unit-time cost incurred by all the anomalies change. The anomaly detection problem with the objective of minimizing the cumulative observation cost was formulated by K. Cohen and Q. Zhao in [21], where they studied this problem with the restriction that across-processes switching is allowed only when the state of the probed process is declared. They focused on the scenario where the number of anomalies is unknown, developed optimal index algorithms and demonstrated its strong performance in terms of minimizing the expected cumulative observation cost through numerical simulations. Furthermore, they studied this problem in [22] without the switching restriction and developed index-type algorithms which had been proven to be asymptotically optimal as the error constraints approach zero. Then, A. Gurevich [23] tackled a general nonlinear cost setting and developed an effective algorithm.
However, these above studies do not consider the switching cost. Incorporating the switching cost into the objective function is motivated by lots of applications. For example, in many searching tasks, relocating the searching region using rescuing ships or air-crafts incurs a considerable cost in terms of energy or delay. Another example is medical diagnostics, where frequent and fast switching across drugs and medical procedures may carry high risk and side effects. Moreover, in power systems, switching different components to probe also incurs a certain amount of time delay and requires a switching cost. As for the AHT problem considering the switching cost, there are few studies in the literature. Vaidhiyan developed a modified Chernoff test (referred as Sluggish policy) in [24] and introduced a switching parameter η which determines the switching probability, which can significantly reduce the number of switchings. They claimed that Sluggish policy approaches the asymptotic performance of Chernoff test as η 0 . In our previous work [25,26], we applied the AHT model to the single-target anomaly detection problem. We proposed a low-complexity deterministic policy (referred as DBS policy) which is shown to be asymptotically optimal and offers significant performance improvement in the finite regime. However, it should be noted that they all focused on the AHT problem from the perspective of minimizing the summation of the sample size and the switching cost and did not consider the expected cumulative cost. Thus, the anomaly detection problem with the objective of minimizing the expected cumulative cost considering the switching cost is first formulated and studied in this paper. In order to intuitively compare our work with the recent existing works, we show the differences in Table 1 according to the different objective functions and whether the switching costs are considered.

1.2. Contributions

In this paper, we consider the problem with the objective of minimizing the expected cumulative costs that take into account not only detection cost but also the switching cost. We are thus facing a new problem that requires a trade-off between the cost per unit time, the sample size and the switching across processes. We propose a deterministic policy (DMSC policy) which makes the number of switching as small as possible while ensuring the asymptotic optimality of the expected cumulative cost incurred by observations. Furthermore, we focus on the problem in the scenario where the number of anomalies is known in advance. In this scenario, to detect all the anomalies, the decision-maker can directly identify all the abnormal processes and make a declaration; or it can exclude all the normal processes and thus obtain the correct information about the anomalies. Thus, the proposed algorithm partitions the problem into two cases. In one case, the processes most likely to be abnormal will be probed with the highest probability; in another case, the decision-maker probes processes that are likely to be normal and eliminates them one by one. We analyze the asymptotic performances of the DMSC policy for different ratios of single-switching delay to single-observation delay as the error constraint approaches zero. We draw the conclusion that the proposed DMSC policy is asymptotically optimal in terms of minimizing the expected cumulative costs when the ratio of single-switching delay to the single observation delay is much smaller than the declaration threshold and is order-optimal when the ratio is comparable to the threshold. The strong performance in the finite regime is demonstrated in the simulation part.

1.3. Organization

In this paper, Section 2 describes the system model and problem formulation for the anomaly detection problem. In Section 3 we propose the deterministic low-cost DMSC policy and analyze its asymptotic performance in the infinite regime. In Section 4 we provide numerical results to illustrate the performance of the proposed policy as compared with other existing policies in the finite regime. Section 5 concludes the paper.

2. System Model and Problem Formulation

2.1. System Model

Consider the problem of detecting L abnormal processes among M processes. Each process may be in a normal state (denoted by H 0 ) or an abnormal state (denoted by H 1 ). Process m is abnormal with a priori probability π m , while process m is in a normal state with a priori probability 1 π m . Let
H 0 { m : 1 m M , process m is normal } , H 1 { m : 1 m M , process m is abnormal }
be the set of normal and abnormal processes, respectively. Each abnormal process m incurs a cost c m ( 0 c m ) per unit time until its state has been identified, while the normal processes do not incur any cost. We focus on the case where c m is the same for each abnormal process, in another word, c m = c holds for all abnormal processes.
The detection procedure starts at time n = 0 and the decision-maker can choose one process to probe at each time. Let ϕ ( n ) { 1 , 2 , , M } be the selection rule indicating which process is chosen to be probed at time n. The time series vector of selection rules can be denoted by ϕ = ( ϕ ( n ) , n 0 ) . When process m is probed at time n, an observation y m ( n ) is obtained from a distribution and is independent over time. If process m is in a normal state, the observation y m ( n ) follows distribution f ( y ) ; if process m is in an abnormal state, the observation y m ( n ) follows distribution g ( y ) . In this paper, we focus on the case where the distributions f ( y ) and g ( y ) are completely known. In practice, we can obtain the distribution f ( y ) by observing the normal processes and analyzing the observation data. As for the distribution g ( y ) of anomalies, it can be roughly judged based on experience. For example, consider the anomaly detection problem among a cyber system. An IDS monitors the traffic over the normal components and takes the packet size values that have arrived in a given interval as statistics. By data analysis, we can know that the observations from normal processes follow a certain distribution. Furthermore, it is known that DoS attacks aim to flood the target component with massive useless traffic. Thus the observations of the process being attacked by DoS will follow a distribution with a large mean. To detect the anomalies, we can assume that the observations from abnormal processes follow a prior distribution of interest. Then, it can be considered that the distribution is known.
We define the stopping time τ m , which is counted from the beginning of the entire detection procedure, as the time when the state of process m is declared and the decision-maker stops probing the process m. The vector of stopping times for M processes can be denoted by τ = ( τ 1 , . . . , τ M ) . We define the stage of the detection procedure as the period time between the stopping times of two processes whose states are successively declared. Besides, the stopping time of the entire detection procedure is denoted by τ e n d , which means all the abnormal processes have been identified. We define δ m { 0 , 1 } as the decision rule that the decision-maker uses to declare the state of process m at stopping time τ m . We have δ m = 0 if the decision-maker declares that process m is in a normal state, while δ m = 1 if the decision-maker declares that process m is in an abnormal state. Let N m be the random sample size required to declare the state of process m. Let δ e n d denote the final decision rule that the decision-maker uses to declare the set of anomalies at the stopping time τ e n d .
The abnormal process m continues incurring costs until its states are identified at the corresponding stopping time τ m . Thus, the expected cumulative cost incurred by all the abnormal processes during the entire detection procedure is given by
E ( C | Γ ) = E m H 1 c m τ m | Γ ,
where Γ = ( τ , δ , ϕ ) denotes an admissible policy for the sequential anomaly detection problem based on the active hypothesis testing model.
The objective is to find a policy Γ that minimizes the expected cumulative cost subject to the error constraints for each process:
inf Γ E ( C | Γ ) , subject to P e m α m = 1 , 2 , , M .
It should be noted that P e m = max ( P m F A , P m M D ) , where P m F A and P m M D denote the false-alarm and miss-detection error probabilities for process m respectively. Besides, let C * denote the infimum achievable by any policy,
C * = inf Γ E ( C | Γ ) .
Further, analyze to simplify the objective function of the expected cumulative cost. During the entire detection procedure, in addition to spending time observing the processes, it also takes time to switch across processes. Let N τ m d and N τ m s denote the total sample size and the total switching times by the stopping time τ m , respectively. We set each observation to 1 unit time and each switching to s unit time. Then, the stopping time τ m for process m can be denoted by
τ m = N τ m d + s N τ m s .
Thus, the objective function can be denoted by
inf Γ E m H 1 c N τ m d + s N τ m s | Γ , subject to P e m α m = 1 , 2 , , M .

2.2. Notations

Since only one process can be probed at a time, let 1 m ( n ) be the indicator function of whether process m is probed at time n. 1 m ( n ) = 1 if process m is probed at time n, and 1 m ( n ) = 0 otherwise.
We use the log-likelihood ratio (LLR), a statistic used in classical sequential hypothesis testing [1], as the decision statistic between two hypotheses. The LLR of process m at time n is denoted as
l m ( n ) log g ( y m ( n ) ) f ( y m ( n ) ) ,
which reflects the goodness-of-fit of which distribution a certain process belongs to. The sum log-likelihood ratio (sum-LLRs) of process m at time n is given by
S m ( n ) t = 1 n l m ( t ) 1 m ( t ) ,
which combines the observations of the process m at multiple times, and can be regarded as the score of whether the process is in an abnormal state.
Let D ( g | | f ) and D ( f | | g ) denote the KL divergence between two distributions g and f which are given by
D ( g | | f ) log g ( x ) f ( x ) g ( x ) d x , D ( f | | g ) log f ( x ) g ( x ) f ( x ) d x .
If process m is in an abnormal state, the sum-LLRs S m ( n ) of process m is a random walk with positive expected increment E m ( l m ( n ) ) = D ( g | | f ) > 0 , while S j ( n ) of process j which is in a normal state is a random walk with negative expected increment E m ( l j ( n ) ) = D ( f | | g ) < 0 . Thus, when the sum-LLRs of process m is sufficiently large, we can declare with a sufficient accuracy that process m is in an abnormal process. Similarly, when the sum-LLRs of process j is sufficiently small, we can declare its state as normal.

3. The DMSC Policy

In this section, we propose a deterministic anomaly detection policy and analyze its sample and switching complexity and the expected cumulative cost in the asymptotic regime as the error constraint α approaches zero.

3.1. The DMSC Policy

Consider the problem of detecting L abnormal processes among M processes where L and M are known. The decision-maker can locate all the anomalies using the method of directly selecting and identifying all L abnormal processes or the method of excluding all M L normal processes. Thus, the proposed DMSC policy partitions the problem space into two cases by comparing 2 D ( g | | f ) L + 1 + ( M , L ) and D ( f | | g ) M L , i.e.,
Case I : 2 D ( g | | f ) L + 1 + ( M , L ) D ( f | | g ) M L , Case II : 2 D ( g | | f ) L + 1 + ( M , L ) < D ( f | | g ) M L ,
where the offset can be expressed as
( M , L ) s ( 2 M 3 L + 1 ) D ( g | | f ) D ( f | | g ) ( L + 1 ) ( M L ) B .
In Case I, the DMSC policy aims at identifying the L abnormal processes sequentially. It should be noticed that in this case, probing the process with the highest sum-LLRs will lead to a rapid collection of sufficient information to declare the state of the process as abnormal since the abnormal processes tend to have higher sum-LLRs among these normal processes and the process with highest sum-LLRs tends not to change after a period of time, which will make the cost incurred by the observations and switchings as small as possible. Let A ( n ) denote the set of processes whose states have been declared as abnormal at time n. The selection rule ϕ ( n ) is given by
ϕ ( n ) = m 1 ( n )
where m 1 ( n ) = arg max m A ( n ) S m ( n ) is the index of the process with the highest sum-LLRs among all the processes whose states have not been declared at time n.
Following Wald’s SPRT [1], the stopping rule and decision rule are given by comparing the sum-LLRs S m ( n ) with the threshold at each time n. Thus, the stopping rule τ m and decision rule δ m can be denoted by
τ m = inf { n : S m ( n ) B , } ,
and
δ m = 1 ,
where the threshold B is determined such that the error constraint P e m α is satisfied and can be expressed as
B log 1 α α
by simplifying the computation of Wald’s approximation [1].
In this case, the stopping time τ e n d of the entire detection procedure and the final decision rule δ e n d are given by
τ e n d = inf { n : | A ( n ) | = L } ,
δ e n d = A ( n ) ,
which means we have completed the searching for the L abnormal processes.
In Case II, the decision-maker chooses the method of excluding M L normal processes to locate the L abnormal processes with lower expected cumulative costs. Let B ( n ) denote the set of processes whose states have been declared as normal at time n. Thus, the selection rule ϕ ( n ) , stopping rule τ m and decision rule δ m are given by
ϕ ( n ) = m 1 ( n ) ,
τ m = inf { n : S m ( n ) B } ,
δ m = 0 ,
where m 1 ( n ) = arg min m B ( n ) S m ( n ) is the index of the process with the smallest sum-LLRs among all the processes whose states have not been declared at time n. In this case, the stopping time τ e n d of the entire detection procedure and the final decision rule δ e n d are given by
τ e n d = inf { n : | B ( n ) | = M L } ,
δ e n d = M \ B ( n ) ,
where M = { 1 , 2 , , M } is the set of all processes.
The DMSC policy for anomaly detection problems in the AHT framework is shown in Algorithm 1.
Algorithm 1: The deterministic (DMSC) policy.
  Input: The observations y, the distributions f and g, the number of processes M, the number of anomalies L, the ratio s, the error constraint α
  Output: The set of anomalies δ e n d
1  Initial the sum-LLRs of the processes S m ( 0 ) = 0 for m = { 1 , 2 , . . . , M } ;
2  Calculate the declaration threshold B according to (13);
3  Calculate the statistics according to (8);
4  if 2 D ( g | | f ) L + 1 + ( M , L ) D ( f | | g ) M L then
5    while the number of declared processes < L do
6      Probe the process with the highest sum-LLRs: ϕ ( n ) = m 1 ( n ) ;
7      Obtain an observation y ϕ ( n ) ( n ) from the process ϕ ( n ) ;
8      Update S ϕ ( n ) ( n ) based on the last observation according to (6);
9      if S ϕ ( n ) ( n ) B then
10        Declare the process ϕ ( n ) as abnormal;
11      end
12    end
13    Declare the L declared processes as abnormal.
14  else
15    while the number of declared processes < M L do
16      Probe the process with the lowest sum-LLRs: ϕ ( n ) = m 1 ( n ) ;
17      Obtain an observation y ϕ ( n ) ( n ) from the process ϕ ( n ) ;
18      Update S ϕ ( n ) ( n ) based on the last observation according to (6);
19      if S ϕ ( n ) ( n ) B then
20        Declare the process ϕ ( n ) as normal;
21      end
22    end
23    Declare the remaining L processes as abnormal.
24  end
For Case I, the process with the highest sum-LLRs m 1 ( n ) is selected at each given time n and declared as abnormal once its sum-LLRs exceeds the threshold B. The asymptotic sample size N m required to declare the state of one process is expected to be B / D ( g | | f ) since the probed process is in an abnormal state with high probability and its corresponding sum-LLRs is a random walk with a positive expected increment D ( g | | f ) . Once the sum-LLRs of the probed process exceeds the threshold B, the decision-maker stops taking observations from this process and declares it as abnormal, which means that this point in time is a stopping time and the first stage terminates. Then choose the updated process m 1 ( n ) to probe and apply the same procedure to the remaining M 1 processes. This repeats until all L abnormal processes have been declared, at which point, the entire detection procedure terminates. Thus, the entire detection procedure can be divided into L stages where the observation time of each stage is expected to be B / D ( g | | f ) and the i-th stage is from the ( i 1 ) -th stopping time to the i-th stopping time. It should be noted that at the beginning of the i-th stage, i 1 processes have been declared as abnormal and at each time of the i-th stage, L i + 1 unidentified abnormal processes incur cost simultaneously. The cumulative observation cost incurred by the unidentified abnormal processes during the i-th stage is excepted to be ( L i + 1 ) B / D ( g | | f ) . Thus, the cumulative cost caused by observations during the detection procedure approaches c · L ( L + 1 ) 2 · B D ( g | | f ) . From another perspective, the cumulative observation time of the i-th declared process is i B / D ( g | | f ) . We also can draw the conclusion that the cumulative observation costs can be approximately expressed as c · L ( L + 1 ) 2 · B D ( g | | f ) . Besides, there will inevitably be switching across processes during the initialization process of each stage, which will result in additional delays. In Case I, we use c · s · L ( L 1 ) 2 to approximate the cost caused by the switchings.
For Case II, the process with the lowest sum-LLRs m 1 ( n ) is selected at each given time n and declared as normal once its sum-LLRs drops below the threshold B . The asymptotic sample size N m required to declare the state of one process approaches B / D ( f | | g ) since the probed process is in a normal state with high probability and its corresponding sum-LLRs is a random walk with a negative expected increment D ( f | | g ) . The same procedure is then applied to the remaining M 1 processes until all the M L normal processes have been declared as normal and then the entire procedure terminates with the remaining L processes declared as abnormal. Unlike Case I where the number of unidentified abnormal processes decreases as the stage index increases, in each stage of Case II, there are L abnormal processes incurring costs. Thus, the cumulative cost caused by observations approaches c · L ( M L ) B D ( f | | g ) . Similarly, the switching cost can be expressed as c · s · L ( M L ) .
Therefore, the decision-maker chooses the strategy that minimizes the asymptotic cumulative cost caused by observations and switchings according to
min c L ( L + 1 ) B 2 D ( g | | f ) + c s L ( L 1 ) 2 , c L ( M L ) B D ( f | | g ) + c s L ( M L ) .
Thus, by formula transformation, the problem space is partitioned into two cases as shown in (8).

3.2. Example

We illustrate the two cases of DMSC policy in Figure 1 with an example that detects L = 2 abnormal processes (assume that process 3 and process 4 are abnormal processes) among M = 5 processes.
For Case I, the decision-maker probes the process m 1 ( n ) and terminates the detection procedure once the number of the processes declared as abnormal reaches L. At the beginning of the detection procedure, since the sum-LLRs of all processes are zero, a process is randomly selected to probe at n = 0 . Suppose that the decision-maker selects process 1. Since process 1 is in a normal state, the sum-LLRs of process 1 will decrease with high probability. Thus, at n = 1 , when the first observation is finished, the order of sum-LLRs of all processes becomes { 2 , 3 , 4 , 5 , 1 } . Since the switching across process takes a certain time delay s, the decision-maker randomly chooses a process to probe at n = 1 + s . Suppose that process 2 is selected. Similarly, the sum-LLRs of process 2 will also decrease since process 2 is also in a normal state, and the order of sum-LLRs of all processes may become { 3 , 4 , 5 , 1 , 2 } . Then, the decision-maker chooses a process to probe at n = 3 + 2 s . Assume that the decision-maker selects process 3. Since process 3 is in an abnormal state, the sum-LLRs of process 3 increases and ranks first with high probability, i.e., m 1 ( n ) = 3 and S m 1 ( n ) ( n ) > 0 . From then on, the decision-maker will continue to probe process 3 with high probability until S m 1 ( n ) ( n ) B . Then the decision-maker will stop taking observations from process 3 and declare it as abnormal. At this time, the stage 1 of the entire detection procedure is finished. Then, repeat this procedure until declaring the state of another abnormal process and the entire detection procedure will be terminated.
For Case II, the decision-maker probes process m 1 ( n ) at each given time. Suppose process 5 is randomly selected to probe at the beginning of the detection procedure. Since process 5 is in a normal state, the sum-LLRs of process 5 will decrease and be the lowest among these processes. Thereafter, the decision-maker will continue probing process 5 until S m 1 ( n ) ( n ) < B , and then stop taking observations from process 5 and declare it as normal. Repeat this operation until all normal processes are declared. Then, the entire detection procedure terminates with the remaining processes declared as abnormal.

3.3. Performance Analysis

We now analyze the asymptotic performance of the DMSC policy in terms of the expected cumulative cost as the error constraint α 0 . Note that according to (13), that the error constraint approaches zero implies that the threshold B and the sample size required to declare the state of each process approaches infinity. In another word, the detection procedure will not be terminated.
According to (4), the expected cumulative cost E ( C | Γ ) can be denoted by the summation of the cost caused by observations, which can be denoted as
E ( C d ) = E m H 1 c N τ m d
and the cost caused by the switchings
E ( C s ) = E m H 1 c s N τ m s .
Thus, it is necessary to analyze the total number of observations and switchings. In our proposed policy, the states of the L abnormal processes or the M L normal processes are declared one by one, which splits the entire detection procedure into L or M L stages. Thus, one important part of the analysis of the DMSC policy is analyzing both the observation times and the switching times of each stage for two cases (detailed analysis can be found in Appendix A.2).
Besides the number of observations and the number of switchings, the ratio s is also an important parameter for the objective function of the expected cumulative cost. It should be noted that s determines the relative contribution of a single switching compared to a single observation to the cumulative cost. According to the order of the ratio of s to B, we analyze the optimality of the proposed policy in the following two scenarios:
Scenario 1: The ratio of the single-switching delay to the single-observation delay s is negligible to the threshold B in the asymptotic regime of α 0 , in another words, lim α 0 s B = 0 , i.e., s = o ( B ) .
Scenario 2: The ratio of the single-switching delay to the single-observation delay s is comparable to the threshold B in the asymptotic regime of α 0 , in another words, lim α 0 s B = O ( 1 ) , i.e., s = Ω ( B ) .
Note that B is the threshold relative to the error probability α and determines the expected sample size required to declared the state of processes, where the expected sample size is B / D ( g | | f ) for the abnormal processes and is B / D ( f | | g ) for the normal processes. Based on (22) and (23), the ratio of s to B can find a connection with the ratio of the cumulative switching cost to the cumulative observation cost.
Next, we consider the above two scenarios and provide the performance analyses of the DMSC policy on the expected cumulative cost. Firstly, we focus on Scenario 1 and prove that the DMSC is asymptotically optimal in this scenario as α 0 . Then, similarly, we prove that the DMSC policy is order-optimal in Scenario 2 in the asymptotic regime.

3.3.1. Performance Analysis for Scenario 1

Here, we assume that the parameter s satisfies s = o ( B ) as α 0 . In this subsection, we prove that the DMSC policy is asymptotically optimal in this scenario.
Definition 1.
We say that policy Γ is asymptotically optimal in α if
lim α 0 E ( C | Γ ) C * = 1 .
Theorem 1
(Asymptotical Optimality of DMSC Policy). Let E ( C | DMSC ) denote the expected cumulative cost incurred by the DMSC policy. If s = o ( B ) , the expected cumulative cost satisfies
lim α 0 E ( C | DMSC ) C * = 1 .
In other words, the expected cumulative cost of the DMSC policy is asymptotically optimal in α.
Proof. 
The proof idea is briefly provided here.
In Appendix A.1, we show that the objective function on the expected cumulative cost has an asymptotic lower bound and gives an expression for the asymptotic lower bound. Then, in Appendix A.2, we upper bound the expected cumulative cost of the DMSC policy by establishing the upper bounds of the number of observations and switchings of each stage. In addition, we show that if s = o ( B ) , the expected cumulative cost under DMSC policy approaches the asymptotic lower bound as α 0 , which completes the proof. The detailed proof is given in Appendix A.3. □

3.3.2. Performance Analysis for Scenario 2

Here, we focus on the scenario where the parameter s satisfies s = Ω ( B ) as α 0 . In this subsection, we define the order-optimal and present Theorem 2, which shows that the DMSC policy is order-optimal in this scenario.
Definition 2.
We say that policy Γ is order-optimal in α if
lim α 0 E ( C | Γ ) C * = O ( 1 ) .
Theorem 2
(Order-Optimality of DMSC Policy). Let E ( C | DMSC ) denote the expected cumulative cost incurred by the DMSC policy. If s = Ω ( B ) , then the expected cumulative cost of the DMSC policy satisfies
lim α 0 E ( C | DMSC ) C * = O ( 1 ) .
In other words, the expected cumulative cost of the DMSC policy is order-optimal in α.
Proof. 
The proof for this scenario is shown in detail in Appendix A.4 based on the similar approach outlined in the proof of Theorem 1.
Since s / B > 0 as α 0 , the offset ( M , L ) can not be ignored in this scenario and the analysis is more complicated than that of Scenario 1. We show that the ratio of the expected cumulative cost of DMSC policy to the asymptotic lower bound is larger than 1 but bounded by a positive constant as α 0 , which completes the proof for Scenario 2. □

4. Numerical Results

In this section, we present numerical examples to illustrate the performance of the proposed DMSC policy as compared to the Random selection Sequential Probability Ratio Testing policy (R-SPRT policy) and CL- π c N policy [22] in the finite regime.
R-SPRT Policy: The random SPRT (R-SPRT) policy is the policy with the lowest switching cost, where a series of SPRTs are performed in random order and the switchings occur only when the current probed process is identified. Once all the abnormal processes or all the normal processes are declared, the detection procedure of R-SPRT will be terminated.
CL- π cN policy: CL- π c N policy was proposed to solve the anomaly detection problem with a similar objective function that aims at minimizing the expected cumulative observation cost without considering the switching cost. It was shown to be asymptotic optimal on its objective function in the finite regime.
In this paper, we focus on the scenario where the number of abnormal processes and the total number of all processes are both known. In addition, we consider the case where the distribution under each hypothesis is completely known: f P o i ( λ f ) and g P o i ( λ g ) , which means that the observations from the normal processes follow the Poisson distribution with parameter λ f and the observations from the abnormal processes follow the Poisson distribution with parameter λ g . The KL divergences can be expressed as:
D ( g | | f ) = λ f λ g + λ g log ( λ g λ f ) , D ( f | | g ) = λ g λ f + λ f log ( λ f λ g ) .
Let C L B * be the asymptotic lower bound on the expected cumulative cost as α 0 , which is given by
c · min L ( L + 1 ) B 2 D ( g | | f ) + s L ( L 1 ) 2 , L ( M L ) B D ( f | | g ) + s L ( M L 1 )
in Appendix A.1 Lemma A1. Define
L Γ E ( C | Γ ) C L B * C L B *
as the relative cost in terms of the expected cumulative cost under policy Γ , as compared to the asymptotic lower bound. Following Theorem 1 and Theorem 2, we expect L D M S C to approach 0 in Scenario 1 and to be bounded by a constant in Scenario 2 as α 0 .

4.1. Scenario 1: s = o ( B )

In this part, we compare the performances of DMSC policy, R-SPRT and CL- π c N policy for M = 5 and L = 2 in Scenario 1 where s = o ( B ) as α 0 .
First, we consider the case where s is fixed, which means that the ratio of the single-switching delay to the single-observation delay is fixed. We set that s = 2 . Since B log 1 α α , in this case, s / B = 0 as α 0 , i.e., s = o ( B ) holds. Note that since s is fixed, the value of the offset ( M , L ) changes as the threshold B increases, which leads to the switch between Case I and Case II in DMSC policy. We set λ f = 2 , λ g = 0.01 and c = 1 . We average the results over 5 · 10 4 trials. Figure 2a illustrates the change in the choice of the decision-maker of probing the process m 1 ( n ) or process m 1 ( n ) as B increases for fixed s. The decision-maker chooses the strategy by comparing 2 D ( g | | f ) L + 1 + ( M , L ) and D ( f | | g ) M L as shown in (8). The greater B is, the smaller ( M , L ) is and the problem is more likely to be in Case II. Thus, there is a switch from Case I to Case II, which is visualized in the simulation figure as the line of DMSC policy (solid black line) overlaps with the line of DMSC policy’s Case I (dashed blue line) before the point B = 40 and overlaps with the line of DMSC policy’s Case II (dashed red line) after that point. As a result of the switching from Case I to Case II, the DMSC policy can achieve the objective of minimizing the expected cumulative cost. Furthermore, Figure 2b shows the relative cost under the DMSC policy and other policies as compared to the asymptotic lower bound. It can be seen that the DMSC policy significantly outperforms the others in the finite regime for all values of B and the relative cost of DMSC policy will approach 0 as α 0 , which is consistent with the conclusion of Theorem 1 that the DMSC policy is asymptotically optimal as α 0 . Besides, it can be noticed that the performance of the R-SPRT policy is worse than that of the DMSC policy but better than of CL- π c N policy.
Then, we consider the case where s / B = 2 α , which means lim α 0 s / B = 0 and ( M , L ) approaches 0 as α 0 . We set λ f = 1 and λ g = 3 , thus 2 D ( g | | f ) L + 1 0.96 and D ( f | | g ) M L 0.30 . Therefore, in this case, 2 D ( g | | f ) L + 1 > D ( f | | g ) M L holds for each B in the simulation and the DMSC policy selects process m 1 ( n ) at each given time n. We average the results over 5 · 10 4 trials. The relative costs under the DMSC policy and other policies as compared to the asymptotic lower bound are presented as a function of the threshold B in Figure 3. It is obvious that the performance of the DMSC policy is superior to that of others.

4.2. Scenario 2: s = Ω ( B )

In this part, we compare the performances of DMSC policy, R-SPRT and CL- π c N policy for M = 5 and L = 2 in Scenario 2 where s = Ω ( B ) as α 0 .
We consider the case where s / B = 2 , which implies that the order of ( M , L ) (defined in (9)) does not change regardless of the values of α or B. We set λ f = 1 and λ g = 3 , thus 2 D ( g | | f ) L + 1 0.96 , D ( f | | g ) M L 0.30 and ( M , L ) 1.56 . In this case, the DMSC policy always selects process m 1 ( n ) to probe at each given time n. We average the results over 5 · 10 4 trials. As shown in Figure 4, the R-SPRT significantly outperforms the DMSC policy for all values of B and the DMSC policy outperforms the CL- π c N policy.

4.3. Discussion

In this section, we presented numerical results to illustrate the performance of the proposed DMSC policy as compared to the R-SPRT policy, whose switching times are the smallest among any policies, and the CL- π c N policy which has been proven in [22] to be asymptotically optimal in terms of minimizing the cumulative observation costs. We compared these three algorithms in Scenario 1 and Scenario 2, respectively.
In Scenario 1 where s = o ( B ) as α 0 . First, we considered the scenario where s is fixed. As shown in Figure 2b, the DMSC policy outperforms the other policies, and the performance of the R-SPRT policy is worse than that of the DMSC policy but better than that of CL- π c N policy. As for the DMSC policy, it outperforms other policies and approaches 0 as threshold B increase, which is consistent with the conclusion of Theorem 1 that the DMSC policy is asymptotically optimal as α 0 .
As for the R-SPRT policy, the decision-maker performs SPRT for each process in a random order, and can not switch to another process before the state of the current probed process is declared. Thus, the expected switching time of R-SPRT is fixed and smaller than any other policies. However, due to the switching constraints, the decision-maker should probe one process until the stopping rule of the process is reached, which leads to that the expected observation time and the cumulative observation costs of the R-SPRT policy are larger than others. In this scenario, the ratio of the single-switching delay to the single-observation delay is fixed, which means the single-switching cost is comparable with the single-observation cost. When the threshold B is small, the expected sample size required to declare the state of a process is small, and the negative effects of the switching constraints of the R-SPRT policy are not much significant. At this time, the relative cost of the R-SPRT policy is slightly larger than that of the DMSC policy. As the threshold B increases, the expected sample size increases, and the cumulative observation costs of the R-SPRT policy increase faster than others. As a result, as the threshold B increases, the relative cost of R-SPRT increases, and the gap of the relative costs of R-SPRT policy and DMSC policy increases.
As for the CL- π c N policy policy, at each given time n, the decision-maker calculate the index γ m ( n ) = π m ( n ) c m E ^ ( n ) ( N m ) for each process m. At each non-specific time, the process with the largest index is probed, while at each specific time that grows exponentially sparse with time, the processes are probed in a round-robin fashion, which leads to the increment of the switching time and the cumulative switching costs. Thus, in this scenario where the single-switching delay is comparable with the single-observation delay ( s = 2 ), the relative cost of CL- π c N policy is highest among these compared policies, even if the CL- π c N policy is proved to be asymptotically optimal in terms of minimizing the cumulative observation costs [22].
Then, we considered the scenario where s / ( B α ) is fixed. It should be noted that α B α log α 0 holds as α 0 . In this simulation, s / ( α B ) is fixed and s / B = 2 α , which leads to that lim α 0 s = 2 α B 0 holds. In another word, the ratio of the single-switching delay to the single-observation delay approaches 0, and the objective of minimizing the cumulative costs can be simplified to minimizing the cumulative observation costs. Thus, due to the switching constraints which leads to that the decision-maker spends a lot of time probing each process, the R-SPRT policy performs worst in this scenario. On the contrary, benefiting from the small impact of the switches on the cumulative costs, the CL- π c N policy performs better than that of the last simulation. Due to the round-robin procedure, the switching costs of the CL- π c N policy are larger than that of the DMSC policy while the observation costs are slightly larger than that of DMSC policy. Since the ratio s approaches 0, the relative cost of the CL- π c N policy is slightly higher than that of the DMSC policy.
As a conclusion, in Scenario 1 where s = o ( B ) as α 0 , the DMSC policy outperforms other policies. Combining Theorem 1 where the DMSC policy is proved to be asymptotically optimal in the finite regime in this scenario, we can conclude that the DMSC policy is the optimal algorithm to solve such an anomaly detection problem in this scenario.
In Scenario 2 where s = Ω ( B ) as α 0 . As shown in Figure 4, the DMSC policy outperforms the CL- π c N policy but underperforms the R-SPRT policy. In this scenario, the ratio s is sufficiently large such the cost incurred by an additional switch will be higher than the cost of observing and declaring a non-target process. Since switching occurs only when the state of a process is identified, the switching times of R-SPRT are the smallest among any other policy. In this case, the R-SPRT performs better benefiting from the fewer switching times. Meanwhile, the switching cost of the DMSC policy is much higher than that of R-SPRT, making the performance on the expected cumulative cost inferior. As for the CL- π c N policy, the switching cost is much higher than that of DMSC policy, thus its relative cost is highest among these three algorithms. Besides, the DMSC is order-optimal in terms of the expected cumulative cost in the scenario where s = Ω ( B ) as α 0 .
In a conclusion, since the ratio s is sufficiently large, any switch will make the cumulative costs much higher. In this scenario, the best method is to minimize switching, i.e., perform SPRT for each process one by one. Thus, in this scenario, the R-SPRT policy is the optimal algorithm since its switching time is the lowest.

5. Conclusions

In this paper, we considered the problem of detecting anomalous processes among a fixed number of processes with the framework of the AHT model. The decision-maker can choose only one process to probe at each given time. If the processes of any two consecutive observations are different, a switching across processes will occur. Either observation for any process or switching across processes increases time delay. Each abnormal process incurs cost per unit time until its state is identified and normal processes do not incur any cost. Our objective is to find an active inference policy that minimizes the expected cumulative cost incurred by all the abnormal processes during the entire detection procedure.
As far as we know, the anomaly detection problem with the objective of minimizing the expected cumulative cost considering the switching costs is first formulated in this paper. For such a problem, we proposed a deterministic policy referred to as DMSC policy that partitions the problem into two cases, one in which the decision-maker directly selects and identifies all abnormal processes, and the other in which all normal processes are excluded and all the abnormal processes are located finally. Furthermore, we proved that the proposed algorithm is asymptotically optimal and order-optimal under error constraints when the ratio of the single-switching delay to the single-observation delay is much smaller than or comparable with the threshold which determines the expected sample size required to declare the states of processes. We also provided numerical simulations to show the strong performance of DMSC policy in the finite regime. The numerical results show the optimality of the DMSC policy in a certain scenario.
However, the optimality of our proposed algorithm is based on the assumption that all abnormal processes incur the same and constant cost per unit time until their corresponding states are identified. Besides, we focus on the scenario where the number of anomalies is known and the distributions of normal and abnormal processes are completely known. If any of these conditions are not met, the optimality of the proposed DMSC policy may no longer hold.
In the future, we would like to study such an anomaly detection problem in the scenario where different anomalous processes incur different single-time costs, or the single-time costs change over time. Besides, we expected that the problem can be extended to the situation where the number of anomalies or the distribution of each hypothesis is unknown, which may be more advantageous in some practical scenarios.

Author Contributions

Conceptualization, F.Q. and H.F.; methodology, F.Q. and H.F.; validation, F.Q.; formal analysis, F.Q.; investigation, F.Q.; resources, F.Q.; writing—original draft preparation, F.Q.; writing—review and editing, F.Q., H.F., T.Y. and B.H.; visualization, F.Q. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Shanghai Municipal Natural Science Foundation grant number 19ZR1404700 and the Yiwu Research Institute of Fudan University.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A. Proof for Theorems

Appendix A.1. The Asymptotic Lower Bound on the Expected Cumulative Cost

In this subsection, we establish the asymptotic lower bound on the expected cumulative cost that can be achieved by any policy.
Lemma A1
(The Asymptotic Lower Bound on the Expected cumulative cost). Let C L B * denote the asymptotic lower bound on the expected cumulative cost. Then,
C * C L B * ,
where,
C L B * = c · min L ( L + 1 ) B 2 D ( g | | f ) + s L ( L 1 ) 2 , L ( M L ) B D ( f | | g ) + s L ( M L 1 ) ,
and B is a function of α and B log 1 α α .
Proof. 
According to the objective function as (4), the cumulative cost consists of the cost incurred by the observations and the cost incurred by the switchings, and E ( C d ) and E ( C s ) denote the cost incurred by the observations and switchings respectively. It should be noted that once an abnormal process is identified, it will not continue incurring costs.
When the total number of processes M and the number of abnormal processes L are known, there are two ways to declare the number of abnormal processes, one is to directly declare the L abnormal processes as abnormal, and the other is declaring M L normal processes as normal one by one and declaring the remaining L processes as abnormal.
When the states of the abnormal processes are declared directly, it is intuitive that probing normal processes before declaring the states of abnormal processes will increase the observation cost. Hence, to establish the lower bound on the expected cumulative cost, we assume that all the abnormal processes are tested before the normal ones. We apply ([22], Lemma 1), where an asymptotic lower bound on the expected cumulative cost considering only the observation cost was established under the same assumption, we have:
inf Γ E ( C d | Γ ) l = 1 L c i = 1 l B D ( g | | f ) = c L ( L + 1 ) B 2 D ( g | | f ) .
Furthermore, any additional switching will also increase the cost. Thus, we assume that each process must be probed continuously and switching is not performed until the state of the currently probed process is declared. Thus, at least L 1 switchings will occur during the entire detection procedure and the cost incurred by the switchings can be lower bounded by
inf Γ E ( C s | Γ ) c s L ( L 1 ) 2 .
Thus, the expected cumulative cost in this situation can be lower bounded by
C * = inf Γ E ( C | Γ ) c L ( L + 1 ) B 2 D ( g | | f ) + s L ( L 1 ) 2
as α 0 .
When declaring the normal processes one by one, we assume that all the normal processes are tested before the abnormal process, and switching across processes is performed only when the state of the currently probed process is declared. Since lim α 0 E ( N m | H 0 ) B / D ( f | | g ) [1], and the number of abnormal processes incurring costs remains constant during the detection procedure (because none of the abnormal processes are identified), we have:
C * = inf Γ E ( C | Γ ) l = 1 L c i = 1 M L B D ( f | | g ) + c s L ( M L 1 ) c L ( M L ) B D ( f | | g ) + s L ( M L 1 )
as α 0 .
Combining (A5) and (A6), the proof of Lemma A1 is completed. □

Appendix A.2. The Expected Cumulative Cost of DMSC Policy

In the DMSC policy, the detection procedure is divided into L or M L stages, depending on whether the decision-maker chooses to probe the process with the highest sum-LLRs m 1 ( n ) or the process with the lowest sum-LLRs m 1 ( n ) . Here, we analyze the asymptotic performance of the DMSC policy on the expected cumulative cost at each stage. Summing the expected cost of each stage will yield the expected cumulative cost of the entire detection procedure. Inspired by (4), we analyze the number of observations and switchings at each stage to obtain the expected cumulative cost.
Let N d k and N s k denote the observation times and the switching times during the k-th stage, respectively. Note that differing from the subscript m of N τ m d and N τ m s , which represents the index of the process, the superscript k of N d k and N s k represents the index of the stage. Figure A1 visually shows the relationship between these parameters.
Figure A1. Illustration of the notations.
Figure A1. Illustration of the notations.
Applsci 11 02976 g0a1
For example, consider the anomaly detection problem among a system consisting of M = 3 processes (denoted as process 1 , 2 , 3 ) and L = 2 abnormal processes (for example, process 1 , 3 are abnormal). We assume that the decision-maker chooses m 1 ( n ) to probe and once the number of processes declared as abnormal reaches L, the detection procedure terminates. Suppose that the decision-maker identifies the abnormal processes in the order of { 1 , 3 } . Hence, the entire detection procedure will be divided into two stages. The stage 1 is from the beginning of the detection procedure n = 0 to the stopping time τ 1 of process 1, where the stopping time τ 1 can be expressed as τ 1 = N τ 1 d + s N τ 1 s , and the duration of stage 1 can be expressed as N d 1 + s N s 1 . Similarly, the stage 2 is from the stopping time τ 1 to the stopping time τ 3 . The stopping time τ 3 can be expressed as τ 3 = N τ 3 d + s N τ 3 s , where N τ 3 d = N d 1 + N d 2 and N τ 3 s = N s 1 + N s 2 are the summation of the observation times and the switching times in two stages, respectively. The duration of stage 2 can be expressed as N d 2 + s N s 2 . In addition, once the state of abnormal process is identified, the corresponding process stops incurring cost. Thus, the cost incurred by process 1 is c τ 1 and the cost incurred by process 3 is c τ 3 , while process 2 does not incur any cost because it is in a normal state. As a conclusion, the cumulative cost incurred during the entire detection procedure is given by c τ 1 + c τ 3 .
Then, we upper bound the expected cumulative cost by analyzing the number of observations and switchings at each stage for Case I and Case II. Since the condition of Case II in DBS policy and DMSC policy are the same, we can apply ([26], Lemma 5 and Lemma 6) to our model in Case II and yield:
E ( N d k | Case II ) ( 1 + o ( 1 ) ) B D ( f | | g ) as α 0 ,
and there exists T s ( 0 , ) such that
E ( N s k | Case II ) T s .
However, it is not feasible to apply the conclusion (A7) and (A8) directly to the Case I of DMSC policy since the condition of Case I of DMSC is more complicated. Therefore, it remains to upper bound the observation times and switching times for Case I of DMSC policy.
For Case I, we can upper bound the observation times N d k and switching times N s k of each stage by analyzing three last passage times of each stage k on the assumption that the ratio s is equal to zero, and the obtained upper bounds are applicable to the case where s is greater than zero. Then, on the assumption that s = 0 , these three passage times can be defined as T 1 k , T 2 k , T 3 k , where T 1 k is the last passage time when the process with the highest sum-LLRs is one of the abnormal processes for all n T 1 k at stage k; T 2 k is the time when the process with the highest sum-LLRs no longer changes for all n T 2 k ; and T 3 k is the time when sufficient information for declaring the process m 1 ( n ) as abnormal has been gathered, in another word, T 3 k is the time when the sum-LLRs of the process m 1 ( n ) satisfies S m 1 ( n ) ( n ) B for all t T 3 k . Hence, according to the definition of T 2 k , the number of switchings N s k of a stage is upper bounded by the value of T 2 k , i.e., N s k T 2 k since the switchings occur only during the period from the beginning of the stage to T 2 k . In addition, the number of observations is upper bounded by T 3 k according to the definition of T 3 k .
It should be noted that T 1 k , T 2 k , T 3 k are not stopping times, because they are associated with the future, and the decision-maker does not know whether they have arrived since the abnormal processes are unknown. Furthermore, these three last passage times are defined under the condition that the sampling is not stopped. In the following analysis, we say implemented indefinitely to indicate that the decision-maker probes the processes indefinitely.
According to the definitions, T 1 k represents the earliest time such that process m 1 ( n ) is an abnormal process for all n T 1 k in each stage. In addition, it has been proved that T 1 k is sufficiently small with high probability [26] and there exist D > 0 and γ > 0 such that
P ( T 1 k > n ) D e γ n .
In addition, T 2 k is the earliest time such that process m 1 ( n ) no longer changes for all n n 2 k . We introduce n 2 k T 2 k T 1 k which denotes the total amount of time between T 1 k and T 2 k . The following lemma shows that P ( n 2 k ) decreases exponentially with n.
Lemma A2.
Assume that the DMSC is in Case I and is implemented indefinitely. Then, there exist D > 0 and γ > 0 such that
P ( n 2 k > n ) D e γ n
for each k = 1 , 2 , . . . , L .
Proof. 
Define
l ˜ m ( n ) = l m ( n ) D ( g | | f ) , if process m is abnormal , l m ( n ) + D ( f | | g ) , if process m is normal ,
thus E ( l ˜ m ( n ) ) = 0 . Note that,
P ( n 2 k > n ) P sup t n S m 2 ( t ) ( t ) ( S m 1 ( t ) ( t ) + l m 1 ( t ) ( t + 1 ) ) 0 t = n P S m 2 ( t ) ( t ) S m 1 ( t ) ( t ) l ˜ m 1 ( t ) ( t + 1 ) D ( g | | f ) t = n E e s · ( S m 2 ( t ) ( t ) S m 1 ( t ) ( t ) l ˜ m 1 ( t ) ( t + 1 ) ϵ ) · e s ( D ( g | | f ) ϵ )
for all s > 0 and 0 < ϵ < D ( g | | f ) .
The last inequality follows by applying the Chernoff bound for each term in the summation. Since E S m 2 ( t ) ( t ) S m 1 ( t ) ( t ) l ˜ m 1 ( t ) ( t + 1 ) ϵ ϵ < 0 is strictly negative, differentiating the MGFs of S m 2 ( t ) ( t ) S m 1 ( t ) ( t ) l ˜ m 1 ( t ) ( t + 1 ) ϵ with respect to s yields strictly negative derivatives at s = 0 . Hence, there exist s > 0 and γ > 0 such that E S m 2 ( t ) ( t ) S m 1 ( t ) ( t ) l ˜ m 1 ( t ) ( t + 1 ) ϵ and e s ( D ( g | | f ) ϵ ) are strictly less than e γ t < 1 . Therefore, there exist D > 0 and γ > 0 such that
t = n E e s · ( S m 2 ( t ) ( t ) S m 1 ( t ) ( t ) l ˜ m 1 ( t ) ( t + 1 ) ϵ ) · e s ( D ( g | | f ) ϵ ) t = n e γ t D e γ n ,
which completes the proof. □
It should be noted that the switchings across processes occur only before T 2 k (where T 2 k is defined on the assumption that s = 0 ), therefore the switching times at each stage follow that N s k T 2 k = T 1 k + n 2 k . Then, based on (A9) and Lemma A2, the number of switchings of Case I in DMSC is upper bounded by applying ([26], Lemma 4 and Lemma 5) (where the upper bound of the switching times is established) to our model. As a conclusion, there exists a constant T s ( 0 , ) such that
E ( N s k | Case I ) T s .
Finally, T 3 represents the earliest time when the sum-LLRs of the process m 1 ( n ) exceeds the threshold B and n 3 k T 3 k T 2 k . Since E ( N m | H 1 ) B / D ( g | | f ) as error constraint α 0 [1], we have
E ( n 3 k | Case I ) B D ( g | | f ) as α 0 ,
where B log 1 α α log α as α 0 . Note that the observation time of stage k N d k = T 1 k + n 2 k + n 3 k . Thus, combining (A9), Lemma A2 and (A14):
E ( N d k | Case I ) ( 1 + o ( 1 ) ) B D ( g | | f ) as α 0 .
Thus, combining (A7), (A8), (A13) and (A15), the number of observations and switchings of DMSC policy at each stage can be bounded
E ( N d k ) ( 1 + o ( 1 ) ) B / D ( g | | f ) , if Case I , ( 1 + o ( 1 ) ) B / D ( f | | g ) , if Case II ,
where B log 1 α α log α as α 0 . Besides, there exists T s ( 0 , ) such that
E ( N s k ) T s .
As a result, according to (4), the expected cumulative cost of DMSC policy can be upper bounded by
E ( C | DMSC ) c k = 1 L i = 1 k B D ( g | | f ) + s T s , if Case I c k = 1 L i = 1 M L B D ( f | | g ) + T s , if Case II = c L ( L + 1 ) 2 B D ( g | | f ) + s T s , if Case I c L ( M L ) B D ( f | | g ) + s T s , if Case II .

Appendix A.3. Asymptotically Optimality of DMSC Policy

In this subsection, we focus on Scenario 1 where the parameter s satisfies s = o ( B ) as α 0 .
Note that the offset ( M , L ) 0 holds as α 0 in this scenario where lim α 0 s / B = 0 . Then, the two cases of DMSC policy (8) can be expressed as
Case I 2 D ( g | | f ) L + 1 D ( f | | g ) M L , Case II 2 D ( g | | f ) L + 1 < D ( f | | g ) M L .
If DMSC policy is in Case I, according to (A2), the asymptotic lower bound on the expected cumulative cost is given by c L ( L + 1 ) B 2 D ( g | | f ) + c s L ( L 1 ) 2 . Then,
lim α 0 E ( C | DMSC ) C * lim α 0 E ( C | DMSC ) C L B * lim α 0 c L ( L + 1 ) 2 B D ( g | | f ) + s T s c L ( L + 1 ) B 2 D ( g | | f ) + c s L ( L 1 ) 2 = lim α 0 1 + r 1 L ( L + 1 ) 2 D ( g | | f ) + L ( L 1 ) s 2 B s B ,
where r 1 = L ( L + 1 ) T s 2 L ( L 1 ) 2 . Since lim α 0 s / B = 0 and r 1 is a constant, then
lim α 0 E ( C | DMSC ) C * 1 .
In Case II, according to (A2), the asymptotic lower bound on the expected cumulative cost is given by c L ( M L ) B D ( f | | g ) + c s L ( M L 1 ) . Following a similar line of arguments as above, we can prove that lim α 0 E ( C | DMSC ) C * 1 holds in Case II. Therefore, the proof of the asymptotic optimality of DMSC policy in Scenario 1 is completed.

Appendix A.4. Order-Optimality of DMSC Policy

In this subsection, we focus on Scenario 2 where the parameter s satisfies s = Ω ( B ) as α 0 . In this scenario, ( M , L ) can not be ignored as α 0 .
If DMSC is in Case I,
2 D ( g | | f ) L + 1 + ( M , L ) D ( f | | g ) M L
holds. In this situation, based on (A22), we can not infer whether the term c L ( L + 1 ) B 2 D ( g | | f ) + c s L ( L 1 ) 2 of (A2) is greater or less than the other term c L ( M L ) B D ( f | | g ) + c s L ( M L 1 ) . Thus, the asymptotic lower bound on the expected cumulative may be the value c L ( L + 1 ) B 2 D ( g | | f ) + c s L ( L 1 ) 2 or the value c L ( M L ) B D ( f | | g ) + c s L ( M L 1 ) . If the asymptotic lower bound is equal to the former expression, we can upper bound the ratio of the expected cumulative cost of DMSC policy to C * by applying (A20) and yield
lim α 0 E ( C | DMSC ) C * lim α 0 E ( C | DMSC ) C L B * lim α 0 1 + r 1 L ( L + 1 ) 2 D ( g | | f ) + L ( L 1 ) s 2 B s B lim α 0 1 + r 1 s L ( L + 1 ) 2 D ( g | | f ) B = O ( 1 ) .
If the asymptotic lower bound is equal to the latter expression, then the upper bound is given by
lim α 0 E ( C | DMSC ) C * lim α 0 E ( C | DMSC ) C L B * lim α 0 c L ( L + 1 ) 2 B D ( g | | f ) + c s L ( L + 1 ) 2 T s c L ( M L ) B D ( f | | g ) + c s L ( M L 1 ) = lim α 0 r 2 + r 3 s ( M L ) B + s ( M L 1 ) D ( f | | g ) ,
where r 2 = ( L + 1 ) D ( f | | g ) 2 ( M L ) D ( g | | f ) and r 3 = r 2 · ( ( M L ) D ( g | | f ) T s ( M L 1 ) D ( f | | g ) ) . Then,
lim α 0 E ( C | DMSC ) C * lim α 0 r 2 + r 3 s ( M L ) B = O ( 1 ) .
Thus, it has been proved that lim α 0 E ( C | DMSC ) C * = O ( 1 ) in Case I.
Then, if DMSC is in Case II, i.e.,
2 D ( g | | f ) L + 1 + ( M , L ) < D ( f | | g ) M L
holds. Then, we can infer that the asymptotic lower bound is equal to c L ( M L ) B D ( f | | g ) + c s L ( M L 1 ) since L ( L + 1 ) B 2 D ( g | | f ) + s L ( L 1 ) 2 L ( M L ) B D ( f | | g ) + s L ( M L 1 ) holds in this situation. Then,
lim α 0 E ( C | DMSC ) C * lim α 0 E ( C | DMSC ) C L B * lim α 0 c L ( M L ) B D ( f | | g ) + c s L ( M L ) T s c L ( M L ) B D ( f | | g ) + c s L ( M L 1 ) = lim α 0 1 + s L T s L ( M L ) B D ( f | | g ) + s L ( M L 1 ) .
Since lim α 0 s / B = O ( 1 ) and T s is a constant, then,
lim α 0 E ( C | DMSC ) C * lim α 0 1 + T s s ( M L ) D ( f | | g ) B = O ( 1 ) .
Therefore, the proof of the order-optimality is completed.

References

  1. Wald, A. Sequential Analysis; Courier Corporation: New York, NY, USA, 2004. [Google Scholar]
  2. Lai, T.L. Nearly optimal sequential tests of composite hypotheses. Ann. Stat. 1988, 16, 856–886. [Google Scholar] [CrossRef]
  3. Pavlov, I.V. Sequential procedure of testing composite hypotheses with applications to the Kiefer–Weiss problem. Theory Probab. Its Appl. 1991, 35, 280–292. [Google Scholar] [CrossRef]
  4. Draglia, V.; Tartakovsky, A.G.; Veeravalli, V.V. Multihypothesis sequential probability ratio tests. I. Asymptotic optimality. IEEE Trans. Inf. Theory 1999, 45, 2448–2461. [Google Scholar] [CrossRef] [Green Version]
  5. Afshari, R.; Gildeh, B.S. Modified sequential sampling plan using fuzzy SPRT. In Proceedings of the 2017 5th Iranian Joint Congress on Fuzzy and Intelligent Systems (CFIS), Qazvin, Iran, 7–9 March 2017; pp. 116–121. [Google Scholar]
  6. Zuo, J.; Ding, J.; Feng, F. Latent Leakage Fault Identification and Diagnosis Based on Multi-Source Information Fusion Method for Key Pneumatic Units in Chinese Standard Electric Multiple Units (EMU) Braking System. Appl. Sci. 2019, 9, 300. [Google Scholar] [CrossRef] [Green Version]
  7. Ainsleigh, P.L.; Luginbuhl, T.E.; Willett, P.K. A Sequential Target Existence Statistic for Joint Probabilistic Data Association. IEEE Trans. Aerosp. Electron. Syst. 2020, 57, 371–381. [Google Scholar] [CrossRef]
  8. Lee, D.H.; Chang, I.H.; Pham, H. Software reliability model with dependent failures and SPRT. Mathematics 2020, 8, 1366. [Google Scholar] [CrossRef]
  9. Chernoff, H. Sequential design of experiments. Ann. Math. Stat. 1959, 30, 755–770. [Google Scholar] [CrossRef]
  10. Bessler, S.A. Theory and Applications of the Sequential Design of Experiments, k-Actions and Infinitely Many Experiments. Part I. Theory; Technical report; Stanford University CA Applied Mathematics and Statistics Labs: Stanford, CA, USA, 1960. [Google Scholar]
  11. Naghshvar, M.; Javidi, T. Active M-ary sequential hypothesis testing. In Proceedings of the 2010 IEEE International Symposium on Information Theory, Austin, TX, USA, 13–18 June 2010; pp. 1623–1627. [Google Scholar]
  12. Naghshvar, M.; Javidi, T. Active sequential hypothesis testing. Ann. Stat. 2013, 41, 2703–2738. [Google Scholar] [CrossRef] [Green Version]
  13. Naghshvar, M.; Javidi, T. Information utility in active sequential hypothesis testing. In Proceedings of the 2010 48th Annual Allerton Conference on Communication, Control, and Computing (Allerton), Monticello, IL, USA, 29 September–1 October 2010; pp. 123–129. [Google Scholar]
  14. Naghshvar, M.; Javidi, T. Performance bounds for active sequential hypothesis testing. In Proceedings of the 2011 IEEE International Symposium on Information Theory Proceedings, St. Petersburg, Russia, 31 July–5 August 2011; pp. 2666–2670. [Google Scholar]
  15. Naghshvar, M.; Javidi, T. Sequentiality and adaptivity gains in active hypothesis testing. IEEE J. Sel. Top. Signal Process. 2013, 7, 768–782. [Google Scholar] [CrossRef] [Green Version]
  16. Cohen, K.; Zhao, Q. Active hypothesis testing for anomaly detection. IEEE Trans. Inf. Theory 2015, 61, 1432–1450. [Google Scholar] [CrossRef]
  17. Wang, C.; Cohen, K.; Zhao, Q. Active hypothesis testing on a tree: Anomaly detection under hierarchical observations. In Proceedings of the International Symposium on Information Theory (ISIT), Aachen, Germany, 25–30 June 2017; pp. 993–997. [Google Scholar]
  18. Wang, C.; Cohen, K.; Zhao, Q. Information-Directed Random Walk for Rare Event Detection in Hierarchical Processes. IEEE Trans. Inf. Theory 2020, 67, 1099–1116. [Google Scholar] [CrossRef]
  19. Huang, B.; Cohen, K.; Zhao, Q. Active anomaly detection in heterogeneous processes. IEEE Trans. Inf. Theory 2018, 65, 2284–2301. [Google Scholar] [CrossRef] [Green Version]
  20. Hemo, B.; Gafni, T.; Cohen, K.; Zhao, Q. Searching for Anomalies Over Composite Hypotheses. IEEE Trans. Signal Process. 2020, 68, 1181–1196. [Google Scholar] [CrossRef] [Green Version]
  21. Cohen, K.; Zhao, Q.; Swami, A. Optimal index policies for anomaly localization in resource-constrained cyber systems. IEEE Trans. Signal Process. 2014, 62, 4224–4236. [Google Scholar] [CrossRef] [Green Version]
  22. Cohen, K.; Zhao, Q. Asymptotically optimal anomaly detection via sequential testing. IEEE Trans. Signal Process. 2015, 63, 2929–2941. [Google Scholar] [CrossRef] [Green Version]
  23. Gurevich, A.; Cohen, K.; Zhao, Q. Sequential anomaly detection under a nonlinear system cost. IEEE Trans. Signal Process. 2019, 67, 3689–3703. [Google Scholar] [CrossRef]
  24. Vaidhiyan, N.K.; Sundaresan, R. Active search with a cost for switching actions. In Proceedings of the 2015 Information Theory and Applications Workshop (ITA), San Diego, CA, USA, 1–6 February 2015; pp. 17–24. [Google Scholar]
  25. Chen, D.; Huang, Q.; Feng, H.; Zhao, Q.; Hu, B. Active anomaly detection with switching cost. In Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Brighton, UK, 12–17 May 2019; pp. 5346–5350. [Google Scholar]
  26. Qin, F.; Chen, D.; Feng, H.; Zhao, Q.; Yang, T.; Hu, B. Active Anomaly Detection with Switching Cost. arXiv 2021, arXiv:1810.11800. [Google Scholar]
Figure 1. Illustration of the DMSC policy ( M = 5 and L = 2 ).
Figure 1. Illustration of the DMSC policy ( M = 5 and L = 2 ).
Applsci 11 02976 g001
Figure 2. Performance comparison for M = 5 , L = 2 , s = 2 , λ f = 2 , λ g = 0.01 . (a) Average cost under DMSC policy. (b) Relative cost under the DMSC policy, the Sequential Probability Ratio Testing policy (R-SPRT) and CL- π c N policy as compared to the asymptotic lower bound. L DMSC approaches 0 as B ( α 0 ).
Figure 2. Performance comparison for M = 5 , L = 2 , s = 2 , λ f = 2 , λ g = 0.01 . (a) Average cost under DMSC policy. (b) Relative cost under the DMSC policy, the Sequential Probability Ratio Testing policy (R-SPRT) and CL- π c N policy as compared to the asymptotic lower bound. L DMSC approaches 0 as B ( α 0 ).
Applsci 11 02976 g002
Figure 3. Performance comparison for M = 5 , L = 2 , s / B = 2 α , λ f = 1 , λ g = 3 .
Figure 3. Performance comparison for M = 5 , L = 2 , s / B = 2 α , λ f = 1 , λ g = 3 .
Applsci 11 02976 g003
Figure 4. Performance comparison for M = 5 , L = 2 , s / B = 2 , λ f = 1 , λ g = 3 .
Figure 4. Performance comparison for M = 5 , L = 2 , s / B = 2 , λ f = 1 , λ g = 3 .
Applsci 11 02976 g004
Table 1. The differences between our work with the works in literature.
Table 1. The differences between our work with the works in literature.
Without Switching CostWith Switching Cost
Minimizing the sample size[16,17,18,19,20][24,25,26]
Minimizing the cumulative costs[21,22,23]Our work
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Qin, F.; Feng, H.; Yang, T.; Hu, B. Low-Cost Active Anomaly Detection with Switching Latency. Appl. Sci. 2021, 11, 2976. https://doi.org/10.3390/app11072976

AMA Style

Qin F, Feng H, Yang T, Hu B. Low-Cost Active Anomaly Detection with Switching Latency. Applied Sciences. 2021; 11(7):2976. https://doi.org/10.3390/app11072976

Chicago/Turabian Style

Qin, Fengfan, Hui Feng, Tao Yang, and Bo Hu. 2021. "Low-Cost Active Anomaly Detection with Switching Latency" Applied Sciences 11, no. 7: 2976. https://doi.org/10.3390/app11072976

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop