Music recognition refers to the process of automatically recognizing and classifying the musical content in audio signals using computer technology and algorithms. Music recognition technology can help people recognize information such as the music title, artist, musical style, rhythm, and the emotions conveyed by the music in the audio, thus enabling applications like automated music information retrieval and recommendation systems. Classical music, due to its vast quantity, diverse types, and time span covering several centuries, presents challenges that existing music recognition software and traditional music recognition algorithms cannot effectively address. In this study, The model based on convolutional neural networks (CNNs) is proposed, allowing people to recognize the classical music title, style, and emotions contained in a piece of music. The proposed model is particularly beneficial for individuals who are interested in classical music but lack extensive knowledge about it, as it provides essential information about the pieces. By extracting multidimensional features from classical music, the model can recognize the title, style, and emotions expressed. To improve the model's recognition accuracy, various noises are introduced to the dataset. Meanwhile, in this study, a novel loss function has been devised to more effectively assess the model's performance. For searching for optimal performance of the model, a novel optimization algorithm also be proposed to find optimal hyperparameters of loss function. The experiment results show average title recognition accuracy is 0.98, average style recognition accuracy is 0.89 and average emotion recognition accuracy is 0.93. These results adequately demonstrate that the proposal model significantly enhances the model's ability to accurately recognize the titles, styles, and emotions of classical music, achieving high recognition rates even in noisy environments.