Cloth defect detection and classification method for garment production

Through local dynamic modeling of fabric texture continuity and classified correlation modeling of defect root characteristics, the accuracy and adaptability problems of fabric defect detection in the prior art are solved, and high-precision and interpretable defect identification in complex backgrounds are achieved.

CN120410984AInactive Publication Date: 2025-08-01ZHEJIANG YUEYIN CLOTHING CO LTD
View PDF 0 Cites 11 Cited by

Patent Information

Application Number
CN202510414338.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-08-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing fabric defect detection methods lack recognition capabilities under the natural fluctuation of textures and complex backgrounds, making it difficult to distinguish between normal texture changes and real defects, and lack of time-continuous modeling of defect behavior, resulting in low detection accuracy, high missed detection rate, and insufficient model generalization ability, making it difficult to adapt to fabrics of different materials.

Method used

Local dynamic modeling of fabric texture continuity is used, regional stability is described through localized processing and dynamic response indicator DRI, and combined with defect boundary stability measurement and defect credibility evaluation, classification correlation modeling of defect root cause characteristics is constructed to achieve accurate identification and type determination of defects.

Benefits of technology

It improves the accuracy of identification of minor and non-impermeable dynamic defects, enhances the applicability and robustness of the system among various fabric materials, reduces the rate of misjudgment, and realizes the interpretability and reliability classification of defect types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120410984A_ABST
    Figure CN120410984A_ABST
Patent Text Reader

Abstract

The invention relates to a cloth defect detection and classification method for garment production, and the method comprises the following steps: carrying out the localization of a cloth image in the space, and constructing a dynamic response model based on the texture continuity of a local region; segmenting the continuous cloth image into sliding windows; constructing a local texture response sequence on a time axis for each window; a dynamic response index DRI is used for describing the stability of the area in space and time, and the stability serves as the basis of anomaly judgment; detecting the position and the change track of the texture response mutation, and reasoning the boundary and the form of the flaw; capturing jump points of which the variation amplitude is greater than a set threshold value in the response sequence; deducing a shape boundary and a diffusion path in the image in combination with a sudden change trend between adjacent windows; constructing a sudden change trajectory diagram to describe the real form of the flaw; judging whether the area belongs to a real defect or not by analyzing the structural stability of the defect boundary, and forming a defect credibility index DCI; and calculating the direction consistency and the edge gradient stability of the flaw boundary.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for detecting and classifying fabric defects for clothing production. Background Art

[0002] Currently, the detection and classification of fabric defects in clothing production has gradually evolved from traditional manual visual inspection to automation and intelligence. However, there are still a series of deficiencies and drawbacks in terms of technology, system, and adaptability, which restrict its further popularization and efficient implementation in large-scale clothing industrial production.

[0003] Firstly, from the perspective of detection accuracy, many existing methods still mainly rely on basic visual features such as static image analysis or pixel-level gray-scale changes, edge detection, and threshold segmentation in single-frame images. For fabrics with large natural texture fluctuations, such as knitted fabrics, denim, woolen fabrics, or printed fabrics with complex patterns, it is difficult to accurately distinguish normal texture changes from real defects, and false detections or missed detections are likely to occur. In particular, the recognition ability significantly decreases when facing micro-defects such as slight yarn skipping, broken weft, and blurred color difference boundaries. Secondly, the lack of robustness in complex backgrounds is a major weakness of current detection systems. In actual production, clothing fabrics are interfered by various factors such as light changes, fabric wrinkles, and sewing thread shadows. These natural variations often cause non-structural fluctuations in image brightness or texture direction, and traditional detection algorithms cannot effectively eliminate such pseudo-abnormalities, easily misjudging normal wrinkles, folds, color difference areas, and printing boundaries as defects, reducing the credibility of the system. Moreover, most detection systems only focus on single or a few dimensions of image features during the feature extraction process, such as texture direction and gray-scale gradient, and lack the modeling of the temporal continuity of defect behavior, ignoring the dynamic evolution characteristics of the fabric texture structure during the movement on the production line, resulting in the system's inability to identify real defects that are not obvious in a single frame but have continuous fluctuations on the time axis, and thus missing the early warning ability for hidden quality problems.

[0004] In addition, although some current systems have introduced deep learning or convolutional neural network models to improve classification accuracy, there are two prominent problems. One is the extremely high dependence on training data. The performance of the model highly depends on the training samples with complete annotations and balanced distributions. However, in the actual factory environment, there are a wide variety of fabric types, scarce and unevenly distributed defect samples, resulting in insufficient model transfer and generalization ability. The other is that most of these models are built based on appearance image features, making it difficult to reflect the causes and structural evolution logic of defects, lacking the ability to explain the defect behavior mechanism. They can often only "identify what it is" but cannot answer "why it is like this", which is not conducive to subsequent quality traceability and production process improvement. In the defect classification link, most existing methods directly send feature vectors into classifiers (such as SVM, random forest, or convolutional network), lacking the modeling of structural differences for different defect types. Especially when the defect boundaries are blurred and the shapes are similar (such as stains and oil spots, broken yarns and skipped yarns), the classification accuracy drops significantly, and the classification results are unexplainable and difficult to trace. At the same time, most systems do not introduce a defect credibility scoring mechanism, unable to perform risk ranking or credibility screening on the detection results, resulting in all high-false-alarm detection results entering the back-end processing process, increasing the cost of manual re-inspection and affecting the overall detection efficiency.

[0005] Furthermore, from the perspective of system adaptability, current fabric detection methods generally lack the dynamic adaptation ability to material diversity. Many models need to adjust parameters for specific fabric categories during the training stage. When changing a batch of materials or printing processes, the model needs to be retrained or manually intervened, making it difficult to achieve the goal of "one system for all fabrics", which greatly limits the deployment efficiency and cost control in industrial scenarios. Summary of the Invention

[0006] The purpose of the present invention is to provide a fabric defect detection and classification method for clothing production, so as to solve some of the drawbacks and deficiencies pointed out in the background technology.

[0007] The technical solutions adopted by the present invention to solve its above technical problems include the following steps:

[0008] S1. Adopt local dynamic modeling of fabric texture continuity:

[0009] S1.1. Localize the fabric image in space and construct a dynamic response model based on the texture continuity of the local area; divide the continuous fabric image into sliding windows;

[0010] S1.2. Construct a local texture response sequence for each window on the time axis; use the dynamic response index DRI to describe the stability of the area in space and time as the basis for anomaly determination;

[0011] S2. Adopt a defect area reasoning mechanism for response mutation trajectories:

[0012] S2.1. Detect the position and change trajectory of texture response mutations, and infer the boundaries and shapes of defects; capture the jump points in the response sequence with a change amplitude greater than the set threshold;

[0013] S2.2. Combine the mutation trends between adjacent windows to deduce the shape boundaries and diffusion paths in the image; construct a mutation trajectory graph to depict the true shape of the defect;

[0014] S3. Adopt defect boundary stability measurement and defect credibility evaluation:

[0015] S3.1. By analyzing the structural stability of the defect boundary, determine whether the area belongs to a true defect, and form a defect credibility index DCI; calculate the direction consistency and edge gradient stability of the defect boundary;

[0016] S3.2. Introduce the texture difference index between the inside and outside of the defect area; comprehensively output the defect credibility score DCI as one of the features for classification decision-making;

[0017] S4. Adopt classification correlation modeling of defect root cause features:

[0018] S4.1. According to the analyzed mutation trajectory, response pattern, and boundary stability, comprehensively construct the root cause feature vector of the defect; extract the directionality, length change, and perturbation amplitude from the trajectory graph; combine with the boundary pattern features to form the root cause representation;

[0019] S4.2. Use a classifier to discriminate the combined features to identify the defect type.

[0020] Furthermore, the local dynamic modeling method for the continuity of the fabric texture includes:

[0021] Adopt a localized modeling method. The continuously acquired fabric image frames are divided into several two-dimensional sliding window regions of a fixed size, denoted as W i,j , where i and j respectively represent the row and column indices of the window in the image matrix; each window corresponds to a single physical sub-region on the fabric surface. As the fabric moves on the production line, the window tracks its evolution behavior on the time axis; and to describe the texture feature state of each local region at time t, define the region response function Φ i,j (t), expressed as follows:

[0022]

[0023] Where:

[0024] Φ i,j (t) is the comprehensive texture response value of the i,j-th window at time t; A(W i,j ) is the pixel area of the window region; p ∈ W i,jTo represent each pixel point within the window; D p (t) is the texture direction offset of pixel point p; G p (t) is the gray - level gradient, reflecting the amplitude of light and dark changes of the pixel within the local area; θ p (t) is the structural perturbation angle formed by the pixel point and its neighborhood in the current frame, measuring the degree of mutation of the spatial structure; ω1, ω2, ω3 are the weighting coefficients corresponding to each component, used to adjust the contribution weights of different feature dimensions to the overall response value.

[0025] Furthermore, the local dynamic modeling method for the continuity of the fabric texture includes:

[0026] Quantify the discontinuity of the texture direction, the mutation of the local gray - level, or the dislocation of the texture structure in the fabric defect manifestation. This disruption process models the continuous evolution process of the local response function Φ i,j (t) in the time dimension, constructs a perturbation evolution quantity, which is used to measure whether there is a significant fluctuation in the texture pattern in the local area between frames; the definition of the perturbation evolution quantity is as follows:

[0027]

[0028] Where:

[0029] Δ i,j is the overall perturbation change intensity of the i, j - th window; n is the number of consecutive frames; t k is the time point of image acquisition, the k - th frame; Φ i,j (t k ) is the texture response of the i, j - th window at time t k moment; β is the perturbation sensitivity index, used to adjust the response intensity of the system to perturbations of different amplitudes. When β > 1, it enhances the recognition ability for high - fluctuation regions.

[0030] Furthermore, the local dynamic modeling method for the continuity of the fabric texture includes:

[0031] Adopt the dynamic response index DRI function Λ i,j , and perform normalization processing by introducing the window structure complexity parameter to enable robust judgment across fabric materials; the definition is as follows:

[0032]

[0033] Where:

[0034] Λ i,j is the dynamic response index of the i, j - th window, used for anomaly determination; Δ i,j is the aforementioned texture perturbation evolution quantity; σ i,jis the variance of the texture structure within the current frame of the window, representing the natural complexity of the region; γ is the complexity adjustment coefficient, controlling the weight of complex textures in the scoring; ∈ is a very small positive number, used to avoid numerical instability problems caused by division by zero; log(·) is a compression transformation of the overall perturbation normalization value to prevent extreme outliers from amplifying errors.

[0035] Furthermore, the method for measuring the stability of the defect boundary and evaluating the credibility of the defect includes:

[0036] In the analysis of boundary direction consistency, the feature of identifying a true defect lies in the degree of mutation of the edge texture direction; a boundary direction perturbation scoring function Ω is constructed d , which is used to measure the average deviation degree between the direction of the detected boundary pixels and the neighborhood direction; it is defined as follows:

[0037]

[0038] where B represents the set of detected suspected defect boundary pixels, |B| is the total number of pixel points in the set; p ∈ B represents any pixel point within the boundary; Θ p is the main texture direction of the pixel; is the average main direction in the neighborhood of the pixel point; α is a non - linear direction mutation enhancement coefficient, with a value greater than 1, used to enhance the sensitivity of mutation features.

[0039] Furthermore, the method for measuring the stability of the defect boundary and evaluating the credibility of the defect includes:

[0040] In the analysis of gray - scale perturbation trend, the edge of a true defect is accompanied by non - smooth and non - periodic brightness fluctuations. A gray - scale high - frequency perturbation detection function Ω is used g , which is used to detect the non - stationary behavior of the gray - scale values of edge pixels; the function is defined as follows:

[0041]

[0042] where {g1, g2, …, g [[ID=3,5]] n} represents the sequence of gray - scale intensities obtained by sampling along the edge; g k is the gray - scale value of the k - th point in the sequence; β is an exponential amplification factor used to control the perturbation response, set between 1.5 and 3, used to improve the response ability to severe fluctuations.

[0043] Furthermore, the method for measuring the stability of the defect boundary and evaluating the credibility of the defect includes:

[0044] Analyze whether there is a mutation in the texture structure between the interior of the region and the surrounding background, and construct a regional texture contrast scoring function Ω t, by measuring the difference in multi-dimensional texture features, identify the degree of structural deviation between the defective area and the adjacent normal area; defined as follows:

[0045]

[0046] Among them, R represents the candidate defective area, and R ′ represents its surrounding neighborhood area; ψ i (·) represents the i-th eigenvalue after texture statistics on the given area, including direction entropy, energy mean, texture density, and filtered response distribution; m is the total dimension of the texture features; γ is the mutation response adjustment coefficient, which controls the influence degree of the difference on the scoring result; Z is the normalization constant; if Ω t has a large value, it indicates that there is a significant deviation in the texture distribution characteristics between the defective area and the external area.

[0047] The fabric defect detection and classification method for clothing production proposed by the present invention has the following beneficial effects and has significant advantages in terms of detection accuracy, system stability, intelligent judgment ability, industrial adaptability, etc.:

[0048] By constructing a local dynamic modeling mechanism for fabric texture continuity, comprehensively extract texture behavior characteristics from the spatial-temporal dimension, avoiding the detection blind spots caused by traditional methods relying on single-frame images or static thresholds, and being able to accurately identify minor and non-apparent dynamic defects;

[0049] The introduced perturbation evolution quantity and dynamic response index DRI enable the system to track the texture perturbation trend between different frames and perform normalization analysis in combination with the texture complexity of the region itself, greatly improving the applicability and robustness of the detection results among various fabric materials; the present invention also constructs a complete defect credibility evaluation mechanism through multi-dimensional structural stability analysis methods such as boundary direction perturbation scoring, gray-scale high-frequency perturbation analysis, and regional texture structure difference evaluation, effectively reducing misjudgments caused by wrinkles, light and shadow, and printing changes, etc., and enhancing the recognition accuracy of real physical defects;

[0050] In the classification stage, the system not only relies on appearance features, but also combines the response trajectory, perturbation path, and boundary features of the defect to form a "root cause feature vector", realizing a logical closed-loop from defect detection to defect cause analysis, and improving the interpretability and reliability of defect type classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 is the flow chart of the fabric defect detection and classification method for clothing production of the present invention.

[0052] Figure 2 is the flow chart of the local dynamic modeling method for fabric texture continuity of the present invention.

[0053] Figure 3 This is a flowchart of the method for measuring the stability of defect boundaries and evaluating the credibility of defects in the present invention. Detailed implementation manners

[0054] The following will give a detailed description of the specific implementation manners of the present invention in conjunction with the accompanying drawings.

[0055] By constructing a local dynamic model of the continuity of fabric texture, precise detection and type determination of subtle defects are achieved. In the first stage S1, "local dynamic modeling of fabric texture continuity" is adopted. This stage is specifically implemented from three aspects: image space division, time series construction, and stability measurement. Step S1.1 is to perform local processing on the fabric image in space, that is, instead of treating the entire fabric image as a whole, it is regionally divided. A sliding window with a fixed size is gradually slid on the image to extract individual spatial local regions, and a corresponding "physical sub-region" is established for each window. These windows will form a traceable window trajectory in the continuously acquired image frames as the fabric moves on the production line. The core purpose of this local processing is to capture the local behavioral characteristics of the fabric surface texture at the micro level.

[0056] Then, in step S1.2, a local texture response sequence in the time dimension is constructed for each sliding window. That is, for each window, multiple frames of images are acquired during the movement of the fabric, and the evolution process of parameters such as texture direction, texture density, and gray-level gradient is calculated to form a time series sample set, thereby characterizing the texture stability and change trend of this region over time. Furthermore, a dynamic response index DRI (Dynamic Response Index) is introduced to quantitatively evaluate this region. The DRI index judges whether this region shows a stable and consistent texture pattern in the spatial and time dimensions by analyzing comprehensive characteristics such as the change amplitude of the texture response value, the direction jump frequency, and the internal texture disturbance intensity of this local region on the time axis. If the DRI value shows a mutation in consecutive frames, it indicates that the texture continuity of this region is damaged and there is very likely a structural defect.

[0057] Through dynamic texture response analysis, the complete boundary and spatial morphology of the defect area are further derived from microscopic mutations. In step S2.1, the focus is first on detecting the positions of texture response mutations and their change trajectories in the time series. Specifically, the local texture response sequences constructed for each sliding window in consecutive frames are analyzed to identify the jump points where the response values change by more than a set threshold between adjacent frames. These jump points reflect abnormal disturbances in the fabric texture in this area and are very likely the starting or sudden points of defects. Subsequently, in step S2.2, the system does not judge individual windows in isolation but conducts a linked analysis of the response change trends between adjacent windows. If response mutations occur simultaneously in multiple adjacent windows at approximately the same time, and their change directions and mutation degrees have a certain continuity and structural directivity, a potential defect boundary with a shape contour can be deduced. By calculating the correlation degree and spatial continuity between these jump points, a mutation trajectory map is further constructed. This trajectory map integrates the scattered abnormal point sets into a complete regional morphology by recording the propagation direction, amplitude, and connection relationship of texture anomalies, forming a process of inferring and reconstructing the true spatial structure of the defect.

[0058] The third stage S3 is "Adopting Defect Boundary Stability Measurement and Defect Credibility Assessment". This stage aims to, after detecting a suspected defect area, determine whether the area belongs to a real physical defect through in-depth analysis of its boundary and internal structure, and quantify its credibility to assist in classification decisions. In step S3.1, first, the structural stability of the defect boundary is calculated and analyzed to determine whether the abnormal area has typical structural damage characteristics. The system models the boundary using multi-dimensional feature indicators. First, the direction consistency is measured, that is, the deviation degree between the texture direction of the boundary pixels and the texture direction of the neighborhood is statistically analyzed. If the boundary direction is chaotic and the direction changes violently, it is more likely to be a real defect such as broken yarn or hole. Secondly, the stability of the edge gradient is analyzed. By observing the local fluctuation amplitude and continuity of the boundary gray level, it is judged whether it has high-frequency non-stationary characteristics. The edges of real defects usually show irregularity and sharp brightness changes, while the boundaries of pseudo-defects such as natural creases and stitches are relatively smooth or periodically stable. The results of these two analyses together constitute the preliminary basis for structural judgment. Further, in S3.2, a texture difference index between the defect area and its external neighborhood is introduced. The system conducts comparative analysis on the candidate area internally and externally in multiple dimensions such as texture direction, frequency, and density. If the area significantly deviates from the surrounding area in terms of texture structure, it indicates that it may have destroyed the original texture continuity of the fabric and is more in line with the physical characteristics of the defect. Through the weighted fusion of direction consistency, gradient stability, and texture contrast, the defect credibility index DCI (Defect Confidence Index) is comprehensively calculated. This index represents the credibility degree of the area being judged as "abnormal" in terms of structure. The higher the DCI value, the more likely it is to be a real defect. Finally, DCI, as one of the important feature inputs in the classification stage, participates in the determination of defect types and the screening of priorities.

[0059] The fourth stage S4 is "Classification and Association Modeling Using Defect Root Cause Features". The core objective of this stage is to enable the classifier to not only make judgments based on apparent image features but also start from the mechanism of defect generation to achieve more robust and interpretable defect type recognition by constructing a feature vector with the ability to explain physical causes. In step S4.1, based on the multi-dimensional data results obtained in the previous stage of the detection process, including mutation trajectories, texture response patterns, and boundary structure stability indicators, etc., a root cause feature vector of the defect is comprehensively constructed. This feature not only reflects the appearance morphology of the abnormal area but also embeds the behavioral characteristics of the defect during the dynamic evolution process. First, parameters describing the propagation trend of the defect, such as trajectory directionality, path length change, and trajectory perturbation amplitude, are extracted from the mutation trajectory map. These indicators reflect the formation method and severity of the defect. For example, linear scratches usually have a single trajectory direction, a longer length, and weaker perturbation, while broken yarns or holes have a short trajectory, strong perturbation, and disordered directions. Then, these trajectory features are combined with boundary structure pattern features, including boundary direction distribution, edge gray level oscillation, and texture contrast, etc., to form a high-dimensional root cause representation vector. This representation not only contains the static morphological features in the current image but also embeds the dynamic behavioral features related to the defect cause. In S4.2, this root cause feature vector is input into a trained multi-class classifier. The classifier can adopt algorithm structures such as support vector machines, lightweight neural networks, or decision trees to discriminate defect samples. The system learns and models the feature distributions of different types of defects in the root cause dimension, improves the recognition accuracy of defects with similar appearances but different underlying causes (such as wrinkles and broken yarns), and effectively reduces the risk of type misjudgment, achieving a recognition leap from "looking similar" to "essentially different", thereby constructing an intelligent defect detection and classification model that comprehensively integrates dynamic detection and root cause classification.

[0060] Example 1:

[0061] Combined with the attached Figure 1 As shown, on the denim production line of a high-end clothing manufacturing factory, a piece of fabric with a width of 1.6 meters is being rolled into the next process at a speed of 1.2 meters per second. A set of automatic defect detection systems based on image recognition is deployed on this production line, which captures cloth surface images at a frequency of 200 frames per second. The resolution of the images is 1920×1080 pixels. The detection algorithm adopted by the system is based on the "Local Dynamic Modeling Method for Fabric Texture Continuity" proposed in the present invention. In this algorithm, the entire image is evenly divided into sliding window areas with a size of 32×32 pixels, denoted as W i,j , and each window corresponds to a physical area of approximately 2 cm square on the cloth surface. During the movement of the fabric, these windows are temporally traceable on consecutive image frames and can extract the dynamic texture behavior of this local area. In a certain detection, the system traced the W25,40 Texture response fluctuations occur in the window area, which is located about 50 cm to the right of the middle section of the fabric. At the detection time point t = 0.32 s, the system extracts the texture response features of this window area and substitutes them into the regional response function:

[0062]

[0063] In this detection, the window contains 1024 pixel points (32×32). The weighting coefficients are set as ω1 = 0.4, ω2 = 0.35, and ω3 = 0.25. This value can be adjusted according to different fabric texture characteristics in the system design. The general recommended range is ω1, ω2, ω3 ∈ [0.2, 0.6], and the sum is 1. The system measures the average pixel response at this moment as: texture direction deviation Mean gray-scale gradient Mean perturbation angle Substituting into the formula gives:

[0064]

[0065] The system records the texture response trends of this area in the previous and subsequent time frames and finds that this value shows an obvious mutation compared with the adjacent frame response values of 13.1 and 13.3 at t = 0.31 s and t = 0.33 s. The DRI algorithm further analyzes and judges that the response amplitude is abnormal, and its mutation exceeds the response mutation threshold set by the system (the default is Δ > 2.0 as suspicious). At the same time, there is also a drastic change in the boundary perturbation angle for three consecutive frames. It is initially judged that there is an abnormal response behavior in this area, and it enters the candidate list of defective areas. Further, the system links the adjacent window areas W 25,39 、W 25,41 、W 24,40 、W 26,40 and finds that their texture responses all show similar direction mutation phenomena near the current time frame. The average direction deviation rises from the original 8 degrees to between 14 and 16 degrees, and the perturbation angle also increases synchronously. This indicates that this abnormality is not single-point pixel-level noise, but a defective fragment with a spatial structure and extended path. According to the trajectory analysis algorithm, its projected length on the fabric surface is about 8 cm, the direction is continuous, and the edge is irregular, suspected to be a skip yarn fault during the weaving process.

[0066] It can be seen that by using the local dynamic modeling method of fabric texture continuity, through constructing the regional response function Φ i,j (t), combined with reasonable selection of weighting coefficients and parameter setting, abnormal texture behaviors can be effectively captured, and real defective areas with structural extension can be identified through linkage analysis with the spatial neighborhood.

[0067] In this embodiment, the response value of the window is further continuously modeled in the time dimension, and its perturbation evolution quantity Δ is calculated i,j , to quantify the degree of texture stability damage in this area between frames. The specific operation is to extract the texture response sequence Φ 25,40 (t k ) from 20 consecutive frames of images collected during the cloth movement of the window. The time interval is set to 0.005 seconds per frame, and the corresponding acquisition time ranges from t1 = 0.22s to t 20 = 0.315s. The system reads the response value of each frame as follows (in response quantity): 12.6, 12.8, 12.9, 13.0, 13.1, 13.3, 13.4, 13.6, 13.7, 13.9, 14.0, 14.2, 14.3, 14.1, 13.8, 13.5, 13.3, 13.0, 12.7. After the 11th frame (about t = 0.275s), there is a continuous downward trend. Subsequently, the 16th frame suddenly drops to 13.5, and the response sequence that originally maintained an increasing trend is interrupted. The system initially judges that there is a perturbation band. For further confirmation, the perturbation evolution quantity function is used for calculation in this stage:

[0068]

[0069] Set the number of consecutive frames b = 19, and select the perturbation sensitivity index β = 1.8. This value belongs to the system recommended range β ∈ [1.2, 2.5]. A higher β value can enhance the response ability to sharp texture fluctuations. Substitute the above response sequence into the calculation to obtain the response difference between each frame:

[0070] [0.2, 0.1, 0.1, 0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, -0.2, -0.3, -0.3, -0.2, -0.3, -0.3]. Take the absolute value of it and raise the response to the power of β = 1.8. After summing the results and dividing by n - 1 = 18, we can get:

[0071]

[0072] After numerical conversion, the slowly rising fluctuation value in the first half is between 0.1 1.8 ≈0.015 and 0.2 1.8 ≈0.056, while the perturbation value of the suddenly dropping part in the second half is 0.3 1.8 ≈0.115. The system detects that the perturbation value is continuously higher than 0.1 in the last 6 frames, forming a peak. Finally, the total perturbation evolution quantity is about ∑≈1.32, and the average perturbation evolution quantity Δ 25,40≈0.073, and the globally set abnormal disturbance threshold of the system is δ = 0.06. Therefore, this window area exceeds the determination threshold, confirming the existence of dynamic behavior with obvious texture damage characteristics. Combining the static mutation previously discovered by the response function Φ and the dynamic disturbance trend captured by Δ now, the system can determine that this area not only has an abnormal response value in a certain frame, but also shows a non-stationary state in consecutive frames, further verifying its evolving characteristics with defects and strengthening the necessity for the candidate area to enter the defect trajectory analysis and boundary reconstruction process.

[0073] In this embodiment, significant disturbances in the texture response value Φ 25,40 at the window W 25,40 (t) in the time dimension have been identified, and Δ is calculated through the disturbance evolution quantity function. 25,40 ≈0.073, and it is preliminarily judged that there is a mutation behavior in the texture continuity of this area. However, to improve the generality and robustness of this judgment among various fabric types, the system does not directly rely on the original value of Δ for abnormal determination, but introduces the dynamic response index DRI function Λ i,j , and performs normalization processing by considering the texture structure complexity of this area, so as to judge whether it still constitutes an abnormality under its own material characteristics.

[0074] For this detection point W 25,40 , the system extracts the texture structure variance σ 25,40 of this window in the current frame (i.e., the moment of abnormal response). This variance measures the texture diversity of this window area in the static image, that is, the distribution fluctuation degree of the gray change in the image. In actual measurement, the system extracts the gray intensity and texture direction components of 1024 pixels from the window, and calculates σ 25,40 = 0.052, indicating that the texture structure of the fabric in this area is not complex in itself. Compared with some fabrics with complex patterns or printing materials, such denim fabrics belong to medium to low texture complexity. To balance the explanatory power of the disturbance value under complex fabric patterns, the system introduces a complexity adjustment coefficient γ. According to empirical parameters, the value range of γ is usually set to [0.8, 2.0]. This time, γ = 1.2 is used, which means that the system is relatively tolerant of complex texture areas, that is, a certain degree of natural fluctuation is allowed. To avoid division by zero and increase numerical stability, the system uniformly sets a very small positive number ∈ = 1×10 -4 . Substitute the above data into the DRI normalization formula:

[0075]

[0076] This DRI value Λ 25,40≈0.336 is sent to the system's anomaly determination module for judgment. Compared with the normal texture fluctuation range where the global cloth average Λ value is 0.12, it is significantly higher. Therefore, this area is officially marked as a high-confidence suspected defect. The system sets a classification response threshold for the DRI value, usually between 0.25 and 0.30. Areas exceeding this threshold will enter the defect trajectory analysis, credibility assessment, and classification decision-making process, forming a closed-loop detection path. This example fully demonstrates the usage logic of the DRI function proposed in the present invention in actual cloth detection. Its core advantage is that it does not directly use the original perturbation value Δ to judge anomalies, but considers the texture complexity σ of the cloth itself i,j , and flexibly adapts to different types of fabrics through the adjustment coefficient γ, enabling the system to maintain high consistency and low false alarms when detecting denim, cotton, linen, and even printed fabrics, enhancing the material independence and industrial-grade stability of the system. In addition, the compression effect of the log function effectively controls the misjudgment risk of extreme perturbation amplification, making the final scoring range more concentrated and controllable, thus providing a solid numerical basis for the subsequent modeling and type classification of the defect credibility DCI

[0077] Example 2:

[0078] Based on the window W mentioned in Example 1 25,40 has passed through the dynamic response function Φ i,j (t), the perturbation evolution quantity Δ i,j , and the normalized dynamic response index DRIΛ i,j is confirmed as a high-confidence abnormal area. The system then enters the defect area structure analysis stage to further confirm whether this area is a real defect rather than a natural fold or printing error

[0079] In this stage, the defect boundary stability measurement and credibility assessment method proposed in the present invention comes into effect. The first thing to execute is the boundary direction consistency analysis. The system uses the mutation trajectory map derived in the previous stage to determine the set of boundary pixels in this area, denoted as B. In actual detection, within the spatial range of the window W 25,40 , a total of 83 suspected defect edge pixels are identified. Therefore, |B| = 83. To determine whether there is a significant mutation in the texture direction in this area, the system uses the constructed boundary direction perturbation scoring function Ω d , which is defined as follows:

[0080]

[0081] In actual detection, the system extracts the main texture direction Θ of each boundary pixel from the image p , which is obtained through the response direction of the Gabor filter, with the unit of angle (degree). For example, if the direction of a certain pixel is 32°, the average value of its neighborhood direction If it is 29°, the direction offset of this point is 3°. The system calculates the direction deviations of all 83 pixel points in sequence, and obtains the whole set of difference sequences as: {2.4, 3.0, 2.1, 5.6, 7.2, 6.9, 8.3, 3.5, 1.9, 2.7, …, 4.8} (only part is listed here, and the complete is 83 values). To enhance the recognition of obvious mutations, the system sets the non-linear direction mutation enhancement coefficient α = 1.6. This parameter is within the recommended range of [1.2, 2.0] in the present invention. A higher α can improve the recognition sensitivity of the system to boundary discontinuities. After the system processes the above offset values by exponential power and then takes the average, the calculation shows:

[0082]

[0083] The direction perturbation score Ω d = 6.87 exceeds the abnormal recognition threshold set by the system (set to 5.5 in this scenario), indicating that this boundary has significant direction disorder characteristics. The system sends this value, together with the gray-scale gradient perturbation value of the current region and the texture difference inside and outside the region, into the defect confidence scoring model DCI (Defect Confidence Index) as the input of the direction instability weight. This calculation process shows that: even if there are brightness or texture mutations in some regions of the image, only when its boundary shows non-smooth and discontinuous structural behavior in the direction space, it will be judged as a high-confidence defect, avoiding misjudgments caused by natural changes such as wrinkles, shadows, and printing. At the same time, by introducing the exponential adjustment coefficient α, the system can fine-tune the sensitivity according to the fabric type, texture tightness, and lighting environment, further enhancing the adaptability of the algorithm in the actual clothing production detection environment. Combining the previous continuous judgment mechanisms of DRI and Δ i,j

[0084] In this embodiment, further through the boundary direction consistency analysis function Ω d The edge direction mutation score of 6.87 is obtained, which is significantly higher than the system-set threshold of 5.5, and it is judged that the boundary of this region has the direction perturbation characteristics of real defects. To further verify whether this region is a physical defect rather than caused by pseudo-abnormalities such as shadows, wrinkles, or color differences, the system also needs to introduce gray-scale perturbation trend analysis, that is, by detecting the non-stationary behavior of the gray-scale values of the boundary pixels to judge whether there are high-frequency brightness fluctuations. This step is realized through the gray-scale high-frequency perturbation detection function Ω g defined in the present invention, and the formula is as follows:

[0085]

[0086] In actual detection, the system performs gray-scale sampling along the identified defect boundary path, selects a continuous section with stable and representative gray-scale among 83 boundary pixels for processing, and extracts the edge gray-scale value sequence {g1, g2, …, g12}, and the corresponding pixel grayscale values are as follows: {108, 110, 113, 118, 122, 119, 115, 109, 104, 101, 98, 97}. It can be seen with the naked eye that after a peak appears in the middle section, it quickly drops, showing obvious non - smoothness. The system sets the disturbance index amplification factor β = 2.0, and this value is within the recommended range [1.5, 3.0]. The goal is to enhance the system's response ability to high - frequency grayscale disturbances and suppress the slow transition caused by slight light changes.

[0087] Substitute into the formula for item - by - item calculation. First, perform second - order difference transformation on the 2nd to the 11th items in the sequence to obtain the following disturbance amounts: |113 - 2×110 + 108| = 1, |118 - 2×113 + 110| = 2, |122 - 2×118 + 113| = - 1, |119 - 2×122 + 118| = - 7,... Calculate the absolute values of all disturbances and square them (i.e., the power exponent is β = 2.0) to obtain the following sequence of squared disturbance values: 1, 4, 1, 49, 64, 36, 36, 25, 9, 1. Summing them up gives the total value: ∑ = 226, and then perform normalization processing:

[0088] The system compares the sample statistics of different regions of the fabric. The normal grayscale disturbance values mostly concentrate between 5 and 12, while for the analysis region in this case, Ω g = 22.6 is much higher than the set judgment threshold (the experience threshold of this factory is 15.0). Therefore, the system confirms that this boundary is not only unstable in direction but also has non - stationary and non - periodic oscillation behavior in brightness distribution, which is highly consistent with the manifestations of physical defects such as jump yarn, broken weft, and changes in weaving density, rather than being caused by light reflection or normal fabric folds. This value will be further fed into the calculation model of the defect credibility index DCI as one of the grayscale disturbance intensity weights, together with Ω d (direction disturbance score) and Ω t (regional texture comparison) to jointly form the final basis for judging defect credibility.

[0089] This example truly demonstrates the complete application path of Ω g in the actual engineering scenario. From boundary extraction to grayscale sequence analysis, and then to disturbance trend quantification, the system can not only accurately identify abnormal brightness fluctuations hidden in details on the fabric but also achieve adaptability to different fabric materials and texture complexities through the adjustment of the coefficient β, enhancing the system's robustness in the face of complex backgrounds such as dark fabrics, printed fabrics, and reflective fabrics.

[0090] To finally confirm whether this area is a real physical defect rather than local illumination, texture variation, or pattern interference, the defect credibility assessment method proposed by the present invention also needs to introduce a third dimension: texture structure comparison and analysis. The system constructs a regional texture comparison scoring function Ω t , and further determines whether there is a sudden deviation in the multi-dimensional texture statistical features between the candidate region R and its surrounding neighborhood R ′ . The formula is as follows:

[0091]

[0092] In the current detection instance, the candidate region R is defined as the area where W 25,40 is located and its extended boundary, a total of 5×5 window blocks (a total of 1024 pixels × 25 windows). The neighborhood region R ′ is the edge region with an outer expansion of 8 pixels. The system extracts m = 4 texture feature dimensions for each region, including ψ1: directional entropy (measuring the degree of disorder in the direction distribution), ψ2: energy mean (texture contrast intensity), ψ3: texture density (the number of texture edges per unit pixel), ψ4: mean Gabor filter response (texture spatial frequency distribution feature). The four statistical results calculated for the R region are: ψ1(R) = 1.92, ψ2(R) = 0.138, ψ3(R) = 0.87, ψ4(R) = 22.3. For the neighborhood region R ′ , the following are calculated: ψ1(R ′ ) = 1.35, ψ2(R ′ ) = 0.112, ψ3(R ′ ) = 0.51, ψ4(R ′ ) = 15.6. It can be preliminarily seen that there are obvious numerical differences in multiple dimensions, especially the obvious jump trends in directional entropy and Gabor response.

[0093] To improve the system's sensitivity to texture mutations, a mutation response adjustment coefficient γ = 1.8 is set. This value is within the recommended range [1.2, 2.5] and is commonly used to enhance the contribution weight of the difference in feature dimensions to the overall score. The normalization factor is set to Z = 10, which is used for scale normalization of the differences in different feature units. Substituting into the formula gives:

[0094]

[0095] The exponential amplification results of the difference of each item are calculated as follows: |0.57| 1.8 ≈0.345, |0.026| 1.8 ≈0.0027, |0.36| 1.8 ≈0.192, |6.7| 1.8 ≈26.44, and the final score is obtained:

[0096]

[0097] Based on the empirical judgment of the sample data, the normal area of Ω on the same fabric t has a distribution range of 0.3 to 1.2. When the score exceeds 2.0, it usually indicates that obvious cross-region mutations have occurred in the texture features. The score of 2.698 is much higher than this threshold, indicating that there is a high degree of inconsistency between the candidate region and the surrounding fabric surface in the multi-dimensional texture structure, which cannot be explained as natural texture or printing and dyeing rules, but is more likely to be structural damage caused by the formation process of physical yarn breakage, abnormal weaving density, etc.

[0098] Finally, this score will be combined with the aforementioned Ω d = 6.87 and Ω g = 22.6 as three core inputs and fed into the DCI model of the defect credibility index for comprehensive calculation to form the final credible score of this candidate region, thereby driving the system to complete classification decisions, mark the defect types, and enter the quality traceability link. From this example, it can be seen that Ω t As one of the important components of the present invention, based on combining directionality and brightness behavior, it quantifies the mutations between regions from the perspective of the texture ontology structure, not only complementing the "boundary behavior" perspective of the first two scores, but also providing a judgment mechanism for "surface structure consistency" at the regional level, enabling this method to have higher accuracy and misjudgment suppression ability when dealing with complex patterns, gradient materials, and asymmetric patterns, and strengthening the industrial applicability and intelligent robustness of the entire detection system.

Claims

1. A method for detecting and classifying fabric defects in clothing production, characterized in that Including the following steps: S1. Adopt local dynamic modeling of fabric texture continuity: S1.

1. Localize the fabric image spatially and construct a dynamic response model based on the texture continuity of the local region; divide the continuous fabric image into sliding windows; S1.

2. Construct a local texture response sequence for each window on the time axis; use the dynamic response index DRI to describe the stability of the region in space and time as the basis for anomaly determination; S2. Adopt a defect area inference mechanism for response mutation trajectories: S2.

1. Detect the positions and change trajectories of texture response mutations, and infer the boundaries and shapes of defects; capture the jump points in the response sequence with a change amplitude greater than the set threshold; S2.

2. Combine the mutation trends between adjacent windows to deduce the shape boundaries and diffusion paths in the image; construct a mutation trajectory map to depict the true shape of the defect; S3. Adopt defect boundary stability measurement and defect credibility evaluation: S3.

1. By analyzing the structural stability of the defect boundary, determine whether the region belongs to a real defect, and form a defect credibility index DCI; calculate the direction consistency and edge gradient stability of the defect boundary; S3.

2. Introduce a texture difference index inside and outside the defect area; comprehensively output the defect credibility score DCI as one of the features for classification decision-making; S4. Adopt classification correlation modeling of defect root cause features: S4.

1. Comprehensively construct a defect root cause feature vector based on the analyzed mutation trajectories, response patterns, and boundary stabilities; extract the directionality, length change, and perturbation amplitude from the trajectory map; combine with the boundary pattern features to form a root cause representation; S4.

2. Use a classifier to discriminate the combined features to identify the defect type.

2. The fabric defect detection and classification method for clothing production according to claim 1, characterized in that The local dynamic modeling method of fabric texture continuity includes: Using a localized modeling approach, the continuously acquired fabric image frames are divided into a number of two-dimensional sliding window regions of a fixed size, denoted as W i,j , where i and j respectively represent the row and column indices of the window in the image matrix; each window corresponds to a single physical sub-region on the fabric surface, and as the fabric moves on the production line, the window tracks its evolution behavior on the time axis; and to describe the texture feature state of each local region at time t, the region response function Φ i,j (t) is defined as follows: Wherein: Φ i,j (t) is the comprehensive texture response value of the i,j-th window at time t; A(W i,j ) is the pixel area of the window region; p ∈ W i,j represents each pixel point within the window; D p (t) is the texture direction offset of pixel point p; G p (t) is the gray-scale gradient, reflecting the amplitude of the brightness change of the pixel within the local area; θ p (t) is the structural perturbation angle formed by the pixel point and its neighborhood in the current frame, measuring the degree of mutation of the spatial structure; ω1, ω2, ω3 are the weighting coefficients corresponding to each component, used to adjust the contribution weights of different feature dimensions to the overall response value.

3. The fabric defect detection and classification method for clothing production according to claim 2, wherein The local dynamic modeling method of fabric texture continuity includes: Quantify the discontinuity of the texture direction, the mutation of the local gray scale, or the dislocation of the texture structure in the fabric defect, which disrupts the process and models the continuous evolution process of the local response function Φ i,j (t) in the time dimension to construct a perturbation evolution quantity for measuring whether there is a significant fluctuation in the texture pattern between frames in the local area; the definition of the perturbation evolution quantity is as follows: Wherein: Δ i,j is the overall disturbance change intensity of the i,j-th window; n is the number of consecutive frames; t k is the time point of image acquisition, the k-th frame; Φ i,j (t k ) is the texture response of the i,j-th window at time t k moment; β is the disturbance sensitivity index, used to adjust the response intensity of the system to disturbances of different amplitudes. When β>1, the recognition ability for high-fluctuation regions is enhanced.

4. The fabric defect detection and classification method for clothing production according to claim 3, characterized in that The local dynamic modeling method of fabric texture continuity includes: Adopt the dynamic response index DRI function Λ i,j , and perform normalization by introducing the window structure complexity parameter to enable robust judgment across fabric materials; it is defined as follows: Wherein: Λ i,j is the dynamic response index of the i,jth window, used for abnormality judgment; Δ i,j is the aforementioned texture perturbation evolution; σ i,j is the variance of the texture structure in the current frame of the window, indicating the natural complexity of the region; γ is the complexity adjustment coefficient, which controls the weight of complex textures in the score; ∈ is a very small positive number used to avoid numerical instability caused by division by zero; log(·) is a compression transformation of the overall perturbation normalization value to prevent extreme outliers from amplifying errors.

5. The fabric defect detection and classification method for clothing production according to claim 1, wherein The defect boundary stability measurement and defect credibility evaluation method includes: In the boundary direction consistency analysis, the feature of identifying real defects lies in the degree of mutation of the edge texture direction; a boundary direction perturbation scoring function Ω d is adopted to measure the average deviation degree of the detected boundary pixel direction from the neighborhood direction; it is defined as follows: Among them, B represents the set of suspected defect boundary pixels detected, and |B| is the total number of pixel points in the set; p ∈ B represents any pixel point within the boundary; Θ p is the main texture direction of the pixel; is the average main direction in the pixel neighborhood ; α is a non-linear direction mutation enhancement coefficient, with a value greater than 1, used to enhance the sensitivity of mutation features.

6. The fabric defect detection and classification method for clothing production according to claim 5, wherein The defect boundary stability measurement and defect credibility evaluation method includes: In the analysis of the grayscale perturbation trend, the edges of real defects are accompanied by non-smooth and non-periodic brightness fluctuations. The grayscale high-frequency perturbation detection function Ω g is used to detect the non-stationary behavior of the grayscale values of edge pixels; the function is defined as follows: Among them, {g1, g2, …, g n} represents the grayscale intensity sequence obtained by sampling along the edge; g k is the grayscale value of the k-th point in this sequence; β is an exponential amplification factor used to control the perturbation response, which is set between 1.5 and 3 to improve the response ability to severe fluctuations.

7. The method for detecting and classifying fabric defects for clothing production according to claim 6, wherein The defect boundary stability measurement and defect credibility evaluation method includes: Analyze whether there is a sudden change in texture structure between the inside of the analysis area and the surrounding background, and construct a regional texture contrast scoring function Ω t , and identify the degree of structural deviation between the defective area and the adjacent normal area through the difference measurement of multi-dimensional texture features; defined as follows: Among them, R represents the candidate defect region, and R' represents its surrounding neighborhood region; ψ i (·) represents the i-th eigenvalue after texture statistics on a given region, including directional entropy, energy mean, texture density, and filtered response distribution; m is the total dimension of the texture features; γ is the mutation response adjustment coefficient, controlling the influence degree of the difference on the scoring result; Z is the normalization constant; if Ω t has a large value, it indicates that there is a significant deviation in the texture distribution characteristics between the defect region and the external region.

Citation Information

Cited By

  • Visual inspection system and method for tiny flaws of industrial products

    CN120612327A

  • Alloy resistor surface defect real-time detection method and system based on image processing

    CN120894367A

  • Intelligent quality evaluation method for waterproof cloth

    CN121481982A

  • A method for intelligent evaluation of tarpaulin quality

    CN121481982B

  • Intelligent positioning method and system for plate cutting

    CN121661134A