Aiming at the problem of coal gangue identification in the current fully mechanized mining face and coal washing links, this article proposes a CNN coal and rock identification method based on hyperspectral data. First, collect coal and rock spectrum data by a near-infrared spectrometer, and then use four methods such as first-order differential (FD), second-order differential (SD), standard normal variable transformation (SNV), and multi-style smoothing to filter the 120 sets of collected data. The coal and rock reflectance spectrum data is preprocessed to enhance the intensity of spectral reflectance and absorption characteristics, and effectively remove the spectral curve noise generated by instrument performance and environmental factors.Construct a CNN model, judge the pros and cons of the model by comparing the accuracy of the three parameter combinations, select the most appropriate learning rate, the number of feature extraction layers, and the dropout rate, and generate the best CNN classifier for hyperspectral data. Rock recognition. Experiments show that the recognition accuracy of the one-dimensional convolutional neural network model proposed in this paper reaches 94.6%, which is higher than BP (57%), SVM (72%) and DBN (86%). Verify the advantages and effectiveness of the method proposed in this article.