The invention discloses an industrial weld defect detection method based on semantic segmentation. The method comprises the following steps: S1, obtaining an original weld image for training and related parameter information, carrying out binarization
processing on the original image, storing a foreground region of the processed image, selecting a region with the maximum area to carry out rectangular shape conversion, and
cutting and storing a rectangular region; s2, marking the
cut rectangular region image, generating a weld defect image
data set,
cutting the image in the weld defect image
data set by using an intelligent
cutting method, and distributing redundant pixels generated by cutting; s3, constructing a semantic segmentation
network model according to the
data set generated in S2, focusing a
defect region by using an attention mechanism, performing selective
convolution calculation on the
defect region, and training the semantic segmentation
network model by using a
loss function as an index; and S4,
processing the
weld seam image to be detected by using the semantic segmentation
network model, and splicing and restoring the
weld seam image to an original image size. According to the invention, the detection precision is improved, and
image processing is not limited.