Industrial visual intelligent on-line detection system for texture flaws of fiber products

By using spatial transformation networks and multi-scale feature masking encoding technology, the detection difficulties caused by non-rigid deformation in the detection of texture defects in fiber products have been solved, achieving high-precision and robust fiber product defect detection.

CN122048877APending Publication Date: 2026-05-15XINYANG QUALITY & TECH SUPERVISION INSPECTION & TESTING CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610145395.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-02
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing fiber product texture defect detection technologies struggle to achieve high-precision detection under non-rigid deformation conditions, leading to high false alarm rates or high false negative rates. This is mainly because traditional algorithms assume pixel-level alignment cannot be met, and weighting strategies lack spatial awareness.

Method used

Geometric adaptive calibration is performed using a spatial transformation network. Through multi-scale feature masking encoding and adaptive gating fusion mechanism, the weight allocation is dynamically adjusted. Combined with inverse mapping technology, geometric correction and texture reconstruction of fiber product images are achieved, generating flawless reference images.

Benefits of technology

High-precision robust detection is achieved in non-rigid dynamic scenarios, reducing false alarm rate and improving the detection sensitivity of minute defects, ensuring the accuracy and reliability of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122048877A_ABST
    Figure CN122048877A_ABST
Patent Text Reader

Abstract

The invention provides an industrial vision intelligent online detection system for texture flaws of fiber products, which relates to the technical field of industrial machine vision and is characterized in that a spatial transformation network is introduced, differentiable geometric adaptive calibration is carried out on continuously acquired image streams, distorted fabric textures are mapped to a standard space, and the texture flaws of the fiber products are detected. And interference of physical deformation on detection is effectively eliminated. On this basis, a flawless ideal texture reference is generated by using a random block mask and pyramid feature reconstruction mechanism, and gradient sensing type adaptive difference calculation is performed on the calibrated image and the reconstructed image in combination with a texture gradient field of a reconstruction domain. And finally, accurately restoring the abnormal thermodynamic diagram of the calibration domain to a physical coordinate system through a reverse re-projection technology of a transformation grid, thereby realizing high-precision and anti-interference online detection of fine texture flaws on the surface of the fiber product in a dynamic deformation environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of industrial machine vision technology, and more specifically, to an industrial visual intelligent online detection system for texture defects in fiber products. Background Technology

[0002] With the continuous improvement of automation in the textile industry, modern weaving production lines have placed extremely high demands on the production speed and quality control of fiber products. To replace inefficient and fatigue-prone manual visual inspection, intelligent online inspection systems based on machine vision have become key equipment for ensuring product yield. However, unlike rigid industrial products such as metals and electronic components, fiber products have significant flexible manifold structural characteristics. During high-speed transport and weaving, the fabric surface inevitably undergoes non-rigid physical deformations such as stretching, shearing, and twisting due to tension fluctuations and mechanical vibrations. This complex dynamic characteristic presents a severe technical challenge to high-precision automated visual inspection.

[0003] Existing texture defect detection technologies, whether traditional algorithms based on standard template matching or unsupervised reconstruction methods based on autoencoders, typically rely on the assumption that the test image and reference sample can achieve strict pixel-level alignment. However, in real-world industrial scenarios, due to the non-rigid deformation of fabrics, even qualified products cannot correspond one-to-one with the standard template in pixel coordinates. This microscopic geometric misalignment leads to algorithms calculating huge differences in pixel grayscale, thus misjudging normal physical deformations as texture defects, resulting in a very high false alarm rate in texture-rich areas. Furthermore, existing technologies often employ globally fixed weight strategies to fuse pixel-level and structural differences when calculating anomaly heatmaps. This static mechanism lacks spatial awareness of the local texture complexity and registration uncertainty of the image, and cannot dynamically adjust the discrimination criteria based on regional features. This directly leads to a technical dilemma: if sensitivity is reduced to suppress registration artifacts in textured areas, light-colored oil stains in flat areas will be missed; if sensitivity is increased, false alarms at texture edges cannot be controlled.

[0004] Therefore, an optimized industrial visual intelligent online detection system for texture defects in fiber products is desired. Summary of the Invention

[0005] To address the aforementioned technical problems, this application is proposed. Embodiments of this application provide an industrial visual intelligent online inspection system for texture defects in fiber products, comprising: The image acquisition and preprocessing module is used to respond to the encoder trigger signal of the industrial line scan camera to perform region of interest segmentation and normalization processing on the acquired continuous grayscale image stream of fiber products to obtain the source image tensor of the fiber products. The geometric adaptive calibration module is used to perform geometric adaptive calibration on the source image tensor of fiber products based on a spatial transformation network to obtain the calibrated fiber product image tensor and the transformation grid matrix. The multi-scale feature mask encoding module is used to perform random block masking on the tensor of the calibration fiber product image and then input it into the feature encoder for multi-scale feature mask encoding to obtain a multi-scale feature list of the fiber product. The structure perception and texture reconstruction module is used to perform structure perception and texture detail reconstruction on the multi-scale feature list of fiber products to obtain the reconstructed fiber product image tensor. The difference map calculation and inverse mapping module is used to perform difference map calculation and inverse spatial mapping on the tensor of calibrated fiber product images and the tensor of reconstructed fiber product images based on the transformed grid matrix to obtain a physical coordinate anomaly heat map. The defect segmentation and analysis module is used to perform adaptive threshold segmentation and connected component filtering analysis on the physical coordinate anomaly heatmap to obtain defect result data containing the location and type of defects.

[0006] Compared with existing technologies, the fiber product texture defect industrial visual intelligent online detection system provided in this application first utilizes an embedded spatial transformation network to perform geometric adaptive calibration on a continuously acquired fabric image stream. By regressing affine parameters and performing differentiable sampling, the non-rigidly deformed fabric is automatically corrected to a standard space, eliminating geometric misalignment interference caused by mechanical stretching at the source. Then, a generative network based on multi-scale feature masks is employed to reconstruct an ideal defect-free reference image using texture context information. Based on this, an adaptive gated fusion mechanism based on the texture gradient of the reconstruction domain is introduced. This mechanism dynamically adjusts the weight allocation of pixel-level differences and structural similarity according to the local texture complexity. In texture-rich regions, structural metrics are used to suppress registration artifacts, while in flat regions, pixel metrics are used to keenly capture subtle color differences. Finally, through inverse spatial mapping, the abnormal results of the calibration domain are accurately restored to the physical coordinate system, achieving high-precision and robust detection of various minute defects in non-rigid dynamic scenes. Attached Figure Description

[0007] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.

[0008] Figure 1 This is a system block diagram of an industrial visual intelligent online detection system for texture defects in fiber products according to an embodiment of this application; Figure 2This is a schematic diagram of the data flow of an industrial visual intelligent online detection system for texture defects in fiber products according to an embodiment of this application; Figure 3 This is a block diagram of the geometric adaptive calibration module in the industrial visual intelligent online detection system for texture defects in fiber products according to an embodiment of this application; Figure 4 This is a block diagram of the structure perception and texture reconstruction module in the industrial visual intelligent online detection system for texture defects in fiber products according to an embodiment of this application; Figure 5 This is a block diagram of the difference map calculation and reverse mapping module in the industrial visual intelligent online detection system for texture defects in fiber products according to an embodiment of this application; Figure 6 This is a block diagram of the difference calculation unit in the industrial visual intelligent online detection system for texture defects in fiber products according to an embodiment of this application. Detailed Implementation

[0009] Hereinafter, exemplary embodiments according to this application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein.

[0010] As indicated in this application and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not specifically singular and may include plural forms. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.

[0011] While this application makes various references to certain modules of the systems according to embodiments of this application, any number of different modules can be used and run on user terminals and / or servers. The modules described are merely illustrative, and different aspects of the systems and methods may use different modules.

[0012] Flowcharts are used in this application to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, various steps can be processed in reverse order or simultaneously as needed. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.

[0013] Existing fiber product texture defect detection technologies are typically based on the assumption of strict pixel alignment between the image under test and a standard template. However, in high-speed transmission in industrial settings, flexible fabrics inevitably experience non-rigid deformations such as stretching and shaking. This geometric misalignment makes it difficult for traditional algorithms to decouple normal deformation from actual defects, often leading to numerous false alarms in textured areas due to registration errors, or sacrificing the detection sensitivity of minor defects in flat areas to suppress false alarms. Therefore, this application proposes an industrial visual intelligent online detection system for fiber product texture defects. Specifically, the system first uses an embedded spatial transformation network to perform geometric adaptive calibration on the acquired fabric image stream. By regressing affine parameters and performing differentiable sampling, the non-rigidly deformed fabric is automatically corrected to the standard space, eliminating geometric misalignment interference caused by physical stretching at the source. Subsequently, a generative network based on multi-scale feature masks is used to perform random masking and multi-level feature extraction on the calibrated image, reconstructing an ideal flawless reference image using texture context information. Building upon this foundation, an adaptive gated fusion mechanism based on the texture gradient of the reconstruction domain is introduced. This mechanism dynamically adjusts the weight allocation of pixel-level differences and structural similarities according to the local texture complexity. In texture-rich regions, structural metrics are used to effectively suppress registration artifacts, while in flat regions, pixel metrics are used to keenly capture subtle color differences. Finally, based on the transformed mesh matrix, the abnormal results of the calibration domain are accurately mapped back to the physical coordinate system. This solves the technical contradiction between high false alarms and missed detection of subtle defects under complex textures while ensuring the positioning accuracy of industrial robots.

[0014] Figure 1 This is a system block diagram of an industrial visual intelligent online detection system for texture defects in fiber products according to an embodiment of this application. Figure 2 This is a schematic diagram of the data flow in an industrial visual intelligent online detection system for texture defects in fiber products according to an embodiment of this application. Figure 1 and Figure 2As shown, the fiber product texture defect industrial visual intelligent online detection system 100 according to an embodiment of this application includes: an image acquisition and preprocessing module 110, used to perform region of interest segmentation and normalization processing on the acquired continuous grayscale image stream of fiber products in response to the encoder trigger signal of an industrial line scan camera to obtain a fiber product source image tensor; a geometric adaptive calibration module 120, used to perform geometric adaptive calibration on the fiber product source image tensor based on a spatial transformation network to obtain a calibrated fiber product image tensor and a transformation grid matrix; and a multi-scale feature mask encoding module 130, used to input features after random block masking processing of the calibrated fiber product image tensor. The encoder performs multi-scale feature masking to obtain a multi-scale feature list of the fiber product; the structure perception and texture reconstruction module 140 is used to perform structure perception and texture detail reconstruction on the multi-scale feature list of the fiber product to obtain a reconstructed fiber product image tensor; the difference map calculation and inverse mapping module 150 is used to perform difference map calculation and inverse spatial mapping on the calibrated fiber product image tensor and the reconstructed fiber product image tensor based on the transformed grid matrix to obtain a physical coordinate anomaly heatmap; the defect segmentation and analysis module 160 is used to perform adaptive threshold segmentation and connected component filtering analysis on the physical coordinate anomaly heatmap to obtain defect result data containing the location and type of defects.

[0015] In the aforementioned online visual intelligent inspection system 100 for texture defects in fiber products, the image acquisition and preprocessing module 110, in response to the encoder trigger signal of the industrial line scan camera, performs region-of-interest segmentation and normalization processing on the acquired continuous grayscale image stream of the fiber product to obtain the source image tensor of the fiber product. It should be noted that, due to the dynamic fluctuations in conveying speed caused by the mechanical transmission characteristics during actual operation of textile production lines, acquisition methods based solely on time intervals can lead to geometric distortions such as longitudinal stretching or compression of the image. Furthermore, the continuous raw data stream output by the industrial camera cannot directly adapt to the tensor input format of deep learning models in terms of dimensionality and numerical distribution. Therefore, the technical solution of this application first responds to the encoder trigger signal of the industrial line scan camera by performing region-of-interest segmentation and normalization processing on the acquired continuous grayscale image stream of the fiber product to obtain the source image tensor of the fiber product, thereby ensuring the proportional consistency of the acquired images in the physical space dimension and completing the standardized adaptation of the data format. The above processing can effectively eliminate the geometric deformation interference caused by changes in production line speed, and provide a numerically stable and dimensionally aligned tensor data foundation for subsequent neural network processing.

[0016] More specifically, in a specific example of this application, the image acquisition and preprocessing module 110 includes: a synchronous acquisition unit, used to control the line scan camera to perform line scanning acquisition with equal physical steps in response to the encoder trigger signal of the industrial line scan camera to obtain a continuous grayscale image stream of fiber products; a segmentation and stacking unit, used to perform sliding segmentation of the region of interest and batch stacking on the continuous grayscale image stream of fiber products to obtain original image batches; and a normalization and encapsulation unit, used to perform data normalization and dimensional expansion encapsulation on the original image batches to obtain the source image tensor of fiber products.

[0017] More specifically, this process follows a logic from physical signal synchronization to data tensor encapsulation. First, a synchronous acquisition operation is performed. Pulse signals from the rotary encoder on the drive shaft are received in real time. Hardware logic calculates the cumulative pulse count to accurately correspond to the actual physical displacement of the fabric. When the cumulative pulse count reaches a preset physical step size threshold, the industrial line scan camera is directly triggered to perform single-line exposure acquisition. The acquired discrete single-line pixel data are then longitudinally stitched together according to time sequence, forming a continuous grayscale image stream of the fiber product that eliminates longitudinal speed distortion. Subsequently, a segmentation and stacking process is performed. A sliding window with a fixed pixel size is moved across the continuous image stream for segmentation. A preset overlap rate is set to cover the window edge area to prevent feature truncation. Multiple independent image blocks are then ordered and stacked in a batch dimension to form the original image batch. Finally, a normalization encapsulation operation is performed, inserting channel dimensions into the data structure of the original image batch to adapt to the input requirements of the neural network, converting the integer format of the pixel data to the floating-point format, and normalizing and mapping the pixel grayscale values ​​from the original grayscale range to the unit interval through linear mapping calculation, ultimately generating a standardized fiber product source image tensor.

[0018] In the aforementioned online visual intelligent inspection system 100 for texture defects in fiber products, the geometric adaptive calibration module 120 is used to perform geometric adaptive calibration on the tensor of the source image of the fiber product based on a spatial transformation network to obtain a calibrated tensor of the fiber product image and a transformation mesh matrix. It should be noted that, given the significant non-rigid manifold structure characteristics of fiber products during high-speed transport in industrial settings, and the influence of mechanical traction fluctuations and equipment micro-vibrations, the fabric surface inevitably undergoes microscopic physical deformations such as stretching, twisting, or shearing. This geometric misalignment makes it difficult for the image under test to achieve strict pixel-level alignment with the standard reference sample, thereby causing high-frequency false alarms in texture-rich areas by the difference-based detection algorithm. Based on this, the technical solution of this application further performs geometric adaptive calibration of the source image tensor of the fiber product using a spatial transformation network to obtain a calibrated fiber product image tensor and a transformation mesh matrix. Specifically, the source image tensor is input into a localized network containing convolutional and fully connected layers for macroscopic geometric feature extraction and dimensionality reduction mapping to regress affine deformation parameters. Based on this, a transformation mesh matrix is ​​generated by inverse projection transformation of the preset standard target mesh coordinates, and this matrix is ​​used to perform differentiable bilinear interpolation sampling on the source image tensor. This automatically senses and dynamically corrects the spatial pose of the fabric image, mapping deformed texture features back to standard geometric positions, ensuring that the retained image differences originate only from real texture defects rather than physical deformation. Through the above processing, geometric errors and texture anomalies can be effectively decoupled, eliminating registration interference caused by mechanical jitter or stretching, and providing a geometrically consistent high-quality data foundation for subsequent texture reconstruction and defect analysis.

[0019] Figure 3 This is a block diagram of the geometric adaptive calibration module in the industrial visual intelligent online inspection system for texture defects in fiber products according to an embodiment of this application. Figure 3 As shown, the geometric adaptive calibration module 120 includes: a parameter regression unit 121, used to input the fiber product source image tensor into a localized network containing convolutional layers and fully connected layers for macroscopic geometric feature extraction and dimensionality reduction mapping to obtain affine deformation parameters; a mesh generation unit 122, used to perform inverse projection transformation on the preset standard target mesh coordinates based on the affine deformation parameters to obtain a transformed mesh matrix; and an interpolation sampling unit 123, used to perform differentiable bilinear interpolation sampling on the fiber product source image tensor based on the transformed mesh matrix to obtain a calibrated fiber product image tensor.

[0020] In the aforementioned online visual intelligent detection system 100 for texture defects in fiber products, the parameter regression unit 121 is used to input the tensor of the source image of the fiber product into a localized network containing convolutional layers and fully connected layers for macroscopic geometric feature extraction and dimensionality reduction mapping to obtain affine deformation parameters. It should be noted that, due to the highly repetitive texture characteristics of fiber product surfaces, and the ease with which they undergo overall rigid displacement or non-rigid shear deformation during industrial transmission, direct processing based on the original pixel coordinates can lead to failure in texture feature matching due to minute spatial misalignments. Conventional image processing struggles to directly extract the geometric information describing this overall deformation from the complex texture background. Therefore, the technical solution of this application further inputs the tensor of the source image of the fiber product into a localized network containing convolutional layers and fully connected layers for macroscopic geometric feature extraction and dimensionality reduction mapping to obtain affine deformation parameters. This allows for the automatic perception and quantification of the translation, rotation, scaling, and shear components of the current fabric image relative to a standard pose through deep learning. Through the above processing, a parametric model describing the geometric pose of the image can be effectively established, providing a precise mathematical transformation basis for subsequent spatial correction and ensuring that subsequent processing focuses on the texture itself rather than geometric position errors.

[0021] More specifically, in a concrete example of this application, the process follows a computational path from high-dimensional feature extraction to low-dimensional parameter regression. First, a macroscopic feature extraction operation is performed, constructing a lightweight localization subnetwork consisting of alternating convolutional and pooling layers. The tensor of the fiber product source image is used as input data, and convolutional kernels are used to slide across the image to extract edge and contour responses. Max pooling is then used to progressively reduce the spatial resolution of the feature map, filtering out high-frequency yarn texture details and retaining only the macroscopic semantic features representing the overall shape and position of the fabric. Subsequently, feature flattening and dimensionality reduction mapping are performed, flattening the multi-channel two-dimensional feature map into a one-dimensional feature vector. This vector is then input into a subsequent cascaded fully connected layer structure. Matrix multiplication and nonlinear activation functions progressively compress and map the high-dimensional image semantic features to a low-dimensional target parameter space. Finally, the parameter regression output operation is performed, using the output layer of the fully connected network to generate an affine deformation parameter tensor containing six degrees of freedom. This parameter tensor corresponds to the scaling factor, rotation angle, shearing coefficient, and translation offset in the two-dimensional affine transformation matrix. In the network initialization phase, a bias term is configured to make the initial output correspond to the identity transformation, thereby ensuring the numerical stability in the initial training phase.

[0022] In the aforementioned online visual intelligent inspection system 100 for texture defects in fiber products, the mesh generation unit 122 is used to perform an inverse projection transformation on the preset standard target mesh coordinates based on affine deformation parameters to obtain a transformed mesh matrix. It should be noted that in discretized digital image processing, if a forward mapping method is directly used to project from the source image coordinate system to the target image coordinate system, the constraints of rasterized integer coordinates can easily lead to discontinuous pixel holes or overlapping artifacts in the output image after scaling or rotation correction, resulting in damage to the integrity of texture information. Based on this, the technical solution of this application further performs an inverse projection transformation on the preset standard target mesh coordinates based on affine deformation parameters to obtain a transformed mesh matrix. This establishes a precise and dense correspondence between each regular pixel in the target calibration space and the non-integer sampling coordinates in the source image space, defining the index path from which pixel information should be extracted in the source image to obtain an ideal image. Through the above processing, the sampling dead zone problem caused by forward mapping can be effectively avoided, ensuring that every pixel in the calibration image can be traced back to the effective texture area of ​​the source image through differentiable coordinate mapping index, thereby ensuring the continuity and authenticity of texture reconstruction.

[0023] More specifically, in a concrete example of this application, the process follows a computational path from standard coordinate system construction to inverse matrix operation. First, a target mesh construction operation is performed, initializing a regular two-dimensional mesh in memory with the same spatial dimensions as the preset output image. Each node in this mesh corresponds to the integer coordinate position of a pixel to be filled in the calibration image, and its coordinate values ​​are normalized to a standard range. Then, inverse projection calculation is performed, reorganizing the six-DOF affine deformation parameters obtained from the previous steps into a two-dimensional affine transformation matrix. This matrix is ​​used to perform an inverse linear transformation operation on the homogeneous coordinate vector of each pixel in the target mesh, calculating the floating-point sampling coordinates of that pixel in the deformed source image coordinate system. This computational process follows the following mathematical model: in, and The x and y coordinates of the source image sampling points are represented by their calculated values. Indicates based on parameters affine transformation function, The homogeneous coordinate vector representing the target grid point. For elements in the affine deformation parameter matrix, and The x and y coordinates of the target grid points are defined, with a constant term of 1 used to complete the homogeneous coordinates to support translation transformations. Finally, a grid matrix generation operation is performed, which tensors and encapsulates the calculated floating-point coordinates of all source images according to their original arrangement order in the target grid, generating a transformed grid matrix that records the coordinate mapping relationships of the entire image.

[0024] In the aforementioned online visual intelligent inspection system 100 for texture defects in fiber products, the interpolation sampling unit 123 is used to perform differentiable bilinear interpolation sampling on the source image tensor of the fiber product based on a transformation grid matrix to obtain a calibrated fiber product image tensor. It should be noted that since the source image sampling coordinates contained in the transformation grid matrix are usually non-integer floating-point values, while digital image data is physically stored as discrete integer raster matrices, direct coordinate rounding mapping not only leads to spatial quantization errors in pixel information and disrupts the continuity of texture details, but also cuts off the gradient data flow during the backpropagation process of the neural network due to the non-differentiability of the rounding function, causing the front-end positioning network to be unable to obtain an effective gradient update. Based on this, the technical solution of this application further performs differentiable bilinear interpolation sampling on the source image tensor of the fiber product based on a transformation grid matrix to obtain a calibrated fiber product image tensor, thereby utilizing the grayscale information of neighboring pixels to perform weighted estimation of pixel values ​​at non-integer coordinate positions, constructing a fully differentiable image resampling mechanism. Through the above processing, the quantization accuracy bottleneck of discrete raster sampling can be effectively overcome, and the end-to-end training convergence capability of the model can be ensured while achieving sub-pixel level geometric correction, generating calibration image data with clear texture and geometric alignment.

[0025] More specifically, in a concrete example of this application, the process follows a computational logic from neighborhood locking to weighted aggregation. First, coordinate localization and neighborhood search operations are performed, traversing each element of the transformation grid matrix to obtain the recorded floating-point sampling coordinates of the source image. Using these coordinates as the center, the four nearest integer coordinate pixels in the fiber product source image tensor are locked as reference neighbors. These four points correspond to the pixel positions at the upper left, upper right, lower left, and lower right of the sampling coordinates, respectively. Then, distance weight calculation is performed, calculating the spatial distance deviations between the floating-point sampling coordinates and these four neighboring pixels in the horizontal and vertical directions. A linear interpolation kernel function is used to convert these distance deviations into normalized interpolation weight coefficients. This calculation logic follows the principle that the closer the distance, the greater the weight; that is, the weight coefficient is equal to one minus the absolute value of the distance deviation in the corresponding direction. Finally, the pixel value aggregation output operation is performed, which performs a point-by-point weighted summation operation on the original gray values ​​of the four neighboring pixels and the corresponding weight coefficients to calculate the final interpolated gray value at the sampling point and fill it into the corresponding position of the calibration fiber product image tensor. This weighted calculation process mathematically maintains the continuity of the partial derivatives with respect to the grid coordinates, thereby allowing the subsequent differential gradient to be back-propagated to the affine deformation parameters through the interpolation formula, driving the network to autonomously learn the optimal geometric transformation strategy.

[0026] In the aforementioned online visual intelligent detection system 100 for texture defects in fiber products, the multi-scale feature mask encoding module 130 is used to perform random block masking on the calibrated fiber product image tensor and then input it into the feature encoder for multi-scale feature mask encoding to obtain a multi-scale feature list of the fiber product. It should be noted that, given that the surface of fiber products typically exhibits high self-similarity and texture periodicity, if a traditional self-encoding reconstruction strategy with full-image input is directly adopted, the neural network is highly susceptible to getting trapped in local optima of the identity mapping during training. This means that the neural network mechanically replicates pixel-level noise and real defects in the input image, resulting in the generated reconstructed image incorrectly retaining the defect information that should have been repaired, causing the subsequent detection logic based on difference comparison to fail. Based on this, the technical solution of this application further processes the tensor of the calibrated fiber product image by random block masking and then inputs it into the feature encoder for multi-scale feature masking to obtain a multi-scale feature list of the fiber product. By artificially introducing spatial occlusion to construct incomplete information input, the encoding network is forced to abandon the simple pixel-level copying strategy and instead use the remaining unmasked areas to understand and infer the overall topological structure and texture extension rules of the fabric. Furthermore, a pyramid hierarchical structure is used to simultaneously extract hierarchical semantic features covering everything from microscopic yarn details to macroscopic pattern layout. Through the above processing, a feature representation system with context awareness and missing feature repair capabilities can be effectively established, blocking the direct transmission of abnormal defect features from the source of encoding, and laying an anti-interference semantic foundation for the subsequent generation of a pure, flawless baseline reconstructed image.

[0027] More specifically, in a specific example of this application, the multi-scale feature mask encoding module 130 includes: a mask injection unit, used to perform structured random mask injection on the calibration fiber product image tensor to obtain a mask image tensor; a feature extraction unit, used to perform pyramid-level feature extraction on the mask image tensor to obtain an intermediate feature set containing multi-level feature maps and a terminal feature tensor with the lowest resolution; and a latent variable encapsulation unit, used to perform channel compression mapping on the terminal feature tensor through a bottleneck layer to extract latent variable features, and to combine and encapsulate the latent variable features and the intermediate feature set according to the resolution level to obtain a multi-scale feature list of fiber products.

[0028] Accordingly, the mask injection unit and feature extraction unit are used to perform structured random mask injection on the calibration fiber product image tensor to obtain a mask image tensor, and to perform pyramid-level feature extraction on the mask image tensor to obtain an intermediate feature set containing multi-level feature maps and a terminal feature tensor with the lowest resolution. It should be noted that, due to the high periodicity and self-similarity of the surface texture of fiber products, if a complete image is directly used as input for unsupervised training, the deep neural network is prone to getting trapped in local optima of the identity mapping, that is, mechanically copying pixel-level defects in the input image instead of learning normal texture distribution patterns, resulting in the reconstructed image incorrectly retaining the defect details that should have been repaired. Based on this, the technical solution of this application further performs structured random mask injection on the calibration fiber product image tensor to obtain a mask image tensor, and performs pyramid-level feature extraction on the mask image tensor to obtain an intermediate feature set containing multi-level feature maps and a terminal feature tensor with the lowest resolution. This artificially constructs an incomplete information input state, forcing the feature encoder to abandon the simple pixel copying strategy and instead use the remaining unmasked area context information to infer and complete the overall topological structure of the fabric, while simultaneously capturing multi-scale semantic representations from microscopic yarns to macroscopic patterns. Through the above processing, the direct transmission of abnormal defect features in the encoding stage can be effectively blocked, and a robust feature system with context awareness and missing repair capabilities can be established, laying an anti-interference data foundation for the subsequent generation of a pure, flawless benchmark reconstruction image.

[0029] More specifically, in a concrete example of this application, the process follows a computational path from active information erasure to hierarchical feature abstraction. First, a structured mask injection operation is performed, generating a binary mask matrix in memory with the same size as the calibration image tensor space. A specific proportion (e.g., 20%) of rectangular regions is selected as occlusion areas using a random block strategy, and their values ​​are set to 0, while the remaining regions are set to 1. This binary mask is then expanded to the channel dimension and subjected to an element-wise Hadamard product operation with the calibration fiber product image tensor, thereby mathematically forcibly erasing the pixel information of the selected regions to generate the mask image tensor. Subsequently, pyramid-level extraction processing is performed. In this embodiment, the feature encoder can employ a variant of the residual network structure or a lightweight MobileNet structure. The encoder contains multiple cascaded convolutional processing stages (e.g., 4 stages), each consisting of convolutional layers (e.g., 3x3 convolutional kernels), batch normalization layers, and activation functions (e.g., ReLU or SiLU). By introducing residual connections at each stage, the gradient vanishing problem of deep networks is prevented. In each processing stage, spatial downsampling is performed using a convolution operation with a stride of 2, which halves the spatial resolution of the feature map at each stage while doubling the number of channels, thereby abstracting texture features hierarchically. During this process, the feature maps output from each stage are temporarily stored sequentially to form an intermediate feature set containing rich spatial details, and the feature map output after the last downsampling stage is established as the lowest-resolution final feature tensor, which aggregates the highest-dimensional global semantic information of the fabric structure.

[0030] Accordingly, the latent variable encapsulation unit is used to extract latent variable features by performing channel compression mapping on the terminal feature tensor through the bottleneck layer, and to combine and encapsulate the latent variable features with the intermediate feature set according to the resolution level to obtain a multi-scale feature list of fiber products. It should be noted that since the terminal feature tensor extracted by deep convolution usually retains excessively high channel dimensions and redundant high-frequency noise, if it is directly used for reconstruction, the neural network is prone to overfitting to the minute imperfection details in the input image rather than learning the inherent topological distribution law of the fabric, and the deep features of a single scale are difficult to simultaneously meet the reconstruction requirements of macroscopic structure and microscopic texture. Based on this, the technical solution of this application further extracts latent variable features by performing channel compression mapping on the terminal feature tensor through the bottleneck layer, and combines and encapsulates the latent variable features with the intermediate feature set according to the resolution level to obtain a multi-scale feature list of fiber products, thereby forcibly compressing the representation dimension of the feature space, filtering out non-common random noise and potential defect information, and constructing a complete feature index covering multi-level semantics. Through the above processing, compact core features that characterize the normal fabric texture manifold can be effectively extracted, and hierarchical data support with both abstract semantics and spatial details can be provided for texture detail recovery in the subsequent decoding stage.

[0031] More specifically, in a concrete example of this application, the process follows an implementation logic from feature dimensionality reduction and compression to data structured reorganization. First, latent variable extraction is performed. A bottleneck structure is constructed using a 1x1 convolutional layer. A linear projection transformation of the channel dimension is performed on the lowest-resolution terminal feature tensor, compressing the high-dimensional feature channel count to a preset low-dimensional value. This removes sparse and redundant information from the feature map and generates highly condensed latent variable features. Next, multi-scale combination and encapsulation processing is performed. The intermediate feature sets temporarily stored in the previous steps are retrieved and arranged in descending order of spatial resolution, and the newly generated latent variable features are added as the lowest-resolution level node to the end of the sequence. Finally, a list output operation is performed, constructing a unified ordered list container. The arranged feature tensors of each level are stored sequentially into this container, forming a multi-scale feature list of fiber products containing full information from shallow appearance details to deep semantic structure, for subsequent decoding and reconstruction modules to call and fuse hierarchically.

[0032] In the aforementioned online visual intelligent detection system 100 for industrial fiber product texture defects, the structure perception and texture reconstruction module 140 is used to perform structure perception and texture detail reconstruction on the multi-scale feature list of fiber products to obtain a reconstructed fiber product image tensor. It should be noted that, given that simple feature upsampling or direct hard skip connections often fail to distinguish between the normal texture frequency of the fabric and the abnormal high-frequency noise caused by defects, it is easy for minute defect features in the input image to leak directly into the final reconstruction result through the skip connection channels, thus failing to establish a truly pure, defect-free comparison benchmark. Based on this, the technical solution of this application further performs structure perception and texture detail reconstruction on the multi-scale feature list of fiber products to obtain a reconstructed fiber product image tensor. Specifically, it parses latent variable features and encoder-side features according to the resolution level, performs transposed convolution projection on the latent variable features to obtain the skip connection feature set and the current decoded features, uses a cascaded upsampling strategy to stitch the two together in the channel dimension, and introduces a channel attention mechanism to perform adaptive weight allocation and convolutional smoothing on the stitched features to extract high-resolution texture features. Finally, it reconstructs, maps, and activates these features. This approach utilizes channel attention to dynamically filter spatial detail information transmitted from the encoder, automatically suppressing feature channel responses corresponding to aperiodic defects while enhancing the feature weights of harmonics in normal yarn texture. This hierarchical recovery of lost texture details maintains global topological consistency. Through this processing, an ideal reference image can be effectively generated that preserves the true weaving pattern while eliminating local anomalies, ensuring that subsequent difference measurements accurately reflect actual physical quality deviations.

[0033] Figure 4 This is a block diagram of the structure perception and texture reconstruction module in the industrial visual intelligent online detection system for texture defects in fiber products according to an embodiment of this application. Figure 4 As shown, the structure perception and texture reconstruction module 140 includes: a feature parsing unit 141, used to parse latent variable features and encoder-side features from the multi-scale feature list of fiber products according to the resolution level, and perform transposed convolution projection on the latent variable features to obtain a skip connection feature set and the current decoded features; a cascaded fusion unit 142, used to use a cascaded upsampling strategy to concatenate the current decoded features and the skip connection feature set along the channel dimension, and use a channel attention mechanism to perform weight adaptive allocation and convolution smoothing on the concatenated features to obtain high-resolution texture features; and a reconstruction mapping unit 143, used to reconstruct, map and activate the high-resolution texture features to obtain the reconstructed fiber product image tensor.

[0034] In the aforementioned online visual intelligent detection system 100 for texture defects in fiber products, the feature parsing unit 141 is used to parse latent variable features and encoder-side features from the multi-scale feature list of fiber products according to the resolution level, and to perform transposed convolution projection on the latent variable features to obtain the skip connection feature set and the current decoded features. It should be noted that since the multi-scale feature list of fiber products usually aggregates heterogeneous data with different levels of abstraction and spatial scales in a compact serialized structure, and the decoding and reconstruction process must strictly follow the logical path of reverse inference from high-level semantics to low-level details, if structured decoupling and dimensional alignment are not performed, the decoding network will not be able to correctly index the corresponding encoder-side features to establish cross-level contextual connections, and the low-resolution latent variable spatial size cannot directly adapt to the fusion requirements of the next level. Based on this, the technical solution of this application further parses latent variable features and encoder-side features from the multi-scale feature list of fiber products according to the resolution hierarchy, and performs transposed convolution projection on the latent variable features to obtain the skip connection feature set and the current decoded features. This restores the encapsulated feature data into independent feature tensors that can be called layer by layer by the decoder, and completes the initial spatial size expansion of the decoding link through learnable parameterized upsampling. Through the above processing, the initial input state of the decoding network can be effectively constructed, and the data index relationship of skip connections at each level can be established, providing a dimension-aligned feature benchmark for the subsequent gradual restoration of texture details.

[0035] More specifically, in a concrete example of this application, the process follows a logic from data unpacking and separation to initial upsampling. First, a feature parsing operation is performed, accessing the storage structure of the multi-scale feature list of the fiber product. Based on predefined feature hierarchy indexing rules, the smallest resolution tensor at the end of the list is identified and extracted as a latent variable feature. This feature contains the most abstract global topological information of the fabric texture. Simultaneously, the remaining resolution tensors in the list are labeled as encoder-side features in descending order of spatial size and stored separately, thus constructing a skip connection feature set for use by the decoder at each level of fusion. Subsequently, transpose projection processing is performed, constructing a transposed convolutional layer as the starting node of the decoder. The extracted latent variable features are used as input data, and a learnable upsampling convolution kernel is used to perform a reverse convolution operation. This expands the spatial dimensions of the feature map to the resolution of the previous level while adjusting the channel dimensions, thereby generating a feature tensor with a preliminary spatial structure. Finally, the initial state establishment operation is performed, defining the feature tensor output by the transposed convolution as the current decoding feature, which serves as the starting point for the decoder to reconstruct the texture structure, and is prepared to be spliced ​​and fused with the corresponding level features in the skip connection feature set in subsequent steps in terms of channel dimension.

[0036] In the aforementioned online visual intelligent detection system 100 for industrial fiber product texture defects, the cascaded fusion unit 142 is used to employ a cascaded upsampling strategy to concatenate the current decoded features with the skip connection feature set along the channel dimension, and utilizes a channel attention mechanism to adaptively allocate weights and perform convolutional smoothing on the concatenated features to obtain high-resolution texture features. It should be noted that while the shallow features on the encoder side retain rich high-frequency spatial details, they also contain noise from the fabric surface, unstructured clutter, and real defect information to be detected. If these features are directly concatenated linearly or additively fused with the decoded features, the defect features are easily leaked directly into the reconstructed image through the skip connection channels, thereby compromising the purity of the reconstructed sample as a flawless comparison benchmark. Based on this, the technical solution of this application further adopts a cascaded upsampling strategy, concatenating the current decoded features with the skip connection feature set along the channel dimension, and using a channel attention mechanism to adaptively allocate weights and perform convolutional smoothing on the concatenated features to obtain high-resolution texture features. This constructs a feature selection mechanism based on channel importance, dynamically adjusting weights according to the correlation between feature channel responses and normal fabric texture distribution, automatically suppressing channel responses containing anomalous mutations or random noise, while selectively enhancing channel signals representing periodic texture structures. Through the above processing, it is possible to effectively restore micro-texture details while blocking the direct transmission of defect information, ensuring that the final generated high-resolution feature tensor accurately describes only the normal fabric topology.

[0037] More specifically, in a concrete example of this application, the process follows a cascaded processing logic from multi-source feature aggregation to adaptive attention recalibration. First, a feature concatenation operation is performed. In each recovery stage of the decoding network, an upsampling algorithm is used to amplify the decoded features output from the previous level to a spatial resolution consistent with the skip connection features of the current level. These two features are then stacked and combined along the channel dimension to form a hybrid concatenated feature tensor containing both deep semantics and shallow details. Next, channel weight calculation is performed. A compression and activation mechanism is introduced to perform global information integration on the concatenated features. First, a global average pooling operation is used to compress the two-dimensional spatial features of each channel into a single global real-valued descriptor. This descriptor vector is then input into a two-layer fully connected network containing dimensionality reduction and upscaling. The first fully connected layer is followed by a ReLU activation function for dimensionality reduction (the compression ratio can be set to 16), and the second fully connected layer is followed by a Sigmoid activation function to map the output to the (0,1) interval, thereby fitting the non-linear dependencies between channels and generating channel attention weight vectors. Finally, feature reshaping and smoothing operations are performed, and the generated weight vector is broadcast to the corresponding channel of the original spliced ​​feature to perform element-wise multiplication operations. This suppresses channels with strong abnormal responses and amplifies channels with significant texture features in the feature map numerically. Then, the recalibrated features are subjected to cross-channel information interaction and spatial filtering through subsequent convolutional layers. Finally, a high-resolution texture feature with clear texture and removed imperfection interference is output.

[0038] In the aforementioned online visual intelligent inspection system 100 for texture defects in fiber products, the reconstruction mapping unit 143 is used to reconstruct, map, and activate high-resolution texture features to obtain a reconstructed fiber product image tensor. It should be noted that since the high-resolution texture features generated after cascaded decoding still reside in a multi-channel high-dimensional feature space, their numerical distribution is not constrained by physical photometric properties, and the channel dimension is much higher than that of a single-channel grayscale image, making it impossible to directly compare pixel-level residuals with the input source image. Based on this, the technical solution of this application further reconstructs, maps, and activates the high-resolution texture features to obtain a reconstructed fiber product image tensor, thereby projecting the abstract high-dimensional feature representation back into a visualized two-dimensional pixel space and forcibly constraining the dynamic range of the output values ​​to match the normalized distribution of the input data. Through the above processing, a reconstructed image conforming to the definition of physical photometric properties can be effectively generated, ensuring that subsequent difference calculations are performed on a basis with the same dimensions and numerical range.

[0039] More specifically, in a concrete example of this application, the process follows a mapping logic from feature dimensionality reduction to photometric normalization. First, a channel compression mapping operation is performed to construct a kernel with a size of... The convolutional layer serves as the output projector, performing pointwise linear convolution operations on high-resolution texture features. Through learned weight parameters, it weights and linearly combines the response values ​​within multiple feature channels, compressing the channel dimension from multi-dimensional to a single dimension to correspond to a grayscale image format. Subsequently, range-constrained activation processing is performed, using the Sigmoid non-linear activation function to perform pixel-wise operations on the compressed feature map. Based on the mathematical properties of the function, real-valued inputs of any range are smoothly mapped to a closed interval between 0 and 1, resulting in a numerically strictly constrained reconstructed fiber product image tensor that maintains strict consistency with the source image tensor generated in the preprocessing stage in terms of data distribution characteristics.

[0040] Specifically, during the offline training phase, a training dataset containing only flawless fiber products (positive samples) is constructed. Flawless samples are input into the system, and the network parameters are iteratively optimized end-to-end by minimizing the total loss function. The total loss function consists of two parts: pixel-level reconstruction loss, used to constrain the consistency of the reconstructed image and the input image in pixel values, typically calculated using the L2 norm; and perceptual loss, used to constrain the consistency between the two at the feature semantic level, calculated by a pre-trained feature extractor (such as a VGG network) to determine the distance between feature maps. During backpropagation, gradients flow through the reconstruction module and across the sampling grid, propagating back to the parameter regression unit of the geometric adaptive calibration module 120, thereby driving it to automatically learn the optimal geometric correction strategy for this type of fabric texture. When the total loss function converges to a preset threshold, the weight parameters of each module are saved for subsequent online detection processes.

[0041] In the aforementioned online visual intelligent detection system 100 for texture defects in fiber products, the difference map calculation and inverse mapping module 150 is used to perform difference map calculation and inverse spatial mapping on the tensors of calibrated and reconstructed fiber product images based on a transformed grid matrix to obtain a heatmap of physical coordinate anomalies. It should be noted that, given that the calibrated image is in a geometrically transformed virtual feature space, the directly calculated defect location cannot correspond to the actual physical coordinates of the fabric on the production line, and a single fixed-weight difference metric is difficult to simultaneously suppress registration artifacts in textured areas and maintain the detection sensitivity of weak defects in flat areas. Therefore, the technical solution of this application further performs difference map calculation and inverse spatial mapping on the tensors of calibrated and reconstructed fiber product images based on a transformed grid matrix to obtain a heatmap of physical coordinate anomalies. This dynamically optimizes the weight allocation of the difference metric based on local texture complexity, enhancing the saliency of weak defects while filtering out registration error noise, and accurately restoring the detection results from the virtual space to the original acquisition space. The above processing can effectively resolve the technical contradiction between false alarms in high-frequency textured areas and missed detections in low-frequency flat areas caused by the fixed weight strategy, and ensure that the output defect coordinates have physical geometric consistency that can be executed in industrial settings.

[0042] Figure 5 This is a block diagram of the difference map calculation and inverse mapping module in the industrial visual intelligent online detection system for texture defects in fiber products according to an embodiment of this application. Figure 5 As shown, the difference map calculation and inverse mapping module 150 includes: a difference calculation unit 151, used to calculate the calibration domain anomaly heatmap between the calibration fiber product image tensor and the reconstructed fiber product image tensor; and an inverse reprojection unit 152, used to perform inverse reprojection on the calibration domain anomaly heatmap based on the coordinate mapping relationship in the transformed grid matrix to obtain the physical coordinate anomaly heatmap.

[0043] In the aforementioned online visual intelligent detection system 100 for texture defects in fiber products, the difference calculation unit 151 is used to calculate the calibration domain anomaly heatmap between the calibrated fiber product image tensor and the reconstructed fiber product image tensor. It should be noted that, given the lack of spatial awareness of registration uncertainty in the existing hybrid metric difference calculation mechanism using globally fixed weights, a large number of false alarms due to halo artifacts are generated in textured areas with densely interwoven latitude and longitude lines, caused by drastic L2 norm jumps due to small registration deviations. Conversely, in areas with flat textures, lowering the weights to suppress false alarms sacrifices the detection sensitivity for minor defects such as light-colored oil stains, failing to simultaneously meet the dual requirements of high-frequency region anti-interference and low-frequency region high sensitivity. Based on this, the technical solution of this application further calculates the calibration domain anomaly heatmap between the calibration fiber product image tensor and the reconstructed fiber product image tensor. Specifically, it uses a directional differential operator to estimate the reconstruction domain texture gradient field of the reconstructed fiber product image tensor to obtain a texture gradient magnitude map. A negative exponential decay nonlinear mapping is then applied to the texture gradient magnitude map to obtain an L2 reliability gating map. The L2 reliability gating map is used as a dynamic adjustment factor to perform gradient-aware adaptive complementary fusion of the calibration and reconstructed fiber product image tensors. This generates spatially varying confidence weights based on the texture topological complexity of the reconstructed image. In texture edge regions, pixel-level difference weights are reduced while structural similarity measurement is dominant to filter out registration noise. In flat regions, pixel-level difference weights are increased to sensitively capture subtle grayscale changes. Through the above processing, the technical contradiction of high false alarm rate and low recall rate in non-rigid fabric detection can be effectively resolved, generating a high-quality anomaly heatmap that is both pure and sensitive.

[0044] Figure 6 This is a block diagram of the difference calculation unit in the industrial visual intelligent online detection system for texture defects in fiber products according to an embodiment of this application. Figure 6As shown, the difference calculation unit 151 includes: a gradient estimation subunit 1511, used to estimate the texture gradient field of the reconstructed fiber product image tensor using a directional differential operator to obtain a texture gradient magnitude map; a gated mapping subunit 1512, used to perform negative exponential decay nonlinear mapping on the texture gradient magnitude map to obtain an L2 reliability gated map; and an adaptive fusion subunit 1513, used to use the L2 reliability gated map as a dynamic adjustment factor to perform gradient-aware adaptive complementary fusion of the calibration fiber product image tensor and the reconstructed fiber product image tensor to obtain a calibration domain anomaly heatmap.

[0045] In the aforementioned online visual intelligent detection system 100 for fiber product texture defects, the gradient estimation subunit 1511 is used to estimate the texture gradient field in the reconstruction domain of the reconstructed fiber product image tensor using a directional differential operator to obtain a texture gradient magnitude map. It should be noted that, given the physical differences in texture complexity across different regions of the fabric surface, and the fact that the original acquired images often contain sensor noise and uncertain real defects, directly calculating gradients based on the original calibration images can easily introduce unstructured interference signals, causing the generated weight map to fail to accurately reflect the inherent topological changes of the fabric. Therefore, the technical solution of this application further utilizes a directional differential operator to estimate the texture gradient field in the reconstruction domain of the reconstructed fiber product image tensor to obtain a texture gradient magnitude map. This allows the selection of a theoretically flawless reconstructed image output by the generator network as a pure and ideal texture benchmark, leveraging its noise-free and defect-free characteristics to obtain a physical quantity that can stably characterize the inherent topological complexity of the fabric. Through the above processing, a reliable physical prior that only reflects the structural changes of the fabric itself can be effectively generated, enabling subsequent processing to accurately distinguish between structurally complex regions and structurally simple regions, laying an interference-resistant data foundation for differentiated adaptive processing strategies.

[0046] More specifically, in a concrete example of this application, the process follows a computational path from directional convolution to modulus synthesis. The reconstructed fiber product image tensor is selected as input data, and a standardized Sobel directional differential operator is used to perform two-dimensional convolution operations in the horizontal and vertical directions. The gray-level change rates in the horizontal weft and vertical warp directions are extracted respectively, and then the gradient L2 modulus of each pixel is synthesized and calculated. The calculation process of the texture gradient field in the reconstructed domain is expressed by the following formula: in, Represents coordinates The generated texture gradient magnitude map value, Refers to the reconstructed image tensor of the input. The symbol represents a two-dimensional convolution operation, while and These represent the standardized horizontal and vertical Sobel operator convolution kernels, respectively. In practical computing scenarios, for high-frequency texture areas such as yarn interlacing nodes in plain or twill fabrics, the convolution operation will produce a high gradient modulus value, indicating that the texture changes drastically at that point; while for gaps between fabric yarns or flat areas, the calculated gradient modulus value approaches 0, thus constructing a two-dimensional scalar field that accurately reflects the topological density distribution of the fabric surface.

[0047] In the aforementioned online visual intelligent inspection system 100 for texture defects in fiber products, the gate mapping subunit 1512 is used to perform a negative exponential decay nonlinear mapping on the texture gradient magnitude map to obtain an L2 reliability gate map. It should be noted that, given that the gradient values ​​in the original texture gradient magnitude map are in an unbounded distribution state, directly using them for weight allocation lacks a unified metric. Furthermore, there is a nonlinear inverse correlation between local texture complexity and the reliability of pixel-level differences; that is, the more complex the texture, the greater the risk of an artificially high L2 norm due to registration errors. Based on this, the technical solution of this application further performs a negative exponential decay nonlinear mapping on the texture gradient magnitude map to obtain an L2 reliability gate map, thereby transforming the original, unbounded gradient values ​​into a standardized confidence weight with clear physical meaning, and accurately modeling the inverse correlation between local texture complexity and L2 norm reliability mentioned above. Through the above processing, a spatially varying weight map can be effectively generated, which can dynamically suppress noise caused by registration errors while fully preserving the ability to detect weak defects in flat areas.

[0048] More specifically, in a concrete example of this application, the process follows a nonlinear transformation logic from physical quantities to probability values. The texture gradient magnitude map calculated in the previous step is selected as input data, and a pixel-by-pixel numerical transformation is performed on it using a negative exponential decay function. The core of this transformation logic lies in constructing a soft gating mechanism, the generation process of which for the L2 reliability gating map is expressed by the following formula: in, This represents the generated L2 reliability gating graph. As a dynamic balance coefficient (the value is usually greater than 0, for example, 1.0), This is a gradient sensitivity control parameter (with a value greater than 0, used to control the steepness of the function curve). This represents an exponential function with the natural constant e as its base. This is the texture gradient magnitude map input in the previous step. In the actual computational logic, when the local texture gradient value... When the value is very large, it means that this is the edge of yarn interlacing. The high response value generated by the L2 norm is very likely due to registration error. At this time, the generated gate factor value... The threshold value will approach 0, indicating a lack of trust in the L2 difference at that point; conversely, in regions with gentle gradients, the threshold value will approach 1, indicating a high degree of trust in the L2 difference, believing it faithfully reflects the true grayscale deviation. For example, when detecting high-density twill denim, for yarn weave nodes with sharp texture gradients, the algorithm will automatically output a threshold value close to 0 to ignore pixel misalignment caused by slight vibrations of the fabric surface, while for smooth areas on the fabric surface, it will output a threshold value close to 1, thus ensuring accurate detection of even light-colored paste stains that are difficult for the human eye to detect.

[0049] In the aforementioned online visual intelligent detection system 100 for industrial fiber product texture defects, the adaptive fusion subunit 1513 is used to perform gradient-aware adaptive complementary fusion of the calibrated fiber product image tensor and the reconstructed fiber product image tensor using an L2 reliability gating map as a dynamic adjustment factor to obtain an anomaly heatmap of the calibration domain. It should be noted that, given the technical contradictions caused by the fixed-weight fusion strategy in existing technologies—namely, the inability to suppress artifacts in high-frequency texture areas while maintaining detection sensitivity for weak defects in low-frequency flat areas—especially in textured regions with densely interwoven latitude and longitude lines and drastic changes in image gradient, even small registration deviations can cause drastic jumps in the L2 norm. Fixed weight values ​​can inappropriately amplify artifacts caused by normal physical deformation, resulting in numerous halo artifacts around texture edges on the defect heatmap. Based on this, the technical solution of this application further utilizes the L2 reliability gating map as a dynamic adjustment factor to perform gradient-aware adaptive complementary fusion of the calibrated fiber product image tensor and the reconstructed fiber product image tensor to obtain an anomaly heatmap of the calibration domain. This allows for spatial adaptive adjustment of the importance of pixel-level and structural-level differences by introducing a dynamic gating mechanism based on the reconstructed texture gradient. Through the above processing, the aforementioned technical contradictions can be effectively resolved. Without requiring manual intervention or sacrificing the performance of any scene, the false alarm rate caused by small registration errors in texture-rich regions is reduced, while ensuring a high recall rate for light-colored defects in flat areas. This comprehensively improves the overall accuracy, robustness, and industrial applicability of the online fiber product texture defect detection system.

[0050] More specifically, in a concrete example of this application, the process follows a computational path of complementary weighting and dynamic synergy. First, a gradient-aware adaptive complementary fusion operation is performed to utilize the dynamically gating map generated in the previous step to spatially adaptively weight and fuse pixel-level and structural-level difference measures, thereby generating the final calibration domain anomaly heatmap. During execution, the L2 reliability gating map is directly used as the weight for the pixel-level squared difference through a Hadamard product (i.e., element-wise multiplication) operation, while 1 is subtracted from the gating map as the weight for the structural dissimilarity measure. This complementary weighting method achieves dynamic switching and synergy of the advantages of different measures: in texture edge regions, due to the low gating factor value, the fusion result is mainly dominated by the SSIM measure, which is insensitive to small spatial displacements, thus effectively filtering out registration artifacts; in flat regions, due to the high gating factor value, the fusion result is dominated by the L2 norm, which is sensitive to slight grayscale changes, ensuring the detection capability of defects such as oil stains and color differences. This process can be represented as: in, This represents the final generated calibration domain anomaly heatmap. Refers to the L2 reliability gating diagram. The symbol represents the Hadamard product operation. Represents the calibration image tensor With reconstructed image tensor The squared difference between pixels Represents the structural similarity index operator. As a compensation gain coefficient for the structure term, This is a numerical stability constant used to prevent the denominator from being zero. For example, when detecting fabrics with complex jacquard textures, the algorithm automatically uses a lower gate value to suppress pixel-level difference noise caused by mechanical jitter in the edge areas of the pattern with sharp texture gradients, while using a higher gate value to sensitively capture extremely faint light yellow oil stains in the smooth areas between the patterns, thereby generating an anomaly heatmap that is both pure and sensitive.

[0051] In the aforementioned online visual intelligent inspection system 100 for fiber product texture defects, the inverse reprojection unit 152 is used to inversely reproject the calibration domain anomaly heatmap based on the coordinate mapping relationship in the transformation grid matrix to obtain a physical coordinate anomaly heatmap. It should be noted that since the calibration domain anomaly heatmap generated in the preceding steps is calculated based on a virtual feature space after geometric deformation correction, there is a nonlinear spatial mapping deviation between its pixel coordinates and the original physical image coordinates acquired by the industrial camera, introduced by the spatial transformation network. If the coordinates of this virtual space are directly used to drive subsequent physical marking machines or rejection devices, the actuator will be unable to accurately locate the actual defect position on the fabric surface. Based on this, the technical solution of this application further uses the coordinate mapping relationship in the transformation grid matrix to inversely reproject the calibration domain anomaly heatmap to obtain a physical coordinate anomaly heatmap. This utilizes the sampling index path recorded in the transformation grid matrix to accurately back-map each anomaly response value in the virtual calibration space to the corresponding pixel position in the original acquisition space, and addresses the coordinate overlap problem caused by resolution changes. Through the above processing, the spatial coordinate drift introduced by the geometric correction algorithm can be effectively eliminated, ensuring that the output defect location data maintains strict geometric consistency with the actual topology of the physical fabric, and providing a reliable physical coordinate reference for the subsequent precise positioning operation of industrial actuators.

[0052] More specifically, in a concrete example of this application, the process follows a reverse computational logic from physical canvas initialization to coordinate scattering aggregation. First, a physical space initialization operation is performed, constructing a zero-based tensor with spatial dimensions identical to the original fiber product source image tensor as the physical coordinate canvas. This canvas is designed to carry the anomaly probability distribution after inverse mapping and restore the geometric scale of the original field of view. Then, coordinate inverse scattering processing is performed, traversing each two-dimensional coordinate vector stored in the transformation grid matrix. This vector precisely records the floating-point mapping position of each pixel in the calibration domain anomaly heatmap in the original source image coordinate system. Based on this mapping relationship, each pixel anomaly value in the calibration domain heatmap is directionally projected into the corresponding coordinate neighborhood of the physical coordinate canvas. Finally, an overlapping region aggregation operation is performed. In the case that multiple calibration domain pixels may be projected to the same physical coordinate neighborhood during deformation recovery, a maximum value retention strategy is adopted to filter and merge the projected outliers. That is, only the outlier values ​​with the largest response intensity are retained at the overlapping position of the physical canvas, thereby preventing the small high-frequency defect responses from being diluted by the averaging effect during the inverse mapping interpolation process. Finally, a physical coordinate outlier heatmap corresponding one-to-one with the original acquired field of view pixels is generated.

[0053] In the aforementioned online visual intelligent inspection system 100 for texture defects in fiber products, the defect segmentation and analysis module 160 is used to perform adaptive threshold segmentation and connected component filtering analysis on the physical coordinate anomaly heatmap to obtain defect result data containing the location and type of defects. It should be noted that, since the physical coordinate anomaly heatmap inevitably retains high-frequency isolated noise caused by sensor reading fluctuations or minor algorithm oscillations during its generation, and the texture reconstruction error distribution of different batches or types of fiber products exhibits significant statistical differences, if a globally fixed threshold is used for segmentation, false alarms are easily generated in areas with large texture fluctuations or missed detections occur at low-contrast defects. Based on this, the technical solution of this application further performs adaptive threshold segmentation and connected component filtering analysis on the physical coordinate anomaly heatmap to obtain defect result data containing the location and type of defects. Specifically, Gaussian space smoothing is applied to the physical coordinate anomaly heatmap to obtain a smoothed heatmap; statistically based dynamic threshold segmentation is performed on the smoothed heatmap to obtain a binary defect mask; and connected component morphological analysis is performed on the binary defect mask to extract the geometric coordinate information of the retained region. This approach utilizes Gaussian filtering to suppress unstructured random noise, dynamically constructs a discrimination criterion adapted to the current texture environment based on the image's statistical characteristics, and eliminates pseudo-defect responses lacking physical area features through morphological constraints. Through this processing, the anti-interference capability of the detection results in complex industrial environments can be effectively improved, ensuring that the final output defect coordinates and type data have high confidence and physical consistency.

[0054] More specifically, in a specific example of this application, the defect segmentation and analysis module 160 includes: a smoothing and denoising unit, used to perform Gaussian space smoothing and denoising on the physical coordinate anomaly heatmap to obtain a smooth heatmap; a dynamic segmentation unit, used to perform statistically based dynamic threshold segmentation on the smooth heatmap to obtain a binary defect mask; and a morphological analysis unit, used to perform connected component morphological analysis on the binary defect mask to extract the geometric coordinate information of the preserved region, and extract confidence scores from the smooth heatmap to obtain defect result data containing the defect location and type.

[0055] Furthermore, this process follows a logical path from signal conditioning to decision output. First, a smoothing and noise reduction operation is performed. A Gaussian convolution kernel of a preset size is defined, and this kernel is used to perform a two-dimensional convolution operation on the physical coordinate anomaly heatmap. The spatial distribution of anomaly scores is smoothed by a weighted average of neighboring pixels, thus generating a smooth heatmap that suppresses high-frequency noise. Then, dynamic segmentation is performed. The mean and standard deviation of global pixel values ​​are calculated by traversing the smooth heatmap. An adaptive threshold formula is constructed based on these statistical characteristics. This formula is used to perform pixel-by-pixel discrimination on the heatmap, marking pixels above the threshold as foreground defects and the remaining pixels as background, thereby generating a binary defect mask. This discrimination logic follows the following mathematical expression: in, This represents the value of the generated binary defect mask at a specific coordinate. This represents the anomaly score at the corresponding coordinates of the input smoothed heatmap. This represents the global pixel mean of the current heatmap. This represents the global pixel standard deviation of the current heatmap. The preset sensitivity coefficient is used. Finally, morphological analysis is performed, and a connected component labeling algorithm is applied to the binary defect mask to cluster adjacent foreground pixels into independent candidate regions. The pixel area of ​​each candidate region is calculated, and tiny regions with an area smaller than a preset threshold are removed. For the retained effective regions, the coordinates of their bounding rectangles are extracted, and the maximum response value within the region is retrieved from the smoothed heatmap as the confidence score. Finally, the defect result data containing the defect location, type, and confidence score is encapsulated and generated.

[0056] In summary, the industrial visual intelligent online detection system for texture defects in fiber products according to embodiments of this application is explained. First, it utilizes a spatial transformation network to perform differentiable geometric self-calibration on the acquired fabric image, eliminating spatial misalignment caused by physical stretching. Then, an ideal flawless texture benchmark is generated through a mask reconstruction mechanism. Based on this, an adaptive fusion mechanism based on the texture gradient field is introduced, dynamically adjusting the weights of pixel-level differences and structural similarity according to the local texture complexity, suppressing registration artifacts in high-frequency texture areas while maintaining high sensitivity to minor defects in flat areas. Finally, the detection results are inversely mapped back to the physical coordinate system, achieving accurate localization and classification of texture defects in fiber products.

Claims

1. An industrial visual intelligent online detection system for texture defects in fiber products, characterized in that, include: The image acquisition and preprocessing module is used to respond to the encoder trigger signal of the industrial line scan camera to perform region of interest segmentation and normalization processing on the acquired continuous grayscale image stream of fiber products to obtain the source image tensor of the fiber products. The geometric adaptive calibration module is used to perform geometric adaptive calibration on the source image tensor of fiber products based on a spatial transformation network to obtain the calibrated fiber product image tensor and the transformation grid matrix. The multi-scale feature mask encoding module is used to perform random block masking on the tensor of the calibration fiber product image and then input it into the feature encoder for multi-scale feature mask encoding to obtain a multi-scale feature list of the fiber product. The structure perception and texture reconstruction module is used to perform structure perception and texture detail reconstruction on the multi-scale feature list of fiber products to obtain the reconstructed fiber product image tensor. The difference map calculation and inverse mapping module is used to perform difference map calculation and inverse spatial mapping on the tensor of calibrated fiber product images and the tensor of reconstructed fiber product images based on the transformed grid matrix to obtain a physical coordinate anomaly heat map. The defect segmentation and analysis module is used to perform adaptive threshold segmentation and connected component filtering analysis on the physical coordinate anomaly heatmap to obtain defect result data containing the location and type of defects.

2. The industrial visual intelligent online detection system for texture defects in fiber products according to claim 1, characterized in that, The image acquisition and preprocessing module includes: The synchronous acquisition unit is used to respond to the encoder trigger signal of the industrial line scan camera and control the line scan camera to perform line scanning acquisition with equal physical steps to obtain a continuous grayscale image stream of fiber products. The segmentation and stacking unit is used to perform sliding segmentation and batch stacking of the region of interest in a continuous grayscale image stream of fiber products to obtain the original image batches. The normalization encapsulation unit is used to normalize and expand the dimensions of the original image batch to obtain the fiber product source image tensor.

3. The industrial visual intelligent online detection system for texture defects in fiber products according to claim 1, characterized in that, The geometric adaptive calibration module includes: The parameter regression unit is used to input the tensor of the source image of the fiber product into a localized network containing convolutional and fully connected layers to extract macroscopic geometric features and perform dimensionality reduction mapping to obtain affine deformation parameters. Mesh generation unit, used to perform inverse projection transformation on the coordinates of a preset standard target mesh based on affine deformation parameters to obtain the transformed mesh matrix; The interpolation sampling unit is used to perform differentiable bilinear interpolation sampling on the fiber product source image tensor based on the transformation grid matrix to obtain the calibrated fiber product image tensor.

4. The industrial visual intelligent online detection system for texture defects in fiber products according to claim 1, characterized in that, The multi-scale feature masking encoding module includes: The mask injection unit is used to perform structured random mask injection on the calibration fiber product image tensor to obtain the mask image tensor. The feature extraction unit is used to perform pyramid-level feature extraction on the mask image tensor to obtain an intermediate feature set containing multi-level feature maps and a terminal feature tensor with the lowest resolution. The latent variable encapsulation unit is used to extract latent variable features by performing channel compression mapping on the end feature tensor through the bottleneck layer, and to combine and encapsulate the latent variable features with the intermediate feature set according to the resolution level to obtain a multi-scale feature list of fiber products.

5. The industrial visual intelligent online detection system for texture defects in fiber products according to claim 1, characterized in that, The structure-aware and texture reconstruction module includes: The feature parsing unit is used to parse the latent variable features and encoder-side features from the multi-scale feature list of fiber products according to the resolution level, and to perform transpose convolution projection on the latent variable features to obtain the skip connection feature set and the current decoded features. The cascaded fusion unit is used to employ a cascaded upsampling strategy to concatenate the current decoded features with the skip connection feature set along the channel dimension, and to use a channel attention mechanism to adaptively allocate weights and perform convolutional smoothing on the concatenated features to obtain high-resolution texture features. The reconstruction mapping unit is used to reconstruct, map, and activate high-resolution texture features to obtain a reconstructed fiber product image tensor.

6. The industrial visual intelligent online detection system for texture defects in fiber products according to claim 1, characterized in that, The difference map calculation and inverse mapping module includes: The difference calculation unit is used to calculate the calibration domain anomaly heatmap between the calibration fiber product image tensor and the reconstructed fiber product image tensor. The inverse reprojection unit is used to perform inverse reprojection on the calibration domain anomaly heatmap based on the coordinate mapping relationship in the transformed grid matrix to obtain the physical coordinate anomaly heatmap.

7. The industrial visual intelligent online detection system for texture defects in fiber products according to claim 1, characterized in that, The defect segmentation and analysis module includes: The smoothing and noise reduction unit is used to perform Gaussian space smoothing and noise reduction on the physical coordinate anomaly heatmap to obtain a smooth heatmap. A dynamic segmentation unit is used to perform statistically based dynamic threshold segmentation on a smooth heatmap to obtain a binary defect mask; The morphological analysis unit is used to perform connected domain morphological analysis on the binary defect mask to extract the geometric coordinate information of the preserved region, and to extract the confidence score from the smoothed heatmap to obtain defect result data containing the location and type of the defect.

8. The industrial visual intelligent online detection system for texture defects in fiber products according to claim 6, characterized in that, The difference calculation unit includes: The gradient estimation subunit is used to estimate the texture gradient field of the reconstructed fiber product image tensor using directional differential operators to obtain a texture gradient magnitude map. The gated mapping subunit is used to perform negative exponential decay nonlinear mapping on the texture gradient magnitude map to obtain the L2 reliability gated map. The adaptive fusion subunit is used to perform gradient-aware adaptive complementary fusion of the calibration fiber product image tensor and the reconstructed fiber product image tensor using the L2 reliability gating graph as a dynamic adjustment factor to obtain an anomaly heatmap of the calibration domain.