Sie sind auf Seite 1von 20

The proposed WSN-EEG wearable device monitors brain activities and alerts patients with

epilepsy. The system will implement the prediction Algorithm, FFNN and mathematical

model to diagnose epilepsy and enhance activities of daily living of epilepsy patients.

5.2 Method
The WSN-EEG consist from three parts,
• WSN- EEG Test and Model Design
• The brain waves illustration
• The FFNN based machine-learning approaches and Deep Learning

5.2.1 WSN-EEG Test and Model Design

A Specific Sensor Ad hoc architecture testbed was designed to study the service time with respect to
latency and jitter factors for data transmission between the WSN and the EEG receiver. The Testbed
consists of a sensor ‘Sensor Side’ connected to the receiver ‘analyzer side’ by control radio environment
(RF cable), as illustrated in figure 25. This Testbed used specific traffic generator software to generate
UDP data (brain waves) from the sensors to the WSN-EEG receiver, and specific analyser to monitor
network traffic and performance time stamp between the nodes.

The study conducted the tests with a source and a receiver. The test-bed used IEEE802.11n as
transmission techniques and security protocol for data privacy. The measurements for data transmission
divided into two subclasses tests with enabled and with disabled security. In the both tests, the sensor
on the patient scalp is the source of the traffic, and the analyzer is the traffic receive in figure 23.

Wi-Fi Receiver

Sensor
RF Cable

Analyser

Figure 1 WSN-EEG Ad hoc Sensor Network Connection

In the Test-bed, a set of UDP in different packet sizes sent from the sensor to the analyser to stressed
the network with maximize CPU capacity, evaluate the service time, study the effect of the signal delay
and the total service time to diagnose epilepsy and seizure attach prediction to alert the patients on
time[65]. All tests were repeated four times in each test session and therefore evaluated four times in
total to record the accurate average service time in respect to the data size and security scenarios.

5.2.2 The brain waves illustration

In this Section, results about the system illustration of four brain waves A,B,T,and D

presented. These were obtained using the microcontroller software imitations on proteus 8

professional 8.4 Model. The C compiler for Microchip PIC MCUs used for coding, using the

PIC16F877A chip and 4MHz crystal. The PIC16F877A has two CCP module so we can use

one of them to calculate the frequency of input signal (brain wave). The Brain waves were

generated by simulation. First, a frequency values is considered. Then, a change according to

a tolerance point is described in order to expose the behaviour of each brain signal to a highly

changing value. To model a rapid change of frequency, i.e. of the subject’s boundary’s and

numbers , the frequency period is suddenly modified or interrupted. In this case CPP module

uses Timer1 for reference timing so appropriately set Tmier1. This is done through T1CON

register and we set prescaler of the Timer1 to 1:4(T1CON=0x21) .Here the last bit of T1CON

means TMR1ON). On the other hands CCP1 is set to interrupt at ever rising edge of input

pulse.(CCP1CON=5).The system clock is a quarter of that of crystal(fosc/4).

Timer_1 was increased with the frequency of a quarter of system clock so its frequency is

0.25MHz. If the input frequency is 1Hz, the counter should count 250000 for one cycle and

counter of CCP will overflow. So in this system uses Timer1’s interrupt and at every

interrupt of Timer1 an other counting variable is increased(tk in code). In this code to avoid

double interrupt tk is divided by 2. For every tk is the same of 65536 CCP counter.

Table 1 Model and results of research-imitations on Proteus 8 Professional 8.4 Model Frequency
values to define normal and abnormal Brain waves
A Wave 8.5 Normal A Wave 12.5 Normal

A Wave 8 Epilepsy Attack boundary A Wave 13 Epilepsy Attack boundary

B Wave 14.5 Hz Normal B Wave 50 Hz Normal


B Wave 14Hz Epilepsy Attack boundary B Wave 50Hz Epilepsy Attack boundary

D Wave 1.5 Hz Normal D Wave 3 Hz Normal

D Wave 1 Hz Epilepsy Attack boundary D Wave 3.5 Hz Epilepsy Attack boundary

T Wave 4.5 Hz Normal T Wave 7 Hz Normal


T Wave 4Hz Epilepsy Attack boundary T Wave 7.5 Epilepsy Attack boundary

When it goes from 1.02 to 1.99 Hz, the time is changed from 1.254390 to 1.625765 sec (look to part
of ANIMATING. It is animating time)

Fig. 11. Results of time, when begun changing frequency from 1.02 Hz

Fig. 12. Results of time, when changed frequency to 1.99 Hz


Difference of frequencies: f2 - f1 = 1.99 – 1.02 = 0.97 Hz
Difference of times: t2 - t1=1.625765 - 1.254390 = 0.371375 sec.

Fig. 13. Results of time, when begun changing frequency from 1.43 Hz

Fig. 14. Results of time, when changed frequency to 3.43 Hz

Difference of frequency: f2 - f1 = 3.43 – 1.43 = 2 Hz


Difference of time: t2 - t1=1.981804 - 1.620181 = 0.361623 sec.
Fig. 15. Results of time, when begun changing frequency from 7.89 Hz

Fig. 16. Results of time, when changed frequency to 11.01 Hz

Difference of frequency: f2 - f1 = 11.01 – 7.89 = 3.12 Hz


Difference of time: t2 - t1=2.157293 - 1.655613 = 0.50168 sec.
Fig. 17. Results of time, when begun changing frequency from 14.08 Hz

Fig. 18. Results of time, when changed frequency to 33.78 Hz

Difference of frequency: f2 - f1 = 33.78 – 14.08 = 19.7 Hz


Difference of time: t2 - t1=1.626004 - 1.245520 = 0.380484 sec.

Differences of frequency (Hz) Differences of times (sec)


1 0.97 0.371375
2 2 0.361623
3 3.12 0.50168
4 19.7 0.380484
0,6

0,5

Differences of time, sec


0,4

0,3

0,2

0,1

0
0,97 2 3,12 19,7
Differences of frequencies, Hz

Fig. 19. Differences of controlling parameters

C++ Program of research

#include <LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
int Htime; //integer for storing high time
int Ltime; //integer for storing low time
float Ttime; // integer for storing total time of a cycle
float frequency;
const normal = 9;
const attach = 10; //storing frequency
void setup()
{
pinMode(normal,OUTPUT);
pinMode(attach, OUTPUT);
pinMode(8,INPUT);
lcd.begin(16, 2);
}
void loop()
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Chastota signal");
Htime=pulseIn(8,HIGH); //read high time
Ltime=pulseIn(8,LOW); //read low time
Ttime = Htime+Ltime;
frequency = 10000/Ttime; //getting frequency with T time is in Micro seconds
lcd.setCursor(0,1);
lcd.print(frequency);
lcd.print(" Hz");
delay(500);
}
5.2.3 Feed Forward Neural Networks (FFNN) System Model and Problem
Formulation

The research proposed FFNN based machine-learning approach to overcome the problem

of non-linearity of the seizure attack. As we can observe in figure 24, the brain signal passing

through proposed tolerance point (pre seizure attack). Using neural network trained model

combining the different distribution in one desirable distribution considering the non-linearity

of the Seizure attack. , provided with a simple specification of the problem in coming section.

Figure 2 Example of an EEG A signal detailing normal behaviour (Gray Colour Normal Brain waves,
Yellow colour is the tolerance point /pre- attack, light blue is the brain activity during a seizure [66]

FFNN applied to the diagnosis of nonlinear signal using WSN-EEG algorithm approach, tolerance

point for signal boundaries for abnormal behaviour signs of possible seizures as identified in section

4.4.4. A faulty dictionary was first created containing responses observed at all inputs and outputs of
the brain wave behaviour for epilepsy patients. The FFNN machine-learning approach considered as

WSN-EEG approximation algorithm to capture mapping enclosed within the fault dictionary, in

addition, as an algorithm tool for searching the fault dictionary in the diagnostic phase.

In the FFNN model, the brain waves time domain, frequency domain measurements taken as

data for WSN-EEG device data-sheets-values. The abnormal signal behaviour and duration

were set as output set of data per fault. Changes in electrical activity in the brain and seizure

symptoms can be correlated to provide information about future seizures, their duration and

severity. However, this correlation between EEG signals and symptoms composes a complex

non-linear problem, which can be solve using neural networks, provided with a simple

specification of the problem. Moreover, Feed-Forward Neural Networks (FFNN for short)

may provide optimize the prediction rate of a neural-network-based system, by removing

inter-layer connections between the neural network.

5.2.3.1 Modelling stage

Electrical activity in the brain can be measured non-invasively via EEG, using electrodes

attached to the scalp that measure voltage fluctuations within neurons in the brain, producing

a time-dependent signal

𝑆𝑆: 𝑅𝑅 → 𝑅𝑅 (1)

That can be sampled in time by the EEG into a finite collection of values 𝑆𝑆̃ (a set),

of the form

S = {𝑆𝑆(𝑡𝑡) | 𝑡𝑡 ∈ 𝑇𝑇} (2)

Sampled in a collection of discrete time instants

𝑇𝑇 = {𝑡𝑡𝑖𝑖 ≥ 0| 𝑖𝑖 = 0, … , 𝑁𝑁} (3)


A seizure in an EEG signal is observable via a rapid change in the amplitude and

form of 𝑆𝑆 (i.e. spiking) that define three states of EEG waves as showcased in Figure

24. A normal state (light blue background), a pre-seizure state (pre-state for short,

yellow background), and a seizure state (light red background). Thus, given a signal 𝑆𝑆

we can partition collection 𝑇𝑇 in three (possibly empty) subsets 𝑇𝑇𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 , 𝑇𝑇𝑝𝑝𝑝𝑝𝑝𝑝 , 𝑇𝑇𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 such

that

𝑇𝑇 = 𝑇𝑇𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 ∪ 𝑇𝑇𝑝𝑝𝑝𝑝𝑝𝑝 ∪ 𝑇𝑇𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 (4)

And the divide a signal 𝑆𝑆, in three subsets:

𝑆𝑆𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 = {𝑆𝑆(𝑡𝑡)| 𝑡𝑡 ∈ 𝑇𝑇𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 }


𝑆𝑆𝑝𝑝𝑝𝑝𝑝𝑝 = �𝑆𝑆(𝑡𝑡)| 𝑡𝑡 ∈ 𝑇𝑇𝑝𝑝𝑝𝑝𝑝𝑝 �
𝑆𝑆𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 = {𝑆𝑆(𝑡𝑡)| 𝑡𝑡 ∈ 𝑇𝑇𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 } (5)

In addition, during the pre-state and the seizure, seizure-symptoms (e.g.

hallucinations, muscle contractions, etc.) begin to appear on the patient, whose severity:

none (𝑛𝑛𝑛𝑛), mild (𝑚𝑚𝑚𝑚), moderate (𝑚𝑚𝑚𝑚), or (𝑠𝑠𝑠𝑠𝑠𝑠)severe define additional criteria for

EEG wave samples. Thus, the samples on a signal 𝑆𝑆 can be written as:

(𝑡𝑡𝑡𝑡)
𝑆𝑆 = �𝑆𝑆(𝑡𝑡𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 )|𝑡𝑡𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 ∈ 𝑇𝑇𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 , 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 ∈ {𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛, 𝑝𝑝𝑝𝑝𝑝𝑝, 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠} ∧ 𝑡𝑡𝑡𝑡 ∈

{𝑛𝑛𝑛𝑛, 𝑚𝑚𝑚𝑚, 𝑚𝑚𝑚𝑚, 𝑠𝑠𝑠𝑠𝑠𝑠}� (6)

5.3.2 Seizure Prediction using Feed Forward Neural Networks

To create an FFNN-based strategy for seizure prediction, we will take the variables and

concepts defined on Section 2 to define a deviation measure in EEG signals to

distinguish between normal and abnormal brain activity and propose a strategy to feed

an FFNN an input (subsets of an EEG signal) to produce an output (a predicted signal).


5.3.2.1 Stage-Learning Hypothesis

The Research used the FFNN paradigm to forecast seizures, using the severity of symptom

signs as defined in in section 2. We can define abnormal brain activity in an EEG as a subset

𝑆𝑆𝑎𝑎𝑎𝑎 ⊆ 𝑆𝑆 brain activity as

𝑆𝑆𝑎𝑎𝑎𝑎 = �𝑆𝑆�𝑡𝑡 (𝑡𝑡𝑡𝑡) �|𝑡𝑡𝑡𝑡 ∈ {𝑚𝑚𝑚𝑚, 𝑚𝑚𝑚𝑚, 𝑠𝑠𝑠𝑠𝑠𝑠}� (7)

That is, as the values of 𝑆𝑆 associated with the appearance of symptoms. Under these
definitions we can define normal brain activity as the complement of 𝑆𝑆𝑎𝑎𝑎𝑎

𝑆𝑆𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 = 𝑆𝑆 ∖ 𝑆𝑆𝑎𝑎𝑎𝑎 (8)

Given a signal, we can define the duration of seizure symptoms using the set diameter of
(𝑡𝑡𝑡𝑡)
𝑇𝑇 as

∆𝑇𝑇 (𝑡𝑡𝑡𝑡) = 𝑚𝑚𝑚𝑚𝑚𝑚�|𝑡𝑡1 − 𝑡𝑡2 |: 𝑡𝑡1 , 𝑡𝑡2 ∈ 𝑇𝑇 (𝑡𝑡𝑡𝑡) �, 𝑡𝑡𝑡𝑡 ∈ {𝑚𝑚𝑚𝑚, 𝑚𝑚𝑚𝑚, 𝑠𝑠𝑠𝑠𝑠𝑠} (9)

In addition, given a non-empty time-frame 𝑇𝑇� ⊂ 𝑇𝑇 we can define the variation of 𝑆𝑆 in 𝑇𝑇� as

∆𝑆𝑆�𝑇𝑇�� = {|𝑆𝑆(𝑡𝑡)|: 𝑡𝑡 ∈ 𝑇𝑇�} (10)

Thus, a spike in brain activity can be easily detected as

∆𝑆𝑆 �
∆𝑆𝑆(𝑇𝑇)
∆𝑇𝑇�
= �
≥ 𝑆𝑆𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 (11)
∆𝑇𝑇

For some tolerance value 𝑆𝑆𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 > 0. Provided with a baseline signal 𝑆𝑆̂ of brain activity
(deduced from expected brain activity), we can define the deviation between a given signal 𝑆𝑆
and the baseline 𝑆𝑆̂ as

𝐷𝐷 = �𝑆𝑆(𝑡𝑡) − 𝑆𝑆̂(𝑡𝑡): 𝑡𝑡 ∈ 𝑇𝑇� (12)

and an absolute measurement of the deviation taking its norm:

‖𝐷𝐷‖ = 𝑚𝑚𝑚𝑚𝑚𝑚��𝑆𝑆(𝑡𝑡) − 𝑆𝑆̂(𝑡𝑡)�: 𝑡𝑡 ∈ 𝑇𝑇� (13)

Isolating the timeframes in which seizures occur, can be done with the provided tolerance

values 𝑆𝑆 (𝑚𝑚𝑚𝑚) , 𝑆𝑆 (𝑚𝑚𝑚𝑚) , 𝑆𝑆 (𝑠𝑠𝑠𝑠𝑠𝑠) > 0 that determine abnormal brain activity:

(𝑡𝑡𝑡𝑡)
𝑇𝑇𝑎𝑎𝑎𝑎 = �𝑡𝑡 ∈ 𝑇𝑇 |𝐷𝐷(𝑡𝑡)| > 𝑆𝑆 (𝑡𝑡𝑡𝑡) �, 𝑡𝑡𝑡𝑡 ∈ {𝑚𝑚𝑚𝑚, 𝑚𝑚𝑚𝑚, 𝑠𝑠𝑠𝑠𝑠𝑠} (14)
And the values of 𝑆𝑆 of abnormal brain activity as:

(𝑡𝑡𝑡𝑡) (𝑡𝑡𝑡𝑡)
𝑆𝑆𝑎𝑎𝑎𝑎 = �𝑆𝑆(𝑡𝑡): 𝑡𝑡 ∈ 𝑇𝑇𝑎𝑎𝑎𝑎 � , 𝑡𝑡𝑡𝑡 ∈ {𝑚𝑚𝑚𝑚, 𝑚𝑚𝑚𝑚, 𝑠𝑠𝑠𝑠𝑠𝑠} (15)

5.3.2.1.1 Learning and Development

Provided with a baseline signal 𝑆𝑆̂ for normal brain activity, we wish to apply the FFNN

paradigm to the problem of determining the type of future seizures a patient will suffer by

producing a signal 𝑆𝑆𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 (the output) from three given inputs:

(𝑚𝑚𝑚𝑚) (𝑚𝑚𝑚𝑚) (𝑠𝑠𝑠𝑠𝑠𝑠)


i. 𝑋𝑋1 = 𝑇𝑇𝑎𝑎𝑎𝑎 ∪ 𝑇𝑇𝑎𝑎𝑎𝑎 ∪ 𝑇𝑇𝑎𝑎𝑎𝑎
(𝑚𝑚𝑚𝑚) (𝑚𝑚𝑚𝑚) (𝑠𝑠𝑠𝑠𝑠𝑠)
ii. 𝑋𝑋2 = 𝑆𝑆𝑎𝑎𝑎𝑎 ∪ 𝑆𝑆𝑎𝑎𝑎𝑎 ∪ 𝑆𝑆𝑎𝑎𝑎𝑎
(𝑚𝑚𝑚𝑚) (𝑚𝑚𝑚𝑚) (𝑠𝑠𝑠𝑠𝑠𝑠)
iii. 𝑋𝑋3 = ∆𝐷𝐷�𝑇𝑇𝑎𝑎𝑎𝑎 � ∪ ∆𝐷𝐷�𝑇𝑇𝑎𝑎𝑎𝑎 � ∪ ∆𝐷𝐷�𝑇𝑇𝑎𝑎𝑎𝑎 �

So that the resulting signal will be of the form 𝑆𝑆𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 = 𝐹𝐹(𝑋𝑋1 , 𝑋𝑋2 , 𝑋𝑋3 ). Classically, we would

like to construct 𝐹𝐹 as a linear combination of the input variables at each time step.

5.3.2.1.2 Optimization Stage

When using the Feed-Forward paradigm, the structure of the network must change, to avoid

creating cycles of neurons between layers (see Figure 25). To guarantee the structure of an

FFNN provided with the input, we can separate the network in a series of hidden layers 𝑂𝑂𝑗𝑗 , 𝑗𝑗 =

1, … , 𝑃𝑃 so that the input of each layer depends on a linear combination of the inputs of the

previous one.

In layer 𝑂𝑂𝑗𝑗 , if 𝑓𝑓𝑗𝑗𝑘𝑘 denotes the input function of neuron 𝑛𝑛𝑘𝑘 , 𝑓𝑓𝑗𝑗𝑘𝑘 is of the following form

𝑓𝑓𝑗𝑗𝑘𝑘 = ∑𝑖𝑖 𝛼𝛼𝑖𝑖𝑖𝑖


𝑘𝑘 𝑖𝑖
𝑓𝑓𝑗𝑗−1 (16)

In our case, the first layer of the neural network (the input layer) is defined by functions
𝐹𝐹𝑖𝑖 , 𝑖𝑖 = 1,2,3 of the form:
(𝑚𝑚𝑚𝑚) (𝑚𝑚𝑚𝑚) (𝑠𝑠𝑠𝑠𝑠𝑠)
𝐹𝐹𝑖𝑖 (𝑋𝑋𝑖𝑖 ) = � 𝑤𝑤𝑖𝑖 𝑋𝑋𝑖𝑖 (𝑡𝑡) � 𝑤𝑤𝑖𝑖 𝑋𝑋𝑖𝑖 (𝑡𝑡) + � 𝑤𝑤𝑖𝑖 𝑋𝑋𝑖𝑖 (𝑡𝑡)
(𝑚𝑚𝑚𝑚) (𝑚𝑚𝑚𝑚) (𝑠𝑠𝑠𝑠𝑠𝑠)
𝑡𝑡∈𝑇𝑇𝑎𝑎𝑎𝑎 𝑡𝑡∈𝑇𝑇𝑎𝑎𝑎𝑎 𝑡𝑡∈𝑇𝑇𝑎𝑎𝑎𝑎

X1 X2 X3 X Input Layer
W3.1
W1.1 W1.i W2.1 W2.i
W3.i
W1.2 W2.2 W3.2

Oj Hidden Layer,J
O1 ∫ ∫ ∫

W1.1 W1.2 W1.j

Y Output Layer
∫ ∫

Y=

Figure 3 Proposed FFNN structure

While if the network has 𝑁𝑁 + 1 layers (with layer 0 being the input layer), the output 𝑆𝑆𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛

will be defined by a function of the form

𝑘𝑘 (𝑚𝑚𝑚𝑚)
𝑘𝑘 𝑘𝑘 (𝑚𝑚𝑚𝑚) (𝑠𝑠𝑠𝑠𝑠𝑠)
𝑆𝑆𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 (𝑡𝑡) = � 𝑤𝑤𝑁𝑁−1 𝑓𝑓(𝑚𝑚𝑚𝑚) (𝑡𝑡) + 𝑤𝑤𝑁𝑁−1 𝑓𝑓(𝑚𝑚𝑚𝑚) (𝑡𝑡) + 𝑤𝑤𝑁𝑁−1 𝑓𝑓(𝑠𝑠𝑠𝑠𝑠𝑠) (𝑡𝑡)
𝑘𝑘

Where the summation is taken over the number of neurons in the (𝑁𝑁 − 1)-th

layer, and 𝑓𝑓(𝑡𝑡𝑡𝑡) satisfies the following property

(𝑡𝑡𝑡𝑡)
𝑓𝑓(𝑡𝑡𝑡𝑡) (𝑡𝑡) = 0 ⟺ 𝑡𝑡 ∉ 𝑇𝑇𝑎𝑎𝑎𝑎 , 𝑡𝑡𝑡𝑡 ∈ {𝑚𝑚𝑚𝑚, 𝑚𝑚𝑚𝑚, 𝑠𝑠𝑠𝑠𝑠𝑠} (17)

5.3.2.2 Application Stage

The predicting signal 𝑆𝑆𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 is constructed provided with an accurate baseline signal 𝑆𝑆̂ and

could provide patients with a more detailed prognosis on their condition, whether they are prone

to seizures and the type of seizures they will suffer. However, extrapolating baseline signals,
as well as the tolerances proposed in section 3 of this thesis, depends on the medical records of

a patient that must be weighted by additional factors (e.g. emotion, sleep patterns).

The range of values used to separate normal from abnormal behavior depends on two factors:

(1) distinguished values of 𝑆𝑆(𝑡𝑡), and (2) the oscillation frequency as presented in Table 1. Given

(𝑡𝑡𝑡𝑡) (𝑡𝑡𝑡𝑡)
a frequency range for a specific type �𝑎𝑎𝑚𝑚𝑚𝑚𝑚𝑚 , 𝑎𝑎𝑚𝑚𝑚𝑚𝑚𝑚 �, the lower and upper boundaries (onset)

frequencies are calculated using a tolerance value 𝜀𝜀 (𝑡𝑡𝑡𝑡) as follows:

(𝑡𝑡𝑡𝑡) (𝑡𝑡𝑡𝑡)
𝑓𝑓𝑚𝑚𝑚𝑚𝑚𝑚 = 𝑎𝑎𝑚𝑚𝑚𝑚𝑚𝑚 + 𝜀𝜀 (𝑡𝑡𝑡𝑡) (18)

For the lower bound, while the upper bound is defined as

(𝑡𝑡𝑡𝑡) (𝑡𝑡𝑡𝑡)
𝑓𝑓𝑚𝑚𝑚𝑚𝑚𝑚 = 𝑎𝑎𝑚𝑚𝑚𝑚𝑚𝑚 − 𝜀𝜀 (𝑡𝑡𝑡𝑡) (19)

Thus, seizure symptoms are observable in the 4,5 Hz - 49,5 Hz, and a seizure attack is

considered to occur when the frequency of oscillation escalates to the abnormal range, and the

change occurs within (at least) 15 seconds (recall Equation 11).

Table 2 Frequency values to define normal (𝒏𝒏𝒏𝒏) and abnormal (𝒎𝒎𝒎𝒎, 𝒎𝒎𝒎𝒎, 𝒔𝒔𝒔𝒔𝒔𝒔) behavior.

Type (𝒕𝒕𝒕𝒕) Range (Hz) 𝜺𝜺 (Hz) (𝒕𝒕𝒕𝒕)


𝒇𝒇𝒎𝒎𝒎𝒎𝒎𝒎 (Hz)
(𝒕𝒕𝒕𝒕)
𝒇𝒇𝒎𝒎𝒎𝒎𝒎𝒎 (Hz)
𝒏𝒏𝒏𝒏 [1,3.5] 0,5 1,5 3
𝒎𝒎𝒎𝒎 [4,7.5] 0,5 4,5 7
𝒎𝒎𝒎𝒎 [8,13] 0,5 7,5 12,5
𝒔𝒔𝒔𝒔𝒔𝒔 [14,50] 0,5 14,5 49,5

6. Results
The results presents the WSN- EEG test and model design simulation output, and a mathematical
prediction model based on simulation WSN-EEG simulations combined results brain waves illustration
output and the FFNN based machine-learning approach.

6.1 WSN- EEG test and model design simulation output

The WSN-EEG deployed IEEE802.11n transmission-techniques to estimate, and evaluate the quality
of service (QoS) parameters. In addition, data packet delay, the total serves time and the security protocol
impact on sensor networks. The results showed the EEG sensor networks performance depends on
design and implementation for security protocols, which adds a significant impact related to the data
packet delays, and the packet size transmitted over the ad hoc sensor network (figure 26, 27) [65].

SERVICE TIME FROM THE SENSOR


TO THE ANALYZER
Average Total Service Time (µs)

228
211
188

135
111
82 94

Uplink

Uplink
32 64 128 256 512 1024 1472
UDP payload (Bytes)

Figure 4 Total service time for data transmission


from sensor to receiver side- security disabled

SERVICE TIME FROM THE SENSOR


TO THE ANALYZER
Average Total Service Time (µs)

284
221 241
202
124
92 103 Uplink

Uplink
32 64 128 256 512 1024 1472
UDP payload (Bytes)
Figure 5 Total service time for data transmission
from sensor to the receiver side - security Enabled

UDP Average Total Service Time


payload (µs)
(Bytes) Packet
Size
Uplink
32 82
64 94
128 111
256 135
512 188
1024 211
1472 228

UDP payload Average Total Service Time (µs) WPA2


(Bytes) Packet Size Enabled

Uplink
32 92
64 103
128 124
256 202
512 221
1024 241
1472 284
6.2 Mathematical prediction Model

In the present work, a mathematical model has been developed to predict the abnormality in the brain
waves as diagnosis for epilepsy attack. The mathematical module corresponding to three different levels
on inputs, brain wave illustration, WSN-EEG simulation, and prediction algorithm implementing FFNN
based learning machine as data inputs for the model. These inputs were processed through three different
level of formulation process to predict the abnormal brain wave, and predict the seizure attack before it
occur in a reasonable time to caution the patents through the WSN-EEG alert system.

According to the developed model, the primary inputs were derivative from WSN-EEG simulation
inputs and outputs as flowing
Sp: Size of UDP packets (32-1472)
Np: Number of transmitted packets (n)
D: packet transmission delays in µs (Microsecond) (constant ≈ 0.5 µs based on test results in the
experiment section)
Nbs(f): Brain Waves length (A, B, D, T constant value) Hz/S
Si: security impact (constant value ≈15 µs to 70 µs)
Transmission Speed = 5 GHz
Qt: the number of pack on the queue
λ: wavelength
v: wave constant speed (5 Ghz Using IEEE802.11n)

x + y = z. (1)

The service time identified as following:


Total Transmission time (Tt) in

µs=(Np*Sp)+(Si+(Qt*Nbs))+D (2)

Nbs= v/ λ (3)

When generated the illustrated brain wave the signal in (section 5.2.2), the main method is a harmonic
oscillation-the amplitude modulation of the carrying signal. This method gives qualitative results in the
analysis and synthesis of the frequency spectrum.
In general, the oscillating wave-signal is represented as follows:

y(t) = A(ω) cos(ω + φ) = Aφ cos(2πft + φω), (4)

Here: U(ω) is the amplitude of the bearing vibration, f is the frequency of the vibrating vibration, ω
is the ailane frequency, and φω is the initial phase of the bearing vibration.
The primary signal is a complex oscillation, its frequency spectrum F1 ... F2 (or Ω1 ... Ω2) is bounded
by a strip, i.e:

Ω2
y (t ) = ∑A
Ω i = Ω1
Ωi cos(Ωit + ϕΩi ),
(5)
Here is the amplitude of the primary signal of the i-th frequency component, i is the frequency
component of the primary signal, the initial phase i is the frequency component.
The amplitude of the harmonic wave (2) of the signal harmonic (4) after modulating the amplitude
form is represented as follows:
y (t ) = [ Aω + AΩ cos(Ωt + ϕΩ )] cos(ωt + ϕω ) =
 A 
= Aω 1 + Ω cos(ωt + ϕω ) cos(ωt + ϕω ).
 Aω  (6)
Coefficient of the depth of modulation of a quantity, when the given value is taken into account, the
amplitude modulated signal will have the following form:
y (t ) = Aω [1 + m cos(Ωt + ϕω )]cos(Ωt + ϕω ). (7)
With linear amplitude modulation and using sinusoidal mathematical formula presentation[70]
y (x, t) = A cos *(2π ((x/ λ)- ft)) = A cos (2π / λ (x-vt) (8)
where is y= wave value, x= wave position, t: time , A: wave amplitude
Implementing wavenumber and angular frequency to formula 3
Where k: wave number (2π wavelengths)
ω: angular frequency 2π times of the frequency
y(x, t) = U cos (ωt + φ) = U cos(2πft + φ)) (9)
Calculate the wavelength and frequency values

λ=2π/k =2πv/ ω =v/f, f = v/ λ (10)

Based on defined tolerance point in the WSN- EEG Epilepsy Predictor Waves Algorithm and
implemented FFNN in ( section 5.4 ) and the defined wave bounders we calculate the
frequencies are calculated using a tolerance value 𝜀𝜀 (𝑡𝑡𝑡𝑡) as follows:

(𝑡𝑡𝑡𝑡) (𝑡𝑡𝑡𝑡)
𝑓𝑓𝑚𝑚𝑚𝑚𝑚𝑚 = 𝑎𝑎𝑚𝑚𝑚𝑚𝑚𝑚 + 𝜀𝜀 (𝑡𝑡𝑡𝑡) (20)

OR
(𝑡𝑡𝑡𝑡) (𝑡𝑡𝑡𝑡)
𝑓𝑓𝑚𝑚𝑚𝑚𝑚𝑚 = 𝑎𝑎𝑚𝑚𝑚𝑚𝑚𝑚 − 𝜀𝜀 (𝑡𝑡𝑡𝑡) (21)

Epilepsy warning = Formula 18 OR Formula 19


Epilepsy Attack = 18 OR 19 * 15 second,

The obtain result of the proposed mathematical model approach can be implantation for

WSN-EEG as an epilepsy prediction and diagnose model or as new tool in the EEG system.

Das könnte Ihnen auch gefallen