The Guzheng, an ancient and widely cherished musical instrument in China, serves as a significant cultural heritage with its enchanting melodies. The advent of artificial intelligence offers a novel avenue for the automatic recognition of guzheng music. This article introduces a pitch detection and recognition approach leveraging an enhanced capsule network. By integrating relative spectrum-aware linear prediction and Mel-scale frequency cepstral coefficients into novel features and feeding them into an optimized capsule network, the method achieves precise pitch recognition from audio inputs. Evaluation on a custom dataset indicates a high accuracy in identifying distinct pitches across the guzheng’s 21 strings, with an average recognition rate of 98.15%. Furthermore, to assess the algorithm’s resilience to interference, comparative experiments against three other network models were conducted in various noise conditions. Our approach outperformed all others, maintaining over 96% accuracy even in noisy environments, demonstrating superior anti-interference capabilities.