Research Article

Network Traffic Anomaly Detection Based on ML-ESN for Power Metering System

Algorithm 1

AMI network traffic classification.
(1)Input:
(2) training dataset
(3) test dataset
(4) input feature value set
(5) the number of neurons in the reservoir
(6) the number of reservoirs
(7) interconnection weight spectrum radius
(8)Output
(9) Training and testing classification results
(10)Steps:
(11) (1) Initially set the parameters of ML-ESN, and determine the corresponding number of input and output units according to the dataset: (i) Set training data length:  (ii) Set test data length:  (iii) Set the number of reservoirs:  (iv) Set number of neurons in the reservoir: (v) Set the speed value of reservoir update:  (vi) Set
(12) (2) Initialize the input connection weight matrix , internal connection weight of the cistern , and weight of external connections between reservoirs : (i) Randomly initialize the values of , , and . (ii) Through statistical normalization and spectral radius calculation, and are bunched to meet the requirements of sparsity. The calculation formula is as follows: , , and and are the spectral radii of and matrices, respectively.
(13) (3) Input training samples into initialized ML-ESN, collect state variables by using equation (9), and input them to the activation function of the processing unit of the reservoir to obtain the final state variables: (i) For from 1 to , compute   (a) Calculate according to equation (7)  (b) For from 2 to , compute  (i) Calculate according to equations (7) and (9)  (c) Get matrix ,
(14) (4) Use the following to solve the weight matrix from reservoir to output layer to get the trained ML-ESN network structure: (i) , where is the ridge regression parameter, matrix is the identity matrix, and and are the expected output matrix and the state collection matrix.
(15)(5) Calculate the output ML-ESN result according to formula (10). (i) Select the SoftMax activation function and calculate the output value.
(16) (6) The data in are input into the trained ML-ESN network, the corresponding category identifier is obtained, and the classification error rate is calculated.