"MathWorks tools enable us to integrate different fields—image processing, statistical analysis, device control, and numerical computation. If we had used other tools, it would have taken much more time, or at least twice as many people."

Dr. Stiliyan Kalitzin, Dutch Epilepsy Clinics Foundation

Detecting epileptic seizures with video.

To diagnose epilepsy, classify seizures, and determine the most appropriate treatment option, physicians monitor patients using electroencephalogram (EEG) and visual cues. However, this approach has proven labor-intensive and costly, requiring patients to remain attached to EEG equipment and neurologists to monitor hours of video tape.

Researchers at the Dutch Epilepsy Clinics Foundation (Stichting Epilepsie Instellingen Nederland or SEIN) in the Netherlands are using MathWorks tools to develop a system that automates the detection of epileptic seizures by applying advanced video processing techniques.

"We wanted to develop an automated or semi-automated remote system that is not directly linked to the patient," explains Dr. Stiliyan Kalitzin, Chairman of the Medical Physics Department at the Dutch Epilepsy Clinics Foundation. "With MathWorks tools, we have a single platform to acquire video from multiple sources, develop algorithms that detect motion common in seizures, validate the system, and deliver results."

"Detecting seizures in this way is challenging," says Kalitzin. "Human observers are susceptible to fatigue, which can cause them to miss seizures. Filtering out irrelevant video data is tedious. The process is also costly because we dedicate a trained technician to monitor each patient and three neurology specialists to review EEG and video data offline."

SEIN sought to develop a system that could automatically identify seizures based on movements in patient video. Researchers also wanted to use continuous real-time streaming video as input, enabling the system to alert caregivers at the onset of a seizure. Finally, the group needed an integrated development environment that supported image acquisition from a variety of sources, video processing, algorithm development, and statistical validation.

Solution

SEIN researchers used MATLAB, Simulink, and Computer Vision Toolbox™ to build a system that automatically detects epileptic seizures by analyzing the movements of epilepsy patients using video data.

Dr. Kalitzin began by partitioning the project into three segments: image acquisition, processing and analysis, and system output. This facilitated a modular system design, enabling the researchers to focus on algorithm development and switch between various input formats and output options.

The team used Simulink and Computer Vision Toolbox to acquire video data from existing AVI and MPEG files, enabling them to test their algorithms from hundreds of patient videos.

Epileptic seizures are characterized by specific kinds of patient movement: myoclonic seizures are distinguished by single jerks, tonic seizures by stiffening, and clonic seizures by repetitive, rhythmic jerks. SEIN researchers used Computer Vision Toolbox to detect this motion in video sequences using optical flow techniques.

They estimated velocity fields using the Optical Flow block from Computer Vision Toolbox and then averaged the velocity fields over multiple frames to reduce the amount of data to be processed. They also isolated positive and negative velocity elements to avoid mutual cancellation between pixels. The team then refined this algorithm by processing thousands of image streams of patients in various positions.

After developing the algorithm for detecting seizures, the team used MATLAB, Statistics and Machine Learning Toolbox™, Image Processing Toolbox™, and Signal Processing Toolbox™ to validate the results by comparing them to methods that rely on electromyography, EEG, and video.

Validation results were then used to adjust the sensitivity of the algorithm using a Simulink model. Depending on whether the application will be used for diagnosis or real-time patient monitoring, the model can be increased to detect all seizure-like events or reduced to lower the number of false positives.

Kalitzin plans to enhance the algorithm by automatically selecting a region of interest, which will minimize false positives caused by caregivers that enter the frame. SEIN researchers are also working with other hospitals on automated real-time monitoring of patients using Image Acquisition Toolbox™ to acquire video data from a web camera.

Results

Increased levels of patient safety. "During testing, the system identified 10–25% more seizures than were initially recognized by a trained neurologist over a 24-hour period," says Kalitzin. "The algorithm itself is about 99% accurate when only the patient is in the frame."

Reduced costs. "With MathWorks tools, we can automate the identification of seizure events and insert markers for further inspection by a neurologist," explains Kalitzin. "We expect to process three times as many patients without expanding our staff. When used in home monitoring, the new technique will further reduce costs by eliminating expensive hospital admissions and clinical observation."

Streamlined development. "The versatility of MathWorks tools enabled us to use a common platform for the entire project," notes Kalitzin. "If we had used other tools, it would have taken much more time, or at least twice as many people."