An unsupervised nonwoven fabric defect detection method based on wavelet frequency domain double enhancement
Patent Information
- Application Number
- CN202610655817.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-13
- Publication Date
- 2026-08-18
AI Technical Summary
1)人工检测效率低、主观性强、误漏检率高,无法适配工业化流水线生产;
1、本申请采用无监督检测范式,模型训练仅依托无缺陷的正常无纺布样本即可完成特征分布学习,无需采集、标注大量工业缺陷样本,规避了有监督检测方案标注成本高、缺陷样本稀缺的行业痛点,更适配工业实际落地场景。
Smart Images

Figure CN122597849A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of machine vision, deep learning and fabric surface defect detection technology, and in particular to an unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement. Background Technology
[0002] Nonwoven fabrics are an important branch of the textile industry, widely used in medical protective equipment, industrial filtration, civil hygiene, and construction engineering. During the industrial production of nonwoven fabrics, factors such as equipment wear and tear, process parameter deviations, operator errors, and environmental disturbances can easily cause various surface defects, including holes, blemishes, fiber clumps, uneven thickness, stains, scratches, dotted spots, and abnormal filamentous textures. The presence of these surface defects directly determines the quality grade of the nonwoven fabric product; if quality control is not rigorous, it will significantly reduce the product qualification rate and the company's economic benefits.
[0003] Currently, most small and medium-sized nonwoven fabric manufacturers in China still use manual visual inspection to screen for surface defects. This inspection method has drawbacks such as high training costs, high labor intensity, and low inspection efficiency. At the same time, the inspection results are easily affected by the subjective experience and physical fatigue of quality inspectors, resulting in frequent false detections and missed detections. This method cannot meet the standardized and high-precision quality inspection requirements of continuous production lines.
[0004] With the development of computer vision and deep learning technologies, automated defect detection based on machine vision is gradually replacing manual inspection. Existing fabric defect detection algorithms are mainly divided into two categories: supervised learning detection methods and unsupervised learning anomaly detection methods.
[0005] Supervised learning detection methods rely on a large number of defect samples with category and pixel annotations to complete model training. However, in actual industrial scenarios, it is difficult to collect non-woven fabric defect samples, the distribution of various defect samples is uneven, and the workload and cost of pixel-level manual annotation are large and expensive. As a result, the generalization ability of supervised detection models is limited, making it difficult to deploy them on a large scale in industry.
[0006] In unsupervised anomaly detection research, the mainstream technical frameworks mainly include Generative Adversarial Networks (GAN), Knowledge Distillation (KD), and Reverse Distillation Unsupervised Anomaly Detection (RD4AD).
[0007] Among them, the GAN framework achieves defect feature fitting through adversarial training between the generator and the discriminator. However, this architecture suffers from unstable training process, is prone to mode collapse, has weak global defect localization capability in small sample scenarios, is prone to losing defect detail features, and has limited detection accuracy. The KD knowledge distillation framework can achieve multi-scale feature knowledge transfer and cover complex defect morphologies, but it has problems such as insufficient ability to capture local defect features and lack of pixel-level defect localization accuracy. RD4AD, as a classic unsupervised architecture of reverse distillation, has a good balance between detection accuracy and inference speed, and has become a commonly used baseline model for industrial texture defect detection. However, this architecture still has inherent limitations.
[0008] Furthermore, existing unsupervised defect detection models, regardless of whether they are based on GAN, KD, or RD4AD architectures, only perform feature extraction, feature enhancement, and defect recognition in the image spatial domain, without exploring complementary information in the image frequency domain. From the perspective of image frequency domain characteristics analysis, the texture details of defects on the nonwoven fabric surface correspond to high-frequency signals in the image, while the global texture structure of a large area of background corresponds to low-frequency signals. Traditional single spatial domain modeling methods cannot achieve effective separation and differentiated representation of high- and low-frequency features.
[0009] Meanwhile, existing lightweight attention feature enhancement schemes, such as EfficientChannel Attention (ECA), only perform local interaction modeling in the channel dimension, completely compressing spatial dimension information and lacking spatial location association feature mining. They cannot adapt to the feature representation requirements of small defects and weak contrast defects in the background of complex non-woven fabric textures. Conventional global context modeling and sequence modeling modules also do not have customized structures for the high and low frequency features of fabrics in the frequency domain, making it difficult to simultaneously take into account global background texture representation and local defect detail enhancement.
[0010] In summary, existing nonwoven fabric defect detection technologies have the following prominent problems: 1) Manual inspection is inefficient, subjective, and has a high rate of false negatives and false negatives, making it unsuitable for industrialized assembly line production. 2) Supervised inspection methods rely on a large number of labeled defect samples, but samples are scarce and labeling costs are high in industrial scenarios, resulting in poor implementation. 3) Mainstream unsupervised detection frameworks such as GAN, KD, and RD4AD are all limited to spatial domain feature processing, which cannot effectively separate high-frequency details of defects from low-frequency global features of the background, resulting in insufficient accuracy in locating and detecting small defects. 4) Traditional attention modules such as ECA only focus on channel dimension modeling, lack spatial dimension feature association, and lack dedicated high and low frequency feature enhancement structures adapted to the frequency domain characteristics of non-woven fabrics. Summary of the Invention
[0011] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes an unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement. It adopts a wavelet frequency domain divide-and-conquer feature processing combined with a teacher-student distillation feature difference comparison architecture, which breaks through the limitation of traditional defect detection only in the image spatial domain. It can complete model learning based on defect-free normal samples, and achieve high-precision discrimination and pixel-level accurate localization of nonwoven fabric defects.
[0012] This application provides an unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement, including the following steps: 1) Acquire the original image of the nonwoven fabric to be inspected, and perform size normalization preprocessing on the original image to obtain an input image with uniform specifications; 2) The preprocessed input image is fed into a teacher encoder with fixed parameters to extract multi-scale deep features; 3) Input the multi-scale deep features into the wavelet high-low frequency joint enhancement module, and after wavelet frequency domain decomposition, perform independent feature transformation processing on the low-frequency feature components and high-frequency feature components respectively; 4) The enhanced features are fed into the single-class bottleneck embedding module to complete multi-scale feature dimension compression and feature embedding; 5) The embedded feature input wavelet low-frequency dedicated enhancement module only performs feature encoding and reconstruction on the low-frequency feature components in the frequency domain, while the high-frequency feature components remain in their original state without processing; 6) The processed features are fed into a trainable student decoder to perform reverse reconstruction of normal texture features; 7) Compare the difference distribution between the output features of the teacher encoder and the reconstructed features of the student decoder, and realize the non-woven fabric defect discrimination and pixel-level localization based on the feature differences.
[0013] According to one embodiment of this application, the wavelet high-low frequency joint enhancement module includes a Haar wavelet decomposition unit, a low-frequency feature processing branch, a high-frequency feature processing branch, and a wavelet inverse transform reconstruction unit. The Haar wavelet decomposition unit decomposes the input features into one low-frequency sub-band feature and three high-frequency sub-band features; Low-frequency sub-band features are input into the spatial environment perception module for contextual association modeling. Three high-frequency sub-band features are input into an adaptive channel spatial module for joint channel and spatial feature mapping. All sub-band features processed by each branch are reconstructed into complete spatial domain features via inverse wavelet transform.
[0014] According to one embodiment of this application, the spatial environment perception module is configured with a three-branch parallel structure, including a global information aggregation branch, a channel redundancy mapping branch, and a dimension reduction association branch. The global information aggregation branch configures global average pooling and global max pooling structures; The channel redundancy mapping branch uses 1×1 convolution to achieve linear transformation of the channel dimension; The dimension reduction association branch uses 1×1 convolution to complete channel dimensionality reduction of query and key features; The output features of each branch are fused across channels and across spaces by multiplying the features with matrix operations.
[0015] According to one embodiment of this application, the adaptive channel space module is composed of a channel feature modeling subunit and a spatial feature modeling subunit; The channel feature modeling subunit constructs channel descriptors based on global average pooling, generates local channel interaction features and global channel association features respectively, and obtains channel attention weights through adaptive fusion; The spatial feature modeling subunit performs average pooling and max pooling on the features in the channel dimension, respectively, and after concatenation, it generates spatial attention weights through convolution and activation. Channel attention weights and spatial attention weights are used to perform a weighted mapping of the original high-frequency features on a channel-by-channel and spatial-position-by-spatial basis.
[0016] According to one embodiment of this application, the wavelet low-frequency dedicated enhancement module includes a Haar wavelet decomposition unit, a low-frequency feature enhancement branch, a high-frequency feature direct-through branch, and a wavelet inverse transform reconstruction unit; The Haar wavelet decomposition unit decomposes the input embedded features into one low-frequency sub-band feature and three high-frequency sub-band features; Low-frequency subband features are fed into an adaptive Mamba-like global enhancement module for sequence structure modeling and feature encoding; The three high-frequency sub-band features are directly fed into the wavelet inverse transform reconstruction unit without undergoing additional feature transformation to complete feature fusion.
[0017] According to one embodiment of this application, the adaptive Mamba-like global enhancement module includes a feature serialization unit, a position encoding unit, a multi-head QKV generation unit, a linear attention calculation unit, a local position enhancement unit, a residual connection unit, and a feedforward network unit; The feature serialization unit converts a two-dimensional feature map into a one-dimensional sequence and performs layer normalization; The position coding unit integrates rotational position coding and local position coding; The multi-head QKV generation unit synchronously generates query, key, and value features and performs activation scaling; The module is configured with two levels of residual connections and completes feature channel expansion and compression mapping through a feedforward network.
[0018] According to one embodiment of this application, both the teacher encoder and the student decoder use a wide residual network as the basic backbone structure, which is composed of multiple layers of residual convolutional units stacked together, for multi-scale semantic feature extraction and reverse feature reconstruction.
[0019] According to one embodiment of this application, when iteratively training the network parameters, only defect-free normal nonwoven fabric samples are used as the training data source; after training, all parameters of the teacher encoder are fixed, and only the student decoder is retained as trainable and updatable parameters to fit the inherent feature distribution of normal nonwoven fabric texture.
[0020] According to one embodiment of this application, during the detection inference process, the feature distance metric between the output features of the teacher encoder and the reconstructed features of the student decoder is calculated pixel by pixel and channel by channel; the feature distance metric is binary-divided by a preset feature difference threshold, and the pixel regions exceeding the threshold are marked as defect regions, and the image-level defect discrimination result and the pixel-level defect localization mask are output respectively.
[0021] According to one embodiment of this application, an anomaly score heatmap is generated based on the pixel-level defect location results. A Gaussian filter operator with a set standard deviation is used to perform smooth convolution processing on the heatmap to suppress pixel-level random noise and correct the edges of the defect area.
[0022] Compared with the prior art, this application has the following beneficial effects: 1. This application adopts an unsupervised detection paradigm. The model training can complete the feature distribution learning by relying only on defect-free normal non-woven fabric samples. There is no need to collect and label a large number of industrial defect samples, which avoids the industry pain points of high labeling cost and scarce defect samples in supervised detection schemes, and is more suitable for actual industrial application scenarios.
[0023] 2. This application breaks away from the traditional feature processing mode that only performs feature processing in the image spatial domain. It introduces wavelet frequency domain decomposition mechanism for the first time, which splits image features into low-frequency global components and high-frequency detail components. This achieves decoupled representation of global texture of non-woven fabric background and local details of defects, and overcomes the shortcomings of spatial domain methods, such as difficulty in separating high and low frequency features, easy omission of small defects, and loss of detail features.
[0024] 3. This application designs a wavelet high- and low-frequency joint enhancement module and a wavelet low-frequency dedicated enhancement module that work together to perform structured feature enhancement on the high- and low-frequency components and the pure low-frequency components in the frequency domain, respectively. Combined with an adapted spatial environment perception module, an adaptive channel space module, and an adaptive Mamba-like global enhancement module, it makes up for the shortcomings of traditional ECA attention mechanism in lacking spatial information and conventional modeling modules in being unable to adapt to the frequency domain features of fabrics, thereby enhancing the ability to express multi-scale features.
[0025] 4. This application defines the teacher-student encoder-decoder backbone structure, parameter fixing and update strategy, feature difference comparison logic, and post-processing smoothing correction process. The overall architecture is clear and the feature transfer is stable. It can not only ensure the accurate reconstruction of normal texture features, but also amplify the feature differences in defect areas, effectively improving the sample-level discrimination accuracy and pixel-level positioning accuracy of non-woven fabric defects, and meeting the real-time and high-precision requirements of industrial quality inspection.
[0026] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0027] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 A flowchart illustrating the unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement provided in this application embodiment; Figure 2 This is a block diagram illustrating the overall principle of the unsupervised wavelet enhancement network provided in the embodiments of this application. Figure 3 This is a schematic diagram of the internal structure of the wavelet high- and low-frequency joint enhancement module provided in an embodiment of this application; Figure 4 This is a schematic diagram of the internal structure of the spatial environment perception module provided in an embodiment of this application; Figure 5 This is a schematic diagram of the overall structure of the adaptive channel space module provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of the wavelet low-frequency dedicated enhancement module provided in the embodiments of this application; Figure 7 This is a schematic diagram of the structure of the adaptive Mamba global enhancement module provided in an embodiment of this application. Detailed Implementation
[0028] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0029] The following is for reference. Figures 1-7 This application describes an unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement according to embodiments of the present application.
[0030] Please see Figure 1This application provides an unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement, which includes steps 1, 2, 3, 4, 5, 6 and 7.
[0031] Step 1: Acquire the original image of the nonwoven fabric to be inspected, and perform size normalization preprocessing on the original image to obtain an input image with uniform specifications.
[0032] In step 1, the original image of the nonwoven fabric to be inspected, acquired in step 1, can be obtained by deploying an industrial area scan camera or line scan camera along the nonwoven fabric production line. This allows for real-time, continuous acquisition of images of the nonwoven fabric surface as it moves along the production line, fully preserving the normal base texture of the nonwoven fabric, as well as the appearance details of various defects such as holes, blemishes, fiber clusters, uneven thickness, stains, dotted impurities, and abnormal filamentary patterns. The original images acquired on-site may have inconsistent resolution, pixel size, and aspect ratio. Directly inputting these images into the network for feature extraction can easily lead to multi-scale feature hierarchy disorder and frequency domain decomposition deviation. Therefore, it is necessary to perform size normalization preprocessing on the original images, uniformly adjusting them to a fixed standard size to eliminate algorithmic interference caused by input scale differences. This results in input images with uniform specifications and consistent scale, providing a standardized input basis for subsequent multi-level feature extraction and frequency domain enhancement.
[0033] Step 2: Feed the preprocessed input image into a teacher encoder with fixed parameters to extract multi-scale deep features.
[0034] Please see Figure 2 , Figure 2 This is a block diagram illustrating the overall principle of the unsupervised wavelet enhancement network in this application. The diagram shows three main functional modules: BWDGL, OCBE, and BWDLF. It also indicates the L1, L2, and L3 multi-scale feature layers, as well as convolution and pooling operations such as Conv7×7, Conv1×1, Conv3×3, and Max pooling. The entire block diagram comprehensively presents the complete data flow logic of the network, starting from the input image, passing through multi-scale feature layers sequentially, successively connecting to the wavelet high- and low-frequency joint enhancement module, the single-class bottleneck embedding module, and the wavelet low-frequency dedicated enhancement module, ultimately completing feature reconstruction and difference discrimination. The various convolution and pooling labels in the diagram correspond to the basic feature operation units within the network, and L1, L2, and L3 correspond to the three multi-scale deep feature layers output by the teacher encoder.
[0035] In step 2, the teacher encoder with fixed parameters refers to the one that relies internally on... Figure 2 The convolutional units (Conv7×7, Conv1×1, Conv3×3) and max pooling units are stacked together. Through alternating convolution and pooling operations, feature mining is performed layer by layer to extract features from the low-level texture, mid-level structure, and high-level semantics, ultimately outputting the corresponding... Figure 2The L1, L2, and L3 multi-scale deep features are used. After the teacher encoder completes pre-training, its overall parameters are fixed and locked. It will not participate in parameter iteration updates in the subsequent detection process. It only serves as a static multi-scale feature extractor, stably outputting multi-layer feature information containing the global background and local defect details of the nonwoven fabric, providing reliable basic features for subsequent frequency domain decomposition and dual-module enhancement.
[0036] Step 3: Input the multi-scale deep features into the wavelet high-low frequency joint enhancement module. After wavelet frequency domain decomposition, perform independent feature transformation processing on the low-frequency feature components and high-frequency feature components respectively.
[0037] In step 3, the L1, L2, and L3 multi-scale deep features output by the teacher are input into... Figure 2 The image shows the internal structure of the wavelet high- and low-frequency joint enhancement module labeled BWDGL. This module leverages the complete orthogonality and information-loss-free characteristics of wavelet transform to map multi-scale features to the frequency domain, separating low-frequency feature components representing the global background and high-frequency feature components representing defect edges and subtle texture variations. Independent feature transformation processing is then performed on the semantic attributes of each type of component, achieving decoupling optimization between the global structure and local defect details. This overcomes the limitation of traditional feature processing in the spatial domain, which cannot accurately distinguish between high and low-frequency information.
[0038] Step 4: Feed the enhanced features into the single-class bottleneck embedding module to complete multi-scale feature dimension compression and feature embedding.
[0039] In step 4, the multi-scale features optimized by the wavelet high-low frequency joint enhancement module are fed into... Figure 2 The module labeled OCBE is a single-class bottleneck embedding module. This module performs synchronous compression mapping of channel and spatial dimensions on the enhanced high-dimensional multi-scale features, projecting redundant high-dimensional features into the low-dimensional feature embedding space. While preserving the core distribution features of the normal texture of nonwoven fabric to the greatest extent, it removes invalid and redundant information, completing the dimensional compression and compact embedding expression of multi-scale features, and providing concise and effective feature input for subsequent low-frequency secondary enhancement and feature reconstruction.
[0040] Step 5: Input the embedded features into the wavelet low-frequency dedicated enhancement module, and only perform feature encoding and reconstruction on the low-frequency feature components in the frequency domain, while keeping the high-frequency feature components in their original state without processing.
[0041] In step 5, the embedding features output by the OCBE module are fed into... Figure 2The module labeled BWDLF is a dedicated low-frequency enhancement module for wavelets. This module differs from the BWDGL module in its functional design. While both use wavelet transform for frequency domain sub-band splitting, it encodes, reconstructs, and enhances only the low-frequency feature components representing the global basis structure. The high-frequency detail components undergo no additional transformation, retaining their original feature state and directly participating in subsequent transmission. This approach strengthens the stability of the global texture representation while fully preserving the high-frequency details of defects without weakening them.
[0042] Step 6: Feed the processed features into the trainable student decoder to perform reverse reconstruction of normal texture features.
[0043] In step 6, the trainable student decoder receives the feature data processed by the BWDLF module. The student decoder is based on the trainable network layer and only learns to fit the feature distribution law of the non-woven fabric without defects and normal texture. It can only complete the high-precision reverse reconstruction of the features of normal areas and cannot fit or replicate the feature distribution of defective areas, thus naturally forming a representation gap between normal samples and defective samples in the feature dimension.
[0044] Step 7: Compare the difference distribution between the output features of the teacher encoder and the reconstructed features of the student decoder, and realize the non-woven fabric defect discrimination and pixel-level localization based on the feature differences.
[0045] In step 7, by comparing the multi-scale features output by the fixed teacher encoder with the restored features reconstructed by the trainable student decoder, the overall feature difference distribution between the two is quantified. Based on the preset difference threshold, the normal area and abnormal area of the image are divided. This can not only achieve sample-level discrimination of whether there are defects in the whole non-woven fabric image, but also lock the pixel position of the defect and complete pixel-level precise positioning.
[0046] According to the method provided in this application, network learning can be completed using only normal nonwoven fabric samples based on an unsupervised learning model. A wavelet frequency domain dual-enhancement approach is introduced, using two differentiated modules, BWDGL and BWDLF, to specifically enhance high-frequency and low-frequency features, and pure low-frequency features respectively. Combined with multi-scale hierarchical and convolutional pooling operations, the global background and local defect details of the nonwoven fabric are effectively separated, improving the recognition ability of small, weak-contrast defects. Simultaneously, a distillation architecture with fixed teacher parameters and trainable students is adopted to stably amplify the feature differences between normal and defective regions. While meeting the real-time detection speed requirements of textile production lines, this significantly improves the sample-level discrimination accuracy and pixel-level positioning precision of nonwoven fabric defects.
[0047] According to some embodiments of this application, the wavelet high-low frequency joint enhancement module includes a Haar wavelet decomposition unit, a low-frequency feature processing branch, a high-frequency feature processing branch, and a wavelet inverse transform reconstruction unit. The Haar wavelet decomposition unit decomposes the input features into one low-frequency sub-band feature and three high-frequency sub-band features. The low-frequency sub-band features are input into the spatial environment perception module for context association modeling. The three high-frequency sub-band features are input into the adaptive channel space module for channel and space joint feature mapping. All sub-band features processed by each branch are reconstructed into complete spatial domain features through wavelet inverse transform.
[0048] Please see Figure 3 , Figure 3 This is a schematic diagram of the internal structure of the wavelet high- and low-frequency joint enhancement module, corresponding to the BWDGL module. Figure 3 The identifiers in the text are explained as follows: F_in: Module input features, with dimensions H×W×C (height×width×number of channels).
[0049] DWT: Discrete Wavelet Transform Unit, also known as Haar wavelet decomposition unit, is responsible for frequency domain decomposition of input features.
[0050] LL, LH, HL, HH: Four frequency domain sub-band features obtained after DWT decomposition. Among them, LL is the low-frequency sub-band (Low-Low), corresponding to one low-frequency sub-band feature; LH, HL, and HH are three high-frequency sub-bands (Low-High, High-Low, High-High), corresponding to three high-frequency sub-band features.
[0051] SCAM: Space Environment Sensing Module (corresponding to...) Figure 4 The structure is the core unit of the low-frequency feature processing branch, which only processes the low-frequency subband LL.
[0052] ACSP: Adaptive Channel Space Module (corresponding to) Figure 5 The structure is the core unit of the high-frequency feature processing branch. The three high-frequency subbands LH, HL, and HH are first merged by concatenation (⊕) and then sent to this module for processing.
[0053] ⊕Concatenation: A splicing operation used to merge the features of three high-frequency subbands along the channel dimension.
[0054] IDWT: Inverse Discrete Wavelet Transform (IDWT) unit, also known as the inverse wavelet transform reconstruction unit, fuses the processed low-frequency features with high-frequency features to reconstruct spatial domain features.
[0055] F_out: Module output features, with dimensions restored to H×W×C, corresponding to complete spatial domain features.
[0056] F_in→DWT: The Haar wavelet decomposition unit decomposes the input features into one low-frequency sub-band feature and three high-frequency sub-band features.
[0057] LL→SCAM: Complete the context association modeling of the low-frequency sub-band feature input spatial environment perception module.
[0058] LH / HL / HH→⊕→ACSP: Completes the joint feature mapping of the channel and space in the adaptive channel spatial module for the input of three high-frequency sub-band features.
[0059] SCAM output + ACSP output → ⊕ → IDWT → F_out: All sub-band features after processing each branch are reconstructed into complete spatial domain features by wavelet inverse transform.
[0060] Figure 3 The module clearly demonstrates the arrangement and feature flow between the Haar wavelet decomposition units, low-frequency feature processing branches, high-frequency feature processing branches, and inverse wavelet transform reconstruction units. The entire module uses the Haar wavelet transform as the basis for frequency domain decomposition. Unlike other wavelet basis functions, the Haar wavelet is characterized by its simple structure, low computational cost, and strong edge feature capture capability, making it suitable for the frequency domain decomposition requirements of non-woven fabric textures and minute defects.
[0061] In this embodiment, the wavelet high-low frequency joint enhancement module serves as the core functional unit for feature frequency domain enhancement. It consists of four parts: a Haar wavelet decomposition unit, a low-frequency feature processing branch, a high-frequency feature processing branch, and a wavelet inverse transform reconstruction unit. The four units are connected sequentially according to the feature flow direction to form a closed-loop processing logic of decomposition, branch processing, and reconstruction.
[0062] The Haar wavelet decomposition unit is the feature splitting unit at the front end of the module. It receives multi-scale deep features output from the teacher encoder and, through the frequency domain mapping relationship of the Haar wavelet basis functions, uniformly splits the input features into one low-frequency sub-band feature and three high-frequency sub-band features. The low-frequency sub-band feature mainly retains the large-area stable background texture information of the non-woven fabric, while the three high-frequency sub-band features respectively carry detail information at different scales, such as abrupt changes in defect edges, fluctuations in texture details, and local speckle variations, achieving a natural decoupling between the global background and local defect details. This implementation does not limit the specific value of the number of sub-bands; the splitting structure of one low-frequency sub-band and three high-frequency sub-bands is the preferred implementation, facilitating independent processing of subsequent branches.
[0063] The low-frequency feature processing branch takes the spatial environment perception module as the core processing unit. The single-channel low-frequency sub-band features output by the Haar wavelet decomposition unit are directly fed into the module. Relying on the multi-branch parallel operation structure inside the module, the feature cross-channel and cross-space context association modeling is completed, which enhances the feature representation capability of the global texture structure of non-woven fabric, so that the low-frequency features can stably reflect the overall substrate texture distribution law.
[0064] The high-frequency feature processing branch simultaneously receives three high-frequency sub-band features, which are then input into the adaptive channel space module in parallel. This module synchronously completes channel dimension weight modeling and spatial dimension position association modeling, realizing joint feature mapping between channels and space. It adaptively enhances and suppresses interference for each high-frequency defect detail feature, retaining effective defect texture information while weakening irrelevant noise features.
[0065] After the low-frequency feature processing branch and the high-frequency feature processing branch respectively complete the feature transformation of each sub-band feature, they are uniformly merged into the back-end wavelet inverse transform reconstruction unit. The wavelet inverse transform reconstruction unit re-integrates and maps the multi-separated sub-band features in the frequency domain back to the spatial domain according to the inverse operation rules of Haar wavelet transform. The reconstruction results in a complete spatial domain feature with differentiated enhancement of both high and low frequency features, which is then output to the subsequent single-class bottleneck embedding module to participate in subsequent feature processing.
[0066] According to some embodiments of this application, the spatial environment perception module is configured with a three-branch parallel structure, including a global information aggregation branch, a channel redundancy mapping branch, and a dimension reduction association branch; the global information aggregation branch is configured with global average pooling and global max pooling structures; the channel redundancy mapping branch uses 1×1 convolution to achieve linear transformation of channel dimensions; the dimension reduction association branch uses 1×1 convolution to complete channel dimensionality reduction of query and key features; the output features of each branch are fused across channels and across spaces by matrix operations and feature multiplication.
[0067] Please see Figure 4 , Figure 4 This is a schematic diagram of the internal structure of the spatial environment perception module, corresponding to the SCAM module. It clearly shows the overall architecture of the three parallel branches, as well as the computing units and feature flow within each branch, which is completely consistent with the structure of this embodiment. Figure 4 The identifiers in the code are explained as follows: F_in represents the module input features, i.e., features from... Figure 3The low-frequency subband features are defined as follows: GAP is the Global Average Pooling unit, and GMP is the Global Max Pooling unit, which together constitute the global information aggregation branch; Conv is a 1×1 convolution unit, corresponding to the core operation structure of the channel redundancy mapping branch and the dimension reduction association branch, respectively; V is the Value feature generated by the channel redundancy mapping branch through 1×1 convolution; QK is the Query / Key feature generated by the dimension reduction association branch through 1×1 convolution; Softmax is the activation function used to generate the attention weight distribution; ⊗ is the matrix multiplication operation, and ⊙ is the broadcast Hadamard product (element-wise multiplication) operation, used for the fusion operation of features from each branch; F_out is the module output feature, which is the enhanced low-frequency subband feature after completing the context association modeling.
[0068] The spatial environment perception module, as the core unit of the low-frequency feature processing branch in the wavelet high-low frequency joint enhancement module, adopts a three-branch parallel structure. The three branches simultaneously receive LL low-frequency sub-band features and perform synchronous calculations. Each branch is independent yet cooperative, and finally forms enhanced low-frequency features through feature fusion. Its core function is to strengthen the contextual association of the global background texture of non-woven fabric in the low-frequency sub-band, improve the representation stability of the global base texture, and provide reliable low-frequency feature support for subsequent feature reconstruction.
[0069] The global information aggregation branch is the fundamental information acquisition branch among the three branches. It is mainly responsible for aggregating the global contextual information of the LL low-frequency subband features. Internally, it is configured with two pooling structures: global average pooling and global max pooling. The two pooling methods work in parallel and are calculated synchronously. Global average pooling is used to capture the overall mean information of the global background texture in the low-frequency features, preserving the overall feature distribution of the large-area stable nonwoven fabric substrate. Global max pooling is used to capture the peak information of local texture in the low-frequency features, taking into account the subtle structural changes in the global background. The combination of the two can comprehensively and completely extract the global contextual features of the low-frequency subband, avoiding the loss of feature information caused by a single pooling method.
[0070] The channel redundancy mapping branch is primarily responsible for performing linear transformations of the channel dimensions and sorting out redundant information for low-frequency sub-band features, using 1×1 convolutions as the core computational unit. 1×1 convolutions are characterized by few parameters and high computational efficiency, enabling linear mapping of the channel dimensions of input features without altering the feature space size. This achieves information exchange between channels and suppression of redundant features, while simultaneously adjusting the feature channel dimensions to fit the specifications of subsequent fusion operations, generating Value features for feature fusion and providing a basic feature carrier for cross-channel and cross-space fusion.
[0071] The dimensionality reduction and association branch is primarily responsible for generating query and key features for attention calculation and performing dimensionality reduction processing on feature channels. It also uses 1×1 convolutions as the core computational unit. By performing channel dimensionality reduction on the input LL low-frequency subband features through 1×1 convolutions, the feature dimensionality and computational cost are effectively reduced. Simultaneously, query and key features are generated. These two types of features are used in subsequent matrix operations to achieve similarity measurement and attention weight allocation between features, providing support for cross-channel and cross-space feature association.
[0072] After each of the three branches completes its own calculations, cross-channel and cross-space feature fusion is achieved through matrix operations and feature multiplication. Specifically, the Query and Key features generated by the dimensionality reduction and association branch are multiplied by matrix operations and activated by Softmax to generate an attention weight distribution. This attention weight is then multiplied element-wise with the Value features generated by the channel redundancy mapping branch to achieve feature weighting. At the same time, the global context features extracted by the global information aggregation branch are fused to finally output an enhanced low-frequency sub-band feature that takes into account both global correlation and local details, completing the context correlation modeling process of the entire spatial environment perception module. This output feature is then incorporated into the wavelet inverse transform reconstruction unit to participate in the subsequent reconstruction of the complete spatial domain features.
[0073] According to some embodiments of this application, the adaptive channel space module consists of a channel feature modeling subunit and a spatial feature modeling subunit. The channel feature modeling subunit constructs channel descriptors based on global average pooling, generates local channel interaction features and global channel association features respectively, and obtains channel attention weights through adaptive fusion. The spatial feature modeling subunit performs average pooling and max pooling on the features in the channel dimension respectively, and generates spatial attention weights by convolution and activation after concatenation. The channel attention weights and spatial attention weights are used to perform a weighted mapping of the original high-frequency features per channel and per spatial position.
[0074] Please see Figure 5 , Figure 5 This is a schematic diagram of the overall structure of the adaptive channel spatial module, corresponding to the ACSP structure described above. It is divided into two main parts: the channel attention branch and the spatial attention branch, which are connected in sequence to form a complete feature processing link. Figure 5The diagram clearly indicates the English text and structural identifiers. I_in represents the module input feature, which is the fused high-frequency feature of the three high-frequency sub-bands after channel concatenation. (a) ACSP represents the overall architecture of the adaptive channel spatial module. (b) Channel Attention is the structure corresponding to the channel feature modeling sub-unit, which contains GAP global average pooling, Conv convolutional units, and Mix adaptive fusion units. (c) Spatial Attention is the structure corresponding to the spatial feature modeling sub-unit, which is configured with GAP global average pooling, GMP global max pooling, and Conv convolutional activation units. In the diagram, ⊗ represents the element-wise weighted multiplication operation of features, and I_out is the high-frequency feature output by the module after dual channel and spatial enhancement.
[0075] The adaptive channel space module adopts a two-stage serial architecture, with channel feature modeling sub-units and spatial feature modeling sub-units set up sequentially. The two sub-units perform their respective functions and are connected one after the other. First, feature correlation information is mined from the channel dimension, and then positional change information is captured from the spatial dimension. It adapts to the distribution characteristics of non-woven fabric defects, which are mostly edge texture changes and local detail anomalies, and performs fine modeling and enhancement processing on high-frequency defect features.
[0076] Channel feature modeling sub-unit corresponding Figure 5 The Channel Attention section, the front-end processing part of the module, uses an internally configured global average pooling (GAP) as its basic structure to construct standardized channel descriptors. It performs global information statistics on each channel of the input high-frequency fused features, characterizing the texture and semantic details carried by each feature channel. Based on this, it derives local channel interaction features and global channel association features. Local channel interaction features focus on the information association and semantic complementarity between adjacent channels, while global channel association features focus on the overall distribution pattern and semantic association of all channels. After both types of features are modeled, they are processed by... Figure 5 The Mix adaptive fusion unit in the model is integrated into a unified representation, thereby generating stable and reliable channel attention weights to represent the differences in the importance of different feature channels to the defect detection task.
[0077] Spatial feature modeling sub-unit correspondence Figure 5The Spatial Attention section inherits the processing logic of the channel feature modeling subunit. At the channel dimension level, it simultaneously configures GAP global average pooling and GMP global max pooling, and performs average pooling and max pooling operations on the features. The two pooling methods extract mean texture information and extreme texture information at different positions of the feature map, respectively. Then, the two pooling results are concatenated and fused, and then feature mapping and dimensionality reduction are performed through the internal Conv convolutional layer. With the help of the activation function, nonlinear transformation is completed, and finally, spatial attention weights that can represent the importance of spatial position are generated, which accurately highlights key spatial positions such as defect edges and texture abrupt changes, and suppresses the interference response of flat and meaningless background areas.
[0078] After all channel attention weights and spatial attention weights are generated, relying on Figure 5 The weighted operation method applies weighted adjustments to the original high-frequency features in a sequential manner. Channel-by-channel feature scaling and strength adjustment are performed based on channel attention weights, followed by spatial location-by-spatial feature enhancement based on spatial attention weights. This achieves synchronous adaptive mapping optimization of the original high-frequency features in both channel and spatial dimensions. The weighted mapping of the high-frequency features preserves more subtle texture details and weakens noise and irrelevant background interference before being fed into the subsequent wavelet inverse transform reconstruction unit for overall feature restoration.
[0079] According to some embodiments of this application, the wavelet low-frequency dedicated enhancement module includes a Haar wavelet decomposition unit, a low-frequency feature enhancement branch, a high-frequency feature direct-through branch, and a wavelet inverse transform reconstruction unit. The Haar wavelet decomposition unit decomposes the input embedded features into one low-frequency sub-band feature and three high-frequency sub-band features. The low-frequency sub-band features are sent to the adaptive Mamba-like global enhancement module for sequence structure modeling and feature encoding. The three high-frequency sub-band features do not undergo additional feature transformation and directly enter the wavelet inverse transform reconstruction unit to complete feature fusion.
[0080] Please see Figure 6 This is a schematic diagram of the structure of the wavelet low-frequency enhancement module (BWDLF). Figure 6The code includes clear English labels and structural identifiers, where BWDLF: overall module identifier, i.e., wavelet low-frequency enhancement module; F_in: module input feature, corresponding to the embedded feature output by the single-class bottleneck embedding module mentioned earlier, with dimensions of H×W×C; DWT: Discrete wavelet transform unit, i.e., Haar wavelet decomposition unit, which decomposes the input feature into LL low-frequency subband and three high-frequency subbands: LH, HL, and HH; LL: low-frequency subband feature, the only component sent to the enhancement branch; LH / HL / HH: three high-frequency subband features, directly entering the pass-through branch; ACMB: adaptive Mamba-like global enhancement module, i.e., the core unit of the low-frequency feature enhancement branch, receiving LL features and outputting enhanced low-frequency features; ⊕: splicing operation, used to merge the three high-frequency subband features; IDWT: Discrete wavelet inverse transform unit, i.e., wavelet inverse transform reconstruction unit, which fuses and reconstructs the enhanced low-frequency features with the pass-through high-frequency features; F_out: module output feature, with dimensions restored to H×W×C.
[0081] This module corresponds to the functional unit labeled BWDLF in the overall framework, and it generally follows the design of... Figure 3 The consistent wavelet transform architecture logic internally includes a DWT discrete wavelet decomposition structure, an IDWT inverse wavelet transform reconstruction structure, and independently configured low-frequency feature enhancement branches and high-frequency feature direct-through branches. The module input is the embedded features output from the single-class bottleneck embedding module mentioned earlier. Through internal units, frequency domain decomposition, branching processing, and feature reconstruction output are completed sequentially, resulting in a well-organized and clear overall feature flow.
[0082] The wavelet low-frequency enhancement module consists of four parts: a Haar wavelet decomposition unit, a low-frequency feature enhancement branch, a high-frequency feature direct-through branch, and a wavelet inverse transform reconstruction unit. These four units are sequentially connected and coordinated according to the feature flow direction, forming a complete workflow of decomposition and splitting, differentiated processing, and finally reconstruction and fusion. This module differs from the BWDGL module design philosophy mentioned earlier; it only performs deep enhancement processing on the low-frequency subband, while retaining the original features of the three high-frequency subbands without additional transformations. This achieves a differentiated design approach of strengthening the global structure of the low-frequency bands while natively preserving the details of high-frequency defects.
[0083] The Haar wavelet decomposition unit, serving as the front-end input processing unit of the module, receives the embedded features from the output of the previous stage. Using the same Haar wavelet transform decomposition mechanism as described above, it stably decomposes the overall features into one LL low-frequency sub-band feature and three LH, HL, and HH high-frequency sub-band features. The low-frequency sub-band mainly carries the overall substrate texture and global structural information of the nonwoven fabric, while the three high-frequency sub-bands carry detailed information such as defect edges, texture abrupt changes, and local minor defects. After decomposition, each sub-band is sent to its corresponding branch for independent processing according to its category.
[0084] The low-frequency feature enhancement branch uses the adaptive Mamba-like global enhancement module as its core processing unit, with the LL low-frequency sub-band features output from the Haar wavelet decomposition unit fed separately into this module. The adaptive Mamba-like global enhancement module possesses long-distance dependency modeling and global sequence representation capabilities, enabling it to perform global sequence structure modeling and feature encoding on low-frequency sub-band features. This fully exploits the long-range correlations of the large-area background texture of non-woven fabrics, strengthens the stability and integrity of the global substrate structure representation, and allows low-frequency features to better fit the normal texture distribution patterns.
[0085] The high-frequency feature direct-through branch is a direct-through path without additional computational processing. After wavelet decomposition, the three high-frequency sub-band features of LH, HL, and HH do not undergo any additional feature transformation operations such as convolution, attention, or feature mapping. They maintain the original feature parameters and detailed information unchanged and are directly passed along the direct-through branch. This fully preserves the various defect details and textures contained in the high-frequency components and avoids the loss or distortion of weak defect features caused by additional processing.
[0086] The wavelet inverse transform reconstruction unit simultaneously receives two source features: one is the low-frequency sub-band feature optimized by the adaptive Mamba-like global enhancement module, and the other is the three original high-frequency sub-band features directly passed from the high-frequency feature pass-through branch. The reconstruction unit uses a unified wavelet inverse transform fusion logic to reintegrate and map the sub-band features, separated in the frequency domain, back to the spatial domain. This reconstructs a fused feature with complete structure, enhanced global texture representation, and well-preserved high-frequency details of defects, which is then fed into subsequent network structures to complete feature reconstruction and defect discrimination.
[0087] According to some embodiments of this application, the adaptive Mamba-like global enhancement module includes a feature serialization unit, a position encoding unit, a multi-head QKV generation unit, a linear attention calculation unit, a local position enhancement unit, a residual connection unit, and a feedforward network unit. The feature serialization unit converts the two-dimensional feature map into a one-dimensional sequence and performs layer normalization. The position encoding unit fuses rotational position encoding and local position encoding. The multi-head QKV generation unit synchronously generates query, key, and value features and performs activation scaling. The module is internally configured with two levels of residual connections and completes feature channel expansion and compression mapping through a feedforward network.
[0088] Please see Figure 7 , Figure 7The diagram illustrates the structure of the Adaptive Mamba Global Enhancement Module (ACMB). The English labels and structural identifiers are explained below: ACMB: Overall module identifier, i.e., Adaptive Mamba Global Enhancement Module; F_in: Module input feature, corresponding to the LL low-frequency subband feature output by the wavelet low-frequency dedicated enhancement module mentioned earlier; Layer Norm: Layer normalization unit, working with the feature serialization unit to complete feature standardization; the feature serialization unit corresponds to the feature dimension transformation structure in the diagram, responsible for converting the two-dimensional feature map into a one-dimensional sequence; Rope: Rotation position encoding unit; Lepe: Local position enhancement unit, together forming the position encoding unit, achieving the fusion of two position encoding methods; QKV Linear: Linear projection layer, i.e., multi-head QKV generation unit, used to simultaneously generate query, key, and value features; Linear Attention: Linear attention computation unit, responsible for calculating attention weights and feature weighting; ⊕: Residual connection operation, corresponding to the residual connection unit inside the module, realizing two-level residual fusion; FFN: Feedforward network unit, containing Conv2d convolutional layers and GELU activation function; F_out: Module output feature, i.e., the enhanced low-frequency subband feature after sequence modeling and encoding.
[0089] The adaptive Mamba-like global enhancement module, as the core unit of the low-frequency feature enhancement branch in the wavelet low-frequency dedicated enhancement module, plays a key role in performing global sequence structure modeling and efficient feature encoding of LL low-frequency subband features. It strengthens the long-distance correlation of the global background texture of nonwoven fabric in the low-frequency subband, making up for the shortcomings of traditional enhancement methods in capturing global texture dependencies. At the same time, through the collaborative cooperation of multi-level units, it ensures the integrity and stability of feature encoding, adapting to the needs of global background representation in low-frequency subband.
[0090] As the front-end preprocessing unit of the module, the feature sequencer unit first receives the input two-dimensional LL low-frequency subband feature map and converts it into a one-dimensional feature sequence, breaking the limitation of two-dimensional space dimension, which is convenient for subsequent sequence modeling and long-distance dependency capture. At the same time, it performs layer normalization processing on the converted one-dimensional sequence to standardize the feature distribution, eliminate the interference caused by feature scale differences, and provide stable and uniform feature input for the operation of subsequent units, avoiding gradient vanishing or training instability problems.
[0091] The positional encoding unit employs a dual-encoding fusion design, consisting of two parts: rotational positional encoding (Rope) and local positional enhancement (Lepe). These two parts work together to inject positional information. Rotational positional encoding injects global positional correlation information into the one-dimensional feature sequence, capturing the long-distance positional dependencies of the feature sequence. The local positional enhancement unit focuses on the local positional correlations of the feature sequence, strengthening the semantic connections between adjacent features. The fusion of these two encoding methods ensures both the positional integrity of the global sequence and the detailed correlations of local features, enabling the encoded features to more accurately reflect the global texture distribution patterns of the low-frequency subband.
[0092] The multi-head QKV generation unit relies on the internal linear projection layer to perform parallel mapping on the one-dimensional feature sequence after position encoding, and simultaneously generate three types of features: query, key, and value. The generated features are then activated and scaled to adjust the feature dimensions and numerical range to adapt to the needs of subsequent linear attention calculations. At the same time, the multi-head design improves the comprehensiveness of feature association capture and mines low-frequency feature semantic information under different dimensions.
[0093] The linear attention computation unit receives three types of features output by the multi-head QKV generation unit and calculates the similarity weights between features through an efficient linear attention mechanism to complete the weighted fusion of features. Compared with the traditional attention mechanism, the linear attention has lower computational cost and faster operation speed. It can efficiently capture the long-distance dependency relationship of low-frequency feature sequences, strengthen the association representation of global background texture, and avoid redundant calculations, thus adapting to the speed requirements of real-time detection in non-woven fabric production lines.
[0094] The local location enhancement unit works in collaboration with the linear attention computation unit to further strengthen the local location correlation of the feature sequence after attention weighted fusion, making up for the shortcomings of linear attention in capturing local details. This ensures that the encoded features have both global correlation and do not lose local texture details in the low-frequency subband, enabling the low-frequency features to more comprehensively reflect the distribution characteristics of the global substrate texture of the nonwoven fabric.
[0095] The module is internally configured with two levels of residual connection units, which realize cross-unit fusion of features through the ⊕ residual connection operation: the first level residual connection is used to fuse the features after position encoding with the original serialized features to avoid the loss of feature information caused during position encoding; the second level residual connection is used to fuse the features after linear attention calculation with the preceding features to alleviate the gradient vanishing problem during deep network training and ensure the integrity and stability of feature encoding.
[0096] The feedforward network unit (FFN) serves as the back-end feature optimization unit of the module. Internally, it completes the expansion and compression mapping of feature channels through the synergistic effect of convolutional layers and activation functions: first, it mines more low-frequency feature semantic information through channel expansion, and then it reduces the feature dimension through channel compression. At the same time, it introduces nonlinear transformation with the help of activation functions to improve the representation ability of features. Finally, it outputs enhanced low-frequency sub-band features after comprehensive encoding and optimization, which are then fed into the subsequent wavelet inverse transform reconstruction unit to participate in feature fusion.
[0097] According to some embodiments of this application, both the teacher encoder and the student decoder use a wide residual network as the basic backbone structure, which is composed of multiple layers of residual convolutional units stacked together, for multi-scale semantic feature extraction and reverse feature reconstruction.
[0098] Please see Figure 2 The Conv7×7, Conv1×1, and Conv3×3 convolutional units and Maxpooling units marked in the figure are all integrated into the basic structure of the wide residual network. The teacher encoder and student decoder rely on this basic backbone structure to complete the multi-scale feature extraction and reverse reconstruction tasks, respectively. This perfectly matches the overall network architecture and ensures the continuity and consistency of feature transmission.
[0099] The teacher encoder and student decoder use the same wide residual network as the basic backbone. The core is to rely on the residual connection advantage of the wide residual network to solve the gradient vanishing problem in the training process of deep networks. At the same time, through the stacking design of multiple residual convolutional units, it can achieve efficient mining and accurate reconstruction of multi-scale semantic features, which can adapt to the detection needs of non-woven fabrics with complex textures and diverse defects.
[0100] The core structure of the wide residual network is the residual convolutional unit. Each residual convolutional unit consists of a convolutional layer, an activation function, and a normalization layer in sequence. Multiple residual convolutional units are stacked layer by layer to form the backbone architecture of the teacher encoder and the student decoder. Compared with traditional residual networks, the wide residual network improves the efficiency and representation ability of feature extraction by widening the feature channel width and optimizing the residual connection method. It can more accurately capture multi-scale feature information of nonwoven fabric from the underlying texture to the high-level semantics.
[0101] For the teacher encoder, its wide residual network backbone is composed of multiple layers of residual convolutional units and pooling units stacked alternately. Starting from the input preprocessed image, it gradually mines the low-level texture details, mid-level structural features and high-level semantic information through layer-by-layer convolution and pooling operations, and finally outputs L1, L2 and L3 multi-scale deep features, providing reliable basic feature input for the subsequent frequency domain enhancement module. Moreover, the parameters of the wide residual network of the teacher encoder are fixed and locked after pre-training, and it only plays the role of a static feature extractor.
[0102] For the student decoder, its wide residual network backbone is also composed of multiple stacked residual convolutional units, matching the overall structure of the teacher encoder's wide residual network. However, it employs a trainable mode, learning only the feature distribution patterns of the defect-free normal texture of non-woven fabric. Through the synergistic effect of inverse convolution and residual connections, the features processed by the wavelet low-frequency enhancement module are reconstructed layer by layer, restoring normal texture features. It cannot replicate the abnormal features of defective areas, thus creating a difference from the features output by the teacher encoder and providing a basis for defect detection.
[0103] The teacher encoder and student decoder adopt the same wide residual network backbone structure, which can ensure that the features extracted and reconstructed by the two are consistent in dimensionality and semantic distribution, which facilitates the comparison and quantification of subsequent feature differences. At the same time, it simplifies the network structure design, reduces training complexity, balances detection accuracy and computing speed, and adapts to the real-time detection needs of non-woven fabric production lines. It forms a complete closed loop with the unsupervised detection logic and frequency domain dual enhancement design mentioned above.
[0104] According to some embodiments of this application, when iteratively training the network parameters, only defect-free normal nonwoven fabric samples are used as the training data source; after training, all parameters of the teacher encoder are fixed, and only the student decoder is retained as trainable and updatable parameters to fit the inherent feature distribution of normal nonwoven fabric texture.
[0105] This application adopts an unsupervised training paradigm, which eliminates the need to label various defect samples throughout the process. It only collects normal non-woven fabric image samples with intact surfaces, no defects, no stains, and no texture abnormalities in the production scene as the sole data source for network iterative training, which greatly reduces the workload of sample collection and manual labeling and is suitable for large-scale application scenarios in actual industrial production lines.
[0106] During the iterative training phase of the network parameters, all normal nonwoven fabric samples were used to participate in the joint training of the wide residual network backbone, various wavelet frequency domain enhancement modules, attention embedding modules, and the encoding / decoding structure. This enabled the entire network to fully learn and fit the normal substrate texture, conventional texture arrangement, and inherent feature distribution patterns of nonwoven fabric. During training, the normal sample feature reconstruction loss was used as the optimization objective, and the weight parameters of each layer of the network were continuously adjusted to gradually improve the network's ability to represent and reconstruct the texture features of normal nonwoven fabric.
[0107] Once the network has completed convergent training, all network parameters of the teacher encoder are locked and fixed, and no longer participate in subsequent inference and fine-tuning processes. This makes it a constant multi-scale feature extractor, stably outputting unified and reliable deep feature representations, and avoiding feature extraction bias caused by parameter fluctuations.
[0108] After training, only the student decoder remains in a trainable parameter update state. Subsequent inference and fine-tuning stages only iteratively optimize the network weights of the student decoder. With the feature support of the fixed teacher encoder, the student decoder continuously approaches and fits the inherent feature distribution pattern of normal nonwoven fabric texture. It can only accurately reconstruct the feature morphology of defect-free areas, but cannot effectively fit and restore the feature distribution of various defective and abnormal areas. This naturally forms the feature representation difference between normal samples and defective samples, laying the foundation for subsequent feature difference comparison, defect discrimination, and pixel-level localization.
[0109] This setup, which uses only normal samples for training and has a fixed teacher and trainable students, aligns with the design intent of unsupervised defect detection. It eliminates the reliance on the number of defect samples and manual annotation. At the same time, by relying on the parameter differentiation settings of the teacher-student architecture, it stably amplifies the feature differences between normal and abnormal regions. While ensuring real-time detection, it improves the accuracy of identifying and locating minor defects and weak contrast defects in nonwoven fabrics.
[0110] According to some embodiments of this application, during the detection inference process, the feature distance metric between the output features of the teacher encoder and the reconstructed features of the student decoder is calculated pixel by pixel and channel by channel; the feature distance metric is binary-divided by a preset feature difference threshold, and the pixel regions exceeding the threshold are marked as defect regions, and the image-level defect discrimination result and the pixel-level defect location mask are output respectively.
[0111] In the actual nonwoven fabric defect detection inference stage, there is no need to participate in the network parameter iteration update. The input image of the nonwoven fabric to be detected is simply fed into the complete network process that has been trained and fixed with parameters. The teacher encoder extracts multi-scale deep features, which are then processed sequentially by the wavelet high-low frequency joint enhancement module, the single-class bottleneck embedding module, and the wavelet low-frequency dedicated enhancement module. Finally, the student decoder completes the reverse reconstruction of normal texture features, obtaining the original multi-scale features output by the teacher encoder and the reconstructed features output by the student decoder.
[0112] During inference, pixels and channels are used as the basic computational units. The differences between the output features of the teacher encoder and the reconstructed features of the student decoder are compared pixel by pixel and channel by channel to solve the feature distance metric. The feature distribution of normal non-woven fabric texture areas is stable and consistent, and the difference between the teacher features and the reconstructed features is small. However, in defective areas such as holes, blemishes, stains, and texture abnormalities, the student decoder cannot fit the abnormal feature distribution, and there will be a significant deviation between the two types of features, forming a distinguishable feature distance difference.
[0113] A feature difference threshold adapted to the nonwoven fabric texture characteristics and detection accuracy requirements is preset. The calculated pixel-by-pixel feature distance metric is compared with the preset threshold and binary segmentation is performed. Pixel areas whose feature distance metric does not exceed the preset threshold are identified as normal texture areas; pixel areas whose feature distance metric exceeds the preset threshold are uniformly labeled as defective pixel areas.
[0114] Based on the binary partitioning results, two types of detection outputs can be obtained simultaneously: First, image-level defect discrimination results. If any number of labeled defect pixels exist in the entire image, the nonwoven fabric image is determined to have a defect; if all pixels are normal areas, it is determined to be a defect-free, qualified sample. Second, pixel-level defect location masks. A binary mask image with the same size as the original image is generated according to the pixel labeling results, accurately outlining the location, contour, and range of defects, achieving pixel-level precise location of various small, low-contrast defects.
[0115] This detection and discrimination method relies on the feature reconstruction differences between teachers and students, without the need for additional defect classification branches and labeled samples. It is fully compatible with the unsupervised detection architecture design. Relying on adaptive feature distance measurement and fixed threshold division, it balances discrimination speed and positioning accuracy, and can meet the application needs of online real-time detection in non-woven fabric industrial production lines.
[0116] According to some embodiments of this application, an anomaly score heatmap is generated based on the pixel-level defect location results. A Gaussian filter operator with a set standard deviation is used to perform smooth convolution processing on the heatmap to suppress pixel-level random noise and correct the edges of the defect area.
[0117] After completing pixel-level defect region labeling and location mask generation, based on the obtained pixel-by-pixel defect judgment results, each pixel of the entire nonwoven fabric image is assigned a corresponding anomaly score. A visual anomaly score heatmap is generated based on the distribution of anomaly scores for each pixel. The heatmap intuitively reflects the strength distribution of anomalies throughout the image; areas with more significant defects correspond to higher anomaly scores, while areas with normal substrate texture maintain lower anomaly score levels.
[0118] The directly generated raw anomaly score heatmap is susceptible to interference from single-pixel random noise and subtle texture fluctuations, resulting in scattered and isolated pseudo-defect pixels. Furthermore, the edges of defect targets tend to exhibit jagged and irregular patterns, affecting the accuracy of defect localization and visualization. Therefore, a Gaussian filter operator with a fixed standard deviation parameter is used to perform smooth convolution processing on the generated anomaly score heatmap.
[0119] The Gaussian filter operator has the characteristics of high center weight and smooth neighborhood transition. After smooth convolution operation, it can effectively filter out isolated and discrete pixel-level random noise in the image and eliminate false defect points caused by small texture undulations. At the same time, it performs smooth fitting and correction optimization on the edge contour of the real defect area, making the defect edge transition more natural and regular, and avoiding edge burrs and fragmented defect areas from interfering with the judgment results.
[0120] The anomaly score heatmap, after Gaussian filtering and smoothing correction, retains the location, range, and anomaly intensity characteristics of the real defect area while suppressing background random noise and false anomalies. The defect outline is more complete and clear, providing a reliable data foundation for subsequent defect level assessment, defect size calculation, and visual inspection display, and is suitable for the stable inspection requirements of online quality inspection in the nonwoven fabric industry.
[0121] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0122] In the description of this application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicating the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.
[0123] In the description of this application, "first feature" and "second feature" may include one or more of the features.
[0124] In the description of this application, "multiple" means two or more.
[0125] In the description of this application, the first feature being "above" or "below" the second feature may include the first and second features being in direct contact, or the first and second features being in contact through another feature between them.
[0126] In the description of this application, the terms "above," "over," and "on top" for the first feature and the second feature include the first feature being directly above or diagonally above the second feature, or simply indicate that the first feature is at a higher horizontal level than the second feature.
[0127] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0128] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
Claims
1. An unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement, characterized in that, Includes the following steps: 1) Acquire the original image of the nonwoven fabric to be inspected, and perform size normalization preprocessing on the original image to obtain an input image with uniform specifications; 2) The preprocessed input image is fed into a teacher encoder with fixed parameters to extract multi-scale deep features; 3) Input the multi-scale deep features into the wavelet high-low frequency joint enhancement module, and after wavelet frequency domain decomposition, perform independent feature transformation processing on the low-frequency feature components and high-frequency feature components respectively; 4) The enhanced features are fed into the single-class bottleneck embedding module to complete multi-scale feature dimension compression and feature embedding; 5) The embedded feature input wavelet low-frequency dedicated enhancement module only performs feature encoding and reconstruction on the low-frequency feature components in the frequency domain, while the high-frequency feature components remain in their original state without processing; 6) The processed features are fed into a trainable student decoder to perform reverse reconstruction of normal texture features; 7) Compare the difference distribution between the output features of the teacher encoder and the reconstructed features of the student decoder, and realize the non-woven fabric defect discrimination and pixel-level localization based on the feature differences.
2. The unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement according to claim 1, characterized in that: The wavelet high-low frequency joint enhancement module includes a Haar wavelet decomposition unit, a low-frequency feature processing branch, a high-frequency feature processing branch, and a wavelet inverse transform reconstruction unit. The Haar wavelet decomposition unit decomposes the input features into one low-frequency sub-band feature and three high-frequency sub-band features; Low-frequency sub-band features are input into the spatial environment perception module for contextual association modeling. Three high-frequency sub-band features are input into an adaptive channel spatial module for joint channel and spatial feature mapping. All sub-band features processed by each branch are reconstructed into complete spatial domain features via inverse wavelet transform.
3. The unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement according to claim 2, characterized in that: The spatial environment perception module is configured with a three-branch parallel structure, including a global information aggregation branch, a channel redundancy mapping branch, and a dimension reduction association branch. The global information aggregation branch configures global average pooling and global max pooling structures; The channel redundancy mapping branch uses 1×1 convolution to achieve linear transformation of the channel dimension; The dimension reduction association branch uses 1×1 convolution to complete channel dimensionality reduction of query and key features; The output features of each branch are fused across channels and across spaces by multiplying the features with matrix operations.
4. The unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement according to claim 2, characterized in that: The adaptive channel space module consists of a channel feature modeling subunit and a spatial feature modeling subunit. The channel feature modeling subunit constructs channel descriptors based on global average pooling, generates local channel interaction features and global channel association features respectively, and obtains channel attention weights through adaptive fusion; The spatial feature modeling subunit performs average pooling and max pooling on the features in the channel dimension, respectively, and after concatenation, it generates spatial attention weights through convolution and activation. Channel attention weights and spatial attention weights are used to perform a weighted mapping of the original high-frequency features on a channel-by-channel and spatial-position-by-spatial basis.
5. The unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement according to claim 1, characterized in that: The wavelet low-frequency dedicated enhancement module includes a Haar wavelet decomposition unit, a low-frequency feature enhancement branch, a high-frequency feature direct-through branch, and a wavelet inverse transform reconstruction unit. The Haar wavelet decomposition unit decomposes the input embedded features into one low-frequency sub-band feature and three high-frequency sub-band features; Low-frequency subband features are fed into an adaptive Mamba-like global enhancement module for sequence structure modeling and feature encoding; The three high-frequency sub-band features are directly fed into the wavelet inverse transform reconstruction unit without undergoing additional feature transformation to complete feature fusion.
6. The unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement according to claim 5, characterized in that: The adaptive Mamba-like global enhancement module includes a feature serialization unit, a position encoding unit, a multi-head QKV generation unit, a linear attention calculation unit, a local position enhancement unit, a residual connection unit, and a feedforward network unit. The feature serialization unit converts a two-dimensional feature map into a one-dimensional sequence and performs layer normalization; The position coding unit integrates rotational position coding and local position coding; The multi-head QKV generation unit synchronously generates query, key, and value features and performs activation scaling; The module is configured with two levels of residual connections and completes feature channel expansion and compression mapping through a feedforward network.
7. The unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement according to any one of claims 1 to 6, characterized in that: Both the teacher encoder and the student decoder use a wide residual network as the basic backbone structure, which is composed of multiple layers of residual convolutional units stacked together, for multi-scale semantic feature extraction and reverse feature reconstruction.
8. The unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement according to any one of claims 1 to 6, characterized in that: When iteratively training the network parameters, only defect-free normal nonwoven fabric samples are used as the training data source; After training, all parameters of the teacher encoder are fixed, and only the student decoder is retained as trainable and updatable parameters to fit the inherent feature distribution of normal nonwoven fabric texture.
9. The unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement according to any one of claims 1 to 6, characterized in that: During the detection and inference process, the feature distance metric between the output features of the teacher encoder and the reconstructed features of the student decoder is calculated pixel by pixel and channel by channel. The feature distance metric is binary divided by a preset feature difference threshold, and the pixel regions exceeding the threshold are marked as defect regions. Image-level defect discrimination results and pixel-level defect localization masks are output respectively.
10. The unsupervised nonwoven fabric defect detection method based on wavelet frequency domain dual enhancement according to any one of claims 1 to 6, characterized in that: An anomaly score heatmap is generated based on the pixel-level defect location results. A Gaussian filter operator with a set standard deviation is used to perform smooth convolution processing on the heatmap to suppress pixel-level random noise and correct the edges of the defect area.