Professional Documents
Culture Documents
jec
rt
DTA/STA
Destinations
U Td
= XT( d ) X( d )
Ud
Input:
Cd Sd projection matrix U Rnr
XT( d ) energy vector s Rn
X( d ) Update Variance Matrix
input vector x Rn
Figure 8: New tensor X is matricized along the dth Output:
mode. Then variance matrix Cd is updated by XT X . updated projection matrix U
(d) (d)
The projection matrix Ud is computed by diagonalizing updated energy vector s
Cd . 1. As each point xt+1 arrives, initialize x := xt+1 .
when historical tensors have the same weights as the new 2. For 1 i r
tensor X . Note that forgetting factor is a well-known trick
in signal processing and adaptive filtering [11]. y(i) = U(:, i)T xi (projection onto U(:, i))
Update Rank: One thing missing from Figure 7 is how to s(i) s(i) + y(i)2 (energy i-th eigenval)
update the rank Ri . In general the rank can be different on e = x y(i)U(:, i) (error, e U(:, i))
each mode or can change over time. The idea is to keep the 1
smallest rank Ri such that the energy ratio kSi kF kXk2F , U(:, i) U(:, i) + y(i)e (update PC estimate)
is above the threshold [15]. In all experiments, we set the s(i)
threshold as 0.9 unless mentioned otherwise. x(i + 1) xi y(i)U(:, i) (repeat with remainder).
Complexity: The P
space consumption PMfor incremental algo-
rithm is M M
Q
i=1 Ni + i=1 Ni R i + i=1 Ri . The dominant
factor is from the first term O( M Figure 9: Tracking a projection matrix
Q
i=1 Ni ). However, standard
OTA requires O(n M
Q
i=1 Ni ) for storing all tensors up to time
n, which is unbounded. Streaming tensor analysis: The goal of STA is to adjust
The computation cost is M
P 2 PM QM projection matrices smoothly as the new tensor comes in.
i=1 Ri Ni + i=1 Ni j=1 Nj
Note that the tracking process has to be run on all modes
+ M 2
P
R
i=1 i i N . Note that for a medium or low mode tensor of the new tensor. For a given mode, we first matricize
(i.e., order M 5), the diagonalization is the main cost. the tensor X into a matrix X(d) (line 2 of Figure 10), then
Section 4.3 introduces a faster approximation of DTA that adjust the projection matrix Ud by applying tracking a pro-
avoids diagonalization. jection matrix over the rows of X(d) . The full algorithm is
While for high order tensors (i.e., order M > 5), the dom- in Figure 10. And the process is visualized in Figure 11.
inant cost becomes O( M
P QM
i=1 Ni j=1 Nj ) from updating the To further reduce the time complexity, we can select only
variance matrix (line 4). Nevertheless, the improvement of a subset of the vectors in X(d) . For example, we can sam-
DTA is still tremendous compared to OTA O(n M
Q
i=1 Ni ) ple vectors with high norms, because those potentially give
where n is the number of all tensors up to current time. higher impact to the projection matrix.
Complexity: The space complexity of STA is the same as
4.3 Streaming Tensor Analysis DTA, which is only the sizeP of the Q
new tensor. The com-
In this section, we present the streaming tensor analysis putational complexity is O(( i Ri ) i Ni ) which is smaller
than DTA (when Ri Ni ). The STA can be further im- a tensor X by its reconstruction error:
proved with random sampling technique, i.e., use only subset M M
of rows of X(d) for update.
Y T
Y T 2
ei = kXi Yi l Ul kF = kXi Xi l Ul Ul kF .
l=1 l=1
Input:
For level two (mode level), the reconstruction error of the
New tensor X RN1 ...NM
lth mode only involves one projection matrix Ul for a given
Old projection matrices Ui |M
i=1 R
Ni Ri
tensor X :
M Ri Ri
Old energy matrices Si |i=1 R
Output: ed = kX X l Ul UTl k2F .
New projection matrices Ui |Mi=1 R
Ni Ri
For level three (dimension level), the error of dimension d
M Ri Ri
New energy matrices Si |i=1 R on the lth mode is just the reconstruction of the tensor slice
Core tensor Y RR1 RM of dimension d along the lth mode.
Algorithm: How much error is too much? We answer this question
1. For d = 1 to M // update every mode Q in the typical way: If the error at time T is enough (say,
2. Matricize new tensor X as X(d) R( i6=d Ni )Nd 2) standard deviations away from the mean error so far, we
3. For each column vector x in XT(d) declare the tensor XT as abnormal. Formally, the condition
4. Track a projection matrix (Ud , diag(Si ), x) is as follows:
M
+1 +1
eT +1 mean ei |Ti=1 + std ei |Ti=1 .
Q
5. Calculate the core tensor Y = X Ud
d=1
si
Sd Pop out Update
Sd
Correlation within a mode: A projection matrix gives
ui Update the correlation information among dimensions for a given
Ud Ud mode. More specifically, the dimensions of the lth mode
Pop out
can be grouped based on their values in the columns of Ul .
The entries with high absolute values in a column of Ul cor-
Figure 11: New tensor X is matricized along the dth respond to the important dimensions in the same concept.
mode. For every row of Xd , we update the projection In the DBLP example shown in Figure 12, UK corre-
matrix Ud . And Sd helps determine the update size. sponds to the keyword concepts. First and second columns
are the DB and DM concepts, respectively. The circles of
5. APPLICATIONS UA and UK indicate the influential authors and keywords
in DM concept, respectively. Similarly, the stars are for DB
After presenting the core technique of tensor analysis, we
concept. An example of actual keywords and authors is in
now illustrate two practical applications of DTA or STA:
Table 3.
1) Anomaly detection, which tries to identify abnormal be-
Correlations across modes: The interesting aspect of
havior across different tensors as well as within a tensor; 2)
DTA is that the core tensor Y provides indications on the
Multi-way latent semantic indexing (LSI), which finds the
correlations of different dimensions across different modes.
correlated dimensions in the same mode and across differ-
More specifically, a large entry in Y means a high correla-
ent modes.
tion between the corresponding columns in all modes. For
example in Figure 12, the large values of Yi (in the shaded
5.1 Anomaly Detection region) activate the corresponding concepts of the tensor
We envision the abnormal detection as a multi-level screen- Xi . For simplicity, we described a non-overlapping example,
ing process, where we try to find the anomaly from the however, groups may overlap which actually happens often
broadest level and gradually narrow down to the specifics. in real datasets.
In particular, it can be considered as a three-level process for Correlations across time: And the core tensor Yi s also
tensor stream: 1) given a sequence of tensors, identify the capture the temporal evolution of concepts. In particular,
abnormal ones; 2) on those suspicious tensors, we locate the Y1 only activates the DB concept; while Yn activates both
abnormal modes; 3) and then find the abnormal dimensions DB and DM concepts.
of the given mode. In the network monitoring example, the Note that DTA monitors the projection matrices over
system first tries to determine when the anomaly occurs; time. In this case, the concept space captured by projec-
then it tries to find why it occurs by looking at the traffic tion matrix Ui s are also changing over time.
patterns from sources, destinations and ports, respectively;
finally, it narrows down the problem on specific hosts or 6. EXPERIMENTS
ports. In this Section, we evaluate the proposed methods on real
For level one (tensor level), we model the abnormality of datasets. Section 6.1 introduces the datasets. Section 6.2
Authors Keywords Year
michael carey,michael stonebraker, h. jagadish,hector garcia-molina queri,parallel,optimization,concurr,objectorient 1995
surajit chaudhuri,mitch cherniack,michael stonebraker,ugur etintemel distribut,systems,view,storag,servic,process,cach 2004
jiawei han,jian pei,philip s. yu,jianyong wang,charu c. aggarwal streams,pattern,support,cluster,index,gener,queri 2004
Table 3: Example clusters: first two lines databases groups, last line data mining group.
2
10
CPU time(sec)
CPU time(sec)
CPU time(sec)
2
OTA 10 2
OTA
OTA 10
DTA DTA DTA
10
1 STA STA STA
1
10
0
10
Figure 14: Both DTA and STA use much less time than OTA over time across different datasets
1.6 12 45
40
1.4
10
35
1.2
8 30
time(sec)
time(sec)
time(sec)
1 25 DTA
6 STA
0.8 20
4 15
0.6
10
2 DTA
0.4
DTA 5
STA
STA
0.2 0 0
100% 75% 50% 25% 100% 75% 50% 25% 100% 75% 50% 25%
sampling percentage sampling percentage sampling percentage
Figure 15: STA uses much less CPU time than DTA across different datasets
never updates the original projection matrices as a lower- Ratio 20% 40% 60% 80% 100%
bound baseline. Source IP 1 0.99 0.99 0.97 0.95
Destination IP 1 0.99 0.99 0.96 0.94
DTA performs very close to OTA, which suggests a cheap Port 1 1 0.99 0.98 0.97
incremental methods over the expensive OTA. And an even
cheaper method, STA, usually gives good approximation to Table 4: Network anomaly detection: precision is very
DTA (see Figure 16(a) and (b) for IP2D and IP3D). But high (the detection false positive rate = 1 precision).
note that STA performs considerably worse in DBLP in
Figure 16(c) because the adaptive subspace tracking tech-
nique as STA cannot keep up to the big changes of DBLP domly select a dimension and then set 50% of the corre-
tensors over consecutive timestamps. Therefore, STA is only sponding slice to 1 simulating an attack in the network.
recommended for the fast incoming with significant time- There are one additional input parameter: forgetting fac-
dependency (i.e., the changes over consecutive timestamps tor which is varied from .2 to 1. The result is obtained
should not be too big). using DTA, and STA achieved very similar result so we ig-
nore it for clarity.
7. DATA MINING CASE STUDIES Performance Metrics: We use detection precision as our
After we evaluated the efficiency of the proposed methods, metric. We sort dimensions based on their reconstruction
we now present two data mining applications using both our error, and extract the smallest number of top ranked hosts
proposed methods, the dynamic and the streaming tensor (say k hosts) that we need to select as suspicious hosts, in
analysis. The two applications are 1) anomaly detection for order to detect all injected abnormal host (i.e., recall = 100%
network traffic analysis and multi-way LSI on DBLP data. with no false negatives). Precision thus equals 1/k, and the
false positive rate equals 1 precision. We inject only one
7.1 Anomaly Detection abnormal host each time. And we repeat each experiment
Here we focus on the IP3D dataset, that is, source-destination- 100 times and take the mean.
port tensors, and we use the algorithm described in Section 5.1 Results: Table 4 shows the precision vs. forgetting fac-
to detect the following three types of anomalies: tor for detecting three different anomalies. Although the
Abnormal source hosts: For example, port-scanners that precision remains high for both types of anomaly detection,
send traffic to a large number of different hosts in the system. we achieve a higher precision when forgetting factor is low
Abnormal destination hosts: For example, the victim of meaning it forgets faster. This is because the attacks we in-
a distributed denial of service attack (DDoS), which receives jected take place immediately which do not depend on the
high volume of traffic from a large number of source hosts. past; in this case, fast forgetting is good. For more elaborate
Abnormal ports: Ports that receive abnormal volume of attacks, the forgetting factor may need to be set differently.
traffic, and/or traffic from too many hosts. Identify real anomaly: For network traffic, normal host
Experiment Setup: We randomly pick one tensor from communication patterns in a network should roughly be sim-
normal periods with no known attacks. Due to the lack of ilar to each other over time. A sudden change of approxi-
detailed anomaly information, we manually inject anomalies mation accuracy suggests structural changes of communica-
into the selected timestamps using the following method. tion patterns since the same approximation procedure can
For a given mode (i.e., source, destination or port) we ran- no longer keep track of the overall patterns. Figure 17(a)
2.4 1.4 5 4
DTA DTA DTA IP2D
STA STA 4.5 STA 3.5 IP3D
2.2 1.35
no update no update no update DBLP
4 3
2 1.3
error ratio
error ratio
1.8 1.25
3
2
1.6 1.2
2.5
1.5
1.4 1.15
2
1
1.2 1.1 1.5
0.5
1 1.05 1
0 2 4 6 8 10 12 1 2 3 4 5 6 2 4 6 8 10 0
hours hours Years DTA STD No Update
destination
destination
30 300 300
error
250 250
20 200 200
150 150
10 100 100
50 50
0
200 400 600 800 1000 1200 100 200 300 400 500 100 200 300 400 500
hours source source