The invention provides an improved multi-frame image target detection network, namely, TFA-Net (Temporal Fusion
Attention Network), which is oriented to a
welding seam defect detection task. According to the network, continuous multiple frames of images are used as input, and spatial features of each frame of image are extracted through a ResNet
backbone network sharing parameters. On the basis, a multi-stage
feature fusion module is fused and introduced, effective integration among features of different scales is realized, and the
perception capability for small-size and weak-contrast defects is improved. In order to further capture dynamic information of the target in the time dimension, a
time sequence modeling module is designed, modeling is carried out on a multi-frame feature sequence, and continuous features of the target changing along with time are extracted. And then, the network adopts a gating
fusion mechanism to carry out adaptive weighted fusion on the static space features and the dynamic
time sequence features, and the robustness and the discrimination capability of feature representation are enhanced. Finally, the fusion features are input into a decoder module, the category probability of the defects is predicted through a classification sub-network, anchor frame position offset is calculated through a frame regression sub-network, and accurate positioning and recognition of the multiple types of defects in the
weld seam image are achieved. The network has the advantages of clear structure, strong generalization ability, high adaptability and the like, and is especially suitable for the problems of
small target size, unclear texture, strong motion continuity and the like in a
welding seam detection scene.