Steel defect detection method based on semantic segmentation model
By using frequency domain mapping and gradient compensation operations, the problem of deep coupling between background texture and defect features in steel defect detection was solved, and stable defect recognition and accurate boundary representation were achieved in a highly dynamic anisotropic wire drawing texture environment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CENTRAL SOUTH UNIVERSITY OF FORESTRY AND TECHNOLOGY
- Filing Date
- 2026-05-18
- Publication Date
- 2026-06-12
AI Technical Summary
Existing steel defect detection technologies suffer from deep coupling between background texture and defect features in the feature space when detecting highly dynamic anisotropic brushed texture surfaces. This leads to spatial topology reconstruction failure of the defect mask output by the detection model, resulting in false fault reports and boundary distortion.
The spatial phase component is preserved by frequency domain mapping, the background texture frequency component is suppressed, the first feature map is generated, and the defect boundary structure is restored by numerical zeroing and gradient compensation operation, and the defect mask is output.
Without increasing the cost of high-resolution optical imaging hardware, stable identification of weak defects was achieved, improving the accuracy of defect classification and identification and the precision of boundary representation.
Smart Images

Figure CN122199556A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of technology, and in particular to a method for detecting defects in steel based on a semantic segmentation model. Background Technology
[0002] In the steel preparation and processing, surface defect detection is a key engineering step to ensure the quality of finished products. Existing industrial visual inspection technologies mainly rely on convolutional neural networks to extract features and perform semantic segmentation on the acquired image signals.
[0003] However, when inspecting steel surfaces with anisotropic brushed textures, highly directional and densely distributed background textures exist in the image signal. The spatial characteristics of these background textures overlap with those of linear defects such as scratches and cracks. Existing detection methods typically employ direct spatial domain feature fusion or conventional filtering denoising techniques. In the direct spatial domain feature fusion approach, the signal intensity of the background texture overshadows the defect signal, leading to semantic dilution in the feature mapping stage of the deep learning model and inducing false positives.
[0004] While conventional filtering and denoising techniques can suppress background texture to some extent, the filtering operators, while weakening the background texture, also cause gradient diffusion at the edges of the defect image, resulting in the loss of sub-pixel-level information at the defect boundary. This ultimately leads to blurred boundaries or shape distortion in the mask prediction results. Furthermore, because background features and defect features are deeply coupled in the feature space, existing models are prone to mistaking local energy abrupt changes in the background texture for defect targets.
[0005] The two types of failure paths mentioned above overlap, resulting in a synergistic failure problem in the existing steel defect detection technology in terms of defect identification accuracy and boundary expression precision. Summary of the Invention
[0006] This invention provides a steel defect detection method based on a semantic segmentation model to address the engineering defects caused by the failure of spatial topology reconstruction of the defect mask output by the detection model during the detection of weak defects on the surface of highly dynamic anisotropic brushed steel. This is due to the fact that conventional feature extraction operators simultaneously strip the high-frequency boundary gradient of the defect target while suppressing the background texture energy flux, and the influence of weak defect semantic dilution caused by the deep downsampling stage of the network. As a result, the engineering defects caused by false activation of the background region and distortion of the true boundary occur.
[0007] In view of the above problems, the present invention provides a steel defect detection method based on a semantic segmentation model, comprising the following steps: Acquire the raw image signal of the object to be detected; Frequency domain mapping is performed on the original image signal to retain the spatial phase component and suppress the components in the original image signal that satisfy the preset frequency distribution characteristics to generate a first feature map; Extract the numerical distribution from the first feature map, generate a first feature mask, and perform zeroing on the first feature map based on the first feature mask to obtain a second feature map; Extract the spatial distribution parameters of the first feature mask, and extract the statistical parameters of the original image signal and the second feature map; perform gradient compensation operation on the second feature map based on the spatial distribution parameters and the statistical parameters to generate the third feature map; Dual-path prediction is performed on the third feature map, and boundary points are extracted from the third feature map according to the preset probability decay gradient constraint, and a defect mask is output.
[0008] Furthermore, the steps for performing frequency domain mapping include: The original image signal is mapped to the frequency domain using a two-dimensional fast Fourier transform; Determine the energy spectral line distribution direction corresponding to the background texture in the frequency domain; A notch filter is used to filter out the frequency components along the energy spectral line distribution direction; The filtered signal is restored to the spatial domain by inverse Fourier transform to obtain the first feature map.
[0009] Furthermore, the steps for generating the first feature mask include: Calculate the confidence score of each pixel in the first feature map; The region with a confidence score greater than a preset threshold is defined as the first feature mask.
[0010] Further, the steps of extracting the spatial distribution parameters and the statistical parameters include: The area ratio of the region covered by the first feature mask is statistically analyzed to generate a first parameter as the spatial distribution parameter; Calculate the average gradient value of the region corresponding to the first feature mask in the original image signal, and generate a second parameter as the statistical parameter; Calculate the feature distribution entropy value of the second feature map to generate a third parameter as the statistical parameter.
[0011] Furthermore, the steps for performing gradient compensation calculations include: The stability factor is determined by normalizing the first parameter based on the third parameter. The gain coefficient is determined by invoking a preset saturation function operator in conjunction with the stability factor; An affine transformation is performed on the second feature map based on the product of the second parameter and the gain coefficient.
[0012] Further, the step of determining the gain coefficient includes: Construct a mapping function with the first parameter as the independent variable and the gain coefficient as the dependent variable; The derivative of the mapping function is suppressed and adjusted according to the third parameter; The gain coefficient is limited to a preset numerical range using the saturation function operator. When the first parameter reaches the preset upper limit, the increase of the gain coefficient stops.
[0013] Furthermore, the third feature map is obtained through the following formula: in, The third feature map, The second parameter is in scalar form. For the first parameter, The third parameter is dimensionless. This is the second feature map. The preset spatial phase matrix, It is a natural constant. This is a preset upper limit constant for the gain. , The preset weighting constants, This refers to scalar multiplication of a scalar and a tensor. This is an element-wise addition.
[0014] Furthermore, the steps for preserving the spatial phase components include: The phase spectrum data output by the two-dimensional fast Fourier transform is extracted, and the phase spectrum data is retained as the spatial phase component.
[0015] Furthermore, the steps for performing dual-path prediction include: The first prediction path outputs a probability distribution map representing the defect center region; The second prediction path outputs a probability distribution map representing the defect edge region; Morphological dilation is performed using the defect center region as the seed point.
[0016] Furthermore, the boundary point extraction steps include: Calculate the spatial gradient of the probability distribution map of the second predicted path output; After the spatial gradient crosses the extreme point, when the change in the spatial gradient is less than a preset threshold, the generation of the boundary pixels of the defect mask is stopped.
[0017] The technical solution provided in this application has at least the following technical effects: By performing frequency domain mapping on the original image signal and suppressing the frequency components corresponding to the background texture, the background texture response is weakened while preserving the spatial phase components, thereby reducing the degree of synchronous stripping of the high-frequency boundary gradient of the defect target during the feature extraction stage.
[0018] The first feature mask is generated by extracting the numerical distribution in the first feature map, and the first feature map is zeroed out according to the first feature mask. This blocks the data flow path of the background features during the downsampling process, thereby reducing the assimilation effect of the background region on the weak defect features and suppressing the false target false alarm fault generated at the output of the detection model.
[0019] By extracting spatial distribution parameters and statistical parameters, gradient compensation is performed on the second feature map. Under the premise of limiting the gain coefficient using the saturation function operator, an affine transformation is performed on the feature matrix to restore the spatial geometric structure of the defect boundary, thereby reducing the degree of topological distortion of the defect boundary mesh and stably realizing the quantization characterization of the boundary pixels.
[0020] By combining the above-mentioned mechanisms of frequency domain mapping, numerical zeroing and gradient compensation, this invention effectively overcomes the spatial topology reconstruction failure caused by conventional extraction operators without increasing the hardware cost of high-resolution optical imaging. It achieves stable identification of weak defects in highly dynamic anisotropic wire drawing texture environments, and simultaneously improves the accuracy of defect classification and identification and the precision of boundary representation. Attached Figure Description
[0021] Figure 1 This is a flowchart of the steel defect detection method based on semantic segmentation model in an embodiment of the present invention. Detailed Implementation
[0022] The above technical solutions will now be described in detail with reference to the accompanying drawings and specific embodiments to provide a better understanding of them. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. It should be understood that the present invention is not limited to the exemplary embodiments used only to explain the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention. Furthermore, it should be noted that, for ease of description, only the parts related to the present invention are shown in the drawings, not all of them.
[0023] Example: Please refer to Figure 1 A steel defect detection method based on a semantic segmentation model includes the following steps: The implementation of a steel defect detection method based on a semantic segmentation model begins with the construction of an industrial vision inspection hardware and software environment. The hardware environment includes an optical imaging device and an industrial control computer equipped with a graphics processing unit (GPU). The optical imaging device captures the raw image signal of the object to be inspected and transmits it to the GPU's video memory space via a peripheral component interconnect (PCI) standard bus. The GPU allocates independent, contiguous blocks of video memory to hold the raw image signal. The parallel data interaction mechanism between the GPU and the video memory space provides the hardware instruction basis for subsequent zeroing of the background pixel matrix and tensor calculations.
[0024] As the original image signal is completely written into the video memory, the industrial control computer triggers the main processing logic sequentially according to its built-in instruction set: Acquire the raw image signal of the object to be detected; Frequency domain mapping is performed on the original image signal to retain the spatial phase component and suppress the components in the original image signal that satisfy the preset frequency distribution characteristics to generate a first feature map; Extract the numerical distribution from the first feature map, generate a first feature mask, and perform zeroing on the first feature map based on the first feature mask to obtain a second feature map; Extract the spatial distribution parameters of the first feature mask, and extract the statistical parameters of the original image signal and the second feature map; perform gradient compensation operation on the second feature map based on the spatial distribution parameters and the statistical parameters to generate the third feature map; Dual-path prediction is performed on the third feature map, and boundary points are extracted from the third feature map according to the preset probability decay gradient constraint, and a defect mask is output.
[0025] When the main processing logic enters the frequency domain mapping stage, the graphics processor (GPU) retrieves the original image signal from the video memory block and calls the computing unified device architecture (CPA) core to map the original image signal to the frequency domain through a two-dimensional fast Fourier transform, generating a frequency domain complex tensor containing an amplitude matrix and a spatial phase matrix. To establish a spatial coordinate mapping benchmark, the GPU performs a decoupling operation on the frequency domain complex tensor, separating the spatial phase matrix from it. After the separation is completed, the GPU allocates a long-term video memory cache address to preserve the spatial phase matrix, which remains in a silent suspended state until it is called again during the gradient compensation operation to perform spatial coordinate alignment.
[0026] In the calculation process that preserves the spatial phase components, the graphics processor performs an operation on the amplitude matrix in the frequency domain complex tensor to suppress the original image signal components that satisfy the preset frequency distribution characteristics. The specific implementation path of the background texture suppression operation is as follows: the graphics processor traverses the amplitude matrix in the frequency domain and extracts the energy amplitude of each coordinate point of the amplitude matrix; it compares the preset physical topology vector of steel residual stress in the video memory to determine the energy spectral line distribution direction corresponding to the background texture in the frequency domain; based on the determined energy spectral line distribution direction, it generates a notch filter mask matrix whose direction angle is orthogonal to the energy spectral line distribution direction; and it performs a Hadamard product operation on the notch filter mask matrix and the amplitude matrix to filter out the frequency components in the energy spectral line distribution direction.
[0027] After the frequency components along the energy spectral distribution direction are filtered out, the graphics processor reads the remaining frequency domain data and restores the filtered signal to the spatial domain through inverse Fourier transform, obtaining the first feature map that completes background texture suppression. Along with the output of the first feature map, the data stream generated in the frequency domain mapping stage is immediately converted into the data input for the next numerical zeroing processing stage. As an alternative physical implementation path for frequency domain mapping, the conversion of the original image signal to the frequency domain and the suppression of frequency components can be performed using discrete cosine transform combined with a directional band-stop filtering algorithm. The discrete cosine transform path can also output the first feature map with the background texture frequency components filtered out and the independently retained spatial phase components.
[0028] As the first feature map is reconstructed in the spatial domain and output to video memory, the graphics processing unit (GPU) of the industrial control computer extracts the first feature map and enters the confidence evaluation stage. The GPU retrieves the global inference branch network pre-loaded into video memory and inputs the first feature map into the global inference branch network to perform parallel inference computation. The global inference branch network reads the spatial and channel dimension data of the first feature map, and calculates the confidence score of each pixel in the first feature map belonging to the distribution range of the defect-free background through multilayer perceptron mapping and normalized exponential function operation. The calculated confidence score is converted into a dot matrix with spatial coordinate mapping relationship. Each floating-point value in the confidence score matrix quantifies and labels the statistical probability that the corresponding coordinate point of the first feature map is a normal background region.
[0029] Once the confidence score matrix is generated and loaded into the graphics processor's cache, the data stream triggers a mask matrix construction instruction. The tensor operation core within the graphics processor extracts the confidence score matrix and performs a full matrix traversal with a preset threshold comparison logic. During the traversal, if the confidence score value corresponding to a physical coordinate point is greater than the preset threshold, the tensor operation core assigns a Boolean state value of 1 to the corresponding coordinate space of the newly created matrix; if the confidence score value is less than or equal to the preset threshold, the tensor operation core assigns a Boolean state value of 0 to the corresponding coordinate space of the newly created matrix. The physically continuous region formed by the convergence of discrete Boolean state values of 1 is logically defined as the first feature mask. The first feature mask establishes the boundary of the background region to be stripped.
[0030] After obtaining the first feature mask, the main processing logic enters the feature annihilation stage, where the graphics processor (GPU) issues a zeroing instruction for the first feature map. The underlying hardware implementation of the zeroing instruction relies on the GPU's multiply-accumulate unit module. The GPU first performs element-wise logical NOT operations on the first feature mask, generating an inverse mask tensor containing isolated feature placeholders. Subsequently, the GPU extracts the first feature map and the inverse mask tensor and feeds them into the multiply-accumulate unit module to perform element-wise Hadamard product operations in the spatial dimension.
[0031] In the element-wise Hadamard product operation, the feature values of the pixel regions corresponding to the first feature mask in the first feature map are multiplied by the zero values in the inverse mask tensor, causing the feature matrix values of the corresponding regions to become zero. Matrix regions in a zero-valued state lose their numerical activation weights for participation in convolution multiplication and addition operations during subsequent forward and backward propagation calculations in the neural network framework. This zeroing process cuts off the data flow trajectory of the background region, blocking the numerical assimilation and propagation path of defective island features by background pixels during pooling layer downsampling. The feature tensor matrix that has undergone the zeroing process is reassigned to a physical address space by the register and output as a second feature map containing island features. The output of the second feature map then triggers the next stage of parameter extraction and gradient compensation operations.
[0032] Along with the output of the second feature map, the graphics processor of the industrial control computer extracts parameters from the numerical zeroing process. These parameters include the spatial distribution parameters of the first feature mask and the statistical parameters of the original image signal and the second feature map. The graphics processor iterates through the set of pixel coordinates of the area covered by the first feature mask, calculates the proportion of the area covered by the first feature mask to the total image area, and generates the first parameter as the spatial distribution parameter. Simultaneously, the graphics processor maps the first feature mask to the spatial coordinate system of the original image signal, extracts the absolute value of the pixel difference of the corresponding physical region, calculates the mean, and generates a second parameter in scalar form as a statistical parameter. Simultaneously, the graphics processor performs a logarithmic summation operation on the activation tensor distribution probabilities of the second feature map, generating a dimensionless feature distribution entropy value, which serves as the third parameter in the statistical parameters. .
[0033] When the first parameter Second parameter and the third parameter After all parameters are written to the registers, the graphics processor performs gradient compensation operations on the second feature map based on spatial distribution parameters and statistical parameters. The graphics processor constructs a model containing natural constants. With the third parameter logarithmic damping term And based on the logarithmic damping term, the first parameter Perform normalized division to determine the stability factor. Stability factor and preset weight constant After multiplication, the result is input into the hyperbolic tangent saturation function operator. The calculation is performed within the range. This is combined with the upper limit constant of the gain. With the basic constant 1, the graphics processor is constructed with the first parameter A mapping function with independent variable and gain coefficient as dependent variable, and based on the third parameter. The derivative of the mapping function is suppressed and adjusted, and the hyperbolic tangent saturation operator is invoked to limit the gain coefficient within a preset numerical range. When the first parameter... When the preset upper limit is reached, the increase in the gain coefficient will stop.
[0034] To generate the third feature map, the graphics processor (GPU) performs a tensor affine transformation on the second feature map using a predefined formula. The formula for generating the third feature map executed by the GPU is: In the formula, the graphics processor will use the second parameter in scalar form. Multiply by the determined gain coefficient, then perform scalar and second characteristic map operation. Tensor scalar multiplication After completing the tensor-scalar multiplication, the graphics processor recalls the previously stored spatial phase matrix from video memory. Extract the preset weight constants With spatial phase matrix Multiply, and then perform element-wise addition on the product with the characteristic tensor that has undergone tensor-scalar multiplication. Tensor affine transformation and spatial phase matrix After the parallel injection reconstruction process is completed, the graphics processor outputs the third feature map. .
[0035] 2.4 Fourth Stage: Morphological Decoupling and Probability Decay Physical Constraints Based on the third feature map The video memory write status, the graphics processor's third feature map Perform dual-path prediction. The graphics processor will then use the third feature map. The data is split into two parallel streams, which are input into the first and second prediction paths of the dual-branch network, respectively. The first prediction path performs two-dimensional convolution and activation mapping, and outputs a probability distribution map representing the defect center region; the second prediction path performs an edge feature extraction mechanism in parallel, and outputs a probability distribution map representing the defect edge region.
[0036] Along with the output of the probability distribution map representing the defect center region, the graphics processor extracts the set of peak coordinate points from the probability distribution map representing the defect center region as seed points, and performs morphological dilation processing using the defect center region as seed points. During the morphological dilation process, the graphics processor simultaneously extracts the probability distribution map representing the defect edge region from the output of the second prediction path and calculates the spatial gradient of the probability distribution map. The calculation of the spatial gradient includes obtaining the probability difference vector between adjacent pixels and extracting the magnitude attribute of the probability difference vector within the coordinate grid.
[0037] Based on a preset probability decay gradient constraint, the graphics processor (GPU) performs boundary point extraction and truncation logic for the spatial gradient. The GPU monitors the numerical trajectory of the spatial gradient, capturing its state when it crosses an extreme point in the pixel coordinate system. After the spatial gradient crosses an extreme point, the GPU continuously calculates the change in the spatial gradient. When the change in the spatial gradient is less than a preset threshold, a Boolean interrupt instruction is triggered, and the GPU stops generating boundary pixels for the defect mask. After the boundary pixel generation is stopped, the GPU outputs a defect mask containing a pixel spatial coordinate array. The defect mask, as the endpoint of data processing, is written to the industrial control computer's hard disk sequence, and the instruction chain of the defect detection method terminates.
[0038] The gradient compensation operation relies on multiple sets of engineering calibration constants pre-loaded into the video memory of the industrial control computer. Before acquiring the spatial distribution parameters and statistical parameters of the first feature mask, the graphics processor pre-reads the gain upper limit constant, sensitivity weight constant, and spatial phase weight constant mounted in the static area of the video memory. The numerical range of the gain upper limit constant is limited by hardware instructions to a closed range of single-precision floating-point numbers from 0.2 to 0.8. The boundary of the gain upper limit constant defines the maximum energy flux product multiplier allowed to be injected into the second feature map during the tensor affine transformation stage. Accompanied by the zeroing process that triggers the stripping of physical background information, the second feature map enters a feature sparsity state. The dimensionless feature distribution entropy value, as a statistical parameter, exhibits a geometric feature extending towards positive infinity on the numerical evolution curve. When the dimensionless feature distribution entropy value approaches positive infinity, the arithmetic logic unit inside the graphics processor calculates the logarithmic damping term, which includes the natural constant and the dimensionless feature distribution entropy value, according to the computer clock. The output value of the logarithmic damping term synchronously approaches positive infinity. The graphics processor invokes a division instruction, dividing the area percentage value, which serves as a spatial distribution parameter, by a logarithmic damping term approaching positive infinity. The resulting stability factor is suppressed downwards by the calculation rules and approaches 0. This near-zero stability factor suppresses the eigenvalue matrix during the backpropagation stage within the underlying neural network's computational framework, blocking the computational path where the gradient matrix's numerical accumulation exceeds the floating-point representation limit.
[0039] When the area ratio of the region covered by the first feature mask approaches the preset upper limit of 1, the area ratio interacts with the dimensionless feature distribution entropy to generate a stability factor that reaches the function's extreme value. The graphics processing unit (GPU) extracts the stability factor that reaches the extreme value and the sensitivity weight constant, executes a scalar multiplication instruction, and feeds the output tensor of the scalar multiplication instruction into the logic mapping gate array containing the hyperbolic tangent saturation function operator. Due to the asymptote mathematical boundary characteristics of the hyperbolic tangent saturation function operator, as the scalar value input to the logic mapping gate array increases, the output feedback of the hyperbolic tangent saturation function operator is clamped within a closed interval where the absolute value is less than or equal to the constant 1. The GPU extracts the limit value of 1 from the output of the hyperbolic tangent saturation function operator, performs a hardware-level multiplication accumulation operation with the gain upper limit constant, and performs an addition instruction with the product result and the basic scalar value 1. After calculation by the logic gate array, the final output gain coefficient is locked at a numerical limit equal to the basic scalar value 1 plus the gain upper limit constant. The clamping decision mechanism implemented by the gain coefficient ensures that the values of the forward propagation feature matrix and the backpropagation weight update matrix remain within the convergence range under the condition of background information stripping input.
[0040] As an alternative physical mapping path for determining the gain coefficient, the graphics processor (GPU) loads a sigmoid growth function operator or a piecewise linear activation function operator instead of the hyperbolic tangent saturation function operator. During execution using the sigmoid growth function operator, the GPU inputs a stability factor into the sigmoid growth function operator to extract a first floating-point mapping value. This first floating-point mapping value is then subjected to an algebraic correction, multiplied by a constant 2 and subtracted by a constant 1. The algebraic correction operation scales and maps the range of the sigmoid growth function operator to the range limit of the hyperbolic tangent saturation function operator, outputting a gain coefficient with an equivalent convergence boundary to the hyperbolic tangent saturation function operator. If the GPU activates the piecewise linear activation function operator, it allocates discrete constant slope values based on a preset value range for the stability factor, and assigns the gain coefficient a constant upper limit value when the stability factor exceeds a preset threshold.
[0041] Along with the extraction of the third parameter, the graphics processor of the industrial control computer extracts local spatial contrast or tensor sparsity to replace the dimensionless feature distribution entropy value. Specifically, the computational flow involves the graphics processor calculating the discrete proportion of non-zero elements in the second feature map to form the L0 norm value, or traversing all pixels in the second feature map, calculating the sum of their absolute values, and dividing by the total number of pixels to form the normalized L1 norm value. The L0 norm value or the normalized L1 norm value is assigned to the third parameter register and fed back into an algebraic calculation sequence containing a logarithmic damping term with a natural constant base, providing the basis input parameters for quantifying the physical island distribution state of the second feature map.
[0042] For edge hardware nodes equipped with RISC-based computing chips, the graphics processing unit (GPU) activates a lookup table addressing mechanism based on GPU Double Data Rate (DDR) memory. During system initialization, the industrial control computer pre-traverses a two-dimensional numerical grid composed of the first and third parameters, compiling the mixed floating-point operation results of the logarithmic damping term, the hyperbolic tangent saturation function operator, and the upper limit of gain constant into a discrete gain map. This discrete gain map is written to the GPU's static random access memory (SRAM) array. Upon entering the data transfer phase, after receiving the first and third parameters, the GPU suspends the algebraic computation of the floating-point arithmetic logic unit (ALU), merges the binary values of the first and third parameters, converts them into an addressing index for the SRAM, and retrieves the gain coefficient value corresponding to the physical memory address to complete the subsequent tensor affine transformation.
[0043] The physical device carrying the instruction chain for frequency domain mapping, numerical zeroing, and gradient compensation is the industrial inspection vision controller. The industrial inspection vision controller consists of a peripheral interconnect standard bus, an image acquisition card, a central processing unit (CPU), and a heterogeneous computing power board with a graphics processing unit (GPU). The image acquisition card is responsible for converting the photon array captured by the optical devices into a digitized raw image signal and pushing the raw image signal into the peripheral interconnect standard bus. The CPU sends operation timing control pulses along the peripheral interconnect standard bus, and the streaming multiprocessor array built into the GPU heterogeneous computing power board extracts the raw image signal and executes tensor multiplication-addition instructions, logarithmic summation instructions, and boundary point extraction and Boolean determination instructions.
[0044] The controller motherboard of the industrial inspection vision controller is embedded with a non-volatile computer-readable storage medium. This non-volatile computer-readable storage medium contains contiguous physical sectors, each containing a sequence of computer-executable instructions. These instructions cover frequency domain filtering and masking logic, tensor value zeroing logic, affine transformation gain logic, and morphological extremum tracking logic. When the central processing unit reads the instruction sequence, the voltage levels of the hardware registers periodically toggle. These registers drive the silicon-based logic gate array to sequentially rotate, completing the physical state transformation of the original image signal into a defect mask containing defect topological geometric location information.
[0045] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A steel defect detection method based on a semantic segmentation model, characterized in that, Includes the following steps: Acquire the raw image signal of the object to be detected; Frequency domain mapping is performed on the original image signal to retain the spatial phase component and suppress the components in the original image signal that satisfy the preset frequency distribution characteristics to generate a first feature map; Extract the numerical distribution from the first feature map, generate a first feature mask, and perform zeroing on the first feature map based on the first feature mask to obtain a second feature map; Extract the spatial distribution parameters of the first feature mask, and extract the statistical parameters of the original image signal and the second feature map; perform gradient compensation operation on the second feature map based on the spatial distribution parameters and the statistical parameters to generate the third feature map; Dual-path prediction is performed on the third feature map, and boundary points are extracted from the third feature map according to the preset probability decay gradient constraint, and a defect mask is output.
2. The method according to claim 1, characterized in that, The steps for performing frequency domain mapping include: The original image signal is mapped to the frequency domain using a two-dimensional fast Fourier transform; Determine the energy spectral line distribution direction corresponding to the background texture in the frequency domain; A notch filter is used to filter out the frequency components along the energy spectral line distribution direction; The filtered signal is restored to the spatial domain by inverse Fourier transform to obtain the first feature map.
3. The method according to claim 1, characterized in that, The steps for generating the first feature mask include: Calculate the confidence score of each pixel in the first feature map; The region with a confidence score greater than a preset threshold is defined as the first feature mask.
4. The method according to claim 1, characterized in that, The steps of extracting the spatial distribution parameters and the statistical parameters include: The area ratio of the region covered by the first feature mask is statistically analyzed to generate a first parameter as the spatial distribution parameter; Calculate the average gradient value of the region corresponding to the first feature mask in the original image signal, and generate a second parameter as the statistical parameter; Calculate the feature distribution entropy value of the second feature map to generate a third parameter as the statistical parameter.
5. The method according to claim 4, characterized in that, The steps for performing gradient compensation calculations include: The stability factor is determined by normalizing the first parameter based on the third parameter. The gain coefficient is determined by invoking a preset saturation function operator in conjunction with the stability factor; An affine transformation is performed on the second feature map based on the product of the second parameter and the gain coefficient.
6. The method according to claim 5, characterized in that, The steps for determining the gain coefficient include: Construct a mapping function with the first parameter as the independent variable and the gain coefficient as the dependent variable; The derivative of the mapping function is suppressed and adjusted according to the third parameter; The gain coefficient is limited to a preset numerical range using the saturation function operator. When the first parameter reaches the preset upper limit, the increase of the gain coefficient stops.
7. The method according to claim 6, characterized in that, The third feature map is obtained by the following formula: in, The third feature map, The second parameter is in scalar form. For the first parameter, The third parameter is dimensionless. This is the second feature map. The preset spatial phase matrix, It is a natural constant. This is a preset upper limit constant for the gain. , The preset weighting constants, This refers to scalar multiplication of a scalar and a tensor. This is an element-wise addition.
8. The method according to claim 2, characterized in that, The step of preserving the spatial phase components includes: The phase spectrum data output by the two-dimensional fast Fourier transform is extracted, and the phase spectrum data is retained as the spatial phase component.
9. The method according to claim 1, characterized in that, The steps for performing dual-path prediction include: The first prediction path outputs a probability distribution map representing the defect center region; The second prediction path outputs a probability distribution map representing the defect edge region; Morphological dilation is performed using the defect center region as the seed point.
10. The method according to claim 9, characterized in that, The boundary point extraction steps include: Calculate the spatial gradient of the probability distribution map of the second predicted path output; After the spatial gradient crosses the extreme point, when the change in the spatial gradient is less than a preset threshold, the generation of the boundary pixels of the defect mask is stopped.