Method and system for segmenting hot-rolled nonwoven fabric surface defect images
Patent Information
- Application Number
- CN202611009945.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-08
- Publication Date
- 2026-10-20
AI Technical Summary
[0004]为了解决现有技术在热轧无纺布复杂纹理背景下易受纹理干扰、微弱缺陷特征表达不足、分割边界粗糙及定位偏差的问题,本发明提供了一种用于热轧无纺布表面缺陷图像的分割方法及系统
[0021]本发明通过对原始图像进行结构纹理分量分离,降低复杂背景纹理对缺陷识别的干扰,使网络更集中于局部异常特征表达。在特征提取过程中,基于通道状态构建动态频率重映射函数,并沿多个空间角度进行二维离散余弦变换,生成多角度二维频率谱;利用该重映射函数对频率谱进行幅值加权,结合门控融合单元生成通道注意力权重,以增强缺陷相关频域特征并抑制部分冗余响应。进一步地,计算通道注意力权重向量的分布熵作为不确定性度量,并据此确定边界约束权重,联合结构分量图像梯度对初步分割掩码进行校正,改善了缺陷边界定位效果,提高了热轧无纺布表面缺陷图像分割的准确性和稳定性。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This application belongs to the field of segmentation, and in particular relates to a method and system for segmenting images of surface defects in hot-rolled nonwoven fabrics. Background Technology
[0002] Thermally rolled nonwoven fabrics possess excellent air permeability, flexibility, and mechanical strength, making them widely used in medical and health applications, industrial filtration, packaging materials, and everyday household goods. However, during actual production, factors such as fluctuations in raw material quality, changes in equipment operating conditions, and unstable process parameters can lead to defects on the product surface, including stains, holes, creases, and foreign matter. These defects not only affect the appearance quality of the nonwoven fabric but can also reduce its mechanical properties and reliability. Therefore, utilizing a vision inspection system on the production line for image segmentation and localization of surface defects in thermally rolled nonwoven fabrics is a crucial step in improving quality control and production automation. Compared to industrial products with relatively smooth surfaces, thermally rolled nonwoven fabrics typically exhibit roll indentations, fiber interlacing, and periodic or semi-periodic texture structures. Defect areas are often interwoven with complex background textures, and some defects show little difference in grayscale, texture, or edge between themselves and the normal background, increasing the difficulty of visual inspection and image segmentation.
[0003] Existing surface defect image segmentation methods mainly include traditional image processing methods and deep learning-based semantic segmentation methods. Traditional methods typically rely on fixed thresholds, edge detection, or morphological rules, which have limited adaptability to changes in illumination, texture direction, and defect morphology, and their detection stability needs improvement. While conventional deep learning segmentation models possess strong feature learning capabilities, they may still be affected by the mutual interference between background textures and defect structure in complex texture backgrounds, leading to confusion between high-frequency texture details and defect edge features, resulting in false detection of normal textures or missed detection of weak defects. Furthermore, existing attention mechanisms often focus on spatial regions or global channel statistics, failing to adequately utilize the multi-angle distribution characteristics of complex textures in the frequency domain, limiting the model's ability to represent small, hidden defects. In addition, some defect boundaries are blurred, and conventional segmentation results are prone to rough edges, region expansion, or boundary positioning deviations. Therefore, it is necessary to propose a surface defect image segmentation method for hot-rolled nonwoven fabrics that can reduce interference from complex background textures, enhance the representation of multi-angle frequency domain defect features, and improve defect boundary positioning. Summary of the Invention
[0004] To address the problems of existing technologies being susceptible to texture interference, insufficient representation of weak defect features, rough segmentation boundaries, and positioning deviations in the context of complex textures in hot-rolled nonwoven fabrics, this invention provides a segmentation method and system for surface defect images of hot-rolled nonwoven fabrics.
[0005] In a first aspect, the present invention provides a method for segmenting images of surface defects in hot-rolled nonwoven fabrics, comprising the following steps: The process involves acquiring original images of surface defects in hot-rolled nonwoven fabric and separating the structure and texture components to obtain structural component images and texture component images. The texture component images are then input into the encoder of a segmentation network, which extracts candidate feature maps at multiple levels. These candidate feature maps are then dimension-unified and fused to obtain a multi-scale fused feature map. Frequency channel attention calculation is performed on the multi-scale fused feature map. A dynamic frequency remapping function is constructed based on the channel states of the multi-scale fused feature map. A two-dimensional discrete cosine transform is performed on each channel of the multi-scale fused feature map along multiple preset spatial angles to generate a multi-angle two-dimensional frequency spectrum. The dynamic frequency remapping function is used to perform amplitude weighting on the multi-angle two-dimensional frequency spectrum to obtain an enhanced multi-angle frequency feature vector. The enhanced multi-angle frequency feature vector is then concatenated and input into a gated fusion unit to generate a channel attention weight vector. This channel-based weighting of the multi-scale fused feature map yields the enhanced feature map. The enhanced feature map is input into the decoder of the segmentation network to generate a preliminary segmentation result mask; the distribution entropy of the channel attention weight vector is calculated as an uncertainty measure, the boundary constraint weights are calculated based on the uncertainty measure, and the preliminary segmentation result mask is corrected using the boundary constraint weights and the gradient of the structural component image to generate a defect segmentation image.
[0006] Further, the step of acquiring the original image of the surface defects of the hot-rolled nonwoven fabric and performing structural-texture component separation to obtain structural component images and texture component images includes: A relative total variation model is used to calculate the total variation and the corresponding in-window spatial smoothing weights for each pixel of the original image of the surface defects of the hot-rolled nonwoven fabric. Based on the window-in-space smoothing weights, an energy objective function is constructed and minimized, and the spatial smoothing structure layer of the original image of the surface defects of the hot-rolled nonwoven fabric is iteratively solved. The original image of the surface defects of the hot-rolled nonwoven fabric is subtracted from the solved spatial smooth structure layer at the pixel level to extract the residual high-frequency pixel response. The absolute value of the high-frequency pixel response is linearly normalized to form the texture component image, and the spatial smooth structure layer is used as the structure component image.
[0007] Furthermore, the construction of the dynamic frequency remapping function based on the channel states of the multi-scale fused feature map includes: The multi-scale fused feature maps are respectively input into the global average pooling layer and the global max pooling layer; The one-dimensional global average pooling vector and the one-dimensional global max pooling vector are spliced together to form a state vector with a length twice the number of channels of the multi-scale fused feature map. The state vector is input into a multilayer perceptron network, and a one-dimensional gain attenuation array is activated through nonlinear mapping. Based on the radial frequency mapping rule, the one-dimensional gain attenuation array is mapped to the corresponding two-dimensional frequency band coordinate position, thereby constructing the dynamic frequency remapping function that is consistent with the size of the multi-angle two-dimensional frequency spectrum.
[0008] Further, the step of performing a two-dimensional discrete cosine transform on each channel of the multi-scale fused feature map along multiple preset spatial angles to generate a multi-angle two-dimensional frequency spectrum includes: Construct four fixed spatial coordinate rotation angles, namely 0°, 45°, 90° and 135°; In each channel of the multi-scale fused feature map, bilinear interpolation resampling is performed according to the four spatial coordinate rotation angles, and the resampled feature map obtained after resampling is unified to a preset fixed size by cropping or zero padding, and four tilt direction feature sub-maps are extracted. For the four extracted tilted feature sub-maps, perform a forward two-dimensional discrete cosine transform along their respective length and width dimensions to calculate the projection inner product, generating four corresponding multi-angle two-dimensional discrete cosine coefficient frequency map sequences, which are then combined to form the multi-angle two-dimensional frequency spectrum.
[0009] Further, the step of using the dynamic frequency remapping function to perform amplitude weighting processing on the multi-angle two-dimensional frequency spectrum to obtain an enhanced multi-angle frequency feature vector includes: The energy scale data segment matrix composed of discrete cosine AC coefficients and DC coefficients in the multi-angle two-dimensional frequency spectrum is extracted by traversal. The energy scale data segment matrix is weighted by element-wise multiplication with the dynamic frequency remapping function to complete the numerical modulation update, resulting in a weighted response coefficient matrix layer. The weighted response coefficient matrix layer is then flattened to construct multiple sets of processed one-dimensional enhanced amplitude distribution responses as the enhanced multi-angle frequency feature vectors.
[0010] Further, the step of concatenating the enhanced multi-angle frequency feature vector and inputting it into the gated fusion unit to generate a channel attention weight vector includes: The enhanced multi-angle frequency feature vectors corresponding to each angle are sequentially concatenated to form a fixed-dimensional fully aggregated one-dimensional tensor. The fully aggregated one-dimensional tensor input includes a gated feedforward network containing two fully connected layers and an activation function to achieve linear and scaling hybrid logic mapping; The channel attention weight vector is generated by normalizing the mapping output to the range of 0 to 1 using the Sigmoid activation function.
[0011] Further, the calculation of the distribution entropy of the channel attention weight vector as an uncertainty measure includes: Take the absolute value of each feature weight element in the channel attention weight vector and divide it by the sum of the absolute values of all feature weight elements to obtain the normalized probability distribution value of each weight element. Based on the Shannon entropy formula, the product of each normalized probability distribution value and the natural logarithm is calculated; The negative summation of all product results is used as the distribution entropy to evaluate the uncertainty measure of the segmentation network in identifying defect information.
[0012] Further, the step of calculating boundary constraint weights based on the uncertainty metric, and using the boundary constraint weights and the gradient of the structural component image to correct the preliminary segmentation result mask to generate a defect segmentation image, includes: The spatial first derivative of the structural component image is calculated using the Sobel operator, and the magnitude of the directional gradient is extracted to generate the gradient matrix of the structural edge. The boundary constraint weights, which are positively correlated with the distribution entropy, are generated by adding the preset benchmark constant to the product of the uncertainty measure and the preset proportional coefficient. First, the gradient matrix of the structure edge is normalized to the same numerical scale as the initial segmentation result mask. Then, the normalized gradient matrix of the structure edge is weighted using the boundary constraint weights to obtain the gradient deviation correction matrix. The initial segmentation result mask is subtracted from the gradient deviation correction matrix for pixel-level shrinkage correction, and then subjected to truncation quantization to generate the defect segmentation image.
[0013] Secondly, the present invention also provides a segmentation system for surface defect images of hot-rolled nonwoven fabrics, comprising the following modules: A generation module is used to acquire the original image of surface defects of hot-rolled nonwoven fabric and perform structural and texture component separation to obtain structural component images and texture component images. The texture component image is input into the encoder of the segmentation network, where the encoder extracts candidate feature maps at multiple levels, and performs dimensional unification and fusion on the candidate feature maps at multiple levels to obtain a multi-scale fused feature map. Frequency channel attention calculation is performed on the multi-scale fused feature map, and a dynamic frequency remapping function is constructed based on the channel state of the multi-scale fused feature map. Two-dimensional discrete cosine transform is performed on each channel of the multi-scale fused feature map along multiple preset spatial angles to generate a multi-angle two-dimensional frequency spectrum. The dynamic frequency remapping function is used to perform amplitude weighting processing on the multi-angle two-dimensional frequency spectrum to obtain an enhanced multi-angle frequency feature vector. The enhanced multi-angle frequency feature vector is concatenated and input into a gated fusion unit to generate a channel attention weight vector, and the multi-scale fused feature map is weighted according to the channel to obtain an enhanced feature map. The segmentation module is used to input the enhanced feature map into the decoder of the segmentation network to generate a preliminary segmentation result mask; calculate the distribution entropy of the channel attention weight vector as an uncertainty measure; calculate the boundary constraint weights based on the uncertainty measure; and use the boundary constraint weights and the gradient of the structural component image to correct the preliminary segmentation result mask to generate a defect segmentation image.
[0014] Preferably, the step of acquiring the original image of the surface defects of the hot-rolled nonwoven fabric and performing structural-texture component separation to obtain structural component images and texture component images includes: A relative total variation model is used to calculate the total variation and the corresponding in-window spatial smoothing weights for each pixel of the original image of the surface defects of the hot-rolled nonwoven fabric. Based on the window-in-space smoothing weights, an energy objective function is constructed and minimized, and the spatial smoothing structure layer of the original image of the surface defects of the hot-rolled nonwoven fabric is iteratively solved. The original image of the surface defects of the hot-rolled nonwoven fabric is subtracted from the solved spatial smooth structure layer at the pixel level to extract the residual high-frequency pixel response. The absolute value of the high-frequency pixel response is linearly normalized to form the texture component image, and the spatial smooth structure layer is used as the structure component image.
[0015] Preferably, the step of constructing a dynamic frequency remapping function based on the channel states of the multi-scale fused feature map includes: The multi-scale fused feature maps are respectively input into the global average pooling layer and the global max pooling layer; The one-dimensional global average pooling vector and the one-dimensional global max pooling vector are spliced together to form a state vector with a length twice the number of channels of the multi-scale fused feature map. The state vector is input into a multilayer perceptron network, and a one-dimensional gain attenuation array is activated through nonlinear mapping. Based on the radial frequency mapping rule, the one-dimensional gain attenuation array is mapped to the corresponding two-dimensional frequency band coordinate position, thereby constructing the dynamic frequency remapping function that is consistent with the size of the multi-angle two-dimensional frequency spectrum.
[0016] Preferably, the step of performing a two-dimensional discrete cosine transform on each channel of the multi-scale fused feature map along multiple preset spatial angles to generate a multi-angle two-dimensional frequency spectrum includes: Construct four fixed spatial coordinate rotation angles, namely 0°, 45°, 90° and 135°; In each channel of the multi-scale fused feature map, bilinear interpolation resampling is performed according to the four spatial coordinate rotation angles, and the resampled feature map obtained after resampling is unified to a preset fixed size by cropping or zero padding, and four tilt direction feature sub-maps are extracted. For the four extracted tilted feature sub-maps, perform a forward two-dimensional discrete cosine transform along their respective length and width dimensions to calculate the projection inner product, generating four corresponding multi-angle two-dimensional discrete cosine coefficient frequency map sequences, which are then combined to form the multi-angle two-dimensional frequency spectrum.
[0017] Preferably, the step of using the dynamic frequency remapping function to perform amplitude weighting processing on the multi-angle two-dimensional frequency spectrum to obtain an enhanced multi-angle frequency feature vector includes: The energy scale data segment matrix composed of discrete cosine AC coefficients and DC coefficients in the multi-angle two-dimensional frequency spectrum is extracted by traversal. The energy scale data segment matrix is weighted by element-wise multiplication with the dynamic frequency remapping function to complete the numerical modulation update, resulting in a weighted response coefficient matrix layer. The weighted response coefficient matrix layer is then flattened to construct multiple sets of processed one-dimensional enhanced amplitude distribution responses as the enhanced multi-angle frequency feature vectors.
[0018] Preferably, the step of concatenating the enhanced multi-angle frequency feature vector and inputting it into the gated fusion unit to generate a channel attention weight vector includes: The enhanced multi-angle frequency feature vectors corresponding to each angle are sequentially concatenated to form a fixed-dimensional fully aggregated one-dimensional tensor. The fully aggregated one-dimensional tensor input includes a gated feedforward network containing two fully connected layers and an activation function to achieve linear and scaling hybrid logic mapping; The channel attention weight vector is generated by normalizing the mapping output to the range of 0 to 1 using the Sigmoid activation function.
[0019] Preferably, calculating the distribution entropy of the channel attention weight vector as an uncertainty measure includes: Take the absolute value of each feature weight element in the channel attention weight vector and divide it by the sum of the absolute values of all feature weight elements to obtain the normalized probability distribution value of each weight element. Based on the Shannon entropy formula, the product of each normalized probability distribution value and the natural logarithm is calculated; The negative summation of all product results is used as the distribution entropy to evaluate the uncertainty measure of the segmentation network in identifying defect information.
[0020] Preferably, the step of calculating boundary constraint weights based on the uncertainty metric, and using the boundary constraint weights and the gradient of the structural component image to correct the preliminary segmentation result mask to generate a defect segmentation image includes: The spatial first derivative of the structural component image is calculated using the Sobel operator, and the magnitude of the directional gradient is extracted to generate the gradient matrix of the structural edge. The boundary constraint weights, which are positively correlated with the distribution entropy, are generated by adding the preset benchmark constant to the product of the uncertainty measure and the preset proportional coefficient. First, the gradient matrix of the structure edge is normalized to the same numerical scale as the initial segmentation result mask. Then, the normalized gradient matrix of the structure edge is weighted using the boundary constraint weights to obtain the gradient deviation correction matrix. The initial segmentation result mask is subtracted from the gradient deviation correction matrix for pixel-level shrinkage correction, and then subjected to truncation quantization to generate the defect segmentation image.
[0021] This invention reduces the interference of complex background textures on defect recognition by separating the structure and texture components of the original image, allowing the network to focus more on local anomaly feature representation. During feature extraction, a dynamic frequency remapping function is constructed based on channel states, and a two-dimensional discrete cosine transform is performed along multiple spatial angles to generate a multi-angle two-dimensional frequency spectrum. This remapping function is used to weight the frequency spectrum by amplitude, and a gated fusion unit is combined to generate channel attention weights to enhance defect-related frequency domain features and suppress some redundant responses. Furthermore, the distribution entropy of the channel attention weight vector is calculated as an uncertainty measure, and boundary constraint weights are determined accordingly. The initial segmentation mask is then corrected using the gradient of the structure component image, improving the defect boundary localization effect and enhancing the accuracy and stability of defect image segmentation on the surface of hot-rolled nonwoven fabric. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of the 0° tilt direction feature sub-map; Figure 2 This is a schematic diagram of the tilt direction feature sub-map at 45°. Figure 3 This is a schematic diagram of the tilt direction feature sub-map at 90°. Figure 4 This is a schematic diagram of the tilt direction feature sub-figure 135°. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0024] This invention provides a method for segmenting images of surface defects in hot-rolled nonwoven fabrics, comprising the following steps: S1. Obtain the original image of the surface defects of the hot-rolled nonwoven fabric and perform structural and texture component separation to obtain structural component images and texture component images.
[0025] Raw images of surface defects in hot-rolled nonwoven fabric are acquired using an industrial camera and converted into a two-dimensional grayscale matrix. A bilateral filtering algorithm is then used to separate the structure and texture components of the two-dimensional grayscale matrix. Bilateral filtering considers both the spatial distance between pixels and the difference in grayscale values, performing joint smoothing of the original image in both the spatial and grayscale domains to reduce local high-frequency texture details while preserving the main edge structures. The smoothed image matrix obtained after filtering is used as the structure component image. Then, the original image matrix is subtracted pixel-by-pixel from the structure component image matrix to obtain a high-frequency residual matrix containing surface defect details and background texture residual information. The absolute value of the high-frequency residual matrix is taken and linearly normalized; this processed matrix is used as the texture component image.
[0026] In some embodiments, acquiring the original image of the surface defects of the hot-rolled nonwoven fabric and performing structural-texture component separation to obtain structural component images and texture component images includes: A relative total variation model is used to calculate the total variation and the corresponding in-window spatial smoothing weights for each pixel of the original image of the surface defects of the hot-rolled nonwoven fabric. Based on the window-in-space smoothing weights, an energy objective function is constructed and minimized, and the spatial smoothing structure layer of the original image of the surface defects of the hot-rolled nonwoven fabric is iteratively solved. The original image of the surface defects of the hot-rolled nonwoven fabric is subtracted from the solved spatial smooth structure layer at the pixel level to extract the residual high-frequency pixel response. The absolute value of the high-frequency pixel response is linearly normalized to form the texture component image, and the spatial smooth structure layer is used as the structure component image.
[0027] The system receives an original grayscale image of surface defects in a hot-rolled nonwoven fabric with dimensions set to 512×512×1 mm. A relative total variation model is used to separate the structure and texture of each pixel in the original image. During the calculation, a 15×15 Gaussian sliding window is selected as the support domain for the local spatial smoothing weights, with the Gaussian kernel standard deviation set to 3.0. Total variation in the horizontal and vertical directions is calculated for the original image to construct an energy objective function. This energy objective function includes a data fidelity term and a total variation smoothing regularization term. The data fidelity term constrains the grayscale difference between the solution result and the original image, while the total variation smoothing regularization term constrains the local variation amplitude of the spatial smoothing structure layer. The smoothing control parameter is set to 0.015, and the spatial correlation weight parameter of the relative total variation is set to 1e-3 to prevent the denominator from being zero. The preprocessed conjugate gradient method is used to iteratively minimize the energy objective function. The maximum number of iterations is set to 5, or the relative change of the energy term between two iterations is less than 1e-4, as a convergence condition. The output is a two-dimensional tensor of the spatial smoothing structure layer containing smooth edges and base strength.
[0028] The original image matrix, also with a size of 512×512, is subtracted element-wise from the obtained spatially smoothed structure layer matrix to obtain a high-frequency pixel response residual map containing only local minor oscillations. The absolute values of the residual responses of all pixels are extracted, preserving anomalous jumps in local texture intensity. A maximum-minimum normalization formula is used to map the numerical range of the absolute residual matrix to a closed interval of 0 to 1. The resulting normalized two-dimensional matrix constitutes the texture component image. The spatially smoothed structure layer obtained in the previous iterations is independently retained as the structure component image, used to assist in the extraction of structural gradients for defect boundary shrinkage correction in subsequent processes.
[0029] S2, the texture component image is input into the encoder of the segmentation network, the encoder extracts candidate feature maps of multiple levels, and the candidate feature maps of multiple levels are dimensionally unified and fused to obtain a multi-scale fused feature map.
[0030] A segmentation network encoder based on the ResNet50 backbone is constructed. The encoder includes an initial convolutional layer, a batch normalization layer, a ReLU activation layer, a max pooling layer, and four sequentially connected residual modules. A pre-trained ResNet50 model is called, its terminal fully connected classification layer is removed, and each residual module is retained as a feature extraction unit. The texture component image tensor obtained in the previous step is subjected to a dimensionality expansion operation to increase the batch dimension, forming a four-dimensional input tensor that meets the encoder's input format requirements. This four-dimensional input tensor is then input into the encoder.
[0031] During forward propagation, the texture component image sequentially passes through an initial convolutional layer, a batch normalization layer, a ReLU activation layer, a max pooling layer, and the first to fourth residual modules. Each residual module includes convolution operations, batch normalization operations, ReLU nonlinear activation operations, and residual connection operations. Four candidate feature tensors are extracted from the outputs of the first, second, third, and fourth residual modules, respectively. The spatial resolution of these four candidate feature tensors decreases sequentially, the number of channels increases sequentially, and their semantic expressive power increases sequentially.
[0032] Spatial size alignment and channel number unification are performed on the four candidate feature tensors respectively; spatial size alignment is achieved through bilinear interpolation upsampling or downsampling, and channel number unification is achieved through a 1×1 convolutional layer. The four processed candidate feature tensors are then weighted and summed according to preset fusion weights to generate a multi-scale fused feature map with uniform size.
[0033] S3, perform frequency channel attention calculation on the multi-scale fused feature map, construct a dynamic frequency remapping function based on the channel state of the multi-scale fused feature map, perform two-dimensional discrete cosine transform on each channel of the multi-scale fused feature map along multiple preset spatial angles to generate a multi-angle two-dimensional frequency spectrum, and use the dynamic frequency remapping function to perform amplitude weighting processing on the multi-angle two-dimensional frequency spectrum to obtain an enhanced multi-angle frequency feature vector.
[0034] For the extracted multi-scale fused feature map, a global pooling operation is performed to calculate the spatial statistics of each feature channel to represent the global channel state. This channel state tensor is input into a multilayer perceptron network containing a linear mapping layer and an activation function. Backpropagation is used to learn and generate band gain or attenuation weights, which serve as the dynamic frequency remapping function. The multi-scale fused feature map is subjected to rotational affine transformations at four preset spatial angles: 0°, 45°, 90°, and 135°. For each channel of the rotated feature map, a two-dimensional discrete cosine transform is performed to convert the spatial domain features to the frequency domain. Two-dimensional discrete cosine coefficients containing DC and AC coefficients are extracted according to a preset band selection rule, generating multi-angle two-dimensional frequency spectra corresponding to the four angles. Using the band gain or attenuation weights output by the multilayer perceptron network, element-wise multiplication is performed to weight and scale the amplitudes of the two-dimensional frequency spectra at the four angles. Finally, a flattening operation is performed along the spatial dimension to obtain an enhanced multi-angle frequency feature vector.
[0035] In some embodiments, constructing a dynamic frequency remapping function based on the channel states of the multi-scale fused feature map includes: The multi-scale fused feature maps are respectively input into the global average pooling layer and the global max pooling layer; The one-dimensional global average pooling vector and the one-dimensional global max pooling vector are spliced together to form a state vector with a length twice the number of channels of the multi-scale fused feature map. The state vector is input into a multilayer perceptron network, and a one-dimensional gain attenuation array is activated through nonlinear mapping. Based on the radial frequency mapping rule, the one-dimensional gain attenuation array is mapped to the corresponding two-dimensional frequency band coordinate position, thereby constructing the dynamic frequency remapping function that is consistent with the size of the multi-angle two-dimensional frequency spectrum.
[0036] For the multi-scale fused feature map with a resolution of 64×64 and 256 channels obtained after unifying and fusing the dimensions of candidate feature maps from multiple levels, global average pooling and global max pooling in the two-dimensional spatial domain are performed respectively. This operation calculates the arithmetic mean and peak value of all 4096 pixels along the spatial dimension of each channel, resulting in two one-dimensional feature vectors, each with a shape of 1×256. The two vectors are then concatenated along the channel dimension to generate a joint channel state vector with a total length of 512. This joint channel state vector can simultaneously identify the distribution trend of smooth background features in each channel of the feature map as well as the intensity peaks of high-frequency local anomalies.
[0037] The joint channel state vector of length 512 is input into a multilayer perceptron network containing two fully connected layers for nonlinear projection. The input to the multilayer perceptron network is the joint channel state vector of length 512, and its structure consists of a first fully connected layer, a modified linear unit activation function layer, and a second fully connected layer. The first fully connected layer serves as a dimensionality reduction layer, with 32 neurons corresponding to a dimensionality reduction ratio of 16, and is equipped with a modified linear unit activation function to increase nonlinear mapping capability. The second fully connected layer maps the feature dimensions to generate a one-dimensional gain attenuation array. The output of the multilayer perceptron network is a one-dimensional gain attenuation array of length 64, where the elements represent the adaptive weights of each frequency band subspace. Using the radial frequency mapping rule, this one-dimensional array is converted into a two-dimensional matrix: taking the upper left corner of a blank two-dimensional matrix of size 64×64 as the low-frequency origin, the Euclidean distance of each frequency domain coordinate relative to the low-frequency origin is calculated, and the Euclidean distance is normalized and divided into 64 discrete frequency band coordinate regions. The 64 weight values of the one-dimensional array are filled into the corresponding frequency band coordinate positions according to the index, thus constructing a 64×64 dynamic frequency remapping function matrix whose size matches the subsequent multi-angle frequency spectrum.
[0038] In some embodiments, performing a two-dimensional discrete cosine transform on each channel of the multi-scale fused feature map along multiple preset spatial angles to generate a multi-angle two-dimensional frequency spectrum includes: Construct four fixed spatial coordinate rotation angles, namely 0°, 45°, 90° and 135°; In each channel of the multi-scale fused feature map, bilinear interpolation resampling is performed according to the four spatial coordinate rotation angles, and the resampled feature map obtained after resampling is unified to a preset fixed size by cropping or zero padding, and four tilt direction feature sub-maps are extracted. For the four extracted tilted feature sub-maps, perform a forward two-dimensional discrete cosine transform along their respective length and width dimensions to calculate the projection inner product, generating four corresponding multi-angle two-dimensional discrete cosine coefficient frequency map sequences, which are then combined to form the multi-angle two-dimensional frequency spectrum.
[0039] Before performing frequency domain feature extraction, a two-dimensional affine transformation rotation matrix group is established with the center of the feature map as the geometric origin, and four fixed rotation angles are preset: 0° horizontal reference, 45° forward oblique cut, 90° orthogonal vertical cut, and 135° reverse oblique cut. For a multi-scale fused feature map with a size of 64×64 and 256 channels, spatial domain data is read channel by channel. For each feature channel matrix, the aforementioned four affine rotation matrices are applied for spatial reconstruction. During geometric rotation, bilinear interpolation is used to calculate the pixel intensity of non-integer coordinate points after grid deviation. The reshaping boundary is adjusted by centering or padding with zero values around the perimeter, and the feature map after bilinear interpolation resampling is normalized to a reference resolution size of 64×64. Four tilted feature sub-maps of the same size and with a unified coordinate reference are extracted in a single channel. Figures 1 to 4 As shown, the tilt direction feature sub-maps extracted at four preset spatial angles of 0°, 45°, 90° and 135° are shown respectively. Each directional feature sub-map is used to characterize the response intensity distribution of nonwoven fabric texture and defects in different spatial directions.
[0040] After direction extraction, a discrete cosine orthogonal transform (DCT) algorithm is used to independently calculate the two-dimensional discrete cosine forward projection inner product along the horizontal and vertical axes of the four 64×64 directional feature sub-maps extracted for each channel. This process converts the spatial domain luminance pixel sequence into a 64×64 frequency domain coefficient matrix. The upper left corner of the matrix contains low-frequency DC coefficients representing the background illuminance features of the image, while the remaining parts contain high-frequency AC coefficients representing directional abrupt changes such as subtle texture edges. For the 256 channels in the entire multi-scale fused feature map, this step generates a total of 1024 64×64 discrete cosine coefficient frequency map sequence matrices. Stacking and aggregation operations are performed on these matrix layers along the viewpoint and channel dimensions to generate a four-dimensional tensor of size 4×256×64×64, forming a multi-angle two-dimensional frequency spectrum.
[0041] In some embodiments, the step of using the dynamic frequency remapping function to perform amplitude weighting processing on the multi-angle two-dimensional frequency spectrum to obtain an enhanced multi-angle frequency feature vector includes: The energy scale data segment matrix composed of discrete cosine AC coefficients and DC coefficients in the multi-angle two-dimensional frequency spectrum is extracted by traversal. The energy scale data segment matrix is weighted by element-wise multiplication with the dynamic frequency remapping function to complete the numerical modulation update, resulting in a weighted response coefficient matrix layer. The weighted response coefficient matrix layer is then flattened to construct multiple sets of processed one-dimensional enhanced amplitude distribution responses as the enhanced multi-angle frequency feature vectors.
[0042] Using the previously constructed 4×256×64×64 dimensional multi-angle two-dimensional frequency spectrum tensor as input, the intersection data of each directional angle and channel index is scanned one by one to locate and extract a 64×64 matrix patch at each independent channel and viewpoint position. This data matrix contains a low-frequency DC coefficient reflecting the reference intensity of illumination at the origin of the coordinate system, and 4095 discrete cosine AC coefficients representing the full-band texture oscillation characteristics occupying the remaining coordinates, forming an energy scaling data segment matrix unique to each slice. A dynamic frequency remapping function mask with a size of 64×64, previously calculated and synthesized by a multilayer perceptron, is then retrieved.
[0043] Element-wise matrix multiplication is performed on the separated energy-scaled data segment matrix and the corresponding dynamic frequency remapping function mask. This operation assigns the radial gain or attenuation weights recorded in the mapping function to AC and DC coefficients on different frequency band coordinates, enhancing the target frequency band response related to defects such as burrs and fiber breakage, and suppressing some low-frequency redundant responses. This completes adaptive numerical modulation and outputs a 64×64 weighted response coefficient matrix layer. A flattening operation is invoked to sequentially read the two-dimensional data of this weighted matrix layer along the spatial rows and columns, flattening the two-dimensional data from a grid arrangement into a single-row one-dimensional feature column vector containing 4096 consecutive elements. After traversing all angle and channel parameters, a total of 1024 (4×256) one-dimensional enhanced amplitude distribution response vectors are output, forming an enhanced multi-angle frequency feature vector set.
[0044] S4. The enhanced multi-angle frequency feature vector is concatenated and input into the gated fusion unit to generate a channel attention weight vector. The enhanced feature map is obtained by weighting the multi-scale fusion feature map according to the channel.
[0045] The previously generated enhanced multi-angle frequency feature vectors are concatenated along the angular dimension to form a joint frequency feature vector. This joint frequency feature vector is input into a gated fusion unit, which generates corresponding channel attention weights for each channel of the multi-scale fused feature map. The output is mapped to the 0-1 interval using a Sigmoid activation function to generate a channel attention weight vector. The dimension of this channel attention weight vector is expanded to match the spatial dimension of the multi-scale fused feature map, and each channel of the multi-scale fused feature map is weighted and calibrated by element-wise multiplication to output an enhanced feature map that highlights defect-related features and suppresses nonwoven background noise.
[0046] In some embodiments, the step of concatenating the enhanced multi-angle frequency feature vector and inputting it into a gated fusion unit to generate a channel attention weight vector includes: The enhanced multi-angle frequency feature vectors corresponding to each angle are sequentially concatenated to form a fixed-dimensional fully aggregated one-dimensional tensor. The fully aggregated one-dimensional tensor input includes a gated feedforward network containing two fully connected layers and an activation function to achieve linear and scaling hybrid logic mapping; The channel attention weight vector is generated by normalizing the mapping output to the range of 0 to 1 using the Sigmoid activation function.
[0047] For the frequency domain tensor branches corresponding to the four azimuth angles (0°, 45°, 90°, and 135°) of each channel in the multi-scale fused feature map, the length of the enhanced multi-angle frequency feature vector for a single viewpoint is 4096. The feature column vectors are sequentially concatenated according to the order of the four preset spatial angles. After concatenation, a single channel-level fully aggregated one-dimensional tensor with a length of 16384 (4096×4) is generated. This concatenation and fusion operation identifies the cross-directional frequency domain coupling information of the target pixel region, realizing one-dimensional reconstruction of multi-directional spatial frequency signals within a single channel, and sends it to the gated fusion unit. The gated fusion unit uses a shared gated feedforward network for feature dimensionality reduction.
[0048] The gated feedforward network takes a 16384-channel-level fully aggregated one-dimensional tensor as input. Its structure consists of a first fully connected layer, a Gaussian error linear unit (Gaussian error linear unit) intermediate activation layer, and a second fully connected layer. This channel-level fully aggregated one-dimensional tensor is input to the first fully connected neural network for dimensionality reduction, and the output uses a Gaussian error linear unit as an intermediate activation function. The second fully connected layer maps the dimensionality-reduced features to the attention weight scalars corresponding to the current channel. After traversing all channels in the multi-scale fused feature map, the attention weight scalars corresponding to each channel are concatenated in channel order to generate a 256-dimensional channel attention weight vector. The Sigmoid activation function is then used to map the channel attention weight vector to the interval between 0.0 and 1.0, generating a channel attention weight vector used as a global feature multiplication filtering mechanism to control the activation level.
[0049] S5, input the enhanced feature map into the decoder of the segmentation network to generate a preliminary segmentation result mask.
[0050] A decoder with a feature pyramid network structure is constructed. A bilinear interpolation algorithm is used to progressively upsample and enlarge the enhanced feature map, gradually restoring its spatial size to the original image size. During the upsampling stage, shallow spatial detail features at the corresponding depth in the encoder are spliced with deep semantic features of the current decoding layer along the channel dimension using skip connections. The spliced fused features are then sequentially processed with a 3×3 convolutional layer, a batch normalization layer, and a ReLU activation function for channel dimensionality reduction and feature refinement. At the end of the decoder, a 1×1 convolutional layer is added to reduce the number of feature channels to 2, and a softmax function is called to calculate the binary classification probability of each spatial pixel for defects and background, outputting a preliminary segmentation mask containing the probability distribution value of each pixel belonging to the defect category.
[0051] S6, calculate the distribution entropy of the channel attention weight vector as an uncertainty measure, calculate the boundary constraint weights based on the uncertainty measure, and use the boundary constraint weights and the gradient of the structural component image to correct the preliminary segmentation result mask to generate a defect segmentation image.
[0052] The distribution entropy of the channel attention weight vector output by the gated fusion unit is calculated using an information entropy calculation algorithm. In implementation, the absolute value of each weight in the channel attention weight vector is first taken and normalized to obtain a normalized probability distribution value. The natural logarithm of the normalized probability distribution value is calculated, and the natural logarithm is multiplied element-wise with the corresponding normalized probability distribution value, then summed along the channel dimension. The summation result is negative, and the resulting scalar value is used as the uncertainty measure of the model prediction. A proportionality constant greater than 0 and a basic bias constant are set. The uncertainty measure is multiplied by the proportionality constant and then added to the basic bias constant to obtain the boundary constraint weights. This ensures that the higher the uncertainty of the model, the larger the boundary constraint weights are assigned, satisfying the positive correlation condition.
[0053] The Sobel function is called to calculate the first-order spatial derivatives in the horizontal and vertical directions of the structural component image obtained in the first step. The gradient magnitude matrix of the structural component image is obtained by taking the square root of the sum of the squares of the two directional derivatives. The gradient magnitude matrix is linearly mapped to the interval between 0 and 1 using the minimax normalization algorithm. The normalized gradient magnitude matrix is multiplied by the boundary constraint weight scalar to generate the gradient bias correction matrix. The gradient bias correction matrix is subtracted from the defect probability matrix in the initial segmentation result mask, and a threshold truncation process is applied to complete the defect boundary shrinkage correction, outputting a defect segmentation image containing two pixel values: 0 and 255.
[0054] In some embodiments, calculating the distribution entropy of the channel attention weight vector as an uncertainty measure includes: Take the absolute value of each feature weight element in the channel attention weight vector and divide it by the sum of the absolute values of all feature weight elements to obtain the normalized probability distribution value of each weight element. Based on the Shannon entropy formula, the product of each normalized probability distribution value and the natural logarithm is calculated; The negative summation of all product results is used as the distribution entropy to evaluate the uncertainty measure of the segmentation network in identifying defect information.
[0055] For a one-dimensional channel attention weight vector of length 256 output by a gating network mapped through a Sigmoid activation function, 256 feature weight values are read from this array. The absolute value of each weight value is taken, and the sum of these 256 absolute values is calculated. The 256 absolute values of the feature weights are iterated over, and each is divided by the sum of the calculated absolute values. This process generates relative values between 0 and 1, with a sum always equal to 1, forming a set of normalized probability distribution values. After obtaining the normalized probability distribution values, the entropy value is calculated based on the Shannon entropy formula. For each independent normalized probability distribution value p, the natural logarithm ln(p) is calculated. To prevent computational errors, a very small positive offset, such as 1e-7, is assigned to the variable p in the logarithm calculation. After obtaining the logarithm result, the result is multiplied by its respective probability value. The 256 calculated scalar values of the multiplication are summed, and the sum is negative to obtain the scalar distribution entropy result. This entropy value is used as a measure of uncertainty to indicate the confidence level of the model's predictions when identifying edge and subtle defect features.
[0056] In some embodiments, the step of calculating boundary constraint weights based on the uncertainty metric and using the boundary constraint weights and the gradient of the structural component image to correct the preliminary segmentation result mask to generate a defect segmentation image includes: The spatial first derivative of the structural component image is calculated using the Sobel operator, and the magnitude of the directional gradient is extracted to generate the gradient matrix of the structural edge. The boundary constraint weights, which are positively correlated with the distribution entropy, are generated by adding the preset benchmark constant to the product of the uncertainty measure and the preset proportional coefficient. First, the gradient matrix of the structure edge is normalized to the same numerical scale as the initial segmentation result mask. Then, the normalized gradient matrix of the structure edge is weighted using the boundary constraint weights to obtain the gradient deviation correction matrix. The initial segmentation result mask is subtracted from the gradient deviation correction matrix for pixel-level shrinkage correction, and then subjected to truncation quantization to generate the defect segmentation image.
[0057] Using a smooth structural component image of size 512×512 as a spatially constrained base map, the entire image is convolved and filtered along the horizontal axis X and vertical axis Y using a standard Sobel operator of size 3×3, and the spatial first derivative distribution map is calculated. and The absolute magnitude of the total composite directional gradient is extracted pixel-by-pixel using the square root of the sum of squares algorithm, generating a 512×512 two-dimensional tensor of the structural edge gradient matrix. Using the uncertainty metric parameter H, combined with a preset baseline constant of 0.5 and a preset scaling factor of 0.2, the gradient is calculated according to the formula... Calculate the scalar coefficients of the output boundary constraint weights. First, map the two-dimensional gradient matrix of the structure's edge to the interval of 0 to 1 using maximum-minimum normalization. Then, combine the normalized two-dimensional gradient matrix of the structure's edge with the boundary constraint weight coefficients. Element-wise scalar multiplication and weighting, followed by amplitude limiting, yields a gradient bias correction matrix consistent with the size and numerical scale of the initial segmentation result mask. The initial segmentation result mask is then subtracted from this gradient bias correction matrix at the pixel level to suppress mis-segmented regions extending to normal texture boundaries. Truncated quantization is performed using a binary function with a threshold of 0.5 to remove negative values, generating the defect segmentation image matrix.
[0058] The experiment included four sets of ablation conditions for comparative verification. The first set of baseline experiments directly input the original image of the hot-rolled nonwoven fabric into a conventional segmentation network for defect identification. The second set of experiments added a relative total variation model to the baseline for image preprocessing to separate the structural and texture components. The third set of experiments, building upon the second set, incorporated a multi-angle two-dimensional discrete cosine transform and a dynamic frequency remapping amplitude-weighted feature fusion module. The fourth set represented the complete technical solution presented in this paper, adding an uncertainty measure based on the channel attention weight distribution entropy and a structural edge constraint correction mechanism to the third set.
[0059] The baseline experiment in the first group achieved an average intersection-over-union (IoU) ratio of 72.5% and a segmentation accuracy of 85.3%. The second group, due to improved input quality, saw its IoU increase to 76.8% and its accuracy reach 88.2%. The third group's IoU climbed to 82.4% and its accuracy increased to 91.6%. The fourth group, with its complete solution, achieved superior performance under these experimental conditions, with an average IoU of 86.9% and a segmentation accuracy of 94.5%.
[0060] By separating structure and texture, interference from smooth background lighting can be reduced, allowing the feature extractor to focus more on identifying local abrupt anomalies. A multi-angle frequency domain remapping weighting mechanism enhances the target frequency band response representing subtle defects such as fiber breaks, improving the network's ability to detect subtle defects in multiple directions. A constraint mechanism combining distribution entropy calculation applies structural gradient constraints to uncertain inference regions, utilizing structural edge information for pixel-level deviation shrinkage correction. This reduces missegmentation extending into normal regions to some extent and improves the fit between defect contours and true boundaries.
[0061] This invention also proposes a segmentation system for surface defect images of hot-rolled nonwoven fabrics, comprising the following modules: A generation module is used to acquire the original image of surface defects of hot-rolled nonwoven fabric and perform structural and texture component separation to obtain structural component images and texture component images. The texture component image is input into the encoder of the segmentation network, where the encoder extracts candidate feature maps at multiple levels, and performs dimensional unification and fusion on the candidate feature maps at multiple levels to obtain a multi-scale fused feature map. Frequency channel attention calculation is performed on the multi-scale fused feature map, and a dynamic frequency remapping function is constructed based on the channel state of the multi-scale fused feature map. Two-dimensional discrete cosine transform is performed on each channel of the multi-scale fused feature map along multiple preset spatial angles to generate a multi-angle two-dimensional frequency spectrum. The dynamic frequency remapping function is used to perform amplitude weighting processing on the multi-angle two-dimensional frequency spectrum to obtain an enhanced multi-angle frequency feature vector. The enhanced multi-angle frequency feature vector is concatenated and input into a gated fusion unit to generate a channel attention weight vector, and the multi-scale fused feature map is weighted according to the channel to obtain an enhanced feature map. The segmentation module is used to input the enhanced feature map into the decoder of the segmentation network to generate a preliminary segmentation result mask; calculate the distribution entropy of the channel attention weight vector as an uncertainty measure; calculate the boundary constraint weights based on the uncertainty measure; and use the boundary constraint weights and the gradient of the structural component image to correct the preliminary segmentation result mask to generate a defect segmentation image.
[0062] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0063] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for segmenting images of surface defects in hot-rolled nonwoven fabrics, characterized in that, Includes the following steps: The original image of the surface defects of the hot-rolled nonwoven fabric is obtained and the structure and texture components are separated to obtain the structure component image and the texture component image. The texture component image is input into the encoder of the segmentation network, the encoder extracts candidate feature maps at multiple levels, and the candidate feature maps at multiple levels are dimension-unified and fused to obtain a multi-scale fused feature map. Frequency channel attention calculation is performed on the multi-scale fused feature map. A dynamic frequency remapping function is constructed based on the channel state of the multi-scale fused feature map. Two-dimensional discrete cosine transform is performed on each channel of the multi-scale fused feature map along multiple preset spatial angles to generate a multi-angle two-dimensional frequency spectrum. The multi-angle two-dimensional frequency spectrum is then subjected to amplitude weighting processing using the dynamic frequency remapping function to obtain an enhanced multi-angle frequency feature vector. The enhanced multi-angle frequency feature vector is concatenated and input into the gated fusion unit to generate a channel attention weight vector. The multi-scale fused feature map is then weighted according to the channel to obtain the enhanced feature map. The enhanced feature map is input into the decoder of the segmentation network to generate a preliminary segmentation result mask; The distribution entropy of the channel attention weight vector is calculated as an uncertainty measure. Boundary constraint weights are calculated based on the uncertainty measure. The preliminary segmentation result mask is corrected using the boundary constraint weights and the gradient of the structural component image to generate a defect segmentation image.
2. The method according to claim 1, characterized in that, The process of acquiring the original image of the surface defects of the hot-rolled nonwoven fabric and performing structural-texture component separation to obtain structural component images and texture component images includes: A relative total variation model is used to calculate the total variation and the corresponding in-window spatial smoothing weights for each pixel of the original image of the surface defects of the hot-rolled nonwoven fabric. Based on the window-in-space smoothing weights, an energy objective function is constructed and minimized, and the spatial smoothing structure layer of the original image of the surface defects of the hot-rolled nonwoven fabric is iteratively solved. The original image of the surface defects of the hot-rolled nonwoven fabric is subtracted from the solved spatial smooth structure layer at the pixel level to extract the residual high-frequency pixel response. The absolute value of the high-frequency pixel response is linearly normalized to form the texture component image, and the spatial smooth structure layer is used as the structure component image.
3. The method according to claim 2, characterized in that, The construction of the dynamic frequency remapping function based on the channel states of the multi-scale fused feature map includes: The multi-scale fused feature maps are respectively input into the global average pooling layer and the global max pooling layer; The one-dimensional global average pooling vector and the one-dimensional global max pooling vector are spliced together to form a state vector with a length twice the number of channels of the multi-scale fused feature map. The state vector is input into a multilayer perceptron network, and a one-dimensional gain attenuation array is activated through nonlinear mapping. Based on the radial frequency mapping rule, the one-dimensional gain attenuation array is mapped to the corresponding two-dimensional frequency band coordinate position, thereby constructing the dynamic frequency remapping function that is consistent with the size of the multi-angle two-dimensional frequency spectrum.
4. The method according to claim 1, characterized in that, The step of performing a two-dimensional discrete cosine transform on each channel of the multi-scale fused feature map along multiple preset spatial angles to generate a multi-angle two-dimensional frequency spectrum includes: Construct four fixed spatial coordinate rotation angles, namely 0°, 45°, 90° and 135°; In each channel of the multi-scale fused feature map, bilinear interpolation resampling is performed according to the four spatial coordinate rotation angles, and the resampled feature map obtained after resampling is unified to a preset fixed size by cropping or zero padding, and four tilt direction feature sub-maps are extracted. For the four extracted tilted feature sub-maps, perform a forward two-dimensional discrete cosine transform along their respective length and width dimensions to calculate the projection inner product, generating four corresponding multi-angle two-dimensional discrete cosine coefficient frequency map sequences, which are then combined to form the multi-angle two-dimensional frequency spectrum.
5. The method according to claim 1, characterized in that, The step of using the dynamic frequency remapping function to perform amplitude weighting processing on the multi-angle two-dimensional frequency spectrum to obtain an enhanced multi-angle frequency feature vector includes: The energy scale data segment matrix composed of discrete cosine AC coefficients and DC coefficients in the multi-angle two-dimensional frequency spectrum is extracted by traversal. The energy scale data segment matrix is weighted by element-wise multiplication with the dynamic frequency remapping function to complete the numerical modulation update, resulting in a weighted response coefficient matrix layer. The weighted response coefficient matrix layer is then flattened to construct multiple sets of processed one-dimensional enhanced amplitude distribution responses as the enhanced multi-angle frequency feature vectors.
6. The method according to claim 1, characterized in that, The enhanced multi-angle frequency feature vector is concatenated and input into the gated fusion unit to generate a channel attention weight vector, including: The enhanced multi-angle frequency feature vectors corresponding to each angle are sequentially concatenated to form a fixed-dimensional fully aggregated one-dimensional tensor. The fully aggregated one-dimensional tensor input includes a gated feedforward network containing two fully connected layers and an activation function to achieve linear and scaling hybrid logic mapping; The channel attention weight vector is generated by normalizing the mapping output to the range of 0 to 1 using the Sigmoid activation function.
7. The method according to claim 5, characterized in that, The calculation of the distribution entropy of the channel attention weight vector as an uncertainty measure includes: Take the absolute value of each feature weight element in the channel attention weight vector and divide it by the sum of the absolute values of all feature weight elements to obtain the normalized probability distribution value of each weight element. Based on the Shannon entropy formula, the product of each normalized probability distribution value and the natural logarithm is calculated; The negative summation of all product results is used as the distribution entropy to evaluate the uncertainty measure of the segmentation network in identifying defect information.
8. The method according to claim 1, characterized in that, The step of calculating boundary constraint weights based on the uncertainty metric, and then using the boundary constraint weights and the gradient of the structural component image to correct the preliminary segmentation result mask to generate a defect segmentation image includes: The spatial first derivative of the structural component image is calculated using the Sobel operator, and the magnitude of the directional gradient is extracted to generate the gradient matrix of the structural edge. The boundary constraint weights, which are positively correlated with the distribution entropy, are generated by adding the preset benchmark constant to the product of the uncertainty measure and the preset proportional coefficient. First, the gradient matrix of the structure edge is normalized to the same numerical scale as the initial segmentation result mask. Then, the normalized gradient matrix of the structure edge is weighted using the boundary constraint weights to obtain the gradient deviation correction matrix. The initial segmentation result mask is subtracted from the gradient deviation correction matrix for pixel-level shrinkage correction, and then subjected to truncation quantization to generate the defect segmentation image.
9. A segmentation system for surface defect images of hot-rolled nonwoven fabrics, characterized in that, Includes the following modules: The generation module is used to acquire the original image of surface defects of hot-rolled nonwoven fabric and perform structural texture component separation to obtain structural component image and texture component image; The texture component image is input into the encoder of the segmentation network, the encoder extracts candidate feature maps at multiple levels, and the candidate feature maps at multiple levels are dimension-unified and fused to obtain a multi-scale fused feature map. Frequency channel attention calculation is performed on the multi-scale fused feature map. A dynamic frequency remapping function is constructed based on the channel state of the multi-scale fused feature map. Two-dimensional discrete cosine transform is performed on each channel of the multi-scale fused feature map along multiple preset spatial angles to generate a multi-angle two-dimensional frequency spectrum. The multi-angle two-dimensional frequency spectrum is then subjected to amplitude weighting processing using the dynamic frequency remapping function to obtain an enhanced multi-angle frequency feature vector. The enhanced multi-angle frequency feature vector is concatenated and input into the gated fusion unit to generate a channel attention weight vector. The multi-scale fused feature map is then weighted according to the channel to obtain the enhanced feature map. The segmentation module is used to input the enhanced feature map into the decoder of the segmentation network to generate a preliminary segmentation result mask; The distribution entropy of the channel attention weight vector is calculated as an uncertainty measure. Boundary constraint weights are calculated based on the uncertainty measure. The preliminary segmentation result mask is corrected using the boundary constraint weights and the gradient of the structural component image to generate a defect segmentation image.
10. The system according to claim 9, characterized in that, The process of acquiring the original image of the surface defects of the hot-rolled nonwoven fabric and performing structural-texture component separation to obtain structural component images and texture component images includes: A relative total variation model is used to calculate the total variation and the corresponding in-window spatial smoothing weights for each pixel of the original image of the surface defects of the hot-rolled nonwoven fabric. Based on the window-in-space smoothing weights, an energy objective function is constructed and minimized, and the spatial smoothing structure layer of the original image of the surface defects of the hot-rolled nonwoven fabric is iteratively solved. The original image of the surface defects of the hot-rolled nonwoven fabric is subtracted from the solved spatial smooth structure layer at the pixel level to extract the residual high-frequency pixel response. The absolute value of the high-frequency pixel response is linearly normalized to form the texture component image, and the spatial smooth structure layer is used as the structure component image.
