Journal of Computational Analysis and Applications VOL. 34, NO.
7, 2025
COMPARATIVE ANALYSIS OF BRAIN ACTIVITY CLASSIFICATION USING
CONVOLUTION NEURAL NETWORKS
Adeel Hashmi
Department of Computer Science & Engineering, School of Engineering & Technology,
Vivekananda Institute of Professional Studies – Technical Campus, New Delhi
[email protected]
Abstract
Electroencephalograms (EEGs) play a crucial role in detecting harmful brain activity by
capturing electrical signals from the brain. This study aims to develop a deep learning framework
for classifying EEG images into their respective brain activity categories. To achieve this, raw
EEG signals were first converted into spectrograms, which provide a visual representation of
signal frequencies over time. These spectrograms were then processed using pre-trained deep
learning models to determine the most effective model for accurate classification. The dataset
used for training and evaluation consists of EEG recordings categorized into six distinct brain
activity labels. The deep learning models implemented for this classification task include VGG16,
AlexNet, ResNet, and InceptionV3. The models were trained using a comprehensive dataset, and
their performance was assessed using standard evaluation metrics. After extensive
experimentation and comparison, the results indicate that InceptionV3 outperforms the other
models in classifying EEG spectrograms. Its superior performance can be attributed to its
advanced architecture, which effectively captures complex patterns within the spectrogram data.
These findings highlight the potential of deep learning in analyzing EEG signals and classifying
harmful brain activities with high accuracy. Future research could explore further improvements
by incorporating more advanced neural architectures, such as Vision Transformers or custom-
built CNN models, to enhance classification performance beyond what pre-trained models can
achieve.
Keywords:
Anomaly Detection; EEG classification; Deep Learning; Convolution Neural Networks
1. INTRODUCTION
The classification of harmful brain activity using machine learning and deep learning represents
a crucial advancement in neuroscience, with significant implications for diagnosing, treating, and
managing neurological disorders. By employing sophisticated computational techniques to
analyze complex brain signals, researchers aim to develop precise and efficient tools for detecting
and categorizing abnormal neural activity linked to conditions such as epilepsy, Alzheimer's
disease, Parkinson's disease, and traumatic brain injury.
Electroencephalography (EEG) is a primary modality used to study brain activity, capturing
electrical signals through electrodes placed on the scalp. As a non-invasive and cost-effective
method, EEG enables real-time monitoring of brain function. Deep learning models including
CNNs and RNNs, have demonstrated significant potential in identifying abnormal EEG patterns,
particularly in epileptic seizure detection. These models automatically learn meaningful features
from raw EEG data, leading to improved seizure prediction and classification accuracy.
Beyond scalp EEG, intra-cranial EEG (iEEG) offers higher spatial resolution by placing
electrodes directly on the brain's surface or within neural tissue. Deep learning approaches applied
to iEEG data have been instrumental in localizing epileptogenic zones and aiding surgical
interventions for patients with drug-resistant epilepsy. By analyzing spatiotemporal patterns
19
Adeel Hashmi et al 19-27
Journal of Computational Analysis and Applications VOL. 34, NO. 7, 2025
within iEEG recordings, these models assist clinicians in pinpointing abnormal brain activity
regions responsible for seizures.
Machine learning and deep learning methodologies extend beyond EEG and iEEG to other
neuroimaging techniques such as fMRI, PET, and MEG. These modalities provide
complementary insights into brain structure, function, and metabolism, facilitating the diagnosis
and characterization of various neurological disorders. For instance, deep learning models trained
on fMRI data have been used to differentiate between Alzheimer's disease patients and healthy
individuals based on patterns of brain connectivity and activity.
Additionally, machine learning algorithms play a crucial role in analyzing multimodal data fusion,
where information from multiple imaging techniques or biological markers is combined to
enhance diagnostic accuracy and prognostic prediction. Integrating EEG, fMRI, and genetic data
can lead to a deeper understanding of neurological disorders and support personalized treatment
strategies tailored to individual patient needs.
Despite these advancements, several challenges persist in harmful brain activity classification.
Issues such as data heterogeneity, small sample sizes, and variability among patient populations
pose hurdles to developing robust and generalizable models. Moreover, ensuring model
interpretability and clinical applicability remains essential for translating research findings into
effective medical practice.
This paper is structured as follows: Section 1 introduces machine learning applications in
neuroimaging, Section 2 reviews prior research on EEG-based classification, Section 3 outlines
the methodology and algorithms employed, Section 4 presents experimental results and analysis,
and Section 5 concludes with future research directions.
2. LITERATURE REVIEW
EEG classification has received considerable attention in neuroscience research, particularly for
applications such as brain-computer interfaces (BCIs), epileptic seizure detection, and cognitive
state estimation. Several influential studies have significantly contributed to advancing EEG data
analysis and classification methodologies.
In neuroimaging, the searchlight algorithm [1] is a widely used multivariate pattern analysis
(MVPA) technique that helps identify localized brain regions associated with specific cognitive
or behavioral tasks. This method systematically scans small, overlapping clusters of voxels (3D
pixels) across the brain, applying classification or decoding techniques to determine whether
neural activity within each cluster differentiates between experimental conditions. The accuracy
results are mapped across the brain, revealing regions where neural patterns are most informative.
This approach enables a fine-grained, data-driven exploration of brain-behavior relationships
without requiring prior assumptions about relevant brain areas.
A comprehensive review by [2] discusses deep learning applications in EEG and
magnetoencephalography (MEG) data analysis. The authors examine various deep learning
architectures, datasets, and challenges in utilizing deep learning for EEG and MEG classification
tasks. Another review by [3] specifically explores the use of deep learning techniques for
classifying motor imagery tasks based on EEG signals, addressing different architectures,
preprocessing methods, and classification challenges.
Acharya et al. [4] pioneered an early method for automated epileptic seizure detection using EEG
signals. Their approach involved extracting features based on line length and employing artificial
neural networks (ANNs) for classification, demonstrating promising results. In a subsequent
study, Acharya et al. [5] proposed an entropy-based feature extraction method for epileptic EEG
20
Adeel Hashmi et al 19-27
Journal of Computational Analysis and Applications VOL. 34, NO. 7, 2025
classification, using machine learning models such as support vector machines (SVMs) and
ANNs.
Lawhern et al. [6] introduced EEGNet, a compact convolutional neural network (CNN)
architecture specifically designed for EEG-based BCIs. EEGNet achieved state-of-the-art
performance on several benchmark datasets, particularly for motor imagery and P300 speller
tasks. In another study, Dahshan et al. [7] investigated deep learning techniques for epileptic
seizure prediction using EEG data, developing a CNN architecture and evaluating various
preprocessing strategies and network configurations.
These key studies underscore the importance of machine learning and deep learning in EEG
classification research, contributing to advances in BCIs, epileptic seizure detection, and clinical
decision support systems for neurological disorders. Several high-level frameworks streamline the
application of machine learning to neuroimaging. PyMVPA [8], a Python-based package, supports
multivariate pattern analysis while integrating with external tools such as R, scikit-learn, and
Shogun [9]. PRoNTo [10], developed in Matlab, interfaces with SPM but provides a limited
selection of machine learning algorithms.
Before applying statistical learning to neuroimaging data, standard preprocessing steps are
necessary. For fMRI, preprocessing typically involves motion correction, slice timing correction,
co-registration with an anatomical image, and normalization to a common template such as the
Montreal Neurological Institute (MNI) space. Widely used tools for these processes include SPM
[11] and FSL [12], with a Python interface available through the nipype library [13].
In [14], the authors collected raw EEG signals using an Emotiv Epoc+ X 14-channel headset and,
after outlier detection, reduced the dataset to 62,286 rows and 86 columns. They trained four
machine learning models—kNN, SVM, decision trees, and random forest—on the dataset, finding
that the SVM model achieved the best performance.
3. METHODOLOGY
Brain waves are electrical signals in the brain that vary over time and are measured in volts. These
waves are categorized into five primary types based on their frequency ranges. Gamma (γ) waves,
exceeding 35Hz, are associated with heightened cognitive activity and intense focus. Beta (β)
waves, spanning 12Hz to 35Hz, are linked to alertness and anxiety. Alpha (α) waves, ranging from
8Hz to 12Hz, indicate a relaxed but awake state. Theta (θ) waves, occurring between 4Hz and
8Hz, are connected to deep relaxation and light sleep. Lastly, Delta (δ) waves, with frequencies
from 0Hz to 4Hz, are predominant during deep sleep.
Electroencephalography (EEG) data consists of multiple channels, each capturing brain wave
activity from different regions of the brain. Typically, EEG data is formatted as a multi-channel
time series that requires preprocessing before analysis. One useful technique for visualizing
frequency changes over time is the spectrogram, which represents how signal frequencies evolve.
A spectrogram is generated using the Short-Time Fourier Transform (STFT), which segments the
signal into overlapping windows and applies the Fourier transform to each, revealing frequency
content over time.
To extract meaningful features from EEG data, spectrograms can be derived from EEG signals.
Standardizing these spectrograms ensures consistency in their dimensions before processing them
through deep learning models. Various deep learning architectures, including AlexNet, VGG-16,
ResNet, and InceptionV3, are applied to the preprocessed spectrograms to classify brain wave
patterns. Model performance is evaluated to determine the most effective approach for EEG signal
analysis (Figure-1).
21
Adeel Hashmi et al 19-27
Journal of Computational Analysis and Applications VOL. 34, NO. 7, 2025
EEG dataset
↓
Conversion to
Spectrograms
↓
Pre-process
the
Spectrograms
↓
Train Deep
Learning
Model
↓
Classify the
Spectrograms
↓
Evaluate the
models
Fig.1. Methodology
AlexNet [15] was one of the first convolutional neural networks (CNNs) to revolutionize
computer vision. It won the 2012 ImageNet Large Scale Visual Recognition Challenge (ILSVRC),
significantly surpassing previous approaches. The architecture consists of five convolutional
layers followed by three fully connected layers, incorporating ReLU activations and max-pooling
layers. AlexNet introduced key innovations, such as extensive use of dropout to mitigate
overfitting and the ReLU activation function, which accelerated training.
The Visual Geometry Group (VGG) at the University of Oxford developed VGG16 and VGG19
[16] as part of their deep learning research. These models follow a simple yet effective
architectural design, consisting of only 3×3 convolutional layers and 2×2 max-pooling layers.
VGG16 includes 13 convolutional layers and three fully connected layers, while VGG19 extends
this with additional convolutional layers. Despite their straightforward structure, VGG networks
achieve outstanding performance in various computer vision tasks and serve as benchmark
architectures. However, their deep layer stack, while beneficial for feature extraction, makes them
computationally intensive compared to shallower networks like AlexNet.
ResNet [17] introduced "residual learning," where the network learns the difference between input
and output rather than mapping the function directly. This is achieved through shortcut
connections (also called skip connections or identity mappings), which allow gradients to
propagate more effectively during backpropagation, addressing the vanishing gradient problem.
The architecture is built upon residual blocks, which include identity blocks, where the shortcut
connection passes input directly to the output if dimensions remain unchanged, and convolutional
blocks, which use 1×1 convolutions to match input and output dimensions. ResNet architectures
are categorized by layer depth, including ResNet-18, ResNet-34, ResNet-50, ResNet-101, and
ResNet-152. Deeper versions, such as ResNet-50 and beyond, incorporate bottleneck blocks,
which use 1×1, 3×3, and another 1×1 convolution to reduce computational cost while preserving
representational power.
22
Adeel Hashmi et al 19-27
Journal of Computational Analysis and Applications VOL. 34, NO. 7, 2025
GoogleNet [18], also known as Inception V1, was developed by Google researchers as part of the
GoogLeNet project. Its key innovation is the Inception module, which integrates multiple
convolutional layers with different filter sizes operating in parallel. This design allows the network
to capture multi-scale features while maintaining computational efficiency. The Inception module
comprises four parallel paths: 1×1 convolutions for fine-grained features, 3×3 convolutions for
medium-sized features, 5×5 convolutions for capturing larger features, and max-pooling to retain
spatial information. To optimize efficiency, 1×1 convolutions are used for dimensionality
reduction before applying larger filters. Additionally, auxiliary classifiers attached to intermediate
layers serve as a form of regularization, preventing the vanishing gradient problem during training.
While these auxiliary classifiers are discarded during inference, they enhance the model's training
stability.
DenseNet [19] (Dense Convolutional Network), developed by Facebook AI Research (FAIR),
introduces dense connections, where each layer is connected to all subsequent layers within a
dense block. This design promotes feature reuse, enhances gradient flow, and mitigates the
vanishing gradient problem. Due to its efficient parameter sharing, DenseNet delivers strong
performance on various image classification tasks while requiring fewer parameters compared to
traditional deep networks.
EfficientNet [20] introduces a novel method that uniformly adjusts the network’s depth, width,
and resolution. These coefficients, denoted as phi (ϕ), control the network’s size across different
dimensions. By scaling all dimensions simultaneously, EfficientNet achieves superior
performance compared to traditional scaling methods while maintaining computational efficiency.
The architecture is built upon a baseline model, EfficientNet-B0, which is designed for optimal
accuracy while remaining computationally efficient. Its structure consists of a backbone network
composed of repeated blocks, similar to architectures like ResNet. Each block includes a series of
convolutional layers followed by batch normalization and activation functions such as Swish or
ReLU. EfficientNet employs compound scaling to systematically expand the network’s depth,
width, and resolution, ensuring balanced growth across all dimensions. A key innovation in
EfficientNet is the introduction of the "MBConv" block (Mobile Inverted Residual Bottleneck
Convolutional), inspired by MobileNetV2. The MBConv block utilizes depth-wise separable
convolutions followed by squeeze-and-excitation (SE) blocks, which dynamically recalibrate
channel-wise feature responses. This design enhances feature representation while keeping the
model compact and computationally efficient. EfficientNet offers multiple model variants,
ranging from EfficientNet-B0 to EfficientNet-B7, each utilizing different scaling coefficients to
balance model size and performance. Smaller variants, such as EfficientNet-B0, are well-suited
for resource-constrained environments, while larger models, like EfficientNet-B7, deliver state-
of-the-art performance on large-scale datasets.
InceptionV3 [21] builds upon earlier Inception architectures, introducing several optimizations
for large-scale image classification. Factorized convolutions replace large filters with smaller
ones, reducing computational complexity. Auxiliary classifiers assist in training by improving
gradient propagation, helping deeper networks converge effectively. Batch normalization is
applied across all layers, stabilizing training and accelerating convergence. Label smoothing
regularizes predictions to prevent overconfidence, improving generalization. Efficient grid size
reduction techniques replace pooling operations with carefully designed convolutions to preserve
feature integrity during downsampling. InceptionV3 is widely used in transfer learning, allowing
pre-trained weights from datasets like ImageNet to be fine-tuned for applications such as medical
imaging, object detection, and facial recognition. The model's balance between accuracy and
computational efficiency makes it suitable for both high-end GPUs and optimized edge devices.
Despite the rise of newer architectures like EfficientNet and Vision Transformers, InceptionV3
remains a foundational model in computer vision, influencing subsequent deep learning
advancements. Its efficient design and robust feature extraction capabilities ensure its continued
relevance across diverse AI applications, from medical diagnostics to industrial automation.
23
Adeel Hashmi et al 19-27
Journal of Computational Analysis and Applications VOL. 34, NO. 7, 2025
4. EXPERIMENTS & RESULTS
The dataset used in the experiments is the Harmful Brain Activity Classification dataset, sourced
from Kaggle. It comprises 17,300 EEG recordings and 11,138 spectrograms, all stored in parquet
format. Additionally, a CSV file is provided containing metadata, specifying that each EEG must
be classified into one of the following categories (Figure-2): seizure, lateralized periodic
discharges (LPD), generalized periodic discharges (GPD), lateralized rhythmic delta activity
(LRDA), generalized rhythmic delta activity (GRDA), or other. Several CNN architectures were
implemented using the PyTorch library, and their performance was evaluated.
Fig.2. Spectrograms for different brain activities
The various evaluation metrics used to evaluate results are as follows:
Accuracy: One of the simplest metrics, accuracy measures the fraction of correctly classified points out of
the total points. It's appropriate for balanced datasets but can be deceptive when classes are imbalanced.
𝑇𝑃+𝑇𝑁
𝐴𝑐𝑐 = 𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁 (1)
Precision: Precision measures the fraction of correct positive predictions out of all positive predictions. It's
a good metric when the cost of false positives is high.
𝑇𝑃
𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 = 𝑇𝑃+𝐹𝑃 (2)
Recall (Sensitivity): Recall measures the fraction of correct positive predictions out of all actual positives.
It's useful when the cost of false negatives is high.
𝑇𝑃
𝑅𝑒𝑐𝑎𝑙𝑙 = 𝑇𝑃+𝐹𝑁 (3)
F1 Score: It is most appropriate to use when there's an imbalance between classes.
𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 ×𝑅𝑒𝑐𝑎𝑙𝑙
𝐹1 𝑠𝑐𝑜𝑟𝑒 = 2 × 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛+𝑅𝑒𝑐𝑎𝑙𝑙 (4)
24
Adeel Hashmi et al 19-27
Journal of Computational Analysis and Applications VOL. 34, NO. 7, 2025
Performance Comparision
100.00%
95.00%
90.00%
85.00% Precision
80.00% Recall
75.00% F1-score
Exception Inception
VGG-16 AlexNet ResNet
Net V3 Accuracy
Precision 93.63% 93.17% 88.14% 93.64% 94.32%
Recall 89.92% 89.21% 85.28% 97.71% 91.68%
F1-score 93.08% 97.98% 91.19% 87.92% 96.57%
Accuracy 85.06% 90.32% 90.60% 97.71% 99.68%
Fig.3. Performance comparison of different models
From Figure-3, we can infer that InceptionV3 gives the best result compared to VGG-16, AlexNet, and ResNet in
terms of all the evaluation metrics. Figure-4 below is the confusion matrix for InceptionV3 on the dataset.
Fig.4. Confusion Matrix (InceptionV3)
5. CONCLUSION & FUTURE SCOPE
25
Adeel Hashmi et al 19-27
Journal of Computational Analysis and Applications VOL. 34, NO. 7, 2025
This study demonstrates the effectiveness of deep learning models in classifying EEG spectrograms to detect
harmful brain activity. By converting EEG signals into spectrograms and utilizing pre-trained CNN architectures,
we were able to identify the most suitable model for accurate classification. Among the models evaluated,
InceptionV3 exhibited the highest performance across multiple evaluation metrics, highlighting its capability to
extract meaningful features from EEG spectrograms. These findings reinforce the potential of deep learning in
medical diagnostics, particularly in the analysis of brain activity, and pave the way for further advancements in
automated EEG classification.
Future research can explore more advanced neural architectures, such as Vision Transformers, which have shown
promise in various image classification tasks. Additionally, developing specialized custom CNN models tailored to
EEG spectrogram analysis could further enhance classification accuracy and efficiency. Incorporating domain
adaptation techniques and transfer learning from larger EEG datasets may also improve model generalization.
Furthermore, integrating explainable AI techniques could provide deeper insights into the decision-making process
of the models, making them more interpretable for medical professionals. Finally, real-time EEG classification
systems can be developed for clinical applications, enabling faster and more reliable detection of harmful brain
activity in real-world scenarios.
REFERENCES
1. N. Kriegeskorte, R. Goebel, and P. Bandettini, “Information-based functional brain mapping,” in
Proceedings of Natl. Acad. Sci. U.S.A. 103, 3863–3868, 2006.
2. L. F. L. Schirrmeister, et al. "Deep learning in EEG and MEG: a review of applications and challenges."
Journal of Neural Engineering, 2017.
3. H. Zhang, et al. "Deep learning for EEG-based motor imagery classification: a review." Journal of Neural
Engineering, 2020.
4. U. R. Acharya, et al. "Automated epileptic seizure detection in EEGs based on line length feature and
artificial neural networks." Journal of Neuroscience Methods, 2005.
5. U.R. Acharya, et al. "Automated diagnosis of epileptic EEG using entropies." Biomedical Signal Processing
and Control, 2011.
6. V. J. Lawhern, et al. "EEGNet: A compact convolutional neural network for EEG-based brain-computer
interfaces." Journal of Neural Engineering, 2018.
7. H. M. Dahshan, et al. "Deep learning for seizure prediction using EEG data." International Conference on
Machine Learning and Applications (ICMLA), 2017.
8. M. Hanke, Y. O. Halchenko, P. B. Sederberg, S. J. Hanson, J. V. Haxby, and S. Pollmann, “PyMVPA: a
python toolbox for multivariate pattern analysis of fMRI data,” Neuroinformatics, vol. 7, no. 37–53, 2009.
9. S. Sonnenburg, G. Rätsch, S. Henschel, C. Widmer, J. Behr, A. Zien, et al, “The SHOGUN machine
learning toolbox,” Journal of Machine Learning Research, vol. 11, 2010.
10. J. Schrouff, M J. Rosa, J. Rondina, A. Marquand, C. Chu, J. Ashburner, et al, “PRoNTo: pattern recognition
for neuroimaging toolbox,” Neuroinformatics, vol. 11, pp. 319–337, 2013.
11. Statistical Parametric Mapping: The Analysis of Functional Brain Images. London: Academic Press.
12. S. M.Smith, M. Jenkinson, M. W. Woolrich, C. F. Beckmann, T. E. Behrens, H. Johansen-Berg, et al.
“Advances in functional and structural MR image analysis and implementation as FSL,” Neuroimage 23,
S208–S219, 2004.
13. K. Gorgolewski, C. D. Burns, C. Madison, D. Clark, Y. O. Halchenko, M. L. Waskom, et al., “Nipype: a
flexible, lightweight and extensible neuroimaging data processing framework in python,” Front.
Neuroinform. vol. 5, no. 13, 2011.
14. H. Gaikwad, S. Gandhi, A. Kiwelekar, and M. Laddha, “Analyzing Brain Signals for Predicting Students’
Understanding of Online Learning: A Machine Learning Approach,” International Journal of
Performability Engineering, vol. 19, no. 7, pp.462, 2023.
26
Adeel Hashmi et al 19-27
Journal of Computational Analysis and Applications VOL. 34, NO. 7, 2025
15. A. Krizhevsky, I. Sutskever, and G. E. Hinton, “ImageNet Classification with Deep Convolutional Neural
Networks,” in Advances in Neural Information Processing Systems (NeurIPS), pp. 1097-1105, 2012.
16. K. Simonyan, and A. Zisserman, “Very Deep Convolutional Networks for Large-Scale Image Recognition,”
in International Conference on Learning Representations (ICLR), 2014.
17. K. He, X. Zhang, S. Ren, and J. Sun, “Deep Residual Learning for Image Recognition,” in Proceedings of
the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770-778, 2016.
18. C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed and D. Anguelov, “Going Deeper with Convolutions,” in
Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1-9, 2015.
19. G. Huang, Z. Liu, L. Van Der Maaten, and K. Q. Weinberger, “Densely Connected Convolutional
Networks,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR),
pp. 2261-2269, 2017.
20. M. Tan and Q. V. Le, “EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks,” in
Proceedings of the 36th International Conference on Machine Learning (ICML), pp. 6105-614, 2019.
21. C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, & Z. Wojna, Z. “Rethinking the Inception Architecture for
Computer Vision,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition
(CVPR), 2818-2826, 2016.
27
Adeel Hashmi et al 19-27