A method and system for detecting defects in textile products

Through a deep learning model based on multimodal features, combined with high-resolution image acquisition and multi-spectral light source lighting technology, the identification accuracy of textile product defect detection in high texture complexity and low contrast areas is solved, and the accurate identification and positioning of multiple categories of defects is achieved, adapting to a dynamic production environment, significantly improving detection accuracy and efficiency.

CN119290896BActive Publication Date: 2025-04-11SUZHOU HONGYANG TEXTILE DYEING & FINISHING
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411815751.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-11
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

The defect detection technology of existing textile product products has low accuracy in defect identification in high texture complexity and low contrast areas, inaccurate distinction between multiple defects and boundary positioning, and difficult for detection models to adapt to dynamically changing production environments.

Method used

The texture, color and geometric features of textile surfaces are extracted through high-resolution image acquisition, multi-spectral light source illumination, automatic exposure control and dynamic ROI division. Combining convolutional neural network, attention mechanism, multi-channel color space conversion and gradient analysis, defect type classification and positioning are performed, and model parameters are optimized through real-time feedback mechanism.

Benefits of technology

It significantly improves the detection accuracy of defects in high texture complexity and low contrast areas, realizes the precise identification and positioning of multiple categories of defects, adapts to different production environments and textile types, and has strong robustness and versatility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119290896B_ABST
    Figure CN119290896B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for detecting defects in textile products, including: collecting textile surface images and performing preprocessing; constructing a feature extraction model to extract multimodal features of textile surface defects; analyzing the extracted features to classify the defect types; locating the defect positions and marking the defect areas and types; outputting defect detection reports, and optimizing model parameters according to the detection results. The present invention significantly improves the classification accuracy and positioning accuracy of textile defect detection through multimodal feature extraction and feedback optimization mechanisms, especially in the detection of complex and low-contrast defects. The present invention greatly improves detection efficiency, reduces false detections and missed detections, and provides an efficient and intelligent solution for quality control in the textile industry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of industrial automation detection, and in particular to a method and system for detecting defects in textile products. Background Art

[0002] The textile industry is an important part of modern manufacturing, and its product quality directly affects the production efficiency and market competitiveness of downstream industries. In the textile production process, surface defects (such as broken yarn, stains, color difference and holes) are one of the core issues of quality control. Traditional textile defect detection methods mainly rely on manual visual inspection or simple mechanical detection methods. Although manual detection has certain flexibility, it is easily affected by the fatigue and subjective judgment of the inspectors, making it difficult to ensure the accuracy and consistency of the detection results. Although the mechanical detection method improves efficiency, it is based on simple optical sensors or texture analysis algorithms, and can usually only identify large-scale obvious defects. The detection ability of small or complex defects (such as multi-category overlapping defects) is weak, and the applicable scenarios are limited. In recent years, with the rapid development of image processing and artificial intelligence technology, textile defect detection methods based on computer vision have gradually become a research hotspot. These methods combine high-resolution image acquisition technology and deep learning models, and realize intelligent detection and classification of textile surface defects by extracting multimodal features such as texture, color, and geometry.

[0003] However, existing textile defect detection methods based on image processing and deep learning still have certain limitations. First, due to the limitations of model capabilities and algorithm design, current defect detection methods have a low defect recognition rate for areas with high texture complexity and low contrast, and often miss or misdetect. Second, when multiple categories of defects exist at the same time, existing methods are not accurate enough in distinguishing the categories of defects and locating their boundaries, especially in the imbalance of detection performance between small target defects (such as slight yarn breaks) and large target defects (such as large stains). In addition, many existing technologies fail to combine the real-time requirements of the production process, lack support for model optimization and update mechanisms, and are difficult to adapt to dynamically changing production environments. For example, the parameters of the detection model mostly rely on offline training, and fail to adjust the model performance through a real-time feedback mechanism. These deficiencies limit the large-scale application of existing detection methods in textile production lines, and fail to meet the industry's actual needs for high-precision and high-efficiency detection. Summary of the invention

[0004] In view of the above-mentioned problems, the present invention is proposed.

[0005] Therefore, the technical problems solved by the present invention are: the existing textile product defect detection technology has low defect recognition accuracy in high texture complexity and low contrast areas, inaccurate multi-category defect differentiation and boundary positioning, and the detection model is difficult to adapt to the dynamically changing production environment.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: A method for detecting defects in textile products, comprising: collecting a textile surface image and performing preprocessing;

[0007] Construct a feature extraction model to extract multimodal features of textile surface defects;

[0008] Analyze the extracted features and classify the defect types;

[0009] Locate the defect and mark the defect area and type;

[0010] Output defect detection report and optimize model parameters based on the detection results.

[0011] As a preferred embodiment of the method for detecting defects in textile products of the present invention, the collecting of textile surface images includes continuously photographing the textile surface using a high-resolution industrial camera to generate high-definition images;

[0012] Optimize image acquisition quality through multi-spectral light source illumination technology, where the light source wavelength range includes visible light and near-infrared light;

[0013] Apply automatic exposure control technology to dynamically adjust areas with uneven lighting;

[0014] The acquired images are sliced ​​to generate image blocks of fixed size.

[0015] As a preferred embodiment of the method for detecting defects in textile products of the present invention, the preprocessing includes graying the collected image to highlight the texture features of the textile surface;

[0016] Use a denoising algorithm based on median filtering to eliminate random noise in the image;

[0017] Use histogram equalization technology to increase image contrast and improve visibility of defective areas;

[0018] Analyze the frequency domain characteristics of the image based on fast Fourier transform and filter out periodic interference;

[0019] The dynamic ROI segmentation method is used to crop the part of the image containing the main textile area.

[0020] As a preferred embodiment of the method for detecting defects in textile products of the present invention, the multimodal features of textile surface defects are extracted, including building a multimodal feature extraction model based on a convolutional neural network, wherein the multimodal feature extraction includes multiple convolutional layers, pooling layers and fully connected layers, wherein the convolutional layers are used to extract local texture features, the pooling layers are used to reduce the dimension and retain the main features, and the fully connected layers realize feature fusion;

[0021] The local texture features of the textile surface are extracted through convolution operations, and the attention mechanism is used to increase the feature expression ability of low-contrast areas to highlight areas where defects may exist.

[0022] Using multi-channel color space conversion, the textile image is converted from RGB space to HSV space or other color space, and the distribution characteristics of the color histogram are statistically analyzed to identify possible color differences or contamination areas on the textile surface;

[0023] The geometric edge features of the textile surface are extracted based on the gradient analysis method, and the linear defects are identified by calculating the gradient intensity and edge direction of the textile texture;

[0024] The channel attention and spatial attention mechanisms are used to perform weighted fusion of the extracted multimodal features;

[0025] An adaptive optimization algorithm is used to train the model, and the model's defect detection performance is optimized by adjusting the weights of the classification loss and positioning loss in the loss function.

[0026] As a preferred embodiment of the method for detecting defects in textile products of the present invention, the analysis of the extracted features includes analyzing the extracted multimodal features and calculating the importance weight of each feature dimension by normalization operation, and the formula is:

[0027] ,

[0028] in, Indicates The weight of the feature, Indicates The eigenvalues ​​of the modes, Indicates The eigenvalues ​​of the modes, Dimensions that represent modal features; Represents the variance of the feature value, which is used to measure the distribution change of the feature in the sample set;

[0029] Using the weighted fusion method, multimodal features are combined into a comprehensive feature vector , the formula is:

[0030] ,

[0031] in, represents the comprehensive feature vector;

[0032] A classification model is built based on deep learning. The model includes a fully connected layer and a Softmax output layer to classify the comprehensive feature vector. The classification probability calculation formula is:

[0033] ,

[0034] in, Representation characteristics Belong to The probability of the class, Indicates The class weight vector, Indicates The class bias, Indicates The class bias, represents the total number of defect categories, Indicates the classification model The transpose of the weight vector corresponding to the class, Indicates the classification model The transpose of the weight vector corresponding to the class;

[0035] To address the imbalance problem of defect categories, a dynamic weight adjustment mechanism is designed and a category balance factor is introduced into the classification loss function. The classification loss calculation formula is:

[0036] ,

[0037] in, represents the category balance factor, Indicates The number of class samples, represents the true label;

[0038] The classification results are evaluated, and the model parameters are further optimized by calculating the classification accuracy and recall rate. The evaluation index formula is:

[0039] ,

[0040] in, represents the number of correctly classified positive samples, represents the number of misclassified positive samples, Indicates the number of missed positive samples.

[0041] As a preferred embodiment of the method for detecting defects in textile products described in the present invention, the method of locating the defect position includes generating a multi-scale feature map through the output of the intermediate layer of the deep learning model, spatially mapping the extracted texture, color and geometric features to form a feature map containing potential information of the textile defect area, and using a candidate frame generation method based on a region generation network to calculate the candidate frame through edge information and gradient changes in the feature map. The candidate box score is calculated by the following formula:

[0042] ,

[0043] in, Represents a candidate box The score, and Represent the gradient values ​​in the horizontal and vertical directions respectively. is the number of pixels in the candidate box; set the threshold , filter out the scores The corresponding candidate box ;

[0044] For the selected candidate boxes Perform pixel-level segmentation to generate defect boundaries. The binary decision of defect segmentation is determined by the following formula:

[0045] ,

[0046] in, Represents pixel Whether it belongs to the defect area, is the pixel confidence predicted by the segmentation network, is the segmentation confidence threshold;

[0047] For the segmented defect area, the type is labeled based on the classification result of the classification model, and the defect category information is combined with the area information to generate labeling data including the defect location, type, and area. The labeling data format is:

[0048] ,

[0049] in, and are the coordinates of the upper left and lower right corners of the defect area, is the defect category, is the defect area.

[0050] As a preferred embodiment of the method for detecting defects in textile products of the present invention, the outputting of the defect detection report includes outputting a detection report including the defect type, location, area and confidence level, and displaying the detection result in a visual form;

[0051] Conduct defect statistics analysis based on the inspection report and generate evaluation indicators for defect quantity distribution and type ratio;

[0052] Evaluate the model performance based on the test results. If the performance does not meet the requirements, continue to expand the training sample set.

[0053] By optimizing model parameters, including retraining weights and adjusting learning rates;

[0054] The optimized model is verified. If the performance meets the requirements, the model version is solidified and put into practical use.

[0055] A textile product defect detection system, characterized in that it includes:

[0056] Image acquisition module: collects textile surface images and performs preprocessing;

[0057] Feature extraction module: build a feature extraction model to extract multimodal features of textile surface defects;

[0058] Feature analysis module: analyzes the extracted features and classifies the defect types;

[0059] Defect location module: locates the defect location and marks the defect area and type;

[0060] Report generation and model optimization module: output defect detection report and optimize model parameters according to the detection results.

[0061] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0062] A computer-readable storage medium stores a computer program, which implements the steps of the method described above when executed by a processor.

[0063] Beneficial effects of the present invention: 1. Improved detection accuracy: By constructing a deep learning model based on multimodal features, the present invention can effectively extract the texture, color and geometric features of the textile surface, significantly improve the detection accuracy of defects in high texture complexity and low contrast areas, and reduce the occurrence of missed detection and false detection;

[0064] 2. Improved classification and segmentation algorithms are used to accurately identify multiple types of defects (such as broken yarn, stains, holes, etc.), and clear defect boundaries are generated through pixel-level segmentation methods, effectively improving the accuracy and reliability of defect positioning;

[0065] 3. Combining the real-time feedback mechanism and the dynamic model optimization method, the present invention can continuously adjust the model parameters according to the detection results, adapt to different production environments and textile types, and has strong robustness and versatility;

[0066] 4. By combining candidate region generation and segmentation algorithms, the utilization of computing resources is greatly optimized, making the detection process more efficient and meeting the needs of industrial production lines for real-time detection;

[0067] 5. Output detailed defect detection reports, support defect statistical analysis and model performance evaluation, and provide strong data support for production process optimization and detection model improvement. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work, among which:

[0069] Figure 1 An overall flow chart of a method for detecting defects in textile products provided in the first embodiment of the present invention. DETAILED DESCRIPTION

[0070] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0071] Example 1, reference Figure 1 , as an embodiment of the present invention, provides a method for detecting defects in textile products, comprising:

[0072] S1: Collect textile surface images and perform preprocessing.

[0073] Use a high-resolution industrial camera to continuously shoot the textile surface to generate high-definition images;

[0074] Image acquisition quality is optimized through multi-spectral light source illumination technology, where the light source wavelength range includes visible light and near-infrared light; the multi-spectral light source includes visible light and near-infrared light, where near-infrared light can highlight surface textures and internal anomalies, making up for the shortcomings of visible light in certain low-contrast areas.

[0075] Automatic exposure control technology is used to dynamically adjust areas with uneven lighting. By dynamically adjusting the exposure time and light intensity, the imaging quality in areas with uneven lighting is ensured to be consistent and noise interference is reduced.

[0076] The acquired images are sliced ​​to generate image blocks of fixed size.

[0077] The collected images are grayed out to highlight the texture features of the textile surface, remove the interference of color information, and focus on the extraction of textile texture features.

[0078] A denoising algorithm based on median filtering is used to eliminate random noise in the image, and isolated noise is eliminated through sorting windows to protect edge features.

[0079] The histogram equalization technique is used to increase the image contrast and improve the visibility of the defect area. It is used to enhance the contrast of the defect area and make the low-contrast area more prominent, which is convenient for subsequent feature extraction.

[0080] The frequency domain characteristics of the image are analyzed based on fast Fourier transform to filter out periodic interference.

[0081] The dynamic ROI division method is used to crop the part of the image containing the main textile area, and the focus area is dynamically defined according to the image content to avoid the background area occupying computing resources, focus on the main textile part, and improve detection efficiency and accuracy.

[0082] It should be noted that the multi-spectral light source combines visible light and near-infrared light to penetrate textiles through different wavelengths of light, solving the problem that traditional single light sources cannot accurately image in low-contrast or light-transmitting areas. This technology enhances image quality in high-reflectivity or low-contrast areas, providing high-quality input for subsequent defect detection, especially when detecting dark textiles or complex textures, significantly improving the visibility of defects.

[0083] For areas with uneven lighting, the optimal exposure level for each pixel is dynamically adapted by automatically adjusting the exposure time and intensity. Traditional fixed exposure methods may cause overexposure or underexposure when switching between light and dark areas. The dynamic adjustment mechanism of the present invention ensures consistent image brightness, especially avoiding the loss of defect information in light and dark alternating areas.

[0084] The content-based dynamic segmentation method focuses on the main textile area and avoids background interference. The static ROI segmentation method is usually difficult to adapt to a variety of textile styles, while the dynamic ROI segmentation is adaptively adjusted according to the image content, effectively reducing the amount of invalid calculations while ensuring the integrity of the main detection area.

[0085] S2: Construct a feature extraction model to extract multimodal features of textile surface defects.

[0086] A multimodal feature extraction model based on convolutional neural network is constructed. The multimodal feature extraction includes multiple convolutional layers, pooling layers and fully connected layers. The convolutional layers are used to extract local texture features, the pooling layers are used to reduce the dimension and retain the main features, and the fully connected layers realize feature fusion.

[0087] The local texture features of the textile surface are extracted through convolution operations, and the attention mechanism is used to increase the feature expression ability of low-contrast areas to highlight areas where defects may exist. The formula is:

[0088] Convolution operation is the core of feature extraction. The formula for extracting local texture features is as follows:

[0089] ,

[0090] in, Indicates Feature map after layer convolution; Represents the weight of the convolution kernel, and its size is ; Indicates that the input image is at coordinates The pixel value at ; Indicates bias; represents the activation function (usually ReLU: ).

[0091] Furthermore, the convolution kernel weights Automatic learning through model training to adapt to different types of textile texture features; activation function Used to enhance nonlinear characteristics and extract higher-order texture features.

[0092] It should be noted that the convolution layer, pooling layer and fully connected layer are used to extract and fuse multimodal features in layers to provide a unified high-dimensional feature vector. Through hierarchical structure processing, the convolution layer extracts local texture features, the pooling layer reduces the dimension to retain key features, and the fully connected layer unifies the multimodal feature representation, ensuring the comprehensiveness and uniformity of feature expression and significantly improving detection accuracy.

[0093] Multi-channel color space conversion is used to convert textile images from RGB space to HSV space or other color spaces, and the distribution characteristics of color histograms are statistically analyzed to identify possible color differences or contaminated areas on the textile surface. HSV space separates hue, saturation and brightness information, and histogram analysis accurately captures color distribution characteristics, significantly improving the ability to detect color differences or contaminated areas on the textile surface.

[0094] The geometric edge features of the textile surface are extracted based on the gradient analysis method. The linear defects are identified by calculating the gradient strength and edge direction of the textile texture. The gradient strength calculation formula is:

[0095] ,

[0096] The edge direction calculation formula is:

[0097] ,

[0098] Use the Sobel operator to calculate the horizontal gradient of the image and vertical gradient , extract the linear features of the textile surface. Used to identify linear defects such as broken yarn and edge damage.

[0099] in, Represents pixels The gradient strength; Indicates the edge direction; and are the horizontal and vertical gradients of the image respectively. Using the gradient strength and edge direction Extracting geometric features is particularly suitable for detecting linear defects such as yarn breaks and cracks in textiles, effectively improving the model's detection accuracy for these problems.

[0100] The channel attention and spatial attention mechanisms are used to perform weighted fusion on the extracted multimodal features.

[0101] The model is trained using an adaptive optimization algorithm. The model's defect detection performance is optimized by adjusting the weights of the classification loss and positioning loss in the loss function. The loss function formula is expressed as:

[0102] ,

[0103] in, Represents classification loss, which is used to optimize classification accuracy; Represents the positioning loss, which is used to optimize the boundary positioning of the defect area; Represents the loss weight, which is used to balance the classification and localization tasks.

[0104] and The initial value of is set through experience and dynamically adjusted during the training process. The Adam optimization algorithm is used to dynamically adjust the learning rate to accelerate model convergence and improve the comprehensive performance of classification and positioning tasks.

[0105] By dynamically adjusting the loss function weights and , achieving the best balance between classification accuracy and positioning accuracy; combined with the Adam optimization algorithm, it improves the efficiency and stability of model training to meet real-time detection needs.

[0106] S3: Analyze the extracted features and classify the defect types.

[0107] The extracted multimodal features are analyzed, and the importance weight of each feature dimension is calculated through normalization operation. The formula is:

[0108] ,

[0109] in, Indicates The weight of the feature, Indicates The eigenvalues ​​of the modes, Indicates The eigenvalues ​​of the modes, Dimensions that represent modal features; Represents the variance of the eigenvalue, which is used to measure the distribution change of the feature in the sample set. In order to improve the dynamic adaptability of feature fusion, the above weight calculation can be introduced into the deep learning attention mechanism, and the channel attention mechanism can be used to dynamically adjust the feature weights to further enhance the model's responsiveness to low contrast and complex texture areas.

[0110] Using the weighted fusion method, multimodal features are combined into a comprehensive feature vector , the formula is:

[0111] ,

[0112] in, represents the comprehensive feature vector; the above feature fusion method can be combined with the traditional weighting method and the dynamic weight adjustment mechanism to further optimize the quality of the comprehensive feature vector. For example, in the small sample category, the dynamic adjustment The weight ratio can further enhance the expressiveness of the features of this category.

[0113] A classification model is built based on deep learning. The model includes a fully connected layer and a Softmax output layer to classify the comprehensive feature vector. The classification probability calculation formula is:

[0114] ,

[0115] in, Representation characteristics Belong to The probability of the class, Indicates The class weight vector, Indicates The class bias, Indicates The class bias, represents the total number of defect categories, Indicates the classification model The transpose of the weight vector corresponding to the class, Indicates the classification model The transpose of the weight vector corresponding to the class;

[0116] To address the imbalance problem of defect categories, a dynamic weight adjustment mechanism is designed and a category balance factor is introduced into the classification loss function. The classification loss calculation formula is:

[0117] ,

[0118] in, represents the category balance factor, Indicates The number of class samples, represents the true label.

[0119] It should be noted that by dynamically adjusting the category balance factor , so that the classification loss function can balance the influence of each category and improve the detection performance of minority class samples. For example, when the number of stain defect samples is much smaller than that of broken yarn samples, this mechanism can significantly improve the model's classification effect on stain defects.

[0120] The classification results are evaluated, and the model parameters are further optimized by calculating the classification accuracy and recall rate. The evaluation index formula is:

[0121] ,

[0122] in, represents the number of correctly classified positive samples, represents the number of misclassified positive samples, Indicates the number of missed positive samples.

[0123] Quantitatively analyze the model performance and identify optimization directions. For example, if the classification accuracy is low, it indicates that the feature weights need to be adjusted. or category balance factor ; If the recall rate is low, it is necessary to strengthen the model's learning ability for small sample categories.

[0124] S4: Locate the defect location and mark the defect area and type.

[0125] A multi-scale feature map is generated through the output of the middle layer of the deep learning model, and the extracted texture, color and geometric features are spatially mapped to form a feature map containing the potential information of the textile defect area. The candidate box generation method based on the region proposal network (RPN) is used to calculate the candidate box through the edge information and gradient changes in the feature map. The candidate box score is calculated by the following formula:

[0126] ,

[0127] in, Represents a candidate box The score, and Represent the gradient values ​​in the horizontal and vertical directions respectively. is the number of pixels in the candidate box; set the threshold , filter out the scores The corresponding candidate box , which is used to retain potential defective areas. The candidate box score uses the gradient changes on the textile surface to effectively locate the areas with high texture changes and reduce the interference of non-defective areas.

[0128] It should be noted that the candidate box scoring formula comprehensively considers the gradient information in the horizontal and vertical directions, which can more accurately capture linear defects (such as broken yarns) and complex texture change areas.

[0129] For the selected candidate boxes Perform pixel-level segmentation to generate defect boundaries. The binary decision of defect segmentation is determined by the following formula:

[0130] ,

[0131] in, Represents pixel Whether it belongs to the defect area, represents the pixel confidence predicted by the segmentation network, Represents the segmentation confidence threshold.

[0132] It should be noted that the binary segmentation method effectively reduces noise interference and makes the defect boundary clearer. In particular, it can generate accurate pixel-level segmentation results for small defects or defect areas with blurred edges. The segmentation results can be jointly optimized with the candidate box score to further improve the accuracy of the defect area boundary.

[0133] For the segmented defect area, the type is labeled based on the classification result of the classification model, and the defect category information is combined with the area information to generate labeling data including the defect location, type, and area. The labeling data format is:

[0134] ,

[0135] in, and Indicates the coordinates of the upper left corner and lower right corner of the defect area, Indicates the defect category, Indicates the area of ​​defective region; It is a collection of multiple labeled instances, each of which completely describes the spatial location, category and area information of a defect area, providing data support for subsequent quality inspection, statistical analysis and data visualization.

[0136] It should be noted that the data structure of the defect area annotation is intuitive and the information is complete, which is convenient for subsequent analysis and data storage. The calculation of is of great reference value for judging the severity of defects, such as distinguishing between minor stains and large areas of damage. , the annotation data realizes the unified representation of defect areas and types, providing comprehensive support for automated quality inspection and production line control.

[0137] S5: Output defect detection report and optimize model parameters according to the detection results.

[0138] Output a test report containing defect type, location, area and confidence, and display the test results in a visual form; the test report is the output result of this step, which is used to record the detected defect information. The report content is intuitive and comprehensive, and can be directly used for defect management and analysis on the production line.

[0139] Defect statistics are analyzed based on the inspection report to generate evaluation indicators for defect quantity distribution and type ratio; the inspection results are presented in a graphical manner, such as superimposing defect area boundaries and category labels on the original image. This display method makes it easier for operators to quickly understand the inspection results, reduces the time for manual review, and improves inspection efficiency.

[0140] Evaluate the model performance based on the test results. If the performance does not meet the requirements, continue to expand the training sample set.

[0141] By optimizing model parameters, including retraining weights and adjusting learning rates, the classification and segmentation performance of the detection model is analyzed, and indicators such as classification accuracy, recall rate, and F1 value are usually used to measure the actual effect of the model. The results of performance evaluation determine whether the model needs to be optimized.

[0142] The optimized model is verified. If the performance meets the requirements, the model version is solidified and put into practical use.

[0143] It should be added that, through performance verification, the optimized model is fixed as the official version and put into actual use, which can effectively avoid system instability problems that may be caused by frequent model updates, thereby providing guarantee for the long-term operation of automated defect detection.

[0144] Embodiment 2 is the second embodiment of the present invention, which is different from the previous embodiment in that:

[0145] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art or partly in the current technical solution. The current computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0146] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0147] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0148] Embodiment 3 is an embodiment of the present invention, which provides a textile product defect detection system, characterized in that it includes an image acquisition module, a feature extraction module, a feature analysis module, a defect location module and a report generation and model optimization module.

[0149] Image acquisition module: collects textile surface images and performs preprocessing;

[0150] Feature extraction module: build a feature extraction model to extract multimodal features of textile surface defects;

[0151] Feature analysis module: analyzes the extracted features and classifies the defect types;

[0152] Defect location module: locates the defect location and marks the defect area and type;

[0153] Report generation and model optimization module: output defect detection report and optimize model parameters according to the detection results.

[0154] Example 4 is an embodiment of the present invention, which provides a method for detecting defects in textile products. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation / comparative experiments.

[0155] This embodiment aims to verify the effectiveness and economic benefits of a method for detecting defects in textile products. The method combines multimodal feature extraction, defect classification, defect location and model optimization, and comprehensively evaluates the performance and advantages of the present invention through simulation experiments and actual detection comparisons. The experiment selected typical textile defect samples, including six types of defects: broken yarn, stains, snagging, holes, color fading and wrinkles, to simulate the defect scenarios that may occur in actual production lines.

[0156] The image acquisition of six groups of textile samples was carried out by industrial cameras, and each group of samples contained typical defect areas. The resolution of the acquired images was set to 2048×2048 pixels, and the images were preprocessed by grayscale, noise reduction, histogram equalization and other methods to enhance the contrast of texture and color features and provide high-quality input for subsequent feature extraction.

[0157] A multimodal feature extraction model is designed based on a convolutional neural network (CNN) to extract defect features on the textile surface from three dimensions: texture, color, and geometric features. The convolution layer captures texture changes, color features are realized through statistics in a multi-channel color space (such as HSV), and geometric features are combined with gradient analysis to extract edge information.

[0158] The extracted comprehensive feature vector is analyzed using a deep learning classification model. The model outputs the classification confidence and category information for each defect. For example, the analysis results of sample 3 (wire pulling) show that the classification confidence is 93% and the classification accuracy is 94%. To ensure the classification performance, the category balance factor is used to dynamically adjust the classification loss for the category imbalance problem.

[0159] The region generation network (RPN) generates candidate boxes for the feature map, and combines pixel-level segmentation technology to locate the defect boundary and record the specific coordinates of the defect area. The classification results are combined with the defect area information to generate annotation data including type, location and area.

[0160] According to the test report, we analyzed the misclassified samples, dynamically expanded the training sample set, and optimized the model performance by adjusting the learning rate and retraining the weights. The classification accuracy of the optimized model increased by 2% to 3% on average. For example, the accuracy of sample 4 (hole) increased from 97% to 98%. For specific data content, please refer to the table below:

[0161] Table 1 Experimental data reference table

[0162] Sample No. Defect Type Defect area (cm²) Detection confidence (%) Classification accuracy (%) Defect location (x1, y1, x2, y2) Accuracy after optimization (%) Sample 1 Yarn breakage 2.7 96 95 (42,53,71,84) 97 Sample 2 Stains 1.6 90 91 (103,118,135,143) 93 Sample 3 Wire drawing 3.1 93 94 (23,33,48,63) 95 Sample 4 Hole 4.3 97 97 (181,192,223,235) 98 Sample 5 Color Fading 1.3 88 89 (88,97,117,129) 91 Sample 6 Wrinkles 0.7 91 92 (28,38,49,58) 94

[0163] The classification accuracy of the model before optimization was 89%~97%, and increased to 91%~98% after optimization, indicating that through feedback optimization and sample expansion, the model's adaptability to different defect types has been significantly enhanced.

[0164] The classification accuracy of low-contrast defects (such as color fading) increased from 89% to 91%, demonstrating the effectiveness of multimodal feature extraction.

[0165] The coordinate marking of the defect area accurately reflects the spatial range of the defect. The present invention has higher accuracy in locating small defects (such as wrinkles).

[0166] The present invention adopts the multimodal feature extraction and optimization feedback loop of the deep learning model, while traditional methods mostly rely on manual experience or simple image processing and lack the ability to detect complex defects.

[0167] The present invention is significantly superior to the existing technology in terms of detection speed and accuracy, especially in the detection of large-area defects such as sample 4 (hole).

[0168] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for detecting defects in textile products, characterized in that: include: Collect textile surface images and perform preprocessing; Construct a feature extraction model to extract multimodal features of textile surface defects; Analyze the extracted features and classify the defect types; Locate the defect and mark the defect area and type; Output defect detection report and optimize model parameters according to the detection results; The defect location includes generating a multi-scale feature map through the intermediate layer output of the deep learning model, spatially mapping the extracted texture, color and geometric features, and forming a feature map containing potential information of the defective area of ​​the textile. The candidate box generation method based on the region generation network is used to calculate the candidate box through the edge information and gradient changes in the feature map. The candidate box score is calculated by the following formula: , in, Represents a candidate box The score, and Represent the gradient values ​​in the horizontal and vertical directions respectively. is the number of pixels in the candidate box; set the threshold , filter out the scores The corresponding candidate box ; For the selected candidate boxes Perform pixel-level segmentation to generate defect boundaries. The binary decision of defect segmentation is determined by the following formula: , in, Represents pixel Whether it belongs to the defect area, is the pixel confidence predicted by the segmentation network, is the segmentation confidence threshold; For the segmented defect area, the type is labeled based on the classification result of the classification model, and the defect category information is combined with the area information to generate labeling data including the defect location, type, and area. The labeling data format is: , in, and are the coordinates of the upper left and lower right corners of the defect area, is the defect category, is the defect area.

2. The method for detecting defects in textile products according to claim 1, characterized in that: The collecting of textile surface images includes continuously photographing the textile surface using a high-resolution industrial camera to generate high-definition images; Optimize image acquisition quality through multi-spectral light source illumination technology, where the light source wavelength range includes visible light and near-infrared light; Apply automatic exposure control technology to dynamically adjust areas with uneven lighting; The acquired images are sliced ​​to generate image blocks of fixed size.

3. The method for detecting defects in textile products according to claim 2, characterized in that: The preprocessing includes graying the collected image to highlight the texture features of the textile surface; Use a denoising algorithm based on median filtering to eliminate random noise in the image; Use histogram equalization technology to increase image contrast and improve visibility of defective areas; Analyze the frequency domain characteristics of the image based on fast Fourier transform and filter out periodic interference; The dynamic ROI segmentation method is used to crop the part of the image containing the main textile area.

4. The method for detecting defects in textile products according to claim 3, characterized in that: The multimodal features of textile surface defects are extracted by constructing a multimodal feature extraction model based on a convolutional neural network, wherein the multimodal feature extraction includes a plurality of convolutional layers, a pooling layer and a fully connected layer, wherein the convolutional layer is used to extract local texture features, the pooling layer is used to reduce the dimension and retain the main features, and the fully connected layer realizes feature fusion; The local texture features of the textile surface are extracted through convolution operations, and the attention mechanism is used to increase the feature expression ability of low-contrast areas to highlight areas where defects may exist. Using multi-channel color space conversion, the textile image is converted from RGB space to HSV space or other color space, and the distribution characteristics of the color histogram are statistically analyzed to identify possible color differences or contamination areas on the textile surface; The geometric edge features of the textile surface are extracted based on the gradient analysis method, and the linear defects are identified by calculating the gradient intensity and edge direction of the textile texture; The channel attention and spatial attention mechanisms are used to perform weighted fusion of the extracted multimodal features; An adaptive optimization algorithm is used to train the model, and the model's defect detection performance is optimized by adjusting the weights of the classification loss and positioning loss in the loss function.

5. The method for detecting defects in textile products according to claim 4, characterized in that: The analyzing of the extracted features includes analyzing the extracted multimodal features and calculating the importance weight of each feature dimension through a normalization operation, and the formula is: , in, Indicates The weight of the feature, Indicates The eigenvalues ​​of the modes; Indicates The eigenvalues ​​of the modes, Dimensions that represent modal features; Represents the variance of the feature value, which is used to measure the distribution change of the feature in the sample set; Using the weighted fusion method, multimodal features are combined into a comprehensive feature vector , the formula is: , in, represents the comprehensive feature vector; A classification model is built based on deep learning. The model includes a fully connected layer and a Softmax output layer to classify the comprehensive feature vector. The classification probability calculation formula is: , in, Representation characteristics Belong to The probability of the class, Indicates The class weight vector, Indicates The class bias, Indicates The class bias, represents the total number of defect categories, Indicates the classification model The transpose of the weight vector corresponding to the class, Indicates the classification model The transpose of the weight vector corresponding to the class; To address the imbalance problem of defect categories, a dynamic weight adjustment mechanism is designed and a category balance factor is introduced into the classification loss function. The classification loss calculation formula is: , in, represents the category balance factor, Indicates The number of class samples, represents the true label; The classification results are evaluated, and the model parameters are further optimized by calculating the classification accuracy and recall rate. The evaluation index formula is: , in, represents the number of correctly classified positive samples, represents the number of misclassified positive samples, Indicates the number of missed positive samples.

6. The method for detecting defects in textile products according to claim 5, characterized in that: Outputting the defect detection report includes outputting a detection report including defect type, location, area and confidence level, and displaying the detection result in a visual form; Conduct defect statistics analysis based on the inspection report and generate evaluation indicators for defect quantity distribution and type ratio; Evaluate the model performance based on the test results. If the performance does not meet the requirements, continue to expand the training sample set. By optimizing model parameters, including retraining weights and adjusting learning rates; The optimized model is verified. If the performance meets the requirements, the model version is solidified and put into practical use.

7. A textile product defect detection system, used to implement the textile product defect detection method according to any one of claims 1 to 6, characterized in that: Image acquisition module: collects textile surface images and performs preprocessing; Feature extraction module: build a feature extraction model to extract multimodal features of textile surface defects; Feature analysis module: analyzes the extracted features and classifies the defect types; Defect location module: locates the defect location and marks the defect area and type; Report generation and model optimization module: output defect detection report and optimize model parameters according to the detection results.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Cloth defect detection method based on multi-modal fusion deep learning

    CN111028204A

  • Fabric defect detection method and system

    CN115393325A