Automatic welding technology has been widely applied in many industrial fields. It is a complex process with many nonlinear parameters and noise factors affecting weld quality. Therefore, it is necessary to inspect and evaluate the quality of the weld seam during welding process. However, in practice there are many types of welding seam defects, causes and the method of corrections are also different. Therefore, welding seam defects need to be classified to determine the optimal solution for the control process with the best quality. Previously, the welder used his experience to classify visually, or some studies proposed visual classification with image processing algorithms and machine learning. However, it requires a lot of time and accuracy is not high. The paper proposes a convolutional neural network structure to classify images of welding seam defects from automatic welding machines on pipes. Based on comparison with the classification results of some deep machine learning networks such as VGG16, Alexnet, Resnet-50, it shows that the classification accuracy is 99.46 %. Experimental results show that the structure of convolutional neural network is proposed to classify images of weld seam defects have availability and applicability