Model training method, crack detection method, computing device, and readable storage medium
Patent Information
- Application Number
- CN202610968590.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-01
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2046-07-01
AI Technical Summary
In existing technologies, the detection of weld cracks in structures such as steel bridges relies on manual inspection, which poses safety hazards and has low detection efficiency. Traditional dataset expansion methods are insufficient and cannot simulate weld crack types under complex environments, resulting in poor detection results.
The image augmentation model is trained using the StyleGAN3 architecture to generate a high-quality set of virtual weld crack image samples. The Faster RCNN model is improved by combining the Swing Transformer network and the FPN module to enhance detection accuracy.
It enables accurate detection of weld cracks in structures such as steel bridges, especially the precise identification of micro-cracks, reducing redundant inspection frames and improving the accuracy and efficiency of inspection.
Smart Images

Figure CN122510258B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of weld inspection, specifically to a model training method, a crack detection method, a computing device, and a readable storage medium. Background Technology
[0002] Welding is commonly used at the joints of numerous structures such as steel bridges, stadiums, and columns. Under long-term loads and environmental factors, cracks often develop at these welded areas. These weld cracks can propagate over time, leading to structural failure. Due to the complex structure of steel bridges and similar facilities, with numerous welded joints often located in inaccessible or concealed areas, acquiring images of weld cracks presents significant challenges. Currently, image acquisition for steel bridge weld cracks largely relies on manual inspection and image capture, which is time-consuming and costly. Operators must spend extended periods in dangerous high-altitude areas or confined spaces to collect images, posing significant safety hazards. Furthermore, manual judgment of weld cracks during image acquisition is often subjective, and the acquired images depend on the operator's experience and skill level, easily leading to missed cracks. The insufficient availability of weld crack images in datasets limits the application of deep learning algorithms in weld crack detection for steel bridges and similar facilities.
[0003] Currently, publicly available weld crack images are scarce, limiting the training data for neural network models. This necessitates the use of traditional dataset augmentation methods to increase the number of virtual weld crack images. Traditional dataset augmentation methods primarily increase the diversity of image datasets by performing geometric transformations and color adjustments on existing images, such as image rotation, translation, cropping, brightness adjustment, and contrast adjustment. However, for complex weld crack image detection, simple data augmentation often fails to simulate the diversity of various crack types and environmental conditions. For rarer crack types, traditional dataset augmentation methods lack a deep understanding of the data semantics, cannot incorporate new structural information during the augmentation process, and cannot effectively generate representative samples, thus limiting the training effect of the detection model and making it difficult to accurately detect weld crack images in structures such as steel bridges. Summary of the Invention
[0004] To overcome the shortcomings of existing technologies, this invention aims to provide a model training method, a crack detection method, a computing device, and a readable storage medium to solve the problem of difficulty in accurately detecting weld crack images in structures such as steel bridges.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: Firstly, this application provides a model training method, comprising: The image augmentation model is obtained by training a model based on the StyleGAN3 architecture using the original sample set, which includes multiple weld crack images. The number of weld crack images is increased by using an image augmentation model to obtain a virtual image sample set corresponding to the weld crack images. The number of weld crack images in the virtual image sample set is greater than that in the original sample set. The initial model was trained based on a virtual image sample set to obtain a weld crack detection model; The initial model includes a Faster R-CNN model with a Swin Transformer network as the backbone. The initial model includes an FPN module and an ACmix attention mechanism module. The output of the Swin Transformer network is connected to the ACmix attention mechanism module through the FPN module, and the output of the FPN module is connected to each independent ACmix attention mechanism module. The FPN module is used to extract features at different resolution levels.
[0006] In the embodiments of this application, an image augmentation model is obtained by training a model based on the StyleGAN3 architecture using the original sample set, including: An original sample set was constructed based on multiple original weld crack images collected. The Model based on the StyleGAN3 architecture is trained using the original sample set to obtain the trained adversarial model. If the similarity of the results of the post-trained adversarial model is greater than the first threshold and the initial Frescher distance is less than the second threshold, the post-trained adversarial model is determined to be an image augmentation model.
[0007] In the embodiments of this application, the number of weld crack images is increased by using an image augmentation model to obtain a virtual image sample set corresponding to the weld crack images, including: The number of weld crack images is increased by using an image augmentation model to obtain multiple virtual weld crack images; A virtual image sample set of weld crack images is constructed based on multiple virtual weld crack images.
[0008] In the embodiments of this application, a virtual image sample set of weld crack images is constructed based on multiple virtual weld crack images, including: Abnormal weld crack images are removed from multiple virtual weld crack images to obtain multiple filtered virtual weld crack images; Multiple filtered virtual weld crack images are labeled to construct a virtual image sample set of weld crack images.
[0009] In the embodiments of this application, the virtual image sample set includes a training set; The initial model is trained based on a virtual image sample set to obtain a weld crack detection model, including: The initial model is trained based on each candidate hyperparameter configuration, and the accuracy and training speed corresponding to the candidate hyperparameter configuration are obtained. The optimal hyperparameter configuration is determined from all candidate hyperparameter configurations that have an accuracy greater than or equal to the target accuracy and a training speed greater than or equal to the preset speed. The training set is input into the initial model, and the initial model is trained multiple times based on the optimal hyperparameter configuration to obtain the weld crack detection model.
[0010] In embodiments of this application, the virtual image sample set further includes a verification set; The initial model is trained based on each candidate hyperparameter configuration, and the accuracy and training speed corresponding to each candidate hyperparameter configuration are obtained, including: The training set is input into the initial model, and the initial model is trained based on each candidate hyperparameter configuration to obtain the model to be validated, and the training speed corresponding to the candidate hyperparameter configuration is obtained. The validation set is input into the model to be validated, and the model is validated by obtaining the accuracy corresponding to each candidate hyperparameter configuration.
[0011] In the embodiments of this application, the Faster RCNN model further includes a region candidate network, a region of interest pooling layer, and a fully connected layer; The output of the Swin Transformer network is fed to the region candidate network, the output of the region candidate network is fed to the region of interest pooling layer, and the output of the region of interest pooling layer is fed to the fully connected layer.
[0012] Secondly, this application provides a crack detection method, including: Acquire images of the welds to be inspected at the target facility; The image of the weld to be detected is input into the weld crack detection model to obtain the weld crack detection result output by the weld crack detection model. The weld crack detection model is obtained according to the model training method described above.
[0013] Thirdly, this application provides a computing device, comprising: The memory is configured to store instructions; The processor is configured to retrieve instructions from memory and, when executing the instructions, to implement the aforementioned model training method and / or the aforementioned crack detection method.
[0014] Fourthly, this application provides a machine-readable storage medium storing instructions that cause a machine to execute the above-described model training method and / or the above-described crack detection method.
[0015] This application provides a model training method, including: training a model based on the StyleGAN3 architecture using an original sample set to obtain an image augmentation model; expanding the number of weld crack images using the image augmentation model to obtain a virtual image sample set corresponding to the weld crack images, wherein the number of weld crack images in the virtual image sample set is greater than that in the original sample set; and training an initial model based on the virtual image sample set to obtain a weld crack detection model.
[0016] Compared with the prior art, the beneficial effects of the present invention are: The weld crack images in the sample set augmented with the StyleGAN3 model not only have richer details and clearer features and textures, but also introduce new features, enriching the diversity of the data. The weld crack detection model trained on the virtual image sample set effectively reduces duplicate detection boxes and achieves more accurate localization of crack morphology.
[0017] Furthermore, the Faster RCNN model with the Swin Transformer network structure as the backbone network was improved by introducing the FPN architecture and ACmix attention mechanism to address the characteristics of weld cracks. This improved the detection accuracy of weld cracks, especially the detection accuracy of micro-cracks, thereby enabling accurate detection of weld crack images in structures such as steel bridges. Attached Figure Description
[0018] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a model training method according to an embodiment of the present invention; Figure 2 This is an example diagram illustrating variations of FID and SSIM according to an embodiment of the present invention; Figure 3 This is a Swing Transformer network diagram according to an embodiment of the present invention; Figure 4 This is a schematic diagram illustrating the principle of image block merging for weld cracks according to an embodiment of the present invention; Figure 5 This is a structural diagram of a Faster R-CNN model according to an embodiment of the present invention; Figure 6 This is a Swing Transformer network diagram of the initial model of an embodiment of the present invention; Figure 7 This is a flowchart of a crack detection method according to an embodiment of the present invention; Figure 8This is an example diagram of the first training process of an unmodified detection model according to an embodiment of the present invention; Figure 9 This is a first example diagram of an unmodified detection model according to an embodiment of the present invention; Figure 10 This is an example diagram of the second training process of an unmodified detection model according to an embodiment of the present invention; Figure 11 This is a second detection example diagram of an unmodified detection model according to an embodiment of the present invention; Figure 12 This is an example diagram comparing the training process before and after model improvement according to an embodiment of the present invention; Figure 13 This is an example diagram comparing the indicators before and after model improvement according to an embodiment of the present invention; Figure 14 This is an example diagram comparing crack detection before and after model improvement according to an embodiment of the present invention. Detailed Implementation
[0019] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustrative and explanatory purposes only and are not intended to limit the scope of the present invention.
[0020] The components of the embodiments of the invention described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0021] In the following, the terms “comprising,” “having,” and their cognates, which may be used in various embodiments of the invention, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as excluding, firstly, the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations thereof.
[0022] Furthermore, the terms "first," "second," and "third" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.
[0023] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of the invention pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be interpreted as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of the invention.
[0024] One-stage object detection networks offer high speed and low computational cost in weld crack detection, enabling rapid crack identification. However, due to directly regressing to predict the target's location and category, they suffer from low crack localization accuracy, are insensitive to detecting small microcracks, and frequently misidentify weld cracks in complex backgrounds. Two-stage object detection networks, by first generating candidate regions and then performing classification and refined regression, can detect weld cracks more accurately. The feature extraction backbone network is the core of the two-stage detection network; its appropriate selection is crucial for balancing the model's detection accuracy and speed.
[0025] Example 1 Please see Figure 1 , Figure 1 This is a flowchart of a model training method according to an embodiment of the present invention. Figure 1 The following are included: S110 trains a model based on the StyleGAN3 architecture using the original sample set to obtain an image augmentation model. The original sample set includes multiple weld crack images.
[0026] Images of weld cracks in publicly available steel structures are collected, and these images are compiled into a raw sample set. It's important to understand that while other adversarial networks can be trained to expand the number of weld crack images, these networks often generate images of poor quality, failing to meet the training requirements of subsequent models and resulting in suboptimal detection performance. In this embodiment, considering the characteristics of weld cracks, a model based on the StyleGAN3 architecture is trained using the raw sample set to obtain an image augmentation model.
[0027] S120, the number of weld crack images is increased by using an image augmentation model to obtain a virtual image sample set corresponding to the weld crack images, wherein the number of weld crack images in the virtual image sample set is greater than that in the original sample set.
[0028] After training a StyleGAN3-based model using the original sample set, the resulting image augmentation model can generate high-quality virtual weld crack images. Virtual images not only expand the size of the dataset but also increase its diversity and richness, improving the generalization ability of subsequent weld crack detection models. By generating virtual weld crack images using the image augmentation model, the number of weld crack images is increased, resulting in a virtual image sample set corresponding to the weld crack images.
[0029] S130, The initial model is trained based on the virtual image sample set to obtain the weld crack detection model; The initial model includes a Faster R-CNN model with a Swin Transformer network as the backbone. The initial model includes an FPN module and an ACmix attention mechanism module. The output of the Swin Transformer network is connected to the ACmix attention mechanism module through the FPN module, and the output of the FPN module is connected to each independent ACmix attention mechanism module. The FPN module is used to extract features at different resolution levels.
[0030] It is important to understand that while other convolutional neural networks besides the Swing Transformer network can be chosen as the backbone network of Faster RCNN, this can easily lead to poor recognition and localization of weld cracks in facilities such as steel bridges. In scenarios involving complex backgrounds or the detection of tiny weld cracks, it is easy to have a high false detection rate and a high false negative rate.
[0031] Considering the characteristics of weld crack images, this embodiment selects the Swing Transformer as the feature extraction network for the detection model. A Faster R-CNN model with the Swing Transformer network as the backbone is constructed to leverage the advantages of the Swing Transformer network in capturing detailed features and processing multi-scale information.
[0032] It's important to understand that modules other than the FPN and ACmix attention mechanisms can be chosen to improve the Swing Transformer network of the Faster R-CNN model. However, for virtual weld crack images generated by the image augmentation model, these improvements may not adequately adapt to the diversity and complexity of virtual images, leading to overfitting or poor generalization when processing image data.
[0033] To address the challenges of large size variations and complex background information in the virtual dataset of steel bridge weld cracks, this embodiment proposes an improvement to the Swin Transformer by introducing an FPN (Feature Pyramid Network) architecture and an ACmix (Attention Convolution Mix) attention mechanism. The Swin Transformer network of the Faster R-CNN model is reconstructed based on the FPN module, and the ACmix attention mechanism module is integrated into the Swin Transformer network of the Faster R-CNN model to obtain the initial model to be trained.
[0034] By adding an FPN module to extract features at different resolution levels, a feature pyramid is formed, and multi-scale feature information is integrated through lateral connections and adaptive weighting. The ACmix attention mechanism is integrated to concentrate more computational resources on the crack region in the image, while suppressing the influence of irrelevant background and reducing interference. Ultimately, this improves the accuracy and detail of crack detection. By introducing the FPN and ACmix attention mechanisms, the SwinTransformer network can extract richer features at different scales, while also improving the model's resistance to background interference.
[0035] A weld crack detection model is obtained by training the initial model using a virtual image sample set. The weld crack detection model trained with the virtual image sample set effectively reduces duplicate detection boxes and provides more accurate localization of crack morphology.
[0036] This application provides a model training method, comprising: training a model based on the StyleGAN3 architecture using an original sample set to obtain an image augmentation model, wherein the original sample set includes multiple weld crack images; augmenting the number of weld crack images using the image augmentation model to obtain a virtual image sample set corresponding to the weld crack images, wherein the number of weld crack images in the virtual image sample set is greater than that in the original sample set; and training the initial model based on the virtual image sample set to obtain a weld crack detection model.
[0037] The weld crack images in the sample set augmented with StyleGAN3 not only have richer details and clearer features and textures, but also introduce new features, enriching the diversity of the data. The weld crack detection model trained on the virtual image sample set effectively reduces duplicate detection boxes and achieves more accurate localization of crack morphology.
[0038] In addition, the Faster RCNN model with the Swin Transformer network as the backbone network was improved by introducing the FPN module and the ACmix attention mechanism module to improve the model for weld crack characteristics, which improved the detection accuracy of weld cracks, especially the detection accuracy of micro cracks, and thus realized the accurate detection of weld crack images of structures such as steel bridges.
[0039] In the embodiments of this application, an image augmentation model is obtained by training a model based on the StyleGAN3 architecture using the original sample set, including: An original sample set was constructed based on multiple original weld crack images collected. The Model based on the StyleGAN3 architecture is trained using the original sample set to obtain the trained adversarial model. If the similarity of the results of the post-trained adversarial model is greater than the first threshold and the initial Frescher distance is less than the second threshold, the post-trained adversarial model is determined to be an image augmentation model.
[0040] Multiple publicly available raw weld crack images are collected and organized to construct an original sample set. The StyleGAN3-based model is trained using this raw sample set to obtain a post-trained adversarial model. The adversarial network in the post-trained adversarial model consists of a generator network and a discriminator network. In this embodiment, the generator network is denoted as G, and the discriminator network as D. The main principle of the post-trained adversarial model is that the generator network converts random noise conforming to a specific distribution into generated image samples, while the discriminator network needs to accurately distinguish between real and fake input image samples. In the mutual adversarial interaction, the generator network and the discriminator network repeatedly update their weight parameters to improve model performance, eventually reaching Nash equilibrium. In this embodiment, the objective function of the GAN (Generative Adversarial Network) is: Formula (1) in, V(D,G) To optimize the objective function of the adversarial network, it consists of a generator network and a discriminator network. E Let be the mathematical expectation of the distribution function; x This is real data; P r (x) For the original data distribution, z It is random noise; P z (z) The data distribution is random noise. D(x) This indicates the result of identifying the true sample. G(z) This indicates the generated image.
[0041] The generator network samples latent vectors from the latent space. These latent vectors are randomized and used to control the generation of basic image features such as color, texture, and shape. The post-trained adversarial model also includes a mapping network, a style module, and a synthesis network. The mapping network, typically composed of eight fully connected layers, transforms the original latent vectors into high-dimensional feature vectors, allowing different dimensions of each latent vector to influence different features of the image. The high-dimensional feature vectors generated by the mapping network are fed into the style module, which influences the style of the final generated image by controlling different levels of features during the generation process, making the generated images more diverse and nuanced. The synthesis network, composed of 18 convolutional layers, transforms the feature vectors generated by the mapping network and style control module into the final image. Each convolutional layer introduces more image details through progressive magnification, resulting in a high-resolution image with high-definition detail. The discriminator network determines whether the image is real data or a fake image generated by the generator.
[0042] In this embodiment, the post-trained adversarial model uses Structural Similarity Index Measure (SSIM) and Fréchet Inception Distance (FID) as evaluation criteria to determine whether the virtual weld crack image generated by the model reaches a sufficiently high quality to meet the training requirements of the subsequent detection model. SSIM is an index that measures the similarity between two images. Based on human visual perception, it comprehensively considers the brightness, contrast, and structure of the images to reflect differences in image quality. Typically, the SSIM value ranges from 0 to 1; a higher SSIM value indicates a higher similarity between the two images. In this embodiment, it is used to evaluate the similarity between a real-world weld crack image and an augmented weld crack image. The formula for SSIM is: Formula (2) Wherein, SSIM represents the structural similarity value, X represents the augmented weld crack image, Y represents the actual weld crack image, μX represents the local mean of the actual weld crack image, μY represents the local mean of the augmented weld crack image, σX represents the variance of the actual weld crack image, σY represents the variance of the augmented weld crack image, and σX,Y represents the covariance of the actual weld crack image and the augmented weld crack image.
[0043] FID (Feature Distribution Identifier) is used to differentiate the feature distribution between real-world weld crack images and augmented weld crack images, reflecting both image diversity and generation quality. A lower FID value indicates higher diversity and better quality in the augmented weld crack image. The formula for FID is: Formula (3) in, x These are real images of weld cracks. g To expand the generated weld crack image, μ x The average value of the feature vectors of the real image over multiple IoU thresholds. COV x is the covariance matrix of the actually acquired weld crack image; μg is the average value of the feature vector of the augmented weld crack image over multiple IoU thresholds. COV g To augment the covariance matrix of the generated weld crack image; T r It represents the sum of the elements on the diagonal of the matrix.
[0044] If the similarity of the trained adversarial model's results is greater than a first threshold and the initial Fraser distance is less than a second threshold, the trained adversarial model is determined to be an image augmentation model. It should be understood that both the first and second thresholds are set according to actual needs and are not limited here. For ease of understanding, in the embodiments of this application, the first threshold is 0.8 and the second threshold is 50. If SSIM is greater than 0.8 and FID is less than 50, it is determined that the virtual weld crack image generated by the trained adversarial model has reached sufficient quality to meet the training requirements of the subsequent detection model, and the trained adversarial model is determined to be an image augmentation model.
[0045] In the embodiments of this application, an image augmentation model is obtained by training a model based on the StyleGAN3 architecture using the original sample set, including: The original sample set is input into the model based on the StyleGAN3 architecture. The model based on the StyleGAN3 architecture is trained by the preset training parameters to obtain the image augmentation model. The preset training parameters include preset iteration period, batch size set to 4, path length regularization coefficient set to 6, training performed in a single GPU environment, and outputting the model weights and evaluation metrics every 20 iteration periods.
[0046] For ease of understanding, in this embodiment, 600 real original weld crack images were acquired. These images were then labeled to construct an original sample set. The original sample set was input into a model based on the StyleGAN3 architecture. The model was trained using preset training parameters to obtain an image augmentation model. Specifically, the preset training parameters in this embodiment include a preset iteration period, a batch size of 4, a path length regularization coefficient of 6, training performed in a single GPU environment, and outputting the model's weights and evaluation metrics every 20 iterations. The size of the preset iteration period is set according to actual needs and is not limited here. For ease of understanding, in this embodiment, the preset iteration period is 5000 rounds.
[0047] Please see Figure 2 , Figure 2 This is an example diagram showing variations of FID and SSIM according to an embodiment of the present invention.
[0048] As shown in the figure, the FID and SSIM metrics of the StyleGAN3 architecture model change continuously during training. The image augmentation model has an FID of 47 and an SSIM of 0.81, satisfying the condition that SSIM is greater than 0.8 and FID is less than 50. Therefore, it is determined that the image augmentation model meets the training requirements of the subsequent detection model.
[0049] In the embodiments of this application, the number of weld crack images is increased by using an image augmentation model to obtain a virtual image sample set corresponding to the weld crack images, including: The number of weld crack images is increased by using an image augmentation model to obtain multiple virtual weld crack images; A virtual image sample set of weld crack images is constructed based on multiple virtual weld crack images.
[0050] The number of weld crack images is increased by using an image augmentation model to obtain multiple virtual weld crack images. In this embodiment, 600 original weld crack images are augmented to 5100 virtual weld crack images, avoiding the shortage of weld crack image datasets for facilities such as steel bridges. The image augmentation model trained based on the StyleGAN3 architecture not only accurately restores the basic structure of the original weld crack images collected in reality, but also adds other features such as background color variation, crack location, and line thickness, meaning that the image augmentation model generates diverse virtual weld crack images.
[0051] In the embodiments of this application, a virtual image sample set of weld crack images is constructed based on multiple virtual weld crack images, including: Abnormal weld crack images are removed from multiple virtual weld crack images to obtain multiple filtered virtual weld crack images; Multiple filtered virtual weld crack images are labeled to construct a virtual image sample set of weld crack images.
[0052] The virtual weld crack images were processed, and abnormal weld crack images were removed from multiple virtual weld crack images to obtain a number of filtered virtual weld crack images. Abnormal weld crack images were determined according to actual needs; they could be weld cracks that did not conform to the norm, or images with excessively low quality, etc., and were not limited here. The filtered virtual weld crack images were then labeled to construct a virtual image sample set of weld crack images.
[0053] In the embodiments of this application, the Faster RCNN model further includes a region candidate network, a region of interest pooling layer, and a fully connected layer; The output of the Swin Transformer network is fed to the region candidate network, the output of the region candidate network is fed to the region of interest pooling layer, and the output of the region of interest pooling layer is fed to the fully connected layer.
[0054] Please see Figure 3 , Figure 3 This is a Swing Transformer network diagram according to an embodiment of the present invention.
[0055] As shown in the figure, the Swin Transformer network architecture in this embodiment includes image patch partitioning, linear embedding, Swin Transformer blocks, and patch merging. The input weld crack image has a size of H×W×3, meaning it consists of height (H), width (W), and RGB (Red, Green, Blue) channels. The image patch partitioning process divides the image into smaller patches. Each patch has a size of H / 4×W / 4, and the output feature map size is H / 4×W / 4×48, meaning each image patch contains 48 dimensions of features, which helps the model focus on local details of the image.
[0056] Please see Figure 4 , Figure 4 This is a schematic diagram illustrating the principle of image block merging for weld cracks according to an embodiment of the present invention.
[0057] In the Swing Transformer network, the weld crack image is divided into 4×4 blocks. The network extracts features from local information such as crack texture and shape in each block. Then, adjacent image blocks are merged to reduce the spatial resolution and increase the number of channels. After multiple image block merging processes, the Swing Transformer network finally outputs a low-resolution, high-channel feature map containing both global and detailed features of the weld crack, which is then fed into the subsequent networks of the Faster R-CNN model for object detection.
[0058] Specifically, in the first stage of the Swin Transformer network processing, each image patch after partitioning is converted into a feature vector through linear embedding, enabling the image to enter the subsequent network structure. The Swin Transformer module is applied twice to extract higher-level image features. The output feature map has a size of H / 4×W / 4×C, where C is the number of feature channels, with a value between 64 and 128, which will not be elaborated here.
[0059] The second stage of the Swin Transformer network processing involves image patch merging, which combines multiple small image patches into a larger region, reducing the spatial dimension of the image and increasing the number of channels in the feature map. The size of the output feature map becomes H / 8×W / 8×2C, meaning the spatial dimension is reduced and the number of channels increases. Through image patch merging, the network can aggregate more local information and expand its perceptual range of the image. The Swin Transformer module is applied twice, resulting in an output feature map with a size of H / 8×W / 8×2C.
[0060] In the third stage of the Swin Transformer network processing, image patch merging is performed to further reduce the spatial dimensions and increase the number of channels. The Swin Transformer module is applied six times; stacking more Swin Transformer modules allows the Swin Transformer network to capture more complex image patterns. The output feature map size is H / 16×W / 16×4C.
[0061] In the fourth stage of the Swin Transformer network processing, image patch merging is performed to further reduce the spatial dimension and increase the number of channels. The Swin Transformer module is applied twice, and the output feature map has a size of H / 32×W / 32×8C. After the image is processed through the four stages of the Swin Transformer network, a high-level feature map is finally output for weld crack detection tasks.
[0062] Please see Figure 5 , Figure 5 This is a structural diagram of the Faster RCNN model according to an embodiment of the present invention.
[0063] The Faster R-CNN model also includes a Region Proposal Network (RPN), a Region of Interest Pooling (ROI) layer, and fully connected layers. As shown in the figure, in this embodiment, the Faster R-CNN model consists of four parts: a Swing Transformer network, the RPN, the ROI pooling layer, and fully connected layers. The RPN generates candidate regions from the feature maps extracted by the Swing Transformer network. These candidate regions are locations that may contain weld cracks. Each candidate region has a probability score and location coordinates, which will not be elaborated here. The ROI pooling layer processes the candidate regions, mapping candidate regions of different sizes to a fixed-size feature map for input into the subsequent fully connected layers for classification and regression.
[0064] After region-of-interest (ROI) pooling, the feature maps are passed to fully connected layers for target category classification. Simultaneously, the pooled feature maps are also passed to a regression network, which refines the location and size of candidate regions, outputting precise bounding box coordinates. The Faster R-CNN model uses non-maximum suppression to retain candidate regions with high scores and no overlap based on their scores, while removing redundant candidate regions, ultimately outputting weld crack detection results with clear scores and locations.
[0065] Please see Figure 6 , Figure 6 This is a Swing Transformer network diagram of the initial model of an embodiment of the present invention.
[0066] To address the challenges of large size variations and complex background information in virtual datasets of weld cracks in steel bridges and other facilities, this embodiment improves the Swing Transformer network of the Faster R-CNN model. As shown in the figure, the Swing Transformer network of the Faster R-CNN model is reconstructed based on the FPN module, and the ACmix attention mechanism module is integrated into the Swing Transformer network of the Faster R-CNN model. The improved Faster R-CNN model serves as the initial model to be trained.
[0067] The FPN module extracts features at different resolution levels, forming a feature pyramid, and integrates multi-scale feature information through lateral connections and adaptive weighting. The FPN module effectively enhances the detection capability of cracks at different scales, enabling the improved Faster R-CNN model to capture both the fine texture of small cracks and maintain the contextual information of large cracks in a single image. The computational process of the FPN module, which generates low-level features from high-level features step-by-step from top to bottom, is as follows: Formula (4) Lateral connectivity fuses high-level features from each layer with features from lower layers, thereby improving the quality of the lower-level feature maps. The calculation process is as follows: Formula (5) In formulas (4) and (5), C l For the first l Feature map of the layer P l For the first l Feature maps generated by the layers, P l+1 For the first l The feature map generated from the layer above the previous layer, UpSampling is an upsampling operation used to upsample the resolution of the high-level feature map to the spatial resolution of the low-level feature map, and Conv is a convolution operation used to generate a feature map from the feature map of the previous layer.
[0068] The ACmix attention mechanism module standardizes weights using the softmax activation function, concentrating more computational resources on the crack region in the image while suppressing the influence of irrelevant background and reducing interference. This ultimately improves the accuracy and detail of crack detection. Specifically, in the first stage, the ACmix attention mechanism module projects the input feature map through multiple 1×1 convolutions, transforming it into a set of intermediate feature maps. The calculation process is as follows: Formula (6) in, g ij The pixels of the output feature map after convolution. K p,q For convolution kernel; The pixels are the input feature map.
[0069] In the second stage, the ACmix attention mechanism module further processes the intermediate feature maps obtained in the first stage through self-attention paths and convolutional paths. In the self-attention path, the intermediate feature maps are converted into query, key, and value through 1×1 convolution operations. Then, weighted aggregation is performed by calculating attention weights to obtain the final feature output. The calculation process is as follows: Formula (7) in, W q For the projection of the query W k The projection matrix of the key; f ij and f ab These are the pixels of the input feature map, and softmax is the activation function.
[0070] In the convolutional path, traditional convolution operations are used, with shift and aggregation operations employed to capture local spatial information. After the computation of the self-attention path and the convolutional path is completed, the ACmix attention mechanism module weighted and fused the outputs of the two paths. The computation process is as follows: (8) in, F att For the output of the self-attention path, F conv The output of the convolution path; α and β The learned parameters control the ratio of the outputs of the two paths; that is, the outputs of the two paths are weighted and fused, and the weighting coefficients are composed of two learned scalars. α and β control.
[0071] In the embodiments of this application, the virtual image sample set includes a training set; The initial model is trained based on a virtual image sample set to obtain a weld crack detection model, including: The initial model is trained based on each candidate hyperparameter configuration, and the accuracy and training speed corresponding to the candidate hyperparameter configuration are obtained. The optimal hyperparameter configuration is determined from all candidate hyperparameter configurations that have an accuracy greater than or equal to the target accuracy and a training speed greater than or equal to the preset speed. The training set is input into the initial model, and the initial model is trained multiple times based on the optimal hyperparameter configuration to obtain the weld crack detection model.
[0072] Multiple candidate hyperparameter configurations are pre-selected. The initial model is trained based on each candidate hyperparameter configuration, and the accuracy and training speed corresponding to each configuration are obtained. The optimal hyperparameter configuration is determined from all candidate configurations where the accuracy is greater than or equal to the target accuracy and the training speed is greater than or equal to the preset speed. It should be understood that the target accuracy and preset speed are set according to actual needs and are not limited here.
[0073] If multiple candidate hyperparameter configurations all satisfy the condition that accuracy is greater than or equal to the target accuracy and training speed is greater than or equal to the preset speed, the candidate hyperparameter configuration with the fastest training speed and the highest accuracy can be selected as the optimal hyperparameter configuration. Alternatively, the candidate hyperparameter configuration with the highest accuracy and the highest training speed can be selected as the optimal hyperparameter configuration. This will not be elaborated further here. The training set is input into the initial model, and the initial model is trained multiple times based on the optimal hyperparameter configuration to obtain the weld crack detection model. This improves the detection accuracy of cracks, especially micro-cracks, while maintaining the training speed.
[0074] In embodiments of this application, the virtual image sample set further includes a verification set; The initial model is trained based on each candidate hyperparameter configuration, and the accuracy and training speed corresponding to each candidate hyperparameter configuration are obtained, including: The training set is input into the initial model, and the initial model is trained based on each candidate hyperparameter configuration to obtain the model to be validated, and the training speed corresponding to the candidate hyperparameter configuration is obtained. The validation set is input into the model to be validated, and the model is validated by obtaining the accuracy corresponding to each candidate hyperparameter configuration.
[0075] The training set is input into the initial model, and the initial model is trained for at least one round based on each candidate hyperparameter configuration to obtain the model to be validated. During at least one round of training, the training speed corresponding to the candidate hyperparameter configuration is obtained. The validation set is input into the model to be validated, and the accuracy corresponding to each candidate hyperparameter configuration is obtained. Different hyperparameter configurations are debugged during training to select the optimal hyperparameter configuration that balances training speed and accuracy.
[0076] Example 2 Please see Figure 7 , Figure 7 This is a flowchart of a crack detection method according to an embodiment of the present invention. Figure 7 Crack detection methods include: S210, acquire the image of the weld to be inspected in the target facility.
[0077] The target facility is set up according to actual needs and can be any steel bridge, column, or other facility requiring weld crack inspection. Images are acquired at the locations where welding processes are used on the target facility to obtain images of the welds to be inspected.
[0078] S220, input the image of the weld to be detected into the weld crack detection model to obtain the weld crack detection result output by the weld crack detection model. The weld crack detection model is obtained according to the above-mentioned model training method.
[0079] The image of the weld to be inspected is input into the weld crack detection model. The weld crack detection model analyzes whether cracks have appeared and determines the location of the cracks, thereby obtaining the weld crack detection result output by the weld crack detection model.
[0080] When using traditional dataset augmentation methods to expand samples, GANs (Generative Adversarial Networks) can generate samples with a distribution similar to the original weld seam images, effectively increasing data diversity. Through adversarial training, the generator can learn the latent features of the data from random noise and generate samples with similar statistical properties, supplementing the deficiencies of existing datasets when data is scarce. However, the image quality generated by traditional GANs may be unstable; in complex scenes, generated images may be noisy or blurry. In high-resolution or fine-grained tasks, the clarity and detail of the generated images are poor, leading to significant differences between the generated images and the actual data.
[0081] For ease of understanding, in the embodiments of this application, the dataset expanded using traditional dataset augmentation methods is used to train a Faster R-CNN model with a Swin Transformer network as the backbone, resulting in an unimproved detection model. This unimproved detection model, compared to the weld crack detection model obtained using the aforementioned training methods, does not incorporate the FPN module and ACmix attention mechanism module for improvement. In this embodiment, the number of weld crack images is increased using an image augmentation model, resulting in multiple virtual weld crack images, expanding the original 600 weld crack images to 5100 virtual weld crack images. Correspondingly, the total number of images in the dataset expanded using traditional dataset augmentation methods is also 5100, the same as the number of virtual weld crack images.
[0082] Please see Figure 8 , Figure 8 This is an example diagram of the first training process of an unmodified detection model according to an embodiment of the present invention.
[0083] During the training of the unimproved detection model, the IoU (Intersection over Union) threshold for the region candidate network was set to 0.7 to ensure the generation of high-quality candidate boxes, and the IoU threshold for the region of interest pooling layer was set to 0.5 to ensure sufficient samples for classification and regression. The IoU thresholds during the evaluation phase were set to 0.5, 0.75, 0.95, and 1, respectively, to comprehensively evaluate the performance of the weld crack detection model from different accuracy requirements. As shown in the figure, mAP 0.5 This indicates that the IoU threshold is set to 0.5, and mAP 0.75 This indicates that the IoU threshold is set to 0.75, and mAP 0.95 This indicates that the IoU threshold is set to 0.95, and mAP all This indicates that the IoU threshold is set to the average of multiple IoU thresholds. The model is trained for 280 epochs, with results output every two epochs.
[0084] Please see Figure 9 , Figure 9 This is a first example diagram of an unmodified detection model according to an embodiment of the present invention.
[0085] The model's accuracy at optimal weights is: mAP 0.5 The mAP is 92.1. 0.75 It is 84.7, mAP 0.95 It is 60.8, mAP all The score is 69.9. In this embodiment, parameter settings with an output confidence level of 0.6 or higher are selected as the inference results of the model, and the optimal weights from 280 training rounds are selected for actual steel bridge weld crack detection. When using traditional dataset augmentation methods to expand the samples, the amount of data in these methods is insufficient, and the crack features that the model can learn during training are limited. This makes it difficult to accurately determine the complete crack area in actual detection, resulting in multiple duplicate detection boxes near the same crack. In addition, the size, direction, shape, and background of the cracks in the original dataset vary little, causing the model to be unable to adapt to more real-world scenarios, thus affecting the stability and accuracy of detection. As shown in the figure, the unimproved detection model trained based on the original sample set produces multiple duplicate detection boxes in the actual weld crack detection scenario, and the crack localization is not complete enough.
[0086] Please see Figure 10 , Figure 10 This is an example diagram of the second training process of the unmodified detection model according to an embodiment of the present invention.
[0087] The input training data, previously augmented using traditional methods, is replaced with virtual weld crack images in this embodiment; that is, the model is trained using a virtual image sample set. The model parameters are set identically, and the training process is shown in the figure. The IoU thresholds during the evaluation phase are set to 0.5, 0.75, 0.95, and 1, respectively, to comprehensively evaluate the performance of the weld crack detection model from different accuracy requirements. As shown in the figure, mAP... 0.5 This indicates that the IoU threshold is set to 0.5, and mAP 0.75 This indicates that the IoU threshold is set to 0.75, and mAP 0.95 This indicates that the IoU threshold is set to 0.95, and mAP all This indicates that the IoU threshold is set to the average of multiple IoU thresholds. The model is trained for 280 epochs, with results output every two epochs.
[0088] Please see Figure 11 , Figure 11 This is a second detection example diagram of an unmodified detection model according to an embodiment of the present invention.
[0089] The model's accuracy at optimal weights is as follows: mAP 0.5 The mAP is 98.6. 0.75 The mAP is 92.6. 0.95 It is 79.3, mAP all The value is 78.8. The optimal weights are selected, and actual steel bridge weld cracks are detected. As shown in the figure, the unimproved detection model, trained using the virtual image sample set in the above model training method, effectively reduces duplicate detection boxes and provides more accurate localization of crack morphology.
[0090] Please see Figure 12 , Figure 12 This is an example diagram comparing the training process before and after model improvement according to an embodiment of the present invention.
[0091] To address the issues of inconsistent weld crack sizes and complex backgrounds in virtual datasets of steel bridge welds, this invention introduces FPN and ACmix to improve the Swing Transformer network. As shown in the figure, for ease of understanding, in this embodiment, the Swing Transformer network of the unimproved detection model is denoted as the Swing Transformer in the figure, and the A-Swin Transformer network of the weld crack detection model obtained by the above training method is denoted as the Swing Transformer in the figure.
[0092] As shown in the figure, mAP 0.5 This indicates that the IoU threshold is set to 0.5, and mAP 0.75This indicates that the IoU threshold is set to 0.75, and mAP 0.95 This indicates that the IoU threshold is set to 0.95, and mAP all This indicates that the IoU threshold is set to the average of multiple IoU thresholds. The initial model is trained based on a virtual image sample set to obtain a weld crack detection model. By comparing the changes during the model's training process, it can be seen that the FPN module enhances the connection of global contextual information, enabling the model to enter the convergence phase earlier. Meanwhile, the ACmix attention mechanism module avoids the risk of overfitting, resulting in smaller fluctuations in the performance metrics after convergence.
[0093] Please see Figure 13 , Figure 13 This is an example diagram comparing the indicators before and after model improvement in one embodiment of the present invention.
[0094] As shown in the figure, the Swin Transformer network of the unimproved detection model is denoted as SwinTransformer in the figure, and the A-Swin Transformer network of the weld crack detection model obtained by the above training method is denoted as Swin Transformer in the figure. Comparing the metrics of the unimproved detection model and the weld crack detection model in this embodiment, since the unimproved Faster R-CNN model already has a strong detection capability for larger and clearer cracks, the improvement results in a significant increase in the model's mAP. 0.5 The final metrics have little impact, with an accuracy improvement of only 0.3%. mAP, which reflects average accuracy, is the key indicator. all The overall performance improved by 2.5%, with mAP0.75 (reflecting small target detection capability) improving by 2.8% and mAP0.95 by 5.4%. The evaluation model improved mAPm and mAPl (reflecting medium and large crack detection capabilities) by 3.7% and 1.8%, respectively. Furthermore, the optimized model's final performance metrics were more stable.
[0095] Please see Figure 14 , Figure 14 This is a comparison example of the second type of crack detection before and after model improvement in one embodiment of the present invention.
[0096] like Figure 14As shown, the Swin Transformer network of the unimproved detection model is denoted as SwinTransformer in the figure, and the A-Swin Transformer network of the weld crack detection model obtained by the above training method is denoted as Swin Transformer in the figure. This embodiment provides four different crack images: image a is a normal crack image; image b is multiple crack images with two or more cracks; image c is a crack image with complex background interference; and image d is a crack image that runs through the entire image. Comparing the crack detection results in image a, the improvement in the model before and after the improvement is not significant for detecting larger and more obvious cracks. Compared to the unimproved detection model, the weld crack detection model in this embodiment has a more accurate localization capability. Comparing the crack detection results in image b, the unimproved detection model cannot detect all cracks, while the weld crack detection model in this embodiment improves the detection capability for small cracks. Comparing the crack detection results in image c, the unimproved detection model misjudges background interference such as protruding structures as cracks. The weld crack detection model in this embodiment does not misjudge background interference as cracks. Comparing the crack detection results in Figure d, the unimproved detection model failed to detect all cracks, only detecting the more obvious ones, and missed cracks in areas with blurred backgrounds. The weld crack detection model in this embodiment did not miss any cracks.
[0097] The confidence levels of the weld crack detection model in this embodiment for each crack detection type have also been improved, reflecting the enhanced crack identification capability of the optimized model and its improved adaptability to diverse data. The test results demonstrate the improved ability of the weld crack detection model in this embodiment to handle complex backgrounds and identify fine cracks.
[0098] This application embodiment also provides a computing device, including: The memory is configured to store instructions; The processor is configured to retrieve instructions from memory and, when executing the instructions, to implement the aforementioned model training method and / or the aforementioned crack detection method.
[0099] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and the model training method and / or the crack detection method described above can be implemented by adjusting the kernel parameters.
[0100] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0101] This application also provides a machine-readable storage medium storing instructions that cause a machine to execute the above-described model training method and / or the above-described crack detection method.
[0102] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0103] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0104] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0105] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0106] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0107] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0108] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0109] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0110] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A model training method, characterized in that, include: An image augmentation model is obtained by training a model based on the StyleGAN3 architecture using the original sample set, wherein the original sample set includes multiple weld crack images. The number of weld crack images is increased by using the image augmentation model to obtain a virtual image sample set corresponding to the weld crack images, wherein the number of weld crack images in the virtual image sample set is greater than the number of weld crack images in the original sample set. The initial model is trained based on the virtual image sample set to obtain a weld crack detection model; The initial model includes a Faster RCNN model with a Swing Transformer network as the backbone network. The initial model includes an FPN module and an ACmix attention mechanism module. The output of the Swing Transformer network is connected to the ACmix attention mechanism module through the FPN module, and the output of the FPN module is connected to each independent ACmix attention mechanism module. The FPN module is used to extract features at different resolution levels.
2. The model training method according to claim 1, characterized in that, The process of training a model based on the StyleGAN3 architecture using the original sample set to obtain an image augmentation model includes: An original sample set was constructed based on multiple original weld crack images collected. The original sample set is used to train the model based on the StyleGAN3 architecture to obtain the trained adversarial model. If the similarity of the results of the post-trained adversarial model is greater than a first threshold and the initial Frescher distance is less than a second threshold, the post-trained adversarial model is determined to be an image augmentation model.
3. The model training method according to claim 1, characterized in that, The step of expanding the number of weld crack images using the image augmentation model to obtain a virtual image sample set corresponding to the weld crack images includes: The number of weld crack images is increased by using the image augmentation model to obtain multiple virtual weld crack images; Based on the multiple virtual weld crack images, a virtual image sample set of weld crack images is constructed.
4. The model training method according to claim 3, characterized in that, The step of constructing a virtual image sample set of weld crack images based on the plurality of virtual weld crack images includes: Abnormal weld crack images are removed from the multiple virtual weld crack images to obtain multiple filtered virtual weld crack images; The multiple filtered virtual weld crack images are labeled to construct a virtual image sample set of weld crack images.
5. The model training method according to claim 1, characterized in that, The virtual image sample set includes a training set; The step of training the initial model based on the virtual image sample set to obtain the weld crack detection model includes: The initial model is trained based on each candidate hyperparameter configuration, and the accuracy and training speed corresponding to the candidate hyperparameter configuration are obtained. The optimal hyperparameter configuration is determined from all candidate hyperparameter configurations that have an accuracy greater than or equal to the target accuracy and a training speed greater than or equal to the preset speed. The training set is input into the initial model, and the initial model is trained multiple times based on the optimal hyperparameter configuration to obtain the weld crack detection model.
6. The model training method according to claim 5, characterized in that, The virtual image sample set also includes a verification set; The step of training the initial model based on each candidate hyperparameter configuration and obtaining the accuracy and training speed corresponding to the candidate hyperparameter configuration includes: The training set is input into the initial model, and the initial model is trained based on each candidate hyperparameter configuration to obtain the model to be verified, and the training speed corresponding to the candidate hyperparameter configuration is obtained. The validation set is input into the model to be validated, and the model is validated to obtain the accuracy corresponding to each candidate hyperparameter configuration.
7. The model training method according to claim 1, characterized in that, The Faster RCNN model also includes a region candidate network, a region of interest pooling layer, and a fully connected layer. The Swin Transformer network outputs to the region candidate network, the region candidate network outputs to the region of interest pooling layer, and the region of interest pooling layer outputs to the fully connected layer.
8. A crack detection method, characterized in that, include: Acquire images of the welds to be inspected at the target facility; The image of the weld to be detected is input into the weld crack detection model to obtain the weld crack detection result output by the weld crack detection model, wherein the weld crack detection model is obtained by the model training method according to any one of claims 1 to 7.
9. A computing device, characterized in that, include: The memory is configured to store instructions; The processor is configured to retrieve the instructions from the memory and, when executing the instructions, to implement the model training method according to any one of claims 1 to 7, and / or the crack detection method according to claim 8.
10. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores instructions for causing the machine to perform the model training method according to any one of claims 1 to 7, and / or the crack detection method according to claim 8.
