<!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>Bidirectional Long Short-Term Memory classifier assist for intelligent ransomware detection in Android OS</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jakub Siłka</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Faculty of Applied Mathematics, Silesian University of Technology Kaszubska 23</institution>
          ,
          <addr-line>44-100 Gliwice</addr-line>
          ,
          <country country="PL">Poland</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>IVUS'21: 26th International Conference Information Society and University Studies</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>A precise description of an invented, complementary method for android's system security is presented in this study. I have created such a system in order to provide casual smartphone users with a useful tool to prevent the ransomware type attacks. With the purpose of obtaining a satisfying outcome, I used BiLSTM and a optimizing algorithm NAdam. I managed to receive a system's accuracy up to over 93% therefore creating a prospectS of complementing the existing security system especially when it is not clear whether a certain application program is safe.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Ransomware</kwd>
        <kwd>Cybersecurity</kwd>
        <kwd>Deep Learning</kwd>
        <kwd>Bidirectional LSTM</kwd>
        <kwd>Artificial Intelligence</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        No personage can deny, that nowadays, we live in the most digitization-based times. Therefore,
a lot of diferent methods are increasingly being developed to protect ourselves in all sorts of
new ways such as Cabaj, Gregorczyk, and Mazurczyk [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] or Hu and Tan [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Although we do
continuously find a new way to use it on our behalf, simultaneously some threats associated
with the violation of personal devices are also occurring more often. Therefore, more and more
often there are very ingenious ways to counteract these threats, such as Venkatraman, Alazab,
and Vinayakumar [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] and Vinayakumar, Soman, Senthil Velan, and Ganorkar [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Actually,
most of the youth keeps a constant contact with internet via smartphone, rather than desktop
computer. According to the fact, that an android figures prominently in a mobile operating
systems market and a fact that in the last years we’ve observed increased number of threats
related to the android I do think that the already existing security methods have to be revised this
will accelerate the progress of many scientific discoveries such as Ferrante, Malek, Martinelli,
Mercaldo, and Milosevic [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. In addition, along with the companies tendency to make wearing
a device as intuitive and easy as possible, more people are apt to use it - especially elders and
very young ones. However, i should mentioned, that such cyber-attacks can be tremendously
reduced just by applying an appropriate hygiene of using an device - including not downloading
the data from suspected pages etc. However, in order to detect the greatest threats, some method
of machine learning is needed if the contractor depends on the flexibility of the system itself,
they are very well known as it can be observed in many publications like YIL [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and Pouyanfar,
Sadiq, Yan, Tian, Tao, Reyes, Shyu, Chen, and Iyengar [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. However, in order to enable the
network to gain any significant advantage, there was a need for the network to remember, so it
is worth remembering about works such as Cao, Yang, Tang, and Lu [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], Sherstinsky [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] or
Yu, Si, Hu, and Zhang [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. In this work a model of Recurrent Neural Network was applied as
classification of ransom software. Similar idea of those architectures was applied in i previous
research for body pose prediction Woźniak, Wieczorek, Siłka, and Połap [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] and malware
threads detection Woźniak, Siłka, Wieczorek, and Alrashoud [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. The idea used in this paper
is oriented on detection of potential dangerous situations in networking solutions. Proposed
detection model was developed by using LSTM based model of neural network architectures.
Numerical vectors are analyzed by BiLSTM and final classification is returned to the system. In
this method various training algorithms were used, and during research the best trained model
was selected. Research results show high eficiency of this proposition.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. System</title>
      <p>As one can observe in the fig.1, the entire system was created in order to supplement the
already existing backup systems, such as firewall. The latter supervise the data stream between
the internet and a device. That is why the system enables data to flow solely under one
condition - if these aren’t recognised by the program as explicitly harmful. However, if the
network classifies a given vector as ransomware, it adds information about it to the blacklist of
a certain phone. As an outcome, if an identical vector would be classified again by the backup
system in the future - it will be possible to immediately determine how could it been classified
by the other network. Hence, it is a method that solely revises a user’s secure. In the case of
such model existence, presumably the blacklist would be send periodically to the labs, in which
the real classification would be determined.
3. Dataset
1. Total Length of Fwd Packets
2. Total Length of Bwd Packets
3. Fwd Packet Length Max
4. Fwd IAT Total
5. Fwd Packet Length Mean
6. Fwd IAT Max
7. Bwd Packet Length Max
8. Bwd Packet Length Min
9. Fwd Avg Bulk Rate
10. Idle Min
11. Flow Bytes/s
12. Flow Packets/s,
where ℎ is parameter of hyper-parameter and  is gradient value of the error function. Values
ˆ and ˆ are calculating according to equations:
ˆ =</p>
      <p>1 − ℎ2
Using equations above, the weights in ANN architecture was defined as follows:

.</p>
      <p>
        The data were gathered and downloaded from the source Lashkari, Kadir, Taheri, and Ghorbani
[
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. They contain a great amount of a particular abstract class - in this case however, I chose
the beningn’s and ransomware’s classes. I underpin this decision with the prospect of providing
a refined security for a casual user. All of the classes use many attributes, such as:
1–9
(1)
(2)
(3)
(4)
(5)
      </p>
    </sec>
    <sec id="sec-3">
      <title>4. Applied mathematical solutions to the problem.</title>
      <p>In order to appropriately train this Neural Network I had to establish which optimising
algorithm would be the most convenient. Following a lot of initial trails, I settled that the NAdam
algorithm was the best - that is, practically speaking, Adam algorithm with the application of
Nesterov momentum.</p>
      <p>NAdam formula is:
 = ℎ1− 1 + (1 − ℎ1),
 = ℎ2− 1 + (1 − ℎ2)2,
ˆ = (1 − ℎ1) + ℎ1+1
+1 =  −  √︀ℎ2ˆ++11+  ,
where  is a learning rate (in this case 0.0005) and is a constant value.</p>
      <p>We applied NEG to Adam as:
 = − 1 −</p>
      <p>ℎ1− 1 (1 − ℎ1)
ℎ2− 1 + (1 − ℎ2)2 +  −  √︀ℎ2− 1 + (1 − ℎ2)2 +</p>
    </sec>
    <sec id="sec-4">
      <title>5. Experiment and Results</title>
      <p>
        The data have been downloaded from the Lashkari, Kadir, Taheri, and Ghorbani [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. The
authors had carefully worked with the model "CCS to caputure", depicting 200K applications.
The VirusTotal was used in order to mark particular abstraction’s classes. In a study, I applied
the Ransomware and benign abstraction’s classes. Following the process of the data’ preparation
- which simply refers to make it possesing two abstraction’s classes "[Ransomware, Benign]",
the NN’s architecture building process was started of. In order to attain satisfying results, I
have scrutinized diferent NN models and also compared a great scope of known approaches
starting with casual ANN, going through RNN and finally getting up to BiLSTM, which actually
proved to be the most suitable, available model. However, one should notice other optimising
algorithms such as AdaGrad, Adam, and NAdam, that I used. The latter emerged as the most
eficient. After established the best combination, I had to determine the most accurate network
architecture.
1–9
(6)
      </p>
      <p>As I managed to make this system remember the results, I had to wise up why didn’t the
results increase along with the time. After an in-depth analysis of performed experiments
and received outcomes it was settled that it is necessary to enlarge the communication in the
particular layers as well as in between them. That is why I have chosen the LSTM Bidirectional
model. As I created the LSTM’s Gate fig.2 and the specific layer, I proceeded to form an entire
network’s architecture, essential for classifying the set. It is crucial to understand that the
BiLSTM is more sensitive to changes in the values of variables architecture than casual ANN
which entails the requirement of huge amount of time-consuming tests. Following the latter, I
resurfaced the most accurate model. The configuration that yielded the best result is displayed
above fig.4. The sequence started of with an use of BiLSTM layer consists of 1000 neurons
then the Dropout operation was conducted up to 60 percent. fig.4 Subsequently, the entire data
underwent the next layer that consisted 500 neurons and consecutively, a dropout (whereas the
values were the same as in the first dropout) along with another layer, although now, with 120
neurons. After that, the data moved towards the last, hidden layer of 60 neurons. All of those
layers were linked with each other by the Dropout operation with the value 0.3. In order to get
all the results within such network, the last synapses underwent the last Dropout operation
with the values equal to 15 .</p>
      <p>The graphs generated as well as the confusion matrix for two of best algorithms in short-term
learning are presented below.</p>
      <p>As it is shown in the table above, it turned out that NAdam had the best performance and
thus, this algorithm was selected for the following long-term tests. The long duration of a
training is due to a way bigger complexity of computational whilst using BiLSTM - in contrast
to casual ANN network. After a long training, using suitable architecture, I managed to achieve
accuracy equal to 93.35% in the process of detecting dangerous programs.</p>
    </sec>
    <sec id="sec-5">
      <title>6. Conclusion</title>
      <p>In the above study, i demonstrated a method to detect various approaches of protecting the
android system against threats associated with ransomware. Moreover, I have compared
those diferent approaches - and indicated which of the optimising algorithm or architecture
was the most suitable and eficient. Following an aforementioned scrutinizing process of the
obtained results, it turned out that the NAdam on BiLSTM architecture is the most accurate
solution - along with this method I managed to get 93.35% accuracy. In this way, I adequately
complemented the full scope of already exiting approaches created to prevent ransomware. In
the foreseeable future, one ought to concentrate particularly on the process of augmentation
the quantity of threats that can be detected with high accuracy.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>Author would like to acknowledge contribution to this research from the Rector of the Silesian
University of Technology, Gliwice, Poland, under program “Initiative of Excellence—Research
University” grant no. 08/IDUB/2019/84.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>K.</given-names>
            <surname>Cabaj</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gregorczyk</surname>
          </string-name>
          , W. Mazurczyk,
          <article-title>Software-defined networking-based crypto ransomware detection using http trafic characteristics</article-title>
          ,
          <source>Computers Electrical Engineering</source>
          <volume>66</volume>
          (
          <year>2018</year>
          )
          <fpage>353</fpage>
          -
          <lpage>368</lpage>
          . URL: https://www.sciencedirect.com/science/article/ pii/S0045790617333542. doi:https://doi.org/10.1016/j.compeleceng.
          <year>2017</year>
          .
          <volume>10</volume>
          . 012.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>W.</given-names>
            <surname>Hu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Tan</surname>
          </string-name>
          ,
          <article-title>Black-box attacks against rnn based malware detection algorithms</article-title>
          ,
          <source>arXiv preprint arXiv:1705.08131</source>
          (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>S.</given-names>
            <surname>Venkatraman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Alazab</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Vinayakumar</surname>
          </string-name>
          ,
          <article-title>A hybrid deep learning image-based analysis for efective malware detection</article-title>
          ,
          <source>Journal of Information Security and Applications</source>
          <volume>47</volume>
          (
          <year>2019</year>
          )
          <fpage>377</fpage>
          -
          <lpage>389</lpage>
          . URL: https://www.sciencedirect.com/science/article/pii/ S2214212618304563. doi:https://doi.org/10.1016/j.jisa.
          <year>2019</year>
          .
          <volume>06</volume>
          .006.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>B.</given-names>
            <surname>Alsulami</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Mancoridis</surname>
          </string-name>
          ,
          <article-title>Behavioral malware classification using convolutional recurrent neural networks</article-title>
          ,
          <source>in: 2018 13th International Conference on Malicious and Unwanted Software (MALWARE)</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>103</fpage>
          -
          <lpage>111</lpage>
          . doi:
          <volume>10</volume>
          .1109/MALWARE.
          <year>2018</year>
          .
          <volume>8659358</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>R.</given-names>
            <surname>Vinayakumar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K. P.</given-names>
            <surname>Soman</surname>
          </string-name>
          ,
          <string-name>
            <surname>K. K. Senthil Velan</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Ganorkar</surname>
          </string-name>
          ,
          <article-title>Evaluating shallow and deep networks for ransomware detection and classification</article-title>
          , in: 2017
          <source>International Conference on Advances in Computing, Communications and Informatics (ICACCI)</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>259</fpage>
          -
          <lpage>265</lpage>
          . doi:
          <volume>10</volume>
          .1109/ICACCI.
          <year>2017</year>
          .
          <volume>8125850</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.</given-names>
            <surname>Ferrante</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Malek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Martinelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Mercaldo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Milosevic</surname>
          </string-name>
          ,
          <article-title>Extinguishing ransomwarea hybrid approach to android ransomware detection</article-title>
          ,
          <source>in: International Symposium on Foundations and Practice of Security</source>
          , Springer,
          <year>2017</year>
          , pp.
          <fpage>242</fpage>
          -
          <lpage>258</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <article-title>[7] A novel wavelet sequence based on deep bidirectional lstm network model for ecg signal classification</article-title>
          ,
          <source>Computers in Biology and Medicine</source>
          <volume>96</volume>
          (
          <year>2018</year>
          )
          <fpage>189</fpage>
          -
          <lpage>202</lpage>
          . URL: https://www.sciencedirect.com/science/article/pii/S0010482518300738. doi:https://doi. org/10.1016/j.compbiomed.
          <year>2018</year>
          .
          <volume>03</volume>
          .016.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>S.</given-names>
            <surname>Pouyanfar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Sadiq</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Yan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Tian</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Tao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. P.</given-names>
            <surname>Reyes</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.-L. Shyu</surname>
            ,
            <given-names>S.</given-names>
            -C. Chen, S.
          </string-name>
          <string-name>
            <surname>Iyengar</surname>
          </string-name>
          ,
          <article-title>A survey on deep learning: Algorithms, techniques, and applications</article-title>
          ,
          <source>ACM Computing Surveys (CSUR) 51</source>
          (
          <year>2018</year>
          )
          <fpage>1</fpage>
          -
          <lpage>36</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Cao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Yang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Q.</given-names>
            <surname>Tang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Lu</surname>
          </string-name>
          ,
          <article-title>An attention enhanced bidirectional lstm for early forest fire smoke recognition</article-title>
          ,
          <source>IEEE Access 7</source>
          (
          <year>2019</year>
          )
          <fpage>154732</fpage>
          -
          <lpage>154742</lpage>
          . doi:
          <volume>10</volume>
          .1109/ACCESS.
          <year>2019</year>
          .
          <volume>2946712</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>A.</given-names>
            <surname>Sherstinsky</surname>
          </string-name>
          ,
          <article-title>Fundamentals of recurrent neural network (rnn) and long short-term memory (lstm) network, Physica D: Nonlinear Phenomena 404 (</article-title>
          <year>2020</year>
          )
          <fpage>132306</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Yu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Si</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Hu</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. Zhang,</surname>
          </string-name>
          <article-title>A review of recurrent neural networks: Lstm cells and network architectures</article-title>
          ,
          <source>Neural computation 31</source>
          (
          <year>2019</year>
          )
          <fpage>1235</fpage>
          -
          <lpage>1270</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>M.</given-names>
            <surname>Woźniak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Wieczorek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Siłka</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Połap</surname>
          </string-name>
          ,
          <article-title>Body pose prediction based on motion sensor data and recurrent neural network</article-title>
          ,
          <source>IEEE Transactions on Industrial Informatics</source>
          <volume>17</volume>
          (
          <year>2020</year>
          )
          <fpage>2101</fpage>
          -
          <lpage>2111</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>M.</given-names>
            <surname>Woźniak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Siłka</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Wieczorek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Alrashoud</surname>
          </string-name>
          ,
          <article-title>Recurrent neural network model for iot and networking malware threads detection</article-title>
          ,
          <source>IEEE Transactions on Industrial Informatics</source>
          (
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>A. H.</given-names>
            <surname>Lashkari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. F. A.</given-names>
            <surname>Kadir</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Taheri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. A.</given-names>
            <surname>Ghorbani</surname>
          </string-name>
          ,
          <article-title>Toward developing a systematic approach to generate benchmark android malware datasets and classification</article-title>
          , in: 2018
          <source>International Carnahan Conference on Security Technology (ICCST)</source>
          , IEEE,
          <year>2018</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>7</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>