Welding technology plays an indispensable role in ship construction, and its maturity has a direct impact on the quality of shipbuilding. The weld seam, being the weakest part of a welded structure, significantly affects the structural strength, service life, and safety reliability of ships. However, the current identification of weld defects in the ship industry relies on manual methods, which are subjective and prone to error. To address this issue, this paper presents a novel approach by collecting weld images from actual ship scenes, preprocessing them to eliminate noise and highlight defect features, and proposing a Transformer-based improved target detection model (T-OBJDETC) to enhance the recognition accuracy of the model.