Single-particle mass spectrometry (SPMS) is a powerful real-time measurement technique to analyze the chemical composition of atmospheric aerosol particles: individual particles are desorbed and ionized to generate a bipolar mass spectrum that expresses the particle's chemical composition, giving clues to its origin and atmospheric processes. Popular approaches to classify SPMS data rely on clustering algorithms, resulting in the inability to achieve automated classification. Here, we present a modified deep learning approach for automatic classification of SPMS data in real-time. Before being processed by a convolutional neural network (CNN), the one-dimensional (1D) mass spectrum is converted into a two-dimensional (2D) representation, since in 2D, global and local features of the spectra are extracted more efficiently. Trained on real-world aerosol mass spectra from a month-long field measurement campaign, the proposed 2D-CNN model achieves a high mean classification accuracy of 92%, outperforming several well-known algorithms based on 2D-CNN, as well as a recently proposed 1D-CNN algorithm trained using 1D representations of mass spectra.