Mass spectrometer is one of the most important instruments in the field of modern analysis. Despite efforts to increase efficiency, it remains a challenge to deploy convolutional neural networks in mass spectrometer due to tight power budgets. In this paper, we propose a hybrid optical-electronic convolutional neural network to achieve fast and accurate classification and identification of mass spectra. The optical convolutional layer is realized by a folded 4f system. Our prototype with one single convolutional layer achieves 96.5% classification accuracy in an experimentally-acquired lipid dataset. A more complicated prototype adding one fully-connected layer achieves 100% accuracy. The proposed hybrid optical-electronic convolutional neural networks might enable non-professionals to avoid the accumulation of experimental experience and complicated calculations.