Abstract
Migraine and epilepsy are common neurological disorders that share overlapping symptoms, such as visual disturbances and altered consciousness, making accurate diagnosis challenging. Although their underlying mechanisms differ, both conditions involve recurrent irregular brain activity, and traditional EEG-based diagnosis relies heavily on clinical interpretation, which may be subjective and insufficient for clear differentiation. To address this challenge, this study introduces an automated EEG classification framework combining Dual Tree Complex Wavelet Transform (DTCWT) for feature extraction with a Random Subspace Ensemble Classifier for multi-class discrimination. EEG data recorded under photic and nonphotic stimulation were analyzed to capture both temporal and frequency characteristics. DTCWT proved effective in modeling the non-stationary nature of EEG signals and extracting condition-specific features, while the ensemble classifier improved generalization by training multiple models on diverse feature subsets. The proposed system achieved an average accuracy of 99.50%, along with strong F-measure, AUC, and Kappa scores. Notably, although previous studies suggest heightened EEG activity in migraine patients during flash stimulation, findings here indicate that flash stimulation alone does not reliably distinguish migraine from epilepsy. Overall, this research highlights the promise of advanced signal processing and machine learning techniques in enhancing diagnostic precision for complex neurological disorders.