Electromagnetic pulse welding seam surface quality detection method based on convolutional neural network
By using a convolutional neural network model that combines multispectral image acquisition and multi-scale feature fusion with a bidirectional long short-term memory network and an adaptive threshold segmentation algorithm, the efficiency and adaptability issues of electromagnetic pulse welding weld surface quality inspection are solved, achieving efficient and accurate weld quality inspection and production process optimization.
Patent Information
- Application Number
- CN202511609321.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-02-10
AI Technical Summary
Existing electromagnetic pulse welding surface quality inspection methods are insufficient in terms of inspection efficiency, accuracy, adaptability, and time series correlation analysis capabilities, making it difficult to adapt to diverse and dynamic production needs. In particular, when welding material combinations are diverse, traditional methods cannot fully obtain the spectral information of the weld surface, lack multi-scale feature fusion design, and have poor adaptability to fixed standard defect libraries.
Multispectral surface image data acquisition is employed, combined with grayscale normalization and noise suppression processing, to construct a convolutional neural network model with multi-scale feature fusion capabilities. Deep features are extracted through alternating stacked dilated convolutional layers and hollow spatial pyramid pooling layers, and temporal modeling is performed using a bidirectional long short-term memory network. Defect identification and analysis are then performed by combining an adaptive threshold segmentation algorithm and a dynamically updated standard defect library.
It enables efficient and accurate detection of weld surface quality, adapts to different material combinations and production process changes, improves the adaptability and accuracy of detection, outputs detailed weld quality inspection reports, and supports the optimization of production processes and quality control.
Smart Images

Figure CN121504844A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electromagnetic pulse welding inspection technology, specifically to a method for inspecting the surface quality of electromagnetic pulse welds based on convolutional neural networks. Background Technology
[0002] Electromagnetic pulse welding, as a highly efficient solid-state joining technology, is widely used in aerospace, automotive manufacturing, rail transportation, and pressure vessel industries due to its advantages such as the absence of a high-temperature molten pool during welding, a small heat-affected zone at the joint, and excellent mechanical properties. In these applications, the weld seam is a critical component of the connected structure, and its surface quality directly affects the safety, reliability, and service life of the overall component. Therefore, accurate and efficient inspection of weld seam surface quality is an indispensable part of the production process.
[0003] Currently, the surface quality inspection of electromagnetic pulse welding welds mainly relies on traditional inspection methods and conventional machine vision inspection methods. However, these methods have many limitations in practical applications. Traditional inspection methods are mainly based on manual visual inspection, requiring inspectors to rely on experience to judge whether there are defects such as cracks, dents, inclusions, and undercut on the weld surface. This method is not only inefficient and difficult to adapt to the inspection needs of large-scale continuous production, but it is also easily affected by factors such as the inspector's subjective experience, fatigue level, and ambient light, resulting in poor stability of inspection results. It also lacks the ability to identify subtle defects or early potential defects, easily leading to missed detections and false detections, and failing to guarantee the consistency and accuracy of the inspection.
[0004] With the development of machine vision technology, some inspection scenarios have begun to adopt conventional machine vision inspection methods. These methods involve acquiring weld seam images using industrial cameras and then using simple image preprocessing algorithms (such as grayscale conversion and mean filtering) and traditional feature extraction methods (such as edge detection and threshold segmentation) for defect identification. However, these methods have significant shortcomings: most conventional machine vision inspections only use single-spectral image acquisition, which cannot fully capture the spectral information of the weld seam surface. Different types of defects have different reflectance characteristics in different spectral bands, and single-spectral data cannot fully reflect the defect features, resulting in missing feature information and affecting the accuracy of defect identification. Traditional feature extraction methods mostly process single-scale features and cannot effectively capture the features of defects of different sizes and shapes on the weld seam surface. In particular, for defects such as microcracks or shallow surface depressions, their feature signals are weak and easily masked by background noise, making accurate extraction and identification difficult.
[0005] While existing deep learning-based detection methods have improved feature extraction capabilities to some extent, most models lack multi-scale feature fusion design and extract features only through a single convolutional layer or simple convolution stacking. This fails to take into account both the macroscopic structural features and microscopic defect features of the weld surface, resulting in insufficient expression of deep features. At the same time, most existing methods analyze a single image or a single detection sample independently, without considering the evolution of weld defects in continuous production batches. They cannot establish a temporal correlation between defects and the production process, making it difficult to judge the trend and potential causes of defects from a batch perspective, which is not conducive to timely adjustment and optimization of the production process.
[0006] Existing defect identification methods largely rely on fixed standard defect libraries. However, in electromagnetic pulse welding applications, there are diverse combinations of welding materials (such as aluminum alloys with steel, titanium alloys with aluminum alloys, etc.). Different material combinations result in variations in the types, morphologies, and characteristics of weld defects. Fixed standard defect libraries cannot adapt to the detection needs of different material combinations and are difficult to incorporate newly discovered defect types. This leads to poor adaptability and scalability of the detection methods, failing to meet the diverse and dynamic detection requirements of actual production. In summary, current electromagnetic pulse welding weld surface quality detection methods still have significant shortcomings in terms of detection efficiency, accuracy, adaptability, and time-series correlation analysis capabilities, necessitating a novel detection method that can overcome these limitations. Summary of the Invention
[0007] The purpose of this invention is to provide a method for detecting the surface quality of electromagnetic pulse welding seams based on convolutional neural networks, so as to solve the problems mentioned in the background art.
[0008] To achieve the above objectives, the present invention provides a method for detecting the surface quality of electromagnetic pulse welds based on convolutional neural networks, the method comprising: Multispectral surface image data of electromagnetic pulse welded joints were acquired, and grayscale normalization and noise suppression were performed on the images to generate a preprocessed weld image sequence. A convolutional neural network model with multi-scale feature fusion capability is constructed. Its input layer receives the preprocessed weld seam image sequence and extracts deep features of the weld seam region through alternating stacked dilated convolutional layers and hollow spatial pyramid pooling layers. The deep features are input into a bidirectional long short-term memory network for time-series modeling to capture the evolution of weld surface defects in continuous production batches and generate spatiotemporal correlated feature vectors. An adaptive threshold segmentation algorithm is used to divide the spatiotemporal correlation feature vector into regions, marking the boundary coordinates and geometric feature parameters of the suspected defect region; Based on the boundary coordinates, the corresponding regions in the original weld seam image are extracted, and the texture complexity index and spectral reflectance distribution of each region are calculated to generate a defect candidate region feature set. Establish a mapping relationship between the defect candidate region feature set and the standard defect library, and determine the actual defect category of each candidate region through nearest neighbor search matching; The standard defect library is dynamically updated, and newly discovered defect features are classified and stored according to material combination type, and associated with the corresponding process parameter records. Output a weld quality inspection report with defect category labels. The report includes a heat map of defect location distribution and batch pass rate statistics.
[0009] Preferably, the acquisition process of the multispectral surface image data is as follows: A high dynamic range industrial camera is deployed at the exit of the electromagnetic pulse welding equipment to simultaneously trigger dual-channel image acquisition in the visible light and near-infrared bands. Adjust the exposure parameters of the high dynamic range industrial camera so that the proportion of overexposed pixels in the welding spatter area is lower than a set threshold. Pixel-level registration is performed on the acquired dual-channel images to eliminate inter-channel displacement deviations caused by equipment vibration; By fusing the registered dual-channel image data, a multispectral surface image with enhanced edge contrast is generated.
[0010] Preferably, the grayscale normalization and noise suppression process specifically includes: The multispectral surface image is converted to the HSV color space, and the luminance component is extracted as the processing object. A nonlocal mean filtering algorithm is used to eliminate high-frequency electromagnetic interference noise in the image while preserving weld texture details; Histogram equalization is performed on the filtered brightness components to expand the grayscale dynamic range of the weld seam in the dark area and the base material in the bright area. The processed luminance component is recombined with the original chrominance component and converted back to the RGB color space for output.
[0011] Preferably, the training process of the convolutional neural network model with multi-scale feature fusion capability is as follows: Label typical defect samples from historical production data and construct a training dataset containing three defect types: cracks, porosity, and lack of fusion. A channel attention mechanism is introduced after the dilated convolutional layer to dynamically adjust the weight allocation ratio of each feature channel; The parameters of the void space pyramid pooling layer are initialized using transfer learning, and its pre-trained weights are derived from a public dataset of metal surface defects. By optimizing the model parameters through a gradual learning rate decay strategy, the convergence speed of the loss function on the validation set reaches the preset standard.
[0012] Preferably, the process of generating the spatiotemporal correlation feature vector is as follows: The deep features of ten consecutive production batches are arranged in chronological order to form a three-dimensional feature tensor; A time window mechanism is set in the hidden layer of the bidirectional long short-term memory network to statistically analyze the feature change gradient within each time step. The gradient of the feature change is processed by moving average to eliminate noise interference caused by abnormal fluctuations in single batch data; The compressed 3D feature tensor dimension outputs a fixed-length spatiotemporal correlation feature vector.
[0013] Preferably, the execution process of the adaptive threshold segmentation algorithm is as follows: Calculate the local entropy distribution of the spatiotemporal correlation feature vectors to identify highly variable regions in the feature space; Initial clustering seed points are generated based on the geometric center coordinates of the highly variable region. An improved fuzzy C-means algorithm is used to iteratively optimize the cluster boundary until the rate of change of the defect area in adjacent iterations is less than the set tolerance. Extract the vertex coordinates of the minimum bounding rectangle of the final cluster region as the boundary coordinates for output.
[0014] Preferably, the calculation process of the texture complexity index is as follows: Within the rectangular area defined by the boundary coordinates, a Gabor filter bank is applied to extract the texture response amplitude in six directions; Calculate the variance and kurtosis coefficient of the amplitude matrix in each direction, and generate a histogram of directional sensitivity distribution; Perform a Fourier transform on the histogram and take the first five low-frequency components as the basic features of the texture complexity index. The basic features and the area of the rectangular region are logarithmically transformed and then concatenated to form the final texture complexity index vector.
[0015] Preferably, the update process of the standard defect library is as follows: When a defect candidate region that does not match any existing category is detected, a manual review process is initiated to obtain expert annotation results; Extract the multimodal features of the defect region corresponding to the expert annotation results, including the three-dimensional point cloud data of the micro-morphology and the elemental energy spectrum distribution; The multimodal features are combined with the current process parameters to form a new record, which is then indexed by the type of the parent material and stored in the standard defect library. Recalculate the centroid positions of each category of defect features in the library and update the reference vector set for nearest neighbor search.
[0016] Preferably, the association process for recording the process parameters specifically includes: The welding voltage peak value, discharge frequency and electrode pressure time sequence curves are synchronously acquired from the equipment control system. The time-series curve is piecewise linearly approximated to extract key process parameter feature points; Calculate the phase difference between the feature point and the defect generation timestamp to establish a causal relationship chain between process fluctuations and defect formation; The causal relationship chain is stored in the form of a directed graph as an additional retrieval dimension of the standard defect library.
[0017] Preferably, the process of generating the weld quality inspection report is as follows: Aggregate the defect detection results of all welded joints in the current batch, and statistically analyze the occurrence frequency and spatial clustering of various defects; The spatial aggregation degree is mapped to the coordinate system of the equipment workbench to generate a two-dimensional defect density distribution heat map. The system automatically determines the acceptance status of each welded joint based on preset acceptance thresholds and calculates the batch acceptance rate. The heat map and the pass rate statistics are combined and output according to a preset template format.
[0018] Compared with the prior art, the beneficial effects of the present invention are: By acquiring multispectral surface image data of electromagnetic pulse welded joints and combining grayscale normalization and noise suppression processing to generate preprocessed weld image sequences, compared with traditional single-spectral image acquisition methods, multispectral data can capture the differences in reflectance characteristics of the weld surface under different spectral bands, comprehensively obtain spectral information related to defects, while grayscale normalization processing can eliminate the influence of light intensity fluctuations on image grayscale values under different acquisition environments, and noise suppression processing can effectively reduce image noise caused by factors such as electromagnetic interference and equipment vibration in industrial environments. This provides a higher quality and more stable image data foundation for subsequent feature extraction and defect identification, reducing the possibility of missed or misjudged defects due to image quality issues.
[0019] In the feature extraction stage, this method constructs a convolutional neural network model with multi-scale feature fusion capabilities. It extracts deep features of the weld region through alternating stacked dilated convolutional layers and hollow spatial pyramid pooling layers. Specifically, the dilated convolutional layers effectively expand the receptive field of the convolutional kernel without increasing computational cost or the number of parameters, capturing a wider range of macroscopic structural features on the weld surface. The hollow spatial pyramid pooling layers, through parallel processing of convolutional kernels with different porosity, achieve the extraction and fusion of features at different scales. This allows for the accurate capture of small-scale defects such as microcracks and minor depressions, as well as the full acquisition of large-scale features such as the overall weld morphology and large-area abnormal regions. This solves the problem that traditional methods or single convolutional structures struggle to handle multi-scale features, resulting in more comprehensive and accurate deep features that better reflect the true quality of the weld surface.
[0020] Another significant advantage of this method is that it incorporates deep features into a bidirectional long short-term memory (LSTM) network for temporal modeling. LSM networks, with their unique gating mechanism and temporal dependency modeling capabilities, can not only analyze the deep features of the current sample but also correlate feature information from weld samples in consecutive production batches, capturing the evolution of weld surface defects over time.
[0021] An adaptive threshold segmentation algorithm is used to divide spatiotemporally correlated feature vectors into regions. Compared with the traditional fixed threshold segmentation method, this algorithm can automatically adjust the segmentation threshold according to the feature distribution characteristics of different weld seam images and the feature differences of different defect regions. There is no need to manually preset the threshold parameters. This not only improves the adaptability and automation of threshold segmentation, but also more accurately marks the boundary coordinates and geometric feature parameters of suspected defect regions. It avoids the problem of over-segmentation or under-segmentation caused by the inappropriateness of fixed thresholds, and provides accurate location and geometric information support for the accurate extraction and further analysis of subsequent defect candidate regions.
[0022] In the defect candidate region analysis stage, this method extracts corresponding regions from the original weld image, calculates the texture complexity index and spectral reflectance distribution of each region, and generates a defect candidate region feature set. The texture complexity index reflects the differences in texture structure of the weld surface region. Different types of defects (such as linear texture of cracks, irregular texture of inclusions, and smooth texture of depressions) have significantly different texture complexities. The spectral reflectance distribution further utilizes the advantages of multispectral data to distinguish the differences between different defects and normal weld regions from a spectral dimension. The combination of these two methods makes the feature set of defect candidate regions richer in feature dimensions and has higher feature recognition, effectively distinguishing suspected defect regions from normal regions. At the same time, it provides more discriminative feature basis for subsequent defect category judgment, improving the accuracy of defect classification.
[0023] A mapping relationship is established between the feature set of candidate defect regions and the standard defect library. The actual defect category of each candidate region is determined through nearest neighbor search matching. The dynamic update design of the standard defect library can classify and store newly discovered defect features according to material combination type and associate them with corresponding process parameter records. This makes the standard defect library no longer a fixed static library, but one that can be continuously enriched and improved with the accumulation of testing practice, the application of new material combinations, and the adjustment of new process parameters. This effectively improves the adaptability of the testing method to different material combinations and different production processes, and solves the problems of poor adaptability and insufficient scalability of traditional fixed standard defect libraries. This allows the testing method to adapt to dynamically changing production needs in the long term.
[0024] The system outputs weld quality inspection reports with defect category labels, including a heat map of defect location distribution and batch pass rate statistics, providing a clear visual representation of weld quality. The defect location heat map clearly displays the specific location and distribution density of each defect on the weld, allowing staff to quickly identify areas of concentrated defects. The batch pass rate statistics reflect the overall quality level of a particular batch of welds, providing direct evidence for production quality assessment. Furthermore, the detailed information in the report provides specific references for adjusting production processes and optimizing quality control strategies, helping to improve overall production quality and efficiency. Attached Figure Description
[0025] Figure 1 A batch statistical chart of electromagnetic pulse welding weld quality; Figure 2 A flowchart for acquiring multispectral surface image data; Figure 3 A flowchart for training a multi-scale feature fusion convolutional neural network model; Figure 4 An integrated graph for training and generating spatiotemporal features of an electromagnetic pulse welding weld quality inspection model. Detailed Implementation
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] Please see Figure 1This invention provides a method for detecting the surface quality of electromagnetic pulse (EMP) welds based on convolutional neural networks. The method includes: deploying an image acquisition system at the end of an EMP welding production line; this system acquires multispectral surface image data of the EMP weld joint; transmitting the acquired raw image data to a preprocessing module for grayscale normalization and noise suppression to generate a preprocessed weld image sequence; and then feeding this image sequence into a pre-trained convolutional neural network model for processing. This network model has multi-scale feature fusion capabilities, and its input layer receives the preprocessed weld image sequence. The network structure extracts deep features of the weld region through alternating stacked dilated convolutional layers and hollow spatial pyramid pooling layers. The extracted deep features are further input into a bidirectional long short-term memory network for temporal modeling. An adaptive threshold segmentation algorithm is used to analyze and process the spatiotemporally correlated feature vector to divide the weld region and accurately mark the boundary coordinates and geometric feature parameters of suspected defect regions. A mapping relationship is established between the feature set of candidate defect regions and a pre-constructed standard defect library. A nearest neighbor search algorithm is used for feature matching to determine the actual defect category corresponding to each candidate region. The standard defect database has a dynamic update mechanism. When new, unrecorded defect features are discovered, the system categorizes and stores them according to material combination type and associates them with corresponding process parameter records. The system generates and outputs a weld quality inspection report with defect category tags. This report not only includes a heat map of defect location distribution but also provides statistical results of batch pass rates, providing an intuitive basis for production quality assessment.
[0028] Example 1: See Figure 2In the image acquisition stage, a high dynamic range (HDR) industrial camera is deployed at a specific location at the exit of the electromagnetic pulse (EMP) welding equipment. The selected HDR camera must meet the hardware requirements for simultaneous triggering of dual-channel image acquisition in both visible and near-infrared bands. The mounting bracket of the HDR camera is shockproof and has fine-tuning capabilities. The optical axis of the HDR camera lens is perpendicular to the plane of the weld surface, and the field of view of the HDR camera completely covers the surface area of the EMP welded joint. Adjusting the exposure parameters of the HDR camera requires consideration of the ambient lighting conditions. The exposure time and gain settings of the HDR camera are optimized to ensure that the proportion of overexposed pixels in the welding spatter area is below a set threshold. The HDR camera receives a trigger signal after the EMP welding equipment completes one welding cycle and simultaneously acquires visible and near-infrared images. The acquired dual-channel images exhibit inter-channel displacement deviations due to equipment vibration. Pixel-level registration is performed using a feature-point-based registration algorithm to eliminate these displacement deviations. The feature point detection algorithm extracts stable feature points from the visible light and near-infrared images, and the feature point matching algorithm calculates the affine transformation matrix between the two sets of feature points. The affine transformation matrix is applied to resample and transform the coordinates of the near-infrared image, ensuring complete spatial alignment with the visible light image. The registered dual-channel image data is then fused using a weighted average fusion algorithm, which assigns different weight coefficients to the visible light and near-infrared images. This fusion process enhances the contrast of the weld edge region, resulting in a multispectral surface image with richer surface detail information. Specifically, the fusion process is implemented using a weighted average fusion algorithm, assigning different weight coefficients to the visible light and near-infrared images. In the registered dual-channel image, the visible light image highlights the color and macroscopic texture of the weld surface, while the near-infrared image penetrates to a certain depth, capturing subsurface structure information. The algorithm dynamically adjusts the weights based on local region contrast, assigning higher weights to the near-infrared image in edge regions to enhance the response of high-frequency details, thereby improving the contrast of the weld edge. This fusion integrates complementary information from different spectral bands, resulting in multispectral surface images containing richer surface details, such as microcracks and shallow depressions, which are easily overlooked in monospectral images.
[0029] The multispectral surface image enters the preprocessing stage, which includes grayscale normalization and noise suppression. The color space conversion module converts the multispectral surface image from the RGB color space to the HSV color space. The HSV color space decomposes the image into hue, saturation, and lightness components. The lightness component, which carries the overall brightness information of the image, is extracted from the HSV color space for subsequent processing. A nonlocal mean filtering algorithm processes the lightness component, filtering by calculating similarity weights between image patches. This algorithm suppresses high-frequency electromagnetic interference noise while preserving weld texture details, resulting in a higher signal-to-noise ratio for the filtered lightness component. Histogram equalization is applied to the filtered lightness component, redistributing pixel grayscale values to expand the dynamic range. Histogram equalization enhances the grayscale difference between the dark weld area and the bright base material, making the microscopic features of the weld area more prominent. The processed lightness component is recombined with the original hue and saturation components to form a new HSV image. The inverse color space transformation module converts the new HSV image back to the RGB color space. The weld seam image sequence output by the preprocessing pipeline has a consistent grayscale range and clear texture features, providing standardized input data for the convolutional neural network model.
[0030] The parameter configuration of high dynamic range (HDR) industrial cameras requires a strict calibration process, which uses standard grayscale and colorimetric cards for color and brightness correction. The white balance setting of the HDR industrial camera is adjusted according to the color temperature of the ambient light source. The focal length and aperture of the HDR industrial camera ensure that the image depth of field covers the entire undulating area of the weld seam. Synchronization of dual-channel image acquisition is guaranteed by a hardware trigger signal, which maintains a precise time relationship with the discharge timing of the electromagnetic pulse welding equipment. The feature point detection algorithm used in pixel-level registration is robust to changes in illumination, and the feature point matching algorithm uses a random sampling consensus algorithm to eliminate mismatched point pairs. The weighting coefficients in the image fusion process are dynamically adjusted based on the local contrast of the channel images, with high-contrast areas occupying a higher proportion in the fusion result. Grayscale normalization processing ensures the comparability of images acquired under different lighting conditions, and noise suppression processing eliminates random noise patterns introduced by electromagnetic interference. The preprocessed weld seam image sequence meets the model input requirements in terms of color consistency and texture fidelity, and the convolutional neural network model can stably extract features from the preprocessed weld seam image sequence. Multispectral information fusion enhances the ability to identify oxide spots and micro-pits, while near-infrared images reveal structural information at a certain depth below the surface. The entire acquisition and preprocessing process is integrated into an embedded system, which enables real-time processing and caching of image data. The data transmission interface sends the preprocessed weld image sequence to the subsequent computing unit, and a verification mechanism ensures data integrity during data transmission. The sampling frequency of the image acquisition system is matched to the production line cycle time, enabling 100% weld quality inspection without affecting production efficiency. Regular maintenance of the high dynamic range industrial camera includes lens cleaning and optical component calibration. Performance monitoring of the high dynamic range industrial camera is achieved by analyzing the sharpness and noise levels of a standard reference image. The parameters of the preprocessing algorithm are fine-tuned according to the material surface characteristics, and the algorithm's adaptability can handle weld joints with different metal combinations.
[0031] The quality assessment of multispectral surface images is based on image sharpness and information entropy indices. The assessment results are used to feedback control the acquisition parameters of high dynamic range industrial cameras. Image registration accuracy is verified by calculating the mutual information of overlapping regions, and the image fusion effect is evaluated using the edge preservation index. A grayscale normalization algorithm compensates for shadow effects caused by uneven illumination, and a noise suppression filter is designed with a kernel function based on the noise power spectrum. The computational efficiency of the preprocessing process meets the real-time requirements of the production line, and parallelization of the preprocessing process utilizes a graphics processor to accelerate computation. The preprocessed weld seam image sequence is stored in a specific file format along with metadata, which includes the acquisition timestamp and process parameter number. An image caching management mechanism balances storage space and access speed, and an image data compression algorithm reduces storage usage while maintaining feature integrity.
[0032] Example 2: See Figure 3 The training process of the convolutional neural network (CNN) model begins with the construction of the training dataset, which is derived from electromagnetic pulse (EMP) welded joint image data accumulated during historical production processes. Annotators precisely delineate and classify defect areas in the images. The training dataset includes positive samples of three typical defect types—cracks, porosity, and lack of fusion—as well as negative samples without defects. The training dataset samples need to cover different base material combinations, plate thicknesses, and process conditions, with a scale of tens of thousands of images to ensure the model's generalization ability. The CNN model employs an encoder-decoder architecture with multi-scale feature fusion capabilities. The input layer of the CNN model receives a preprocessed weld seam image sequence, with the input images uniformly scaled to a fixed pixel size. Dilated convolutional layers, as the core component for feature extraction, are alternately stacked at the network front end. These layers capture contextual information under different receptive fields by adjusting the dilation rate. Each dilated convolutional layer is followed by a batch normalization layer and a ReLU activation function. The batch normalization layer accelerates model convergence and improves training stability. A channel attention mechanism module is embedded after the dilated convolutional layers, performing global average pooling on the channel dimensions of the feature maps. The channel attention mechanism module inputs the pooling results into the fully connected layer to generate channel weight vectors, which are then normalized to the 0-1 range using the Sigmoid function. This module performs channel-by-channel multiplication on the normalized channel weights and the original feature maps, enabling dynamic weight recalibration of feature channels. The dilated spatial pyramid pooling module is deployed at the end of the encoder, employing four parallel convolutional branches with different dilation rates to extract multi-scale features. The output feature maps from each branch of the dilated spatial pyramid pooling module are upsampled to a uniform size, and multi-scale information is fused through channel concatenation. The initialization parameters of the dilated spatial pyramid pooling module are derived from pre-trained weights on a publicly available dataset of metal surface defects, and the module undergoes transfer learning fine-tuning on the target dataset.
[0033] The model training employs a stochastic gradient descent optimizer with a driving term, and the loss function is a weighted combination of cross-entropy loss and Dice loss. A progressive learning rate decay strategy dynamically adjusts the learning rate during training, setting an initial high value and then gradually decaying it during the validation set loss plateau. An early stopping mechanism is used to prevent overfitting; training automatically terminates when the validation set loss stops decreasing after several consecutive training epochs. The trained convolutional neural network model possesses pixel-level defect segmentation capabilities, outputting a defect probability map of the same size as the input image. After deep feature extraction, the temporal modeling stage begins. A bidirectional long short-term memory (BSSM) network receives deep feature sequences from ten consecutive production batches. These deep feature sequences are arranged in chronological order into a three-dimensional feature tensor, with the three dimensions corresponding to the time step, spatial location, and number of feature channels, respectively. The BSSM network consists of two independent recurrent neural networks, one for forward propagation and one for backward propagation. The hidden state at each time step of the BSSM network contains both historical and future information. The time window mechanism set in the hidden layer extracts feature sequence segments using a sliding window approach, and calculates the time difference value of the feature vectors within the window. The time difference value reflects the gradient magnitude of feature changes between adjacent batches, and is smoothed using an exponentially weighted moving average algorithm.
[0034] The smoothed feature gradients are concatenated with the original features along the channel dimension. The resulting enhanced features are then input into the unit state update gate of the bidirectional long short-term memory (LSTM) network. The unit state update gate calculates forgetting and remembering factors based on the input features and historical states, dynamically controlling the transmission and forgetting of information over time. The LSTM network ultimately outputs a hidden state vector for each time step, which is compressed into a fixed-dimensional spatiotemporal correlated feature vector using global max pooling. This spatiotemporal correlated feature vector integrates the spatial characteristics of defect morphology with the temporal patterns of evolution, providing a highly discriminative feature representation for subsequent defect classification. The entire model training and feature generation process is deployed on a distributed computing cluster, employing a parameter server architecture for parallel data training. Intermediate feature visualization tools monitor the quality of feature learning during training, displaying the model's regions of interest through gradient heatmaps. The similarity metric for the spatiotemporal correlated feature vectors uses cosine similarity to evaluate the correlation between different defect evolution patterns. The joint training of the convolutional neural network model and the bidirectional long short-term memory network adopts an end-to-end optimization strategy, which enables the parameter adjustment of the feature extraction and temporal modeling modules to work together. During the model inference stage, multi-scale testing enhancement techniques are used to improve detection robustness. The input image is scaled and flipped during the inference stage, and the prediction results are then fused.
[0035] Augmentation strategies for the training dataset include geometric transformations and color perturbations. These strategies expand sample diversity through random rotation, cropping, and brightness adjustments. The depth and width of the convolutional neural network (CNN) model are balanced based on computational resources and real-time requirements, and their design must meet the throughput metrics of production line inspection. The number of layers and hidden units in the bidirectional long short-term memory (BSSM) network is set according to the defect evolution cycle, affecting the ability to model long-term dependencies. During model deployment, computational graph optimization and operator fusion techniques are employed to improve inference speed. Computational acceleration is achieved through inference frameworks such as TensorRT. Specifically, computational graph optimization techniques are used during model deployment. By analyzing the computational graph structure of the CNN model, redundant nodes are eliminated and computational paths are reconstructed to reduce the computational load during inference. Operator fusion techniques are used to merge adjacent neural network layers. Simultaneously, the TensorRT inference framework is used to optimize the model's kernel and calibrate its accuracy, automatically selecting efficient computational kernels and utilizing hardware acceleration capabilities to improve inference speed while ensuring detection accuracy. Hyperparameter tuning during training employs an automatic Bayesian optimization method, seeking the optimal model configuration within a given resource budget. The parameters of the convolutional neural network model and the bidirectional long short-term memory network are periodically updated online, continuously optimizing model performance using newly collected labeled data. A hierarchical index structure is used to store spatiotemporal correlation feature vectors, supporting rapid retrieval and similar case matching. The entire system establishes a complete model version management and rollback mechanism, ensuring the reliability and traceability of detection algorithm updates. Training dataset quality monitoring uses cross-validation accuracy fluctuations for early warning, promptly identifying labeling errors or data distribution shifts. Interpretability analysis of spatiotemporal correlation feature vectors is achieved through gradient-based activation mapping, aiding in understanding the model's decision-making process.
[0036] See Figure 4In the training process of the electromagnetic pulse welding weld surface quality detection model, the integration of multi-scale feature fusion and temporal modeling relies on the collaborative optimization of convolutional neural networks and bidirectional long short-term memory networks. Specifically, the preprocessed weld image sequence is input into a convolutional neural network with an encoder-decoder architecture. Multi-scale features are extracted through alternating stacked dilated convolutional layers with various hole rates. Each convolutional layer is followed by batch normalization and ReLU activation function to improve training stability. The channel attention mechanism performs global average pooling on the feature map, generates channel weight vectors, and normalizes them using the Sigmoid function to achieve dynamic recalibration of feature channels. The hole spatial pyramid pooling module uses four parallel convolutional branches to fuse multi-scale information, and its parameters are initialized through transfer learning using pre-trained weights from a public dataset of metal surface defects. The deep feature sequence is arranged in temporal order as a three-dimensional tensor and input into the bidirectional long short-term memory network for temporal modeling. The time window mechanism calculates the feature change gradient using a sliding window and smooths it using an exponentially weighted moving average algorithm. The hidden state vector is compressed into a fixed-dimensional spatiotemporal correlation feature vector through global max pooling, integrating spatial features and temporal evolution patterns. In the parameter configuration, the expansion rate of the convolutional neural network is set to an increasing sequence according to the receptive field requirements, the number of hidden units of the bidirectional long short-term memory network is set to 50-100 units according to the defect evolution cycle, and the learning rate is set to an initial value of 0.01 and decays stepwise based on the validation set loss.
[0037] Example 3: The adaptive threshold segmentation algorithm processes the spatiotemporal correlation feature vector generated by a bidirectional long short-term memory network. This feature vector contains comprehensive feature information of weld surface defects in the spatiotemporal dimension. The local entropy distribution of the spatiotemporal correlation feature vector is calculated using a sliding window method, where the sliding window traverses the feature space with a step size of one unit. The entropy value within each window is calculated based on the Shannon entropy formula:
[0038] Where: H represents the entropy of the feature values within the window, and n represents the number of quantization levels of the feature values within the window. It represents the probability of an eigenvalue appearing at the i-th quantization level, with the logarithmic base b set to 2 so that the entropy unit is bits. High-entropy regions correspond to high-variability regions in the feature space, indicating a higher probability of defect existence. The geometric center coordinates of the identified high-variability regions are determined through connected component analysis, and these coordinates serve as the initial clustering seed points for the improved fuzzy C-means algorithm.
[0039] The improved fuzzy C-means algorithm introduces a spatial regularization term into the traditional objective function, simultaneously considering feature similarity and spatial proximity. The clustering process iteratively updates the membership matrix and cluster centers. The membership matrix describes the degree of membership of each feature point to each cluster. The defect region area in the k-th iteration is calculated based on the membership matrix and feature point coordinates, defined as the area of the minimum convex hull formed by feature points with membership greater than a threshold. The rate of change of defect region area between adjacent iterations is calculated as the ratio of the difference between the two areas to the previous area. Iteration terminates when the rate of change is less than a set tolerance (e.g., 0.01). The final clustered region contour is extracted using the α-shape algorithm, and the vertex coordinates of the minimum bounding rectangle of the contour are output as boundary coordinates. These boundary coordinates are used to extract rectangular regions from the original weld image, containing complete suspected defect appearances. Texture complexity calculation begins with the application of Gabor filter banks, which contain even-component filters in six directions (0°, 30°, 60°, 90°, 120°, 150°). Each directional filter is convolved with a rectangular region of the image, and the absolute value of the convolution result yields the texture response amplitude. The variance and kurtosis coefficients of the texture response amplitude matrices in each of the six directions are calculated. Variance measures the dispersion of the amplitude distribution, while kurtosis coefficients reflect the sharpness of the distribution pattern. The variance and kurtosis coefficients in the six directions form a twelve-dimensional eigenvector, which constitutes the basic data for the histogram of directional sensitivity distribution.
[0040] The histogram of orientation sensitivity distribution is subjected to Discrete Fourier Transform (DFT), which transforms spatial domain features to the frequency domain. The magnitudes of the top five low-frequency components in the DFT result are taken as basic features, corresponding to the macroscopic periodic structure information of the texture. The basic features and the area of the rectangular region are subjected to a natural logarithmic transformation, which compresses the dynamic range of the data and reduces the influence of dimensions. The magnitudes of the five transformed low-frequency components and the logarithm of the region area are concatenated to form a six-dimensional texture complexity index vector. The texture complexity index vector and the spectral reflectance distribution together constitute the defect candidate region feature set. The spatial regularization term weight coefficient of the improved fuzzy C-means algorithm is determined through cross-validation, and the spatial regularization term weight coefficient controls the balance between feature similarity and spatial continuity. The number of clusters, C, is adaptively determined according to the density distribution of high-variability regions, ensuring that the defect features contained in each cluster have internal consistency. The vertex coordinates of the minimum bounding rectangle of the contour are arranged in a clockwise direction, and the vertex coordinates of the minimum bounding rectangle of the contour establish a pixel correspondence with the original image. The center frequency and bandwidth of the Gabor filter are set according to the typical scale of the weld texture, covering texture features from coarse to fine. The statistical calculation of the texture response amplitude matrix excludes boundary effects in image edge regions, using only pixel values from the effective convolution region. The Fourier transform of the orientation sensitivity distribution histogram is implemented using the Fast Fourier Transform algorithm, ensuring computational efficiency meets real-time requirements. Each dimension of the texture complexity index vector undergoes z-score normalization, resulting in zero mean and unit variance for features in different dimensions. The defect candidate region feature set is stored using a hierarchical index structure, supporting efficient feature matching and retrieval operations.
[0041] The parameter sensitivity analysis of the adaptive threshold segmentation algorithm was conducted using the controlled variable method, which determined the influence of the local entropy calculation window size on the segmentation results. The correlation between texture complexity index and defect type was verified through canonical correlation analysis, providing a basis for feature selection. The entire segmentation and feature calculation process was implemented in parallel on a graphics processing unit (GPU), leveraging parallel computing capabilities to improve processing speed. The accuracy of boundary coordinates was evaluated by comparing the intersection-union ratio (IU) with manually labeled results, ensuring accurate defect localization. The consistency of texture feature calculation was verified through feature stability testing of the same defect under different lighting conditions, guaranteeing the robustness of the detection system. The adaptive threshold segmentation algorithm and texture complexity index calculation form the basis for quantitative defect description, transforming qualitative judgments into quantifiable feature data. The structured representation of the defect candidate region feature set facilitates similarity matching with a standard defect database, supporting the defect classification decision-making process.
[0042] Example 4: The dynamic update mechanism of the standard defect library is activated when the detection system identifies an unknown defect pattern. This mechanism relies on a manual review process to confirm the category attributes of new defects. A specific application scenario involves the electromagnetic pulse welding process of aluminum alloy and galvanized steel. The detection system found an unmatched defect candidate region in production batch EPW-2023-08-015. The cosine similarity between the feature vector of the defect candidate region and the feature vectors of all existing categories in the standard defect library is lower than the preset matching threshold of 0.85. The system automatically generates a manual review request and sends the multispectral image and feature data of the defect candidate region to the quality assessment terminal. The quality engineer observes the microstructure of the defect region through the terminal interface. Referring to industry standard JB / T4730.1, the quality engineer confirms that the defect is a novel type of interface ripple defect. The quality engineer marks the defect category as "interface ripple" on the review interface and adds a description of the defect's macroscopic characteristics as a periodic banded distribution.
[0043] Expert annotation results trigger a multimodal feature extraction process, which uses a scanning electron microscope to acquire 3D point cloud data of the defect area's microstructure. The acquisition of the 3D point cloud data employs focal stacking technology, which synthesizes a complete 3D morphology from images of different focal planes. An energy dispersive spectroscopy (EDS) analyzer simultaneously acquires the elemental energy spectrum distribution of the defect area, detecting an abnormal enrichment of zinc at the interface. The multimodal features, along with texture complexity indicators and spectral reflectance distribution extracted from the images, constitute the feature set of the newly added record. This new record is also associated with process parameters such as welding voltage peak, discharge frequency, and electrode pressure. Table 1 illustrates the storage structure of the new record in the standard defect library.
[0044] Table 1: New Records Added to the Standard Defect Library
[0045] The standard defect library establishes a hierarchical index structure based on material combination types, which are coded according to the chemical composition and thickness specifications of the base material. New records are stored under the "Aluminum Alloy-Galvanized Steel" material combination branch and are simultaneously added to the standard defect library's quick search view. The standard defect library management module recalculates the feature centroid positions of all defect categories in the library, iteratively updating these positions based on Euclidean distance. The nearest neighbor search reference vector set is updated synchronously, containing the feature centroid coordinates of all confirmed defect categories. The standard defect library's version control system records this update operation, saving the changes in feature centroid coordinates before and after the update. The correlation process for recording process parameters begins with the real-time database of the equipment control system, which records welding voltage peak, discharge frequency, and electrode pressure time-series data at a 100Hz sampling frequency. This time-series data is transmitted to the quality inspection system via a data interface, precisely synchronized with the image acquisition timestamp. A piecewise linear approximation algorithm compresses the original time-series curves, reducing the data volume by 70% while preserving key waveform features. Key process parameter characteristic points include the inflection point of voltage rise edge, the extreme point of discharge frequency, and the stable plateau value of electrode pressure. The phase difference between the time coordinates of key process parameter characteristic points and the defect generation timestamp is calculated.
[0046] Phase difference calculation employs cross-correlation analysis to determine the time lag between process parameter fluctuations and defect formation. A fixed phase difference of 15 milliseconds exists between the timestamp of interface ripple defect generation and the leading fluctuation of welding voltage peak. This phase difference establishes a causal chain between process fluctuations and defect formation. This causal chain is stored in a directed graph database. Nodes in the directed graph represent process parameter events or defect events, and edges represent the causal relationships and time lags between events. The graph database supports reverse retrieval queries based on process parameters, allowing for the reverse lookup of potential defect types using process parameter fluctuation characteristics. The completeness of the standard defect database is ensured through a cross-validation mechanism, which compares the distribution consistency of new defect features with historical data. When the minimum distance between the feature vector of a newly added record and the centroid of an existing category is less than the inter-category distance threshold, the standard defect database initiates a category merging evaluation process. This process calculates the Mahalanobis distance between the two defect features and determines whether they should be merged into the same category based on hypothesis testing. The standard defect database utilizes a columnar database to optimize query performance, with specialized optimizations for feature vector range queries and nearest neighbor searches. The standard defect database access interface provides standardized feature comparison services and supports concurrent access from multiple clients and transaction management. The accuracy of process parameter record correlation depends on the accuracy of the time synchronization mechanism, which employs the IEEE 1588 precision clock synchronization protocol. The time deviation between the equipment control system and the quality inspection system is controlled within 1 millisecond, ensuring the reliability of causal relationship analysis. Causal relationship chains in the directed graph database support probability weight assignment; the weights of these chains represent the statistical frequency of the causal relationship. The standard defect database backup strategy combines incremental and full backups, guaranteeing data security and system recoverability. The standard defect database access log records all query and update operations and is used for audit trails and anomaly detection.
[0047] The storage of multimodal features employs a hybrid architecture of distributed file system and database, with large-capacity multimodal feature files stored in the distributed file system. Metadata of feature vectors and their association with process parameters are stored in a relational database, establishing a fast index relationship between the metadata and process parameter associations. The update frequency of the standard defect library is automatically adjusted according to the production cycle, with an appropriate increase during the application of new materials or processes. Storage capacity monitoring of the standard defect library sets early warning thresholds, triggering data archiving and cleanup processes upon triggering early warnings. The entire standard defect library management system constitutes a self-learning knowledge base, continuously enriching its defect knowledge as production progresses. The dynamic update mechanism of the standard defect library enables the detection system to adapt to new defect patterns, reducing reliance on the completeness of initial training data. Deep correlation of process parameter records enables defect root cause analysis, providing data support for process optimization. Version management of the standard defect library ensures the traceability of detection results and meets the requirements of the quality management system. The integrated storage of multimodal features provides multiple perspectives for defect analysis, and supports cross-modal joint retrieval and analysis.
[0048] Example 5: The generation process of the weld quality inspection report begins with the aggregated analysis of the inspection results of all welded joints in the current batch. The inspection results of the current batch include the defect category, location coordinates, and geometric parameters of each joint. The report generation system reads the inspection data of batch EPW-2024-Q2-038 and statistically analyzes the occurrence frequency of three types of defects: cracks, porosity, and lack of fusion. The calculation of defect occurrence frequency is based on a weighted average of the number of defects in each joint, and the defect occurrence frequency reflects the overall trend of batch quality. The statistical results show that the occurrence frequency of crack defects in batch EPW-2024-Q2-038 is 3.2%, the occurrence frequency of porosity defects is 1.7%, and no lack of fusion defects were detected. Spatial aggregation mapping transforms the two-dimensional coordinates of the weld surface to the equipment workbench coordinate system. The equipment workbench coordinate system establishes a millimeter-level precision planar reference system based on the equipment origin. The defect point coordinates are mapped to the workbench coordinate system through an affine transformation matrix, preserving the original detection positional accuracy. A kernel density estimation algorithm generates a two-dimensional defect density distribution heatmap. The algorithm uses a Gaussian kernel function to estimate the density of defect points. The heatmap uses a gradient from blue to red, with blue areas representing low defect density and red areas representing high defect density. The heatmap for batch EPW-2024-Q2-038 shows a distinct red area between 350mm and 450mm on the X-axis, corresponding to stress concentration areas at the equipment fixture locations.
[0049] The acceptance threshold is dynamically determined based on product acceptance specifications, with differentiated tolerance standards for different defect categories. The threshold for crack defects is a maximum length not exceeding 0.5 mm and a depth not exceeding 10% of the plate thickness. The threshold for porosity defects is a single pore diameter not exceeding 1.0 mm and a number of pores per unit area not exceeding three. The report generation system automatically compares the defect size of each joint with the acceptance threshold, marking defects exceeding the threshold as critical defects. The batch pass rate is calculated as the ratio of the number of qualified joints to the total number of inspected joints. For batch EPW-2024-Q2-038, the statistics show that 192 out of 200 inspected joints meet the acceptance criteria. The defect location heatmap uses vector graphics to ensure scaling accuracy, and the overlay of the equipment workbench grid coordinates facilitates precise positioning. The legend of the heatmap clearly indicates the correspondence between color and defect density, with ten gradient levels for density. The batch pass rate statistics are displayed in a pie chart, showing the pass rate distribution. The statistics also list the specific impact weights of various defects. The header area of the report template records the batch number and inspection timestamp, while the body text area arranges different analysis results according to preset sections. The report output format supports both PDF and Excel options to meet the viewing needs of different users.
[0050] The data verification mechanism of the inspection report ensures statistical accuracy through dual verification, comparing the consistency between the original inspection data and the statistical results in the report. The kernel function bandwidth parameter in the heatmap generation process is optimized through cross-validation, affecting the smoothness and detail retention of density estimation. The dynamic adjustment function of the pass / fail threshold adapts to different product grade requirements; this adjustment is achieved through parameter configuration via the management interface. The report template style specifications follow the enterprise visual identity system standards, including font size, color scheme, and layout grid. The report distribution system pushes reports to the quality management department via message middleware and simultaneously archives them to a historical database for long-term storage. The interactive viewing function of the defect density distribution heatmap supports online analysis, allowing users to hover and view the defect density value at specific coordinates. The historical trend chart of batch pass rate statistics displays data from the past twelve months, helping to analyze quality fluctuation patterns. Access permissions for the report generation system are controlled hierarchically based on roles, distinguishing between viewing and export permissions. The report signing mechanism uses digital certificates to ensure report integrity and prevents report content tampering. The multilingual report output function meets the needs of multinational production bases and supports switching between Chinese and English versions.
[0051] The generation frequency of weld quality inspection reports is synchronized with production batches, automatically triggered after each batch completes inspection. An anomaly detection mechanism for the report data source monitors data flow integrity and issues warnings when data is missing. The heatmap color scheme is designed with colorblind users in mind, using color combinations that support colorblindness detection. A report caching mechanism improves response speed during high-frequency access, optimizing the indexing of historical reports. The performance monitoring system of the report generation system records generation time, ensuring system response time complies with the service level agreement. The standardized format of weld quality inspection reports facilitates cross-departmental flow of quality data and reduces information interpretation bias. The coordinate system of the defect location distribution heatmap is the same as that of the production equipment, facilitating rapid location of problematic equipment modules. An automated early warning function for batch pass rate statistics sets threshold alerts, triggering alarms when the pass rate falls below the target value. The report template's configurable fields adapt to process change requirements, allowing for flexible adjustments to the report's content structure. The entire report generation system is deeply integrated with the Manufacturing Execution System (MES), automating the entire process of quality data collection and analysis.
[0052] Digital watermarking technology in weld quality inspection reports protects the report's intellectual property rights, embedding invisible identification information. Report access logs record each user's access time and operations, meeting the traceability requirements of the quality management system. Mobile report viewing functionality is adapted through responsive design, ensuring display quality across different devices. Queue management processes and generates report generation requests for tasks, scheduling computing resources according to a first-in, first-out (FIFO) principle. The fault tolerance mechanism of the report generation system automatically switches in case of single-node failure, ensuring service continuity through a load-balanced cluster. The weld quality inspection report generation process constitutes the final link in the quality closed-loop management, transforming inspection data into decision support information. The combination of defect distribution heatmaps and pass rate statistics provides a macro-level quality perspective, guiding the optimization of the production process. Standardized report formats promote long-term comparability analysis of quality data, establishing a unified quality evaluation benchmark. Automated report generation reduces errors from manual statistics and improves the efficiency of the quality management department. The entire reporting system is designed with data security and access control in mind, and complies with industrial data protection standards.
[0053] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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.
[0054] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for detecting the surface quality of electromagnetic pulse welds based on convolutional neural networks, characterized in that, Includes the following steps: Multispectral surface image data of electromagnetic pulse welded joints were acquired, and grayscale normalization and noise suppression were performed on the images to generate a preprocessed weld image sequence. A convolutional neural network model with multi-scale feature fusion capability is constructed. Its input layer receives the preprocessed weld seam image sequence and extracts deep features of the weld seam region through alternating stacked dilated convolutional layers and hollow spatial pyramid pooling layers. The deep features are input into a bidirectional long short-term memory network for time-series modeling to capture the evolution of weld surface defects in continuous production batches and generate spatiotemporal correlated feature vectors. An adaptive threshold segmentation algorithm is used to divide the spatiotemporal correlation feature vector into regions, marking the boundary coordinates and geometric feature parameters of the suspected defect region; Based on the boundary coordinates, the corresponding regions in the original weld seam image are extracted, and the texture complexity index and spectral reflectance distribution of each region are calculated to generate a defect candidate region feature set. Establish a mapping relationship between the defect candidate region feature set and the standard defect library, and determine the actual defect category of each candidate region through nearest neighbor search matching; The standard defect library is dynamically updated, and newly discovered defect features are classified and stored according to material combination type, and associated with the corresponding process parameter records. Output a weld quality inspection report with defect category labels. The report includes a heat map of defect location distribution and batch pass rate statistics.
2. The method for detecting the surface quality of electromagnetic pulse welds according to claim 1, characterized in that, The acquisition process of the multispectral surface image data is as follows: A high dynamic range industrial camera is deployed at the exit of the electromagnetic pulse welding equipment to simultaneously trigger dual-channel image acquisition in the visible light and near-infrared bands. Adjust the exposure parameters of the high dynamic range industrial camera so that the proportion of overexposed pixels in the welding spatter area is lower than a set threshold. Pixel-level registration is performed on the acquired dual-channel images to eliminate inter-channel displacement deviations caused by equipment vibration; By fusing the registered dual-channel image data, a multispectral surface image with enhanced edge contrast is generated.
3. The method for detecting the surface quality of electromagnetic pulse welds according to claim 2, characterized in that, The grayscale normalization and noise suppression process is specifically as follows: The multispectral surface image is converted to the HSV color space, and the luminance component is extracted as the processing object. A nonlocal mean filtering algorithm is used to eliminate high-frequency electromagnetic interference noise in the image while preserving weld texture details; Histogram equalization is performed on the filtered brightness components to expand the grayscale dynamic range of the weld seam in the dark area and the base material in the bright area. The processed luminance component is recombined with the original chrominance component and converted back to the RGB color space for output.
4. The method for detecting the surface quality of electromagnetic pulse welds according to claim 1, characterized in that, The training process of the convolutional neural network model with multi-scale feature fusion capability is as follows: Label typical defect samples from historical production data and construct a training dataset containing three defect types: cracks, porosity, and lack of fusion. A channel attention mechanism is introduced after the dilated convolutional layer to dynamically adjust the weight allocation ratio of each feature channel; The parameters of the void space pyramid pooling layer are initialized using transfer learning, and its pre-trained weights are derived from a public dataset of metal surface defects. By optimizing the model parameters through a gradual learning rate decay strategy, the convergence speed of the loss function on the validation set reaches the preset standard.
5. The method for detecting the surface quality of electromagnetic pulse welds according to claim 4, characterized in that, The specific process for generating the spatiotemporal correlation feature vector is as follows: The deep features of ten consecutive production batches are arranged in chronological order to form a three-dimensional feature tensor; A time window mechanism is set in the hidden layer of the bidirectional long short-term memory network to statistically analyze the feature change gradient within each time step. The feature change gradient is processed by moving average to eliminate noise interference caused by abnormal fluctuations in single batch data; The compressed 3D feature tensor dimension outputs a fixed-length spatiotemporal correlation feature vector.
6. The method for detecting the surface quality of electromagnetic pulse welds according to claim 1, characterized in that, The execution process of the adaptive threshold segmentation algorithm is as follows: Calculate the local entropy distribution of the spatiotemporal correlation feature vectors to identify highly variable regions in the feature space; Initial clustering seed points are generated based on the geometric center coordinates of the highly variable region. An improved fuzzy C-means algorithm is used to iteratively optimize the cluster boundary until the rate of change of the defect area in adjacent iterations is less than the set tolerance. Extract the vertex coordinates of the minimum bounding rectangle of the final cluster region as the boundary coordinates for output.
7. The method for detecting the surface quality of electromagnetic pulse welds according to claim 6, characterized in that, The calculation process for the texture complexity index is as follows: Within the rectangular area defined by the boundary coordinates, a Gabor filter bank is applied to extract the texture response amplitude in six directions; Calculate the variance and kurtosis coefficient of the amplitude matrix in each direction, and generate a histogram of directional sensitivity distribution; Perform a Fourier transform on the histogram and take the first five low-frequency components as the basic features of the texture complexity index. The basic features and the area of the rectangular region are logarithmically transformed and then concatenated to form the final texture complexity index vector.
8. The method for detecting the surface quality of electromagnetic pulse welds according to claim 1, characterized in that, The update process of the standard defect library is as follows: When a defect candidate region that does not match any existing category is detected, a manual review process is initiated to obtain expert annotation results; Extract the multimodal features of the defect region corresponding to the expert annotation results, including the three-dimensional point cloud data of the micro-morphology and the elemental energy spectrum distribution; The multimodal features are combined with the current process parameters to form a new record, which is then indexed and stored in the standard defect library according to the type of the parent material. Recalculate the centroid positions of each category of defect features in the library and update the reference vector set for nearest neighbor search.
9. The method for detecting the surface quality of electromagnetic pulse welds according to claim 8, characterized in that, The association process of the recorded process parameters is as follows: The welding voltage peak value, discharge frequency and electrode pressure time sequence curves are synchronously acquired from the equipment control system. The time-series curve is piecewise linearly approximated to extract key process parameter feature points; Calculate the phase difference between the feature point and the defect generation timestamp to establish a causal relationship chain between process fluctuations and defect formation; The causal relationship chain is stored in the form of a directed graph as an additional retrieval dimension of the standard defect library.
10. The method for detecting the surface quality of electromagnetic pulse welds according to claim 1, characterized in that, The specific process for generating the weld quality inspection report is as follows: Aggregate the defect detection results of all welded joints in the current batch, and statistically analyze the occurrence frequency and spatial clustering of various defects; The spatial aggregation degree is mapped to the coordinate system of the equipment workbench to generate a two-dimensional defect density distribution heat map. The system automatically determines the acceptance status of each welded joint based on preset acceptance thresholds and calculates the batch acceptance rate. The heat map and the pass rate statistics are combined and output according to a preset template format.
Citation Information
Cited By
Heat treatment cross shaft sleeve quality inspection method based on deep learning
CN121937464A