EEG signals analysis shows to be a crucial step for understanding brain activity and detecting mental states such as sleep, epilepsy and normal. Accurate automatic classification of EEG signals represents a complex task, requiring the use of sophisticated algorithms. In this light, we focus in this work on achieving the automatic epilepsy detection from EEG signals. The proposed methodology is based on developing two proposed Convolutional Neural Networks (CNN) including both CNN-1D and CNN-2D models. In the first stage, we have implemented a proposed light weighted CNN-1D architecture using EEG dataset of 500 patients, available from the Kaggle repository, which has been normalized into segments of 1 s for each 1D-EEG segment. In the second stage, we opt for the EEG dataset preprocessing, where each 1D-EEG signal has been segmented into 0.5 s. Next, each 1D-EEG signal has been converted to EEG spectrograms images, getting 2D–EEG dataset. These 2D-EEG spectrograms have served as input to the proposed CNN-2D, which has been implemented for epilepsy class detection. The performance of two proposed CNN architectures has been evaluated on yielded high classification accuracy, AUC and F1-score results, going to 99.34%, 99.80% and 99.34% for CNN-1D and 98.88%, 100% and 97.88% for CNN -2D respectively. Overall, a comparative analysis between the two CNN models demonstrates the effectiveness of deep learning based convolutional neural networks models with a small gap where the CNN-1D performs slightly better than the CNN-2D in terms of accuracy and F1-score. However, the CNN-2D surpassed CNN-1D in terms of AUC in detecting epilepsy from EEG signals. Finally, both CNN models have outperformed the state-of-art works.