A welding seam defect optical detection method and system based on multi-scale feature fusion

The optical detection method for weld defects by multi-scale feature fusion solves the problem of difficulty in removing optical scattering interference from the weld surface in existing technologies, and realizes accurate detection and analysis of weld defects.

CN121955029BActive Publication Date: 2026-06-26HEBEI UNIV OF ENG
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HEBEI UNIV OF ENG
Filing Date
2026-03-27
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing optical inspection methods struggle to effectively remove optical scattering interference from the surface of weld materials without damaging metal structures, thus limiting the accuracy of analyzing the state of deep physical defects in metals.

Method used

An optical detection method for weld defects using multi-scale feature fusion is adopted. By controlling the optical emission module to emit an initial probe beam, the initial optical response signal is obtained, multi-scale feature extraction and roughness interference analysis are performed, and a dynamic optical modulation strategy is adaptively generated to remove surface scattering interference, thereby achieving accurate detection of weld defects.

Benefits of technology

It enables accurate testing and analysis of defects in metal weld materials in environments with surface morphology interference, and reduces the superposition of characteristics between macroscopic surface contours and microscopic internal defects in optical and physical responses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121955029B_ABST
    Figure CN121955029B_ABST
Patent Text Reader

Abstract

The application provides a kind of welding defect optical detection method and system based on multi-scale feature fusion, it is related to material detection technical field, wherein the method comprises: controlling optical emission module to emit initial probe light beam to the surface of the welding material to be detected, obtains initial optical response signal;The response signal is extracted to multi-scale feature, determine the degree of physical scattering interference of material surface;Adaptive generation based on the interference degree contains a plurality of modulation state parameters Dynamic optical modulation strategy;According to the strategy, the modulation light beam sequence is sequentially emitted to the surface of the material to be tested, and a plurality of target optical response signals reflecting specific optical physical properties are synchronously acquired;The target optical response signal is respectively extracted to multi-scale feature and multi-dimensional feature fusion operation, and the defect analysis conclusion of the material to be tested is output according to the fusion feature distribution matrix.The application determines the optical physical properties of the material, and strips the optical scattering interference energy caused by the surface macroscopic fluctuation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of materials testing technology, and in particular to an optical inspection method and system for weld defects based on multi-scale feature fusion. Background Technology

[0002] Currently, assessing the internal and surface physical states of structural components by measuring their optical physical properties is a common method for analyzing material quality in industrial manufacturing. In automated welding and forming operations, due to a combination of factors such as localized heat input gradient changes and physical phase transitions during the cooling and crystallization of the molten metal pool, microscopic cracks and porosity sometimes occur at the joints of metal structural components. To determine the material continuity and specific physical state in these areas, non-destructive analysis methods such as optical testing are typically introduced. Conventional material testing methods mainly involve emitting a probe beam of fixed wavelength and specific polarization state onto the surface of the material under test and receiving the corresponding reflected photon energy distribution. This allows for the measurement of the physical characteristics of the local optical field to collect test data and identify the underlying state.

[0003] Due to the periodic movement of heat sources and the dynamic characteristics of fluids during automated metal welding, the surface of actual weld materials often exhibits a macroscopic fish-scale texture with spatial periodic undulations. Simultaneously, the heat-affected zone (HAZ) shows microscopic roughness differences due to varying degrees of high-temperature oxidation. When these complex physical morphologies receive a probe beam with fixed parameters, they easily excite spatial optical diffuse reflection and polarization degradation, thus creating optical scattering interference energy covering the detection area on the material surface. Since the optical diffraction characteristics generated by deep grain boundary cracks or pore edges in the weld material can overlap with the physical scattering characteristics caused by the aforementioned surface morphology, when using optical response signals with specific parameters to assess the physical state of deep, hidden material defects, the acquired underlying optical signals often contain a significant amount of surface physical morphology scattering interference information.

[0004] Existing material characteristic data acquisition and processing mechanisms often struggle to effectively isolate light and shadow fluctuations caused by macroscopic undulations on the material surface from the source light field when faced with complex, superimposed optical response data. Surface roughness-induced physical scattering masks the minute optical reflection characteristics of deep, hidden defects within the material. Current testing methods cannot effectively remove light and shadow scattering interference from the material surface without damaging the metal structure, thus limiting the accuracy of quantitative analysis of deep physical defect states in metals. Summary of the Invention

[0005] The purpose of this invention is to provide an optical inspection method and system for weld defects based on multi-scale feature fusion, so as to solve the problems pointed out in the background art.

[0006] In a first aspect, the present invention provides an optical detection method for weld defects based on multi-scale feature fusion, applied to a weld defect detection system, the detection method comprising:

[0007] The optical emission module is controlled to emit an initial detection beam toward the surface of the weld to be inspected, and the optical acquisition module is controlled to acquire the initial optical response signal corresponding to the surface of the weld to be inspected.

[0008] Multi-scale feature extraction is performed on the initial optical response signal to obtain initial multi-scale feature matrices corresponding to multiple different spatial resolution levels;

[0009] The detection method further includes:

[0010] Roughness interference feature analysis is performed on the initial multi-scale feature matrix to determine the degree of surface scattering interference on the surface of the weld to be inspected.

[0011] Based on the surface scattering interference level, an adaptive dynamic optical modulation strategy containing multiple modulation state parameters is generated.

[0012] According to the dynamic optical modulation strategy, the optical emission module is controlled to sequentially emit multiple modulation beam sequences corresponding to the multiple modulation state parameters to the surface of the weld to be inspected, and the optical acquisition module is controlled to synchronously acquire multiple target optical response signals corresponding to the multiple modulation beam sequences.

[0013] Multi-scale feature extraction is performed on the optical response signals of the multiple targets to obtain the target multi-scale feature matrix sequence corresponding to each target optical response signal;

[0014] A multi-scale feature fusion operation is performed based on the target multi-scale feature matrix sequence to obtain the target fused feature distribution matrix, and the defect analysis conclusion corresponding to the surface of the weld to be inspected is output based on the target fused feature distribution matrix.

[0015] Optionally, the step of performing multi-scale feature extraction on the initial optical response signal to obtain initial multi-scale feature matrices corresponding to multiple different spatial resolution levels includes:

[0016] The initial optical response signal is input into a feature extraction network structure containing multiple receptive field analysis nodes;

[0017] Macroscopic scattering characteristic parameters corresponding to macroscopic rough morphology are extracted at each receptive field analysis node, and microscopic reflection characteristic parameters corresponding to microstructure grain boundary defects are extracted.

[0018] The macroscopic scattering feature parameters and the microscopic reflection feature parameters are mapped to the initial multi-scale feature matrix corresponding to each spatial resolution level.

[0019] Optionally, before extracting the macroscopic scattering characteristic parameters and the microscopic reflection characteristic parameters, the method further includes:

[0020] Collect a priori distribution dataset of ripple frequency of normal welds under preset welding process parameters;

[0021] A spatial frequency domain filter mask is constructed using the aforementioned ripple frequency prior distribution dataset;

[0022] The initial optical response signal is subjected to a background periodic structured light and shadow filtering operation using the spatial frequency domain filter mask to suppress optical interference energy caused by the regular fish scale pattern physical fluctuations.

[0023] Optionally, the step of performing a multi-scale feature fusion operation based on the target multi-scale feature matrix sequence to obtain the target fused feature distribution matrix includes:

[0024] Calculate the feature activation gain ratio of each target multi-scale feature matrix corresponding to the initial multi-scale feature matrix;

[0025] Based on the aforementioned feature activation gain ratio, calculate the independent fusion weighting coefficients for each modulated beam sequence;

[0026] The independent fusion weighting coefficients are used to perform a weighted summation calculation on all the target multi-scale feature matrices to generate the final target fusion feature distribution matrix.

[0027] Optionally, the step of outputting the defect analysis conclusions corresponding to the surface of the weld to be inspected based on the target fusion feature distribution matrix includes:

[0028] The target fusion feature distribution matrix is ​​compared with a preset physical attribute database of weld defects for similarity.

[0029] When the preset similarity conditions are met, the matching physical category identifier of the defect is extracted;

[0030] Calculate the physical energy attenuation value contained within the target fusion feature distribution matrix, and use the physical energy attenuation value to map and calculate the depth geometric parameters of the corresponding defect;

[0031] The physical category identifier of the defect and the depth geometric parameters are used together as the output of the defect analysis conclusion.

[0032] Optionally, the step of performing roughness interference feature analysis on the initial multi-scale feature matrix to determine the surface scattering interference level of the weld surface to be inspected includes:

[0033] Calculate the optical scattering gradient magnitude corresponding to each local region in the initial multi-scale feature matrix;

[0034] Extract suspected interfering connected blocks whose optical scattering gradient magnitude is higher than a preset gradient threshold;

[0035] Calculate the pixel variance fluctuation parameters within each suspected interfering connected block;

[0036] The pixel variance fluctuation parameter is used as the degree of surface scattering interference on the surface of the weld to be inspected.

[0037] Optionally, the adaptive generation of a dynamic optical modulation strategy comprising multiple modulation state parameters based on the surface scattering interference level includes:

[0038] The surface scattering interference level is divided into multiple preset interference intensity ranges;

[0039] For each interference intensity range, a set of detection spectral bands with corresponding penetration capabilities and a set of spatial modulation polarization angles are pre-allocated;

[0040] Based on the interference intensity range of the surface scattering interference obtained from actual calculations, the corresponding set of detection spectral bands and the set of spatial modulation polarization angles are selected to form the dynamic optical modulation strategy containing multiple modulation state parameters.

[0041] Optionally, controlling the optical emission module to sequentially emit a sequence of modulated beams corresponding to the multiple modulation state parameters onto the surface of the weld to be inspected, based on the dynamic optical modulation strategy, includes:

[0042] The dynamic optical modulation strategy is analyzed to include multiple emission wavelength parameters and multiple polarization direction parameters.

[0043] According to the set time interval sequence, drive waveform commands corresponding to each emission wavelength parameter are sent to the tunable laser component in the optical emission module, and angle rotation commands corresponding to each polarization direction parameter are sent to the polarization controller simultaneously.

[0044] This drives the optical emission module to emit a sequence of modulated beams that simultaneously possess specific emission wavelength parameters and specific polarization direction parameters at various time interval nodes.

[0045] Optionally, controlling the optical acquisition module to simultaneously acquire multiple target optical response signals corresponding to the multiple modulated beam sequences includes:

[0046] At the synchronized moment of sending the drive waveform command and the angle rotation command, an exposure trigger level is sent to the optical acquisition module;

[0047] The optical acquisition module is controlled to acquire, at each time interval node, a high-dimensional spectral polarization response data matrix reflected back from the surface of the weld to be inspected under the target wavelength and target polarization state;

[0048] All of the high-dimensional spectral polarization response data matrices are used as the optical response signals of the multiple targets.

[0049] In a second aspect, the present invention provides an optical inspection system for weld defects based on multi-scale feature fusion, comprising a processing unit and a storage medium storing computer instructions, characterized in that, when the processing unit executes the computer instructions, it is configured to execute the optical control flow and data operation logic in the optical inspection method for weld defects based on multi-scale feature fusion as described in the first aspect.

[0050] The present invention has achieved the following beneficial effects:

[0051] By extracting multi-scale features from the initial optical-physical response signal of the test material surface, the surface roughness characteristics and physical scattering interference of the weld material were quantitatively analyzed, and a dynamic optical modulation strategy covering specific wavelengths and polarization directions was adaptively generated accordingly. This scheme controls the underlying hardware to sequentially emit a modulated beam sequence and simultaneously acquire target optical response signals reflecting different physical properties of the material. It can dynamically execute multi-mode modulation of the probe light field according to the actual surface morphology of the material, stripping away the background scattering interference energy caused by the fish-scale texture undulations of the weld material surface from the physical acquisition front end. This reduces the feature overlap between macroscopic surface contours and microscopic internal defects in the optical-physical response, enabling the subsequently fused multi-scale feature matrix to reflect the changes in the internal physical properties of the test material matrix. This allows for the testing and analysis of defects in metal weld materials in a physical environment with surface morphology interference.

[0052] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.

[0053] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0054] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0055] Figure 1This is a flowchart illustrating the optical detection method for weld defects based on multi-scale feature fusion provided in an embodiment of the present invention.

[0056] Figure 2 This is a structural block diagram of the optical inspection system for weld defects based on multi-scale feature fusion provided in an embodiment of the present invention. Detailed Implementation

[0057] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0058] As the physical connection point of metal structural components, welds are subject to the combined effects of local heat input gradient changes, physical phase transformations during the cooling and crystallization of the molten metal pool, and external environmental temperature disturbances during automated welding processes. This results in microscopic cracks, lack of fusion, or porosity defects both inside and on the surface of the weld. Conventional optical non-destructive testing primarily involves emitting a probe beam with a fixed wavelength and polarization state into the test area and receiving the reflected light intensity distribution for data acquisition and defect identification. Due to the periodic movement of the heat source and the dynamic characteristics of the metal fluid during automated welding, the actual weld surface generally exhibits a macroscopic fish-scale texture with spatial periodic undulations. Simultaneously, the microscopic roughness varies around the heat-affected zone due to differences in the degree of high-temperature oxidation of the metal. When the aforementioned physical morphology receives a probe beam with fixed parameters, it excites spatial optical diffuse reflection and polarization state degradation, forming surface scattering interference energy covering the test area. Under the aforementioned physical light field distribution, the optical diffraction and reflection characteristics generated by grain boundary cracks or internal pore edges overlap with the scattering characteristics caused by the surface morphology. Existing image data recognition models struggle to isolate optical scattering interference caused by surface physical fluctuations from the underlying physical signal level, thereby increasing the false alarm rate for detecting deep, hidden defects.

[0059] To this end, this application discloses an optical detection method and system for weld defects based on multi-scale feature fusion, which can acquire underlying optical signals in real time and extract multi-scale features, quantitatively evaluate the degree of surface scattering interference, and then reverse control the front-end optical emission module to perform physical-level multi-mode modulation, strip away surface scattering signals, and realize the identification of weld defects.

[0060] See attached document Figure 1 As shown in the figure, this application discloses an optical detection method for weld defects based on multi-scale feature fusion, which is applied to a weld defect detection system and includes the following steps:

[0061] Step S1: Control the optical emission module to emit an initial detection beam toward the surface of the weld to be inspected, and control the optical acquisition module to acquire the initial optical response signal corresponding to the surface of the weld to be inspected.

[0062] Specifically, before the optical emitting module emits the initial detection beam onto the surface of the weld to be inspected, the procedure further includes: physically calibrating the spatial position and projection angle of the optical emitting module and the optical acquisition module relative to the surface of the weld to be inspected in a preset three-dimensional coordinate system. The working posture of the optical emitting module is adjusted by a multi-axis mechanical motion control platform so that the emitting end face of the optical emitting module forms an angle between the incident optical axis and the surface of the weld to be inspected; simultaneously, the receiving end face of the optical acquisition module is adjusted to form an angle between the receiving optical axis and the surface of the weld to be inspected. The physical calibration parameters of the spatial position and the projection angle are fixed to ensure that the underlying optical signals acquired multiple times have a reference consistency in the spatial coordinate system. Furthermore, the reference detection distance is set to a spatial value at the millimeter level. Preferably, during the detection operation, the preset reference detection distance is maintained to ensure that the physical spot size and optical energy density formed by the initial detection beam on the surface of the weld to be inspected are within a constrained range. For example, the reference detection distance is specifically calibrated to a physical range of 50mm to 150mm to balance the optical imaging field of view coverage and the signal-to-noise ratio of the returned photon energy. After calibration, the control processor sends a reference trigger command to the optical emission module. The optical emission module is internally configured with a broadband semiconductor light-emitting array component covering the visible to near-infrared bands. Upon receiving the reference trigger command, the broadband semiconductor light-emitting array component projects the initial detection beam with broadband energy coverage characteristics.

[0063] Furthermore, when the initial probe beam is projected onto the surface of the weld to be inspected, due to the spatial distribution differences in the physical refractive index of the weld material and the geometric undulations of the macroscopic fish-scale pattern on the surface, the photon flow will simultaneously undergo physical specular reflection, subsurface scattering, and deep diffuse reflection processes. Smooth metal crystal surfaces will produce directional physical specular reflection; rough oxide regions will produce diffuse scattering; and tiny crack tips or pore edges will induce local optical diffraction and absorption attenuation. Reflected photons, scattered photons, and diffracted photons carrying various physical characteristic information of the weld surface to be inspected will re-intercept in space, forming a composite optical reflection field. The control processing unit sends a synchronous acquisition level signal to the optical acquisition module, causing the photosensitive receiving physical channel within the optical acquisition module to be synchronously activated. The high dynamic range photoelectric conversion array inside the optical acquisition module captures the spatial photon energy flow returned from the surface of the weld to be inspected according to the set reference exposure physical time window. For example, the span of the reference exposure physical time window is set to 500μs to 2ms. This time window can effectively avoid overexposure of optical sensor pixels caused by high reflectivity areas, and also allow the scattered photons in dark areas to obtain sufficient charge integration.

[0064] Understandably, the optical acquisition module performs photoelectric conversion on the captured spatial photon energy flow, generating a discrete quantized physical matrix containing planar spatial coordinate indices and light intensity amplitude sequences, and uses this discrete quantized physical matrix as the initial optical response signal. The initial optical response signal records the original full-spectrum optical reflection physical quantity distribution of the weld surface under test without wavelength selection and polarization filtering. By projecting the initial probe beam across the entire frequency band and acquiring the unmodulated initial optical response signal, the macroscopic ripple light and shadow contours and microscopic physical scattering energy are preserved, providing the original basic physical data input for subsequent removal of surface physical interference.

[0065] Step S2: Collect the prior distribution dataset of ripple frequency of normal welds under preset welding process parameters; construct a spatial frequency domain filter mask using the prior distribution dataset of ripple frequency; perform background periodic structured light and shadow filtering operation on the initial optical response signal using the spatial frequency domain filter mask to suppress optical interference energy caused by regular fish scale pattern physical fluctuations.

[0066] Specifically, under fixed process conditions such as wire feeding speed, welding current, arc voltage, and robotic arm travel speed, the surface of a formed normal metal weld will exhibit regular fish-scale-like physical undulations with a spatial periodic span. These regular physical undulations appear as a periodic stripe structure with alternating bright and dark areas in optical imaging. The weld surface layer formed by the final solidification phase transition due to fluid solidification oscillation exhibits a repetitive macroscopic corrugated structure undulation in spatial physical scale spacing. The control processor calls upon the reference optical response scan data of multiple pre-recorded normal, defect-free metal weld samples from local storage media. A planar discrete Fourier forward transform is performed on all the reference optical response scan data, mapping the pixel brightness signals based on spatial geometric coordinate domain distribution to a planar complex spectral coordinate system composed of spatial frequency and phase distributions. Within the planar complex spectral coordinate system, the periodic undulation characteristics of the regular corrugated structure are transformed into locally concentrated high-amplitude energy bright spots. The processor iterates through and locks the planar frequency coordinate system nodes of local high-amplitude energy bright spots in all samples, extracts the corresponding spatial frequency values ​​and energy amplitude thresholds, and packages and integrates the aforementioned spatial frequency values ​​and energy amplitude thresholds to construct the ripple frequency prior distribution dataset as a prior template. Specifically, the energy amplitude threshold is determined as follows: extract the spectral energy amplitude of all normal, defect-free metal weld samples at the corresponding local high-amplitude energy bright spot coordinate system nodes, calculate the average of all extracted spectral energy amplitudes; then multiply this average by a preset boundary tolerance coefficient (e.g., a scalar constant between 0.8 and 0.9), and determine the calculated product value as the energy amplitude threshold. This threshold is used to objectively define and distinguish the lower boundary between the periodic light and shadow fluctuation energy caused by regular fish-scale undulations and the random background noise energy in the frequency domain.

[0067] Furthermore, a spatial frequency domain filter mask is constructed using the ripple frequency prior distribution dataset. The processing unit initializes and generates a blank frequency domain mask matrix in system memory with the same resolution scale as the initial optical response signal. In the planar frequency domain coordinate system, for the periodic high-energy frequency band physical region indicated by the ripple frequency prior distribution dataset, a physical stopband attenuation parameter with a value set to zero is configured; for the non-periodic physical region far from the aforementioned high-energy frequency band physical region, an all-pass physical gain parameter with a value set to the upper limit of full scale is configured. The physical stopband attenuation parameter and the all-pass physical gain parameter together constitute the spatial frequency domain filter mask with multi-dimensional matrix dimensions.

[0068] Understandably, the acquired initial optical response signal is physically converted to the spatial frequency domain to generate a corresponding initial spatial frequency domain complex matrix. An element-wise matrix multiplication operation is then performed between the spatial frequency domain filter mask and the initial spatial frequency domain complex matrix. During the multiplication, complex feature data at the row and column coordinates within the initial spatial frequency domain complex matrix are extracted, and real attenuation or gain parameters at the corresponding row and column coordinates within the spatial frequency domain filter mask are simultaneously extracted. The two are then multiplied using scalar logic, and the product is overwritten and written back to the original memory address segment. Further clarification is needed, as the real attenuation or gain parameter is defined as a real weighting factor in the spatial frequency domain that scales and modulates the complex feature energy of the optical response at the corresponding frequency coordinate node. The specific process for obtaining this information is as follows: Based on the preset configuration distribution rules when constructing the spatial frequency domain filter mask, when the currently extracted row and column coordinates fall within the physical stopband region corresponding to the periodic fish-scale pattern frequency, the system extracts and assigns a very small positive real number (such as 0.01) with a value of zero or close to zero as the real attenuation parameter to suppress the background interference energy of this frequency band; when the currently extracted row and column coordinates fall within a non-periodic physical region far from the periodic fluctuations, the system extracts and assigns a full-scale constant value of 1 as the real gain parameter to retain the true characteristic energy reflecting the high-frequency optical response of potential microscopic defects without loss. Since the stopband attenuation parameter corresponding to the fish-scale pattern frequency is close to zero, the dot product operation blocks the light and shadow fluctuation energy of the regularly fluctuating physical structure. After the dot product operation is completed, the physical frequency domain matrix is ​​re-physically mapped back to the spatial domain geometric space using the plane discrete Fourier inverse physical transform logic. This completes the background periodic structure light and shadow filtering operation and outputs a corrected optical response signal that suppresses the background periodic structure light and shadow features. The aforementioned corrected optical response signal is then used as the standard input data for the multi-scale feature extraction operation.

[0069] Step S3: Perform multi-scale feature extraction on the processed initial optical response signal to obtain initial multi-scale feature matrices corresponding to multiple different spatial resolution levels.

[0070] Specifically, multi-scale feature extraction is performed on the initial optical response signal to obtain initial multi-scale feature matrices corresponding to multiple different spatial resolution levels. This includes: inputting the initial optical response signal into a feature extraction network structure containing multiple receptive field analysis nodes; extracting macroscopic scattering feature parameters corresponding to macroscopic roughness at each receptive field analysis node, and extracting microscopic reflection feature parameters corresponding to microscopic grain boundary defects; and mapping the macroscopic scattering feature parameters and the microscopic reflection feature parameters to the initial multi-scale feature matrices corresponding to each spatial resolution level.

[0071] Further, the pre-compiled feature extraction network structure is loaded. The feature extraction network structure is internally configured as a topological hierarchy containing shallow high-frequency physical sensing network branches and deep low-frequency physical sensing network branches executed in parallel, consisting of multi-layered cascaded spatial feature physical convolution kernels and a nonlinear physical threshold filtering module. Specifically, the nonlinear physical threshold filtering module consists of a hardware gated circuit unit with a digital logic comparator, or algorithm execution code logic configured with a nonlinear activation operator (such as a ReLU rectified linear unit); its function is to perform nonlinear unidirectional truncation and boundary constraint mapping on the multiplication and addition calculation results output by the front-end spatial feature physical convolution kernel, to forcibly filter out invalid optical background noise interference below the system's dark field environment. The nonlinear physical threshold is defined as: the lowest energy limit truncation benchmark value for determining whether a local optical feature node has reached the effective optical reflection response activation state; combined with the system's underlying light intensity measurement requirements, its value is pre-set by the system to a constant 0 or a positive real constant less than 0.05 obtained based on the noise calibration of the unloaded anechoic chamber. The processing engine converts the processed initial optical response signal into a multi-channel floating-point data tensor and pushes it to the network structure operator layer. As a specific network topology implementation, the feature extraction network structure adopts a dual-stream parallel processing architecture with splitting at the beginning and merging at the end. The multi-channel floating-point data tensor pushed to the network structure operator layer is synchronously copied and independently fed into the shallow high-frequency physical perception network branch and the deep low-frequency physical perception network branch, respectively. Specifically, the deep low-frequency physical perception network branch is configured with at least three-dimensional feature downsampling convolutional blocks sequentially along the forward propagation direction of the data. By cascading layer by layer, the physical coverage area of ​​the macroscopic receptive field is gradually expanded to capture large-scale light and shadow contour undulations. The shallow high-frequency physical perception network branch is configured as a sequence of equal-scale feature maps without step decay. Its internal operators maintain a constant spatial resolution level with the original input during the operation, thereby preserving high-frequency physical boundary information to the greatest extent and suppressing pixel-level loss during feature extraction. After performing independent feature matrix operations, the two network branches output tensor data in their respective feature spaces at the terminal merging node, thus forming a complete network physical topology link that supports subsequent multi-scale feature alignment and splicing.

[0072] At the receptive field analysis node corresponding to the deep physics level and with a specific physical size, the computation processor uses a planar feature convolution kernel with a large area set to the physical perception size to perform spatial sliding multiply-accumulate calculations on the input multi-channel floating-point data tensor. The spatial sliding multiply-accumulate calculation includes the underlying processing logic: spatially superimposing the planar feature convolution kernel matrix of a specific size onto the initial coordinate segment at the upper left corner of the floating-point data tensor matrix. As a preferred implementation, the spatial size of the large-area planar feature convolution kernel corresponding to the deep physics level is configured as a 7×7 or 9×9 two-dimensional parameter matrix to cover a large macroscopic physical receptive field. For each corresponding pixel position within the overlapping region, the input floating-point value is multiplied by the specific weight floating-point value of the convolution kernel using scalar multiplication. After obtaining multiple product parameters, an adder is used to sum all product parameters and the bias constant parameter. Specifically, the bias constant parameter is defined as follows: It exists independently of the input features during spatial sliding multiply-accumulate calculations, is appended to the output feature values ​​of each node, and is used to compensate for the dark current noise of the underlying optical sensor and adjust the trigger origin of the nonlinear activation function (i.e., the bias term). The specific solution method for the bias constant parameter is as follows: During the offline model pre-training stage before the formal deployment and operation of the feature extraction network structure, this parameter is used as a learnable initial network weight variable; a pre-collected dataset of metal weld samples containing known typical normal morphologies and defect optical responses is used to perform forward propagation feed calculations on the network model; subsequently, the error gradient of the loss function is calculated using the backpropagation algorithm, and an adaptive gradient descent optimizer (such as Adam or SGD optimizer) is called to iteratively update and optimize the bias variable in multiple rounds; after the overall network model accuracy reaches a convergent state, the constant value at this convergent and stable state is extracted and solidified into the underlying hardware register, which serves as the bias constant parameter called during actual forward inference. The summation result is input into the rectified activation function to perform boundary constraint judgment: if the summation result is less than the zero threshold, the output channel variable is forcibly overwritten to zero; if the summation result is greater than or equal to the zero threshold, the output channel variable retains its original summation result value. After the activation judgment is completed, the final value is written to the corresponding coordinate position in the lower-level feature matrix. Subsequently, the sliding window is controlled to perform spatial coordinate translation according to the set horizontal and vertical step sizes, repeating the above multiply-add and activation calculations until all row and column boundary ranges of the entire input multi-channel floating-point data tensor are traversed and covered. The macroscopic scattering feature parameters representing the macroscopic contour are then calculated and output.

[0073] At the receptive field analysis node corresponding to a shallow physical level and a specific physical size, the computation processor employs a planar feature differential convolution kernel with a small physical sensing area and responsiveness to edge gradients. This kernel performs pixel-wise spatial sliding multiplication-addition calculations on the input multi-channel floating-point data tensor. The central weight within the aforementioned planar feature differential convolution kernel is positive, while the surrounding weights are negative, with the absolute value of the central weight greater than that of the surrounding weights. This is used to detect abrupt differential changes in spatial energy. In a preferred embodiment, the spatial size of the planar feature differential convolution kernel is configured as a compact 3×3 two-dimensional parameter matrix. The central weight corresponding to its central coordinate is configured as +8, and the weights corresponding to the eight surrounding neighborhood coordinates are equally configured as -1, thus constructing a Laplacian high-frequency difference operator. After local overlapping multiplication-addition and threshold rectification activation, the output is the microscopic reflection feature parameter representing a minute defect in the metallic crystal.

[0074] Understandably, the control processor extracts the macroscopic scattering feature parameters and the microscopic reflection feature parameters within the same computational physical layer channel and performs a dimension alignment operation. The processor calls the spatial bilinear interpolation operator to upsample and amplify the macroscopic scattering feature parameters. The bilinear interpolation calculation steps include: for any floating-point mapped coordinate node in the amplified target matrix, addressing backwards to locate the positions of adjacent physical integer coordinate nodes. Calculating the length ratio difference between the mapped coordinate node and the adjacent integer coordinate nodes in the horizontal physical axis direction and the vertical physical axis direction respectively. Using the length ratio difference as a weighting factor, the feature parameter values ​​carried on adjacent physical integer coordinate nodes are sequentially cross-multiplied. The results of the cross-multiplication calculation are added to form a smooth interpolation result on the corresponding coordinate node of the target matrix. After completing the bilinear interpolation operation through global coordinate traversal, the macroscopic scattering feature parameters and the microscopic reflection feature parameters are aligned spatially to the standard resolution level coordinate reference.

[0075] After the dimension alignment operation is completed, the memory controller component, based on the logical address mapping algorithm, performs a data dimension concatenation and splicing operation on the macroscopic scattering feature parameters and the microscopic reflection feature parameters after unifying the resolution coordinates, according to the preset physical matrix rules, along the depth channel expansion dimension direction. Specifically, the preset physical matrix rules refer to the deep feature channel splicing and combination rules (i.e., concatenation operation) in tensor operations: Under the premise that the system confirms that the high-dimensional feature tensor corresponding to the macroscopic scattering feature parameter and the high-dimensional feature tensor corresponding to the microscopic reflection feature parameter are completely aligned and equal in length, width, and resolution dimensions (i.e., the number of row pixel nodes and column pixel nodes) in the two-dimensional planar geometric space; all feature channel data contained in the microscopic reflection feature parameter are sequentially stacked and appended to the ends of each deep feature channel contained in the macroscopic scattering feature parameter according to their original sequence order; thereby generating a new composite three-dimensional tensor matrix through splicing and fusion, and the total number of deep channels in the newly generated composite three-dimensional tensor matrix is ​​strictly equal to the sum of the number of deep channels of the two sets of feature parameters involved in the splicing, achieving multi-dimensional feature integration without disrupting the planar pixel coordinate mapping. The spliced ​​and combined multi-dimensional physical feature tensor is output as the initial multi-scale feature matrix corresponding to the current spatial resolution physical level. Specifically, the multi-level pooling dimensionality reduction operation is implemented using a 2×2 spatial max pooling operator with a step size of 2. This effectively preserves the peak features of high-frequency optical reflection responses caused by metal grain boundary defects while reducing the spatial resolution of the feature map and compressing redundant computations. Subsequently, the system sequentially performs multi-level pooling dimensionality reduction, outputting multiple sets of feature data storage block sequences with cascaded distribution relationships, i.e., multiple initial multi-scale feature matrices at different spatial resolution levels. By setting up a parallel extraction computing architecture covering receptive field analysis nodes with different physical sensing ranges, the corresponding low-frequency macroscopic morphology optical response signals and the corresponding high-frequency microscopic defect optical response signals are decoupled at the feature matrix level.

[0076] Step S4: Perform roughness interference feature analysis on the initial multi-scale feature matrix to determine the surface scattering interference level of the weld surface to be inspected.

[0077] Specifically, roughness interference feature analysis is performed on the initial multi-scale feature matrix to determine the surface scattering interference level of the weld surface to be inspected, including: calculating the optical scattering gradient amplitude corresponding to each local region in the initial multi-scale feature matrix; extracting suspected interference connected blocks whose optical scattering gradient amplitude is higher than a preset gradient threshold; calculating the pixel variance fluctuation parameter inside each suspected interference connected block; and using the pixel variance fluctuation parameter as the surface scattering interference level of the weld surface to be inspected.

[0078] The processing unit extracts a planar feature slice array at the spatial resolution level from the initial multi-scale feature matrix as the underlying computational base map. A local planar computational physical window is set within the space of the planar feature slice array. Planar spatial differentiation calculations are performed using the horizontal and vertical differential feature operators. Local convolution calculations are performed between the horizontal differential feature operator and the underlying data nodes within the local region matrix to obtain the partial derivative values ​​of the brightness change rate along the horizontal physical coordinate axis for each pixel node; convolution calculations are performed using the vertical differential feature operator to obtain the partial derivative values ​​of the brightness change rate along the vertical physical coordinate axis for each pixel node. Subsequently, the horizontal partial derivative values ​​of brightness change at the same coordinate nodes are extracted and squared; simultaneously, the vertical partial derivative values ​​of brightness change are extracted and squared. The horizontal and vertical squared results are physically summed and added. After addition, the square root operation is called, and the square root of the sum is inversely calculated to obtain the calculated optical scattering gradient magnitude parameter.

[0079] Further, the processing unit reads the calibration reference data pre-stored in the storage medium and extracts the preset gradient threshold. For example, the preset gradient threshold can be obtained by adaptively calculating the global optical scattering gradient magnitude using the Otsu method; or, based on empirical calibration, the preset gradient threshold is fixedly configured as a specified scalar value within the range of [0.45, 0.65] to effectively distinguish between background optical noise and physical scattering boundaries caused by surface undulations. For all calculated optical scattering gradient magnitudes, pixel-by-pixel threshold comparison logic is executed. When it is determined that the optical scattering gradient magnitude corresponding to a spatial coordinate node exceeds the preset gradient threshold, the feature value of the corresponding spatial coordinate node is set to an active state. After completing the global traversal, the processing unit calls a connected component growth clustering algorithm based on eight-neighborhood spatial morphology. The connected component growth clustering algorithm uses a stack push and pop search mechanism to traverse the surrounding adjacent pixel nodes, starting from the seed node with a high-level activation marker attribute. If an adjacent pixel node has a high-level activation marker attribute, it is included in the current topology set list, and the newly discovered node is continuously pushed onto the stack as the seed node for the next round of growth. When the stack is empty, it indicates that the current connected branch exploration loop has been completed. The set of spatial connected regions merged within the same closed topology set list is extracted by the system and defined as the suspected interfering connected block.

[0080] Understandably, for the extracted suspected interference connected regions, the processing unit repositions and maps them back to the initial multi-scale feature matrix. The total number of pixel nodes contained within the current suspected interference connected region is statistically analyzed, and the corresponding background optical response feature value is extracted. Specifically, the relationship between the total number of pixel nodes and the background optical response feature value is a one-to-many mapping relationship between the total scale of the macroscopic spatial geometric set and the physical attributes of microscopic local independent nodes: that is, the total number of pixel nodes represents the total number of effective discrete coordinate pixels covered by the current suspected interference connected region within a two-dimensional planar region; and each independent two-dimensional physical space coordinate node within this connected region uniquely carries a specific quantized brightness amplitude scalar data, namely the background optical response feature value. The specific steps for extracting the background optical response feature values ​​are as follows: The system processor sequentially traverses the two-dimensional planar spatial row and column coordinate indices of each independent pixel node contained within the closed boundary of the currently suspected interfering connected block; then, using the two-dimensional planar spatial row and column coordinate indices as the underlying memory address, it performs a sequential addressing and positioning operation within the initial multi-scale feature matrix at the corresponding spatial resolution level, directly reading the light intensity quantized floating-point values ​​recorded in the memory segment corresponding to each spatial coordinate address. The collected light intensity data are then summarized to extract all the background optical response feature values. The processor accumulates all the background physical response value variables and divides the total accumulated value by the total number of pixel nodes to calculate the arithmetic mean expected physical value. Subsequently, a nested addressing loop is initiated: for each individual background physical response numerical variable, the aforementioned arithmetic mean expected physical value is subtracted using subtraction logic to obtain the absolute deviation parameter; the absolute deviation parameter is multiplied by itself using multiplication logic to generate the squared deviation parameter; all squared deviation parameters are summed using an accumulator; finally, the summed value inside the accumulator is divided by the total number of pixel nodes. After the calculation process is completed, the pixel variance fluctuation parameter representing the internal fluctuation divergence state is output.

[0081] Collect the pixel variance fluctuation parameters corresponding to all independently extracted suspected interference connected blocks. Using the number of pixel nodes contained in the block as a weighting factor, perform a weighted average summation and normalization operation on all pixel variance fluctuation parameters to generate a global quantitative numerical index characterizing the physical scattering environment of the entire weld surface under inspection. Establish this index as the surface scattering interference level. Convert planar image processing into a quantitative mathematical statistical analysis and calculation of the surface physical optical scattering state. Specifically, the surface scattering interference level (denoted as...) The specific formula for calculating the weighted average summation normalization is as follows: ;in, This represents the total number of the suspected interfering connected blocks extracted. For the first Pixel variance fluctuation parameters within a suspected interfering connected block; For the first The number of pixel nodes contained within a suspected interfering connected block is used as a weighting factor here. This refers to the maximum limit variance constant obtained beforehand through roughness limit calibration. For example, this maximum limit variance constant can be established by pre-collecting optical scattering images of high-roughness weld samples with deep oxidation and large areas of unfused defects on the surface, and extracting the expected maximum variance of the globally connected blocks. This serves as the full-scale upper limit benchmark for the system's quantitative evaluation of the physical scattering environment. Using this formula, with the pixel area of ​​each block as the weight, discrete fluctuation parameters are normalized to a specific dimensionless numerical range (e.g., 0 to 1), establishing a unified and reproducible benchmark for evaluating the surface physical scattering environment.

[0082] The above formula introduces the parameter of the number of pixel nodes. As a weighting factor, the system essentially calculates the mathematical expectation of the global scattering energy. Compared to directly averaging the variances of all blocks, this area-weighted method effectively smooths out variance abrupt changes caused by localized, isolated noise points, ensuring that the evaluation results are dominated by large-area, realistic physical fluctuations. Furthermore, in the error-proofing boundary design of the underlying algorithm, the preceding morphological connected component growth and clustering algorithm has ensured the number of internal pixels in all extracted suspected interfering connected components. Therefore, the cumulative term in the denominator It is a positive integer, combined with a pre-defined non-zero constant. This avoids the risks of computational overflow and system crash caused by division by zero, and improves the robustness of continuous detection in industrial settings.

[0083] Step S5: Based on the surface scattering interference level, adaptively generate a dynamic optical modulation strategy containing multiple modulation state parameters.

[0084] Specifically, based on the surface scattering interference level, an adaptive dynamic optical modulation strategy comprising multiple modulation state parameters is generated, including: dividing the surface scattering interference level into multiple preset interference intensity intervals; for each interference intensity interval, pre-allocating a set of detection spectral bands with corresponding penetration capabilities and a set of spatial modulation polarization angles; and selecting the corresponding set of detection spectral bands and the set of spatial modulation polarization angles according to the interference intensity interval where the surface scattering interference level is actually calculated, so as to combine them to form the dynamic optical modulation strategy comprising multiple modulation state parameters.

[0085] The processing unit discretizes the extracted numerical domain of the surface scattering interference level into multiple non-overlapping preset interference intensity intervals according to numerical gradient rules. The system constructs physical parameter mapping relationships for each interference intensity interval in the configuration database. For intervals representing low variance parameters, a set of detection spectral bands containing visible light frequency band parameters is assigned, along with a set of spatially modulated polarization angles composed of reference polarization angle parameters. For intervals representing high variance parameters, a set of detection spectral bands containing near-infrared transmission frequency band parameters is assigned, and simultaneously combined with a set of spatially modulated polarization angles composed of parameters covering linear polarization states at specific rotation angles. As a preferred implementation: the system divides the normalized surface scattering interference level into three intensity intervals. When the surface scattering interference level is within... In the low-degree range, the detection spectral band set is configured to cover the visible light band with a center wavelength of 450 nm to 650 nm, and the spatial modulation polarization angle set is configured to include only... Unidirectional reference line polarization; when in In the moderate range, the detection spectral band set is configured to cover the near-infrared band with a center wavelength of 650 nm to 850 nm, and the spatial modulation polarization angle set is configured to include... and Combined linear polarization; when in In the high-altitude range, due to the presence of microscopic oxidation undulations with significant surface roughness, the detection spectral band set is configured to cover the deep near-infrared transmission band with a center wavelength of 850 nm to 1064 nm, and is simultaneously combined with a combination covering... , , orthogonal and The multi-directional polarization state parameters. This precise combination of mapping parameters utilizes the strong penetrability of deep infrared long waves and multi-dimensional orthogonal polarization states to effectively filter out photon depolarization interference excited by high-roughness surfaces, ensuring that the underlying hardware can accurately execute adaptive modulation actions.

[0086] Furthermore, the processing unit utilizes a comparator gate array to perform a traversal comparison calculation between the quantized scalar value of the surface scattering interference level and the span of the aforementioned multiple interference intensity intervals. Once it is confirmed that the scalar value of the surface scattering interference level falls within the interference intensity interval of the specific target, the corresponding set of detection spectral bands and the set of spatial modulation polarization angles are extracted. The extracted multiple emission wavelength control parameter variables and multiple specific polarization angle control parameter variables are arranged, combined, and encapsulated according to the set underlying hardware driver execution time series nodes to generate the dynamic optical modulation strategy containing multiple modulation state parameters.

[0087] Step S6: According to the dynamic optical modulation strategy, control the optical emission module to sequentially emit multiple modulation beam sequences corresponding to the multiple modulation state parameters to the surface of the weld to be inspected, and control the optical acquisition module to synchronously acquire multiple target optical response signals corresponding to the multiple modulation beam sequences.

[0088] Specifically, controlling the optical emission module to sequentially emit multiple modulation beam sequences corresponding to the multiple modulation state parameters onto the surface of the weld to be inspected includes: analyzing multiple emission wavelength parameters and multiple polarization direction parameters contained within the dynamic optical modulation strategy; sending drive waveform commands corresponding to each emission wavelength parameter to the tunable laser component in the optical emission module according to a set time interval sequence, and simultaneously sending angle rotation commands corresponding to each polarization direction parameter to the polarization controller; thereby driving the optical emission module to emit the modulation beam sequence simultaneously possessing specific emission wavelength parameters and specific polarization direction parameters at each time interval node. Specifically, in the set time interval sequence, the physical time span between adjacent time interval nodes is set to 5ms to 20ms. This time span configuration not only adapts to the wavelength switching setup time of the tunable laser component, but also enables the synchronously linked optical acquisition module to have sufficient charge integration and photoelectric analog-to-digital conversion period, thereby reducing the aliasing of optical field characteristics and timing crosstalk between multiple modulation beam sequences.

[0089] The processing unit converts specific emission wavelength parameters into corresponding digital control parameters according to a set time interval sequence. These digital control parameters are then mapped to a continuous analog voltage signal applied to the tunable laser component via a digital-to-analog converter. Under a specific voltage injection level constraint, the center wavelength of the beam output by the tunable laser component is locked to the spectral coordinate position corresponding to the current emission wavelength parameter. Simultaneously, the processing unit outputs an angle rotation command to the polarization controller, containing a target duty cycle pulse width signal. Under direct voltage control, the light wave penetrating the polarization controller is modulated into an outgoing light wave with a specific polarization phase angle. This drives the optical emission module to emit the modulated beam sequence simultaneously possessing specific wavelength and polarization parameters at each time interval node.

[0090] Furthermore, controlling the optical acquisition module to synchronously acquire multiple target optical response signals corresponding to the multiple modulated beam sequences includes: sending an exposure trigger level to the optical acquisition module at the synchronization moment of sending the driving waveform command and the angle rotation command; controlling the optical acquisition module to acquire, at each time interval node, a high-dimensional spectral polarization response data matrix reflected back from the surface of the weld to be inspected under the target wavelength and target polarization state; and using all the high-dimensional spectral polarization response data matrices as the multiple target optical response signals.

[0091] Understandably, within the same system clock cycle as the sending of the analog voltage signal, the processing unit continuously injects a high-level exposure trigger level into the sensor pin of the optical acquisition module. This controls the optical acquisition module to open the photosensitive integration time window and capture photons arriving at the photosensitive interface. After analog-to-digital conversion and quantization, the processing unit allocates a 3D tensor storage address space in memory. The horizontal and vertical coordinates of the 3D tensor record the spatial position, and the depth channel labels the center wavelength and spatial polarization angle. This generates a multidimensional spectral polarization response data matrix with optical parameter identifiers. All the aggregated multidimensional spectral polarization response data matrices are used as the multiple target optical response signals.

[0092] Step S7: Perform multi-scale feature extraction on the multiple target optical response signals to obtain the target multi-scale feature matrix sequence corresponding to each target optical response signal.

[0093] Specifically, the processing unit feeds the independently acquired target optical response signals into the feature extraction network structure. At the receptive field analysis nodes corresponding to deep physical levels and specific physical dimensions, a large-area planar feature convolution kernel is invoked to perform sliding multiplication and addition calculations on the target optical response signals to extract macroscopic scattering feature parameters corresponding to the macroscopic morphology. At the receptive field analysis nodes corresponding to shallow physical levels and specific physical dimensions, a compact-step planar feature differential convolution kernel is invoked to perform sliding multiplication and addition calculations to extract microscopic reflection feature parameters corresponding to grain boundary defects in the microstructure.

[0094] The control processor then performs spatial feature interpolation bilinear expansion and size cascade alignment operations again. This aligns the macroscopic scattering feature parameters with the microscopic reflection feature parameters in the spatial resolution dimension coordinate system. Data dimension concatenation and splicing operations are performed, and the numerical boundary intervals are constrained by a specific nonlinear rectified activation function. Specifically, the specific nonlinear rectified activation function is a Rectified Linear Unit (ReLU) or a Leaky ReLU to filter out invalid negative optical response noise. For the target optical response signal under a specific modulation state of each independent input, the processor calculates and outputs a combination of multidimensional physical feature tensors, establishing it as the target multi-scale feature matrix corresponding to the current modulated beam sequence. After iterative extraction and calculation, the system generates multiple sets of parallel feature tensors in memory space, which are then summarized and defined as the target multi-scale feature matrix sequence.

[0095] Step S8: Perform a multi-scale feature fusion operation based on the target multi-scale feature matrix sequence to obtain the target fused feature distribution matrix.

[0096] Specifically, performing a multi-scale feature fusion operation based on the target multi-scale feature matrix sequence to obtain a target fused feature distribution matrix includes: calculating the feature activation gain ratio of each target multi-scale feature matrix corresponding to the initial multi-scale feature matrix; calculating the independent fusion weighting coefficients corresponding to each modulation beam sequence based on the feature activation gain ratios; and performing a weighted summation calculation on all the target multi-scale feature matrices using the independent fusion weighting coefficients to generate the final target fused feature distribution matrix.

[0097] The processing unit retrieves the initial multi-scale feature matrix generated in the initial stage as the measurement reference baseline. The target multi-scale feature matrix under a specific modulation state is extracted and differentially evaluated with the initial multi-scale feature matrix node-by-node and depth-channel-by-channel. The target feature activation energy value at a specific node position within the target multi-scale feature matrix is ​​subtracted from the reference feature energy value at the same coordinate point position within the initial multi-scale feature matrix to obtain the absolute difference in local feature energy activation change. Subsequently, all the absolute differences in local feature energy activation change are accumulated to obtain the total difference in regional feature change. The total difference in regional feature change is divided by the sum of the original values ​​of all feature elements within the reference baseline data to obtain the feature activation gain ratio corresponding to the current specific modulation beam sequence.

[0098] Further, based on the aforementioned feature activation gain ratio, the independent fusion weighting coefficients for each modulated beam sequence are calculated. The computation processor calls the exponentiation formula module based on the natural constant base. The feature activation gain ratios calculated for each branch are used as exponent parameters for power calculation, and then each exponentiation result is divided by the sum of the exponentiation results of all branches. After the aforementioned ratio normalization calculation process, the computation processor outputs a set of numerical distributions within the closed interval from zero to positive real numbers, defined as the independent fusion weighting coefficients. Specifically, let the total number of emitted modulated beam sequences be... , corresponding to the The characteristic activation gain ratio of the modulated beam sequence is Then its corresponding independent fusion weighting coefficient The mathematical formula for calculation is: In the formula, The base of the natural constant is... Representing the The characteristic activation gain ratio of each modulated beam sequence. This nonlinear mathematical mapping model based on the natural exponential function not only ensures the accuracy of all calculated weighting coefficients. Strictly in Within the closed interval, and ensuring that the sum of the combined weights of all feature channels in the same coordinate system is 1, a smooth, weighted allocation of multimodal optical feature tensors that effectively suppresses the risk of numerical overflow is achieved at the mathematical level.

[0099] Furthermore, this embodiment uses the natural constant. The exponential mapping operator (Softmax mechanism) with a base of 0.5 is used in optical field modulation and multi-scale feature acquisition. In these processes, the optical response induced by real defects typically exhibits weak local peaks, while background scattering interference displays a large-area mean distribution. The nonlinear amplification characteristic of the exponential mapping assigns exponentially increasing fusion weights to feature channels with high activation gain ratios, while strongly suppressing low activation gain (background noise) channels. This soft feature selection mechanism significantly improves the contrast between the optical responses of defect features and background features while preserving physical modal data as much as possible. Furthermore, the mapping model is continuously differentiable throughout, preserving an algorithmic interface for fine-tuning of backpropagation parameters in deep learning networks that may be introduced later in the system.

[0100] Understandably, the independent fusion weighting coefficients are used to perform a weighted summation calculation on all the target multi-scale feature matrices. All the target multi-scale feature matrices are retrieved and subjected to scalar multiplication element-wise with each feature node using the assigned independent fusion weighting coefficients. Subsequently, the feature dimension channels of all scaled target multi-scale feature matrices are numerically accumulated at their geometric coordinate node positions. The output is a unified tensor result that aggregates all modal features, i.e., the target fusion feature distribution matrix.

[0101] Step S9: Output the defect analysis conclusion corresponding to the surface of the weld to be inspected based on the target fusion feature distribution matrix.

[0102] Specifically, the defect analysis conclusion corresponding to the surface of the weld to be inspected is output based on the target fusion feature distribution matrix, including: performing a similarity comparison operation between the target fusion feature distribution matrix and a preset weld defect physical attribute database; when the preset similarity condition is met, extracting the matching defect physical category identifier; calculating the physical energy attenuation value contained in the target fusion feature distribution matrix, and using the physical energy attenuation value to map and calculate the depth geometric parameters of the corresponding defect; and outputting the defect physical category identifier and the depth geometric parameters together as the defect analysis conclusion.

[0103] The processing unit flattens the target fusion feature distribution matrix into a high-dimensional feature vector floating-point sequence array according to a specific scanning sequence. For example, the specific scanning sequence can be a row-major raster scan or a Z-order curve scan to ensure that adjacent optical features in two-dimensional space maintain local continuity when converted into one-dimensional high-dimensional feature vectors. The system retrieves the stored preset physical attribute database of weld defects. The floating-point cosine similarity calculation logic is initiated: the high-dimensional feature vector floating-point sequence array is extracted and the standard multidimensional feature benchmark model sequence array in the database is used. The numerical elements in the corresponding order of the two arrays are multiplied by scalars. All product parameters are summed to generate a vector inner product parameter scalar. Simultaneously, the sum of the squares of each element in each sequence array is calculated, and the square root operation is performed to obtain the vector magnitude parameter of each sequence. Finally, the aforementioned vector inner product parameter scalar is divided by the product of the two vector magnitude parameters to complete the calculation of the cosine similarity comparison coefficient. When the calculated value is greater than or equal to a set floating-point threshold, the preset similarity condition is satisfied. In a preferred embodiment, the set floating-point threshold is a threshold constant between 0.85 and 0.92. When the calculated cosine similarity comparison coefficient is greater than or equal to the selected threshold (e.g., 0.85), the system determines that the current target fusion feature distribution matrix and the benchmark model in the database have achieved physical attribute matching. The processing unit sends an extraction request to the database addressing instruction sequence, locks and extracts the corresponding text-encoded identifier, and establishes it as the defect physical category identifier. For example, the preset weld defect physical attribute database is constructed by pre-collecting the optical features of standard test blocks containing artificially prefabricated defects and clustering and labeling them; the defect physical category identifier specifically covers, but is not limited to, physical defect types specific to automated metal welding processes, such as surface microcracks, subsurface porosity, interlayer lack of fusion, and weld toe undercut.

[0104] Further, the processing unit locates and extracts the effective brightness quantization scalar feature set within the corresponding defect occurrence coordinate region in the target fusion feature distribution matrix, and extracts the expected average reference number of feature node brightness at the coordinate points of the normal flat metal region. Specifically, the processing unit first calculates the global feature energy median value of the target fusion feature distribution matrix; clusters coordinate nodes with feature energy values ​​lower than the global feature energy median value by a specific proportion (e.g., lower than 50%) as the defect occurrence coordinate region, and divides the remaining high-energy response distribution connected regions as the normal flat metal region. The absolute light intensity difference between the effective brightness quantization scalar feature set and the expected average reference number is calculated and divided by the reference number; the resulting proportional floating-point parameter is defined as the physical energy attenuation value. The processing unit calls a pre-fitted nonlinear polynomial algebraic equation. The physical energy attenuation value is substituted into the algebraic equation. The algebraic equation is solved to calculate the corresponding spatial depth dimension. The output spatial depth dimension is defined as the depth geometry parameter.

[0105] Specifically, since the energy loss of photons propagating in the cavities or cracks inside solid metal structures follows the Beer-Lambert exponential absorption law, in order to avoid the clock cycle loss and numerical singularity overflow risks caused by logarithmic function solving in the low-level hardware operation, this system starts from the physical level and uses the Taylor series expansion principle to perform high-order truncation equivalence on the logarithmic exponential inversion model, thereby constructing the aforementioned nonlinear polynomial algebraic equation, the specific analytical mathematical expression of which is: In the formula, The calculated spatial depth dimension (i.e., the final output depth geometric parameter, whose unit of measurement is millimeters (mm)). To improve the physical energy attenuation value of the replacement. Because It is a proportional parameter obtained by dividing the absolute difference in light intensity by the expected average reference number, so it is measured as a dimensionless pure scalar in the equation.

[0106] In the equation, The first-order physical mapping compensation coefficient is used to characterize the shallow linear optical absorption of the matrix. To characterize the second-order physical scattering compensation coefficient dominated by multiple internal optical reflections at the secondary interface; To characterize the third-order deep concealed reflection correction constant dominated by high-dimensional volume scattering energy dissipation. The above three fitting coefficients are combined ( , , The physical dimensions of all of them are uniformly defined by the system as millimeters (mm).

[0107] The derivation of the above third-order nonlinear polynomial is based on the inverse analysis of the Beer-Lambert exponential absorption law. The standard photon energy decay model is expressed as... (in (Absorption coefficient). In the inversion solution depth In theory, logarithmic operations need to be performed. However, directly executing logarithmic instruction sets in embedded hardware or computing acceleration chipsets incurs high clock cycle overhead. This invention truncates the logarithmic inversion model at the zero-degradation point using a higher-order Taylor series / Maclaurin series expansion. The first-order term after expansion corresponds to the shallow decay dominated by linear absorption (…). The second-order term corresponds to multiple internal light ejection compensations ( The third-order term corrects for the energy dispersion of scattering in deep complex bodies. This method of converting transcendental functions into algebraic polynomials not only preserves the high-precision mapping relationship of the physical optics model, but also reduces the computational complexity of the underlying hardware from complex floating-point coprocessor calculations to a multiply-accumulate instruction set (MAC) based on multiply-accumulate, thereby improving the real-time throughput of the detection system.

[0108] The aforementioned combination of physical mapping fitting coefficients is pre-obtained and solidified through the following objective calibration procedure: physical energy attenuation sampling and calculation are performed on metal calibration defect test blocks of the same material with a series of known micrometer to millimeter-level standard depth steps to generate a measured dataset, and the dataset is extracted by surface regression fitting using the multivariate nonlinear least squares method. The construction of this algebraic equation and its associated constants not only achieves a closed-loop conversion from a two-dimensional dimensionless optical energy signal vector to a three-dimensional solid space depth dimension, improving the accuracy of the inversion analysis process, but also optimizes the efficiency of the underlying chip hardware execution. It should be noted that the aforementioned combination of fitting coefficients ( , , The calibration values ​​of the weld surface to be inspected are strongly correlated with the specific metal material type (such as carbon structural steel, aluminum alloy or austenitic stainless steel). Before performing the actual inspection task, the system will dynamically call a set of specific calibration coefficient combinations that match the current metal material from the hardware register based on the pre-entered material property work order to participate in the algebraic solution.

[0109] Specifically, the relationship between the pre-entered material attribute work order and the specific calibration coefficient combination is a key-value precise retrieval and call relationship: the material attribute work order carries a digital identification code that represents the identity of the specific metal material category to be tested. The system uses the digital identification code as the addressing primary key (Key) and performs precise matching and table lookup in the underlying hash mapping lookup table configured in the system hardware, thereby uniquely matching and retrieving the specific calibration coefficient combination (Value) bound to the primary key.

[0110] The strongly correlated mapping relationship refers to the following: for different specific types of metallic materials (such as carbon structural steel, aluminum alloys, etc.), due to their inherent differences in internal microscopic lattice arrangement, intrinsic optical refractive index, and intrinsic physical properties of photon absorption cross-sections at different wavelengths, the proportion of energy dissipation caused by shallow linear optical absorption, multiple reflections at internal interfaces, and deep high-dimensional scattering during photon energy propagation within different materials (i.e.,... , , The corresponding weights are different for each type of metal. Therefore, each specific type of metal material objectively corresponds to a unique set of fitting coefficients that can accurately describe the physical law of its unique photon energy attenuation. , , ).

[0111] The determination of the strong correlation mapping binding relationship is specifically as follows: During the offline calibration stage of the equipment at the factory, artificial defect calibration test blocks containing a series of known standard geometric depth step size sequences from micrometers to millimeters are pre-processed using various known categories of metals consistent with the actual test material; under the same illumination environment, the physical energy attenuation of various material test blocks at different known defect depths is measured using an optical acquisition module to obtain a real scatter dataset; subsequently, using the measured physical energy attenuation values ​​as independent variable parameters and the corresponding known standard step depths as dependent variable parameters, the multivariate nonlinear least squares method is independently called to perform spatial three-dimensional surface regression fitting calculation for each specific category of metal material; the optimal mathematical fitting constant combination for each type of metal material is obtained through regression fitting solution. , , Finally, the specific metal material type's numerical identification code and the calculated coefficient combination are mapped and burned into the aforementioned mapping lookup table.

[0112] After the determination is completed, the processing unit performs data reassembly and encapsulation operations on the defect physical category identifier and the depth geometric parameters according to the data communication bus protocol format. It then generates the defect analysis conclusion containing the message content and pushes it over the network, completing the detection task process.

[0113] This application discloses an optical inspection system for weld defects based on multi-scale feature fusion, as shown in the attached figure. Figure 2 As shown, it includes a processing processor 10 and a storage medium 20 storing computer instructions 201. When the processing processor 10 runs the computer instructions 201, it is configured to execute the optical control process and data operation logic in the optical detection method for weld defects based on multi-scale feature fusion.

[0114] In terms of specific hardware architecture configuration, the processing processor 10 includes a central control processing chip, a computing acceleration processing chip array, or a field-programmable gate array (FPGA) integrated circuit component. The storage medium 20 includes a non-volatile static flash memory module, a dynamic random access synchronous memory module, and a persistent hard disk storage array device. The detection system is equipped with an industrial network communication interface protocol control card and an output isolation transformer drive module peripheral channel. The processing processor 10 acts as a scheduling hub, achieving high-bandwidth control signal interaction with the front-end optical emission module through a physical interface connection. It also synchronously achieves array data reception control with the high-definition image photosensitive array data interface built into the optical acquisition module.

[0115] After the detection system completes its initialization and power-on procedure, the arithmetic processor 10 loads the binary format computer instruction sequence 201 stored in the storage medium 20 into the random access memory buffer space via the parallel addressing data bus inside the system motherboard. Upon entering the working mode, the arithmetic processor 10 sequentially extracts the opcode instructions from the memory address space according to the system clock cycle, and assigns them to the internal arithmetic logic unit array for machine cycle decoding and timing triggering. Following the underlying compilation instruction flow, the detection system performs control actions in automated mode, implements multi-dimensional tensor feature reconstruction and extraction tasks, quantifies and evaluates the output surface scattering interference level index, controls the hardware to send specific wavelength and polarization control signals, captures multi-modal physical response tensor blocks, performs floating-point response excitation weighted allocation, calls the similarity calculation model and attenuation algebraic equation model for solution, and finally outputs a defect analysis conclusion message with defect physical category identifier and depth geometric parameters.

[0116] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. An optical detection method for weld defects based on multi-scale feature fusion, applied to a weld defect detection system, the detection method comprising: The optical emission module is controlled to emit an initial detection beam toward the surface of the weld to be inspected, and the optical acquisition module is controlled to acquire the initial optical response signal corresponding to the surface of the weld to be inspected. Multi-scale feature extraction is performed on the initial optical response signal to obtain initial multi-scale feature matrices corresponding to multiple different spatial resolution levels; The detection method is characterized in that it further includes: Roughness interference feature analysis is performed on the initial multi-scale feature matrix to determine the degree of surface scattering interference on the surface of the weld to be inspected. Based on the surface scattering interference level, an adaptive dynamic optical modulation strategy containing multiple modulation state parameters is generated. According to the dynamic optical modulation strategy, the optical emission module is controlled to sequentially emit multiple modulation beam sequences corresponding to the multiple modulation state parameters to the surface of the weld to be inspected, and the optical acquisition module is controlled to synchronously acquire multiple target optical response signals corresponding to the multiple modulation beam sequences. Multi-scale feature extraction is performed on the optical response signals of the multiple targets to obtain the target multi-scale feature matrix sequence corresponding to each target optical response signal; Based on the target multi-scale feature matrix sequence, a multi-scale feature fusion operation is performed to obtain the target fused feature distribution matrix, and the defect analysis conclusion corresponding to the surface of the weld to be inspected is output according to the target fused feature distribution matrix. The step of performing multi-scale feature extraction on the initial optical response signal to obtain initial multi-scale feature matrices corresponding to multiple different spatial resolution levels includes: The initial optical response signal is input into a feature extraction network structure containing multiple receptive field analysis nodes; Macroscopic scattering characteristic parameters corresponding to macroscopic rough morphology are extracted at each receptive field analysis node, and microscopic reflection characteristic parameters corresponding to microstructure grain boundary defects are extracted. The macroscopic scattering feature parameters and the microscopic reflection feature parameters are mapped to the initial multi-scale feature matrices corresponding to each spatial resolution level; Before extracting the macroscopic scattering characteristic parameters and the microscopic reflection characteristic parameters, the process also includes: Collect a priori distribution dataset of ripple frequency of normal welds under preset welding process parameters; A spatial frequency domain filter mask is constructed using the aforementioned ripple frequency prior distribution dataset; The initial optical response signal is subjected to a background periodic structured light and shadow filtering operation using the spatial frequency domain filter mask to suppress optical interference energy caused by regular fish scale pattern physical fluctuations; The adaptive generation of a dynamic optical modulation strategy comprising multiple modulation state parameters based on the surface scattering interference level includes: The surface scattering interference level is divided into multiple preset interference intensity ranges; For each interference intensity range, a set of detection spectral bands with corresponding penetration capabilities and a set of spatial modulation polarization angles are pre-allocated; Based on the interference intensity range of the surface scattering interference obtained from actual calculations, the corresponding set of detection spectral bands and the set of spatial modulation polarization angles are selected to form the dynamic optical modulation strategy containing multiple modulation state parameters.

2. The optical inspection method for weld defects based on multi-scale feature fusion as described in claim 1, characterized in that, The step of performing a multi-scale feature fusion operation based on the target multi-scale feature matrix sequence to obtain the target fused feature distribution matrix includes: Calculate the feature activation gain ratio of each target multi-scale feature matrix corresponding to the initial multi-scale feature matrix; Based on the aforementioned feature activation gain ratio, calculate the independent fusion weighting coefficients for each modulated beam sequence; The independent fusion weighting coefficients are used to perform a weighted summation calculation on all the target multi-scale feature matrices to generate the final target fusion feature distribution matrix.

3. The optical inspection method for weld defects based on multi-scale feature fusion as described in claim 2, characterized in that, The step of outputting defect analysis conclusions corresponding to the surface of the weld to be inspected based on the target fusion feature distribution matrix includes: The target fusion feature distribution matrix is ​​compared with a preset physical attribute database of weld defects for similarity. When the preset similarity conditions are met, the matching physical category identifier of the defect is extracted; Calculate the physical energy attenuation value contained within the target fusion feature distribution matrix, and use the physical energy attenuation value to map and calculate the depth geometric parameters of the corresponding defect; The physical category identifier of the defect and the depth geometric parameters are used together as the output of the defect analysis conclusion.

4. The optical inspection method for weld defects based on multi-scale feature fusion as described in claim 1, characterized in that, The step of performing roughness interference feature analysis on the initial multi-scale feature matrix to determine the surface scattering interference level of the weld surface to be inspected includes: Calculate the optical scattering gradient magnitude corresponding to each local region in the initial multi-scale feature matrix; Extract suspected interfering connected blocks whose optical scattering gradient magnitude is higher than a preset gradient threshold; Calculate the pixel variance fluctuation parameters within each suspected interfering connected block; The pixel variance fluctuation parameter is used as the degree of surface scattering interference on the surface of the weld to be inspected.

5. The optical inspection method for weld defects based on multi-scale feature fusion as described in claim 1, characterized in that, The step of controlling the optical emission module to sequentially emit a sequence of modulated beams corresponding to the multiple modulation state parameters onto the surface of the weld to be inspected, based on the dynamic optical modulation strategy, includes: The dynamic optical modulation strategy is analyzed to include multiple emission wavelength parameters and multiple polarization direction parameters. According to the set time interval sequence, drive waveform commands corresponding to each emission wavelength parameter are sent to the tunable laser component in the optical emission module, and angle rotation commands corresponding to each polarization direction parameter are sent to the polarization controller simultaneously. This drives the optical emission module to emit a sequence of modulated beams that simultaneously possess specific emission wavelength parameters and specific polarization direction parameters at various time interval nodes.

6. The optical inspection method for weld defects based on multi-scale feature fusion as described in claim 5, characterized in that, The control of the optical acquisition module to synchronously acquire multiple target optical response signals corresponding to the multiple modulated beam sequences includes: At the synchronized moment of sending the drive waveform command and the angle rotation command, an exposure trigger level is sent to the optical acquisition module; The optical acquisition module is controlled to acquire, at each time interval node, a high-dimensional spectral polarization response data matrix reflected back from the surface of the weld to be inspected under the target wavelength and target polarization state; All of the high-dimensional spectral polarization response data matrices are used as the optical response signals of the multiple targets.

7. An optical inspection system for weld defects based on multi-scale feature fusion, comprising a processor and a storage medium storing computer instructions, characterized in that, When the processing unit executes the computer instructions, it is configured to perform the optical control process and data processing logic in the optical detection method for weld defects based on multi-scale feature fusion as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Surface defect detection method and system based on curved surface coding and multi-view fusion

    CN121027154A

  • Optical surface defect data detection method based on deep learning

    CN121190433A