<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Semi-supervised Random Forest for Intrusion Detection Network</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ningxin Shi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Xiaohong Yuan</string-name>
          <email>xhyuan@ncat.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>William Nick</string-name>
          <email>wmnick@aggies.ncat.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>North Carolina Agricultural and Technical State University</institution>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2017</year>
      </pub-date>
      <fpage>181</fpage>
      <lpage>185</lpage>
      <abstract>
        <p>In order to protect valuable computer systems, network data needs to be analyzed and classified so that possible network intrusions can be detected. Machine learning techniques have been used to classify network data. For supervised machine learning methods, they can achieve high accuracy at classifying network data as normal or malicious, but they require the availability of fully labeled data. Semi-supervised machine learning methods, however, can use a small number of labeled examples and train a large number of examples without label. In this research, we explore the use of semi-supervised Random Forest in classifying network data and intrusion detection. It was used to classify the Third International Knowledge Discovery and Data Mining Tools Competition dataset (KDD 1999) and the result were compared with the results of using the supervised methods of Random Forest. The results were also compared with those using ladder network, an approach which combines unsupervised neural networks, in classifying KDD 1999.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Random Forest</kwd>
        <kwd>semi-supervised machine learning</kwd>
        <kwd>KDD 1999</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 INTRODUCTION</title>
      <p>In the last decade, the development of computer
technology and the invention of the internet have brought
many benefits to society. Some of these benefits include
faster communication, better convenience and more
productivity. Today, more than three billion people have
access to the Internet, equating to 42 percent of the global
population in 2014. Thus, network security has become
very important. Intrusion Detection System (IDS) is a
device or software application that monitors a network or
system for malicious activity or policy violation. Current
IDSs are either signature based or anomaly based. The
signature based IDS detects the attacks which have been
documented. Thus new types of attacks cannot be detected
by the signature based detection. The anomaly based
detection focuses on finding unknown or unusual activity
patterns in the observed data. It can detect new attacks but
it also needs a domain expert to distinguish normal or
abnormal activity patterns.</p>
      <p>
        In this research, machine learning methods has been
used to detect attacks. Some of the machine learning
classifiers have been developed under supervised learning.
Supervised learning is to use labeled data to train the
classifier and then test the classifier in the test set. The
disadvantage of supervised learning is that it needs a large
amount of labeled data, which is not practical since it’s
labor intensive. Different from supervised learning, the
unsupervised learning is to use unlabeled data to train the
classifier and to infer a function described hidden structure.
However unsupervised learning is very sensitive to noise
data and the results can be influenced a lot. Hasan and his
team developed the Support Vector Machine (SVM) and
Random Forest supervised learning methods[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Salama
and his team have used a hybrid intrusion detection scheme
utilizing both SVM and Deep Belief Networks (DBN) [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>
        Semi-supervised learning falls between supervised
learning and unsupervised learning. Different from
supervised learning, semi-supervised learning uses a small
amount of labeled data and a large amount of unlabeled
data to train and test the classifiers. Researchers have found
that unlabeled data, when used in conjunction with a small
amount of labeled data, can produce considerable
improvement in learning accuracy. There are two kinds of
semi-supervised learning, transductive and inductive
learning. Transductive learning is to use labeled data to
train the classifier and use the unlabeled data to test the
classifier. The inductive learning is to use both labeled and
unlabeled data to train the classifier. Zehra Cataltepe et al
had a research on semi-supervised decision trees for
network intrusion detection based on KDD99 dataset [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
Leistner et al developed a semi-supervised algorithm of
Random Forest [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] based on Breiman’s research on
Random Forest which developed the Out-of-bag theory [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
Liu et al discussed about the node splitting for Random
Forest Construction and developed the new algorithm [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        This research implemented semi-supervised Random
Forest for network intrusion detection. KDD99 dataset was
used for training the classifier. The experiments used the
same number of classes, and the same number of samples
in each class as in Mtahir et al ’s research [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] in order to
compare the results with supervised Random Forest and
semi-supervised ladder nework.
      </p>
      <p>
        The paper is organized as follows. Section 2 discusses
the background of Random Forest based on Dr. Leo
Breiman’s research [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Section 3 discusses about the
experiment results and compares to results on supervised
Random Forest and semi-supervised ladder network [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
Section 4 concludes the paper.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Background</title>
      <sec id="sec-2-1">
        <title>2.1 Random Forest</title>
        <p>
          Random Forest is an ensemble of classification or
regression trees. The Random Forest classifier works by
partitioning the training set of the data into k subsets and
constructing a decision tree out of each subset. All of the
subsets are randomly selected. Each decision tree is made
by randomly selecting m variables out of all the variables
and finding the best split on the selected variables. This is
done at each node and continued until a node cannot be
split further, leading to the leaf nodes. Each tree votes on a
classification after running the test set on each of them. The
final classification of the forest is determined by the
majority of the decision trees [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ].
        </p>
        <p>
          The algorithm of Random Forest proposed by Dr. Leo
Breiman described as below [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ].
2
        </p>
        <p>Given a set of classifiers t1(x), t2(x),…, tk(x), and with the
training set drawn at random from the distribution of the
random vector Y, X, we can get the margin function as
!" #, % = '( )* +) # = %
−!'. /0 1'( )* +) # = 2
where I is the indicator function. The margin measures
the average number of votes at X, Y for the right class
exceeds the average votes for any other class. The larger
the margin, the more accuracy in testing. The
generalization error is given by</p>
        <p>34 ∗ = 3#,1 !" #, % &lt; 0
where the subscripts X, Y indicate that the probability is
over the X, Y space.</p>
        <p>In random forests, tk(X) = t(X, Qk). When the forest has
a large number of trees, it follows the Strong Law of Large
Numbers and the tree structure that:</p>
        <p>3#,1(39 + #, Θ = %
− !'. /0 139 + #, Θ = 2 &lt; 0 (3)
where Q is random vector for splitting selection and Qk
is independent identically distributed random vector.</p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2 Semi-supervised Random Forest</title>
        <p>For Random Forest F = {t1, t2, …, tN}, when each tree is
constructing, it learns a function F: x ®y. The training set
is {xi Îx}i = 1…l and the test set {yi Î y}i = 1…l. Each internal
node of Random Forest is binary split with a partition
criterion.</p>
        <p>When testing, given a test case x, Random Forest gives
the probability estimation for each class as
; &lt; .</p>
        <p>
          where pi (k|x) is the probability estimation of class k
given by the ith tree [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ].
        </p>
        <p>It is estimated by calculating the ratio that class k gets
votes from the leaves in the ith tree
;? &lt; .</p>
        <p>AB,C
E
DFG AB,D</p>
        <p>(1)
(2)
(4)
(5)
Semi-supervised Random Forest for Intrusion Detection
where li,k is the number of leaves in the ith tree that vote
for class k. Here the overall decision function of Random
Forest is as follows.</p>
        <p>H = 'I"!'.; &lt; . | &lt; ∈ L
(6)</p>
        <p>
          Xiao Liu et al [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] developed the Semi-supervised
splitting Random Forest based on the Out-Of-Bag (OOB)
samples of the tree which was mentioned in Beriman’s
research.
        </p>
        <p>The process of Random Forest constructing, an
individual training set for each tree (random input) is
generated from the original training set using bootstrap
aggregation (for labeled set MA? and unlabeled setMN?). The
samples which are not included in the training set is OOB
samples and can be used to calculate OOB error. A OOBE
is a good feature to do node splitting and semi-supervised
training.</p>
        <p>
          Xiao’s algorithm for semi-supervised splitting is as
follows [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ].
        </p>
        <p>Train the tree with only labeled data: +A? =
+I'OPQIRR MA? .</p>
        <p>Step 5: Calculate the OOBE: RA? = TTUR +A?, MA −
MA? using the labeled trained tree and the difference
between original labeled data and labeled samples.
Step 6: Train the tree with both labeled and unlabeled
data: +N? = VR!OQIRR MA?, MN? .</p>
        <p>Step 7: Calculate the OOBE: RN? = TTUR +N?, MA −
MA? using unlabeled trained tree and the difference between
original labeled dataset and labeled samples.</p>
        <p>Step 8: Compare the OOBE of the above two different
trained tree to select final classifiers.</p>
        <p>if RA? &gt; RN? then
Step 9: H = H ∪ +N?.</p>
        <p>Step 10: else
Step 11: H = H ∪ +A?.</p>
        <p>Step 12: end if
Step 13: end for
Step 14: Return F.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Experiment and Results</title>
      <p>3.1 KDD 1999 dataset</p>
      <p>
        KDD 1999 is the Third International Knowledge
Discovery and Data Mining Tools Competition, which was
held in conjunction with the Fifth International Conference
on Knowledge Discovery and Data Mining [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. The
training data contains about 4GB of compressed packet
capture data from 7 weeks of network traffic. These data
have been processed into 4.9 million connection records,
with a set of 41 features. Table 2 is the categories of
malicious behavior included in the dataset [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <sec id="sec-3-1">
        <title>3.2 Experiment</title>
        <p>
          This research used Berman’s Random Forest model [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]
and implemented the algorithm of Liu et al [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] to split the
tree nodes. The program was developed based on
Kevinkerandren’s example program [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ].
        </p>
        <p>
          In order to compare with supervised Random Forest
method, the experiments used the samples as 10, 1000,
3000 and 5000 examples per class and classes as 16, 9, 6
and 6 respectively which were same as those in Mtahir et
al ’s research [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. Each of the class contained 50% labeled
data and 50% unlabeled data.
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>3.3 Semi-Supervised Random Forest compared with Supervised Random Forest</title>
        <p>
          To compare the supervised machine learning and
semisupervised machine learning, we used Mutahir Nadeem et
al [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ] ‘s results on supervised machine learning. Table 3
and Table 4 are the result comparison for semi-supervised
Random Forest and supervised Random Forest.
The result under semi-supervised took a little bit longer
time to execute but the accuracy is similar as the one used
supervised method. The advantage of semi-supervised
approach is that it only requires part of the training dataset
is labeled.
        </p>
      </sec>
      <sec id="sec-3-3">
        <title>3.4 Semi-Supervised Random Forest compared with Semi-Supervised Ladder Network</title>
        <p>
          Table 5 and Table 6 are the result comparison for
semisupervised Random Forest and semi-supervised Ladder
Network of Mutahir et al [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ].
4
        </p>
        <p>To be consistent, the result used the samples as 10, 1000,
3000 and 5000 examples per class. The training data set
includes both labeled and unlabeled examples. The ratio of
labeled data is 50%.</p>
        <p>Compared with the result of semi-supervised Random
Forest, the Ladder Network took more time to execute. For
large amount of data, semi-supervised RF and Ladder
Network has similar accuracy. But for the medium amount
of data, the Ladder Network has lower accuracy than that
of Random Forest.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4 Conclusions</title>
      <p>In summary, the Semi-supervised Random Forest
performed better than the Semi-supervised Ladder Network.
Even though it took more time to train in semi-supervised
Random Forest than that in supervised Random Forest, it
has advantage because it only needs small amount of
labeled data. This is practical because in the real world, it is
hard to label large amount of data. Also, training the
classifier using unlabeled data can make the margin more
accurate and smooth.</p>
      <p>Our future work includes improving the training
algorithm of semi-supervised Random Forest and making it
faster. Also we will develop semi-supervised Support
Semi-supervised Random Forest for Intrusion Detection
Vector Machine (SVM) and Deep Belief Network (DBN)
on KDD 99 and compare their results.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgement Reference</title>
      <p>The 28th Modern Artificial Intelligence and Cognitive Science</p>
      <p>Conference, Fort Wayne, Indiana, USA
This work is partially supported by NSF under the grant
CNS-1460864. Any opinions, findings, and conclusions or
recommendations expressed in this material are those of the
author(s) and do not necessarily reflect the views of NSF.</p>
      <p>Heidelberg.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Leo</given-names>
            <surname>Breiman</surname>
          </string-name>
          .
          <year>2001</year>
          .
          <article-title>Random forests</article-title>
          .
          <source>Machine Learning</source>
          ,
          <volume>45</volume>
          (
          <issue>1</issue>
          ):
          <fpage>5</fpage>
          -
          <lpage>32</lpage>
          , University of California Berkeley, CA.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Xiao</given-names>
            <surname>Liu</surname>
          </string-name>
          , Mingli Song, Dacheng Tao, Zicheng Liu, Luming Zhang, Chun Chen and
          <string-name>
            <given-names>Jiajun</given-names>
            <surname>Bu</surname>
          </string-name>
          .
          <year>2013</year>
          .
          <article-title>Semisupervised Node Splitting for Random Forest Construction</article-title>
          .
          <year>CVPR2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Christian</given-names>
            <surname>Leistner</surname>
          </string-name>
          , Amir Saffari, Jakob Santner and
          <string-name>
            <given-names>Horst</given-names>
            <surname>Bischof</surname>
          </string-name>
          .
          <article-title>Semi-supervised Random Forests. Institute for Computer Graphics and Vision</article-title>
          . Graz University of Technology.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Md</given-names>
            <surname>Al Mehedi Hasan</surname>
          </string-name>
          , Mohammed Nasser, Biprodip Pal and
          <string-name>
            <given-names>Shamim</given-names>
            <surname>Ahmad</surname>
          </string-name>
          .
          <year>2014</year>
          .
          <article-title>Support vector machine and random forest modeling for intrusion detection system (ids)</article-title>
          .
          <source>Journal of Intelligent Learning Systems and Applications</source>
          ,
          <volume>6</volume>
          (
          <issue>1</issue>
          ):
          <fpage>45</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Mostafa</surname>
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Salama</surname>
          </string-name>
          , Heba F. Eid, Rabie A.
          <string-name>
            <surname>Ramadan</surname>
          </string-name>
          ,
          <source>Ashraf Darwish and Aboul Ella Hassanien</source>
          .
          <year>2011</year>
          .
          <article-title>Hybrid Intelligent Intrusion Detection Scheme</article-title>
          , pages
          <fpage>293</fpage>
          -
          <lpage>303</lpage>
          . Springer Berlin Heidelberg, Berlin,
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Zehra</given-names>
            <surname>Cataltepe</surname>
          </string-name>
          , Umit Ekmekci, Tanju Cataltepe, and
          <string-name>
            <given-names>Ismail</given-names>
            <surname>Kelebek</surname>
          </string-name>
          .
          <article-title>Online Feature Selected Semisupervisd Decision Trees for Network Intrusion Detection</article-title>
          . Istanbul Technical University.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Mutahir</given-names>
            <surname>Nadeem</surname>
          </string-name>
          , Ochaun Marshall, Sarbjit Singh,
          <string-name>
            <given-names>Xing</given-names>
            <surname>Fang</surname>
          </string-name>
          and
          <string-name>
            <given-names>Xiaohong</given-names>
            <surname>Yuan</surname>
          </string-name>
          .
          <year>2016</year>
          .
          <article-title>Semi-supervised Deep Neural Network for Network Intrusion Detection</article-title>
          .
          <source>Conference on Cybersecurity Education, Research and Practice, October 29-30</source>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <article-title>[8] KDD cup 1999 data</article-title>
          ,
          <year>October 1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Kevin-kerandren</surname>
          </string-name>
          .
          <year>2016</year>
          , March 13. Random forest in Python. GitHub. https://github.com/kevin-keraudren/randomforestpython
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>