Intelligent System for Screening Epileptic Seizures in the Erbil Electroencephalogram Epilepsy Dataset Images Utilizing Cascaded Histogram of Oriented Gradients-Gray Level Co-occurrence Matrix Features

Hero Abdullah Mohammed1*, Salih Omer Haji1, Raghad Zuhair Yousif1,2

1Department of Physics, College of Science, Salahaddin University-Erbil, Erbil, Kurdistan Region, Iraq, 2Department of Computer Engineering, College of Engineering, Knowledge University, Erbil 44001, Iraq

Corresponding author’s e-mail: Hero Abdullah Mohammed, Department of Physics, College of Science, Salahaddin University-Erbil, Erbil, Kurdistan Region, Iraq. E-mail: hero.mohammed@su.edu.krd
Received: 24-05-2025 Accepted: 27-07-2025 Published: 09-09-2025

DOI: 10.21928/uhdjst.v9n2y2025.pp115-128



ABSTRACT

Driven by strong demand on easy-to-use, accurate, and automated diagnosis tools to help people with epilepsy, especially in the Kurdistan region, where is a scarcity of specialized doctors in remote places, this study proposes a novel approach for epileptic seizure detection from electroencephalogram (EEG) signals using a statistical feature extraction method that being derived from a cascaded histogram of oriented gradients (HOG) and gray level co-occurrence matrix (GLCM) techniques for (117 normal) non-epileptic seizure and (117 abnormal) epileptic seizure diagnosed EEG signal images collected from Erbil teaching hospital. Four classification algorithms, namely support vector machine (SVM), K-Nearest Neighbors (KNN), decision tree, and discriminator with rigorous hyperparameter optimization using Bayesian techniques, were utilized to improve classification and three feature extraction approaches, cascaded HOG-GLCM, GLCM, based statistical features extraction, and HOG, were calculated. The proposed comprehensive simulation results revealed that the cascaded HOG-GLCM approach significantly outperforms single-feature methods. The SVM and KNN classifiers achieved exceptional performance with the cascaded features, both approximately reaching 98.57% accuracy, ensuring almost no epileptic events went undetected, which represents a substantial improvement over GLCM (best: 92.86% accuracy) and HOG approaches (best: 94.29% accuracy). The synergistic effect observed between gradient-based and texture-based features demonstrates how HOG captures directional patterns characteristic of seizure activity, while GLCM extracts spatial relationships within the signal. Neither feature type alone provides sufficient discriminative power, as evidenced by the 5–8% accuracy drop in single-feature approaches.

Index Terms: Histogram of Oriented Gradients, Machine Learning, Electroencephalogram, Epilepsy, Gray Level Co-occurrence Matrix

1. INTRODUCTION

Epilepsy represents one of the most prevalent neurological disorders worldwide, affecting approximately 51.7 million people globally as of 2021, with an age-standardized prevalence of 658/100,000 population [1]. Every year, the World Health Organization reports five million new cases [2]. The disorder disproportionately affects low- and middle-income nations, where over 80% of epileptics live and where treatment disparities may span 75% or more [3]. This great worldwide load emphasizes the urgent requirement for accurate, quick, and easily available diagnostic instruments. Epilepsy may arise from an anomaly in cerebral wiring, an imbalance of neurotransmitters, or a combination of these elements [4]. Neurons often create electrical signals that influence other neurons, glands, and muscles, resulting in human thoughts, emotions, and behaviors. Epilepsy is hard to diagnose since it has many different aspects. Epilepsy can happen when the wiring in the brai n is not right, when there are too many or too few neurotransmitters, or when these things happen together [4]. Neurons usually provide electrical signals that affect other neurons, glands, and muscles. This is how thoughts, feelings, and actions happen in people. Seizures can happen when these electrical patterns get messed up. They can cause strange feelings, emotions, behaviors, convulsions, muscle spasms, and loss of consciousness [5]. The problem is finding these unusual patterns in the complicated landscape of regular brain activity. The recent article published by Chen et al. in 2023 indicated that epilepsy is not only related to the seizure disorder but also results in unusual feelings, emotions, and behaviors, as well as convulsions, muscular spasms, and loss of consciousness that require management strategies [5].

The suggested cascaded histogram of oriented gradients-gray level co-occurrence matrix (HOG-GLCM) method solves these problems using the strengths of two well-known feature extraction methods that work well together. HOG is great at picking up gradient and edge information that shows the structural patterns of seizure activity. GLCM, on the other hand, is good at analyzing textural patterns and spatial correlations within electroencephalogram (EEG) signals in a more complex way. By combining these methods, we develop a feature extraction framework that is specifically designed to tell the difference between normal and epileptic EEG signals. This has a number of advantages over single-feature methods. The proposed cascaded approach has a number of benefits, including (1) better discriminative power by extracting both structural and textural features from EEG signals; (2) better performance across a range of signal conditions thanks to the multi-scale representation created by combining gradient-based and texture-based features; (3) better classification accuracy that is much better than using individual feature extraction methods; and (4) the ability to be scaled up for use in real-time clinical settings. However, there are some things to think about with this approach: (1) More complicated to compute than single-feature methods, so they need to be optimized for real-time use; (2) depend on high-quality EEG signal preprocessing to make sure feature extraction works; (3) need to carefully tune hyperparameter to get the best performance across different patient groups; and (4) need to be thoroughly validated across multiple datasets to show that they can be used in other situations.

2. RELATED WORK

In this section of our article, we will provide a comprehensive review of articles that are similar to the topic of our study. Several signal processing and feature extraction methods have been investigated for automatic epilepsy detection, such as time-domain, which was suggested by Fasil and Rajesh in 2019 [6], and also Chakrabarti et al. in 2012 used temporal properties of EEG to distinguish between normal and seizure cases [7]. Recently, researchers have used new techniques and methods to automatically detect the early stages of EEG. The study done by Shoeb in 2009 used machine learning based on support vector machine (SVM) to classify patient-specific data through the analysis of scalp EEG, which acquired 96% accuracy [8]. In 2020, Usman et al. used main component analysis for seizure prediction using the wavelet transform. Abnormal brain activity is seen to start before to a seizure, referred to as the predictable state. Twenty-three participants evaluated the models, resulting in a sensitivity of 93.1% for 84 seizures [9]. Investigated by Anuragi and Sisodia in 2020 are empirical wavelet transform-based automated alcoholism detection utilizing EEG signal characteristics. They presented an (EWT)-based automatic classification model for alcohol detection. With LS-SVM, they obtained 98% average accuracy and 98% area under the curve (AUC) value. Their research neglected important details on processing efficiency and real-time feasibility [10].

Ayman et al. (2023) conducted the identification of epileptic seizures by means of physical epileptic activity analysis instead of feature engineering; therefore, they classified epilepsy. K-Nearest Neighbors (KNN), (NB), (LR), (SGDC), (GB), decision tree (DT), and three deep learning models: Extreme learning machine (ELM), Long (LSTM), and (ANN) were seven separate machine learning techniques used for the binary categorizations of epileptic activity. With an accuracy of 100% and a 0.99 AUC, their proposed deep learning model, ELM, obtained the best results [11].

Farooq et al. (2023) conducted a review on the detection of epileptic seizures using machine learning, addressing its taxonomy, opportunities, and challenges. This research focused on identifying the most prevalent feature extraction techniques and classifiers used for the precise categorization of normal and epileptic seizures [12]. In 2023, Chandel et al. investigated the classification of epileptic EEG signals with a machine learning-based model. The differentiation between normal EEG and epileptic EEG has been conducted using three classification models: (RF), (DT), and (ET). Their conclusion indicates that the final classifier exhibits the highest performance, with an accuracy of 99.63 for the suggested approach [13].

In 2025, Atlam et al. introduced a new way to improve the detection of epileptic seizures using SMOTE to balance the data and a combination of techniques called PCA and DWT to select important features. The suggested method seeks to make seizure detection systems more accurate and dependable by fixing data imbalance and pulling out important features from EEG signals. Performance improvements were seen, with the SVM classifier achieving an accuracy of 97.30% [14].

Object identification, particularly for human recognition in images, is achieved through the use of HOG. It employs the “HOG descriptor,” a feature extraction method designed for human identification in an image [15]. Co-occurrence oriented gradient (CoHOG) histograms are a gradient-based technique used in many fields. The CoHOG method provides a consistent characterization of both statistical and differential properties of a texture [16].

Zhou et al. (2020) employed the HOG approach for feature extraction from raw Bayer pattern images [17]. Sarowar et al. (2019) utilized the (HOG) approach to extract features from images [18]. Bakheet and Al-Hamadi (2021) employed HOG features in conjunction with the SVM classifier to detect blinks and categorize power system equipment based on auditory data [19]. GLCM, introduced by Haralick et al. (1973), provides a statistical method for examining texture by analyzing spatial relationships between pixels [20]. GLCM has been widely applied in medical image analysis, offering valuable textural information that complements structural features. The integration of HOG and GLCM approaches has shown promise in various domains, as demonstrated by Kataoka et al. (2015) with their CoHOG [16]. This technique, as Thontadari and Prabhakar (2016) note, offers a consistent characterization of both statistical and differential attributes of texture [21].

The present study addresses these challenges by introducing a novel cascaded approach that combines HOG and GLCM techniques for EEG signal classification. This approach leverages the complementary strengths of both methods: HOG’s ability to capture gradient and edge information and GLCM’s capacity to analyze textural patterns and spatial relationships. By cascading these techniques, a feature extraction framework is specifically optimized for differentiating between normal and epileptic EEG signals.

Our research makes several significant contributions to the field:

  • A novel cascaded HOG-GLCM feature extraction methodology has been introduced, which effectively captures both structural and textural characteristics of EEG signals, enhancing classification accuracy.

  • Converting the EEG data from single dimension (signal data) to two dimensions (image data) which paved the road to use the techniques used in feature extraction of digital images in capturing the features of the EEG signal

  • The establishment of a comprehensive dataset of epilepsy signal images, called the Erbil Epilepsy Dataset, includes EEG recordings sourced from governmental hospitals in Erbil, Kurdistan, thus fulfilling the demand for diverse and representative datasets in epilepsy research.

  • To maximize classification performance, rigorous hyperparameter optimization (HPO) with Bayesian approaches was employed to fine-tune numerous classifiers.

The remainder of this paper is organized as follows: Section 3 details our methodology, including dataset collection, preprocessing, the proposed cascaded HOG-GLCM feature extraction approach, classification techniques, our experimental results, and comparative analysis. Section 4 discusses the implications of our findings, Section 5 computational complexity and real-time consideration, Section 6 limitations and constraints, and Section 7 concludes with a summary of contributions and directions for future research.

3. METHODOLOGY

The study focused on exploring four different methods for classifying EEG abnormalities. For each method, the system followed the essential steps of machine learning: Pre-processing the EEG signals collected, extracting relevant features, and performing classification. This approach allowed us to systematically analyze and categorize the EEG signals for accurate detection of seizure and non-seizure cases. The study focused on four different methods for classifying EEG abnormalities, following machine learning protocols for each method. This allowed for systematic analysis and categorization of EEG signals to accurately distinguish between seizure and non-seizure events. Fig. 1 below presents an example of two EEG image samples from the Erbil EEG Epilepsy Dataset, according to the categories under examination.

thumblarge

Fig. 1. Two samples of seizure and non-seizure electroencephalogram (EEG) brain signal images from Erbil EEG epilepsy dataset (a) seizure EEG brain signal image (b) non-seizure EEG brain signal image.

3.1. EEG Dataset Collection

Over 3 months from September to November 2024, the study collected 234 EEG cases from Erbil Teaching Hospital in the Kurdistan Region of Iraq. The dataset consisted of 117 normal (non-seizure) and 117 abnormal (seizure) recordings, collected from male and female patients across diverse age groups. Seizure cases were confirmed by skilled neurologists, while normal cases were validated by the absence of seizure activity EEG data were gathered using NIHON KOHDEN-brand software Neuroworkbench version 05–01 with 32 electrodes arranged based on the “10–20 system” for placing the electrodes and gain sensitivity of 100 μV (50 Hz) ranging from a high frequency of 30Hz to a low frequency of 0.03 Hz, but only 18 active electrodes were used. Fig. 2 depicts the EEG machine used in this study. Part of the collected images, namely 50 normal and 50 abnormal, have been uploaded to GitHub with URL https://github.com/DrRaghad-75/ErbilEEG_dataset-/tree/main, aiming to add complete documentation and images in the near future.

thumblarge

Fig. 2. Electroencephalogram signal recording done by the corresponding author utilizing Nihon Kohden-brand machine.

3.2. Proposed Model

Fig. 3 below demonstrates the flow chart for the proposed system model. In this model, each EEG recording a patient has undergone (seizure and non-seizure) categories to help identify their seizure state. The entire process can be broken down into five key components: EEG Dataset Collection, pre-processing, feature extraction, classification, and, eventually, performance evaluation metrics calculation.

thumblarge

Fig. 3. The pattern of the model used to classify normal and epileptic seizures.

3.3. Preprocessing

The preprocessing phase of EEG signals encompasses numerous critical procedures for efficient feature extraction for analysis. Initially, signal-to-image conversion is employed to convert 1D EEG signals into 2D RGB and then into single-band (grayscale) images. The single-band image is cropped to eliminate the borders, focusing just on the regions of interest. The resultant images are subsequently scaled to a uniform resolution of 256 by 256 pixels, assuring consistency for subsequent analysis and modeling. In the denoising stage, histogram equalization followed by Median filter has been used to improve image quality and diminish noise. Ultimately, image binarization has been utilized to transform the processed photographs into a binary format, thereby streamlining the data and highlighting essential structures. This readies the dataset for dependable feature extraction and classification activities. Combining these four steps into a single conceptual equation is as shown below:

I_enhanced(x,y) = Rgb2gray(imbinarize(imresize(imcrop(medfilt2(histeq(I_old(x,y)), [M N])), [256 256])));

3.4. Feature Extraction Methodology

Imagine trying to identify patterns in brain waves that could signal an epileptic episode. The proposed new approach intends to do just that by merging two potent technologies in a particular manner. The proposed cascaded approach first captures the structural “shape” of brain signals using (HOG) then examines how these patterns spatially connect using (GLCM), and finally extracts relevant statistical features to facilitate the classifier’s job to differentiate between normal brain activity from seizures. Recent work by Krishnan et al. (2024) showed that when time-based EEG signals are transformed into image-like representations, powerful computer vision techniques can be applied, which dramatically improve the ability to detect epilepsy [22]. This insight perfectly aligns with the proposed cascaded approach. Thus, the cascaded approach offers several key advantages that make it particularly well-suited for EEG signal classification: In the first place, it captures complementary information, think of HOG as an expert at identifying shapes and edges, while GLCM specializes in analyzing textures. By combining them, the best of both worlds can be captured - in another place provides multi-scale representation, hence, the proposed approach analyzes brain signals at different levels of detail - from local gradient patterns (HOG) to their spatial relationships (GLCM). This multi-layered view provides more comprehensive understanding of what’s happening in the brain. In the third place, it handles signal variations robustly - Brain signals naturally vary in amplitude and frequency, making them challenging to analyze. Fortunately, HOG does not get thrown off by local changes in signal strength (similar to how it handles lighting changes in images), while GLCM captures consistent textural patterns regardless of absolute signal values. This robustness is particularly valuable when analyzing EEG data from different patients or recording sessions. Eventually, it enhances discriminative power - The statistical features have been derived from HOG-GLCM matrices provide highly distinctive attributes that effectively differentiate between normal and epileptic EEG patterns.

3.4.1. Cascaded HOG-GLCM approach

The HOG feature extraction process follows these systematic steps:

1. Gradient computation: For each pixel in the EEG image, the horizontal gradient and vertical gradient have been calculated as indicated below [19]:

thumblarge

Where f(x, y) represents the pixel intensity at position (x, y).

2. Gradient magnitude and orientation: From these gradients, were computed using [19]

thumblarge

3. Cell histograms: Each EEG signal’s image is divided into small spatial regions called “cells” (typically 8 × 8 pixels). For each cell, the histogram of gradient orientations is computed by: Quantizing the orientation angles into bins (typically 9 bins covering 0°–180° for unsigned gradients), then weighting each pixel’s contribution by its gradient magnitude, and eventually accumulating these weighted votes into the orientation bins.

4. Block normalization: To account for variations in illumination and contrast, cells are grouped into larger spatial regions called “blocks” (typically 2 × 2 cells). The histograms within each block are concatenated and normalized using L2-norm depicted by equation 3 below [13]:

thumblarge

Where v is the unnormalized feature vector containing all histograms in a block, and ε is a small constant (typically 1e−5) to prevent division by zero.

5. Matrix creation: For a given HOG feature map with N normalized gray levels, N × N matrix is created where each element (i, j) represents the frequency of occurrence of pixel pairs with values i and j separated by a specific displacement vector (dx, dy).

6. Multiple direction analysis: To capture textural patterns in all directions, we compute GLCMs for four principal directions: 0° (horizontal), 45° (diagonal), 90° (vertical), and 135° (anti-diagonal), using displacement vectors (d, 0), (d, d), (0, d), and (–d, d) respectively, where d is the distance parameter (typically d = 1).

7. Normalization: Each GLCM is normalized by dividing each element by the total number of pixel pairs, converting the frequency counts to probability values:

thumblarge

Where C(i, j) is the count in the original GLCM, and P(i, j) is the normalized probability.

Poza et al. (2020) have validated the effectiveness of this multi-directional GLCM approach for analyzing complex patterns in biomedical signals [23].

8. Feature vector construction: The final HOG descriptor is formed by concatenating the normalized block histograms from all blocks in the detection window, creating a comprehensive feature vector that captures gradient information across the entire EEG image.

3.4.2. Statistical features extraction

This study has selected the following features. Contrast refers to the local variables or physical attributes quantified in the GLCM. Thus, variations or intensity differences are quantified in the GLCM [24].

thumblarge

As previously mentioned, P(i, j) represents the normalized probability of every pair at an angle of 0°. Homogeneity quantifies the proximity of the element distribution in the GLCM to its diagonal. It measures how close the element distribution in the GLCM is to its diagonal [24]:

thumblarge

Correlation denotes the linear dependence of gray level values inside the co-occurrence matrix.

thumblarge

Where μx, μy, and σx, σy, the means and standard deviations are specified [10]:

thumblarge

Entropy represents the unpredictability or level of disorder within an image generated by the GLCM pairs.

thumblarge

The energy measures how consistent the texture is, thus higher energy levels mean that the textures are more uniform and have fewer gray level transitions. Lower energy levels mean that the textures are more complex [24].

thumblarge

The five statistical features give a full picture of the textural aspects that come from the GLCM investigation. Each feature captures a separate aspect of the spatial relationships in the processed EEG images, making it a strong set of features for telling the difference between normal and epileptic patterns. The proposed system framework is presented by the algorithm below Algorithm 1:

ALGORITHM 1: Epileptic seizure classification using HOG.GLCM cascaded features

thumblarge

3.5. Experimental Settings and Implementation Details

The experimental conditions were carefully chosen to ensure fair comparisons between different feature extraction methods and classification algorithms. The study used a high-performance system with an Intel Core i7 processor, 8GB of RAM, and an NVIDIA GeForce RTX 3080 GPU for calculations. The dataset was divided into 70% for training and 30% for testing, ensuring fair representation of classes. A 10-fold stratified cross-validation was used for cross-validation to ensure accuracy and minimize random changes in data partitioning. Factors for feature extraction were improved through extensive testing. The cell size for HOG extraction was set to 8 × 8, the block size to 2 × 2, and the orientation bins to 9. The GLCM analysis set the displacement distance at 1 pixel and performed four directional analyses to gather information on texture. Bayesian optimization methods in MATLAB’s Optimization Toolbox were used to optimize hyperparameters, with the negative cross-validation accuracy set as the objective function. The optimization process was allowed to run for 100 iterations to find the best or nearly best solutions.

3.6. Classifications and Performance Evaluation Metrics

Classification is a machine learning methodology wherein training data are utilized to construct models, which are subsequently employed to predict new data. The constructed model is assessed using testing data to determine algorithm performance. Pixel-based image classification systems examine the numerical characteristics of designated image feature vectors and categorize data accordingly. This work employs four distinct classification techniques: (DT), (SVM), (KNN), and discriminator (DR) to categorize epilepsy from image datasets. It is worth to mention that the created data set features vector has been dismasted with a ratio of 70% for training and 30% for testing with 10 k-folds. The performance of the proposed classification technique for elliptical seizure detection is evaluated using confusion matrix metrics, including true positives (TP), false positives (FP), true negatives (TN), and false negatives (FN). These metrics enable the calculation of critical performance indicators such as follows [25]:

1. Sensitivity (Recall): Measures the proportion of correctly identified seizure events

thumblarge

2. Precision: Indicates the reliability of positive predictions

thumblarge

3. F1-Score: Balances precision and recall through the harmonic mean

thumblarge

4. Accuracy: Represents overall correct classifications

thumblarge

These metrics are widely used in medical diagnostics, particularly for epileptic seizure detection, where distinguishing abnormal EEG signals from normal ones is critical.

4. RESULTS AND DISCUSSION

All experiments and calculations were conducted in MATLAB version 2023b. Fig. 4a-e demonstrates the box plots for the five key statistical features, namely entropy, contrast, energy, correlation, and homogeneity, derived from all 234 EEG images scanned from the Erbil EEG Epilepsy Dataset. This leads to generate a feature vector of size 345 by 5, equally divided between the seizure and seizure images. The features plot depicted the remarkable separation between the previously mentioned two groups of classes (non-epileptic seizure and epileptic seizure). Consequently, Fig. 4a-e shows the box plots for the five most important statistical features that were taken from all 234 EEG images scanned from the Erbil EEG Epilepsy Dataset. These features are entropy, contrast, energy, correlation, and homogeneity. These box plots indicate important information about how well the derived features can mark the difference between normal and epileptic EEG patterns. Fig. 4’s analysis shows a number of important things about the retrieved features. The entropy characteristic (Fig. 4a) makes it easy to tell the difference between normal and epileptic instances. Epileptic signals have higher entropy values, which means that the textural patterns are more complicated and random. This conclusion fits with what doctors already know: Seizures cause neurons to fire in a more random way than regular brain activity. The contrast characteristic (Fig. 4b) shows big variations between the two classes, with epileptic signals having higher contrast values. This means that seizure activity makes that the converted EEG images show more pronounced changes in intensity, which is what happens when the raw signals fluctuate quickly in amplitude. Energy values (Fig. 4c) are lower for cases of epilepsy than for normal cases, which means that the textural patterns are less consistent during seizures. This finding backs up the idea that seizures change the typical patterns of brain activity. Fig. 4d shows that there are various patterns between normal and epileptic cases. For example, epileptic signals have different spatial correlation features. This means that the spatial correlations that GLCM analysis finds are useful for telling things apart. Fig. 4e shows that the classes are clearly different from one other in terms of homogeneity. Normal EEG signals have higher homogeneity values, which means that the patterns are more uniform than the patterns that happen during a seizure. This analysis makes a feature vector that is 234 by 5, with half of the images being non-seizure and the other half being seizure images. The characteristics analysis showed a clear difference between the two groups of classes we talked about earlier (non-epileptic seizure and epileptic seizure).

thumblarge

Fig. 4. (a-e) A box plot of the histogram of oriented gradients gray level co-occurrence matrix statistical features, the five features (Entropy, Contrast, Energy, Correlation, and Homogeneity) extracted from the Erbil electroencephalogram epilepsy dataset.

Consequently, around 70 images are randomly selected, with 35 from each class – non-seizure and seizure. Various comparative scenarios for feature extraction are evaluated using different machine learning techniques, including HoG features alone, GLCM followed by statistical features alone, and eventually, the cascaded HOG-GLCM method followed by statistical features extraction. Table 1 presents a detailed assessment of HPO for the four employed classifiers, which reveals that SVM outperforms other classifiers, achieving the lowest objective function value of 0.02439. KNN shows the highest potential for improvement, with projected values between 0.012195 and 0.0088702. The DT exhibits full stability in its hyperparameters, indicating a local optimum. SVM performs best with standardization applied, while KNN yields better results without it. The Box Constraint parameter for SVM reveals significant variation between observed and calculated values, suggesting room for optimization. Table 1 also gives clear insight into the trade-off between model complexity and performance, assisting in model selection and optimization for epileptic seizures. A comprehensive evaluation of epileptic seizure detection using different feature extraction methods and classification algorithms has been achieved in this article which reveals significant insights into the optimal approach for EEG signal analysis. The confusion matrices and performance metrics clearly demonstrate the superiority of the cascaded HOG-GLCM approach over either feature extraction method used independently. As depicted in Fig. 5, which displays the confusion matrices for different classifiers in the case of cascaded features, the SVM classifier achieved near-perfect performance with the recording an accuracy of 98.57%, precision of 97.22%, and most notably, a sensitivity of 100%. This perfect sensitivity indicates that the model successfully identified all epileptic cases without any false negatives – a critical factor in clinical applications where missing a seizure event could have serious consequences. The SVM’s F1-score of 98.59% further confirms the balanced performance between precision and recall. Similarly, the KNN classifier with HOG-GLCM features matched the SVM’s impressive performance, also achieving 98.57% accuracy and 100% sensitivity. The confusion matrix reveals that both SVM, KNN along with DR misclassified only a single case, resulting in a specificity of 97.14%, 97.22%, and 100%, respectively. This minimal error rate demonstrates the robustness of the cascaded feature approach when paired with these classifiers.

TABLE 1: Unified hyperparameter optimization table for all classifiers

thumblarge
thumblarge

Fig. 5. Confusion matrices for different classifiers in the case of cascaded features (histogram of oriented gradients-gray level co-occurrence matrix).

The DT classifier, while slightly less accurate at 95.71%, still performed admirably; its confusion matrix shows one false negative and two false positives, resulting in a sensitivity of 97.06% and specificity of 94.44%. The DR model achieved 98.57% accuracy with perfect precision and specificity (both 100%), misclassifying only one epileptic case as non-epileptic. This exceptionally high degree of sensitivity is especially important in clinical settings because it shows that the model correctly identified all cases of epilepsy without any false negatives. This is very important because missing a seizure could have serious consequences for patient safety and treatment plans.

As an alternative scenario for feature extraction to substantiate the superiority of the proposed feature extraction technique. Fig. 6 depicts the confusion matrices for different classifiers when using GLCM features followed by statistical feature extraction, all classifiers showed a noticeable decrease in performance compared to the cascaded approach. The SVM classifier achieved the highest accuracy among GLCM-only models at 92.86%, with balanced precision and sensitivity (both 91.43%). The confusion matrix reveals three false negatives and two false positives, indicating increased difficulty in class separation using only texture-based features. The KNN classifier with GLCM features performed slightly worse with 91.43% accuracy and identical precision, sensitivity, and F1-score values of 91.18%. The DT classifier struggled the most with GLCM features, achieving only 88.57% accuracy and 85.71% sensitivity, missing five epileptic cases. The DR model reached 90% accuracy with GLCM features, showing moderate performance with a sensitivity of 88.57%. These results suggest that while GLCM features extract significant textural information from EEG signal images, which are inadequate for effective seizure identification, especially when high sensitivity is essential.

thumblarge

Fig. 6. Confusion matrices for different classifiers when using gray-level co-occurrence matrix features, followed by statistical feature extraction.

Eventually, Fig. 7 demonstrated the confusion matrices for different classifiers when using HOG feature extraction, which performed better than GLCM features but still fell short of the cascaded approach. The SVM classifier with HOG features achieved 94.29% accuracy with balanced metrics across precision, sensitivity, specificity, and F1-score (all 94.29%). The confusion matrix shows two false positives and two false negatives, indicating a symmetrical error distribution. The KNN classifier with HOG features reached 92.86% accuracy with slightly lower sensitivity (91.43%) than precision (94.12%). The DT classifier achieved 90% accuracy, while the DR model performed slightly better at 92.86% accuracy with HOG features. These results indicate that gradient-based HOG features capture more discriminative information than GLCM features alone but still lack the comprehensive representation provided by the cascaded approach. The superior performance of the cascaded HOG-GLCM approach demonstrates a clear synergistic effect between gradient-based and texture-based features. This synergy can be attributed to the complementary nature of the information captured by each method. Table 2 reports all performance measures for all scenarios of feature extraction.

thumblarge

Fig. 7. Confusion matrices for different classifiers when using the histogram of oriented gradients feature extraction.

TABLE 2: The complete performance measures for all scenarios of feature extraction

thumblarge

5. COMPUTATIONAL COMPLEXITY AND REAL-TIME CONSIDERATIONS

The HOG feature extraction part takes O(N × M × B) time to run, where N × M is the size of the picture and B is the number of orientation bins. This means that each of the 256 × 256 pixel images with 9 orientation bins will need about 590,000 operations. The GLCM calculation is O(L2 × N × M), where L is the number of gray levels. With 256 gray levels, this takes about 16.7 million processes for each image. It takes an average of 0.15 s to extract features from one EEG image, but the time it takes to classify them varies by algorithm.

6. LIMITATIONS AND CONSTRAINTS

The proposed method for automatically detecting epilepsy has limitations due to the large dataset, difficulty in calculations, and the need for comparison and validation. The dataset consists of 234 EEG recordings from one institution, which may not fully represent real-world clinical populations. The cascaded HOG-GLCM method requires more processing power than simpler methods, making it less useful for real-time applications. The method also creates a high-dimensional feature space, making it difficult to use on limited resources or portable devices. Future research should focus on expanding datasets, validating across institutions, optimizing real-time, combining deep learning methods, and conducting clinical validation.

7. CONCLUSION

This study introduces a novel cascaded HOG-GLCM feature extraction methodology for epileptic seizure detection from EEG signal images. The comprehensive evaluation using the Erbil EEG Epilepsy Dataset demonstrates that this innovative approach substantially outperforms single-feature extraction methods, with a significant 5–8% improvement in accuracy. The synergistic integration of complementary feature extraction techniques – HOG capturing directional patterns characteristic of seizure activity and GLCM extracting spatial relationships – yields remarkable classification performance. SVM and KNN classifiers achieved 98.57% accuracy with perfect sensitivity (100%), ensuring no epileptic events went undetected. Most notably, the SVM classifier attained an exceptional F1-score of 98.59%, demonstrating balanced precision (97.22%) and recall with minimal error rate. Our comparative analysis quantitatively validates the superiority of the cascaded approach over GLCM-only (92.86% accuracy) and HOG-only (94.29% accuracy) methods. The rigorous Bayesian HPO further enhanced classification performance across all tested algorithms. The establishment of the first comprehensive epilepsy dataset from Erbil, Kurdistan, comprising carefully collected and preprocessed EEG recordings, addresses the critical need for diverse and representative data resources in epilepsy research. Future work should focus on computational optimization for real-time applications and integration with deep learning techniques while maintaining the high accuracy and perfect sensitivity demonstrated in this study, ultimately contributing to improved epilepsy management and patient outcomes worldwide.

8. ACKNOWLEDGMENT

The authors would like to thank Salahaddin University–Erbil for supporting this article and also the Erbil teaching hospital, especially Dr. Tahsin Muhsin Qadr, head of the EEG department.

REFERENCES

[1] V. L. Feigin, T. Vos, B. S. Nair, S. I. Hay, Y. H. Abate, A. H. A. Abd Al Magied, S. A. E. A. Abdelkader, M. A. Abdollahifar, A. Abdullahi, R. G. Aboagye, L. G. Abreu, S. A. Rumeileh, H. Abualruz,…&C. J. L. Murray. “Global, regional, and national burden of epilepsy, 1990-2021:A systematic analysis for the global burden of disease study 2021”. The Lancet Public Health, vol. 10, no. 3, pp. e203-e227, 2025.

[2] M. Leonardi, P. Martelletti, R. Burstein, A. Fornari, L. Grazzi, A. Guekht, R. B. Lipton, D. D. Mitsikostas, J. Olesen, M. O. Owolabi, E. Ruiz De la Torre, S. Sacco, T. J. Steiner, N. Surya, T. Takeshima, C. Tassorelli, S. J. Wang, T. Wijeratne, S. Yu and A. Raggi. “The world health organization intersectoral global action plan on epilepsy and other neurological disorders and the headache revolution:From headache burden to a global action plan for headache disorders”. The Journal of Headache and Pain, vol. 25, no. 1, 4, 2024.

[3] F. Lado, S. Ahrens and E. Riker. “Guidelines for Specialized Epilepsy Centers:Report of the National Association of Epilepsy Centers Guideline Panel”. vol. 386, 2024. https://lww.com/wnl/d [Last accessed on 2025 May 18].

[4] M. Mursalin, Y. Zhang, Y. Chen and N. V. Chawla. “Automated epileptic seizure detection using improved correlation-based feature selection with random forest classifier”. Neurocomputing, vol. 241, pp. 204-214, 2017.

[5] Z. Chen, M. I. Maturana, A. N. Burkitt, M. J. Cook and D. B. Grayden. “Seizure forecasting by high-frequency activity (80-170 Hz) in long-term continuous intracranial EEG recordings”. Neurology, vol. 99, no. 4, pp. e364-e375, 2022.

[6] O. K. Fasil and R. Rajesh. “Time-domain exponential energy for epileptic EEG signal classification”. Neuroscience Letters, vol. 694, pp. 1-8, 2019.

[7] S. Chakrabarti, A. Swetapadma and P. K. Pattnaik. A review on epileptic seizure detection and prediction using soft computing techniques. In:“Smart Techniques for a Smarter Planet Towards Smarter Algorithms“. Springer, Berlin, pp. 37-51, 2019.

[8] A. H. Shoeb. “Application of Machine Learning to Epileptic Seizure Onset Detection and Treatment”. Massachusetts Institute of Technology, United States, 2009.

[9] S. M. Usman, S. Latif and A. Beg. “Principle Components Analysis for Seizures Prediction using Wavelet Transform”. arXiv[Preprint], 2020.

[10] A. Anuragi and D. S. Sisodia. “Empirical wavelet transform based automated alcoholism detecting using EEG signal features”. Biomedical Signal Processing and Control, vol. 57, 101777, 2020.

[11] U. Ayman, M. S. Zia, O. D. Okon, N. U. Rehman, T. Meraj, A. E. Ragab and H. T. Rauf.“Epileptic patient activity recognition system using extreme learning machine method”. Biomedicines, vol. 11, no. 3, 816, 2023.

[12] M. S. Farooq, A. Zulfiqar and S. Riaz. “Epileptic seizure detection using machine learning:Taxonomy, opportunities, and challenges”. Diagnostics (Basel), vol. 13, no. 6, 1058, 2023.

[13] G. Chandel, S. K. Saini and A. Sharma. Epileptic eeg signal classification using machine learning based model. In:“2023 International Conference on Disruptive Technologies (ICDT)“. IEEE, United States, pp. 733-739, 2023.

[14] H. F. Atlam, G. E. Aderibigbe and M. S. Nadeem. “Effective epileptic seizure detection with hybrid feature selection and SMOTE-based data balancing using SVM classifier”. Applied Sciences, vol. 15, no. 9, 4690, 2025.

[15] S. S. I. Umar. “Accelerated Histogram of Oriented Gradients for Human Detection”. Universiti Teknologi Malaysia, Malaysia, 2016.

[16] H. Kataoka, K. Hashimoto, K. Iwata, Y. Satoh, N. Navab, S. Ilic and Y. Aoki. Extended co-occurrence hog with dense trajectories for fine-grained activity recognition. In:“Computer Vision--ACCV 2014:12th Asian Conference on Computer Vision”. Singapore, Singapore, November 1-5, 2014, Revised Selected Papers, Part V 12”. Springer, Berlin, pp. 336-349, 2015.

[17] W. Zhou, S. Gao, L. Zhang and X. Lou. Histogram of oriented gradients feature extraction from raw bayer pattern images. In:“IEEE Transactions on Circuits and Systems II:Express Briefs”. vol. 67. IEEE, United States, pp. 946-950, 2020.

[18] M. G. Sarowar, M. A. Razzak and M. A. Al Fuad. HOG feature descriptor based PCA with SVM for efficient &accurate classification of objects in image. In:“2019 IEEE 9th International Conference on Advanced Computing (IACC)”. IEEE, United States, pp. 171-175, 2019.

[19] S. Bakheet and A. Al-Hamadi. “A framework for instantaneous driver drowsiness detection based on improved HOG features and naïve bayesian classification”. Brain Sciences, vol. 11, no. 2, 240, 2021.

[20] R. M. Haralick, K. Shanmugam and I. H. Dinstein. Textural features for image classification. In:“IEEE Transactions on Systems, Man, and Cybernetics”. IEEE, United States, pp. 610-621, 1973.

[21] C. Thontadari and C. J. Prabhakar. “Scale space co-occurrence HOG features for word spotting in handwritten document images”. International Journal of Computer Vision and Image Processing (IJCVIP), vol. 6, no. 2, pp. 71-86, 2016.

[22] P. T. Krishnan, S. K. Erramchetty and B. C. Balusa. “Advanced framework for epilepsy detection through image-based EEG signal analysis”. Frontiers in Human Neuroscience, vol. 18, 1336157, 2024.

[23] J. Poza, C. Gómez, A. Bachiller and R. Hornero. “Spectral and nonlinear analyses of spontaneous magnetoencephalographic activity in Alzheimer's disease”. Journal of Healthcare Engineering, vol. 3, no. 2, pp. 299-322, 2012.

[24] S. O. Haji and R. Z. Yousif. “A novel run-length based wavelet features for screening thyroid nodule malignancy”. Brazilian Archives of Biology and Technology, vol. 62, p. e19170821, 2019.

[25] Aayesha, M. B. Qureshi, M. Afzaal, M. S. Qureshi and M. Fayaz. “Machine learning-based EEG signals classification model for epileptic seizure detection”. Multimedia Tools and Applications, vol. 80, no. 12, pp. 17849-17877, 2021.