Weld defect real-time detection method and system based on lightweight neural network
By using the feature extraction and fusion of the lightweight neural network StarNet and the C3k2-FasterFusion module, combined with the LeanHead detection head, the problem of balancing real-time performance and accuracy in weld defect detection is solved, achieving efficient and accurate weld defect detection, which is applicable to aerospace, automotive manufacturing and other fields.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-03-31
AI Technical Summary
Existing weld defect detection technologies struggle to achieve real-time, accurate, and efficient detection in industrial settings. In particular, the models struggle to balance accuracy and speed when identifying small-sized, irregularly shaped defects and in complex backgrounds, and noise interference affects detection stability.
The system employs a lightweight neural network, StarNet, for feature extraction, combines it with the C3k2-FasterFusion module for feature fusion, and uses the LeanHead detection head for defect location regression and category prediction. It also reduces computational complexity by sharing convolutional layer structures and is compatible with edge computing devices.
It enables accurate identification of small-sized, irregularly shaped weld defects, meets the needs of industrial-grade quality monitoring, reduces the scale of model parameters and computational load, adapts to various industrial welding scenarios, and achieves real-time online detection.
Smart Images

Figure CN121767320A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and intelligent manufacturing technology, and more specifically, to a method and system for real-time detection of weld defects based on a lightweight neural network. Background Technology
[0002] In industries such as aerospace, automotive manufacturing, and energy equipment, welding is one of the core joining processes. The quality of the weld directly affects the structural strength and safety of the product. Therefore, weld defect detection is an indispensable quality control step in industrial production. During the weld formation process, various types of defects, such as porosity, cracks, lack of fusion, chamfering, voids, and burn-through, are easily generated due to factors such as fluctuations in process parameters, environmental interference, or changes in equipment status. If these defects are not identified in a timely and accurate manner, they may lead to safety hazards during product service.
[0003] Traditional weld defect detection mainly relies on non-destructive testing methods, including ultrasonic testing, radiographic testing, magnetic particle testing, and manual visual inspection. These methods have significant limitations in practical applications: manual visual inspection results are easily affected by subjective factors such as the inspector's experience and fatigue, resulting in low efficiency and poor consistency; while ultrasonic testing and radiographic testing offer a certain depth of detection, their complex procedures, bulky equipment, and stringent environmental requirements make them unsuitable for the real-time online inspection needs of production lines. Furthermore, the analysis and interpretation of test results require specialized personnel, further limiting the improvement of inspection efficiency.
[0004] With the rapid development of deep learning and computer vision technologies, image-based intelligent target detection technology has provided a new solution for weld defect detection. Target detection algorithms, represented by R-CNN, Faster R-CNN, SSD, and the YOLO series, can automatically extract features from images and complete target recognition through an end-to-end learning model, demonstrating excellent detection performance in complex scenes. Among them, the YOLO series algorithms, due to their balance between detection speed and accuracy, have become a research hotspot in the field of industrial defect detection, and related improved models have already been initially applied in weld defect detection scenarios.
[0005] However, existing deep learning-based weld defect detection technologies still face several practical challenges: First, weld defects are often small in size and irregular in shape, making their features easily obscured under different lighting conditions and complex background interference, hindering accurate model identification. Second, industrial production scenarios demand extremely high detection speeds, especially when deployed on edge computing devices. It is necessary to control the computational complexity and parameter scale of the model while ensuring detection accuracy, and existing models often struggle to balance the trade-off between accuracy and speed. Third, noise prevalent in welding images interferes with the feature extraction process, reducing the model's generalization ability and affecting the stability of detection results. These problems prevent existing technologies from fully meeting the practical needs of real-time, accurate, and efficient weld defect detection in industrial scenarios. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of existing technologies and propose a real-time weld defect detection method based on a lightweight neural network, comprising the following steps: S1 Image Acquisition: Acquire images of the weld area to be inspected; S2 Feature Extraction: The lightweight backbone network StarNet is used to extract multi-scale features of the image. StarNet contains four feature extraction stages, and the core uses star-shaped operations to realize feature mapping and nonlinear transformation. S3 Feature Fusion: The multi-scale features are fused and enhanced through the C3k2-FasterFusion module, which integrates partial convolution (PConv), convolution gated linear unit (CGLU) and convolution-attention fusion module (CAFM). S4 Target Detection: Defect location regression and category prediction are performed on the fused features using the LeanHead lightweight detection head, which employs a shared convolutional layer structure. S5 output: Generates defect location boxes and corresponding classification labels.
[0007] Preferably, the star-shaped operation of StarNet specifically involves: adding a constant to the input vector and then performing two independent linear transformations, multiplying the results of the two transformations element by element, as expressed mathematically:
[0008] Here and For input channel index (including additional bias terms). For input dimensions.
[0009] Preferably, each feature extraction stage of StarNet reduces the feature map size through convolutional layers, employs batch normalization, and sets a depthwise separable convolution at the end of the stage, with ReLU6 as the activation function.
[0010] Preferably, the workflow of the C3k2-FasterFusion module is as follows: first, some input channels are convolved using PConv to reduce computational load; then, local attention features are extracted using CGLU; and finally, enhanced fusion features are output by combining the detailed features of local branches with the attention mechanism of global branches using CAFM.
[0011] Preferably, the shared convolutional layer of the LeanHead lightweight detection head is a 3×3 convolutional layer, followed by two independent 1×1 convolutional layers, which are used for defect box prediction and category classification, respectively.
[0012] Preferably, in the image acquisition step, the size of the acquired images is uniformly adjusted to 640×640 pixels, and the training samples are expanded using data augmentation technology. The expanded training samples are divided into training set, validation set and test set according to a preset ratio.
[0013] Preferably, the total number of data-enhanced training samples is 4000, and the preset ratio is training set:validation set:test set = 7:2:1. A real-time weld defect detection system based on a lightweight neural network includes: Image acquisition module: used to acquire image data of the weld area to be inspected; Feature extraction module: The StarNet backbone network is used to extract multi-scale features from the image data. Feature fusion module: The C3k2-FasterFusion module described above is used to fuse and enhance the multi-scale features; Target detection module: The LeanHead lightweight detection head mentioned above is used to realize defect location regression and category prediction; Result output module: Used to receive the output information of the target detection module, generate and output defect location boxes and classification labels.
[0014] Preferably, it also includes an edge deployment unit, which is adapted to GPU / ARM / ASIC hardware platforms and is used to carry the feature extraction module, feature fusion module and target detection module to realize real-time online detection of weld defects.
[0015] Preferably, the image acquisition module includes a data augmentation unit, which is used to expand the training samples through data augmentation technology and divide the training set, validation set and test set according to a preset ratio.
[0016] Compared with existing technologies, the beneficial effects of this invention are: This invention captures second-order interactions between features through the star-shaped operation of the StarNet backbone network, and combines the local attention extraction and global attention fusion mechanism of the C3k2-FasterFusion module to effectively suppress noise interference in welding images, accurately identify various weld defects of small size and irregular shape, and the detection accuracy fully meets the stringent requirements of industrial-grade quality monitoring.
[0017] Through structural optimization of the three core modules, the model parameter scale and computational load are greatly reduced. Compared with mainstream lightweight detection models, the lightweight advantage is significant. It can be flexibly deployed on various edge computing devices such as GPU / ARM / ASIC, which completely solves the industry pain points of high hardware resource requirements and limited deployment of traditional deep learning models.
[0018] The LeanHead detection head reduces redundant computation by sharing convolutional layers and, combined with the efficient feature processing logic of StarNet and C3k2-FasterFusion, significantly improves detection speed, fully meeting the online real-time detection needs of high-speed industrial production lines. It can be widely adapted to various fields with high requirements for detection timeliness, such as aerospace and automotive manufacturing.
[0019] The core functional modules of this invention are independently customizable, and the module combination can be flexibly adjusted according to the accuracy and speed requirements of different industrial scenarios. At the same time, the model is compatible with a variety of optimization technologies, and can be adapted to different weld types, lighting conditions and inspection equipment, covering various industrial welding quality inspection scenarios.
[0020] Compared to traditional non-destructive testing methods, the testing process of this invention is highly automated, requires no manual intervention, and significantly reduces labor costs. After the model is deployed on edge devices, it can achieve real-time quality inspection, promptly detect welding defects and provide feedback, prevent unqualified products from flowing into subsequent processes, and effectively improve production efficiency and product qualification rate. Attached Figure Description
[0021] Figure 1 This is a diagram of the overall architecture of an SFL-YOLO model based on a lightweight neural network system proposed in this invention (including the StarNet backbone, C3k2-FasterFusion feature fusion module, and LeanHead detection head). Figure 2 This is a diagram of the StarNet backbone network architecture mentioned in this invention; Figure 3 This is a comparative illustration of the convolution types mentioned in this invention (standard convolution, depthwise separable convolution, grouped convolution, partial convolution). Figure 4 This is a schematic diagram of the structure of the Convolutionally Gated Linear Unit (CGLU) mentioned in this invention; Figure 5 This is a schematic diagram of the Convolutional Attention Fusion Module (CAFM) structure mentioned in this invention; Figure 6 This is a schematic diagram of the C3k2-FasterFusion module structure mentioned in this invention; Figure 7 This is a schematic diagram of the LeanHead detection head structure mentioned in this invention; Figure 8 These are example images of the original and supplementary welding defects mentioned in this invention; Figure 9 This is a comparison chart of the heat maps detected by the various models mentioned in this invention. Detailed Implementation
[0022] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0023] Referring to the figures, this embodiment discloses a real-time weld defect detection method and system based on a lightweight neural network, wherein the detection method includes the following steps: S1 Image Acquisition: Acquires images of the weld area to be inspected, uniformly adjusts them to 640×640 pixels, and expands the sample size through data augmentation techniques to improve the model's generalization ability. Specifically, images of the weld area to be inspected are acquired through industrial image acquisition equipment, standardized to uniform image size, and the sample diversity is expanded through data augmentation techniques to provide high-quality input data for model training and inference, improving the model's adaptability to weld images under different working conditions and lighting conditions; S2 Feature Extraction: StarNet is used as a lightweight backbone network to replace the original YOLOv11n backbone. StarNet consists of four stages, with star-shaped operations at its core. It achieves feature mapping and nonlinear transformation through element-wise multiplication without requiring additional trainable parameters. Each stage ends with a depthwise separable convolution, using ReLU6 activation function to balance feature extraction capability and computational efficiency. Specifically, the StarNet lightweight backbone network is used to extract features from the preprocessed weld seam image. This network uses star-shaped operations as its core. After adding a constant to the input feature vector, it performs two independent linear transformations and then multiplies the transformation results element-wise. Without adding additional trainable parameters, it efficiently captures the second-order interactions between features, achieving multi-scale, deep weld seam feature mining. At the same time, it combines depthwise separable convolution, batch normalization, and ReLU6 activation function to significantly reduce computational overhead while maintaining feature extraction capability, adapting to lightweight requirements. S3 Feature Fusion: The C3k2-FasterFusion module is designed, integrating the partial convolution (PConv), convolutional gated linear unit (CGLU), and convolution-attention fusion module (CAFM) of FasterNet. PConv reduces computational complexity, CGLU extracts local attention, and CAFM enhances the response of salient regions, effectively suppressing background noise and optimizing feature fusion results. Specifically, the C3k2-FasterFusion module fuses and optimizes multi-scale features extracted by StarNet. First, partial convolution (PConv) is used to perform convolution operations only on a portion of the input channels, reducing redundant computation and memory usage. Then, a local attention mechanism is constructed through the convolutional gated linear unit (CGLU) to focus on key region features in the weld image. Finally, the convolution-attention fusion module (CAFM) combines the detailed texture features of the local branch with the attention mechanism of the global branch to effectively suppress background noise interference in the weld image, enhance the recognition and discriminativeness of defect features, and output more representative fused features. S4 Object Detection: Employs the LeanHead lightweight detection head, replacing the decoupled detection head structure of YOLOv11n with a shared 3×3 convolutional layer to reduce redundant computation. Two subsequent 1×1 convolutional layers perform bounding box prediction and classification respectively, reducing model complexity while maintaining performance. Specifically, the fused features are input into the LeanHead lightweight detection head, which uses a shared convolutional layer design. A single shared convolutional layer replaces the multiple independent convolutional branches of the traditional decoupled detection head, reducing redundant computation. Then, two independent 1×1 convolutional layers perform regression calculations for defect locations and classification predictions for defect categories, accurately outputting the location bounding box of the weld defect and its corresponding category label.
[0024] S5 Output: Generates defect location bounding boxes and corresponding classification labels, providing an intuitive reference for industrial quality monitoring. Specifically, after lightweight optimization, the entire model can be deployed on edge computing devices such as GPUs / ARMs / ASICs, enabling real-time reception, rapid inference, and result output of weld seam images in industrial production scenarios. This provides immediate feedback for production line quality monitoring, meeting the core requirements of online real-time detection.
[0025] The above detection method is based on the following real-time detection system, which includes: An image acquisition module is used to acquire image data of the weld area to be inspected. Specifically, the image acquisition module includes a data augmentation unit, which is used to expand the training samples through data augmentation techniques and divide the training set, validation set, and test set according to a preset ratio. The feature extraction module employs the StarNet backbone network to extract multi-scale features from the image data. Specifically, the StarNet backbone network abandons standard convolution and uses star-shaped operations to achieve non-linear transformation and dimensionality expansion of features. Mathematically, it captures second-order interactions between features through the outer product operation of double-weighted vectors, combining lightweight design with strong representational capabilities. The overall network structure is compact, with significantly lower parameters and computational cost compared to traditional backbone networks. The feature fusion module employs the C3k2-FasterFusion module to fuse and enhance the multi-scale features. Specifically, the C3k2-FasterFusion module uses PConv to convolve only some input channels, reducing computation by 57% and memory usage by 35%. CGLU uses depthwise convolution to adjust the gating signal and construct a local attention mechanism. CAFM combines local detail features with global attention to effectively suppress noise and improve feature recognition.
[0026] The target detection module uses the LeanHead lightweight detection head to achieve defect location regression and category prediction. Specifically, the LeanHead detection head simplifies the structure through parameter sharing, reduces the number of channels and redundant calculations, and significantly improves the detection speed while maintaining the accuracy of defect location and classification, thus adapting to real-time detection requirements.
[0027] The result output module is used to receive the output information from the target detection module, generate and output the defect location box and classification label.
[0028] Furthermore, it also includes an edge deployment unit, which is adapted to GPU / ARM / ASIC hardware platforms and is used to carry the feature extraction module, feature fusion module and target detection module to realize real-time online detection of weld defects.
[0029] The following are included in the specific experimental process of the above embodiments: 1. Dataset: Various defects may occur during welding operations, including chamfering, holes, burn-through, and edge notches. These defects may stem from factors such as environmental changes, equipment malfunctions, or process instability. Figure 8 As shown, the dataset used in this study was constructed by us, and all images were taken at a size of 640×640 pixels. To help the model learn better and avoid overfitting, we used data augmentation techniques to increase the total number of training images to 4000. The dataset was then divided into training, validation, and test sets in a 7:2:1 ratio.
[0030] 2. Experimental Environment: The experiment used the following hardware configuration: a 13th generation Intel® Core™ i7-13700H processor, 16GB of RAM, and an NVIDIA Ge-Force RTX 4060 laptop graphics card with 8GB of video memory. The software environment included Windows 11, Python 3.10.18, PyTorch 2.5.1 + cu121 framework, and CUDA 12.1 driver. Training parameters were set as follows: batch size 16, initial learning rate 0.01, and a fixed number of training epochs of 300. Four threads were used during training, and the stochastic gradient descent (SGD) optimizer was employed.
[0031] 3. Evaluation Metrics: To comprehensively evaluate the effectiveness of the proposed improvement scheme, we adopted multiple evaluation metrics: precision analysis uses precision (P) and recall (R), object detection performance is evaluated by mean AP (using an intersection-union threshold of 0.5, with mAP@0.5:0.95 to measure the performance at each intersection-union threshold from 0.5 to 0.95 in increments of 0.05), model parameters (Params) are used to evaluate model size and compactness, computational complexity (GFLOPs) quantifies processing requirements, and frame rate (FPS) is used as a real-time performance metric.
[0032] This integrated approach provides a comprehensive evaluation covering detection accuracy (P / R / mAP), model efficiency (Params / GFLOPs), and deployment capability (FPS).
[0033] These metrics are interrelated, especially since there is often a trade-off between inference speed (FPS) and accuracy (mAP). Therefore, model selection should consider both aspects holistically. The evaluation formula is defined as follows:
[0034] 4. Ablation Study: We conducted eight ablation experiments to comprehensively test the SFL-YOLO algorithm. These experiments tested the StarNet backbone network, the C3k2-FasterFusion feature module, and the LeanHead detector head. As shown in Table 1, a "√" is marked if the module is used, and a blank is marked if it is not used.
[0035] The baseline model achieved an mAP@0.5 of 95.74 and an mAP@0.5:0.95 of 62.99, with a frame rate of 195.19 FPS. In Experiment 2, we added the StarNet network. This reduced the computational cost from 6.3 GFLOPs to 5.0 GFLOPs, a decrease of 20.6%. The speed decreased to 176.99 FPS, a reduction of 9.3%, but still significantly higher than the 30 FPS required for real-time detection.
[0036] Experiments 3 and 4 tested the independent performance of LeanHead and C3k2-FasterFusion, respectively. C3k2-FasterFusion maintained good accuracy by reducing complexity, achieving an mAP@0.5 value of 94.73 (a decrease of 1.01) and an mAP@0.5:0.95 value of 58.67 (a decrease of 4.32), running at a frame rate of 186.72 FPS to meet real-time requirements. LeanHead, on the other hand, improved accuracy to mAP@0.5 = 96.33 (+0.59) and mAP@0.5:0.95 = 63.29 (+0.30), running at a frame rate of 170.61 FPS, approximately 5.7 times faster than the baseline, but 12.6% slower.
[0037] Experiments 6 and 7 combined LeanHead with C3k2-FasterFusion. Experiment 7 achieved an mAP@0.5 of 95.12, an mAP@0.5:0.95 of 60.04, and an FPS of 180.49, which is more than six times faster than the actual requirements.
[0038] In Experiment 8, the complete SFL-YOLO model achieved an mAP@0.5 score of 94.96, with an mAP@0.5:0.95 ratio of 61.30, and a frame rate of 100.64 FPS. Although the speed is 48.4% lower than the benchmark, it is still 3.4 times faster than the minimum requirements for real-time applications. The total computational cost was reduced to 3.4 GFLOPs, resulting in a 46% performance improvement. This balance successfully achieves accuracy, efficiency, and ease of use in resource-constrained industrial environments.
[0039] Table 1. SFL-YOLO Ablation Study: Impact of StarNet, C3k2-FasterFusion, and LeanHead on Performance
[0040]
[0041] 5. Comparative Experiments: We conducted comparative tests with mainstream lightweight detection models such as YOLOv8n, YOLOv9t, YOLOv10n, YOLOv11n, and RT-DETR, as well as one method from the literature. Table 2 shows the experimental results. Our SFL-YOLO model achieves a good balance between speed and accuracy.
[0042] Among these models, SFL-YOLO has the fewest parameters (1.48 million) and the lowest computational cost (3.4 GFLOPs). Its FLOPs are 50.0% lower than YOLOv8n, 46.9% lower than YOLOv9t, 47.7% lower than YOLOv10n, 46.0% lower than YOLOv11n, 94.0% lower than RT-DETR, and 34.6% lower than the methods described in the literature.
[0043] It is worth noting that RT-DETR has 19.87 million parameters and 56.9 GFLOPs, making it difficult to use on resource-constrained devices. The literature method has a moderate scale (2.16 million parameters, 5.2 GFLOPs), but lower accuracy (mAP@0.5 = 94.78%), which may not meet the needs of defect detection.
[0044] In contrast, SFL-YOLO maintains high accuracy with minimal computation, proving its suitability for welding defect detection and its applicability in real-world industrial environments.
[0045]
[0046] Table 2. Performance comparison of SFL-YOLO and mainstream detection models on a custom dataset. 6. Visualization of test results: such as Figure 9 The heatmap shows that SFL-YOLO demonstrates a significant improvement in attention concentration compared to YOLOv8, YOLOv9, YOLOv10, YOLOv11, and RT-DETR models. Despite a 46% reduction in computational load (from 3.4 GFLOPs to 6.3 GFLOPs), the model still maintains a real-time performance of 100.64 frames per second—3.3 times faster than the industrial-grade baseline of 30 frames per second. This dual breakthrough of accurate defect localization and substantial optimization of computing power fully validates the successful deployment of our model in industrial scenarios.
[0047] 7. Conclusion: Addressing the challenges of multi-scale variations, complex background interference, and insufficient detection accuracy in welding defect detection, this patent proposes an improved target detection algorithm, SFL-YOLO, based on the YOLOv11n framework. This algorithm primarily comprises three innovative aspects: The lightweight backbone network StarNet is adopted to enhance feature extraction and fusion capabilities; the original C3k2 module is replaced with the C3k2-FasterFusion module to suppress background noise and enhance contextual representation; and a LeanHead detection head is designed to reduce overall computational cost.
[0048] The effectiveness of the architecture was validated through comprehensive ablation experiments and comparative tests conducted on a custom dataset. Ablation studies showed that integrating the three components reduced computational complexity from 6.3 GFLOPs to 3.4 GFLOPs (a reduction of 46.0%). In comparative experiments, SFL-YOLO exhibited the lowest GFLOPs and parameter count (1.48 million) among all tested lightweight models, while maintaining industrial-grade detection accuracy (mAP@0.5 = 94.96%) and meeting real-time performance requirements (frame rate 100.64, 3.3 times higher than the industrial benchmark of 30 frames / second).
[0049] These results validate the proposed model's ability to achieve high-precision real-time welding defect detection under complex multi-scale environments and noise interference. Future work will focus on further improving model efficiency through techniques such as model pruning and knowledge distillation, aiming to expand its applicability in a wider range of industrial applications.
[0050] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the technical scope disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
[0051] Furthermore, it should be understood in the description of this invention that the terms indicating orientation or positional relationship are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this invention and simplifying the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.
[0052] Furthermore, in this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
Claims
1. A method for real-time detection of weld defects based on a lightweight neural network, characterized by, The method comprises the following steps: S1, image acquisition: acquiring an image of a weld area to be detected; S2, feature extraction: extracting multi-scale features of the image by using a lightweight backbone network StarNet, the StarNet comprising four feature extraction stages, and a star operation being used to realize feature mapping and nonlinear transformation; S3, feature fusion: fusing and enhancing the multi-scale features by using a C3k2-FasterFusion module, the C3k2-FasterFusion module integrating a partial convolution, a convolution gate linear unit and a convolution-attention fusion module; S4, target detection: performing defect position regression and category prediction on the fused features by using a LeanHead lightweight detection head, the detection head adopting a shared convolution layer structure; S5, output result: generating a defect position frame and a corresponding classification label.
2. The method according to claim 1, wherein, The star operation of the StarNet is specifically: adding a constant to an input vector, performing two independent linear transformations on the input vector, and multiplying the two transformation results element by element, and the mathematical expression is: ; here and is the input channel index with an additional bias term; is the input dimension. 3.The real-time welding defect detection method based on lightweight neural network according to claim 1, characterized in that, Each feature extraction stage of the StarNet reduces the size of the feature map by using a convolution layer, processes by using a batch normalization, sets a depth separable convolution at the end of the stage, and uses a ReLU6 as an activation function.
4. The method of claim 1, wherein the method is based on a lightweight neural network. The working process of the C3k2-FasterFusion module is: first, performing convolution on part of the input channels by using a PConv to reduce the amount of calculation, then extracting local attention features by using a CGLU, and finally combining the detail features of the local branch and the attention mechanism of the global branch by using a CAFM to output enhanced fused features.
5. The method of claim 1, wherein the method is based on a lightweight neural network. The shared convolution layer of the LeanHead lightweight detection head is a 3x3 convolution layer, and two independent 1x1 convolution layers are connected after the 3x3 convolution layer, which are respectively used for defect frame prediction and category classification.
6. The method of claim 1, wherein the method is based on a lightweight neural network. In the image acquisition step, the size of the acquired image is uniformly adjusted to 640x640 pixels, and the training samples are expanded by using a data enhancement technique, and the expanded training samples are divided into a training set, a validation set and a test set according to a preset ratio.
7. The method of claim 1, wherein the method is based on a lightweight neural network. The total number of the data enhanced training samples is 4000, and the preset ratio is training set: validation set: test set = 7:2:
1.
8. A lightweight neural network-based real-time weld defect detection system, characterized by, The method comprises: an image acquisition module, configured to acquire image data of a weld area to be detected; a feature extraction module, configured to extract multi-scale features of the image data by using the StarNet backbone network in claim 1, 2 or 3; a feature fusion module, configured to fuse and enhance the multi-scale features by using the C3k2-FasterFusion module in claim 1 or 4; a target detection module, configured to realize defect position regression and category prediction by using the LeanHead lightweight detection head in claim 1 or 5; a result output module, configured to receive output information of the target detection module, and generate and output a defect position frame and a classification label.
9. The real-time weld defect detection system based on lightweight neural network according to claim 8, wherein, The edge deployment unit is adapted to a GPU / ARM / ASIC hardware platform and is used to carry the feature extraction module, the feature fusion module and the target detection module, so as to realize real-time online detection of the weld defects.
10. The real-time weld defect detection system based on lightweight neural network according to claim 8, wherein, The image acquisition module comprises a data enhancement unit, which is used to expand training samples through a data enhancement technique and divide a training set, a verification set and a test set according to a preset proportion.