8
8
On
BY
GROUP 8
KANCHAN (2021A3PS2185H)
HYDERABAD CAMPUS
(SEPTEMBER 2024)
ACKNOWLEDGMENTS
I take this opportunity to thank Prof. Ravi Kiran., my Instructor in Charge, for
placing his trust in my work and for all the guidance, help, and encouragement
throughout the semester. I sincerely thank all my colleagues in the Electrical
Engineering department for providing me with various opportunities to learn.
2
Contributions
3
ABSTRACT
Epileptic seizures are random, and most epileptic patients experience dangerous
physical symptoms during an attack that render the patient uneasy when
conducting their daily tasks hence epilepsy detection is a critical area in medical
research, requiring accurate and efficient classification of seizure types to improve
diagnosis and patient outcomes. This report presents a novel approach utilizing
Adaptive Neuro-Fuzzy Inference Systems (ANFIS) to classify epilepsy types
based on multi-signal analysis, incorporating EEG, ECG, EMG, and
accelerometer data. Unlike previous studies that relied on limited signals or
insufficient preprocessing techniques, our method integrates advanced denoising,
feature extraction, and encoding processes to enhance accuracy and reduce false
alarms. The proposed model achieved a minimal training RMSE of 0.407216 and
an average testing error of 0.33486, outperforming state-of-the-art solutions by
leveraging the critical insights from EEG data alongside other physiological
signals. Comparative analysis highlights how the inclusion of multi-signal inputs
and the use of ANFIS address the limitations of earlier approaches, such as high
false alarm rates and insufficient feature integration. The results demonstrate that
our solution not only achieves superior classification performance but also
establishes a robust framework for reducing false alarms and improving seizure
detection accuracy, making it a promising advancement in the field of epilepsy
diagnostics.
4
CONTENTS
Title page ............................................................................................. 1
Acknowledgements ............................................................................... 2
Contributions ........................................................................................ 3
Abstract ................................................................................................ 4
1. Introduction…………………………………….6
2. Methodology……………………………………7-12
2.2 Framework……………………………...8-12
Conclusion .............................................................................................19
References………………………………………………………………20
5
1. Introduction
The fast improvement of the Internet of Things (IoT) innovation makes it
possible to associate different objects together through the Internet and to provide
more information on interoperability techniques for application purposes [1].
More potential uses of IoT in data- intensive modern domains, such as medical
care services, are being investigated. With the help of the Internet of Things and
developments in sensor technology, monitoring epilepsy patients has never been
easier with IoT assistance [2]. Epilepsy is one of the most common neurological
disorders, affecting approximately 50 million people worldwide. Seizures occur
suddenly, and without proper monitoring, they can lead to severe injuries or life-
threatening complications [2]. Traditional methods for monitoring epileptic
patients rely on manual observation or hospital-based systems, which are limited
by their inability to continuously monitor patients outside of clinical settings.
6
2. Methodology
Data for this study was organized by generating synthetic signals simulating EEG,
ECG, EMG, and accelerometer measurements.
3. Label Encoding: Seizure types were numerically encoded for compatibility with
ANFIS.
4. Classification: ANFIS was employed to classify the data with high accuracy,
reducing false alarms by learning complex patterns in the data.
In this work, sensor output data representing patient behaviors is used as input for
the ANFIS logic system. Simulations are conducted using MATLAB script
commands to identify membership functions for each input. The Sugeno-type
inference system is employed to model the fuzzy relationships between input
signals and epilepsy classification. These relationships are expressed using a set
of IF-THEN rules, such as:
where Mji and N represent fuzzy sets for the inputs Xi and output y, respectively.
The premise (IF part) defines the input conditions, while the conclusion (THEN
part) determines the output classification.
This system's fuzzification process transforms crisp input values into fuzzy values
based on defined membership functions. The inference engine evaluates these
fuzzy inputs against rules to determine the output. Finally, defuzzification
converts the fuzzy output back into a crisp value for classification. The
defuzzification process uses the centroid method, providing a robust decision-
making process. Inputs such as "EEG," "ECG," "TEMP," and "ACC" are
processed to derive context-aware classification results, reducing false alarms and
enhancing accuracy.
7
2.2 Framework
The processed signal data is classified into seizure and non-seizure events
using an ANFIS framework.
Fuzzy rules are defined based on medical insights, such as:
o IF heart rate increases AND muscle spasms are detected, THEN
seizure is likely.
o IF EEG activity shows high spikes AND the accelerometer detects a
fall, THEN classify as a tonic-clonic seizure.
8
This project's ANFIS (Adaptive Neuro-Fuzzy Inference System) model is
designed to classify epilepsy types by processing physiological data collected
from multiple sources, including EEG, ECG, EMG, and accelerometer
signals.
The inputs to the system are statistical features extracted from these signals,
as shown in Figure 1, such as mean and standard deviation, which capture
critical variations indicative of seizure activity.
0: Focal Seizure
1: Generalized Seizure
2: Absence Seizure
3: Non-Epileptic
Membership Functions
Gaussian membership functions are defined for each input, which provides
smooth transitions between fuzzy sets and facilitates accurate classification.
For instance, EEG spike patterns will be mapped into low, Moderate, and
High fuzzy sets. Accelerometer readings could be mapped to stationary,
normal, and jerky movements. Different types of membership functions can
be used. For example, in Figure 3, a triangle type of MF is used.
9
Figure 3: Input membership functions for ANFIS.
Figure 4 shows the output membership functions, which are of constant type.
The fuzzy inference system uses a set of IF-THEN rules derived from expert
medical knowledge. These rules link the input conditions (e.g., signal
features) to the output classifications. Examples include:
IF EEG activity is High AND Muscle Spasms are Detected THEN classify as
Generalized Seizure.
10
Figure 5: Rules for ANFIS.
The ANFIS model combines fuzzy logic with neural network principles to
tune membership functions and optimize the fuzzy rule base. Key tuning
processes include:
Classification Process
Fuzzification: The system converts crisp input features (e.g., statistical values
of signals) into fuzzy values using the defined membership functions.
Inference Engine: The fuzzy inference mechanism evaluates the input data
against the set of rules to generate fuzzy output values.
11
Defuzzification: The fuzzy outputs are converted back into crisp values using
the centroid method, providing the final classification of epilepsy type.
3. Real-Time Simulations:
12
3. Comparison with State-of-the-Art Solutions
Our implemented ANFIS-based epilepsy detection model was compared
against existing state-of-the-art solutions.
The comparison highlights the model's performance regarding testing error,
RMSE, and classification accuracy.
The average testing error achieved was 0.33486, demonstrating our approach's
effectiveness compared to other methods.
Key Approach:
- Utilized ECG, EMG, and accelerometer sensors to detect seizure events.
- Relied on a fuzzy logic controller for decision-making, using simple IF-THEN
rules.
- Focused on generalized seizures, with alerts sent to caregivers via IoT
platforms.
Limitations:
- Did not include EEG data, which is critical for identifying brainwave
abnormalities associated with seizures.
- Limited preprocessing, leading to higher noise in signals.
- Prone to false alarms due to simplistic decision-making rules.
Key Approach:
- Focused on wearable detection systems using ECG, accelerometer, and
temperature sensors.
- Employed rule-based decision-making for seizure classification.
- Highlighted low-cost and user-friendly hardware solutions.
Limitations:
- Excluded EEG data, missing critical neurological insights necessary for
13
comprehensive seizure detection.
- Rule-based classification often misinterpreted non-seizure activities, leading to
high false positives.
- Lack of advanced feature extraction limited system adaptability and accuracy.
Key Approach:
- Used accelerometers and vibration sensors for motion-based seizure detection.
- Integrated Bluetooth connectivity for real-time alerts to caregivers via mobile
applications.
- Developed user-friendly features like false alarm and panic buttons.
Limitations:
- Heavy reliance on hardware, including vibration sensors and smartphone
connectivity, limits flexibility.
- No EEG integration, which restricts detection to motor-based seizures,
excluding absence or focal seizures.
- Threshold-based algorithms lacked sophistication, causing frequent false
positives.
14
3.1 Summary Table of Comparison:
15
4. Results and Discussions
The following results demonstrate the performance of our solution in epilepsy
detection. The minimal training RMSE was 0.407216, with testing error reduced
to an average of 0.33486.
Below are the results demonstrating the performance of our approach. The
minimal training RMSE achieved was 0.407216, and the average testing error was
reduced to 0.33486. This highlights the effectiveness of our solution in classifying
epilepsy types with reduced false alarms.
The Figures 1 and 2 show the training and testing of ANFIS model in Matlab
simulation environment.
16
Figure 3: Training Data for ANFIS.
17
Figure 5: Output of ANFIS for Training and Testing Data
The above figures 3,4 and 5 show the training and testing datasets for ANFIS
model. The output of ANFIS is classified in 4 types. They are: Focal seizure – 0,
Generalized Seizure – 1, Absence Seizure – 2, Non-Epileptic – 3.
Each of these seizures are classified based on the variance of data and ANFIS
creates learning weights which help in classifiying these seizures.
18
Conclusion
Our solution significantly improves upon prior work by leveraging multi-
signal integration, denoising techniques, and the ANFIS classifier.
This IoT-based system provides a highly accurate and reliable solution for
monitoring epileptic patients. While it offers significant improvements in accuracy
and flexibility compared to previous solutions, further testing in real-world
environments is needed to ensure robustness and minimize false alarms.
19
References
[1] B.D. Chung Hua, H. Fahmi, L. Yuhao, C.C. Kiong, A. Harun, Internet of things (IoT) monitoring system
for elderly, in Int. Conf. Intell. Adv. Syst. ICIAS 2018, 2018, pp. 1–6, no. August 2018.
[2] I. Lee, K. Lee, The Internet of things (IoT): applications, investments, and challenges for enterprises, Bus.
Horiz. 58 (4) (2015) 431–440.
20
PROBLEMS IDENTIFIED AND TO BE WORKED ON:
● Goal: Add EEG sensors to the device to directly monitor brainwave activity for
more comprehensive seizure detection, especially for non-convulsive seizures
like absence seizures.
● Goal: Develop strategies to improve power efficiency for both the wearable
device and the connected smartphone.