Research Article

Flow Graph Anomaly Detection Based on Unsupervised Learning

Algorithm 1

Flow graph anomaly detection.
Input: Graph stream G
Output:abnormal object
1:function PREPROCESSOR(G)
2:      if called by Controller then
3:    3 types of Anomaly Samples A←NEGATIVESAMPLING(G)
4:    A←NODE2VEC(A)
5:    return A
6     else
7:     X←NODE2VEC(G)
8:     X←SEMODEL(X)
9:     return X
10:     end if
1l:end function
12:
13:function CONTROLLER(G)
14:   A ← PREPROCESSOR(G)
15:   for a in A do
16:      Gaussian distribution←VARIATIONAL AUTO-ENCODER(a)
17:      Save Model Gaussian distribution
18:   end for
19:end function
20:
2l:function OPTIMIZER(X-test)
22:   for x in X-test do
23:   xReconst←AUTO-ENCODER(x)
24:   xSample←GAUSSIAN DISTRIBUTION
25:   Deviation←LOSSFUNCTION(x,xReconst, xSample)
26:   end for
27:end function