<!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>
      <journal-title-group>
        <journal-title>CITI'</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>of Cerebral Cortex Neurosignals from EEG Sensors and Recognizing Specific Types of Mechanical Movements of Pacient Limbs under the Cognitive Feedback</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Myhaylo</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Petryk</string-name>
          <email>petrykmr@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Pastukh</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Bachynskiy</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mudryk</string-name>
          <email>i1mudryk@ukr.net</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Ternopil Ivan Puluj National Technical University</institution>
          ,
          <addr-line>56, Ruska Street, Room 1-104 Ternopil, 46001</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2023</year>
      </pub-date>
      <volume>1</volume>
      <fpage>14</fpage>
      <lpage>16</lpage>
      <abstract>
        <p>New methods of processing cognitive neurosignals of the cerebral cortex based on the analysis of digital data from EEG sensors using machine learning methods, used to model the elements of mechanical movements of the patient's limbs, are considered in this article. The results of the application of this approach consist in determining the reverse cognitive effects on the study of movement elements (thumbs of the left and right hands) as signs for recognizing specific types of movement of human limbs. Neural networks, cognitive signals, neuro feedback, mechanical movements of patients' limbs, analysis, big data sets, machine learning, hardware and software.</p>
      </abstract>
      <kwd-group>
        <kwd>Mechanical</kwd>
        <kwd>Cognitive</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        The latest machine learning technologies based on deep neural networks in the development of
signal processing information systems are improving the solution of problems related to the
recognition and identification of human movements caused by cognitive influences of the nodes in the
cortex of the brain. This is associated with a whole range of current medical applications, such as
restoring the motor functions of people affected by various negative technological and military
actions by creating effective means of prosthetics for this category of patients, treating patients with
signs of a range of critical neurological disorders such as Alzheimer's and Parkinson's disease. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
Analysis of digital signals from nodes in the cortex of the brain (CC) is crucial for understanding the
role of feedback in the cognitive control of human movements and their restoration to a normal state.
The complexity of identifying the states of the human motor support mechanism (MSM) lies in the
imperfection of existing diagnostic methods, their low accuracy, and the lack of mathematical and
software tools for identifying the reverse influence of cognitive influences of CC nodes on their
behavior. Studies of neural systems related to the analysis of patient behavior have been conducted by
a number of researchers, such as Legrand A.-P., Vidailhet M., Wang J.-S., Luis E. D., Viviani P, and
others [
        <xref ref-type="bibr" rid="ref2 ref3 ref4 ref5">2-5</xref>
        ]. They focused primarily on analyzing the state of MSM in patients using classical
methods of digital processing based on Fourier transformation [
        <xref ref-type="bibr" rid="ref2 ref3 ref4">2-4</xref>
        ]. However, such methods require
further development to ensure high-quality analysis and recognition of movements under the
influence of cognitive signals from CC.
      </p>
      <p>2023 Copyright for this paper by its authors.</p>
      <p>This article proposes a high-performance information technology for processing digital EEG
signals from CC to study the state of the human MSM based on machine learning using deep neural
networks, which allows identifying movement elements with consideration of cognitive feedback
from CC nodes.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Experiment</title>
      <p>
        The research idea was to use machine learning for analyzing cognitive feedback effects of SS
neurosignals based on processing of encephalographic data of a patient who underwent an experiment
[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], taking into account the approaches developed in [
        <xref ref-type="bibr" rid="ref7 ref8">7,8</xref>
        ]. The NEUROKOM computer
electroencephalograph with a 16-channel selection of encephalograms and transmission to a personal
computer using the appropriate protocol, which is the fifth generation of developed computer
electroencephalography complexes, was chosen for studying the brain's electroencephalography
(EEG) signals (Fig. 1).
      </p>
      <p>The helmet with the installed hardware and software platform of the manufacturer was used for
conditioning EEG signals and post-processing on a PC. The data was stored in both raw text and
visualized representations at each point in time.</p>
      <p>To obtain input data, the encephalograph was connected to the patient, which allowed measuring
the potentials of his brain activity.</p>
      <p>During the experiment, the patient sat comfortably in a chair with a backrest and armrests and
performed bending movements of the index finger of their left hand for 2 minutes, followed by the
same movements with the index finger of their right hand. The obtained data were analyzed using
machine learning based on deep networks, which allowed for high-precision recognition of specific
finger movements (which finger was flexed at a given time) and the resulting cognitive feedback
effects of the neural nodes of the central nervous system, as determined by EEG signals from 16
sensors of the encephalograph.</p>
      <p>During the experiment, the patient's movements were recorded by the encephalograph at a
sampling rat of 500 Hz, which provided sufficient data. The total number of signal measurements for
each of the 16 sensors of the encephalograph was 6003. Various experimental conditions were also
taken into account, such as preventing sound stimuli, which reduced the risk of obtaining erroneous
results. The obtained data were saved and used for further analysis and modeling using machine
learning. The sets of output data are presented in Figures 2 and 3.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Machine Learning</title>
      <p>
        After conducting the experiment, we obtained a significant amount of data that needed to be
processed and analyzed. For this, we used the object-oriented programming language Python and
specialized libraries: pandas, numpy, matplotlib.pyplot, collections, sklearn [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Thanks to this, we
were able to build a model that can determine with 99.98% accuracy which finger was bent at a
particular moment in time. The machine learning process allowed us to achieve this high accuracy and
ensure the reliability of the results obtained.
3.1.
      </p>
    </sec>
    <sec id="sec-4">
      <title>Data preparing for machine learning</title>
      <p>We read data from two files, "eeg_0.txt" and "eeg_1.txt", using the pd.read_csv() function from
the pandas library. These files contain electroencephalogram (EEG) data from 16 sensors for two
different patients who performed a finger flexion movement. Each file contains 6003 rows (number of
EEG measurements for each finger) and 17 columns (each with 6002 values), where the first column
contains the date and time, and the other 16 columns contain the EEG signal values for each sensor
located in defined neurozones of the patient's brain cortex (encoding Fp1, Fp2, F3, etc.) (Fig. 1, 2).</p>
      <p>Next, we used the iloc() function to select all rows and columns from 2 to the second-to-last for
each table, meaning we discarded the first and last columns that do not contain EEG values.</p>
      <p>To determine which finger corresponds to each data row, we created a new column "target", where
the LHF finger is assigned the identifier "0" for table df1, and the RHF finger is assigned the
identifier "1" for table df2. Therefore, we can use this column as the class label for training our
machine learning model (MLM). In this case, "target" is an identifier of one of the fingers, and has a
value of either 0 or 1.</p>
      <p>Below is the dataset (table) for the LHF finger in the MLM, where the EEG values are recorded
for each sensor, and the finger identifier is located in the "target" column (Figure 3).</p>
    </sec>
    <sec id="sec-5">
      <title>Visualization of electroencephalography (EEG) signals</title>
      <p>To visualize the data, we used the matplotlib.pyplot library and created a plot that displays the values
of the encephalogram for both LHF and RHF fingers during a 2-minute experiment. In the graphs
(Fig. 5, 6), one can see how the encephalogram values change over time and how they differ for
different fingers (LHF, RHF). This visualization helps to get a general idea of the characteristics of
the data and their distribution.</p>
      <p>Before loading data into the model, it is necessary to prepare and clean it from unnecessary
information. In our case, we merge the data from two sets (LHF and RHF) into one set to have more
examples for training our neural network. After that, we standardize the data to have a mean of 0 and
a standard deviation of 1. The result without normalization is shown in Fig. 7, and the result with
normalization is shown in Fig. 8. This process ensures the uniformity of the data, which increases the
convergence of the model and reduces training time.</p>
      <p>We use the StandardScaler class from the scikit-learn library to standardize the MLM sets. After
standardization, we split our MLM data set into two sets in a 75:25 ratio. 75% of the data will be used
to train our neural network, and 25% will be used to test its effectiveness. We use the train_test_split
class from the scikit-learn library to split the data into training and testing sets.</p>
      <p>In addition to standardization, other operations are performed on the MLM data, such as
normalization, clipping, or removing missing values. The use of different preprocessing methods
affects the model results, so it is important to experiment with different approaches and choose the
one that achieves the best results.
3.4.</p>
    </sec>
    <sec id="sec-6">
      <title>Training and testing model</title>
      <p>After completing the process of preparing the data for analysis and processing, we proceed with
the creation and training of the neural network. This process includes the following stages: model
initialization, training, prediction, and evaluation of its effectiveness.</p>
      <p>During the training of the model, the neural network was trained using input data and
backpropagation of error to establish appropriate weights between neurons. This process can take a
long time, depending on the complexity of the task and the size of the data used. The code snippet
used for training and testing is shown in Fig. 9.</p>
      <p>"Testing and evaluating the effectiveness of the MLM (LHF &amp; RHF) allows us to determine the
accuracy of the model, which indicates how accurately it predicts the output data. Various metrics
such as accuracy, f1-score, and ROC AUC can be used for this purpose. The visualization of the
confusion matrix is presented in Figure 10.</p>
      <p>Evaluating the performance of the model enables us to identify weaknesses and improve its
accuracy. Figure 11 shows the probability estimation results of the model ranging from 0 to 1.</p>
      <p>As a result of training and testing the MLM (LHF &amp; RHF) neural network, we achieved high
accuracy, which enabled us to prepare it for use in recognizing patient movements under
investigation.
3.5.</p>
    </sec>
    <sec id="sec-7">
      <title>Example of MLM for recognizing specific patient movements</title>
      <p>The trained and tested MLM was fed a set of EEG data - signals from the patient's brain cortex
(Fig. 13).</p>
      <p>The output of the network indicated that the given set of input EEG signals from the brain cortex
(Fig. 12) corresponded to the patient's RHF finger movement (Fig. 13) with an accuracy of 0.999133.
a)
b)</p>
      <p>Therefore, as a result of training and testing the MLM neural network (LHF &amp; RHF), we achieved
a high level of accuracy, which allowed us to prepare it for use in recognizing the investigated
movements of patients.</p>
    </sec>
    <sec id="sec-8">
      <title>4. Concluіsions</title>
      <p>The authors propose a high-performance information technology for processing digital EEG
signals from the central cortex (CC) to investigate the state of the human motor system based on
machine learning using deep neural networks. This approach allows for the identification of
movement elements with consideration of the cognitive feedback loops of the CC neural nodes as
features for recognizing specific types of human limb movements. High-performance algorithms for
recognizing movement elements have been developed based on this approach, which enables parallel
computing.</p>
    </sec>
    <sec id="sec-9">
      <title>5. Acknowledgements</title>
      <p>The research results mentioned in this work were partly supported by Grant SSHN Campus France,
2021 and Projects DI 247-22 M.P. (0122U001979), funding from the Ministry of Education and
Science of Ukraine.</p>
    </sec>
    <sec id="sec-10">
      <title>6. References</title>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Bhidayasiri</surname>
            <given-names>R.</given-names>
          </string-name>
          , Mari Z.
          <article-title>Digital phenotyping in Parkinson's disease: Empowering neurologists for measurement-based care</article-title>
          .
          <source>Parkinsonism Relat Disord</source>
          .
          <year>2020</year>
          Nov;
          <volume>80</volume>
          :
          <fpage>35</fpage>
          -
          <lpage>40</lpage>
          . DOI:
          <volume>10</volume>
          .1016/j.parkreldis.
          <year>2020</year>
          .
          <volume>08</volume>
          .038.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Legrand</surname>
            <given-names>A.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rivals</surname>
            <given-names>I.</given-names>
          </string-name>
          , Richard A.,
          <string-name>
            <surname>Apartis</surname>
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Roze</surname>
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vidailhet</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Meunier</surname>
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hainque</surname>
            <given-names>E</given-names>
          </string-name>
          .
          <article-title>New insight in spiral drawing analysis methods - Application to action tremor quantification</article-title>
          .
          <source>J Clinical Neurophysiology</source>
          ,
          <volume>128</volume>
          (
          <issue>10</issue>
          ),
          <fpage>1823</fpage>
          -
          <lpage>1834</lpage>
          . (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Wang</surname>
            <given-names>J.-S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chuang F</surname>
          </string-name>
          .
          <article-title>-C. An Accelerometer-Based Digital Pen with a Trajectory Recognition Algorithm for Handwritten Digit and Gesture Recognition</article-title>
          .
          <source>IEEE Transactions on Industrial Electronics</source>
          ,
          <volume>59</volume>
          (
          <issue>7</issue>
          ),
          <fpage>2998</fpage>
          -
          <lpage>3007</lpage>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Louis</surname>
            ,
            <given-names>E. D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gillman</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Böschung</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hess</surname>
            ,
            <given-names>C. W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yu</surname>
            ,
            <given-names>Q.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Pullman</surname>
            ,
            <given-names>S. L.</given-names>
          </string-name>
          <article-title>High width variability during spiral drawing: Further evidence of cerebellar dysfunction in essential tremor</article-title>
          .
          <source>Cerebellum</source>
          ,
          <volume>11</volume>
          ,
          <fpage>872</fpage>
          -
          <lpage>879</lpage>
          (
          <year>2012</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Viviani</surname>
            <given-names>P</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Burkhard</surname>
            <given-names>PR</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chiuvé</surname>
            <given-names>SC</given-names>
          </string-name>
          ,
          <string-name>
            <surname>dell'Acqua</surname>
            <given-names>CC</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vindras</surname>
            <given-names>P</given-names>
          </string-name>
          .
          <article-title>Velocity control in Parkinson's disease: a quantitative analysis of isochrony in scribbling movements</article-title>
          .
          <source>Exp Brain</source>
          <year>2009</year>
          ;
          <volume>194</volume>
          :
          <fpage>259</fpage>
          -
          <lpage>83</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Scikit-learn</surname>
          </string-name>
          ,
          <source>Machine Learning in Python, Pedregosa</source>
          et al.,
          <source>Journal of Machine Learning Research</source>
          , vol.
          <volume>12</volume>
          , pp.
          <fpage>2825</fpage>
          -
          <lpage>2830</lpage>
          ,
          <year>2011</year>
          . URL: https://scikit-learn.org/.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Petryk</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gancarczyk</surname>
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Khimich</surname>
            <given-names>O</given-names>
          </string-name>
          .
          <article-title>Methods of Mathematical Modeling and Identification of Complex Processes and Systems on the basis of High-performance Calculations (neuroand nanoporous feedback cyber systems, models with sparse structure data, parallel computations)</article-title>
          . Scientific Publishing University of Bielsko-Biala. Bielsko-Biala, Poland,
          <year>2021</year>
          , 194 p.https://www.sbc.org.pl/dlibra/publication/584139/edition/549297
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Mudryk</surname>
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Petryk</surname>
            <given-names>M..</given-names>
          </string-name>
          <article-title>High-performance modeling, identification and analysis of heterogeneous abnormal neurological movement's parameters based on cognitive neuro feedback-influences</article-title>
          .
          <source>Innovative Solutions in Modern Science</source>
          .
          <year>2021</year>
          . New York. TK Meganom LLC.
          <source>V1(45)</source>
          ,
          <fpage>235</fpage>
          -249 doi: 10.26886/
          <fpage>2414</fpage>
          -
          <lpage>634X</lpage>
          .
          <volume>1</volume>
          (
          <issue>45</issue>
          )
          <year>2021</year>
          .
          <fpage>16</fpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>