Raman spectroscopy is widely used for substance identification, providing molecular information from various components along with noise and instrument interference. Consequently, identifying components based on Raman spectra remains challenging. In this study, we collected Raman spectral data of 474 hazardous chemical substances using a portable Raman spectrometer, resulting in a dataset of 59 468 spectra. Our research employed a deep neural convolutional network based on the ResNet architecture, incorporating an attention mechanism called the SE module. By enhancing the weighting of certain spectral features, the performance of the model was significantly improved. We also investigated the classification predictive performance of the model under small-sample conditions, facilitating the addition of new hazardous chemical categories for future deployment on mobile devices. Additionally, we explored the features extracted by the convolutional neural network from Raman spectra, considering both Raman intensity and Raman shift aspects. We discovered that the neural network did not solely rely on intensity or shift for substance classification, but rather effectively combined both aspects. This research contributes to the advancement of Raman spectroscopy applications for hazardous chemical identification, particularly in scenarios with limited data availability. The findings shed light on the significance of spectral features in the model's decision-making process and have implications for broader applications of deep learning techniques in Raman spectroscopy-based substance identification.