The focus of this masters is on the developing of a wearable sensory system for detection of epileptic seizures using the commercially available MEMS (Micro Electro-Mechanical Systems) inertial sensors. This system if further developed enables the patient to live independently and the hospital staff or relatives to monitor the patient and make sure of his wellness. The significance of the current project is especially perceived when considering that the currently available alarm systems are confined to the limited space of the hospital and cannot be used in everyday life.
For this purpose, a mechanical model of human body is developed and the optimal placement of the sensors is decided. Finally a detection technique to distinguish between normal activity and seizure episodes is proposed and tested by experimental data. The project is done in collaboration with Dr. R. S. McLachlan from the department of clinical neurological sciences of London Health Sciences Centre, University hospital.
In this introduction first some background information regarding the human body modeling, Kane's Dynamics Equation method, Epilepsy classification, state of art in the inertial sensors and finally their application in medical detection are given. Then the motivation, objective and assumptions of the current research are illustrated. In this section it is made clear why the seizure detection is important. The introduction is concluded with an overview of the topics that are covered in this thesis.
Human Body Modeling and Simulation
The problem of human motion analysis has fostered a dramatic growth of biomechanics researchers' interest for simulation and modeling of human body for years, and even several commercial and non-commercial software packages are already developed for this purpose [4- 6]. There are two main streams of modeling that correspond to inverse and forward dynamics in the human body modeling.
Forward vs. Inverse Dynamics
One of the major issues in Biomechanics has been the creating of mathematical models that resemble the human body, in a manner that gives the researchers an opportunity to recreate, simulate or analyze human body movements. Indeed, over the recent years modeling of the human body movement is receiving attention from many researchers. This interest is motivated by a wide variety of applications such as athletic performance analysis, surveillance, research and development, military, human-machine interface, welfare and rehabilitation robotics, and prosthetics .
Inverse dynamics is a method that is commonly used in the biomechanical analysis of human movements to assess the net joint torque or muscle moment due to the contraction of muscles in each joint using the experimental data from motion, electromyography (EMG) or sensory measurements. This method uses kinematic, kinetic, and anthropometric information as input to solve the equations of motion for each body segment (winter, 2005). The inconsistency between the measured data due to modeling error as well as the indeterminate muscle tensions due to actuation redundancy are two main sources of error in inverse dynamics approach. Optimization techniques are applied in order to obtain a unique solution for the latter problem . Other sources of error are also reported which includes inaccuracy in movement coordinate data which itself is due to the error in marker location that is because of the inherent motion capture system noise (Richards, 1999) and also skin movement artifact (Cappozzo et al., 1996; Fuller et al., 1997; Holden et al., 1997), estimations of body segment parameters, and identification of joint center of rotation locations (e.g., Bell et al., 1990; Kuo, 1998; Schwartz and Rozumalski, 2005; Riemer et al., in press).
Forward dynamics computation, on the other hand, is performed to simulate the motion assuming a muscle activation pattern or even neglecting the effects of the muscle and soft tissue and just considering the joint torques. Actuated forward dynamics simulations are particularly powerful because they allow for the identification of the relationships between the torque applied to the joints, and the specific task movement. Understanding these relationships without simulation analyses is challenging because of the highly complex, nonlinear and multi degree of freedom nature of the human body system. Simulations also allow estimation of quantities that are difficult or impossible to measure in vivo, such as the applied joint torque by using the measurable quantities such as angular acceleration and angular displacement of the joints along with the acceleration of the segments along with the forward dynamics equations of motion. A similar procedure is developed in chapter 4.
Figure shows a description of the simulation techniques for the human body modeling.
Figure1. Different techniques for simulation of the human body motion simulation
Kane's Method and Application to Human Body Model
In 1961, Professor Thomas Kane published a paper ''Dynamics of Non-holomonic Systems''  in which he described a new method for formulating the equations of motion of complex dynamical systems (or multi-body systems). This new method was a Lagrangian form of d'Alembert's principle which allowed dynamical equations to be generated without differentiation of kinetic and potential energy. Later, in 1965 Kane and Wang published a paper "On the Derivation of Equations of Motion"  and described the use of 'generalized speeds'. These two papers formed the foundation of what has since become known as Kane's method for multi-body dynamics.
Although the application of Kane's method has advantages over other methods of formulating dynamical equations (table 1-1) , the importance and ease of Kane's method was not fully recognized until the advances in the space industry of 1960s and 1970s. At that time, reducing the cost of simulation as well as making the equations of motion suitable for modeling and computer programming lead to the use of Kane's method. In references ,  and  funded by NASA, researches modeled a human in freefall (weightlessness) by using Kane's method.
Later, other researchers used this method in other areas involving human activities; for instance Lemmon et al  studied the dynamics of a car crash victim, or Gallenstein et al  analyzed the swimmer motion and more recently Nagano et al  applied this method to study the jumping dynamics of a human body.
Further, based on various dynamical principles developed by Newton, Euler, Kane and Lagrange a number of commercial software packages were developed for multi-body dynamics such as ADAMS (Automatic Dynamic Analysis of Mechanisms) , AUTOLEV , Working Model , etc. In this text analysis will be done by ADAMS and AUTOLEV. AUTOLEV will be used to generate an output code to run in MATLAB and ADAMS will be used to visualize the human body under certain conditions such as having an epileptic seizure.
Table1-1, Comparison of Dynamic Methods
Yields good physical understanding
Looks at system as a whole
Looks at system as a whole
Easy to teach and learn
Does not require calculation of unwanted interaction forces
Easy to teach and learn
Highly systematic- can even be implemented on the computer
Doesn't require calculation of unwanted interaction forces
Eliminates vagueness surrounding virtual work approach
Disadvantages eliminated and advantages retained through use of Motion Law
Requires introduction and elimination of Lagrange multipliers for closed-loop systems
Physical insight can be limited
Requires calculation of unwanted interaction forces
Requires use of virtual work approach, which can be vague
Looks at system in parts
Fortunately Kane's method has found its way to computer implementation. Simulation programs now exist which are proficient in algebraic manipulations and Kane's method such as ADAMS and Motion Genesis. These programs are able to calculate the entire set of dynamics equations in an algebraic form for open-chain linked-segment models, making it possible to utilize models with more segments and more degrees of freedoms.
Unlike other biomechanics software such as Life Modeler and ADAMS, Motion Genesis provides a step by step approach to Kane's method which allows some insight into the nature of the equations derived. As it is stated in the user's manual, "Motion Genesis was created expressly to facilitate analyses based either on Kane's method or on Newton-Euler equations." Components such as the mass, inertia values, dimensions of each segment as well as the coordinates and the input functions are all entered in a systematic way. Once these components are entered, Motion Genesis can generate sets of equations of motion and MATLAB or C++ code. The generated code actually integrates Motion Genesis equations forward in time using a fourth-order Runge Kutta integration scheme. This numerical method can solve a wide range of equations such as ordinary, nonlinear differential and or non-differential equations. In addition, the generated MATLAB code is an optimal one which reduces the time of calculation effectively. Thus Motion Genesis was our choice of program because it provides a step by step approach to Kane's method which allows some insight into the nature of the equations derived and was considered to be a valuable tool with regards to this research.
The dynamic analysis of multi-body systems is aided by various software packages, for example, MotionGenesis, Automatic Dynamic Analysis of Mechanical Systems (ADAMS)1 , Dynamic Analysis and Design System (DADS) , mathematical dynamical models (MADYMO) , AnyBody , and LifeModeler  which they all have been used extensively for human body simulations.
Commercial and non-commercial Multi-body Modeling and Simulation Software
MSC Software Corporation, USA
Capable of importing the full body musculoskeletal CAD model, output is in the form of graph or rough data.
AnyBody Technology, Denmark
Full body Musculoskeletal CAD based Model/graphs in which joints, constraints and initial values are selectable from the library or can be defined.
Symbolic sets of equations of motion, MATLAB and C++ code.
Mechanical Simulation Corporation, USA
MBDyn - general purpose multibody/multidisciplinary analysis software, Italy
MathEngine - Toolkit for dynamic simulation , UK
Pro/ENGINEER formerly Pro/MECHANICA
Full body CAD based Model/graphs in which joints, constraints and initial values are selectable from the library or can be defined.
SD/FAST (Dynamic software for mechanical systems),
The full nonlinear equations of motion for that system. C++ or Fortran code.
SimMechanics - Simulation Toolbox for Matlab
Working Model - 2D and 3D simulation software from MSC Software Corporation
Less sophisticated version of ADAMS with output in the form of graph or rough data.
MBSSIM - MultiBody System SIMulation. University of Heidelberg, Germany
Epileptic Seizure, Classification and Definition
Epilepsy is a physical condition characterized by sudden, brief changes in how the brain works. [http://www.epilepsy.ca/en-CA/Epilepsy-Canada.html] It is a symptom of a neurological disorder - a disorder that affects the brain and shows itself in the form of seizures.
Facts about Epilepsy
Epilepsy affects almost 60 million people worldwide. Particularly in Canada, almost 0.6% of the population have epilepsy However, Due to the encompassing public stigma and the prejudice with which society has historically treated people with epilepsy, many with the disorder are resentful to embrace their condition or to seek for treatment. Thus the prevalence of epilepsy is likely much higher. Table shows summarizes the facts about epilepsy in Canada [http://www.epilepsy.ca/en-CA/Epilepsy-Canada.html].
It might be interesting to know that number of the past world leaders and notable people suffered from epilepsy. In fact, a possible link between epilepsy and greatness has attracted biographers and physicians for centuries. In his interesting article, Dr. McLachlan states that Julius Cesar's disease and its consequences possibly altered the course of his life and consequently the history [http://cjns.metapress.com/content/v286441q7743m307/fulltext.pdf]. The French 17th century physician Jean Taxil in his Treatise on Epilepsy refers to Aristotle's "famous epileptics". This list includes Julius Caesar and Roman Emperor Caligula, Drusus, Petrarch, Hercules, Ajax, Bellerophon, Socrates, Plato, Empedocles, Maracus of Syracuse, and the Sibyls.
There are number of factors which may trigger the epileptic seizure including stress, poor nutrition and skipping meals, missed medication, flickering lights, illness, fever and allergies, lack of sleep, emotional involvements such as anger, worry and fear, heat and/or humidity [http://www.epilepsy.com/node/986825]. In almost half of epileptic patients, the cause of epilepsy is unknown. However, in the remainder brain tumour and stroke, and head trauma of any type are most common causes. Other cases that are listed as the causes of epilepsy include :
Injury; the more severe the injury, the greater the chance of developing epilepsy
Infection or systemic illness of the mother during pregnancy
Brain injury to the infant during delivery may lead to epilepsy
Aftermath of infection (meningitis, viral encephalitis)
Poisoning, from substance abuse of alcoholism
Epilepsy Facts in Canada.
The major form of treatment is long-term drug therapy. However, drugs are not a perfect cure and can have numerous and sometimes severe, side effects. In some severe cases, when the medication fails, brain surgery may be recommended only when the seizures are confined to one area of the brain in which the brain tissue can be safely removed without damaging personality or function. Although some segments of the population affected can be treated successfully with drug therapy or neurosurgical procedures, approximately a quarter of the affected patients cannot be treated via any available therapy . These people are at high risk for physical as well as mortal injuries. They are often unable to live independently and a large number is institutionalized. Hence, for the epileptic patients in general, and in particular to the class mentioned above, the instantaneous detection of an epileptic seizure can play a significant role in shaping their well-being. Such a detection unit can be made to trigger an alarm system to get the right assistance in situations that require immediate intervention. This is especially important in institutions where many patients with severe epilepsy live together. Due to lack of resources, the patients are not continuously supervised by nurses especially at night, hence justifying the need for design and development of robust sensing/alarm systems.
Epileptic Seizure Generalized Types
Inertial sensors can only detect the type of seizures that express themselves in movements or alternatively the type of seizures which disturb the normal movement patterns. Motor seizure is the term which describes the seizures in which the main clinical manifestations are movements [H.O. Luders and S.N. Noachtar. Epileptic Seizures, Pathophysiology and Clinical Semiology. Churchill Livingstone, New York, 2000.)]. These kind of so called "motor seizures" can be divided into two major subgroups, simple motor seizures and complex motor seizures. simple motor seizures involves motor movements that are relatively 'simple' and unnatural. Further, simple seizures are not accompanied by loss of consciousness and are caused by a relatively massive discharge in the motor structures of the cortex [Commission of Classification and Terminology of the International League Against Epilepsy. Proposal for revised clinical and electroencephalographic classification of epileptic seizures. Epilepsia, 22:489-501, 1981.] [J. Engel Jr. A proposed diagnostic scheme for people with epileptic seizures and with epilepsy: Report of the ILAE task force on classification and terminology. Epilepsia, 42:796-803, 2001.]. Whereas complex motor seizures are seizures in which the movements are relatively complex and simulate natural movement, except that they are inappropriate for the situation. These seizures often arise from the limbic system and they are accompanied by loss of consciousness [Commission of Classification and Terminology of the International League Against Epilepsy. Proposal for revised clinical and electroencephalographic classification of epileptic seizures. Epilepsia, 22:489-501, 1981.] [J. Engel Jr. A proposed diagnostic scheme for people with epileptic seizures and with epilepsy: Report of the ILAE task force on classification and terminology. Epilepsia, 42:796-803, 2001.]. The focus of this thesis is on the simple motor seizures. This focus actually justifies the application of inertial sensors to model, observe and eventually detect the epileptic seizure. Simple motor seizures can be subdivided into the following types: myoclonic, clonic, tonic, and tonic-clonic seizures. Primarily simple seizures can be sub-classified into a number of categories, depending on their frequency of movement, the duration of muscle contractions and the muscle involved. [Nijsen's Phd thesis]:
Myoclonic seizure involve an extremely brief (< 100 ms) muscle contraction with the frequency of 50 Hz [P. Brown and C.D. Marsden. Rhytmic cortical and muscle discharge in cortical myoclonus. Brain, 119:1307-1316, 1996]. The seizure can result in jerky movements of a few adjacent muscles, for example, only one antagonistic pair muscles or muscle groups. The surface EEG associated with a myoclonic seizure shows a poly/spike wave correlate [M. Hallett. Myoclonus: Relation to epilepsy. Epilepsia, 26(Suppl.1): S67-S77, 1998. ]. EMG-signals reveal synchronous muscle activation in both agonist and antagonist muscle of the affected muscle group. [Phd Thesis of Nijsen's]
Tonic seizures consist of regularly repeated myoclonus contractions recurring at intervals between 0.2 and five times per second. During a clonic seizure the affected parts of the body show repetitive jerking [H. Luders, J. Acharya, C. Baumgartner, S. Benbadis, A. Bleasel, R. Burgess, D.S. Dinner, A. Ebner, N. Foldvary, E. Geller, H. Hamer, H. Holthausen, P. Kotagal, H. Morris, H.J. Meencke, S. Noachtar, F. Rosenow, A. Sakamoto, B.J. Steinhoff, I. Tuxhorn, and E. Wyllie. Semiological seizure classification. Epilepsia, 39(9):1006-1013, 1998.]. During the clonic seizures (poly) spike-wave complexes were observed in the EEG. [H.M. Hamer, H.O. Lüders, S. Knake, B. Fritsch, W.H. Oertel, and F. Rosenow. Electrophysiology of focal clonic seizures in humans: a study using subdural and depth electrodes. Brain, 126:547-555, 2003.] Here again the bursts of muscle activation occurred synchronously in agonistic and antagonistic muscles and were separated by periods of complete muscle relaxation in all muscles [Nijsen's Phd Thesis]. A distinguishing factor between clonic and myoclonic seizure is that clonic from tonic-clonic seizures is that myoclonic seizures involve only one or a few twitches or jerks without any particular rhythm whereas clonic seizure is rhythmic.
During tonic seizures a sustained sudden contraction of multiple muscle groups is observed. Tonic seizures have a duration that is from 10 to 20 seconds, but can also be in different range [H.O. Luders and S.N. Noachtar. Epileptic Seizures, Pathophysiology and Clinical Semiology. Churchill Livingstone, New York, 2000.]. The EEG shows high frequency activity of an average 30 Hz, which may increase in amplitude as the frequency is decreased. Tonic seizures most often occur during sleep and usually involve all or most of the brain, affecting both sides of the body. If the person is standing or walking at the instant the seizure starts, he or she often falls. However, consciousness is usually preserved.
Tonic-clonic seizures involve an initial contraction of the muscles similar to the tonic seizure during which the patient has the legs and arms in extension with the arms adducted and crossed in front of the body; this phase lasts 5 to 10 seconds. It is then followed by a series of rhythmic, tremor-like muscle contractions. In which muscle contractions are similar to the clonic seizure. The movements of the arms increase progressively in amplitude as the repetition rate diminishes. This type of seizure may involve tongue biting, urinary incontinence and the absence of breathing.
Schematic representation of body movements during simple motor seizures
Current Detection and Monitoring systems for epilepsy studies
The integration of 3-Dimensional motion measurement using multi-camera system and reaction force measurement using force plates has been successfully devoted to tracking human body parts and performing dynamic analysis of their physical behaviors in a complex environment (Karaulova et. al., 2002; Inoue et. al., 2003). However, the optical motion analysis method needs sizeable work space and high-speed graphic signal processing devices, and for this analysis method, the devices are expensive, and the initial calibration experiments and offline analysis of recorded pictures are very complex and time-consuming. Therefore, this method is only limited to laboratory research, and are not suitable for patient monitoring while the patient is engaged in their routine daily activities.
electrodes placed at a number of locations on the scalp [http://sites.pcmd.ac.uk/time/methods.php?cat=eeg]
An EEG trace of a healthy individual at rest with their eyes closed [http://sites.pcmd.ac.uk/time/methods.php?cat=eeg]
An EEG trace of during an (absence) epileptic seizure [http://sites.pcmd.ac.uk/time/methods.php?cat=eeg]
Inertial Sensors Selection and Placement
Many of epileptic seizure symptoms involve movement of the human body parts. In technical term these symptoms are referred as motor ones .As a result seizure can be captured and analyzed with several technologies based on motion studies such as video and inertial sensors. In fact owing to the recent developments in the area of micro-electro-mechanical systems (MEMS) based inertial sensors, as well as their desirable size, cost and power consumption, researchers are considering these sensors a good choice for human body motion kinematics studies especially in the form of wearable inertial motion sensors. This form of inertial motion sensors recently became commercially available, and uses a combination of accelerometers, gyroscopes and magnetometers.
The placement of the inertial sensors on the body is the area which still needs more research as it is often hard to predict which locations on the body can provide the most relevant features with respect to sensitivity limitations of the wearable inertial sensors. On the other hand, placing the sensors on several locations of the body can be cumbersome and also prone to errors. It is clear from various studies that the position of the sensors is important for activity classification [,]. Although the wearable sensory system is widely used in human body motion recognition, to the knowledge of writer there is no comparative work investigating optimal sensor placement for movement studies of human body in terms of mechanical equations of motion.
State of Art
The feasibility of seizure detection based on triaxial inertial sensors has been discussed in various papers [2, 3, 4 and 6]. Inertial sensors are used in a wide range of medical application areas for monitoring and studying hand tremors, gait analysis, falling from bed alarms and Parkinson's disease. In Parkinson's disease, studies aim at distinguishing pathological and normal movements . In these cases, accurate knowledge of the angular motion of the arm is extremely important. Angular velocities are typically measured using rate gyroscopes which are particularly susceptible to drift . Further, it is widely accepted that angular acceleration cannot be obtained by differentiating the rate gyro output and the angular acceleration is typically calculated from combined output of accelerometers and gyroscopes. However, in this method, the placement (location and orientation) of accelerometers fixed on the segment plays a significant role in achieving high sensing resolution.
The present project is mainly concerned with determining the suitability of such a device for predicting optimal positioning and patient-specific motion customization. However, the ultimate goal of this work is in developing a complete patient monitoring system that can work along with the currently available tools such as EEG (electroencephalogram) and video monitoring for epilepsy patients. Once the suitability is determined, real-time linking of the motion signals to the EEG monitoring systems will also be attempted. Outcome from this project is envisaged to result in providing in-patient as well as outpatient monitoring systems for people suffering from epilepsy and elevate the quality of overall healthcare.
Recently, inexpensive in-chip inertial sensors including gyroscopes and accelerometers have gradually found practical applications in human motion analysis. Schepers et al (2007) proposed a combination sensor system including six degrees of freedom force sensors and miniature inertial sensors to estimate joint moments and powers of the ankle. Tong and Granat (1999) proposed a measurement device using two gyroscopes, one placed on the thigh and the other on the shank, which can estimate knee rotation angle during walking. This system can detect different phases of human walking, but the quantitative analysis for leg motion was not completed in this study.
Wearable inertial motion sensors consisting of accelerometers, gyroscopes and magnetic sensors are readily available nowadays (Cooper et. al., 2009). Although these devices which are manufactured using MEMS technology have received commercial success, in particular for applications that require moderate accuracy (see, e.g., Asokanthan and Wang, 2009), this class sensor systems for medical applications started entering the market only in the last year or so. However, the recently developed complete sensor systems that are primarily designed for predicting 3D position/orientation for human movement applications have opened a variety of possibilities for medical applications.
For epileptic seizure analysis, various types of inertial sensors have nearly been used. This can be seen from Table. Some statistics within twenty relative papers from references is provided in the same table. Accelerometers are the most frequently used sensors. Almost all the research papers are mentioned it. However to achieve better results, accelerometers are normally used with gyroscopes, to construct the IMU. Using multi-sensors, it also brings up the need for data fusion [3, 8].
Discussed by Papers
Review of current products
A unit of inertial sensor including tri-axial accelerometer, tri-axial gyroscope and tri-axial magnetometer can be easily built by preparing each set of tri-axial sensor from supplier such as Analog Device. But the problem is how to apply sensor fusion to get the most useful information of the sensors. This issue becomes even more important when considering that the project involves several parts from human body simulation to optimization and epileptic seizure detection technique. Considering this matter, commercial sensory unit packages combining the three sensors mentioned above and having the sensor fusion already done were considered. For deciding on the sensory system so many factors such as accuracy, sensitivity, noise level, maximum catchable frequency, availability and maintenance service, and of course the cost of unit. Initially the Xsens MVN BIOMECH suit was chosen. But later it was decided that the device is sophisticated for motion tracking purposes and consequently it might be more than what we need for our purpose. So considering cons and pros of different sensory units, Motion Node inertial unit was chosen to use in this project. In this section, a brief overview of the two major inertial units is given and the section is concluded by a comparative table giving the information about other available sensors.
The MVN inertial wearable system is fully ambulatory, body worn array of sensors. Data is transmitted by a wireless connection to the laptop computer on which the processing is performed and visualized. With the MVN Studio software, the user can easily observe, record and export the movements in three dimensional. The ballpark pricing for the standard MVN Development Kit is around 20k USD and it includes:
17 MTw's are small wireless and highly accurate 3D motion trackers. The output of each MTw is accurate 3D orientation and calibrated sensor data (acceleration, rate of turn, magnetic field and barometer) at high update rates. Internal sampling of almost 120 Hz together with pre-processing ensures accuracy under challenging dynamic conditions.
The Awinda station is a wireless receiver for up to 32 MTw's which connects to the pc. It charges the sensors simultaneously and has multiple hardware connections for digital I/O for time synchronization with compatible auxiliary systems.
The Awinda USB dongle is a small USB-receiver for the MTw's to be used instead of the Awinda station. (Not available yet, however will be shipped for free within a few months)
A set of click-in full-body straps which are easy to use click-in body straps for quick and sturdy mounting the MTw's to the subject's body.
MT Manager Software is an intuitive user interface for configuring and real time visualization of the MTw orientation and calibrated sensor data. Record and export data as ASCII format.
MT Software Development Kit is a software package which allows gaining real-time access to the capabilities of the MTw's. This also allows easily integrating the MTw's into user's own application. Example code is provided for MATLAB, LabVIEW, Excel, C/C++
MTx in hand processed.jpg
Xsens MVN. 
MTx unit from Xsens Technologies B.V. 
The Motion Nodeâ„¢ system consists of 5 inertial sensor packages with one Motion Nodeâ„¢ Bus . Each package is an inertial measurement unit and contains triaxial gyroscopes, triaxial accelerometers and triaxial magnetometers (35Ã-35Ã-15 mm, 10 g). The sensor modules are connected in a chain to the Motion Nodeâ„¢ Bus, meaning that only one cable leads to each segment. The Motion Nodeâ„¢ Bus synchronizes all sensor sampling, powers the sensors and makes the wireless communication with the stationary unit which can be either PC or laptop.
The software package which comes with the sensor provides a simple interface to preview, record, and export inertial measurement data to FBX, COLLADA, BVH, and CSV. These output data can be analyzed in MATLAB, Lab View and Excel. It also Adjust sensitivity and filtering parameters for different application requirements. On the other hand, sensor fusion algorithms applied in the software on the sensors' results ensure highly accurate output.
For quick and convenient placement, the sensors and cables can be attached to body segments using AIRCASTâ„¢ Pneumatic Armband (Figure ()) with the Motion Nodeâ„¢ Bus mounted on the wrist (Figure ()). The armband is universal fit and it guarantees a minimal skin motion artifact. It also provides less restriction and its breathable material enhances comfort and wearability which is highly important in the project to guarantee patient's comfort during the experiment. Straps can be also worn over normal clothing.
Another advantage of the system is that it has also a very quick and easy set up which can be done in less than 10 minutes by a non-technician person. The total weight of the system (including batteries) is 1.9 kg. Five sensor modules will be placed on the right arm (1) and forearm (2), head (1), and chest (1). Battery life for 5 sensors is 7 hours which seems to be quite satisfactory for the purpose of monitoring during night.
In an effort to formulize a method to place the sensors, some researchers have used the statistical or classification methods. For instance, L. Atallah et al. presented a framework for the investigation of feature relevance as well as sensor positioning for a set of wearable accelerometers. Their work was based on the activity classification the by applying three feature selection methods: Relief-F, Simba, and mRMR to assess the relevance of features for discriminating 15 different activities. All these three methods achieved similar performance . Bao & Intille employed five bi-axial accelerometers placed on the user's right hip, wrist, upper arm, ankle, and thigh in order to collect data from 20 users. Using decision tables, instance- based learning, C4.5 and NaÃ¯ve Bayes classifiers, they created models to distinguish twenty daily activities from each other. Their results indicated that the accelerometer placed on the thigh was most powerful for distinguishing between activities .
In particular, for the case of epileptic seizure detection, researchers often chose to use sensors in predefined locations on the body such as wrist, forearm and arm. For instance, Nijsen et al.  has developed a detection algorithm to discriminate between data with and without subtle nocturnal motor activity for epileptic seizure. Five accelerometers were attached to the body, two to the ankles, two to the wrists, and one to the chest. In another study, Nijsen et al. attached an accelerometer to the arm of the patient and fitted the output results' curve with exponential function. Jallon et al.  and Cuppens et al.  also studied the detection of epileptic seizures with accelerometers and Conradsen et al.  used a multi-modal approach. Table I summarizes some of the most significant recent work using sensors for activity recognition as well as seizure detection.
Type of Sensors
Atallah et. Al.
Different locations for different types of activities
Bao et al. 
hip, wrist, ankle, arm and thigh
Yang et al. 
Hester et al. 
Mathie et al. 
Lo et al. 
Karantonis et al. 
Schulc et al. 
wii remote (Accelerometer)
Nijsen et al. 
Conradsen et. al. 
Xsens (Accelerometer, Gyroscope and Magnetometer)
Becq et al. 
wrist and head
Decaigny et. al.
Wrist and ankle
Jallon et. Al.
MotionPod (Accelerometer and Magnetometer)
Keijsers et. Al.
upper arms, upper legs, wrist, and trunk
Epilepsy is a neurological disorder in which the tendency of the brain to generate epileptic seizures causes involuntary movements. Approximately %33 of the epileptic patients continue to have seizures in spite of appropriate medication . Many of these onsets start suddenly and of course unpredictably; making the patient to lose consciousness and may carry risks of severe trauma and even death. In some cases, patient is alone and seizures may pass unnoticed, especially during sleep and this makes the prescription and monitoring purposes more difficult. There are also some occasions in which in the absence of immediate medical assistance there is a high risk of death. That is why an alarm system which is capable of detecting the seizure and recording it as well as triggering an alarm in life-threatening occasions is necessary. When the seizures are detected an alarm can warn staff at the hospital or relatives at home of the seizures. This can also give a clear knowledge of how often, when and in which incidents the seizure is likely to happen for a particular patient.
In fact, there are currently a variety of alarm systems available including patient's bed shaking analysis , rhythmic movements' detection by video algorithms , seizure associated EEG patterns recognition , audio sensitive seizure detection devices , and heart rate, rhythm, or regularity analysis  but they are not reliable because of their low sensitivity and false detections. This problem justifies the search for new detection systems, in particular inertial sensory detection system, for warning about seizures. In the case of video detection, regular rhythmic movements can be recognized across pixels of digital image by image processing techniques, but such recognition fails with patients under covers. Bed shake detectors are also not very practical since they only detect seizures with repetitive physical movements, but these are among the most worrisome, and sudden death is more likely in people with uncontrolled tonic-clonic seizures.
The fact that the epileptic seizure is a motor phenomenon makes the movement-based detection systems an alternative to the current devices. Even though using inertial sensors in biomechanical and biomedical studies is now common, the work on these systems is still seems to be on early stages of its development. Indeed a wave of gathering interest is propelling the field in a variety of directions, efforts that are mostly fueled by cooperation between two fields of engineering and medical studies. For instance, inertial sensors are now used in a wide range of medical application areas for monitoring and studying hand tremors, gait analysis, falling from bed alarms and Parkinson's disease.
However, the efficiency of the detection sensory system depends on the information it can retrieve from a seizure episode while the information should be sufficient, but not excessive. Hence, an increased number of sensors alone do not guarantee that the detection system will have a better performance. The relevance of the information brought by an additional sensor must also be taken into account and economic issues may also be considered. When designing a sensor system, one must search for those combinations (numbers and placements) of sensors that can provide the highest possible detection level at lowest possible cost.
Question at this stage would: what type of inertial sensors should be used for the detection system? Many researchers as mentioned earlier have used different combinations of sensors, from using just accelerometers, to the combination of accelerometers, gyroscopes and magnetometers. Generally in the combined ones the aim of the author is more towards extracting an extra piece of information which cannot be derived by using just accelerometers or magnetometers. Even though utilization of the combined inertial sensors, including accelerometers, magnetometers and gyroscopes; has been shown to reduce the drift [,] but still the uncertainties of each sensor can cause error in the detection. To quantify and count for the errors induced by the placement of each sensor, one needs to develop a relation between human body model and the each sensor's noise level. To do so human body model should be developed and explicit dynamic equations should be derived.
Having the human body model and also detection system available, one should be also able to distinct between the epileptic seizure onset and normal activities. This is the area that mostly discussed among researchers and it seems to be still a challenging topic. To the knowledge of the writer there is no unique efficient method to detect the epileptic seizure. Most of the detection systems rely on the using video recording and sensors or EEG and sensors together to detect epileptic episodes. However, this is exactly opposite to the initial purposes of using inertial sensors which is portability. So the need for detection system that is online, immediate, reliable, comfortable and is solely rely on the data from inertial sensors still exists.
Objectives and Assumptions
In clinical applications the quantitative characterization of human kinematics and kinetics can be helpful for clinical doctors in monitoring patients' recovery status, prescribing the right medicine and notifying the medical personnel rapidly in emergency situations. In diseases such as epilepsy, 24/7 monitoring of patients is needed but considering the fact that the monitoring instruments are mainly limited to the hospital or laboratory use, the use of these instruments during daily activities of the patients are often difficult. Nowadays body-mounted inertial/magnetic sensors are increasingly used in biomechanical and biomedical applications because of their main advantages of miniaturization, autonomy, low intrusiveness and unrestricted application range.
Objective of the proposed research is then to evaluate the use of a wearable inertial sensory system which can measure human body translation and angular motion and to optimize its use for predicting optimal sensor locations as well as for customizing for patient-specific activities. The present research will primarily focus on patients suffering from epilepsy, although such as system can be used for a variety of patient illnesses such as Parkinson Disease (PD), hand tremor, etc.
An array of Accelerometer, Gyroscope and Magnetometer sensors integrated into fabric straps are to be mounted on patients at optimal locations for accurate real-time estimation of angular orientations as well as limited linear positions. This inertial sensor combination allows accurate estimation of motion parameters with minimal position errors while continuously acquiring and transmitting the physiological data to a remote monitoring station. This system will be an invaluable tool, when combined with other tools such as EEG (electroencephalogram) and when the sensory data are suitably correlated to the patients' activities can provide useful information on the overall health status of the wearer as well as notify the medical care personnel in emergency situations such as seizures. The sensory information will also assist in validating the predictions to be made via modelling of the human dynamics for the purposes of determining optimal sensor locations for patient-specific activities. In addition, examining the body movement in seizure and representing the epilepsy seizure by a mechanical model in terms of speed, velocity and acceleration, will also provide further information such as distinguishing the seizure response from response due to daily activities.
It may be pointed out that some simplifying assumptions had to be made in the human body modelling to reduce the complexity of the system to a reasonable number of degrees of freedom since the primary focus of the present work is on the prediction of optimal locations in this work. These assumptions include: the effect of the muscle and the muscle activation during epileptic seizure is neglected; proposed approach only considered the myoclonic seizure i.e. applied joint torques during myoclonic seizure are used in this study to calculate the angular velocities and other kinematics quantities which are later used in the optimization method - however, the approach can easily be extended to other types of seizures; a homogeneous shape is considered for arm in the optimization method, i.e. the width of arm is considered to be uniform along the length of the arm.
Organization of the Thesis
In the second chapter, the focus is on the human body modeling and simulation. For this purpose, in the first section of this chapter, biomechanical model for human body and the approach to develop that model is presented. The more detailed information on the segments, each joint's degree of freedom and subsequently the whole model's degree of freedom, model anthropometry data and finally joint torques are given.
Following to the third chapter, optimization technique for the placement of the inertial sensors on the arm is discussed and a technique is proposed to form the objective function for the optimization. Then the optimal placement is calculated using global optimization toolbox of MATLAB. Eventually, a sensitivity analysis is done to determine results' delicacy to the joint torque and damping coefficients, arm geometry and mass, and the inertial sensor's uncertainty.
In the fourth chapter, the emphasis is on developing a new technique to distinguish the epileptic seizure measured output signal using inertial sensors. For this purpose, joint torque calculation is proposed. The advantage of using this technique over using the conventional method of the integration of the output results of gyroscope and acceleration is also discussed.
Chapter five includes some preliminary experimental data derived from the epileptic seizure patient. In this chapter a comparison between normal and involuntary seizure-type activity is done using the experimental data. Finally applying the method presented in chapter four the feasibility of the technique is investigated.
Chapter six includes some remarks of the thesis as well as detailed analysis of the experimental data and the proposed technique's application. Recommendations for future work are also presented in this chapter. Furthermore, Motion Genesis code as well as the objective function's MATLAB code is included in the appendix.