The quality of welding is directly related to the performance and life of welded products. This paper proposes an automatic defect detection method using deep learning on a small weld X-ray image dataset. Combined with Generative Adversarial Network (GAN) and Deep Convolutional Neural Network (DCNN), this method can successfully deal with the problem of data imbalance in small image dataset and achieves a good detection effect for low-contrast defect images. Extensive experiments have proved that this approach could accurately and quickly complete the location and detection task of internal defects of welds, and it achieves the Mean Average Precision (mAP) result as 91.64%. © 2022, Politechnica University of Bucharest. All rights reserved.