Abstract:In response to the problems of relatively small weld penetration depth and width, small differences in base metal and weld area, and difficulty in identifying surface defects in cruise thin plate welds, a deep learning DenseNet network is integrated with an attention mechanism CA module (Coordinate attention) to improve the accuracy of the model in extracting weld features and more accurately identify weld positions.In order to improve the stability of the model, the ReLu activation function in the original DenseNet model was replaced with ReLu6, and a Bayesian optimization algorithm was used to select hyperparameters for the improved DenseNet model. Training was conducted on a self established dataset of ship thin plate welding seam defects, and experimental results showed that the improved DenseNet model has excellent performance in detecting ship thin plate welding seam defects. In the test set, it achieved an accuracy of 96.03% and an average accuracy of 97.96%, which is 8.93% higher than the original DenseNet model recognition accuracy.