Fabric inspection system for identifying defects of waste fabrics
By employing multispectral polarization image acquisition and Bayesian model optimization techniques, the problem of high false negative rates in waste fabric defect detection has been solved, enabling accurate detection and efficient identification of waste fabric defects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DONGHUA UNIV
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Current technologies rely on manual visual observation for defect detection in waste fabrics, resulting in a high rate of missed detections and making it difficult to achieve accurate detection.
A multi-modal data matrix is constructed by acquiring multispectral polarization images. Through polarization state filtering, local refractive index correction and enhanced denoising, combined with local texture complexity analysis and wavelet decomposition, high-frequency defect features are adaptively filtered. Through iterative optimization using a Bayesian model, accurate defect detection results are output.
It improves the accuracy and stability of defect detection in waste fabrics, reduces the false negative rate, adapts to the detection needs of different materials and wear levels, and improves the reliability and accuracy of detection.
Smart Images

Figure CN121837232A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fabric inspection technology, specifically to a fabric inspection system for identifying defects in waste fabrics. Background Technology
[0002] With the advancement of the resource recycling strategy, the recycling and reuse of waste fabrics has become one of the core directions for the green development of the textile industry. During the recycling process, waste fabrics are prone to various defects such as stains, fiber breakage, holes, and aging and brittleness due to factors such as storage environment, wear and tear, processing, and transportation. The presence of these defects directly affects the quality and safety of recycled fabrics. Therefore, accurate detection of defects in waste fabrics is a key link in ensuring recycling efficiency and improving the quality of recycled products, and fabric testing technology occupies an important position in the waste fabric recycling industry chain.
[0003] Currently, defect detection in waste fabrics is mostly done manually, relying on the visual observation and experience of the inspectors to identify the type and location of defects on the fabric surface with the naked eye. However, this method is greatly affected by the subjective factors and fatigue level of the inspectors, resulting in a high rate of missed detections. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a fabric inspection system for identifying defects in waste fabrics, solving the problem of high false negative rates in existing waste fabric defect detection methods.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a fabric inspection system for identifying defects in waste fabrics, comprising: The acquisition module is used to acquire multispectral polarization image data of waste fabrics and construct a multimodal data matrix; The processing module is used to perform polarization state filtering, local refractive index correction and enhanced noise reduction on the multimodal data matrix, and output the purified feature image. The decomposition module is used to perform local texture complexity analysis on the feature image, adaptively select wavelet parameters and filter high-frequency sub-bands, and output a preliminary image of defect features. The enhancement module is used to perform image enhancement processing on the preliminary image of the defect features and output the enhanced feature image; The separation module is used to construct a high-dimensional feature matrix from the enhanced feature image, and output a pure defect feature set after kernel space mapping and low-dimensional manifold construction. The detection module is used to detect the image corresponding to the pure defect feature set and output the detection result including defect classification result, location coordinates and detection confidence. The optimization module is used to construct a Bayesian posterior probability model with the detection results as observations, iteratively optimize the model, output the final optimized detection results, and visualize them.
[0006] By adopting the above technical solution, a multimodal data matrix is constructed based on multispectral polarization acquisition. After noise reduction and interference removal, high-frequency defect features are adaptively screened to enhance feature recognition. Pure defect feature sets are extracted for identification and localization. Furthermore, Bayesian model iteration is used to optimize and adapt to different working conditions, thereby enhancing the feature difference between minute defects and the background, improving feature extraction accuracy and system adaptability, and achieving accurate detection of defects in waste fabrics. This solves the problem of high false negative rate in existing waste fabric defect detection.
[0007] Preferably, the multispectral polarization image data includes at least image data of waste fabric under spectral channels and polarization angles. The spectral channels include at least blue, green, red, and near-infrared spectra of preset wavelengths. The polarization angles are polarization angles with a step size of 15° within the range of 0°-180°. The construction of the multimodal data matrix involves converting the acquired multispectral polarization image data into a format and constructing a multimodal data matrix with dimensions including image height, image width, number of spectral channels, and number of polarization angles.
[0008] Preferably, the output purified feature image specifically includes the following steps: Calculate the polarization degree of each pixel in the multimodal data matrix, set a polarization degree threshold, and filter out candidate defect areas; The pixel grayscale gradient within the candidate defect region is calculated using the Sobel operator, and then substituted into the local refractive index correction model to obtain the local corrected refractive index. The intensity of the scattered light after correction is calculated by combining the locally corrected refractive index with the Rayleigh scattering formula, and the light intensity image is obtained. Adaptive histogram equalization is performed on the light intensity image, and then Gaussian noise is removed by nonlocal mean filtering to output the purified feature image.
[0009] Preferably, the output of the preliminary image of defect features specifically includes the following steps: The purified feature image is divided into preset pixel blocks, and the texture complexity of each pixel block is calculated. Based on the texture complexity threshold, the wavelet basis function and the number of decomposition layers are selected, and wavelet packet decomposition is performed on the purified feature image to obtain wavelet packet subbands; The entropy value of each wavelet subband is calculated based on the Renyi entropy criterion. High-frequency subbands with preset entropy values are selected and reconstructed to output a preliminary image of defect features.
[0010] Preferably, the step of calculating the entropy value of each wavelet packet subband based on the Renyi entropy criterion and filtering the high-frequency subband with a preset entropy value specifically includes the following steps: Calculate the sum of squares of pixel grayscale values for each wavelet subband to obtain the energy value of each subband; Calculate the ratio of the energy value of a single subband to the sum of the energy values of all wavelet packet subbands to obtain the energy proportion of each subband; Set the order of Renyi entropy, substitute the energy proportion as the probability term in the Renyi entropy formula, and calculate the entropy value of each wavelet packet. Set an entropy value screening threshold, and determine the subbands with entropy values greater than the screening threshold as high-frequency subbands.
[0011] Preferably, the enhanced feature image output specifically includes the following steps: Perform contrast-limited adaptive histogram equalization on the preliminary image of the defect features, set the pixel block size and contrast limit threshold, and obtain a contrast-enhanced image; The Laplacian operator is used to perform edge enhancement processing on the contrast-enhanced image to obtain an edge-enhanced image; The contrast-enhanced image and the edge-enhanced image are weighted and fused according to a preset ratio based on pixel grayscale values to output the enhanced feature image.
[0012] Preferably, the output pure defect feature set specifically includes the following steps: The enhanced feature image is divided into preset pixel blocks, and the preset dimension features of each pixel block are extracted to construct a high-dimensional feature matrix; The high-dimensional feature matrix is mapped to a high-dimensional kernel space using radial basis functions to construct a kernel matrix; Based on the kernel matrix, calculate the kernel space distance between each feature vector and other feature vectors, and select a set number of neighborhood samples for each feature vector in the high-dimensional feature matrix; The local weight matrix is calculated based on the kernel space relationship between the neighborhood samples and the corresponding feature vectors. The low-dimensional mapping is solved by eigenvalue decomposition, and the pure defect feature set is output.
[0013] Preferably, the output includes defect classification results, location coordinates, and detection confidence scores, specifically including the following steps: The image corresponding to the pure defect feature set is scaled to a preset input size, and the pixel grayscale values are normalized to obtain the model input image. The YOLOv5 object detection model is used to process the input image of the model. The classification branch outputs the probability distribution of defect types, and the regression branch outputs the position coordinates including the coordinates of the defect bounding box. The classification result of the defect is determined based on the probability distribution, and the probability value corresponding to the classification result is extracted as the detection confidence level.
[0014] Preferably, the output of the final optimized detection result specifically includes the following steps: Using the detection confidence, detection rate, and false detection rate as observations, a Bayesian posterior probability model is constructed, which includes the fractional order, refractive index correction coefficient, kernel function parameters, and wavelet packet decomposition level. The Markov chain Monte Carlo algorithm is used to sample the Bayesian posterior probability model, obtain parameter combinations, and adjust the corresponding parameters according to the detection results; When the detection confidence of a set number of consecutive frames reaches a set threshold, the corresponding parameters converge and the optimized detection result is output; otherwise, the detection is re-executed through the processing module.
[0015] Preferably, the step of acquiring parameter combinations and adjusting corresponding parameters based on detection results specifically includes the following steps: Initialization: Initialize the initial parameter values of the Markov chain, and use the parameter combination corresponding to the initial parameter values as the initial current parameter combination. The initial parameter values include at least the preset initial values of fractional order, refractive index correction coefficient, kernel function parameters, and wavelet packet decomposition layer number. Generate calculation: Generate candidate parameter combinations based on a preset step size, substitute the candidate parameter combinations into the Bayesian posterior probability model, and calculate the candidate posterior probability value. At the same time, substitute the current parameter combination into the Bayesian posterior probability model and calculate the current posterior probability value. Ratio calculation: Calculate the ratio of the candidate posterior probability value to the current posterior probability value to obtain the acceptance probability; Acceptance judgment: When the acceptance probability is greater than the preset random probability threshold, the candidate parameter combination is accepted as the current parameter combination. When the acceptance probability is less than or equal to the preset random probability threshold, the current parameter combination is retained, and the generation calculation, ratio calculation and acceptance judgment steps are repeated until the number of samplings reaches the preset threshold to obtain the parameter combination. Parameter adjustment: When the detection rate in the current detection results is lower than the preset detection rate threshold, adjust the wavelet packet decomposition layer and fractional order. When the false detection rate is higher than the preset false detection rate threshold, adjust the kernel function parameters and refractive index correction coefficient.
[0016] This invention provides a fabric inspection system for identifying defects in waste fabrics. It has the following beneficial effects: 1. This invention constructs a multimodal data matrix based on multispectral polarization acquisition, removes interference through denoising correction, adaptively filters high-frequency defect features to enhance feature recognition, extracts pure defect feature sets for identification and localization, and iteratively optimizes and adapts to different working conditions through a Bayesian model, thereby enhancing the feature difference between minute defects and the background, improving feature extraction accuracy and system adaptability, and achieving accurate detection of defects in waste fabrics, solving the problem of high false negative rate in existing waste fabric defect detection.
[0017] 2. This invention achieves adaptive selection of wavelet parameters by leveraging local texture complexity analysis, and combines it with the core parameter iterative optimization mechanism of the Bayesian posterior probability model, enabling the system to dynamically adapt to the detection needs of waste fabrics with different materials and wear levels, thereby improving the detection stability and reliability under complex working conditions.
[0018] 3. This invention separates the defect features from the residual background texture in the high-dimensional feature matrix by using kernel space mapping and low-dimensional manifold construction. The extracted pure defect feature set reduces interference from irrelevant information, thereby improving the accuracy of defect classification and localization and reducing the false detection rate. Attached Figure Description
[0019] Figure 1 This is an architecture diagram of an inspection fabric system for identifying defects in waste fabrics proposed in this invention; Figure 2 This is a flowchart of a fabric inspection method for identifying defects in waste fabrics, as proposed in an embodiment of the present invention. Detailed Implementation
[0020] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Example 1: In a first embodiment of the present invention, the present invention provides a fabric inspection system for identifying defects in waste fabrics, such as... Figure 1 As shown, it includes: The acquisition module is used to acquire multispectral polarization image data of waste fabrics and construct a multimodal data matrix; Furthermore, the multispectral polarization image data includes at least image data of waste fabric under spectral channels and polarization angles. The spectral channels include at least blue, green, red and near-infrared spectra of preset wavelengths. The polarization angles are polarization angles with a step size of 15° within the range of 0°-180°. The construction of the multimodal data matrix involves converting the acquired multispectral polarization image data into a format and constructing a multimodal data matrix with dimensions including image height, image width, number of spectral channels and number of polarization angles.
[0022] Specifically, to enhance the distinguishing features between minute defects and background textures in waste fabrics, the acquisition module needs to acquire multispectral polarization image data and construct a multimodal data matrix. The spectral channels must include at least 450nm blue light, 550nm green light, 650nm red light, and 850nm near-infrared spectrum, with polarization angles covering the range of 0°-180°, in 12 angles with a 15° step size. To ensure acquisition synchronization, the camera frame rate needs to be adaptively adjusted according to the following formula: ,in, For camera frame rate, For fabric transport speed, In pixels This represents the image width.
[0023] The acquired 12-bit grayscale image was linearly stretched to 8 bits, and then a multimodal data matrix was constructed. ,in =2048 pixels, which is the image height. =8192 pixels, which is the image width. =4, which represents the number of spectral channels. =12, representing the number of polarization angles. In this embodiment, the hardware includes a narrowband polarized light source, a line scan camera, etc. The image is transmitted to the FPGA via the Camera Link protocol to complete the format conversion, and the matrix data is directly output to the processing module, providing a high-quality structured data source.
[0024] The processing module is used to perform polarization state filtering, local refractive index correction, and enhanced noise reduction on the multimodal data matrix, and output the purified feature image. Furthermore, the output of the purified feature image specifically includes the following steps: Calculate the polarization degree of each pixel in the multimodal data matrix, set a polarization degree threshold, and filter out candidate defect areas; The pixel grayscale gradient within the candidate defect region is calculated using the Sobel operator, and then substituted into the local refractive index correction model to obtain the local corrected refractive index. The intensity of the scattered light after correction is calculated by combining the locally corrected refractive index with the Rayleigh scattering formula, and the light intensity image is obtained. Adaptive histogram equalization is performed on the light intensity image, and then Gaussian noise is removed by nonlocal mean filtering to output the purified feature image.
[0025] Specifically, the processing module removes texture background and noise interference from the multimodal data matrix, purifies defect feature signals, and lays the foundation for subsequent feature decomposition. First, polarization state screening is performed. The difference in polarization scattering between defects and normal textures is used to initially screen candidate regions. The degree of polarization is calculated according to the formula: ,in, coordinates Pixel polarization degree These represent the maximum and minimum light intensities of the pixel at 12 polarization angles. Inputting the polarization intensity data from the multimodal data, and outputting the polarization degree, a threshold of 0.6 is set, and pixel regions with polarization degrees greater than the threshold are designated as candidate defect regions.
[0026] To correct signal distortion caused by uneven refractive index in the fabric, the gray-level gradient of the candidate region pixels is first calculated using the Sobel operator, and then substituted into the local refractive index correction model: ,in, For local correction of refractive index, The basic refractive index of the fabric, such as 1.53 for cotton fabrics. The grayscale gradient is input. After inputting the grayscale gradient and the base refractive index, and outputting the corrected refractive index, the corrected light intensity is calculated using the Rayleigh scattering formula: ,in, =30° is the scattering angle. =300mm is the distance between the camera and the fabric, outputting a light intensity image that truly reflects the characteristics of the defects.
[0027] Finally, enhancement and denoising are performed. Adaptive histogram equalization with 8×8 sub-blocks and a contrast limit threshold of 2.0 is applied to the light intensity image to improve the contrast between defects and the background. Gaussian noise is then removed by nonlocal mean filtering with a 15×15 search window and a smoothing parameter of 10, while preserving the edges of defects.
[0028] In this embodiment, the processing module is implemented by FPGA and ARM in collaboration. Multimodal data is transmitted to FPGA via AXI4 bus, and polarization degree calculation and gray level gradient solution are completed in parallel. ARM performs Rayleigh scattering calculation, FPGA accelerates equalization and filtering processing, and the purified feature image is transmitted to decomposition module through shared memory, thereby improving the identification of defect features.
[0029] The decomposition module is used to perform local texture complexity analysis on the feature image, adaptively select wavelet parameters and filter high-frequency sub-bands, and output a preliminary image of defect features. Furthermore, the output of the preliminary image of defect features specifically includes the following steps: The purified feature image is divided into preset pixel blocks, and the texture complexity of each pixel block is calculated. Based on the texture complexity threshold, the wavelet basis function and the number of decomposition layers are selected, and wavelet packet decomposition is performed on the purified feature image to obtain wavelet packet subbands; The entropy value of each wavelet subband is calculated based on the Renyi entropy criterion. High-frequency subbands with preset entropy values are selected and reconstructed to output a preliminary image of defect features.
[0030] Furthermore, based on the Renyi entropy criterion, the entropy value of each wavelet packet subband is calculated, and high-frequency subbands with preset entropy values are selected. This specifically includes the following steps: Calculate the sum of squares of pixel grayscale values for each wavelet subband to obtain the energy value of each subband; Calculate the ratio of the energy value of a single subband to the sum of the energy values of all wavelet packet subbands to obtain the energy proportion of each subband; Set the order of Renyi entropy, substitute the energy proportion as the probability term in the Renyi entropy formula, and calculate the entropy value of each wavelet packet. Set an entropy value filtering threshold, and identify subbands with entropy values greater than the filtering threshold as high-frequency subbands.
[0031] Specifically, the decomposition module separates the residual texture background from the high-frequency features of defects in the cleaned feature image. It then improves the accuracy of defect feature extraction by using local texture adaptive matching parameters. The specific process is as follows: First, the purified feature image is divided into preset pixel blocks, typically 8×8 pixel blocks, to balance texture representation accuracy and computational efficiency. Then, the texture complexity of each pixel block is calculated to quantify the drasticness of grayscale changes, using the following formula: ,in, For texture complexity, =64, total number of pixels in an 8×8 pixel block A set of pixel blocks The pixel grayscale gradient is derived from the Sobel operator result in the processing module. The grayscale gradient data is input, and the texture complexity is output to distinguish between high and low texture complexity regions.
[0032] A texture complexity threshold of 0.3 is set, and wavelet parameters are adaptively selected: for regions with C ≥ 0.3, a db8 wavelet basis and 5 decomposition layers are chosen to suit the needs of dense texture separation; for regions with C < 0.3, a sym5 wavelet basis and 3 decomposition layers are chosen to balance separation effect and efficiency. Wavelet packet decomposition is performed based on the selected parameters, decomposing the image signal into full-frequency subbands. High-frequency subbands correspond to defect features, while mid- and low-frequency subbands correspond to residual textures.
[0033] Further filtering of high-frequency sub-bands using the Renyi entropy criterion: First, calculate the sum of squared gray levels of pixels in each sub-band to obtain the energy value; then, calculate the ratio of the energy of a single sub-band to the total energy, i.e., the energy proportion, which is used as the probability term in the entropy formula. The Renyi entropy calculation formula is: ,in, Entropy is a value that characterizes the richness of signal information; the high-frequency subbands of defects have higher entropy values. =2, the optimal order as determined by calibration. The total number of sub-bands, For the first The energy percentage of each sub-band is input. After outputting the entropy value based on the energy percentage, an entropy value filtering threshold is set. Sub-bands with entropy values greater than the threshold are defined as high-frequency sub-bands. Through inverse wavelet packet transform, a preliminary image of defect features is obtained.
[0034] In this embodiment, the purified image is transmitted to the ARM module via shared memory, where pixel block partitioning, texture complexity calculation, wavelet packet decomposition, Renyi entropy filtering, and reconstruction are performed sequentially. Finally, the preliminary image of defect features is transmitted to the enhancement module via the internal bus, effectively removing residual texture.
[0035] The enhancement module is used to perform image enhancement processing on the preliminary image of defect features and output the enhanced feature image; Furthermore, the output of the enhanced feature image specifically includes the following steps: Perform contrast-limited adaptive histogram equalization on the preliminary image of defect features, set the pixel block size and contrast limit threshold, and obtain a contrast-enhanced image; The Laplacian operator is used to perform edge enhancement processing on the contrast-enhanced image to obtain the edge-enhanced image; The contrast-enhanced image and the edge-enhanced image are weighted and fused according to a preset ratio based on pixel grayscale values, and the enhanced feature image is output.
[0036] Specifically, the enhancement module addresses the issues of insufficient contrast and blurred edges in the initial image of defect features output by the decomposition module. Through combined enhancement processing, it highlights the overall features and edge details of the defects, laying the foundation for the subsequent separation module to accurately construct a high-dimensional feature matrix. The specific process is as follows: First, contrast-limited adaptive histogram equalization is performed on the preliminary image of the defect features. Generally, the pixel block size is set to 8×8 to balance effect and efficiency, and the contrast limit threshold is set to 2.0 to suppress noise amplification. After calibration with multiple sets of samples, the Laplacian operator is then used for edge enhancement. This operator uses second-order difference to capture regions of abrupt gray-level changes and strengthen the edges of defects. The operator formula is: ,in, To enhance the grayscale values of image pixels at the edges, To enhance the contrast of the corresponding pixel grayscale values in the image, , This represents the grayscale value of a neighboring pixel. It takes the grayscale value of the contrast-enhanced image as input and outputs the edge-enhanced image, significantly improving the grayscale value of defect edges and making the contours clearer.
[0037] Finally, the two images are weighted and merged according to a preset ratio, taking into account both overall features and edge details. The fusion formula is as follows: ,in, The grayscale values of the merged pixels. To enhance image weighting coefficients for contrast enhancement, in some embodiments... Setting it to 0.7 retains 70% contrast features and 30% edge features, balancing the advantages of both.
[0038] In this embodiment, the preliminary image of the defect features is transmitted to the FPGA via the internal bus, and the equalization IP core, Laplacian convolution template, and fusion hardware logic are called sequentially to complete the processing. The enhanced feature image is stored in shared memory via the AXI4 bus for the separation module to call, and the grayscale difference and edge sharpness of the defects are improved.
[0039] The separation module is used to construct a high-dimensional feature matrix from the enhanced feature image, and outputs a pure defect feature set after kernel space mapping and low-dimensional manifold construction. Furthermore, the specific steps for outputting the pure defect feature set are as follows: The enhanced feature image is divided into preset pixel blocks, and the preset dimension features of each pixel block are extracted to construct a high-dimensional feature matrix. A high-dimensional feature matrix is mapped to a high-dimensional kernel space using radial basis functions to construct a kernel matrix; The kernel space distance between each eigenvector and other eigenvectors is calculated based on the kernel matrix, and a set number of neighborhood samples are selected for each eigenvector in the high-dimensional feature matrix. The local weight matrix is calculated based on the kernel space relationship between the neighborhood samples and the corresponding feature vectors. The low-dimensional mapping is solved by eigenvalue decomposition, and the pure defect feature set is output.
[0040] Specifically, the separation module addresses the coupling problem between residual background and features in the enhanced image, achieving complete separation of defects and residual background features. The specific process is as follows: First, the enhanced image is divided into 8×8 pixel blocks. 18-dimensional features are extracted from each pixel block to construct a high-dimensional feature matrix, with each row corresponding to the feature vector of one pixel block. A radial basis function is then used to map the high-dimensional matrix to a high-dimensional kernel space, resolving the linear inseparability of features in the original space. The formula is as follows: ,in, Characterizes the similarity of the kernel space of two eigenvectors. , It is a high-dimensional feature vector. =0.01 adjusts the mapping range; inputs a high-dimensional matrix and outputs a kernel matrix.
[0041] The kernel space distance is calculated based on the kernel matrix. For each feature vector, 10 neighborhood samples with the smallest distance are selected. The local weight matrix is calculated according to the kernel space relationship. The low-dimensional mapping is solved by eigenvalue decomposition, and a 3-dimensional pure defect feature set is output, which reduces the amount of subsequent calculation.
[0042] In this embodiment, the enhanced image is transmitted via shared memory, and feature construction, kernel mapping, and dimensionality reduction are completed sequentially. The pure defect feature set is transmitted to the detection module through the internal bus to remove residual background interference.
[0043] The detection module is used to detect images corresponding to pure defect feature sets and output detection results including defect classification results, location coordinates and detection confidence. Furthermore, the output includes the defect classification results, location coordinates, and detection confidence level, specifically including the following steps: The image corresponding to the pure defect feature set is scaled to a preset input size, and the pixel grayscale values are normalized to obtain the model input image. The YOLOv5 object detection model is used to process the input image. The classification branch outputs the probability distribution of defect types, and the regression branch outputs the position coordinates including the bounding box coordinates of the defects. The classification results of defects are determined based on probability distribution, and the probability values corresponding to the classification results are extracted as the detection confidence level.
[0044] Specifically, the detection module converts the images corresponding to the pure defect feature set into quantitative detection results, providing reliable observations for the optimization module, and realizing accurate identification and location of defects in waste fabrics. The specific process is as follows: First, the image corresponding to the pure defect feature set is preprocessed: the image is scaled to a preset size of 640×640 to fit the YOLOv5 model, balancing detection speed and accuracy; then, grayscale values are normalized using the following formula: ,in, The grayscale value after normalization. The original grayscale value. , The minimum and maximum gray values of the scaled image are used to standardize the gray range and improve the stability of the model input.
[0045] After preprocessing, the input image is obtained and input into a YOLOv5 model specifically trained for defects in waste fabrics. The model extracts multi-scale features through the backbone network and fuses features through the neck network. The classification branch outputs the probability distribution of defect types, and the regression branch outputs the bounding box coordinates. The type corresponding to the highest probability in the probability distribution is selected as the classification result, and this probability value is used as the detection confidence to ensure the reliability of the results.
[0046] The optimization module is used to build a Bayesian posterior probability model with the detection results as observations. After iterative optimization, the final optimized detection results are output and visualized.
[0047] Furthermore, the final optimized detection result is output through the following steps: Using the detection confidence, detection rate, and false detection rate as observations, a Bayesian posterior probability model is constructed, which includes the fractional order, refractive index correction coefficient, kernel function parameters, and wavelet packet decomposition level. The Markov chain Monte Carlo algorithm is used to sample the Bayesian posterior probability model, obtain parameter combinations, and adjust the corresponding parameters according to the detection results; When the detection confidence of a set number of consecutive frames reaches a set threshold, the corresponding parameters converge and the optimized detection result is output; otherwise, the detection is re-executed through the processing module.
[0048] Furthermore, obtaining parameter combinations and adjusting the corresponding parameters based on the detection results specifically includes the following steps: Initialization: Initialize the initial parameter values of the Markov chain and use the parameter combination corresponding to the initial parameter values as the initial current parameter combination. The initial parameter values include at least the preset initial values of fractional order, refractive index correction coefficient, kernel function parameters, and wavelet packet decomposition level. Generate calculation: Generate candidate parameter combinations based on a preset step size, substitute the candidate parameter combinations into the Bayesian posterior probability model, and calculate the candidate posterior probability value. At the same time, substitute the current parameter combination into the Bayesian posterior probability model and calculate the current posterior probability value. Ratio calculation: Calculate the ratio of the candidate posterior probability value to the current posterior probability value to obtain the acceptance probability; Acceptance judgment: When the acceptance probability is greater than the preset random probability threshold, the candidate parameter combination is accepted as the current parameter combination. When the acceptance probability is less than or equal to the preset random probability threshold, the current parameter combination is retained, and the generation calculation, ratio calculation and acceptance judgment steps are repeated until the number of samples reaches the preset threshold to obtain the parameter combination. Parameter adjustment: When the detection rate in the current detection results is lower than the preset detection rate threshold, adjust the wavelet packet decomposition layer number and fractional order. When the false detection rate is higher than the preset false detection rate threshold, adjust the kernel function parameters and refractive index correction coefficient. Specifically, the optimization module addresses the issue that fixed parameters are difficult to adapt to waste fabrics of different materials and wear levels. It iteratively optimizes core parameters through test results to ensure stable test accuracy, and finally outputs optimized test results for visualization. The specific process is as follows: First, using the detection confidence, detection rate, and false positive rate as observed values, a Bayesian posterior probability model is constructed, including fractional order, refractive index correction coefficient, kernel function parameters, and wavelet packet decomposition level. The core formula is: ,in, The posterior probability characterizes a given observation. Time parameter combination Credibility, For the parameter combination to be optimized, For the set of observations, Let be the likelihood function. The prior probability is set based on historical data. This represents the marginal probability of a constant term. Input the observed values and prior distribution, output the posterior probability of the parameters, and locate the optimal parameter combination.
[0049] The Markov chain Monte Carlo algorithm is used for sampling optimization: In the initialization step, the fractional order (0.6), refractive index correction coefficient (1.02), kernel function parameter (0.01), and wavelet packet decomposition level (4) are set as the initial parameter combination, based on pre-detection calibration to ensure fast convergence; in the generation calculation step, candidate parameter combinations are generated with a step size of 0.05, and substituted into the model to calculate the candidate and current posterior probability values; the ratio is used to calculate the acceptance probability. ,in To accept probability, Candidate parameters, The current parameters are used; when accepting a judgment, a random number between 0 and 1 is generated. If the number is greater than the threshold, the parameters are updated, and the sampling is repeated 1000 times until the optimal combination is obtained. In the parameter adjustment stage, if the detection rate is lower than the threshold, the number of decomposition layers or the fractional order is increased to enhance feature extraction. If the false detection rate is too high, the kernel function parameters or the refractive index correction coefficient are optimized to improve the separation accuracy. When the detection confidence is ≥0.9 for 10 consecutive frames, the parameters converge and the optimized result is output; if the target is not met, the process is returned to the processing module to re-execute the process.
[0050] Example 2: In a second embodiment of the present invention, the present invention provides a method for inspecting fabrics to identify defects in waste fabrics, such as... Figure 2 As shown, it includes the following steps: Acquire multispectral polarization image data of waste fabrics and construct a multimodal data matrix; The multimodal data matrix is subjected to polarization state filtering, local refractive index correction and enhanced denoising processing to output a purified feature image. Local texture complexity analysis is performed on the feature image, wavelet parameters are adaptively selected and high-frequency sub-bands are filtered, and a preliminary image of defect features is output. The preliminary image of defect features is subjected to image enhancement processing, and the enhanced feature image is output. A high-dimensional feature matrix is constructed from the enhanced feature image, and then a pure defect feature set is output through kernel space mapping and low-dimensional manifold construction. The system detects images corresponding to pure defect feature sets and outputs detection results including defect classification results, location coordinates, and detection confidence. A Bayesian posterior probability model is constructed using the detection results as observations. After iterative optimization, the final optimized detection results are output and visualized.
[0051] In the testing of large-scale waste fabric recycling production lines, the recycled fabrics encompass various materials such as cotton, linen, and synthetic fibers, exhibiting complex defects including stains, fiber breaks, and holes. Furthermore, the degree of fabric wear varies significantly. Existing testing methods are prone to high rates of missed and false detections due to inaccurate feature extraction and poor parameter adaptability, making it difficult to meet the efficiency and accuracy requirements of batch testing. To address these issues, this invention provides a method for identifying defects in waste fabrics, the process of which is as follows: Figure 2 As shown. The specific implementation process of this method is as follows: First, multispectral polarization image data of waste fabrics are acquired to construct a multimodal data matrix. Specifically, multi-band spectral acquisition equipment is used in conjunction with a polarization imaging module that covers all angles to acquire data simultaneously, and the matrix is integrated according to pixel coordinates. This comprehensively captures the multidimensional optical feature differences between defects and the background, laying the foundation for accurate differentiation.
[0052] Subsequently, the multimodal data matrix undergoes polarization state screening, local refractive index correction, and enhanced denoising. First, the pixel polarization degree is calculated using the polarization degree formula, and a preset polarization degree threshold is set to screen candidate defect areas. Then, the grayscale gradient is calculated using the Sobel operator, substituted into the correction model to obtain the corrected refractive index, and the corrected light intensity is calculated using the Rayleigh scattering formula. Finally, adaptive histogram equalization with a matching pixel block size and nonlocal mean filtering with a corresponding window size are performed to output a cleaned feature image, effectively removing interference and correcting signal distortion.
[0053] Next, local texture complexity analysis is performed on the purified feature image. The image is divided into pixel blocks, and a texture complexity threshold is set. For texture complexity exceeding the threshold, a suitable wavelet basis function and corresponding decomposition level are selected; for texture complexity below the threshold, another suitable wavelet basis function and corresponding decomposition level are selected. High-frequency sub-bands are selected and reconstructed based on the Renyi entropy criterion, outputting a preliminary image of defect features, thus achieving accurate separation of defects and residual texture.
[0054] Then, enhancement processing is performed on the preliminary image of defect features. Equalization is achieved using an appropriate pixel block size and contrast limit threshold. Edge enhancement is performed using a two-dimensional discrete Laplacian operator. The two images are fused according to preset weight coefficients to output an enhanced feature image, simultaneously improving grayscale differences and edge sharpness.
[0055] Next, a high-dimensional feature matrix is constructed from the enhanced feature image. Multi-dimensional texture features are extracted according to the set pixel blocks, mapped to the high-dimensional kernel space using radial basis functions, the kernel space distance is calculated and neighborhood samples are selected, and a low-dimensional pure defect feature set is obtained through eigenvalue decomposition, completely removing residual background interference.
[0056] Next, the image corresponding to the pure defect feature set is scaled, and gray values are mapped according to the normalization formula. The image is then input into a specially trained YOLOv5 model, and the output includes the defect classification results, location coordinates, and detection confidence, thus achieving accurate positioning and real-time reliable detection.
[0057] Finally, a Bayesian posterior probability model was constructed using the detection confidence, detection rate, and false detection rate as observations, and iteratively optimized using a Markov chain Monte Carlo algorithm. Initial parameters were set as fractional order, refractive index correction coefficient, etc. Candidate parameters were generated according to a step size, and adjusted after a preset number of samplings. When the detection confidence reached a set threshold for a consecutive set number of frames, the optimized result was output and displayed on an industrial touchscreen, dynamically adapting to the detection needs of different fabrics and ensuring stable and consistent detection accuracy.
[0058] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A fabric inspection system for identifying defects in waste fabrics, characterized in that, include: The acquisition module is used to acquire multispectral polarization image data of waste fabrics and construct a multimodal data matrix; The processing module is used to perform polarization state filtering, local refractive index correction and enhanced noise reduction on the multimodal data matrix, and output the purified feature image. The decomposition module is used to perform local texture complexity analysis on the feature image, adaptively select wavelet parameters and filter high-frequency sub-bands, and output a preliminary image of defect features. The enhancement module is used to perform image enhancement processing on the preliminary image of the defect features and output the enhanced feature image; The separation module is used to construct a high-dimensional feature matrix from the enhanced feature image, and output a pure defect feature set after kernel space mapping and low-dimensional manifold construction. The detection module is used to detect the image corresponding to the pure defect feature set and output the detection result including defect classification result, location coordinates and detection confidence. The optimization module is used to construct a Bayesian posterior probability model with the detection results as observations, iteratively optimize the model, output the final optimized detection results, and visualize them.
2. The fabric inspection system for identifying defects in waste fabrics according to claim 1, characterized in that: The multispectral polarization image data includes at least image data of waste fabric under spectral channels and polarization angles. The spectral channels include at least blue, green, red, and near-infrared spectra of preset wavelengths. The polarization angles are polarization angles with a step size of 15° within the range of 0°-180°. The construction of the multimodal data matrix involves converting the acquired multispectral polarization image data into a format and constructing a multimodal data matrix with dimensions including image height, image width, number of spectral channels, and number of polarization angles.
3. The fabric inspection system for identifying defects in waste fabrics according to claim 1, characterized in that: The output purified feature image specifically includes the following steps: Calculate the polarization degree of each pixel in the multimodal data matrix, set a polarization degree threshold, and filter out candidate defect areas; The pixel grayscale gradient within the candidate defect region is calculated using the Sobel operator, and then substituted into the local refractive index correction model to obtain the local corrected refractive index. The intensity of the scattered light after correction is calculated by combining the locally corrected refractive index with the Rayleigh scattering formula, and the light intensity image is obtained. Adaptive histogram equalization is performed on the light intensity image, and then Gaussian noise is removed by nonlocal mean filtering to output the purified feature image.
4. The fabric inspection system for identifying defects in waste fabrics according to claim 1, characterized in that: The output of the preliminary image of defect features specifically includes the following steps: The purified feature image is divided into preset pixel blocks, and the texture complexity of each pixel block is calculated. Based on the texture complexity threshold, the wavelet basis function and the number of decomposition layers are selected, and wavelet packet decomposition is performed on the purified feature image to obtain wavelet packet subbands; The entropy value of each wavelet subband is calculated based on the Renyi entropy criterion. High-frequency subbands with preset entropy values are selected and reconstructed to output a preliminary image of defect features.
5. The fabric inspection system for identifying defects in waste fabrics according to claim 4, characterized in that: The calculation of the entropy value of each wavelet packet sub-band based on the Renyi entropy criterion, and the selection of high-frequency sub-bands with preset entropy values, specifically includes the following steps: Calculate the sum of squares of pixel grayscale values for each wavelet subband to obtain the energy value of each subband; Calculate the ratio of the energy value of a single subband to the sum of the energy values of all wavelet packet subbands to obtain the energy proportion of each subband; Set the order of Renyi entropy, substitute the energy proportion as the probability term in the Renyi entropy formula, and calculate the entropy value of each wavelet packet. Set an entropy value screening threshold, and determine the subbands with entropy values greater than the screening threshold as high-frequency subbands.
6. The fabric inspection system for identifying defects in waste fabrics according to claim 1, characterized in that: The enhanced feature image output specifically includes the following steps: Perform contrast-limited adaptive histogram equalization on the preliminary image of the defect features, set the pixel block size and contrast limit threshold, and obtain a contrast-enhanced image; The Laplacian operator is used to perform edge enhancement processing on the contrast-enhanced image to obtain an edge-enhanced image; The contrast-enhanced image and the edge-enhanced image are weighted and fused according to a preset ratio based on pixel grayscale values to output the enhanced feature image.
7. The fabric inspection system for identifying defects in waste fabrics according to claim 1, characterized in that: The output pure defect feature set specifically includes the following steps: The enhanced feature image is divided into preset pixel blocks, and the preset dimension features of each pixel block are extracted to construct a high-dimensional feature matrix; The high-dimensional feature matrix is mapped to a high-dimensional kernel space using radial basis functions to construct a kernel matrix; Based on the kernel matrix, calculate the kernel space distance between each feature vector and other feature vectors, and select a set number of neighborhood samples for each feature vector in the high-dimensional feature matrix; The local weight matrix is calculated based on the kernel space relationship between the neighborhood samples and the corresponding feature vectors. The low-dimensional mapping is solved by eigenvalue decomposition, and the pure defect feature set is output.
8. The fabric inspection system for identifying defects in waste fabrics according to claim 1, characterized in that: The output includes defect classification results, location coordinates, and detection confidence scores, specifically including the following steps: The image corresponding to the pure defect feature set is scaled to a preset input size, and the pixel grayscale values are normalized to obtain the model input image. The YOLOv5 object detection model is used to process the input image of the model. The classification branch outputs the probability distribution of defect types, and the regression branch outputs the position coordinates including the coordinates of the defect bounding box. The classification result of the defect is determined based on the probability distribution, and the probability value corresponding to the classification result is extracted as the detection confidence level.
9. The fabric inspection system for identifying defects in waste fabrics according to claim 1, characterized in that: The output of the final optimized detection result specifically includes the following steps: Using the detection confidence, detection rate, and false detection rate as observations, a Bayesian posterior probability model is constructed, which includes the fractional order, refractive index correction coefficient, kernel function parameters, and wavelet packet decomposition level. The Markov chain Monte Carlo algorithm is used to sample the Bayesian posterior probability model, obtain parameter combinations, and adjust the corresponding parameters according to the detection results; When the detection confidence of a set number of consecutive frames reaches a set threshold, the corresponding parameters converge and the optimized detection result is output; otherwise, the detection is re-executed through the processing module.
10. The fabric inspection system for identifying defects in waste fabrics according to claim 9, characterized in that: The process of acquiring parameter combinations and adjusting corresponding parameters based on detection results specifically includes the following steps: Initialization: Initialize the initial parameter values of the Markov chain, and use the parameter combination corresponding to the initial parameter values as the initial current parameter combination. The initial parameter values include at least the preset initial values of fractional order, refractive index correction coefficient, kernel function parameters, and wavelet packet decomposition layer number. Generate calculation: Generate candidate parameter combinations based on a preset step size, substitute the candidate parameter combinations into the Bayesian posterior probability model, and calculate the candidate posterior probability value. At the same time, substitute the current parameter combination into the Bayesian posterior probability model and calculate the current posterior probability value. Ratio calculation: Calculate the ratio of the candidate posterior probability value to the current posterior probability value to obtain the acceptance probability; Acceptance judgment: When the acceptance probability is greater than the preset random probability threshold, the candidate parameter combination is accepted as the current parameter combination. When the acceptance probability is less than or equal to the preset random probability threshold, the current parameter combination is retained, and the generation calculation, ratio calculation and acceptance judgment steps are repeated until the number of samplings reaches the preset threshold to obtain the parameter combination. Parameter adjustment: When the detection rate in the current detection results is lower than the preset detection rate threshold, adjust the wavelet packet decomposition layer and fractional order. When the false detection rate is higher than the preset false detection rate threshold, adjust the kernel function parameters and refractive index correction coefficient.