In the aerospace manufacturing industry, nondestructive evaluation (NDE) of components plays an important role. Porosities and other defects usually occur in the welds of these components. If such defects end up in the aircraft, the fatigue life of components is lessened, which may cause disastrous accidents. At present, those welds are manually evaluated by human inspectors via reviewing X-ray images. To reduce the workload of inspectors, we have developed an automatic inspection system for identifying defects in linear thin welds. For an X-ray image, this system starts with localizing the central line of the weld using a random forest (RF) regressor. A region surrounding the line is then investigated using an RF classifier in order to detect defects. After extensive experiments, the results demonstrate that the weld can be precisely localized from X-ray images, and the defect detection module can find 80% of defects that have been identified by human inspectors (i.e., true positives), while fewer than 1.6 false positives per image are returned. It is suggested that the system may be beneficial to human inspectors by reducing their workload. In addition, our system produces encouraging results on the publicly available weld X-ray image data set and a magnetic tile image data set. <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Note to Practitioners</i> —This work was motivated by the challenge of inspecting aerospace components, which is almost entirely done manually at present. Rather than replacing human inspectors, this work aims at reducing their workload by providing them with an initial inspection result for each component. Especially, the proposed system is able to first localize the Region of Interest (RoI) from an X-ray image of a component and then identify potential defects contained in the RoI. To the best of our knowledge, few existing studies perform defect detection on raw component images. Normally, researchers manually cropped an RoI from these images. The output of our system is the pixelwise location information on potential defects. Our results demonstrate that the proposed system is able to accurately localize the weld and identify 80% of defects contained in abnormal weld images with very few false positives. Given that large weld images ( <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> <tex-math notation="LaTeX">$2304\times1920$ </tex-math></inline-formula> pixels) were processed, our system located the weld in 6.6± 1.3 s/image and fulfilled defect detection on each localized weld region in 0.8± 0.1 s. The proposed system was also tested with the publicly available X-ray weld image data set: GDXray and a magnetic tile image data set. Although only a small number of training images were available, promising results were obtained. This suggests that our system is suitable for both X-ray weld images and other images though more work is needed to reduce false positives.