Pain is a subjective experience and clinicians need to treat patients with accurate pain levels. EEG has emerged as a useful tool for objective pain assessment, but due to the low signal-to-noise ratio of pain-related EEG signals, the prediction accuracy of EEG-based pain prediction models is still unsatisfactory. In this paper, we proposed an autoencoder model based on convolutional neural networks for feature extraction of pain-related EEG signals. More precisely, we used EEGNet to build an autoencoder model to extract a small set of features from high-density pain-evoked EEG potentials and then establish a machine learning models to predict pain levels (high pain vs. low pain) from extracted features. Experimental results show that the new autoencoder-based approach can effectively identify pain-related features and can achieve better classification results than conventional methods.