Corrosion of pipeline walls can lead to serious safety accidents such as leaks, fires and even explosions. This paper proposes a corrosion detection method using deep learning based on percussion sound for pipelines. The percussion induced acoustic signals are processed by wavelet threshold noise reduction and double threshold endpoint detection to generate the Mel spectrograms, and then an 18-layer Residual Network (ResNet18) is used to mine the depth information and classify the degree of pipeline corrosion. We conducted experiments to verify the validity of the approach. Seven working conditions are generated by electrochemical corrosion of a pipe specimen, and percussions are applied at five different positions under the same working conditions to collect the impact acoustic signals. The test results show that the method can quickly, efficiently and accurately detect the degree of pipeline corrosion, classify the degree of pipe corrosion without being affected by the striking position Therefore, the model has great potential for application in detecting the internal corrosion of pipelines based on percussion sounds.