X=NSL_KDD the performance evaluation of STL for the NIDS,

X=NSL_KDD Dataset/KDD Train.txt;T= NSL_KDD Dataset/KDD Test.txt;X,T =NSL_KDD Dataset;

rng(0,’twister’); % For reproducibility

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

hiddenSize = 15;

autoenc1=trainAutoencoder(X,hiddenSize,’MaxEpochs’,400,..

    ‘L2WeightRegularization’,0.001,…

   
‘SparsityRegularization’,4,…

   
‘SparsityProportion’,0.05,…

   
‘DecoderTransferFunction’,’purelin’);

features1 = encode(autoenc1,X);

hiddenSize = 10;

autoenc2 = trainAutoencoder(features1,hiddenSize,…

    ‘L2WeightRegularization’,0.001,…

   
‘SparsityRegularization’,4,…

   
‘SparsityProportion’,0.05,…

   
‘DecoderTransferFunction’,’purelin’,…

   
‘ScaleData’,false);

features2 = encode(autoenc2,features1);

softnet =

trainSoftmaxLayer(features2,T,’LossFunction’,’crossentropy’);

deepnet = stack(autoenc1,autoenc2,softnet);

deepnet = train(deepnet,X,T);

NSL_KDD_type = deepnet(X);

plotconfusion(T,NSL_KDD_type);

 

 

 

(a)    
Feature Learning
from pre-processed data

 

(b)   
Soft-max Regression
classifier training for the derived training data

 

                           

 

                          Self-taught Learning

(c)    
“Classification
using self-taught learning

 

                                         Figure 3

 

4.2. Performance Evaluation

To ascertain the performance evaluation of STL for the
NIDS, execute three types of classification

(a)    
Normal and
anomaly (2-class)

(b)   
Normal and four
different attack categories(5-class)

(c)    
Normal and 22
different attack (23- class)

 

 

Evaluate the accuracy metric using the following

  Accuracy: “which
is the percentage of correctly classified records over the total number of
records.

 

 Precision (P): which is the percentage ratio of the number of “true
positives” (TP) records divided by the number of true positives (TP) and false
positives (FP) classified records.

 

P=

 

Recall (R): which is the percentage ratio of number of “true positives
records” divided by the number of true positives and false negatives (FN)
classified records.

 

R=

 

F-Measure
(F): The harmonic mean of precision and
recall and represents a balance between them.

 

F=

 

4.2.1 Evaluation Based on training dataset

Create a 10- fold cross validation on the training
data to classify the accuracy of STL for 2-class,5-class and 23-class.
Thereafter compare its performance with the soft-max regression when its
applied on the NSL-NDD data set without feature learning.

 

                         

 

 

 

 

 

          Accuracy for various Classification

                                                        
Figure 4

 

If the Accuracy is evaluated
for 2, 5, and 23-classes, the STL should achieved >98% accuracy 4. for all
types

 

4.2.2 Evaluation Based on training with test dataset

Evaluate the STL and SMR
for class 2 and 5 – class using the test data. Perform the accuracy metric for
the STL

                  

 

                     “Accuracy
for various Classification”

 

                                          Figure 5

 

If applied on testing
and training data, the STL should achieved accuracy of ~88% for 2-class 4
which is far better than other previous researched methods