\documentclass[11pt,twoside]{article}\makeatletter

\IfFileExists{xcolor.sty}%
  {\RequirePackage{xcolor}}%
  {\RequirePackage{color}}
\usepackage{colortbl}
\usepackage{wrapfig}
\usepackage{ifxetex}
\ifxetex
  \usepackage{fontspec}
  \usepackage{xunicode}
  \catcode`⃥=\active \def⃥{\textbackslash}
  \catcode`❴=\active \def❴{\{}
  \catcode`❵=\active \def❵{\}}
  \def\textJapanese{\fontspec{Noto Sans CJK JP}}
  \def\textChinese{\fontspec{Noto Sans CJK SC}}
  \def\textKorean{\fontspec{Noto Sans CJK KR}}
  \setmonofont{DejaVu Sans Mono}
  
\else
  \IfFileExists{utf8x.def}%
   {\usepackage[utf8x]{inputenc}
      \PrerenderUnicode{–}
    }%
   {\usepackage[utf8]{inputenc}}
  \usepackage[english]{babel}
  \usepackage[T1]{fontenc}
  \usepackage{float}
  \usepackage[]{ucs}
  \uc@dclc{8421}{default}{\textbackslash }
  \uc@dclc{10100}{default}{\{}
  \uc@dclc{10101}{default}{\}}
  \uc@dclc{8491}{default}{\AA{}}
  \uc@dclc{8239}{default}{\,}
  \uc@dclc{20154}{default}{ }
  \uc@dclc{10148}{default}{>}
  \def\textschwa{\rotatebox{-90}{e}}
  \def\textJapanese{}
  \def\textChinese{}
  \IfFileExists{tipa.sty}{\usepackage{tipa}}{}
\fi
\def\exampleFont{\ttfamily\small}
\DeclareTextSymbol{\textpi}{OML}{25}
\usepackage{relsize}
\RequirePackage{array}
\def\@testpach{\@chclass
 \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
  \ifnum \@lastchclass=7 5 \else
   \ifnum \@lastchclass=8 \tw@ \else
    \ifnum \@lastchclass=9 \thr@@
   \else \z@
   \ifnum \@lastchclass = 10 \else
   \edef\@nextchar{\expandafter\string\@nextchar}%
   \@chnum
   \if \@nextchar c\z@ \else
    \if \@nextchar l\@ne \else
     \if \@nextchar r\tw@ \else
   \z@ \@chclass
   \if\@nextchar |\@ne \else
    \if \@nextchar !6 \else
     \if \@nextchar @7 \else
      \if \@nextchar (8 \else
       \if \@nextchar )9 \else
  10
  \@chnum
  \if \@nextchar m\thr@@\else
   \if \@nextchar p4 \else
    \if \@nextchar b5 \else
   \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
   \fi \fi  \fi  \fi  \fi  \fi  \fi \fi \fi \fi \fi \fi}
\gdef\arraybackslash{\let\\=\@arraycr}
\def\@textsubscript#1{{\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}
\def\Panel#1#2#3#4{\multicolumn{#3}{){\columncolor{#2}}#4}{#1}}
\def\abbr{}
\def\corr{}
\def\expan{}
\def\gap{}
\def\orig{}
\def\reg{}
\def\ref{}
\def\sic{}
\def\persName{}\def\name{}
\def\placeName{}
\def\orgName{}
\def\textcal#1{{\fontspec{Lucida Calligraphy}#1}}
\def\textgothic#1{{\fontspec{Lucida Blackletter}#1}}
\def\textlarge#1{{\large #1}}
\def\textoverbar#1{\ensuremath{\overline{#1}}}
\def\textquoted#1{‘#1’}
\def\textsmall#1{{\small #1}}
\def\textsubscript#1{\@textsubscript{\selectfont#1}}
\def\textxi{\ensuremath{\xi}}
\def\titlem{\itshape}
\newenvironment{biblfree}{}{\ifvmode\par\fi }
\newenvironment{bibl}{}{}
\newenvironment{byline}{\vskip6pt\itshape\fontsize{16pt}{18pt}\selectfont}{\par }
\newenvironment{citbibl}{}{\ifvmode\par\fi }
\newenvironment{docAuthor}{\ifvmode\vskip4pt\fontsize{16pt}{18pt}\selectfont\fi\itshape}{\ifvmode\par\fi }
\newenvironment{docDate}{}{\ifvmode\par\fi }
\newenvironment{docImprint}{\vskip 6pt}{\ifvmode\par\fi }
\newenvironment{docTitle}{\vskip6pt\bfseries\fontsize{22pt}{25pt}\selectfont}{\par }
\newenvironment{msHead}{\vskip 6pt}{\par}
\newenvironment{msItem}{\vskip 6pt}{\par}
\newenvironment{rubric}{}{}
\newenvironment{titlePart}{}{\par }

\newcolumntype{L}[1]{){\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}[1]{){\centering\arraybackslash}p{#1}}
\newcolumntype{R}[1]{){\raggedleft\arraybackslash}p{#1}}
\newcolumntype{P}[1]{){\arraybackslash}p{#1}}
\newcolumntype{B}[1]{){\arraybackslash}b{#1}}
\newcolumntype{M}[1]{){\arraybackslash}m{#1}}
\definecolor{label}{gray}{0.75}
\def\unusedattribute#1{\sout{\textcolor{label}{#1}}}
\DeclareRobustCommand*{\xref}{\hyper@normalise\xref@}
\def\xref@#1#2{\hyper@linkurl{#2}{#1}}
\begingroup
\catcode`\_=\active
\gdef_#1{\ensuremath{\sb{\mathrm{#1}}}}
\endgroup
\mathcode`\_=\string"8000
\catcode`\_=12\relax

\usepackage[a4paper,twoside,lmargin=1in,rmargin=1in,tmargin=1in,bmargin=1in,marginparwidth=0.75in]{geometry}
\usepackage{framed}

\definecolor{shadecolor}{gray}{0.95}
\usepackage{longtable}
\usepackage[normalem]{ulem}
\usepackage{fancyvrb}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{marginnote}

\renewcommand{\@cite}[1]{#1}


\renewcommand*{\marginfont}{\itshape\footnotesize}

\def\Gin@extensions{.pdf,.png,.jpg,.mps,.tif}

  \pagestyle{fancy}

\usepackage[pdftitle={Study of EEG Signal for Epilepsy Detection and Localization using Bagged Tree and SVM Algorithms},
 pdfauthor={}]{hyperref}
\hyperbaseurl{}

	 \paperwidth210mm
	 \paperheight297mm
              
\def\@pnumwidth{1.55em}
\def\@tocrmarg {2.55em}
\def\@dotsep{4.5}
\setcounter{tocdepth}{3}
\clubpenalty=8000
\emergencystretch 3em
\hbadness=4000
\hyphenpenalty=400
\pretolerance=750
\tolerance=2000
\vbadness=4000
\widowpenalty=10000

\renewcommand\section{\@startsection {section}{1}{\z@}%
     {-1.75ex \@plus -0.5ex \@minus -.2ex}%
     {0.5ex \@plus .2ex}%
     {\reset@font\Large\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
     {-1.75ex\@plus -0.5ex \@minus- .2ex}%
     {0.5ex \@plus .2ex}%
     {\reset@font\Large}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
     {-1.5ex\@plus -0.35ex \@minus -.2ex}%
     {0.5ex \@plus .2ex}%
     {\reset@font\large}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
     {-1ex \@plus-0.35ex \@minus -0.2ex}%
     {0.5ex \@plus .2ex}%
     {\reset@font\normalsize}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
     {1.5ex \@plus1ex \@minus .2ex}%
     {-1em}%
     {\reset@font\normalsize\bfseries}}


\def\l@section#1#2{\addpenalty{\@secpenalty} \addvspace{1.0em plus 1pt}
 \@tempdima 1.5em \begingroup
 \parindent \z@ \rightskip \@pnumwidth 
 \parfillskip -\@pnumwidth 
 \bfseries \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}\par
 \endgroup}
\def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
\def\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
\def\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
\def\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
\@ifundefined{c@section}{\newcounter{section}}{}
\@ifundefined{c@chapter}{\newcounter{chapter}}{}
\newif\if@mainmatter 
\@mainmattertrue
\def\chaptername{Chapter}
\def\frontmatter{%
  \pagenumbering{roman}
  \def\thechapter{\@roman\c@chapter}
  \def\theHchapter{\roman{chapter}}
  \def\thesection{\@roman\c@section}
  \def\theHsection{\roman{section}}
  \def\@chapapp{}%
}
\def\mainmatter{%
  \cleardoublepage
  \def\thechapter{\@arabic\c@chapter}
  \setcounter{chapter}{0}
  \setcounter{section}{0}
  \pagenumbering{arabic}
  \setcounter{secnumdepth}{6}
  \def\@chapapp{\chaptername}%
  \def\theHchapter{\arabic{chapter}}
  \def\thesection{\@arabic\c@section}
  \def\theHsection{\arabic{section}}
}
\def\backmatter{%
  \cleardoublepage
  \setcounter{chapter}{0}
  \setcounter{section}{0}
  \setcounter{secnumdepth}{2}
  \def\@chapapp{\appendixname}%
  \def\thechapter{\@Alph\c@chapter}
  \def\theHchapter{\Alph{chapter}}
  \appendix
}
\newenvironment{bibitemlist}[1]{%
   \list{\@biblabel{\@arabic\c@enumiv}}%
       {\settowidth\labelwidth{\@biblabel{#1}}%
        \leftmargin\labelwidth
        \advance\leftmargin\labelsep
        \@openbib@code
        \usecounter{enumiv}%
        \let\p@enumiv\@empty
        \renewcommand\theenumiv{\@arabic\c@enumiv}%
	}%
  \sloppy
  \clubpenalty4000
  \@clubpenalty \clubpenalty
  \widowpenalty4000%
  \sfcode`\.\@m}%
  {\def\@noitemerr
    {\@latex@warning{Empty `bibitemlist' environment}}%
    \endlist}

\def\tableofcontents{\section*{\contentsname}\@starttoc{toc}}
\parskip0pt
\parindent1em
\def\Panel#1#2#3#4{\multicolumn{#3}{){\columncolor{#2}}#4}{#1}}
\newenvironment{reflist}{%
  \begin{raggedright}\begin{list}{}
  {%
   \setlength{\topsep}{0pt}%
   \setlength{\rightmargin}{0.25in}%
   \setlength{\itemsep}{0pt}%
   \setlength{\itemindent}{0pt}%
   \setlength{\parskip}{0pt}%
   \setlength{\parsep}{2pt}%
   \def\makelabel##1{\itshape ##1}}%
  }
  {\end{list}\end{raggedright}}
\newenvironment{sansreflist}{%
  \begin{raggedright}\begin{list}{}
  {%
   \setlength{\topsep}{0pt}%
   \setlength{\rightmargin}{0.25in}%
   \setlength{\itemindent}{0pt}%
   \setlength{\parskip}{0pt}%
   \setlength{\itemsep}{0pt}%
   \setlength{\parsep}{2pt}%
   \def\makelabel##1{\upshape ##1}}%
  }
  {\end{list}\end{raggedright}}
\newenvironment{specHead}[2]%
 {\vspace{20pt}\hrule\vspace{10pt}%
  \phantomsection\label{#1}\markright{#2}%

  \pdfbookmark[2]{#2}{#1}%
  \hspace{-0.75in}{\bfseries\fontsize{16pt}{18pt}\selectfont#2}%
  }{}
      \def\TheFullDate{2019-01-15 (revised: 15 January 2019)}
\def\TheID{\makeatother }
\def\TheDate{2019-01-15}
\title{Study of EEG Signal for Epilepsy Detection and Localization using Bagged Tree and SVM Algorithms}
\author{}\makeatletter 
\makeatletter
\newcommand*{\cleartoleftpage}{%
  \clearpage
    \if@twoside
    \ifodd\c@page
      \hbox{}\newpage
      \if@twocolumn
        \hbox{}\newpage
      \fi
    \fi
  \fi
}
\makeatother
\makeatletter
\thispagestyle{empty}
\markright{\@title}\markboth{\@title}{\@author}
\renewcommand\small{\@setfontsize\small{9pt}{11pt}\abovedisplayskip 8.5\p@ plus3\p@ minus4\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus2\p@
\belowdisplayshortskip 4\p@ plus2\p@ minus2\p@
\def\@listi{\leftmargin\leftmargini
               \topsep 2\p@ plus1\p@ minus1\p@
               \parsep 2\p@ plus\p@ minus\p@
               \itemsep 1pt}
}
\makeatother
\fvset{frame=single,numberblanklines=false,xleftmargin=5mm,xrightmargin=5mm}
\fancyhf{} 
\setlength{\headheight}{14pt}
\fancyhead[LE]{\bfseries\leftmark} 
\fancyhead[RO]{\bfseries\rightmark} 
\fancyfoot[RO]{}
\fancyfoot[CO]{\thepage}
\fancyfoot[LO]{\TheID}
\fancyfoot[LE]{}
\fancyfoot[CE]{\thepage}
\fancyfoot[RE]{\TheID}
\hypersetup{citebordercolor=0.75 0.75 0.75,linkbordercolor=0.75 0.75 0.75,urlbordercolor=0.75 0.75 0.75,bookmarksnumbered=true}
\fancypagestyle{plain}{\fancyhead{}\renewcommand{\headrulewidth}{0pt}}

\date{}
\usepackage{authblk}

\providecommand{\keywords}[1]
{
\footnotesize
  \textbf{\textit{Index terms---}} #1
}

\usepackage{graphicx,xcolor}
\definecolor{GJBlue}{HTML}{273B81}
\definecolor{GJLightBlue}{HTML}{0A9DD9}
\definecolor{GJMediumGrey}{HTML}{6D6E70}
\definecolor{GJLightGrey}{HTML}{929497} 

\renewenvironment{abstract}{%
   \setlength{\parindent}{0pt}\raggedright
   \textcolor{GJMediumGrey}{\rule{\textwidth}{2pt}}
   \vskip16pt
   \textcolor{GJBlue}{\large\bfseries\abstractname\space}
}{%   
   \vskip8pt
   \textcolor{GJMediumGrey}{\rule{\textwidth}{2pt}}
   \vskip16pt
}

\usepackage[absolute,overlay]{textpos}

\makeatother 
      \usepackage{lineno}
      \linenumbers
      
\begin{document}

             \author[1]{Mostafa A.  Abd-ElBaset}

             \author[2]{Sherif H.  ElGohary}

             \affil[1]{  Cairo University}

\renewcommand\Authands{ and }

\date{\small \em Received: 11 December 2018 Accepted: 4 January 2019 Published: 15 January 2019}

\maketitle


\begin{abstract}
        


Epilepsy is considered one of the common medical and social disorders with unique characteristics.  EEG signal was used for the classification and detection of epilepsy. This study proposed epilepsy classification without signal decomposition, as well as other algorithms used for decomposing the EEG signal to sub-bands like discrete wavelet transform (DWT) and dual-tree complex wavelet transform (DT-CWT). Descriptive comparisons were done between results for EEG signals with/without decomposition. The proposed algorithm includes the study of the extracted features and using machine learning kernels as Support Vector Machine (SVM) and bagged tree to achieve the optimal values of (accuracy-specificity-sensitivity and execution time). Results show that adding the line length to the group of features, the accuracy increased to 99.4%. By employing decomposing the EEG signal, the accuracy could be raised to99.875 % even after reducing the number of features to only three features. These features are line length, STD, and mean.  This study proposed different algorithms with minimum features for epilepsy classification and localization with optimum execution time.

\end{abstract}


\keywords{}

\begin{textblock*}{18cm}(1cm,1cm) % {block width} (coords) 
\textcolor{GJBlue}{\LARGE Global Journals \LaTeX\ JournalKaleidoscope\texttrademark}
\end{textblock*}

\begin{textblock*}{18cm}(1.4cm,1.5cm) % {block width} (coords) 
\textcolor{GJBlue}{\footnotesize \\ Artificial Intelligence formulated this projection for compatibility purposes from the original article published at Global Journals. However, this technology is currently in beta. \emph{Therefore, kindly ignore odd layouts, missed formulae, text, tables, or figures.}}
\end{textblock*}


\let\tabcellsep& 	 	 		 
\section[{INTRODUCTION}]{INTRODUCTION} 
\section[{lectroencephalographic}]{lectroencephalographic}\par
(EEG)provides the electrical action potentials produced by cerebral cortex neurons  {\ref [1]}. The ease of use and noninvasive technique gives the power to EEG to be widely used to diagnose brain diseases such as (autismepilepsy-head injury-dementia-brain tumors, etc?).\par
Epilepsy is a type of neurological disease. It is ranked as second most rife neurological disorder in humans, with around 40-50 million people in the world suffer from epilepsy  {\ref [2]}. A seizure is a paroxysmal event happening due to hyper synchronous, excessive neuronal discharges  {\ref [3]}. The scalp EEG is a test used for the clinical diagnoses of Epilepsy  {\ref [4,} {\ref 5]}. Automatic detection of seizure began in the 1970s and various methods addressing this problem have been presented  {\ref [6]}. Ling Guo introduced line length feature extracted from the EEG signal after discrete wavelet transform and utilized the artificial neural network as a classifier \hyperref[b0]{[7]}. B. Suguna Nanthini et al. \hyperref[b1]{[8]} perform automatic detection for seizure by using Shannon Entropy. They decomposed the EEG signal and utilized SVM for classification. Manisha Chandani et al. \hyperref[b2]{[9]} applied DWT for decomposition and two classifiers (SVM and Author ? ?: Biomedical and System Engineering Department, Cairo University, Giza 12613, Egypt. e-mail: sh.elgohary@eng1.cu.edu.eg Multilayer Perceptron Neural network) \hyperref[b1]{[8,}\hyperref[b2]{9]}. They represented their detection only on sets Z and S from database which introduced by (Andrzejak et al.) \hyperref[b3]{[10]}. DWT has been used to decompose each channel signal to sub-bands. Various wavelet types have been employed such as (Daubechies, Haar, Coiflets, and Reverse Bior) with different levels. Moreover, a comparison between the wavelet types will be represented to select the optimum wavelet and level. A distinct technique was used for decomposition as DT-CWT which separates the real and imaginary parts of each signal and decomposes them by different filters. Then, line length was extracted from each sub-band in both cases (DWT and DT-CWT). After signal processing and feature extraction, the features were applied to the machine learning algorithms to classify the signal to normal or abnormal. This work introduced epilepsy classification method with optimum accuracy and execution time. Moreover, detection of the focal area will lead to estimate the location of the epilepsy source. 
\section[{II.}]{II.} 
\section[{MATERIAL AND METHODS a) Dataset Description}]{MATERIAL AND METHODS a) Dataset Description}\par
There are two different datasets. The first one which described by Andrzejac et al. \hyperref[b3]{[10]}, is employed to study the classification algorithms and the important features to be extracted. The second data set was used for applying the best technique in epilepsy classification and for localization. The first dataset consists of five sets (Z, O, N, F, and S) each set has recorded from five patients. Each patient has 20 channels sampled at 173.61Hzusing 12-bits resolution. All EEG recording was preprocessed with the same 128 channel amplifier. Number of points in each signal is 4097 points with duration of 23.6 seconds. First set is Z which represented normal EEG with the eye open and taken from scalp. Set O had been recorded from the scalp but with the eye closed. Sets N, F, S were measured via intracranial electrodes. N recorded from the epileptogenic zone but F from the opposite side both at seizure-free interval. Finally, set S was taken from the epileptogenic zone but during seizure activity. The entire five datasets were filtered by filter 0.53-40 Hz band-pass and examined by a physician, as shown in figure \hyperref[fig_1]{1}.The second data set was collected by Warsaw memorial child hospital \hyperref[b5]{[12]}. It contains records of 23 patients with severe epilepsy, mostly caused by different lesions. The patients aged 1-18 years. EEG was taken by a 10-20 system with 19 electrodes sampled at 250 HZ. The hardware reference was "fpz" channel. Physicians examined each data set recording and put markers at the seizure period. With each patient, there is an MRI image that locate the focal area of epilepsy in the brain. A random EEG signal to patient id "Chimic" shown in figure  {\ref 2}, and the seizure period marked by physicians. 
\section[{b) Discrete wavelet transforms (DWT) Analysis}]{b) Discrete wavelet transforms (DWT) Analysis}\par
Recently, a discrete wavelet transform (DWT) widely applied in many engineering fields for solving various real-life problems \hyperref[b4]{[11]}. DWT equation is shown below \hyperref[b6]{[13]}:DWT (j,k) = 2 ?j 2 ? ??(??)??( ?? ? 2 ?? ?? 2 ?? ? ?? ) ???? (1)\par
Fig.  {\ref 2}: EEG signals from patient id "Chimic"\par
We used various wavelets techniques such as Daubechies (dB), Haar, Coiflets, and Reverse Bior. Selecting the optimum technique and order is our aim to be the input of the feature extraction stage. The wavelet type evaluation depends on the execution time of signal decomposition and parameters such as (accuracy, specificity, sensitivity) of the classification algorithms. 
\section[{c) Analysis with double-tree complex wavelet transforms (DT-CWT)}]{c) Analysis with double-tree complex wavelet transforms (DT-CWT)}\par
DWT has certain limitations, first a small change in input signal will lead to a large change in wavelet coefficients. Second, it has poor directional selectivity \hyperref[b7]{[14]}.ð??"ð??" 0 (??) = ? 0 (?? ? 0.5) (2)\par
DT-CWT decomposes the EEG signal to complex wavelet function and scaling function. ?? ?? is the complex wavelet function transform and described by Equation (3). Where ?? ?? , the real part, is related to the upper tree, and ?? ?? is the imaginary part that related to the lower tree.?? ?? (??) = ?? ?? (??) + ???? ?? (??) (3)\par
The scaling function ? ?? was represented by equation (4), where (? ?? , ? ?? ) for real and imaginary part, respectively. "t" is the time domain transformation. Where: ?? is the given mother wavelet, J is the scale parameters, and k is the shift parameter. ??(??) is the signal in the time domain. Equation (1) shows the signal decomposition to sub-bands. DWT is an efficient method to decompose the EEG signal to sub-bands by applying a set of low-pass filters g(n) and high-pass filters h(n) on the signal as shown in Figure  {\ref .}3. This operation repeated the same value as the choosing level. We choose the level to be four that generates five sub-bands, as described in Table  {\ref 1}.\par
To overcome those limitations, we introduced DT-CWT, as shown in Figure \hyperref[fig_3]{4}. A group of low-pass and high-pass filters used for decomposition. This process repeated until the system reaches 4 th stage. The upper part of the tree for the real part (? 0, ? 1 ) where ? 0 for low pass filters and ? 1 for high pass filters. The lower part of thetree for the imaginary part (ð??"ð??" 0 , ð??"ð??" 1 )where ð??"ð??" 0 for lowpass filters and ð??"ð??" 1 for high-pass filters. Equation (2) shows the relation between the upper tree and the lower tree. Where the upper filters and the lower filters are half sampled delay as follow:   
\section[{d) Feature Extraction}]{d) Feature Extraction}\par
Detection of epileptic seizures depends on two types of features driven from signal's amplitude, such as (Min, Max, etc?) and the frequency features. High accuracy results achieved from a combination of amplitude and frequency features such as line length "LL.".\par
The features included in our study in EEG signal without decomposition were (Min, Max, Mean, Median, Mode, 1st quartile, 3rd quartile, Inter Quartile Rang (IQR), Standard division (STD), and LL. However, we applied the line length feature to the decomposition signal in all sub-bands.\par
Line length is a parameter to measure signal complexity or waveform fractal dimension, and it's like Katz's fractal dimension, as stated in \hyperref[b0]{[7,}\hyperref[b8]{15]}, and describes in Equation (5).???? = 1 ?? ? 1 ? ??????(?? ??+1 ? ?? ?? ) ???1 ??=1\textbf{(5)}\par
Where, X stands for the signal, N is the total number of samples and I is the signal samples indices. 
\section[{e) Epilepsy Classification}]{e) Epilepsy Classification}\par
Classifying data is a vital task in machine learning algorithms. Support vector machine (SVM) was used to assort not only linear classification but also nonlinear classification by using the Kernel trick, which is Transforming data into another dimension that has a clear dividing margin between all classes of data.??(??, ??) = ???? + ?? 2 ?? 2 (6)\par
Equation (  {\ref 6}) describes the kernel trick using a kernel function K(x, y) where the training points mapped to a 3-dimensional space where a separating hyperplane can be easily detected \hyperref[b1]{[8]}. There are several types of SVM (linear-quadratic, cubic, fine Gaussian, medium Gaussian, coarse). Bagged trees algorithm will be introduced on this work. Bagging is a method for enhancing the results of machine learning classification algorithms. This technique leads to classify epilepsy, and reduces the variance, which helps to avoid over fitting problem \hyperref[b2]{[9]}.\par
Four channels from the normal persons and nine channels from the patients are used to build the learning dataset. Cross-validation was utilized with five folds. A twenty randomly channels from sets (Z, O, N, F, S) will be classified. Finally, obtain Accuracy, Specificity, Sensitivity, and execution time). As shown in Equations \hyperref[b0]{(7,}\hyperref[b1]{8,}\hyperref[b2]{9)}.Accuracy (??????) = ????+???? ????+????+????+???? (7) Specificity (????) = ???? ????+???? (8) Sensitivity (????) = ???? ????+???? (9)\par
Where, TP, TN, is the true positive and true negative, respectively. FP, FN, is the false positive and false negative, respectively. Execution time is the elapsed time that the program used only for classification. The computer hardware was CORE i5 with 4 GB ram.\par
We used four types of classification. Type I is performed on the ten features without DWT. While type II performed on the better of two classifiers without, the line length feature and decomposition. While type III executed on line length feature only for the five subbands after DWT. Finally, type VI, DT-CWT applied with level four and line length feature. A proposed algorithm was built to take each sub-band and divided it into sub-signals. Sixty-four points were chosen to be the length of each sub-signal. The output will be a matrix [m, n] (m) is rows which equals 64 that is the total number of segments, and (n) is the column that will be the total number of features.\par
f) The Localization EEG LAB is utilized as an open-source Matlab toolbox used for EEG signal analysis. The feature extraction and plotting procedure of the spectra in the time domain and frequency domains added to the opensource code. Moreover, EEGLAB will be edited to generate a heat map 2D model of the scalp that represents the area that caused the seizure.\par
ii. Classification The classification procedure started to estimate the variation of amplitude in all channels. As the variation of all channels amplitude occurred, that will be a sign of the seizure period as seen in figure. 5.   
\section[{iii. EEG Mapping and Localization}]{iii. EEG Mapping and Localization}\par
After finishing classification, the tool will localize the most affected channel in amplitude and plot a heat map model to the scalp that appears the affected area in more red color and less affected area in blue. Then, we validated the affected area generated by our system with the area determined by the physician on MRI image, as seen in figure. 6. 
\section[{III. RESULTS AND DISCUSSION}]{III. RESULTS AND DISCUSSION}\par
A classifier evaluation procedure performed to select DWT types. Table \hyperref[tab_0]{2} shows the results of the types of SVM and Bagged tree algorithms while using ten features without using signal decomposition methods. Medium Gaussian SVM and Bagged tree improves the accuracy for classification. Table \hyperref[tab_1]{3} shows the change in the result while not using line length and only use the nine features (Min, Max, Mean, Median, Mode, STD, 1 st    DWT is applied to the signal and extracts the line length feature from the five sub-bands, as in table.4. Reducing the number of features from ten to only five will have a massive effect on the execution time, particularly on the bagged tree algorithm. Table \hyperref[tab_4]{5 and 6} show different types of DWT and their orders. Table \hyperref[tab_3]{5} shows medium and fine Gaussian SVM results for db and coif with 4 th order and Coif at the optimum level. When the order increases the execution time increases too, while the accuracy stay the same.\par
Table \hyperref[tab_4]{6} shows the effect of different types and orders of DWT on the bagged tree algorithm. A comparison in accuracy between Db4 and Coif 4 both almost the same, but the execution time of Db was a little bit better. Moreover, we applied DT-CWT to the signal, and line length feature extracted from different levels as declared in table \hyperref[tab_5]{7}.  DT-CWT gives the optimum classification result with the fine Gaussian SVM as it uses the real and imaginary parts of the signal but with higher execution time. Wavelet types in DWT show improvement in the classification accuracy.\par
Therefore, choosing the optimal wavelet type will enhance the final result. Moreover, Median-SVM and bagged trees give the best result compared with the related work.\par
Table \hyperref[tab_6]{8} shows a comparison between the proposed method and literature reviews done on the same dataset. Previously, some researchers evaluate their work only by set Z, and S. However, this work utilized all different sets Z, O, N, F as normal person dataset and S as patient dataset.\par
After using the localization procedure on the second dataset, a heat map model is most similar to the MRI image. Figure 7 shows the heat map at different seizure periods.  
\section[{CONCLUSION}]{CONCLUSION}\par
Seizure detection is a significant step for epilepsy classification. This work shows that decomposing the EEG signal enhancing the evaluation parameters result. Utilizing DT-CWT in signal decomposition and fine Gaussian SVM will improve the SP and SE of classification, but the execution time was higher as a comparison with DWT. The classification execution time is vital as the classification accuracy. As for real-time EEG data, the classification delay could have magnificent effect on system performance. Such outputs will help on real-time analysis to test the performance and localize the cerebral cortex focal area. As passing throw the localization, the application proves that determining the focal area could be achieved from the EEG signal.  \begin{figure}[htbp]
\noindent\textbf{}\includegraphics[]{image-2.png}
\caption{\label{fig_0}?}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{1}\includegraphics[]{image-3.png}
\caption{\label{fig_1}Fig. 1 :}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{3}\includegraphics[]{image-4.png}
\caption{\label{fig_2}Fig. 3 :}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{4}\includegraphics[]{image-5.png}
\caption{\label{fig_3}Fig. 4 :}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{}\includegraphics[]{image-6.png}
\caption{\label{fig_4}}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{5}\includegraphics[]{image-7.png}
\caption{\label{fig_5}Fig. 5 :}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{6}\includegraphics[]{image-8.png}
\caption{\label{fig_6}Fig. 6 :}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{}\includegraphics[]{image-9.png}
\caption{\label{fig_7}}\end{figure}
   \begin{figure}[htbp]
\noindent\textbf{2} \par 
\begin{longtable}{P{0.2740816326530612\textwidth}P{0.16653061224489796\textwidth}P{0.14224489795918369\textwidth}P{0.1526530612244898\textwidth}P{0.11448979591836735\textwidth}}
Algorithm\tabcellsep ACC\tabcellsep SP\tabcellsep SE\tabcellsep Execution Time (ms)\\
Linear SVM\tabcellsep \tabcellsep \tabcellsep \tabcellsep \\
Quadratic\tabcellsep 98.6\%\tabcellsep 99\%\tabcellsep 98.2\%\tabcellsep 19\\
SVM\tabcellsep 99.34\%\tabcellsep 99.4\%\tabcellsep 99.2\%\tabcellsep 25\\
Cubic SVM\tabcellsep 98.18\%\tabcellsep 99.2\%\tabcellsep 93.9\%\tabcellsep 24\\
Fine SVM\tabcellsep 99.25\%\tabcellsep 99.3\%\tabcellsep 99.1\%\tabcellsep 22\\
Medium SVM\tabcellsep 99.4\%\tabcellsep 99.35\%\tabcellsep 99.3\%\tabcellsep 22\\
Coarse SVM\tabcellsep 98.6\%\tabcellsep 99\%\tabcellsep 97.3\%\tabcellsep 23\\
Bagged Tree\tabcellsep 99.3\%\tabcellsep 99.4\%\tabcellsep 99.1\%\tabcellsep 78\end{longtable} \par
 
\caption{\label{tab_0}Table 2 :}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{3} \par 
\begin{longtable}{P{0.2608910891089109\textwidth}P{0.13465346534653466\textwidth}P{0.12623762376237624\textwidth}P{0.12623762376237624\textwidth}P{0.20198019801980197\textwidth}}
Algorithm\tabcellsep ACC\tabcellsep SP\tabcellsep SE\tabcellsep Execution Time (ms)\\
Medium SVM Bagged Tree\tabcellsep 98.2\% 98.1\%\tabcellsep 98.3\% 98.2\%\tabcellsep 97.6\% 97.6\%\tabcellsep 21 74\end{longtable} \par
 
\caption{\label{tab_1}Table 3 :}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{4} \par 
\begin{longtable}{P{0.2740816326530612\textwidth}P{0.15959183673469388\textwidth}P{0.15959183673469388\textwidth}P{0.14224489795918369\textwidth}P{0.11448979591836735\textwidth}}
Algorithm\tabcellsep ACC\tabcellsep SP\tabcellsep SE\tabcellsep Execution Time (ms)\\
Linear SVM\tabcellsep \tabcellsep \tabcellsep \tabcellsep \\
Quadratic\tabcellsep 99.5\%\tabcellsep 99.8\%\tabcellsep 98.2\%\tabcellsep 17\\
SVM\tabcellsep 99.4\%\tabcellsep 99.5\%\tabcellsep 98.9\%\tabcellsep 21\\
Cubic SVM\tabcellsep 99.5\%\tabcellsep 99.7\%\tabcellsep 99\%\tabcellsep 20\\
Fine SVM\tabcellsep 99.6\%\tabcellsep 99.6\%\tabcellsep 99.5\%\tabcellsep 22\\
Medium SVM\tabcellsep 99.8\%\tabcellsep 99.75\%\tabcellsep 99.6\%\tabcellsep 19\\
Coarse SVM\tabcellsep 99.5\%\tabcellsep 99.6\%\tabcellsep 99\%\tabcellsep 19\\
Bagged Tree\tabcellsep 99.65\%\tabcellsep 99.64\%\tabcellsep 99.68\%\tabcellsep 50\end{longtable} \par
 
\caption{\label{tab_2}Table 4 :}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{5} \par 
\begin{longtable}{P{0.17957746478873238\textwidth}P{0.1755868544600939\textwidth}P{0.1755868544600939\textwidth}P{0.17957746478873238\textwidth}P{0.13967136150234744\textwidth}}
Algorithm\tabcellsep ACC\tabcellsep SP\tabcellsep SE\tabcellsep Execution time(ms)\\
Db4 Haar Coif3 Coif4 Rbio3.9 Rbio4.4\tabcellsep 99.8\% 98.2\% 99.6\% 99.7\% 99.5\% 99.4\%\tabcellsep 99.75\% 99.6\% 99.7\% 99.8\% 99.4\% 99.3\%\tabcellsep 99.6\% 92.03\% 99.5\% 99.55\% 99.6\% 99.4\%\tabcellsep 19 17 20 22 23 25\end{longtable} \par
 
\caption{\label{tab_3}Table 5 :}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{6} \par 
\begin{longtable}{P{0.17790697674418604\textwidth}P{0.17790697674418604\textwidth}P{0.17790697674418604\textwidth}P{0.17790697674418604\textwidth}P{0.13837209302325582\textwidth}}
Algorithm\tabcellsep ACC\tabcellsep SP\tabcellsep SE\tabcellsep Execution time(ms)\\
Db4 Haar Coif3 Coif4 Rbio3.9 Rbio4.4\tabcellsep 99.65\% 98.5\% 99.6\% 99.6\% 99.4\% 99.2\%\tabcellsep 99.64\% 99.3\% 99.5\% 99.65\% 99.4\% 99.1\%\tabcellsep 99.68\% 94.5\% 99.4\% 99.55\% 99.5\% 99.4\%\tabcellsep 50 32 41 54 49 61\end{longtable} \par
 
\caption{\label{tab_4}Table 6 :}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{7} \par 
\begin{longtable}{P{0.3154639175257732\textwidth}P{0.122680412371134\textwidth}P{0.09639175257731958\textwidth}P{0.10515463917525773\textwidth}P{0.21030927835051547\textwidth}}
Algorithm\tabcellsep ACC\tabcellsep SP\tabcellsep SE\tabcellsep Execution Time (ms)\\
Fine Gaussian\tabcellsep 99.875\tabcellsep 99.9\tabcellsep 99.68\tabcellsep 85\\
SVM\tabcellsep \tabcellsep \tabcellsep \tabcellsep \\
Bagged tree\tabcellsep 99.25\tabcellsep 99.37\tabcellsep 98.75\tabcellsep 225\end{longtable} \par
 
\caption{\label{tab_5}Table 7 :}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{8} \par 
\begin{longtable}{P{0.2662808641975309\textwidth}P{0.40007716049382713\textwidth}P{0.08526234567901235\textwidth}P{0.09837962962962962\textwidth}}
Researchers\tabcellsep Method\tabcellsep Dataset\tabcellsep Acc\%\\
Kannathal et al.2005b\tabcellsep Entropy measures-inference system adaptive neuro fuzzy\tabcellsep Z,S\tabcellsep 99.20\\
Kannathal et\tabcellsep Chaotic measures-\tabcellsep \tabcellsep \\
al.2005a\tabcellsep surrogate data\tabcellsep Z,S\tabcellsep \textasciitilde 90.0\\
\tabcellsep analysis\tabcellsep \tabcellsep \\
Polat and Gunes.2007\tabcellsep FFT-Decision tree\tabcellsep Z,S\tabcellsep 98.72\\
Subasi 2007\tabcellsep DWT mixture of expert model\tabcellsep Z,S\tabcellsep 95.00\\
Tzallas et al.2007b\tabcellsep Time frequency analysis ANN\tabcellsep ZONF-S\tabcellsep 97.73\\
Ling Guo et al.2010\tabcellsep DWT Line length-MLPNN\tabcellsep ZONF-S\tabcellsep 97.77\\
Suguna et al.2014\tabcellsep SVM with Shannon Entropy\tabcellsep Z,S\tabcellsep 95.00\\
Manisha et al.2018a\tabcellsep DWT -MLPNN\tabcellsep Z,S\tabcellsep 100.0\\
Manisha et al.2018a\tabcellsep DWT-SVM\tabcellsep Z,S\tabcellsep 99.00\\
This work\tabcellsep DWT-Line length-SVM\tabcellsep ZONF-S\tabcellsep 99.80\\
This work\tabcellsep DWT-Line length-Bagged Tree\tabcellsep ZONF-S\tabcellsep 99.65\\
This work\tabcellsep DT-CWT fine Gaussian SVM\tabcellsep \multicolumn{2}{l}{ZONF-S 99.875}\\
\tabcellsep IV.\tabcellsep \tabcellsep \end{longtable} \par
 
\caption{\label{tab_6}Table 8 :}\end{figure}
 			\footnote{( ) K © 2019 Global Journals Study of EEG Signal for Epilepsy Detection and Localization using Bagged Tree and SVM Algorithms} 			\footnote{rd International Conference on Advances in Medical, Signal and information Processing, MEDSIP; 2006.} 		 		\backmatter  			  				\begin{bibitemlist}{1}
\bibitem[Chui et al. ()]{b6}\label{b6} 	 		‘A multistage system to detect epileptic form activity in the EEG’.  		 			C Chui 		,  		 			A Dingle 		,  		 			R Jones 		,  		 			G Carroll 		,  		 			W Fright 		.  	 	 		\textit{IEEE Transactions on Biomedical Engineering}  		1992. 1993. Academic Press. 40  (12)  p. .  	 	 (An Introduction to Wavelets) 
\bibitem[Guo et al. ()]{b0}\label{b0} 	 		\textit{Automatic epileptic seizure detection in EEGs based on line length feature and artificial neural networks},  		 			Ling Guo 		,  		 			Daniel Rivero 		,  		 			Julian R Rabunal 		,  		 			Alejandro Pazos 		.  		2010.  	 
\bibitem[Suguna Nanthini and Santhi ()]{b1}\label{b1} 	 		\textit{EEG Signal Analysis for Epileptic Detection Using Soft Computing Techniques},  		 			B Suguna Nanthini 		,  		 			B Santhi 		.  		2014. p. .  	 
\bibitem[Chandani and Kumar ()]{b2}\label{b2} 	 		‘EEG signal processing for epileptic seizure Prediction by using MLPNN and SVM Classifiers’.  		 			Manisha Chandani 		,  		 			Arun Kumar 		.  	 	 		\textit{American Journal of Information Science and Technology}  		2018. 2  (2)  p. .  	 
\bibitem[Andrzejak et al. ()]{b3}\label{b3} 	 		‘Indications of nonlinear deterministic and finite-dimensional structures in time series of brain electrical activity: dependence on recording region and brain state’.  		 			R Andrzejak 		,  		 			K Lehnertz 		,  		 			F Mormann 		,  		 			C Rieke 		,  		 			P David 		,  		 			C Elger 		.  	 	 		\textit{Physical review}  		E2001. 64  (6)  p. .  	 
\bibitem[Esteller et al. ()]{b8}\label{b8} 	 		‘Line length: An efficient feature for seizure onset detection’.  		 			R Esteller 		,  		 			Echauz J 		,  		 			T Tcheng 		,  		 			B Litt 		.  	 	 		\textit{23 rd Annual International Conference of the IEEE Engineering in Medicine and Biology Society},  				2001. p. 4.  	 
\bibitem[Zwoli?ski et al. ()]{b5}\label{b5} 	 		‘Open database of epileptic EEG with MRI and post operational assessment of foci-a real world verification for the EEG inverse solutions’.  		 			P Zwoli?ski 		,  		 			M Roszkowski 		,  		 			J Zygierewicz 		,  		 			S Haufe 		,  		 			G Nolte 		,  		 			P J Durka 		.  	 	 		\textit{Neuro informatics}  		2010. 8  (4)  p. .  	 
\bibitem[Zwolinski et al.]{b4}\label{b4} 	 		\textit{Open Database of Epileptic with MRI and Post Operational Assessment of Foci-a Real World Verification for the EEG Inverse Solutions},  		 			Piotr Zwolinski 		,  		 			Marcin Roszkoski 		,  		 			Jaroslaw Zygierewicz 		,  		 			Stefan Haufe 		,  		 			Guido Nolte 		,  		 			Piotr J Durka 		.  		 	 
\bibitem[Deivasigaman and Senthilpari ()]{b7}\label{b7} 	 		\textit{Wong Hin Young. Classification of Focal and Non focal EEG Signals Using ANFIS Classifier for Epilepsy Detection},  		 			S Deivasigaman 		,  		 			C Senthilpari 		.  		2016.  	 
\end{bibitemlist}
 			 		 	 
\end{document}
