Steel bridge weld surface defect identification method, equipment and storage medium
Through the improved AlexNet network model, combined with Gaussian filtering and Leaky ReLU activation function, the problem of low accuracy and low efficiency of steel bridge weld defect identification is solved, efficient weld defect identification is achieved, and the identification accuracy and efficiency are improved.
Patent Information
- Application Number
- CN202410047342.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-12
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-01-12
AI Technical Summary
The existing steel bridge weld defect identification technology has problems of low accuracy and efficiency. Traditional manual inspection is time-consuming and labor-intensive. Although the convolutional neural network provides new ideas, the accuracy and efficiency are still insufficient.
Using the improved AlexNet network model, by constructing a sample data set, image preprocessing and data enhancement were performed, combined with Gaussian filtering and Leaky ReLU activation function, to construct a structure containing 6 convolutional layers, 2 maximum pooling layers and 1 average pooling layer. Layer recognition model improves weld defect feature extraction and information retention capabilities.
The accuracy and efficiency of steel bridge weld defect identification are improved, achieving a total accuracy of more than 95%. The identification accuracy of various types of defects is significantly improved, and the consumption of computing resources and the risk of over-fitting are reduced.
Smart Images

Figure CN118096649B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of bridge defect recognition, and in particular relates to a steel bridge weld surface defect recognition method, device and storage medium based on an enhanced AlexNet network. Background Art
[0002] Compared with traditional concrete bridges, steel structure bridges have become an important development direction in the field of bridge engineering due to their advantages such as light weight, high strength, large span capacity, easy factory manufacturing and convenient assembly construction. However, the connection form of steel structure bridges has evolved from riveting and bolting to welding, and welding has now become the main connection method between steel structure components. Although welding provides a strong connection performance for the structure, welding defects may cause residual stress and stress concentration, affecting the safety and durability of the bridge.
[0003] In order to effectively deal with welding defects, traditional disease detection mainly relies on manual inspection and non-destructive testing. Manual inspection is time-consuming, labor-intensive, subjective, and inefficient. Although non-destructive testing has overcome the omissions and misjudgments caused by experience differences to a certain extent, its high operating costs, difficult-to-promote technology, and test results affected by subjectivity are still limiting factors in its application.
[0004] In this context, digital image method combined with deep learning has become a promising method to solve the problem of weld defect detection. In particular, the outstanding performance of convolutional neural network (CNN) in image processing has provided new ideas for steel bridge weld defect detection. However, the current steel bridge weld defect classification and recognition technology based on convolutional neural network has problems of low accuracy and efficiency. Summary of the invention
[0005] The purpose of the present invention is to provide a method, device and storage medium for identifying surface defects of steel bridge welds, so as to solve the problems of low accuracy and efficiency in existing steel bridge weld defect identification technologies.
[0006] The present invention solves the above technical problems through the following technical solutions: a method for identifying surface defects of steel bridge welds, the identification method comprising a training phase and an application phase, the training phase comprising the following steps:
[0007] Constructing a sample data set, wherein the sample data set includes a plurality of sample data, each of the sample data includes an input quantity and an output quantity, wherein the input quantity is an image containing a weld, and the output quantity is a defect category of the weld in the corresponding image;
[0008] Constructing a defect recognition model, wherein the defect recognition model adopts an improved AlexNet network model, and the improved AlexNet network model includes an input layer, a first convolutional layer, a second convolutional layer, a first maximum pooling layer, a third convolutional layer, an average pooling layer, a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer, a second maximum pooling layer, a first fully connected layer, a second fully connected layer, a third fully connected layer, and an output layer connected in sequence;
[0009] Using the sample data set to train and verify the defect recognition model to obtain a target recognition model;
[0010] The application phase includes the following steps:
[0011] Get images of steel bridge welds;
[0012] The target recognition model is used to identify the steel bridge weld image to obtain the apparent defect category of the steel bridge weld.
[0013] Furthermore, the constructing of the sample data set specifically includes:
[0014] Produce multiple segmental components of the longitudinal ribs and the top plate of the steel bridge deck, and produce different welding defects in the joint area between the longitudinal ribs and the top plate of each segmental component;
[0015] Use industrial cameras to collect weld images of each segment component and label all weld images with defect categories;
[0016] Preprocessing the weld image to obtain a labeled image containing the weld;
[0017] The sample data set is constructed based on all annotated images containing welds.
[0018] Furthermore, the defect categories of the weld image include undercut, slag inclusion, hole, incomplete penetration, weld bead and no defect.
[0019] Further, the weld image is preprocessed, specifically including:
[0020] The weld image is subjected to cropping, grayscale processing, filtering and data enhancement processing in sequence; the data enhancement processing includes one or more of horizontal mirroring, vertical mirroring, diagonal flipping, translation and rotation, and the data enhancement processing includes brightness adjustment and contrast adjustment.
[0021] Furthermore, the Gaussian function is used to filter the weld image after grayscale processing. The specific formula is:
[0022] f out (x,y)=G(x,y)*f in (x,y)
[0023]
[0024] Among them, f in (x,y) represents the image before filtering, f out (x, y) represents the filtered image, G(x, y) represents the Gaussian function, (x, y) represents the pixel coordinates on the image, σ represents the standard deviation of the Gaussian function, and * represents the convolution operator.
[0025] Furthermore, the convolution kernel size of the first convolution layer and the second convolution layer is 5×5, and the step size is 2; the convolution kernel size of the third convolution layer is 5×5, and the step size is 1; the convolution kernel size of the fourth convolution layer, the fifth convolution layer, and the sixth convolution layer is 3×3, and the step size is 1;
[0026] The pooling kernel size of the first maximum pooling layer and the second maximum pooling layer is 3×3, and the step size is 1.
[0027] Furthermore, the activation function in the improved AlexNet network model adopts the Leaky ReLU function, and the specific expression is:
[0028]
[0029] Among them, x represents the input of the activation function and α represents a constant.
[0030] Based on the same concept, the present invention also provides a terminal device, the terminal device comprising:
[0031] Memory for storing computer programs;
[0032] A processor is used to implement the above-mentioned steel bridge weld surface defect identification method when executing the computer program.
[0033] Based on the same concept, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for identifying surface defects of steel bridge welds as described above is implemented.
[0034] Beneficial Effects
[0035] Compared with the prior art, the advantages of the present invention are:
[0036] The present invention provides a method for identifying apparent defects of steel bridge welds, which improves the AlexNet network model. The improved AlexNet network model includes 6 convolutional layers, 2 maximum pooling layers and 1 average pooling layer. Compared with the traditional AlexNet network model, the present invention has more advantages in the number of parameters and fitting ability, pays more attention to the extraction of weld defect features and information retention, and improves the accuracy and efficiency of steel bridge weld defect identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only one embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 is a flow chart of a method for identifying surface defects of a steel bridge weld in an embodiment of the present invention;
[0039] Figure 2 Schematic diagram of a steel bridge deck artificial defect test block in an embodiment of the present invention;
[0040] Figure 3 is a schematic diagram of grayscale and filtering processing in an embodiment of the present invention;
[0041] Figure 4 is a schematic diagram of data augmentation processing in an embodiment of the present invention;
[0042] Figure 5 AlexNet is an improved network model architecture diagram in an embodiment of the present invention;
[0043] Figure 6 is a schematic diagram of a first convolutional layer and a second convolutional layer in an embodiment of the present invention;
[0044] Figure 7 Schematic diagram of maximum pooling and average pooling in an embodiment of the present invention;
[0045] Figure 8 is a graph of a ReLU function and a LeakyReLU function in an embodiment of the present invention;
[0046] Fig. 9 Schematic diagram of the accuracy of the improved AlexNet network model in an embodiment of the present invention;
[0047] Fig.10 Schematic diagram of the loss of the improved AlexNet network model in an embodiment of the present invention;
[0048] Fig.11is the confusion matrix of the verification result of the improved AlexNet network model in the embodiment of the present invention;
[0049] Fig.12 It is a comparison diagram of the verification accuracy of the traditional AlexNet network model (i.e., conventional AlexNet network) and the improved AlexNet network model (i.e., enhanced AlexNet network) in the embodiment of the present invention;
[0050] Fig.13 It is the recognition and classification result of each defect category by the traditional AlexNet network model (ie, conventional AlexNet network) and the improved AlexNet network model (ie, enhanced AlexNet network) in the embodiment of the present invention. DETAILED DESCRIPTION
[0051] The following is a clear and complete description of the technical solutions in the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0053] Example 1
[0054] like Figure 1 As shown, a method for identifying surface defects of steel bridge welds provided by an embodiment of the present invention includes a training phase and an application phase, and the training phase includes the following steps:
[0055] Step A1: construct a sample data set, the sample data set includes multiple sample data, each sample data includes an input quantity and an output quantity, the input quantity is an image containing a weld, and the output quantity is a defect category of the weld in the corresponding image;
[0056] Step A2: construct a defect recognition model, which uses an improved AlexNet network model;
[0057] Step A3: Use the sample data set to train and verify the defect recognition model to obtain the target recognition model.
[0058] The application phase includes the following steps:
[0059] Step B1: Acquire a steel bridge weld image; Step B2: Use a target recognition model to identify the steel bridge weld image to obtain an apparent defect category of the steel bridge weld.
[0060] In step A1, a sample data set is constructed, which specifically includes:
[0061] Step A11: making a plurality of segmental components of the longitudinal ribs and the top plate of the steel bridge deck, and making different welding defects in the joint area between the longitudinal ribs and the top plate of each segmental component;
[0062] Step A12: using an industrial camera to collect weld images of each segment component, and labeling defect categories of all weld images;
[0063] Step A13: preprocessing the weld image to obtain an image containing the weld with annotations;
[0064] Step A14: Construct a sample dataset based on all annotated images containing welds.
[0065] like Figure 2 As shown, the segment component material of this embodiment is Q345q steel, the thickness of the top plate is 20mm, the longitudinal rib is a U-rib plate, the thickness of the U-rib plate is 10mm, the length of the top plate and the U-rib plate are both 1m, multiple defects are designed on each segment component at the same time, and 10 segment components are manufactured at the same time. The weld surface defect categories of this embodiment include undercut, slag inclusion, hole, incomplete penetration, weld bead and no defect, and 5 defects are designed on each segment component at the same time.
[0066] Industrial cameras were used to collect images of weld defects on each segment component, and 303 weld images were finally obtained, which were divided into six categories: undercut, slag inclusion, hole, incomplete penetration, weld nodule, and no defect. The weld images collected by industrial cameras are of different sizes, small in number, and have noise interference, which cannot meet the needs of deep learning. Therefore, these weld images collected by industrial cameras need to be preprocessed.
[0067] In this embodiment, the weld image is preprocessed, specifically including: cropping, grayscale processing, filtering and data enhancement and expansion processing of the weld image in sequence; the data augmentation processing includes one or more of horizontal mirroring, vertical mirroring, diagonal flipping, translation and rotation, and the data enhancement processing includes brightness adjustment and contrast adjustment.
[0068] All weld images are cropped in batches so that the cropped image sizes are 224×224 and 227×227. Images with a size of 224×224 are used to input into the improved AlexNet network model, and images with a size of 227×227 are used to input into the traditional AlexNet network model, so as to facilitate the subsequent comparison of the training process and training results of the two models.
[0069] In this embodiment, the Rgb2gray function in Matlab is used to grayscale the cropped weld image to simplify the image data matrix and improve the operation speed of the improved AlexNet network model. In order to eliminate the interference of the surrounding environment, such as noise, light intensity, etc., which will inevitably affect the image during the extraction process, and to ensure that effective information of the weld image is obtained, the weld image after grayscale processing is filtered, such as Figure 3 The grayscale and filtering results are shown.
[0070] In this embodiment, a Gaussian function is used to filter the weld image after grayscale processing. The Gaussian filtering principle is to perform weighted averaging on the entire image, and the pixel value of each pixel point is obtained by weighted averaging the pixel values of itself and other pixels in the neighborhood. Among them, the specific formula for filtering the weld image after grayscale processing using the Gaussian function is:
[0071] f out (x,y)=G(x,y)*f in (x,y) (1)
[0072]
[0073] Among them, f in (x,y) represents the image before filtering, f out (x, y) represents the filtered image, G(x, y) represents the Gaussian function, (x, y) represents the pixel coordinates on the image, σ represents the standard deviation of the Gaussian function, and * represents the convolution operator.
[0074] Table 1 Various defect images
[0075]
[0076] In order to make the trained network model have better generalization ability, a large amount of sample data is often required for network model training. The existing sample data is only 303, which cannot meet the training requirements of the network model and easily leads to overfitting of the network model. Therefore, this embodiment uses the data enhancement method to expand the images collected by the industrial camera, and mirrors the weld images after filtering (including horizontal and vertical mirroring), flips diagonally, translates, and rotates them at random angles, such as Figure 4 After data enhancement and augmentation, the number of images expanded from the original 303 to 6946. The specific information of various defect images is shown in Table 1.
[0077] In step A2, the improved AlexNet network model is used as the defect recognition model, such as Figure 5As shown, the improved AlexNet network model includes an input layer, a first convolutional layer, a second convolutional layer, a first maximum pooling layer, a third convolutional layer, an average pooling layer, a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer, a second maximum pooling layer, a first fully connected layer, a second fully connected layer, a third fully connected layer and an output layer, which are connected in sequence.
[0078] The purpose of the convolution operation in the convolution layer is to extract different features of the input image. The convolution layer is composed of several convolution units (convolution kernels), and each convolution kernel corresponds to a feature map. After the convolution kernel is convolved with the previous layer image, the corresponding feature map is obtained under the action of the excitation function, that is:
[0079]
[0080] in, is the convolution kernel; * is the convolution operation; f() is the activation function; is the bias term; L is the current layer number; j is the jth neuron; is the i-th image of the L-1th layer; M is the maximum number of layers; is the output feature map of the jth image in the Lth layer.
[0081] After the convolution layer performs feature extraction, the output feature map is passed to the pooling layer for feature selection and information filtering. The pooling layer can reduce the image data space and feature dimension to prevent the model from overfitting, that is:
[0082]
[0083] In the formula, is the downsampling function; is the sampling coefficient; is the output feature map of the jth image in the L-1th layer (i.e., the feature map output by the convolutional layer before the pooling layer); It is the eigenvalue obtained after sampling the j-th image in the L-th layer.
[0084] The traditional AlexNet network model mainly consists of 5 convolutional layers, 3 pooling layers and 3 fully connected layers. The present invention enhances and optimizes the traditional AlexNet network model. The improved AlexNet network model includes 1 input layer, 6 convolutional layers, 2 maximum pooling layers, 1 average pooling layer and 3 fully connected layers. Figure 5 shown.
[0085] In this embodiment, the input image size of the input layer of the improved AlexNet network model is 224×224 to accommodate the convolution operation of the convolution layer in the improved AlexNet network model.
[0086] The first convolutional layer of the traditional AlexNet network model uses a convolution kernel of 11×11 and a stride of 4. The convolution kernel size of the first and second convolutional layers of the improved AlexNet network model of the present invention is 5×5 and the stride is 2 (e.g. Figure 6 As shown in FIG. 1 , the first convolution layer and the second convolution layer are used to replace the first convolution layer in the traditional AlexNet network model. The present invention uses the first convolution layer and the second convolution layer with a convolution kernel size of 5×5 and a step size of 2 to replace the first convolution layer in the traditional AlexNet network model, which can improve the fitting ability of the network model and the efficiency of extracting high-level feature information.
[0087] A study of the traditional AlexNet network model found that the convolution kernel size of the first convolution layer is 11×11 and the step size is 4. This setting may have problems of information loss and low computational efficiency when processing complex image features. The present invention uses two convolution layers to replace the first convolution layer in the traditional AlexNet network model, aiming to better capture the abstract features in the image through multi-level convolution operations, and improve the computational efficiency on the basis of retaining the features. Compared with a single convolution layer, two convolution layers have stronger fitting ability and can better adapt to features of different scales and complexities; by reducing the size of the convolution kernel, the network model can learn local features more flexibly, and the reduction in step size enables the network model to explore the details of the image more finely. Compared with the traditional 11×11 convolution kernel, the two-layer 5×5 convolution kernel reduces the number of parameters, thereby reducing the computational burden of the network model and improving the efficiency of training and reasoning, which also helps to prevent overfitting and improve the generalization ability of the network model. The present invention makes the network model smoother in the early training process by improving the first convolution layer of the traditional network model. Smaller convolution kernels and step sizes make it easier for the network model to converge, alleviate the gradient vanishing problem during training, and help reach a convergence state more quickly. According to the improvement of the convolution layer of the present invention, the convolution layer is encoded accordingly, and by adjusting the parameters of the network model (such as the number of iterations, the learning rate), it is ensured that the output of the convolution layer has a positive impact on the subsequent layers of the network model.
[0088] During the pooling process, the image is divided into several matrix regions. The maximum pooling takes the maximum value of the pixels in the pooling area, and the average pooling takes the average value of the pixels in the pooling area. The principle is as follows Figure 7 shown.
[0089] The advantages of max pooling are:
[0090] (1) Improved feature sensitivity: Max pooling emphasizes the significant features of the weld defect area by selecting the maximum pixel value in the pooling area. This makes the feature map after max pooling more sensitive to the texture features of the weld defect. (2) Local feature prominence: Max pooling helps retain the most significant local features, allowing the network to focus more on the focal area and enhance the local perception of weld defects.
[0091] The advantages of average pooling are:
[0092] (1) Enhanced noise resistance: Average pooling helps smooth the image and reduce the impact of noise by taking the average value of pixels in the pooling area. This makes the feature map after average pooling more sensitive to steel background information. (2) Global information preservation: Average pooling helps preserve the global information of the image, has advantages in capturing a wide range of background features, and helps prevent overfitting during training.
[0093] The present invention improves the AlexNet network model by using a maximum pooling layer between the second convolutional layer and the third convolutional layer, and between the sixth convolutional layer and the first fully connected layer. This is because weld defects usually show local and significant features. Using maximum pooling helps to better highlight these key areas, improves the extraction effect of defect features, and is more accurate in the final classification results. Using an average pooling layer between the third convolutional layer and the fourth convolutional layer helps to maintain global features, enhance sensitivity to steel background information, and avoid losing important background information during training.
[0094] By improving the pooling layer of the AlexNet network model, the overall network model shows higher accuracy in the weld defect recognition task. It can not only sensitively capture the local details of the weld defects, but also retain the global perception of the background information. It significantly improves the network model's recognition accuracy for weld defects and the retention of global information, and improves the comprehensiveness and adaptability of the network model. This improvement provides a more powerful and effective tool for weld defect recognition.
[0095] In the actual implementation process, the improved pooling layer is encoded using a deep learning framework, and the parameters such as the convolution kernel size, step size, and boundary padding are adjusted to ensure that the improved pooling layer can work together in the network model. The improved pooling layer is embedded in the entire AlexNet network model to ensure that the output of each pooling layer has a positive impact on the next layer of the network model while avoiding excessive loss of information.
[0096] In this embodiment, the sample data set is divided into a training set and a validation set in a ratio of 8:2, the training set is used to train the improved AlexNet network model, and the trained AlexNet network model is tuned by the validation set. During the training process, the parameters of the network model are continuously adjusted according to the feedback of the loss function to ensure that the network model achieves the best performance in the weld defect recognition task.
[0097] The traditional AlexNet network model uses ReLU as the activation function, which effectively solves the gradient diffusion problem. However, the gradient of the ReLU function is zero when the input is less than 0, which will cause the network to be unable to perform backpropagation and cause neuron death, thereby resulting in training loss. In order to effectively solve the neuron death problem, the present invention introduces LeakyReLU as the activation function. LeakyReLU not only retains the advantages of ReLU, but also appropriately retains the parameters when the input is less than 0, so that more parameters can be learned during the training process, thereby improving the robustness of the model. Figure 8 The graphs of the ReLU function and the LeakyReLU function are shown.
[0098] In this embodiment, the specific expression of the Leaky ReLU function is:
[0099]
[0100] Among them, x represents the input of the activation function (i.e., feature map); α represents a constant, and the default value is 0.01.
[0101] In this embodiment, the specific training process of the improved AlexNet network model is:
[0102] The input layer receives an image of size 224×224×3, performs normalization preprocessing, and maps the image pixels into a 224×224×1 pixel matrix. The image input to the network model is a grayscale image, that is, each pixel contains 1 pixel value, representing the RGB channels of the image respectively.
[0103] The first convolutional layer C1 uses 96 convolution kernels of size 5×5, a step size of 2, and a border padding of 0 to perform a convolution operation on the data input by the input layer. The size of the output feature map is (110, 110, 96).
[0104] The second convolutional layer C2 uses 96 convolution kernels of size 5×5, a step size of 2, and a border padding of 0 to perform a convolution operation on the feature map output by the first convolutional layer C1. The size of the output feature map is (53, 53, 96); then the first maximum pooling layer Maxpooling1 performs a maximum pooling operation on the feature map output by C2. The pooling kernel size is 3×3, the step size is 2, and the border padding is 0. The size of the feature map obtained after pooling is (26, 26, 96).
[0105] The third convolutional layer C3 uses 256 convolution kernels of size 5×5, a step size of 1, and a border padding of 2 to perform a convolution operation on the feature map output by the first maximum pooling layer Maxpooling1. The size of the output feature map is (26, 26, 256); then the average pooling layer Avepooling3 performs a maximum pooling operation on the feature map output by C3, with a pooling kernel size of 3×3, a step size of 2, and a border padding of 0. The size of the feature map obtained after average pooling is (13, 13, 256).
[0106] The fourth convolutional layer C4 uses 384 convolution kernels of size 3×3, a step size of 1, and a border padding of 1. It performs a convolution operation on the feature map output by the average pooling layer Avepooling3, and the size of the output feature map is (13, 13, 384).
[0107] The fifth convolutional layer C5 uses 384 convolution kernels of size 3×3, a step size of 1, and a border padding of 1 to perform a convolution operation on the feature map output by C4. The size of the output feature map is (13, 13, 384).
[0108] The sixth convolutional layer C6 uses 256 convolution kernels of size 3×3, a step size of 1, and a border padding of 1 to perform a convolution operation on the feature map output by C5. The size of the output feature map is (13, 13, 256); then the second maximum pooling layer Maxpooling6 performs a maximum pooling operation on the feature map output by C6. The pooling kernel size is 3×3, the step size is 2, and the border padding is 0. The size of the feature map obtained after pooling is (6, 6, 256).
[0109] The feature map output by the second maximum pooling layer Maxpooling6 is subjected to a two-layer fully connected operation through the first fully connected layer FC1 and the second fully connected layer FC2. The parameters of FC1 and FC2 are both 1×1×4096; the third fully connected layer FC3 is followed by a classification layer, and the parameters are set to 1×1×6 according to the 6 defect categories; after being processed by the activation function Softmax, the classification result is finally output through the Classoutput classification layer.
[0110] Table 2 Defect classification results of the improved AlexNet network model
[0111]
[0112] The present invention is based on the MATLAB 2021b learning platform, the processor is AMD Ryzen 7 5800H with RadeonGraphics@3.20GHz, and the memory is 16.0GB. Parameter setting: the number of iterations is 70 times, 128 sample data are selected as a batch for training, the initial learning rate is 0.001, and the verification accuracy and verification loss are output for each iteration, such as Fig. 9 and Fig.10 In this embodiment, a total of 70 iterations of training are performed, which takes 2 minutes and 20 seconds. Fig. 9 and Fig.10 It can be seen that when the number of iterations reaches 40, the accuracy of the network model basically reaches a stable convergence state, and the loss also converges accordingly.
[0113] The specific division and classification results of the final sample data set are shown in Table 2. It can be seen from Table 2 that after multiple trainings, for various types of defects, the improved AlexNet network model has no missed detections and the overall prediction and classification results are good, with a total accuracy of more than 95%. Among them, the recognition accuracy of undercut and incomplete penetration is the highest, reaching 100.00%; followed by the recognition accuracy of holes and weld nodules, both of which are 99.67%; the recognition accuracy of slag inclusions and no defects is lower, at 94.33% and 97.67% respectively; the total accuracy is 98.56%. In order to observe the recognition results more intuitively, the confusion matrix is derived from the training results. The ordinate of the confusion matrix represents the real welding defect type, the abscissa represents the welding defect type identified by the model, and the diagonal unit represents the number of defect types correctly identified, such as Fig.11 shown.
[0114] Depend on Fig.11 It can be seen that the prediction results of undercut and incomplete penetration are the best, with no misjudgment; the prediction results of holes and weld nodules are good, with only 0.33% misjudgment; the probability of slag inclusion being misjudged as weld nodules is 2.33%, the probability of being misjudged as no defects is 2.00%, and the probability of being misjudged as undercut is 1.33%; the probability of no defects being misjudged as slag inclusion is 2.00%, and the probability of being misjudged as incomplete penetration is 0.33%. There may be two reasons for the misjudgment. First, the level of manual welding technology is not high, and some welding parts that are identified as no defects still have small flaws, which are similar to other types of defects; second, the training data set of slag inclusion and no defects is large and has more data features, and the insufficient training of the network model leads to poor prediction results.
[0115] In order to verify that the improved AlexNet network model is more superior, the verification accuracy graph and the recognition classification graph of each defect type are used to compare with the traditional AlexNet network model, that is, the verification accuracy of the two network models is obtained by training the processed sample data set under the same parameter conditions, as shown in Fig.12 shown.
[0116] 100 images of each defect type were selected from the dataset that was not trained to compare the recognition and classification results of the two network models for each defect type. Fig.13 The two network models were used to classify and identify 100 images respectively, and the results are shown in Table 3.
[0117] Table 3 Recognition and classification results of different defect types by different network models
[0118]
[0119] The comparison of the two network models confirmed that the improved AlexNet network model of the present invention has better recognition ability for steel bridge welding defects.
[0120] Example 2
[0121] An embodiment of the present invention further provides a terminal device, which includes: a processor and a memory storing a computer program, wherein the processor is configured to implement the above-mentioned method for identifying surface defects of steel bridge welds when executing the computer program.
[0122] Although not shown, the terminal device includes a processor, which can perform various appropriate operations and processes according to the program and / or data stored in a read-only memory (ROM) or the program and / or data loaded from the storage part into a random access memory (RAM). The processor can be a multi-core processor or can include multiple processors. In some embodiments, the processor can include a general main processor and one or more special coprocessors, such as a central processing unit, a graphics processing unit (GPU), a neural network processor (NPU), a digital signal processor (DSP), etc. In RAM, various programs and data required for the operation of the terminal device are also stored. The processor, ROM and RAM are connected to each other via a bus. The input / output (I / O) interface is also connected to the bus.
[0123] The processor and the memory are used together to execute the program stored in the memory. When the program is executed by the computer, the methods, steps or functions described in the above embodiments can be implemented.
[0124] Although not shown, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for identifying surface defects of a steel bridge weld as described above is implemented.
[0125] Storage media in embodiments of the present invention include permanent and non-permanent, removable and non-removable items that can be implemented by any method or technology to store information. Examples of storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0126] What is disclosed above is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or modifications within the technical scope disclosed in the present invention, which should be covered within the protection scope of the present invention.
Claims
1. A method for identifying surface defects of steel bridge welds, the method comprising a training phase and an application phase, characterized in that: The training phase includes the following steps: Constructing a sample data set, wherein the sample data set includes a plurality of sample data, each of the sample data includes an input quantity and an output quantity, wherein the input quantity is an image containing a weld, and the output quantity is a defect category of the weld in the corresponding image; A defect recognition model is constructed, wherein the defect recognition model adopts an improved AlexNet network model, and the improved AlexNet network model includes an input layer, a first convolutional layer, a second convolutional layer, a first maximum pooling layer, a third convolutional layer, an average pooling layer, a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer, a second maximum pooling layer, a first fully connected layer, a second fully connected layer, a third fully connected layer, and an output layer connected in sequence; wherein the convolution kernel size of the first convolutional layer and the second convolutional layer is 5×5, and the step size is 2; the convolution kernel size of the third convolutional layer is 5×5, and the step size is 1; the convolution kernel size of the fourth convolutional layer, the fifth convolutional layer, and the sixth convolutional layer is 3×3, and the step size is 1; the pooling kernel size of the first maximum pooling layer and the second maximum pooling layer is 3×3, and the step size is 1; the activation function in the improved AlexNet network model adopts the LeakyReLU function, and the specific expression is: Among them, x represents the input of the activation function, and α represents a constant; Using the sample data set to train and verify the defect recognition model to obtain a target recognition model; The application phase includes the following steps: Get images of steel bridge welds; The target recognition model is used to identify the steel bridge weld image to obtain the apparent defect category of the steel bridge weld.
2. The method for identifying apparent defects of steel bridge welds according to claim 1, characterized in that: The constructing of the sample data set specifically includes: Produce multiple segmental components of the longitudinal ribs and the top plate of the steel bridge deck, and produce different welding defects in the joint area between the longitudinal ribs and the top plate of each segmental component; Use industrial cameras to collect weld images of each segment component and label all weld images with defect categories; Preprocessing the weld image to obtain a labeled image containing the weld; The sample data set is constructed based on all annotated images containing welds.
3. The method for identifying apparent defects of steel bridge welds according to claim 2, characterized in that: The defect categories of the weld image include undercut, slag inclusion, hole, incomplete penetration, weld bead and no defect.
4. The method for identifying apparent defects of steel bridge welds according to claim 2, characterized in that: Preprocessing the weld image specifically includes: The weld image is subjected to cropping, grayscale processing, filtering and data enhancement processing in sequence; the data enhancement processing includes one or more of horizontal mirroring, vertical mirroring, diagonal flipping, translation and rotation, and the data enhancement processing includes brightness adjustment and contrast adjustment.
5. The method for identifying apparent defects of steel bridge welds according to claim 4, characterized in that: The Gaussian function is used to filter the weld image after grayscale processing. The specific formula is: f out (x,y)=G(x,y)*f in (x,y) Among them, f in (x,y) represents the image before filtering, f out (x, y) represents the filtered image, G(x, y) represents the Gaussian function, (x, y) represents the pixel coordinates on the image, σ represents the standard deviation of the Gaussian function, and * represents the convolution operator.
6. A terminal device, characterized in that: The terminal device comprises: Memory for storing computer programs; A processor, configured to implement the method for identifying surface defects of a steel bridge weld as described in any one of claims 1 to 5 when executing the computer program.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for identifying surface defects of a steel bridge weld as claimed in any one of claims 1 to 5 is implemented.
