Real-time detection method for surface defects of seamless stainless steel pipe based on deep learning
Patent Information
- Application Number
- CN202611200630.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-10
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2046-08-10
AI Technical Summary
在光学检测中,利用不同波段的光谱特性可以增强不同缺陷的对比度,但现有方案往往仅使用单一或少数几个波段成像,未能充分挖掘连续多波段反射光谱中隐含的材料散射与镜面反射成分差异,导致内部微裂纹引起的次表面散射信号和表面划痕产生的直接反射信号在图像层面混叠,难以实现缺陷类型的准确区分
通过可调谐激光光谱扫描元件获取多波段反射频谱图像序列及对应的空间坐标相位信息,并依据相位梯度耦合关系生成钢管外表面三维形貌矩阵,在此基础上提取相邻波段间的频谱差分特征,将频谱差分特征与三维形貌矩阵进行空间同步叠加,生成包含缺陷边界轮廓与深度梯度的组合缺陷特征图。该组合特征图在保留光谱差异响应的同时嵌入了表面微观形貌的高度变化信息,边缘强度图与三维形貌高度值经乘积累加后,使缺陷边缘的对比度与局部深度梯度直接关联,缺陷边界与深度变化平缓区域的特征表达得到同步增强,避免单一光谱特征在弱对比区域出现的边界丢失。三维形貌信息与频谱差分特征的结合使得凹陷类缺陷的底部轮廓和隆起类缺陷的边缘转折处均能获得突出的响应,即使在钢管反光强烈、高光饱和区域,也能借助形貌高度差异在组合特征图中保持缺陷区域的完整性,提升后续深度学习网络对缺陷区域定位的稳定性和分割的连贯性。
Smart Images

Figure CN122689832B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of seamless steel pipe surface defect detection technology, specifically a method for real-time detection of surface defects in seamless stainless steel pipes based on deep learning. Background Technology
[0002] Seamless stainless steel pipes are widely used in petrochemical, nuclear power equipment, and aerospace fields, and their surface defects directly affect the service safety of components. Traditional steel pipe surface defect detection relies mainly on eddy current, magnetic flux leakage, or single-view two-dimensional vision methods. Eddy current and magnetic flux leakage detection are not sensitive to cracks parallel to the direction of magnetic field lines, while two-dimensional vision detection cannot obtain surface depth information, making it difficult to determine the actual geometric size of dents and bulges, and its detection rate for shallow defects such as rolling folds and small scratches is insufficient.
[0003] To compensate for the lack of depth dimension, some methods reconstruct the 3D contour using line structured light or phase-shifted fringe projection. However, these active triangulation methods suffer from occlusion and scanning blind spots under conditions of high-speed circumferential movement of the steel pipe, making it difficult to achieve synchronous registration with surface imaging. In optical inspection, the spectral characteristics of different bands can enhance the contrast of different defects. However, existing methods often only use single or a few bands for imaging, failing to fully explore the differences in material scattering and specular reflection components hidden in continuous multi-band reflection spectra. This results in the superposition of subsurface scattering signals caused by internal microcracks and direct reflection signals generated by surface scratches at the image level, making it difficult to accurately distinguish defect types. Some detection methods acquire multi-band images, but still use traditional image difference or simple spectral ratio calculations, failing to organically integrate surface morphology information with spectral difference features in space. This suppresses weak contrast areas and areas with gentle depth changes at defect boundaries in feature representation, limiting the accuracy of subsequent classification and segmentation.
[0004] Furthermore, existing deep learning defect detection methods are mostly based on a single information source, only inputting grayscale or color images. When faced with strong reflections and high-saturation areas on the surface of stainless steel pipes, they are prone to misjudging specular reflection artifacts as scratches, and lack effective means to identify microcracks hidden beneath the surface. Summary of the Invention
[0005] This invention provides a real-time detection method for surface defects of seamless stainless steel pipes based on deep learning. The aim is to generate a combined defect feature map that simultaneously contains the defect boundary contour and depth gradient by fusing multi-band reflection spectrum image sequences with spatial coordinate phase information under high-speed real-time detection conditions. Then, by using the principle of optical dispersion to selectively bandpass filter the combined features in the frequency domain, the scattering signal reflecting the internal microcracks of the material is effectively separated from the reflection signal reflecting the surface scratches. Combined with a multi-task neural network and adaptive threshold refinement, pixel-level accurate classification and segmentation of surface and near-surface defects of seamless stainless steel pipes is achieved, improving the ability to identify easily confused defects such as internal microcracks and surface scratches.
[0006] To achieve the above objectives, the present invention provides the following technical solution: The present invention provides a real-time detection method for surface defects of seamless stainless steel pipes based on deep learning, comprising: A tunable laser spectral scanning element moves along the axial direction of the steel pipe to collect a sequence of multi-band reflection spectrum images covering the entire circumference of the outer surface of the steel pipe and the corresponding spatial coordinate phase information. The multi-band reflection spectrum image sequence is reconstructed in three dimensions. Based on the phase gradient coupling relationship between the spatial coordinate phase information and the reflection light intensity attenuation gradient, a three-dimensional morphology matrix of the outer surface of the steel pipe containing radial concavity depth and axial bulge height is generated, thereby realizing non-contact accurate recovery of the micro-geometric deviations of the outer surface. The spectral difference features between adjacent bands in the multi-band reflection spectrum image sequence are extracted, and the spectral difference features are spatially and synchronously superimposed with the three-dimensional topography matrix of the outer surface of the steel pipe to generate a combined defect feature map that simultaneously contains defect boundary contour and depth gradient information, which significantly enhances the visualization contrast of weak defects. The combined defect feature map is subjected to frequency domain bandpass filtering based on the principle of optical dispersion to separate the scattering signal reflecting the microcracks inside the material and the reflection signal reflecting the surface scratches, generating a separated defect category component image, so that defects of different physical causes can be independently characterized. The separated defect category component images are input into a pre-trained deep learning multi-task neural network, which outputs a pixel-level defect region mask. The pixel-level defect region mask is subjected to two-dimensional adaptive threshold refinement processing to generate the final defect category identifier, thereby completing the accurate classification and location of defects while ensuring real-time performance.
[0007] As a preferred embodiment of the present invention, the tunable laser spectral scanning element spirals along the axial direction of the steel pipe with a preset fixed pitch, emits a continuously frequency-modulated laser beam at each scanning position, receives reflected light, and decomposes it into at least three narrow-band spectral components with different center wavelengths through a grating beam splitter. Each narrow-band spectral component corresponds to an independent imaging channel. Simultaneously, a synchronous trigger signal is used to record spatial coordinate phase information including axial displacement encoder readings and circumferential rotation encoder readings, thereby accurately associating each frame of the spectral image with the absolute position of the steel pipe. Preferably, the tunable laser spectral scanning element comprises multiple vertical cavity surface-emitting lasers arranged in a linear array, with equal emission frequency intervals between each vertical cavity surface-emitting laser, forming a continuous emission frequency band covering a predetermined spectral range, ensuring the spectral continuity and consistency of multi-band information.
[0008] In the process of three-dimensional topography reconstruction, the reflected light intensity attenuation gradient value at each pixel can be preferably converted into the surface normal deflection angle corresponding to that pixel. The surface normal deflection angle is inversely proportional to the reflected light intensity attenuation gradient value. Then, gradient integration is performed using the difference in surface normal deflection angle between adjacent pixels to reconstruct the three-dimensional topography height value of the region, thereby generating the three-dimensional topography matrix of the outer surface of the steel pipe, further improving the ability to distinguish between small depressions and bulges.
[0009] For the extraction of spectral difference features, the image of the Kth band in the multi-band reflectance spectrum image sequence can be subtracted pixel by pixel from the image of the (K+1)th band, and the subtraction result is processed to eliminate negative pixels caused by the difference in reflectance between bands, thus obtaining a lossless spectral difference image sequence, thereby highlighting the material's differentiated response to different spectra. Further, edge enhancement is performed on the lossless spectral difference image sequence. Horizontal edge gradients are extracted using a 5×5 kernel Sobel operator, and vertical edge gradients are extracted using a 5×5 kernel Sobel operator. The two are then combined to obtain an edge intensity map. The gray value of each pixel in the edge intensity map is multiplied by the corresponding shape height value in the three-dimensional shape matrix of the outer surface of the steel pipe, and then accumulated to the shape height value to generate the combined defect feature map. This simultaneously enhances the boundary contour and depth gradient of the defect, facilitating subsequent identification.
[0010] The frequency domain bandpass filtering processing based on the principle of optical dispersion can specifically include: performing a two-dimensional Fourier transform on the combined defect feature map to obtain a frequency domain amplitude spectrum and a frequency domain phase spectrum; setting a first bandpass filter and a second bandpass filter in the frequency domain amplitude spectrum, wherein the passband frequency of the first bandpass filter corresponds to the frequency band of the scattering signal generated by the internal microcrack, and the passband frequency of the second bandpass filter corresponds to the frequency band of the reflection signal generated by the surface scratch; performing dot multiplication operations on the frequency domain amplitude spectrum with the first bandpass filter and the second bandpass filter respectively to generate a first filtered amplitude spectrum and a second filtered amplitude spectrum, and then performing a two-dimensional inverse Fourier transform in combination with the frequency domain phase spectrum to obtain the microcrack component image corresponding to the scattering signal and the surface scratch component image corresponding to the reflection signal, thereby accurately separating the two types of defect features.
[0011] The deep learning multi-task neural network comprises a shared feature encoder, a defect classification branch, and a defect segmentation branch. The shared feature encoder uses a residual convolutional structure, consisting of multiple cascaded convolutional blocks. Each convolutional block contains a convolutional layer, a batch normalization layer, and a ReLU activation function. Max pooling layers are placed between adjacent convolutional blocks to progressively reduce the feature map resolution. The defect classification branch, as the first task output, includes a global average pooling layer and a fully connected layer, outputting the softmax probability distribution of various defects. The defect segmentation branch, as the second task output, includes a transposed convolutional upsampling path corresponding to the shared feature encoder. Skip connections are used to fuse the features from each layer of the encoder with the upsampling features, outputting a pixel-level defect region mask. This multi-task shared structure ensures segmentation accuracy while collaboratively completing classification, effectively reducing redundant computation and meeting real-time detection requirements.
[0012] In the two-dimensional adaptive threshold refinement process for pixel-level defect region masks, the mask is divided into multiple local sub-blocks of equal size. For each sub-block, the average and standard deviation of pixel confidence scores are calculated, and the product of the average score, standard deviation, and a preset coefficient is used as the local refinement threshold for that sub-block. Pixels within the sub-block with confidence scores below the refinement threshold are set as background, while pixels with confidence scores above or equal to the threshold are retained as defect regions, resulting in a refined binary defect mask. Connectivity analysis is performed on the refined binary defect mask to obtain the vertex coordinates of the minimum bounding rectangle of each connected component. The final defect category identifier is determined by combining the probability scores output from the defect classification branch. This refinement process can suppress isolated artifacts while preserving the true defect edges, improving the defect detection rate and the reliability of type identification.
[0013] The technical effects and advantages provided by the present invention in the above technical solution are as follows: A multi-band reflectance spectrum image sequence and corresponding spatial coordinate phase information are acquired using a tunable laser spectral scanning element. Based on the phase gradient coupling relationship, a three-dimensional topography matrix of the steel pipe's outer surface is generated. Spectral difference features between adjacent bands are extracted, and these features are spatially and synchronously superimposed with the three-dimensional topography matrix to generate a combined defect feature map containing the defect boundary contour and depth gradient. This combined feature map embeds the height variation information of the surface micro-topography while preserving the spectral difference response. After multiplication and summation of the edge intensity map and the three-dimensional topography height value, the contrast of the defect edge is directly correlated with the local depth gradient. The feature representation of the defect boundary and areas with gentle depth changes is synchronously enhanced, avoiding boundary loss that occurs in weak contrast areas with single spectral features. The combination of three-dimensional topography information and spectral difference features allows for prominent responses at the bottom contours of concave defects and the edge transitions of convex defects. Even in areas of strong reflection and high gloss saturation in the steel pipe, the integrity of the defect region can be maintained in the combined feature map by leveraging the height difference in topography, improving the stability and coherence of defect region localization and segmentation in subsequent deep learning networks.
[0014] The combined defect feature map is subjected to frequency domain bandpass filtering based on the principle of optical dispersion. A first bandpass filter corresponding to the scattering signal frequency band and a second bandpass filter corresponding to the reflection signal frequency band are set in the frequency domain amplitude spectrum. After dot multiplication, these filters are inverse Fourier transformed and combined with the frequency domain phase spectrum to generate the internal microcrack component image and the corresponding surface scratch component image of the material. This processing utilizes the specific low-frequency scattering distribution characteristics of subsurface scattering caused by internal microcracks in the frequency domain, while the specular reflection signal generated by surface scratches exhibits a relatively concentrated high-frequency directional component in the frequency domain. Separating these two components through independent bandpass channels effectively eliminates signal aliasing at the image level. The separated defect category component images retain the typical spectral features of their respective defect types. After being input into a deep learning multi-task neural network, the network can establish more discriminative feature codes for different component images. The category recognition ability of the defect classification branch is enhanced, and the defect segmentation branch more accurately depicts the diffusion range of internal microcracks and the direction of surface scratches in the pixel-level mask. This significantly reduces misjudgments caused by specular reflection artifacts and improves the detection rate of microcracks hidden under the epidermis. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0016] Figure 1This is a flowchart of a method for real-time detection of surface defects in seamless stainless steel pipes; Figure 2 This is a flowchart of the three-dimensional morphology reconstruction of the surface of a seamless steel pipe based on the attenuation gradient of reflected light intensity; Figure 3 This is a schematic diagram of local adaptive threshold refinement of pixel-level defect area mask. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] See Figure 1 This invention provides a real-time detection method for surface defects of seamless stainless steel pipes based on deep learning, comprising: By moving a tunable laser spectral scanning element along the axial direction of the steel pipe, a multi-band reflection spectrum image sequence covering the entire circumference of the outer surface of the steel pipe and the corresponding spatial coordinate phase information are acquired. The multi-band reflection spectrum image sequence is subjected to three-dimensional topography reconstruction processing. Based on the phase gradient coupling relationship between the spatial coordinate phase information and the reflected light intensity attenuation gradient, a three-dimensional topography matrix of the outer surface of the steel pipe containing radial concavity depth and axial bulge height is generated. Extract the spectral difference features between adjacent bands in the multi-band reflection spectrum image sequence, and spatially overlay the spectral difference features with the three-dimensional topography matrix of the outer surface of the steel pipe to generate a combined defect feature map containing defect boundary contours and depth gradients. The combined defect feature map is subjected to frequency domain bandpass filtering based on the principle of optical dispersion to separate the scattering signal reflecting the microcracks inside the material and the reflection signal reflecting the surface scratches, and generate the separated defect category component image. The separated defect category component images are input into a pre-trained deep learning multi-task neural network, which outputs a pixel-level defect region mask. The pixel-level defect region mask is subjected to two-dimensional adaptive threshold refinement processing to generate the final defect category identifier.
[0019] Example 1 In a specific implementation, the tunable laser spectral scanning element comprises multiple vertical-cavity surface-emitting lasers (VCSELs) arranged in a linear array. Each VCSEL corresponds to an independent emission frequency, and the emission frequency interval between adjacent VCSELs is set to an equal value, so that the emission frequencies of all VCSELs together constitute a continuous emission frequency band, which covers a predetermined spectral range. The number of VCSELs in the linear array is determined by the width of the predetermined spectral range and the frequency interval between adjacent VCSELs.
[0020] The tunable laser spectral scanning element moves spirally along the axial direction of the seamless steel tube at a preset fixed pitch. The fixed pitch is calculated based on the outer diameter circumference of the seamless steel tube and the circumferential field of view of the tunable laser spectral scanning element to ensure that after one revolution along the spiral path, the acquisition area covers the seamless steel tube along the axial direction with a predetermined overlap, achieving gapless scanning of the outer surface of the seamless steel tube in the entire circumference. At each scanning position, the linear array vertical cavity surface-emitting lasers in the tunable laser spectral scanning element synchronously emit continuously frequency-modulated laser beams. Each vertical cavity surface-emitting laser is frequency-modulated at the time of emission, and the modulation method is linear scanning frequency modulation within a predetermined bandwidth near its own independent emission frequency. The frequency modulation period is synchronized with the trigger period of the scanning position switching. After the continuously frequency-modulated laser beam irradiates the outer surface of the seamless steel tube, it is reflected, and the receiving optical system in the tunable laser spectral scanning element collects the reflected light.
[0021] The receiving optical system guides the collected reflected light to a grating beam splitter. The grating beam splitter performs spatial dispersion on the received reflected light, decomposing it into three narrowband spectral components with different center wavelengths. These three narrowband spectral components are then fed into three independent imaging channels. Each imaging channel contains a planar array imaging sensor, which, under the control of a synchronous trigger signal, exposes and images the corresponding narrowband spectral component, generating a single frame of narrowband spectral image. At a single scanning position, the three imaging channels are simultaneously exposed, and the resulting three frames of narrowband spectral images constitute a multi-band reflectance spectrum image set.
[0022] At the same moment the area array imaging sensor is exposed and imaging, a synchronous trigger signal drives the axial displacement encoder and the circumferential rotary encoder to latch the readings. The axial displacement encoder outputs the absolute position value of the tunable laser spectral scanning element along the axial direction of the seamless steel pipe, which is used as the axial displacement encoder reading; the circumferential rotary encoder outputs the absolute angle value of the tunable laser spectral scanning element around the circumference of the seamless steel pipe, which is used as the circumferential rotary encoder reading. The axial displacement encoder reading and the circumferential rotary encoder reading together constitute the spatial coordinate phase information corresponding to the multi-band reflection spectrum image group. As the tunable laser spectral scanning element spirals along the axial direction of the seamless steel pipe, it repeatedly performs the operations of continuously frequency modulated laser beam emission, reflected light reception and splitting, multi-channel imaging, and spatial coordinate phase information recording at each scanning position, sequentially acquiring multiple sets of multi-band reflection spectrum image groups covering the entire circumference of the outer surface of the seamless steel pipe and the corresponding spatial coordinate phase information. All multi-band reflection spectrum image groups are arranged in the acquisition order to form a multi-band reflection spectrum image sequence.
[0023] Example 2 In specific implementation, please refer to Figure 2 The attenuation gradient value of reflected light intensity is obtained from each pixel position in the multi-band reflectance spectrum image sequence. The attenuation gradient value is obtained by calculating the rate of change of reflected light intensity along the axis of the seamless steel pipe at the same pixel position between two consecutive scan positions. The reflected light intensity is determined by the weighted sum of the gray values of each band in the multi-band reflectance spectrum image sequence, and the weighting coefficient is proportional to the reciprocal of the center wavelength of each band.
[0024] Phase gradient coupling refers to the inherent physical coupling between the spatial coordinate phase information of each pixel on the outer surface of a steel pipe and the attenuation gradient of reflected light intensity during tunable laser spectral scanning. The physical basis of this coupling lies in the fact that the microscopic geometry of the steel pipe's outer surface simultaneously affects two physical quantities: the axial displacement encoder reading and the circumferential rotary encoder reading in the spatial coordinate phase information record the relative spatial position of the scanning element and the steel pipe surface, and this positional information has a spatial correspondence with the geometric undulations of the surface morphology; the attenuation gradient of reflected light intensity reflects the change in the surface normal direction. When the scanning laser beam irradiates a concave or convex area, the surface normal deflection causes a gradient change in the reflected light intensity along the scanning direction. The mathematical model of phase gradient coupling is defined as follows: for any pixel on the outer surface of the steel pipe... The axial position in its spatial coordinate phase information and circumferential angle With the attenuation gradient of reflected light intensity The following coupling relationship exists between them: ; in, This indicates the surface normal deflection angle corresponding to that pixel; For the coupling mapping function, its specific operation rules are as follows: First, according to and Determine the absolute spatial position of the pixel on the outer surface of the steel pipe; then, using this position as the center, calculate the rate of change of reflected light intensity along both the axial and circumferential directions within a preset neighborhood to obtain the attenuation gradient of reflected light intensity. Finally, Substituting into the inverse proportional relationship completes the conversion from the attenuation gradient of reflected light intensity to the surface normal deflection angle.
[0025] After obtaining the reflected light intensity attenuation gradient value for each pixel, this gradient value is converted into the corresponding surface normal deflection angle for that pixel. The conversion of the surface normal deflection angle is based on the following inverse proportional formula: ; in, Represents image coordinates The surface normal deflection angle of a pixel, in radians; Represents image coordinates The attenuation gradient value of reflected light intensity at a given pixel, expressed in grayscale values per millimeter; To prevent division by zero constant, Values ; This is the angle conversion scaling factor. The range of values is rad·(grayscale value per millimeter) to rad (grayscale value per millimeter), The calibration method is as follows: A standard planar reflector is placed at a test position at a known tilt angle, using the same material as the seamless steel pipe. The attenuation gradient value of the reflected light intensity of the standard planar reflector is measured. A linear fit is then performed between the known tilt angle and the measured attenuation gradient value, and the reciprocal of the fit slope is taken as the calibrated value. The value.
[0026] After obtaining the surface normal deflection angles of all pixels, the difference in surface normal deflection angles between adjacent pixels is extracted. The calculation method for the difference in surface normal deflection angles between adjacent pixels is as follows: for image coordinates... For each pixel, calculate the values of that pixel and its horizontally adjacent pixels. The surface normal deflection angle difference, and the pixel value adjacent to the vertical direction. The difference in surface normal deflection angle. The horizontal component of the difference in surface normal deflection angle is denoted as... The vertical component of the surface normal deflection angle difference is denoted as... .
[0027] The 3D topographic height is reconstructed using the difference in surface normal deflection angles between adjacent pixels through gradient integration. The gradient integration path begins at a pre-selected reference point in the image, which is the center pixel of a defect-free area on the outer surface of the seamless steel pipe. The initial topographic height value of this reference point is set to zero. Starting from the reference point, the process is repeated pixel-by-pixel along the horizontal and vertical directions of the image. The recursive method is to add the topographic height value of the current pixel to the product of the surface normal deflection angle difference component and the pixel physical distance, thus obtaining the topographic height values of adjacent pixels. The pixel physical distance is determined by the pixel size of the area array imaging sensor in the imaging channel and the magnification of the imaging optical system.
[0028] After performing gradient integration on all pixels, the topography height value of each pixel on the outer surface of the steel pipe is obtained. The topography height values of each pixel are arranged according to image coordinates, where positive values represent convexities on the outer surface of the seamless steel pipe, corresponding to axial bulge height, and negative values represent concaveities on the outer surface of the seamless steel pipe, corresponding to radial concavity depth. The topography height values of all pixels together constitute the three-dimensional topography matrix of the outer surface of the steel pipe.
[0029] Example 3 In practice, a multi-band reflection spectrum image sequence is acquired. The multi-band reflection spectrum image sequence contains M bands, where M is an integer greater than or equal to 3. Each band corresponds to a frame of two-dimensional grayscale image, and each frame of two-dimensional grayscale image has H rows and W columns of pixels.
[0030] For the band number K, where K is an integer from 1 to M-1, the image of the Kth band in the multi-band reflectance spectrum image sequence is denoted as... The image of the (K+1)th band is denoted as .right and Perform pixel-by-pixel subtraction. The subtraction operation is performed as follows: for image coordinates... The pixel at that location, take exist Subtract the pixel grayscale value at that location exist The difference value is obtained from the pixel grayscale value at that location. After performing the pixel-by-pixel subtraction operation on all pixel coordinates, a spectral difference image is generated. Perform pixel-by-pixel subtraction operations on K from 1 to M-1, generating a total of M-1 frames of spectral difference images, forming a set of spectral difference images.
[0031] Spectral difference image Each frame of the spectral difference image undergoes absolute grayscale value conversion. The method for absolute grayscale value conversion is as follows: for the spectral difference image... median coordinate pixel grayscale value at ,Pick The absolute value is used to obtain the absolute value grayscale value. For spectral difference images After performing absolute grayscale value conversion on all pixels, a lossless spectral difference image is generated. The absolute value conversion of image grayscale values is performed sequentially on K from 1 to M-1, generating a total of M-1 frames of lossless spectral difference images, which constitute a lossless spectral difference image sequence.
[0032] For each frame of the lossless spectral difference image sequence Edge enhancement processing is performed. The edge enhancement process uses the transverse Sobel operator to extract a lossless spectral difference image. The horizontal edge gradient. The kernel size of the transverse Sobel operator is 5×5, and the kernel matrix of the transverse Sobel operator... The matrix is a 5x5 two-dimensional matrix. The values of each element are weighted according to the horizontal center difference: the elements in the center row are zero, the elements in the two rows above are positive, and the elements in the two rows below are negative. The value range decreases as the distance from the center column increases. This is the kernel matrix of the horizontal Sobel operator. With lossless spectral difference image Perform a 2D convolution operation with a stride of 1 pixel and mirror padding of 2 pixels to obtain the horizontal edge gradient map. .
[0033] Edge enhancement processing is performed simultaneously with the extraction of lossless spectral difference images using the longitudinal Sobel operator. The vertical edge gradient. The kernel size of the longitudinal Sobel operator is also 5×5, and the kernel matrix of the longitudinal Sobel operator... The kernel matrix is a 5x5 two-dimensional matrix. The values of the elements are weighted according to the vertical central difference: the elements in the central column are zero, the elements in the left two columns are positive, and the elements in the right two columns are negative. The magnitude of the values decreases as the distance from the central row increases. This is the kernel matrix of the vertical Sobel operator. The kernel matrix of the transverse Sobel operator The kernel matrix of the vertical Sobel operator is obtained by transposing it. With lossless spectral difference image Perform a 2D convolution operation with a stride of 1 pixel and mirror padding of 2 pixels to obtain the vertical edge gradient map. .
[0034] Horizontal edge gradient map and vertical edge gradient map Perform amplitude composition calculation. The amplitude composition calculation method is as follows: for coordinates... Calculate the horizontal edge gradient value at the pixel location. The square of the edge gradient value in the vertical direction The edge strength value is obtained by taking the square root of the sum of the squares of the two sides. Edge strength value The calculation formula is: ; in, Represents lossless spectral difference image In coordinates Edge strength value at the location, Represents the horizontal edge gradient map In coordinates gradient value at, Represents the vertical edge gradient map In coordinates gradient value at, The value range is 1 to integers, For lossless spectral difference images The number of pixel rows, The value range is 1 to integers, For lossless spectral difference images The number of pixel columns. After performing amplitude synthesis operation on all pixel coordinates, an edge intensity map is generated. Edge enhancement processing is performed sequentially on K from 1 to M-1, generating a total of M-1 frames of edge intensity maps.
[0035] Obtain the three-dimensional topography matrix of the outer surface of the steel pipe. The three-dimensional topography matrix of the outer surface of the steel pipe is a... OK A two-dimensional matrix of columns, denoted as ,in Representing coordinates The topography height value corresponding to the pixel.
[0036] edge intensity map Superimposed on the three-dimensional topography matrix of the outer surface of the steel pipe The corresponding axial position is determined by the lossless spectral difference image. Image from the Kth band and the image of the (K+1)th band The spectral difference was calculated to obtain, and The corresponding axial positions are the same scanning positions, and the three-dimensional topography matrix of the outer surface of the steel pipe is shown. Zhongyu and The range of pixel rows with the same axial position is the corresponding axial position. The overlay operation is performed as follows: for each coordinate within the range of the corresponding axial position... Edge intensity map median coordinate Edge strength value at Multiply by the three-dimensional topography matrix of the outer surface of the steel pipe median coordinate Topographic height value To obtain the product value Then multiply the product value Accumulated to topographic height value Above, the updated topographic height value The above overlay operation is performed sequentially on the edge intensity map of frame M-1. The updated three-dimensional topography matrix of the outer surface of the steel pipe obtained after overlay is the combined defect feature map.
[0037] Example 4 In practical implementation, a combined defect feature map is obtained. The combined defect feature map is a map with a size of... OK A two-dimensional matrix of columns, denoted as ,in This represents the total number of rows in the combined defect feature map. This represents the total number of columns in the combined defect feature map. The first character in the combined defect feature diagram represents the... Line 1 The grayscale value of the column pixels, The range of values is to integers, The range of values is to Integers.
[0038] Feature map of combined defects A two-dimensional Fourier transform is performed. The two-dimensional Fourier transform is implemented using a two-dimensional discrete Fourier transform algorithm. The combined defect feature map is then analyzed. All After performing a two-dimensional discrete Fourier transform on each pixel, a pixel of size is obtained. OK The frequency domain complex matrix of the column is denoted as Frequency domain complex matrix Each element in the matrix is a complex number, and the matrix is a complex number matrix in the frequency domain. The Middle Line 1 The elements of a column are denoted as , The range of values is to integers, The range of values is to integers, Represents the row index in the frequency domain space. Represents the column index in the frequency domain space.
[0039] From frequency domain complex matrices The frequency domain amplitude spectrum and frequency domain phase spectrum are extracted. The frequency domain amplitude spectrum is denoted as... Frequency domain amplitude spectrum The Middle Line 1 Column amplitude By calculating the complex matrix in the frequency domain Corresponding element The modulus is obtained, and the calculation method is as follows: The frequency domain phase spectrum is denoted as... Frequency domain phase spectrum The Middle Line 1 Phase value of the column By calculating the complex matrix in the frequency domain Corresponding element The argument is obtained by calculating the following method: ,in Representing complex numbers The real part, Representing complex numbers The imaginary part.
[0040] amplitude spectrum in the frequency domain At least two different bandpass filters are set in the configuration. The first bandpass filter is denoted as... First bandpass filter The passband frequency range is set to First bandpass filter lower limit of passband frequency range Values First bandpass filter Upper limit of passband frequency range Values ,in Represents the frequency domain amplitude spectrum Normalized sampling frequency, The value is First bandpass filter The passband frequency range is set based on the following: the scattering effect of microcracks inside the material on the incident laser causes the scattered signal to be concentrated in the low-frequency band in the frequency domain. This is achieved by analyzing the amplitude spectrum of the scattered signal in the frequency domain. The energy distribution in the sample determines that the scattered signal energy is concentrated at the normalized frequency. to Within the range, therefore the first bandpass filter The passband frequency range is set to The physical cause of the low-frequency distribution characteristics of the scattered signal lies in the fact that microcracks on the surface of seamless stainless steel tubes typically exhibit narrow opening defects with widths on the order of micrometers and extending in the depth direction. When an incident laser beam irradiates the microcrack region, because the crack opening size is on the same order of magnitude as the incident light wavelength, part of the incident light undergoes diffraction at the crack opening edge, generating diffracted light that propagates into the crack interior and the subsurface region of the surrounding material. During propagation, the diffracted light undergoes multiple scatterings with the crack inner wall and surrounding grain boundaries. Each scattering causes a random deflection of the light wave's propagation direction, while simultaneously introducing random phase delays due to differences in optical path length. The superposition effect of multiple random scattering processes results in a diffusely distributed intensity signal in the spatial domain, lacking obvious directionality. After conversion to the frequency domain by a two-dimensional Fourier transform, this diffuse distribution corresponds to a spectral energy distribution concentrated in the low-frequency region. Furthermore, the absorption of incident light by the material inside and around the microcrack further weakens the contribution of high-frequency components, resulting in a significant low-pass filtering characteristic in the frequency domain energy distribution of the scattered signal. Based on the above physical mechanism, in this embodiment, the lower and upper limits of the passband frequency of the first bandpass filter are set to normalized frequencies of 0.025 and 0.075, respectively. This frequency band covers the main energy concentration area of the microcrack scattering signal, which can effectively extract the microcrack characteristic signal while suppressing the interference of surface reflection signal and system noise to the greatest extent.
[0041] The second bandpass filter is denoted as Second bandpass filter The passband frequency range is set to Second bandpass filter lower limit of passband frequency range Values Second bandpass filter Upper limit of passband frequency range Values Second bandpass filter The passband frequency range is set based on the following: the specular reflection of the incident laser by the surface scratches causes the reflected signal to be concentrated in the mid-to-high frequency band in the frequency domain. This is achieved by analyzing the amplitude spectrum of the reflected signal in the frequency domain. The energy distribution in the signal determines that the reflected signal energy is concentrated at the normalized frequency. to Within the range, therefore the second bandpass filter The passband frequency range is set to .
[0042] First bandpass filter Second bandpass filter All are two-dimensional frequency domain filter matrices of the same size, with dimensions of [missing information]. OK Column. First bandpass filter. The Middle Line 1 Column element values The rule for determining the value is: when the frequency domain amplitude spectrum median coordinate The corresponding frequency value falls within the passband frequency range. hour, Values When the frequency domain amplitude spectrum median coordinate The corresponding frequency value does not fall within the passband frequency range. hour, Values Second bandpass filter The Middle Line 1 Column element values The rule for determining the value is: when the frequency domain amplitude spectrum median coordinate The corresponding frequency value falls within the passband frequency range. hour, Values When the frequency domain amplitude spectrum median coordinate The corresponding frequency value does not fall within the passband frequency range. hour, Values Frequency domain amplitude spectrum median coordinate Corresponding frequency value The calculation formula is: ; in, Represents the frequency domain amplitude spectrum median coordinate Normalized frequency values at that point Represents the row index in the frequency domain space. Represents the column index in the frequency domain space. Represents the frequency domain amplitude spectrum Total number of rows Represents the frequency domain amplitude spectrum The total number of columns.
[0043] frequency domain amplitude spectrum With the first bandpass filter Perform a dot product operation. The dot product operation is performed as follows: for coordinates... frequency domain amplitude spectrum amplitude in With the first bandpass filter The corresponding element value in Multiplying them together yields the first filtered amplitude spectrum. median coordinate amplitude at After performing a dot product operation on all coordinates, the first filtered amplitude spectrum is generated. .
[0044] frequency domain amplitude spectrum With the second bandpass filter Perform a dot product operation. The dot product operation is performed as follows: for coordinates... frequency domain amplitude spectrum amplitude in With the second bandpass filter The corresponding element value in Multiplying them together yields the second filtered amplitude spectrum. median coordinate amplitude at After performing a dot product operation on all coordinates, a second filtered amplitude spectrum is generated. .
[0045] For the first filtered amplitude spectrum Perform a two-dimensional inverse Fourier transform. The implementation of the two-dimensional inverse Fourier transform uses the two-dimensional discrete inverse Fourier transform algorithm. During the two-dimensional inverse Fourier transform, the first filtered amplitude spectrum... As the amplitude input for the inverse transform, the frequency domain phase spectrum is used. As the phase input for the inverse transform, the first filtered amplitude spectrum is used. With frequency domain phase spectrum To combine them, the combination method is as follows: for coordinates Constructing complex numbers ,in Represents the imaginary unit. Represents the natural constant. Represents the frequency domain phase spectrum median coordinate The phase value at that point. After constructing complex numbers over all coordinates, the first filter frequency domain complex matrix is obtained. For the first filter frequency domain complex matrix Performing a two-dimensional discrete inverse Fourier transform yields a value of size . OK The column is a real matrix, which is the microcrack component image of the corresponding scattering signal.
[0046] For the second filter amplitude spectrum Perform a two-dimensional inverse Fourier transform. During the two-dimensional inverse Fourier transform, the second filtered amplitude spectrum... As the amplitude input for the inverse transform, the frequency domain phase spectrum is used. As the phase input for the inverse transform, the second filtered amplitude spectrum is used. With frequency domain phase spectrum To combine them, the combination method is as follows: for coordinates Constructing complex numbers After constructing complex numbers for all coordinates, the second filtered frequency domain complex matrix is obtained. For the second filter frequency domain complex matrix Performing a two-dimensional discrete inverse Fourier transform yields a value of size . OK The column is a real matrix, which is the surface scratch component image of the corresponding reflected signal.
[0047] The microcrack component image and the surface scratch component image together constitute the separated defect category component image.
[0048] Example 5 In practice, deep learning multi-task neural networks include a shared feature encoder, a defect classification branch, and a defect segmentation branch.
[0049] The shared feature encoder employs a residual convolution structure. The input to the shared feature encoder is the separated defect category component image, with a resolution of [resolution missing]. pixels, the number of channels in the input image is , The value is determined by the number of separated defect category component images; when the separated defect category component images contain two single-channel images, a microcrack component image and a surface scratch component image... The value is 2. The shared feature encoder contains a first convolutional block, a first max pooling layer, a second convolutional block, a second max pooling layer, a third convolutional block, a third max pooling layer, a fourth convolutional block, and a fourth max pooling layer, which are cascaded in sequence.
[0050] The first convolutional block contains the first convolutional layer, the first batch of normalized layers, and the first ReLU activation function. The number of input channels in the first convolutional layer is... The first convolutional layer has 64 output channels, a 7×7 kernel size, a stride of 2, and a padding width of 3. The first batch of normalization layers performs channel-by-channel batch normalization on the feature maps output by the first convolutional layer. The batch size is set to 16 during the training phase of the deep learning multi-task neural network. The first ReLU activation function performs a non-linear mapping on each element in the feature map output by the first batch of normalization layers; the output is equal to the input value when the input value is greater than zero, and zero when the input value is less than or equal to zero. The first max-pooling layer has a 3×3 kernel size, a stride of 2, and a padding width of 1.
[0051] The second convolutional block contains a second convolutional layer, a second batch normalization layer, and a second ReLU activation function. The input to the second convolutional block is the output feature map of the first max-pooling layer. The second convolutional layer has 64 input channels, 128 output channels, a 3×3 kernel size, a stride of 1, and a padding width of 1. The second batch normalization layer performs channel-by-channel batch normalization on the 128 channels of the feature map output from the second convolutional layer. The second ReLU activation function performs a non-linear mapping on the feature map output from the second batch normalization layer. The second max-pooling layer has a 3×3 kernel size, a stride of 2, and a padding width of 1.
[0052] The third convolutional block contains a third convolutional layer, a third batch normalization layer, and a third ReLU activation function. The input to the third convolutional block is the output feature map of the second max-pooling layer. The third convolutional layer has 128 input channels, 256 output channels, a 3×3 kernel size, a stride of 1, and a padding width of 1. The third batch normalization layer performs channel-by-channel batch normalization on the 256 channels of the feature map output from the third convolutional layer. The third ReLU activation function performs a non-linear mapping on the feature map output from the third batch normalization layer. The third max-pooling layer has a 3×3 kernel size, a stride of 2, and a padding width of 1.
[0053] The fourth convolutional block contains a fourth convolutional layer, a fourth batch normalization layer, and a fourth ReLU activation function. The input to the fourth convolutional block is the output feature map of the third max-pooling layer. The fourth convolutional layer has 256 input channels, 512 output channels, a 3×3 kernel size, a stride of 1, and a padding width of 1. The fourth batch normalization layer performs channel-by-channel batch normalization on the 512 channels of the feature map output from the fourth convolutional layer. The fourth ReLU activation function performs a non-linear mapping on the feature map output from the fourth batch normalization layer. The fourth max-pooling layer has a 3×3 kernel size, a stride of 2, and a padding width of 1.
[0054] The defect classification branch serves as the output branch of the first task in the deep learning multi-task neural network. The input to the defect classification branch is the output feature map of the fourth max-pooling layer in the shared feature encoder. The defect classification branch contains a global average pooling layer and a fully connected layer. The global average pooling layer averages the value of all pixels in each channel of the feature map output by the fourth max-pooling layer, thus converting a... The feature map group is transformed into a 512-dimensional feature vector, where This indicates the number of pixel rows in the output feature map of the fourth max pooling layer. This represents the number of pixel columns in the output feature map of the fourth max-pooling layer. The input dimension of the fully connected layer is 512, and the output dimension of the fully connected layer is... , This indicates the total number of preset defect categories. The value is 4, and the four defect categories are microcracks, surface scratches, pits, and no defects. The output of the fully connected layer... After the dimensional vector is processed by the softmax function, the softmax probability distribution of the defect category is obtained. The softmax probability distribution contains the probability score of each category.
[0055] The defect segmentation branch serves as the output branch of the second task in the deep learning multi-task neural network. The input to the defect segmentation branch is the output feature map of the fourth max-pooling layer in the shared feature encoder. The defect segmentation branch contains a transposed convolutional upsampling path corresponding to the shared feature encoder. This transposed convolutional upsampling path consists of a first transposed convolutional layer, a first skip connection fusion layer, a second transposed convolutional layer, a second skip connection fusion layer, a third transposed convolutional layer, a third skip connection fusion layer, and a segmentation output convolutional layer, all cascaded sequentially.
[0056] The first transposed convolutional layer has 512 input channels, 256 output channels, a 4×4 kernel size, a stride of 2, and a padding width of 1. The first skip connection fusion layer concatenates the feature map output from the first transposed convolutional layer with the feature map output from the third convolutional block of the shared feature encoder along the channel dimension, resulting in a concatenated feature map with 512 channels. The second transposed convolutional layer has 512 input channels, 128 output channels, a 4×4 kernel size, a stride of 2, and a padding width of 1. The second skip connection fusion layer concatenates the feature map output from the second transposed convolutional layer with the feature map output from the second convolutional block of the shared feature encoder along the channel dimension, resulting in a concatenated feature map with 256 channels. The third transposed convolutional layer has 256 input channels, 64 output channels, a 4×4 kernel size, a stride of 2, and a padding width of 1. The third skip connection fusion layer concatenates the feature map output from the third transposed convolutional layer with the feature map output from the first convolutional block in the shared feature encoder along the channel dimension, resulting in a concatenated feature map with 128 channels. The segmented output convolutional layer has 128 input channels, 1 output channel, a 1×1 kernel size, and a stride of 1. A sigmoid activation function is applied after the segmented output convolutional layer, mapping each pixel value output by the segmented output convolutional layer to the 0-1 range, thus obtaining a pixel-level defect region mask.
[0057] The training process of the deep learning multi-task neural network is completed before the detection is performed. Training samples consist of separated defect category component images containing known defect categories and masks of known defect regions. The training loss function is a weighted sum of classification and segmentation loss terms. The classification loss term is the cross-entropy loss, and the segmentation loss term is the binary cross-entropy loss. The weight coefficient for the classification loss term is 0.3, and the weight coefficient for the segmentation loss term is 0.7. The optimizer uses the Adam optimizer, with an initial learning rate set to... The training rounds are set to 200 rounds.
[0058] After training the deep learning multi-task neural network, the separated defect category component images are input into the deep learning multi-task neural network. The defect segmentation branch outputs a pixel-level defect region mask. The value of each pixel in the pixel-level defect region mask is a confidence level between 0 and 1, representing the probability that the pixel belongs to the defect region.
[0059] A two-dimensional adaptive threshold refinement process is applied to the pixel-level defect region mask. The pixel-level defect region mask is divided into multiple local sub-blocks of equal size, each sub-block having a size of [missing information]. Pixels The value is 32. For sub-blocks located at the edge of the mask in pixel-level defect regions after division, when the sub-block size is insufficient... When the pixel is insufficient, a mirror fill method is used to expand it to the required size. Pixel.
[0060] For each local sub-block, calculate the mean and standard deviation of the confidence scores for all pixels within that sub-block. For the... There are 3 local sub-blocks, and the average confidence score of all pixels within each local sub-block is denoted as . The standard deviation of the confidence scores of all pixels within a local sub-block is denoted as . .average value The calculation method is to calculate the local sub-block. Sum the confidence scores of each pixel and then divide by . Standard deviation The calculation method is to calculate the confidence score and average value of each pixel within the local sub-block. Sum the squares of the differences and divide by Then take the square root.
[0061] Calculate the first Local refinement threshold for each local sub-block Local refinement threshold The calculation formula is: ; in, Indicates the first Local refinement threshold for each local sub-block; Indicates the first The average confidence level of all pixels within a local sub-block; Indicates the first The standard deviation of the confidence scores of all pixels within a local sub-block; This represents the first preset coefficient. The value is 0.8. First preset coefficient. The value of 0.8 is based on the following: After the deep learning multi-task neural network is trained, the validation set samples are used to evaluate the first preset coefficient. The test was performed within the range of 0.5 to 1.5 with a step size of 0.1. During the test, the F1 score of the defect segmentation was used as the evaluation metric, and the metric that maximized the F1 score was selected. The value is taken as the first preset coefficient. The final setting value was determined after traversal testing. The F1 score is highest when the value is 0.8.
[0062] The first Confidence level and local refinement threshold of each pixel within a local sub-block Comparison is performed. When the confidence level of a pixel is less than the local refinement threshold... When the confidence level of a pixel is greater than or equal to the local refinement threshold, the confidence level of that pixel is set to 0 and it is marked as background. When the confidence level of a pixel is set to 1, it is marked as a defect region. After performing comparison operations on all local sub-blocks, a refined binary defect mask is obtained.
[0063] Connectivity analysis is performed on the refined binary defect mask. The eight-adjacent connected component labeling algorithm is used for this analysis. It iterates through all pixels in the refined binary defect mask, grouping adjacent pixels with a value of 1 into the same connected component. After this process, the set of all connected components contained in the refined binary defect mask is obtained.
[0064] For each connected component in the set of connected components, calculate the minimum bounding rectangle of the connected component. The minimum bounding rectangle is calculated as follows: take the minimum row coordinate of all pixels in the connected component as the row coordinate of the top-left vertex of the minimum bounding rectangle, take the minimum column coordinate of all pixels in the connected component as the column coordinate of the top-left vertex of the minimum bounding rectangle, take the maximum row coordinate of all pixels in the connected component as the row coordinate of the bottom-right vertex of the minimum bounding rectangle, and take the maximum column coordinate of all pixels in the connected component as the column coordinate of the bottom-right vertex of the minimum bounding rectangle.
[0065] For each connected component, the minimum bounding rectangle is used to obtain the defect category with the highest probability score within the area covered by the minimum bounding rectangle from the softmax probability distribution output by the defect classification branch. This category is then taken as the defect category for that connected component. The coordinates of the top-left and bottom-right vertices of the minimum bounding rectangle are combined with the defect category to form a final defect category identifier. This process is repeated for all connected components in the set to obtain the final defect category identifiers for all connected components.
[0066] See Figure 3 In the graph, the horizontal axis represents the pixel column position, ranging from 0 to 800 pixels, and the vertical axis represents the pixel confidence score and local refinement threshold, ranging from 0 to 1. The solid curve represents the trend of pixel confidence score change, and the dashed stepped curve represents the corresponding local refinement threshold. The pixel confidence curve exhibits a clear multi-peak fluctuation characteristic. In the ranges of approximately 100 to 250 pixels and 500 to 700 pixels, the confidence value rises significantly and repeatedly approaches or reaches 1.0, indicating a high confidence level that pixels in these regions are identified as defective areas by the deep learning multi-task neural network. The corresponding local refinement threshold... The threshold also rises significantly within the aforementioned high confidence interval. The stepped threshold reflects that the image is divided into multiple 32×32 pixel local sub-blocks, and the local threshold is calculated independently for each sub-block.
[0067] In regions where pixel confidence is below the local threshold, the confidence curve fluctuates between 0.0 and 0.2, and the local threshold... Maintaining a low threshold indicates that the pixels in that area are marked as background. Dynamic adjustment of the local threshold allows the refinement process to adapt to the confidence distribution of different regions, avoiding missed or false detections that may occur if the overall threshold is fixed.
[0068] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A real-time detection method for surface defects in seamless stainless steel pipes based on deep learning, characterized in that, The method includes: By moving a tunable laser spectral scanning element along the axial direction of the steel pipe, a multi-band reflection spectrum image sequence covering the entire circumference of the outer surface of the steel pipe and the corresponding spatial coordinate phase information are acquired. The multi-band reflection spectrum image sequence is subjected to three-dimensional topography reconstruction processing. Based on the phase gradient coupling relationship between the spatial coordinate phase information and the reflected light intensity attenuation gradient, a three-dimensional topography matrix of the outer surface of the steel pipe containing radial concavity depth and axial bulge height is generated. Extract the spectral difference features between adjacent bands in the multi-band reflection spectrum image sequence, and spatially overlay the spectral difference features with the three-dimensional topography matrix of the outer surface of the steel pipe to generate a combined defect feature map containing defect boundary contours and depth gradients. The combined defect feature map is subjected to frequency domain bandpass filtering based on the principle of optical dispersion to separate the scattering signal reflecting the microcracks inside the material and the reflection signal reflecting the surface scratches, and generate the separated defect category component image. The separated defect category component images are input into a pre-trained deep learning multi-task neural network, which outputs a pixel-level defect region mask. The pixel-level defect region mask is subjected to two-dimensional adaptive threshold refinement processing to generate the final defect category identifier; The step of spatially and synchronously superimposing the spectral difference features with the three-dimensional topography matrix of the outer surface of the steel pipe to generate a combined defect feature map containing defect boundary contours and depth gradients includes: Edge enhancement processing is performed on each frame of the lossless spectral difference image sequence. The edge enhancement processing uses a horizontal Sobel operator to extract the horizontal edge gradient of the frame and a vertical Sobel operator to extract the vertical edge gradient of the frame. The horizontal and vertical edge gradients are then combined to generate an edge intensity map. The edge intensity map is then superimposed onto the corresponding axial position of the three-dimensional topography matrix of the outer surface of the steel pipe. The superposition method is to multiply the gray value of each pixel in the edge intensity map by the topography height value corresponding to that pixel in the three-dimensional topography matrix of the outer surface of the steel pipe, and then add the result to the topography height value to generate the combined defect feature map.
2. The method for real-time detection of surface defects in seamless stainless steel pipes based on deep learning according to claim 1, characterized in that, The process of acquiring a multi-band reflection spectrum image sequence and corresponding spatial coordinate phase information covering the entire circumference of the outer surface of the steel pipe by moving a tunable laser spectral scanning element along the axial direction of the steel pipe includes: The tunable laser spectral scanning element is controlled to advance spirally along the steel pipe axis with a preset fixed pitch, emitting a continuously frequency-modulated laser beam and receiving reflected light at each scanning position; The reflected light is decomposed into at least three narrowband spectral components with different center wavelengths by a grating beam splitter, and each narrowband spectral component corresponds to an independent imaging channel; The spatial coordinate phase information of each imaging channel at the acquisition time is recorded using a synchronous trigger signal. The spatial coordinate phase information includes the axial displacement encoder reading and the circumferential rotation encoder reading.
3. The method for real-time detection of surface defects in seamless stainless steel pipes based on deep learning according to claim 2, characterized in that, The tunable laser spectral scanning element includes multiple vertical cavity surface-emitting lasers arranged in a linear array. Each vertical cavity surface-emitting laser corresponds to an independent emission frequency, and the emission frequencies of adjacent vertical cavity surface-emitting lasers are equally spaced, forming a continuous emission frequency band covering a predetermined spectral range.
4. The method for real-time detection of surface defects in seamless stainless steel pipes based on deep learning according to claim 1, characterized in that, The process of generating a three-dimensional topography matrix of the outer surface of the steel pipe, including radial concavity depth and axial bulge height, based on the phase gradient coupling relationship between the spatial coordinate phase information and the reflected light intensity attenuation gradient, includes: The reflected light intensity attenuation gradient value at each pixel is converted into the surface normal deflection angle corresponding to that pixel, and the surface normal deflection angle is inversely proportional to the reflected light intensity attenuation gradient value. By utilizing the difference in surface normal deflection angle between adjacent pixels, the three-dimensional topography height value of the region is reconstructed through gradient integration, thereby generating the three-dimensional topography matrix of the outer surface of the steel pipe.
5. The method for real-time detection of surface defects in seamless stainless steel pipes based on deep learning according to claim 1, characterized in that, The extraction of spectral difference features between adjacent bands in the multi-band reflectance spectrum image sequence includes: The image of the Kth band in the multi-band reflection spectrum image sequence is subtracted pixel by pixel from the image of the (K+1)th band to generate a set of spectrum difference images, where K is an integer greater than or equal to 1 and less than the total number of bands; The spectral difference image is subjected to absolute value conversion of grayscale values to eliminate negative pixels caused by the difference in reflectivity between bands, thereby generating a lossless spectral difference image sequence.
6. The real-time detection method for surface defects of seamless stainless steel pipes based on deep learning according to claim 1, characterized in that, The process of performing frequency domain bandpass filtering on the combined defect feature map based on the principle of optical dispersion separates the scattering signal reflecting the microcracks inside the material from the reflection signal reflecting the surface scratches, generating a separated defect category component image, including: A two-dimensional Fourier transform is performed on the combined defect feature map to convert the image spatial domain signal to the frequency domain, generating a frequency domain amplitude spectrum and a frequency domain phase spectrum. At least two different bandpass filters are set in the frequency domain amplitude spectrum, the passband frequency of the first bandpass filter corresponds to the frequency band of the scattered signal, and the passband frequency of the second bandpass filter corresponds to the frequency band of the reflected signal; The frequency domain amplitude spectrum is multiplied by the first bandpass filter and the second bandpass filter respectively to generate the first filtered amplitude spectrum and the second filtered amplitude spectrum. Two-dimensional inverse Fourier transforms are performed on the first and second filtered amplitude spectra, respectively, and then combined with the frequency domain phase spectrum to generate microcrack component images corresponding to the scattered signal and surface scratch component images corresponding to the reflected signal.
7. The method for real-time detection of surface defects in seamless stainless steel pipes based on deep learning according to claim 1, characterized in that, The deep learning multi-task neural network includes: a shared feature encoder, a defect classification branch, and a defect segmentation branch; The shared feature encoder adopts a residual convolutional structure, which contains multiple convolutional blocks cascaded in sequence. Each convolutional block contains a convolutional layer, a batch normalization layer, and a ReLU activation function. Max pooling layers are set between adjacent convolutional blocks to gradually reduce the feature map resolution. The defect classification branch, as the first task output branch of the deep learning multi-task neural network, includes a global average pooling layer and a fully connected layer, used to output the softmax probability distribution of the defect category. The defect segmentation branch, as the second task output branch of the deep learning multi-task neural network, includes a transposed convolutional upsampling path corresponding to the shared feature encoder. It fuses the features of each layer of the encoder with the upsampling features through skip connections to output a pixel-level defect region mask.
8. The method for real-time detection of surface defects in seamless stainless steel pipes based on deep learning according to claim 7, characterized in that, The step of performing two-dimensional adaptive threshold refinement on the pixel-level defect region mask includes: The pixel-level defect region mask is divided into multiple local sub-blocks of equal size. For each local sub-block, the average and standard deviation of the confidence scores of all pixels in the sub-block are calculated, and a refinement threshold is calculated. The refinement threshold is equal to the sum of the average and the standard deviation multiplied by a first preset coefficient. Pixels with a built-in confidence level below the refinement threshold in each sub-block are set as background, while pixels with a confidence level above or equal to the refinement threshold are retained as defect areas, thus obtaining a refined binary defect mask. Connectivity analysis is performed on the refined binary defect mask to calculate the vertex coordinates of the minimum bounding rectangle of each connected component, and the final defect category identifier is determined by combining the probability score output by the defect classification branch.
9. The method for real-time detection of surface defects in seamless stainless steel pipes based on deep learning according to claim 1, characterized in that, The kernel size of both the horizontal Sobel operator and the vertical Sobel operator is 5×5.
Citation Information
Patent Citations
Multi-spectral feature level fusion pipeline crack visual detection method
CN121190487A
Gear defect identification method and system based on deep learning
CN122156205A