Convolutional neural network (CNN) classification has not achieved a medically-satisfied level of accuracy in sleep apnea detection due to the negative effect of the ECG data segmentation process, Gradient vanishing issues, and internal Covariate shift. This research aims to enhance segmentation, classification accuracy, and eliminate gradient vanishing and internal covariate shift to increase the sleep apnea detection classification accuracy. The proposed system consists of a novel enhancement of segmentation and classification technique (Enhancement of SC) and elimination of gradient vanishing and internal covariate shift (Elimination of GVICS). The enhancement of SC considers the time-dependent nature of apnea events during the classification process and the elimination of GVICS reduces the instability of the neural network due to inactive neurons and improves classification accuracy by removing large input distribution of data during the training phases. The results show that the proposed system achieves better classification performance in four different datasets tested and given accuracy 98.9% against the current accuracy of 94.5% processing time per sample 3 milliseconds against the current processing time 5 milliseconds. Besides, the model has achieved its optimal accuracy in fewer epochs 8 against the current optimal accuracy time of 11 epochs. The proposed solution has improved the accuracy of sleep apnea classification and reduced time to achieve optimal accuracy of the neural network by using the ESCEGCs algorithm; the study has solved the issues of gradient vanishing and internal covariate shift and enhances the overall classification accuracy.