Fabric defect identification system based on AI
Through the AI-based fabric defect identification system, the dynamic changes of the fabric are monitored in real time and combined with image analysis, which solves the problem of inaccurate defect identification in the existing technology and achieves more efficient defect identification and quality control.
Patent Information
- Application Number
- CN202410726250.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-06-06
AI Technical Summary
Existing optical detection technology is difficult to respond to dynamic changes in fabrics in real time during fabric defect identification, resulting in inaccurate and delayed defect identification, affecting production efficiency and quality control.
An AI-based fabric defect identification system is used to collect tension and pressure readings in real time through the fabric dynamic monitoring module. It combines nonlinear behavior analysis and image gradient monitoring modules to generate defect identification signals, and performs deep local perception analysis through the enhanced learning optimization module to achieve Accurate identification and reconstruction of defects.
It improves the accuracy of fabric defect prediction, ensures early detection and efficient processing of defects, and significantly improves the quality control and efficiency of the production line.
Smart Images

Figure CN118747731A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of optical detection technology, and in particular to an AI-based fabric defect recognition system. Background Art
[0002] Optical inspection is a method of analyzing and measuring the characteristics of an object using optical instruments and techniques. It involves the use of various light sources (such as visible light, infrared, ultraviolet light) and optical equipment (such as microscopes, cameras, sensors) to capture and analyze light reflected, transmitted or emitted from an object. Optical inspection technology is widely used in industrial quality control, medical diagnosis, environmental monitoring and other fields, and can non-invasively detect the structure and defects on the surface or inside of an object. By analyzing the absorption, scattering, polarization and other characteristics of light, optical inspection can provide detailed information about material composition, structural integrity and other important characteristics.
[0003] Among them, the fabric defect recognition system is an optical inspection technology specifically used in the textile industry, mainly used to automatically detect and identify defects in fabrics, such as holes, stains, yarn errors, etc. This system usually includes high-resolution camera equipment and image processing software, which can analyze fabrics in real time on the production line, thereby improving production efficiency and quality control. By instantly identifying and classifying fabric defects, the fabric defect recognition system helps reduce waste and defective products, optimize resource utilization, and ensure product quality.
[0004] Existing optical inspection technologies are often unable to handle subtle defects in fabric defect identification due to technical limitations. Although they can capture and analyze the light emitted by objects, traditional methods often fail to respond to dynamic changes in fabrics, such as fluctuations in tension and pressure, in real time in the face of rapidly changing production conditions and the complexity of fabrics. In addition, traditional optical equipment and image processing software may not be able to continuously provide high-precision data in high-speed production environments, resulting in inaccurate and delayed defect identification. These limitations not only affect production efficiency, but may also lead to resource waste and quality control issues, especially in large-scale production, where defects that are not identified and handled in a timely manner can lead to significant economic losses. Summary of the invention
[0005] The purpose of the present invention is to solve the shortcomings of the prior art and propose a fabric defect recognition system based on AI.
[0006] In order to achieve the above-mentioned purpose, the present invention adopts the following technical scheme: A fabric defect recognition system based on AI comprises:
[0007] The fabric dynamic monitoring module collects the tension and pressure readings on the fabric production line, calculates the change amplitude of the readings in real time, and performs behavior trend analysis. It builds a preliminary model of fabric behavior based on trend changes and obtains a behavior prediction model.
[0008] The nonlinear behavior analysis module uses numerical simulation technology to perform time series analysis on the data in the behavior prediction model, extract periodicity and abnormal fluctuations, draw a defect possibility map based on the periodicity and abnormal fluctuations, locate the predicted defect dynamics, and generate a defect recognition signal;
[0009] The image gradient monitoring module performs pixel-level gradient analysis on the fabric image, detects the high gradient change area in the image, obtains gradient change data, compares the gradient change data with the defect recognition signal, identifies the defect position associated with the high gradient change, and generates a key defect position map;
[0010] The reinforcement learning optimization module adjusts the network parameters according to the defect area marked in the key defect location map, applies the adjusted network parameters to perform deep local perception analysis on the defect area, reconstructs the defect detail information in the image, and generates a defect reconstruction result.
[0011] As a further solution of the present invention, the steps of acquiring the behavior prediction model are specifically as follows:
[0012] The monitoring equipment collects the tension readings z and pressure readings p on the fabric production line using the formula:
[0013]
[0014] Calculate the change range of the readings and generate a change range result;
[0015] Among them, Δx represents the change amplitude, z i represents the ith tension reading, Indicates the average value of tension readings, p i represents the ith pressure reading, represents the average value of the pressure readings, n represents the total number of readings, and w z 、w p are the weight factors for tension and pressure, respectively;
[0016] For the above mentioned change results, exponential smoothing method is applied to conduct trend analysis, using the formula:
[0017]
[0018] Analyze the behavioral trend of the change range and generate trend analysis results;
[0019] Among them, T t represents the trend value at time t, x t Represents the change amplitude data at time t, T t-1 represents the trend value at time t-1, w1 and w2 are weight factors, and β is the adjustment coefficient;
[0020] The trend analysis results were applied to a linear regression model using the regression formula:
[0021]
[0022] Calculate a preliminary model of fabric behavior to obtain a behavior prediction model;
[0023] Where M represents the behavior prediction model, T i represents the trend analysis results of the differentiated time points, γ i represents the regression coefficient at multiple time points, λ i is the adjustment factor.
[0024] As a further solution of the present invention, the step of extracting periodicity and abnormal fluctuations is specifically:
[0025] Analyze the time series data in the behavior prediction model and use the residual calculation formula:
[0026]
[0027] Calculate the residuals of the time series and generate a residual sequence;
[0028] Among them, R t represents the residual at time t, x t represents the actual observed value at time t, represents the current moment value predicted by the model at the previous moment, c represents the periodic amplitude, and ω represents the periodic frequency;
[0029] The autocorrelation function and partial autocorrelation function are applied to analyze the residual sequence, using the formula:
[0030]
[0031] Identify dependency patterns in time series and generate dependency pattern analysis;
[0032] Among them, ACF(k) represents the k-order autocorrelation function value, PACF(k) represents the k-order partial autocorrelation function value, R t is the residual at time t, is the residual mean, n is the sample size, and k is the lag order;
[0033] Using the dependency pattern analysis, combined with time series decomposition, the formula is adopted:
[0034]
[0035] Locate the predicted defect dynamics, generate periodic and abnormal fluctuations;
[0036] Among them, St represents the seasonal component in the time series, R t-i represents the residual before the moment, α i , β j are the weight coefficients of seasonal and random components, ∈ t-j represents the error term before time j, p and q are the model orders of seasonal and random components respectively.
[0037] As a further solution of the present invention, the step of acquiring the defect recognition signal is specifically as follows:
[0038] Based on the periodic and abnormal fluctuation data described in time series analysis, the data is converted into a graphical representation using visualization technology, using the formula:
[0039]
[0040] Generate defect probability map;
[0041] Among them, G represents the defect possibility map, α t Adjust the intensity of the graph at each time point, δ t Used to enhance the sensitivity of graphics to data, γ t ,ω t Adjust for cyclical effects;
[0042] Image processing technology is applied to the defect possibility map to perform edge detection and key change point analysis, using the formula:
[0043]
[0044] Locate significant changes in the map and generate dynamic defect location results;
[0045] Among them, D t represents the dynamic location of the defect at time t, is the time second derivative of the spectrum, is the first-order derivative, κ is the weighting factor;
[0046] According to the defect dynamic positioning results, the probability analysis method formula is adopted:
[0047]
[0048] Dynamically provide differentiated response strength for each identified defect to generate a defect identification signal;
[0049] Among them, R represents the defect recognition signal, β i is the corresponding weight factor, and m is the number of identified defect points.
[0050] As a further solution of the present invention, the step of obtaining the gradient change data is specifically as follows:
[0051] Perform pixel-level gradient analysis on the fabric image and apply the gradient calculation formula:
[0052]
[0053] Generate preliminary gradient data;
[0054] Where I represents the pixel intensity of the image, x and y are the pixel coordinates, and G(x,y) represents the gradient intensity of each pixel. is the first-order derivative, representing the rate of change of the image in the horizontal and vertical directions. is the second-order derivative, reflecting the acceleration of the change, and ξ is the weight that adjusts these second-order effects;
[0055] The high-change area is detected on the preliminary gradient data using a threshold filtering formula:
[0056] H(x,y)=ifG(x,y)>θthen1else0
[0057] Generate data for areas with high gradient changes;
[0058] Among them, H(x,y) represents the gradient area after threshold processing, and θ is the cutoff threshold that determines the high gradient change;
[0059] The data of the high gradient change area are statistically analyzed, and the statistical characteristics are calculated to characterize the characteristics of the overall gradient change, using the formula:
[0060]
[0061] Obtain the average gradient value of the high gradient area and obtain the gradient change data;
[0062] Where V represents the average gradient value of the high gradient area.
[0063] As a further solution of the present invention, the step of obtaining the key defect position map is specifically as follows:
[0064] The gradient change data is analyzed and compared with the defect recognition signal, using the correlation analysis formula:
[0065] C(x,y)=H(x,y)×S(x,y)×log(1+∈·G(x,y))
[0066] Generate defect and gradient correlation data;
[0067] Among them, C(x,y) represents the correlation strength between the gradient and the defect signal, S(x,y) is the defect identification signal, and ∈ is a parameter to enhance the influence of small changes;
[0068] The output of the defect and gradient correlation data is spatially screened to determine the key defect location, using the threshold decision formula:
[0069] D(x,y)=ifC(x,y)>θthen1else0
[0070] generating defect location data;
[0071] Where D(x,y) represents the defect location decision result, and θ is the threshold used to identify defects;
[0072] The defect position determined according to the defect position data adopts the visual enhancement formula:
[0073] K=∑ x,y D(x,y)×φ(x,y)
[0074] Generate a map of key defect locations;
[0075] Among them, K is the key defect location map, and φ(x,y) is the visual enhancement function.
[0076] As a further solution of the present invention, the step of obtaining the defect reconstruction result is specifically:
[0077] Using the defect area data identified in the key defect location map, the parameters of the neural network are adjusted to match the defect characteristics, and the parameter adjustment formula is applied:
[0078] P new =P old ×(1+α·tanh(β·D var ))
[0079] Generate adjusted network parameters;
[0080] Among them, P new is the adjusted network parameter, P old are the previous parameters, α and β adjust the sensitivity and rate of parameter adjustment, D var is the gradient variance calculated from the defect location map;
[0081] Using the adjusted network parameters, deep local perception analysis is performed on the defect area, using the deep learning analysis formula:
[0082]
[0083] Generate analysis results of defective areas;
[0084] in, is the adjusted weight matrix, I x+i,y+j represents the pixel value of the defect area, σ is a nonlinear activation function, and A(x,y) represents the analysis result of the defect area;
[0085] According to the analysis results of the defect area, the defect details in the image are reconstructed using the image reconstruction formula:
[0086] R=∫∫A(x,y)·φ(x,y,γ)dxdy
[0087] Generate defect reconstruction results;
[0088] Among them, φ(x, y, γ) is the image enhancement function adjusted based on the defect characteristics, γ is the enhancement coefficient, and R represents the defect reconstruction result.
[0089] Compared with the prior art, the advantages and positive effects of the present invention are:
[0090] In the present invention, the accuracy of fabric defect prediction is enhanced by implementing real-time dynamic monitoring and advanced numerical simulation. The dynamic data provided by real-time monitoring allows the system to capture subtle changes in fabric production, while numerical simulation analyzes the periodicity and abnormal fluctuations of these data to find possible sources of defects. Combining gradient analysis and network parameter optimization, the system can accurately locate defects at the pixel level, achieving more accurate defect identification. This innovation in technical means, especially the deep integration of data processing and image analysis, ensures early detection and efficient processing of defects, thereby significantly improving the quality control and efficiency of the production line. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] Figure 1 is a system flow chart of the present invention;
[0092] Figure 2 A flowchart of the steps for obtaining the behavior prediction model of the present invention;
[0093] Figure 3 A flow chart of the steps of extracting periodicity and abnormal fluctuations of the present invention;
[0094] Figure 4 A flow chart of the steps of obtaining a defect recognition signal of the present invention;
[0095] Figure 5 A flow chart of the steps for obtaining gradient change data of the present invention;
[0096] Figure 6 A flowchart of the steps for obtaining a key defect location map of the present invention;
[0097] Figure 7 It is a flow chart of the steps of obtaining the defect reconstruction result of the present invention. DETAILED DESCRIPTION
[0098] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0099] In the description of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, in the description of the present invention, "multiple" means two or more, unless otherwise clearly and specifically defined.
[0100] Embodiment 1
[0101] See also Figure 1 , an AI-based fabric defect recognition system includes:
[0102] The fabric dynamic monitoring module collects the tension and pressure readings on the fabric production line, calculates the change amplitude of the readings in real time, and performs behavior trend analysis. It builds a preliminary model of fabric behavior based on trend changes and obtains a behavior prediction model.
[0103] The nonlinear behavior analysis module uses numerical simulation technology to perform time series analysis on the data in the behavior prediction model, extract periodicity and abnormal fluctuations, draw defect possibility maps based on periodicity and abnormal fluctuations, locate the predicted defect dynamics, and generate defect recognition signals;
[0104] The image gradient monitoring module performs pixel-level gradient analysis on the fabric image, detects the high gradient change area in the image, obtains gradient change data, compares the gradient change data with the defect recognition signal, identifies the defect location associated with the high gradient change, and generates a key defect location map;
[0105] The reinforcement learning optimization module adjusts the network parameters according to the defect area marked in the key defect location map, applies the adjusted network parameters to perform deep local perception analysis on the defect area, reconstructs the defect detail information in the image, and generates a defect reconstruction result.
[0106] The behavior prediction model includes tension trend, pressure trend, and behavior indicators. The defect recognition signal includes periodic indicators, abnormal indicators, and defect probability map. The key defect location map includes high gradient areas, defect contrast indicators, and key location markers. The defect reconstruction results include parameter adjustment information, perceived depth, and image detail clarity.
[0107] See also Figure 2 , the steps to obtain the behavior prediction model are as follows:
[0108] The monitoring equipment collects the tension readings z and pressure readings p on the fabric production line using the formula:
[0109]
[0110] Calculate the change range of the readings and generate a change range result;
[0111] Among them, Δx represents the change amplitude, z i represents the ith tension reading, Indicates the average value of tension readings, p i represents the ith pressure reading, represents the average value of the pressure readings, n represents the total number of readings, and w z 、w p are the weight factors for tension and pressure, respectively;
[0112] For the change amplitude results, the exponential smoothing method is used for trend analysis, using the formula:
[0113]
[0114] Analyze the behavioral trend of the change range and generate trend analysis results;
[0115] Among them, T t represents the trend value at time t, x t Represents the change amplitude data at time t, T t-1 represents the trend value at time t-1, w1 and w2 are weight factors, and β is the adjustment coefficient;
[0116] Apply the trend analysis results to the linear regression model using the regression formula:
[0117]
[0118] Calculate a preliminary model of fabric behavior to obtain a behavior prediction model;
[0119] Where M represents the behavior prediction model, T i represents the trend analysis results of the differentiated time points, γ i represents the regression coefficient at multiple time points, λ iis the adjustment factor.
[0120] Detailed derivation process of step 1
[0121] formula:
[0122]
[0123] Parameter details:
[0124] Δx: The comprehensive change amplitude, which indicates the degree of change in tension and pressure readings.
[0125] z i : The ith tension reading.
[0126] The average value of the tension readings.
[0127] p i : The ith pressure reading.
[0128] The average value of the pressure readings.
[0129] n: The total number of readings, set to 10 in this example.
[0130] w z : Weight factor of tension, assumed to be 0.6.
[0131] w p : Weight factor of pressure, assumed to be 0.4.
[0132] Calculation example:
[0133] Assume that the tension readings are z = [20, 22, 19, 21, 20, 18, 23, 21, 22, 20] and the pressure readings are p = [15, 16, 15, 14, 15, 16, 14, 15, 16]. Calculate the average:
[0134]
[0135] Calculate the comprehensive change amplitude Δx:
[0136]
[0137]
[0138] The final result Δx≈0.55 represents the comprehensive change magnitude.
[0139] Detailed derivation process of step 2
[0140] formula:
[0141]
[0142] Parameter details:
[0143] T t : Trend value at the moment.
[0144] x t : The comprehensive change amplitude data at the moment, obtained from step 1.
[0145] T t-1 : The trend value at time t-1, assuming the initial value is O.
[0146] w1,w2: weight factors, set to 0.7 and 0.3 respectively.
[0147] β: adjustment coefficient, set to 1.
[0148] Calculation example:
[0149] Assume that the current comprehensive change range x t =0.55 (obtained from step 1), initial value T t-1 =0.
[0150]
[0151] Final result t =0.55 represents the trend value at the current moment.
[0152] Detailed derivation process of step 3
[0153] formula:
[0154]
[0155] Parameter details:
[0156] M: Behavior prediction model.
[0157] T i : Trend analysis results at different time points, assuming the current value is 0.55.
[0158] γ i : The regression coefficient at each time point is set to a random value, such as [0.2, 0.3, 0.5].
[0159] λ i : Adjustment factor, set to a random value, such as [1,1.5,1.2].
[0160] γ0: basic coefficient, set to 0.1.
[0161] Calculation example:
[0162] Assume n = 3, and T i Both are 0.55, calculate M:
[0163] M=0.1+(0.2·0.55×1)+(0.3·0.55×1.5)+(0.5·0.55×1.2)
[0164] M=0.1+0.11+0.2475+0.33
[0165] M=0.7875
[0166] The final result M≈0.79 represents the output of the behavior prediction model and quantifies the impact of trend data on the prediction model.
[0167] See also Figure 3 , the steps of extracting periodicity and abnormal fluctuations are as follows:
[0168] Analyze the time series data in the behavior prediction model and use the residual calculation formula:
[0169]
[0170] Calculate the residuals of the time series and generate a residual sequence;
[0171] Among them, R t represents the residual at time t, x t represents the actual observed value at time t, represents the current moment value predicted by the model at the previous moment, c represents the periodic amplitude, and ω represents the periodic frequency;
[0172] Apply autocorrelation function and partial autocorrelation function to analyze the residual sequence, using the formula:
[0173]
[0174] Identify dependency patterns in time series and generate dependency pattern analysis;
[0175] Among them, ACF(k) represents the k-order autocorrelation function value, PACF(k) represents the k-order partial autocorrelation function value, R t is the residual at time t, is the residual mean, n is the sample size, and k is the lag order;
[0176] Using dependency pattern analysis, combined with time series decomposition, the formula is adopted:
[0177]
[0178] Locate the predicted defect dynamics, generate periodic and abnormal fluctuations;
[0179] Among them, S t represents the seasonal component in the time series, R t-irepresents the residual before the moment, α i , β j are the weight coefficients of seasonal and random components, ∈ t-j represents the error term before time j, p and q are the model orders of seasonal and random components respectively.
[0180] formula:
[0181]
[0182] Parameter explanation:
[0183] R t : residual at time t
[0184] x t : The actual observed value at time
[0185] The current moment value predicted by the model at the previous moment
[0186] c: Periodic amplitude
[0187] ω: periodic frequency
[0188] Derivation:
[0189] Assume that the actual observed value x at time t = 10 is 10 is 500, the predicted value is 485, the periodic amplitude c is 50, and the periodic frequency ω is 0.3. Calculate the residual R 10 as follows:
[0190] Calculate the periodic term: c·sin(ω·10)=50·sin(0.3·10)
[0191] Assume sin(3)≈0.1411 (using common trigonometric function values)
[0192] Then the periodic term is 50·0.1411=7.055
[0193] Calculate the residual: R 10 =500-(485+7.055)=500-492.055=7.945
[0194] Explanation of the example results:
[0195] The residual error of 7.945 indicates that at time t=10, the actual observed value is about 7.945 higher than the adjusted value predicted by the model, which indicates that the model has a certain deviation from the actual situation.
[0196] formula:
[0197]
[0198] Parameter explanation:
[0199] ACF(k): k-order autocorrelation function value
[0200] R t : residual at time t
[0201] Residual mean
[0202] n: sample size
[0203] k: lag order
[0204] Derivation:
[0205] Assume that the residual sequence data R1, R2, ..., R5 are 3, 5, 2, 8, 6, and we want to calculate the 11th-order autocorrelation function ACF(1):
[0206] Compute the mean residual error:
[0207] Calculate the numerator: (5-4.8)(3-4.8)+(2-4.8)(5-4.8)+(8-4.8)(2-4.8)+(6-4.8)(8-4.8)
[0208] Calculate the denominator: (3-4.8) 2 +(5-4.8) 2 +(2-4.8) 2 +(8-4.8) 2 +(6-4.8) 2
[0209] Substituting the specific values, the numerator is 0.96+-2.64+9.6+5.76=13.68, and the denominator is
[0210] 3.24+0.04+7.84+10.24+1.44=22.8
[0211] ACF(1)=13.68 / 22.8≈0.6
[0212] Explanation of the example results:
[0213] The value of ACF(1) is about 0.6, indicating that the residual series has a strong positive autocorrelation at the first lag, indicating that the residual values of two consecutive time points tend to be similar in the positive direction.
[0214] formula:
[0215]
[0216] Parameter explanation:
[0217] S t : Seasonal component in time series
[0218] R t-i : The residual before time
[0219] α i : Weight coefficient of seasonal component
[0220] ∈ t-j : Error term before time j
[0221] β j : Weight coefficient of random component
[0222] pandq: model orders for seasonal and random components respectively
[0223] Derivation:
[0224] To calculate the seasonal component in a time series, assume the following data and parameter settings:
[0225] Residual sequence R t The values are [5,3,6,2,8]
[0226] Error sequence ∈ t The values are [0.5, 0.3, 0.6, 0.2, 0.8]
[0227] The weight coefficients α are [0.3, 0.2] and β are [0.4, 0.1]
[0228] p=2 and q=2
[0229] Calculate S5 (using R5=8, R4=2, ∈5=0.8, ∈4=0.2):
[0230] Calculate the seasonal component:
[0231] α1·R4+α2·R3=0.3·2+0.2·6=0.6+1.2=1.8
[0232] Compute the random component:
[0233] β1·∈4+β2·∈3=0.4·0.2+0.1·0.6=0.08+0.06=0.14
[0234] Final S5 value:
[0235] S5=1.8+0.14=1.94
[0236] Explanation of the example results:
[0237] The value of the seasonal component S5 is 1.94, indicating that at time t = 5, the time series shows a certain seasonal fluctuation based on the weighted sum of previous residuals and errors. This value reflects the impact of past residuals and errors on the current moment value and is used to predict and understand future patterns or trends.
[0238] See also Figure 4 , the specific steps for obtaining the defect recognition signal are:
[0239] Based on the periodic and abnormal fluctuation data in time series analysis, the data is converted into graphical representation using visualization technology, using the formula:
[0240]
[0241] Generate defect probability map;
[0242] Among them, G represents the defect possibility map, α t Adjust the intensity of the graph at each time point, δ t Used to enhance the sensitivity of graphics to data, γ t ,ω t Adjust for cyclical effects;
[0243] Image processing technology is applied to the defect possibility map to perform edge detection and key change point analysis, using the formula:
[0244]
[0245] Locate significant changes in the map and generate dynamic defect location results;
[0246] Among them, D t represents the dynamic location of the defect at time t, is the time second derivative of the spectrum, is the first-order derivative, κ is the weighting factor;
[0247] According to the dynamic positioning results of defects, the probability analysis method formula is used:
[0248]
[0249] Dynamically provide differentiated response strength for each identified defect to generate a defect identification signal;
[0250] Among them, R represents the defect recognition signal, β i is the corresponding weight factor, and m is the number of identified defect points.
[0251] Formula analysis and examples for step 1
[0252] formula:
[0253]
[0254] Parameter Description:
[0255] α t : Graphics intensity adjustment parameter, assuming the value is 0.5
[0256] δ t : Parameter that enhances the sensitivity of graphics to data, assuming a value of 0.1
[0257] γ t : Adjust the parameter of the periodic effect, assuming a value of 0.3
[0258] ω t : Frequency parameter of the periodic effect, assumed to be π / 4 (this is a common periodic frequency)
[0259] S t :Periodic and abnormal fluctuation data extracted from time series analysis, assuming S1 = 2, S2 = 1, only the first two time points are calculated to simplify
[0260] n: The total number of data points, assumed to be 2
[0261] Derivation process:
[0262] Calculate G at the first two time points:
[0263] t=1
[0264] G1=0.5·exp-0.1·2 2 +0.3·cos(π / 4·1)
[0265] G1=0.5·exp(-0.4+0.3·0.707)
[0266] G1=0.5·exp(-0.187)≈0.5·0.829≈0.415
[0267] t=2
[0268] G2=0.5·exp-0.1·1 2 +0.3·cos(π / 4·2)
[0269] G2=0.5·exp(-0.1+0.3·0)
[0270] G2=0.5·exp(-0.1)≈0.5·0.905≈0.453
[0271] result:
[0272] Total G = G1 + G2 = 0.415 + 0.453 = 0.868
[0273] This value represents the overall strength of the defect likelihood map for the given parameters and model.
[0274] Formula analysis and examples for step 2
[0275] formula:
[0276]
[0277] Since the above formula involves the calculation of second-order derivatives and first-order derivatives, and there is actually no specific function form, we only assume that κ = 1, consider the simplified form of G and use numerical differentiation approximation:
[0278] The first-order derivative is assumed to be a linear change G2-G1:
[0279]
[0280] The second derivative is assumed to be approximately zero (in the simplified model).
[0281] Calculate D t :
[0282] D t =0+1·(0.038) 2 =0.001444
[0283] result:
[0284] This represents the value of the dynamic positioning of the defect, showing very small changes, which is consistent with the slight periodic fluctuations in reality.
[0285] See also Figure 5 , the specific steps for obtaining gradient change data are:
[0286] Perform pixel-level gradient analysis on the fabric image and apply the gradient calculation formula:
[0287]
[0288] Generate preliminary gradient data;
[0289] Where I represents the pixel intensity of the image, x and y are the pixel coordinates, and G(x,y) represents the gradient intensity of each pixel. is the first-order derivative, representing the rate of change of the image in the horizontal and vertical directions. is the second-order derivative, reflecting the acceleration of the change, and ξ is the weight that adjusts these second-order effects;
[0290] The high-change area is detected on the preliminary gradient data, and the threshold filtering formula is used:
[0291] H(x,y)=ifG(x,y)>θthen1else0
[0292] Generate data for areas with high gradient changes;
[0293] Among them, H(x,y) represents the gradient area after threshold processing, and θ is the cutoff threshold that determines the high gradient change;
[0294] The data of high gradient change areas are statistically analyzed and the statistical characteristics are calculated to characterize the characteristics of the overall gradient change. The formula is:
[0295]
[0296] Obtain the average gradient value of the high gradient area and obtain the gradient change data;
[0297] Where V represents the average gradient value of the high gradient area.
[0298] Detailed explanation of the formula for step 1
[0299] formula:
[0300]
[0301] Parameter details:
[0302] I is the pixel intensity of the image, and its specific value depends on the grayscale of the image.
[0303] Represent the first-order derivatives of the image in the horizontal and vertical directions, respectively, and are used to calculate the magnitude of the gradient, that is, the rate of change of pixel intensity.
[0304] It is the second derivative of the image in the corresponding direction, indicating the change in the rate of change.
[0305] ξ is a weight coefficient used to adjust the influence of the second-order derivative. It is assumed that ξ = 0.5 is taken as a reasonable estimate in reality.
[0306] Derivation process and examples:
[0307] Suppose in a simple image region, we have the following pixel intensities:
[0308] At point (x, y), pixel intensity I = 100
[0309] At the horizontally adjacent points (x+1, y) and (x-1, y), the pixel intensities are 120 and 80 respectively.
[0310] At the vertically adjacent points (x,y+1) and (x,y-1), the pixel intensities are 110 and 90 respectively.
[0311] calculate and (using a simple difference approximation):
[0312]
[0313] Similarly, calculate the second-order derivative:
[0314]
[0315] Finally, the gradient G(x,y) is calculated as:
[0316]
[0317] This value represents the gradient strength at the point (x, y). The higher the gradient, the more dramatic the image change.
[0318] Detailed explanation of the formula for step 2
[0319] formula:
[0320] H(x,y)=ifG(x,y)>θthen1else0
[0321] Parameter details:
[0322] G(x,y) is the gradient value obtained from step 1.
[0323] θ is the gradient threshold used to determine whether to mark the current point as a high-change region. It is assumed to be set to θ = 15, which is a reasonable value to ensure that only significant gradient changes are detected.
[0324] Derivation process and examples:
[0325] Using the gradient value G(x,y)=22.36 calculated in the previous step, compare θ=15:
[0326] H(x,y)=if22.36>15then1else0=1
[0327] This means that the point (x,y) is marked as a high-variance area.
[0328] Detailed explanation of the formula for step 3
[0329] formula:
[0330]
[0331] Parameter details:
[0332] V represents the average gradient value of the high gradient area, which is used to describe the average characteristics of the area with significant changes in the image.
[0333] H(x,y) is the binary image of the high gradient area obtained from step 2, where 1 represents the high gradient area and 0 represents the non-high gradient area.
[0334] G(x,y) is the original gradient data, that is, the gradient value of each point calculated in step 1.
[0335] Derivation process and examples:
[0336] Suppose in a small area, we have the following values of H(x,y) and G(x,y) (taking a simple 5×5 matrix as an example):
[0337] H(x,y) matrix (0 indicates low gradient, 1 indicates high gradient):
[0338]
[0339] G(x,y) matrix (representing the gradient value of each pixel):
[0340]
[0341] First calculate ∑ x,y H(x,y)·G(x,y):
[0342] Only calculate the position where H(x,y)=1:
[0343] 22+23+25+24+26+28+21+30+27+29=255
[0344] Then calculate ∑ x,y H(x,y):
[0345] There are 10 high gradient regions in total.
[0346] Finally, the average gradient V is calculated as:
[0347]
[0348] This value V=25.5 represents the average gradient value of the high gradient area, which is used to describe the overall gradient characteristics of the area with significant changes in the image.
[0349] See also Figure 6 , the specific steps for obtaining the key defect location map are:
[0350] Analyze the gradient change data and compare it with the defect recognition signal, using the correlation analysis formula:
[0351] C(x,y)=H(x,y)×S(x,y)×log(1+∈·G(x,y))
[0352] Generate defect and gradient correlation data;
[0353] Among them, C(x,y) represents the correlation strength between the gradient and the defect signal, S(x,y) is the defect identification signal, and ∈ is a parameter to enhance the influence of small changes;
[0354] The output of defect and gradient correlation data is spatially screened to determine the key defect locations, using the threshold decision formula:
[0355] D(x,y)=ifC(x,y)>θthen1else0
[0356] generating defect location data;
[0357] Where D(x,y) represents the defect location decision result, and θ is the threshold used to identify defects;
[0358] The defect location is determined based on the defect location data, using the visual enhancement formula:
[0359] K=∑ x,y D(x,y)×φ(x,y)
[0360] Generate a map of key defect locations;
[0361] Among them, K is the key defect location map, and φ(x,y) is the visual enhancement function.
[0362] Detailed explanation and derivation of the formula for step 1
[0363] formula:
[0364] C(x,y)=H(x,y)×S(x,y)×log(1+∈·G(x,y))
[0365] Parameter explanation:
[0366] H(x,y): represents the mark of the area with high gradient change. The value of 1 represents high gradient and 0 represents low gradient.
[0367] S(x,y): defect recognition signal, a value of 1 indicates the presence of a defect, and a value of 0 indicates no defect.
[0368] G(x,y): Raw gradient strength value, calculated from pixel-level gradient analysis of the image.
[0369] ∈: Adjustment parameter used to enhance the impact of small gradient changes, assuming a value of 0.1.
[0370] Calculation process:
[0371] For each pixel (x, y), calculate its gradient strength G(x, y). Assume that the gradient value at a certain point is 30.
[0372] Judge H(x,y) according to the set threshold θ (assumed to be 20). If G(x,y)>θ, then H(x,y)=1, otherwise it is 0.
[0373] The defect identification signal S(x, y) has been obtained through the previous steps and is assumed to be 1 at this point.
[0374] Substitute H(x,y), S(x,y), and G(x,y) into the formula to calculate C(x,y):
[0375] C(x,y)=1×1×log(1+0.1×30)=log(4)≈1.386
[0376] This means that if a pixel has both a high gradient and is marked as a defect, then the C(x,y) value will be used for further analysis.
[0377] Detailed explanation and derivation of the formula for step 2
[0378] formula:
[0379] D(x,y)=ifC(x,y)>θthen1else0
[0380] Parameter explanation:
[0381] C(x,y): The correlation strength calculated in the previous step.
[0382] θ: Time value used to decide whether to mark the current point as a critical defect point. Set the threshold to 1.2.
[0383] Calculation process:
[0384] According to the value of C(x,y) (the previous calculation result is about 1.386), compare whether it is greater than θ.
[0385] If C(x,y)=1.386>1.2, then D(x,y)=1, otherwise it is 0.
[0386] D(x,y)=1
[0387] This means that the pixel is marked as a critical defect location.
[0388] Detailed explanation and derivation of the formula for step 3
[0389] formula:
[0390]
[0391] Parameter explanation:
[0392] D(x,y): The defect location decision result obtained from the previous step.
[0393] φ(x,y): Image rendering function, used to add visual effects to the defect location map, assuming φ(x,y) = 255 (the maximum brightness value of the image).
[0394] Calculation process:
[0395] For each pixel (x, y) in the image, if D(x, y) = 1 (indicates defect ), then K increases by φ(x,y). Assume that 10 pixels are marked as defects:
[0396] K = 10 × 255 = 2550
[0397] This means that 10 key defect locations are marked in the image, and the total visual enhancement value is 2550, indicating that the defect locations are visually significantly highlighted.
[0398] See also Figure 7 , the specific steps for obtaining defect reconstruction results are:
[0399] Using the defect area data identified in the key defect location map, adjust the parameters of the neural network to match the defect characteristics and apply the parameter adjustment formula:
[0400] P new =P old ×(1+α·tanh(β·D var ))
[0401] Generate adjusted network parameters;
[0402] Among them, P new is the adjusted network parameter, P old are the previous parameters, α and β adjust the sensitivity and rate of parameter adjustment, D var is the gradient variance calculated from the defect location map;
[0403] Use the adjusted network parameters to perform deep local perception analysis on the defect area, using the deep learning analysis formula:
[0404]
[0405] Generate analysis results of defective areas;
[0406] in, is the adjusted weight matrix, I x+i,y+j represents the pixel value of the defect area, σ is a nonlinear activation function, and A(x,y) represents the analysis result of the defect area;
[0407] According to the analysis results of the defect area, reconstruct the defect details in the image using the image reconstruction formula:
[0408] R=∫∫A(x,y)·φ(x,y,γ)dxdy
[0409] Generate defect reconstruction results;
[0410] Among them, φ(x, y, γ) is the image enhancement function adjusted based on the defect characteristics, γ is the enhancement coefficient, and R represents the defect reconstruction result.
[0411] Formula analysis and examples in step 1:
[0412] formula:
[0413] P new =P old ×(1+α·tanh(β·D var ))
[0414] Parameter explanation:
[0415] P old : Original network parameters, assumed to be a weight value, such as 0.5.
[0416] α: adjustment coefficient, affecting the amplitude of parameter adjustment, assumed to be 0.1.
[0417] β: adjustment coefficient, affecting the adjustment rate, assumed to be 5.
[0418] D var : The gradient variance in the defect area is assumed to be 0.2.
[0419] tanh: Hyperbolic tangent function, used for smoothing effects.
[0420] Calculation process:
[0421] After adjusting the weight matrix, assuming (Result of step 1).
[0422] I x+i,y+j : The pixel value within the defect area, assuming that the pixel value at position (0,0) is 255.
[0423] σ: activation function, for example, Sigmoid function.
[0424] Calculation process:
[0425] Calculate the product of local weight and pixel:
[0426] Apply activation function
[0427] Example results:
[0428] The local perception analysis result A(0,0)≈1 is obtained, indicating that the pixel at this position is very likely to be part of the defect area.
[0429] Formula analysis and examples in step 3:
[0430] formula:
[0431] R=∫∫A(x,y)·φ(x,y,γ)dxdy
[0432] Parameter explanation:
[0433] A(x,y): The output of step 2, the value at position (0,0) is 1.
[0434] φ(x,y,γ): Assume a simple enhancement function, γ = 1.5, φ(0,0,1.5) = 1.5.
[0435] R: Reconstructed result, which is an integrated representation of defect details.
[0436] Calculation process:
[0437] Calculate the product of the image enhancement function and the local analysis result: A(0,0)×φ(0,0,1.5)=1×1.5=1.5.
[0438] Assuming the image is a single pixel, the integral simplifies to a direct multiplication result.
[0439] Example results:
[0440] The final defect reconstruction result R=1.5 indicates that at this point in the image, the defect is enhanced for clearer identification and analysis.
[0441] The above are only preferred embodiments of the present invention and are not intended to limit the present invention in other forms. Any technician familiar with the profession may use the technical contents disclosed above to change or modify them into equivalent embodiments with equivalent changes and apply them to other fields. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A fabric defect recognition system based on AI, characterized in that: The system comprises: The fabric dynamic monitoring module collects the tension and pressure readings on the fabric production line, calculates the change amplitude of the readings in real time, and performs behavior trend analysis. It builds a preliminary model of fabric behavior based on trend changes and obtains a behavior prediction model. The nonlinear behavior analysis module uses numerical simulation technology to perform time series analysis on the data in the behavior prediction model, extract periodicity and abnormal fluctuations, draw a defect possibility map based on the periodicity and abnormal fluctuations, locate the predicted defect dynamics, and generate a defect recognition signal; The image gradient monitoring module performs pixel-level gradient analysis on the fabric image, detects the high gradient change area in the image, obtains gradient change data, compares the gradient change data with the defect recognition signal, identifies the defect position associated with the high gradient change, and generates a key defect position map; The reinforcement learning optimization module adjusts the network parameters according to the defect area marked in the key defect location map, applies the adjusted network parameters to perform deep local perception analysis on the defect area, reconstructs the defect detail information in the image, and generates a defect reconstruction result.
2. The AI-based fabric defect recognition system according to claim 1, characterized in that: The steps for obtaining the behavior prediction model are specifically as follows: The monitoring equipment collects the tension readings z and pressure readings p on the fabric production line using the formula: Calculate the change range of the readings and generate a change range result; Among them, Δx represents the change amplitude, z i represents the ith tension reading, Indicates the average value of tension readings, p i represents the ith pressure reading, represents the average value of the pressure readings, n represents the total number of readings, and w z 、w p are the weight factors for tension and pressure, respectively; For the above mentioned change results, exponential smoothing method is applied to conduct trend analysis, using the formula: Analyze the behavioral trend of the change range and generate trend analysis results; Among them, T t represents the trend value at time t, x t Represents the change amplitude data at time t, T t-1 represents the trend value at time t-1, w1 and w2 are weight factors, and β is the adjustment coefficient; The trend analysis results were applied to a linear regression model using the regression formula: Calculate a preliminary model of fabric behavior to obtain a behavior prediction model; Where M represents the behavior prediction model, T i represents the trend analysis results of the differentiated time points, γ i represents the regression coefficient at multiple time points, λ i is the adjustment factor.
3. The AI-based fabric defect recognition system according to claim 1, characterized in that: The steps of extracting periodicity and abnormal fluctuations are specifically as follows: Analyze the time series data in the behavior prediction model and use the residual calculation formula: Calculate the residuals of the time series and generate a residual sequence; Among them, R t represents the residual at time t, x t represents the actual observed value at time t, represents the current moment value predicted by the model at the previous moment, c represents the periodic amplitude, and ω represents the periodic frequency; The autocorrelation function and partial autocorrelation function are applied to analyze the residual sequence, using the formula: Identify dependency patterns in time series and generate dependency pattern analysis; Among them, ACF(k) represents the k-order autocorrelation function value, PACF(k) represents the k-order partial autocorrelation function value, R t is the residual at time t, is the residual mean, n is the sample size, and k is the lag order; Using the dependency pattern analysis, combined with time series decomposition, the formula is adopted: Locate the predicted defect dynamics, generate periodic and abnormal fluctuations; Among them, S t represents the seasonal component in the time series, R t-i represents the residual before the moment, α i , β j are the weight coefficients of seasonal and random components, ∈ t-j represents the error term before time j, p and q are the model orders of seasonal and random components respectively.
4. The AI-based fabric defect recognition system according to claim 1, characterized in that: The steps of obtaining the defect identification signal are specifically as follows: Based on the periodic and abnormal fluctuation data described in time series analysis, the data is converted into a graphical representation using visualization technology, using the formula: Generate defect probability map; Among them, G represents the defect possibility map, α t Adjust the intensity of the graph at each time point, δ t Used to enhance the sensitivity of graphics to data, γ t ,ω t Adjust for cyclical effects; Image processing technology is applied to the defect possibility map to perform edge detection and key change point analysis, using the formula: Locate significant changes in the map and generate dynamic defect location results; Among them, D t represents the dynamic location of the defect at time t, is the time second derivative of the spectrum, is the first-order derivative, κ is the weighting factor; According to the defect dynamic positioning results, the probability analysis method formula is adopted: Dynamically provide differentiated response strength for each identified defect to generate a defect identification signal; Among them, R represents the defect recognition signal, βi is the corresponding weight factor, and m is the number of identified defect points.
5. The AI-based fabric defect recognition system according to claim 1, characterized in that: The steps for obtaining the gradient change data are specifically as follows: Perform pixel-level gradient analysis on the fabric image and apply the gradient calculation formula: Generate preliminary gradient data; Where I represents the pixel intensity of the image, x and y are the pixel coordinates, and G(x,y) represents the gradient intensity of each pixel. is the first-order derivative, representing the rate of change of the image in the horizontal and vertical directions. is the second-order derivative, reflecting the acceleration of the change, and ξ is the weight that adjusts these second-order effects; The high-change area is detected on the preliminary gradient data using a threshold filtering formula: H(x,y)=ifG(x,y)>0then 1 else0 Generate data for areas with high gradient changes; Among them, H(x,y) represents the gradient area after threshold processing, and θ is the cutoff threshold that determines the high gradient change; The data of the high gradient change area are statistically analyzed, and the statistical characteristics are calculated to characterize the characteristics of the overall gradient change, using the formula: Obtain the average gradient value of the high gradient area and obtain the gradient change data; Where V represents the average gradient value of the high gradient area.
6. The AI-based fabric defect recognition system according to claim 1, characterized in that: The steps for obtaining the key defect location map are specifically as follows: The gradient change data is analyzed and compared with the defect recognition signal, using the correlation analysis formula: C(x,y)=H(x,y)×S(x,y)×log(1+∈·G(x,y)) Generate defect and gradient correlation data; Among them, C(x,y) represents the correlation strength between the gradient and the defect signal, S(x,y) is the defect recognition signal, and ∈ is a parameter that enhances the influence of small changes; The output of the defect and gradient correlation data is spatially screened to determine the key defect location, using the threshold decision formula: D(x,y)=ifC(x,y)>θthen1else0 generating defect location data; Where D(x,y) represents the defect location decision result, and θ is the threshold used to identify defects; The defect position determined according to the defect position data adopts the visual enhancement formula: K=∑ x,y D(x,y)×φ(x,y) Generate a map of key defect locations; Among them, K is the key defect location map, and φ(x,y) is the visual enhancement function.
7. The AI-based fabric defect recognition system according to claim 1, characterized in that: The steps for obtaining the defect reconstruction result are specifically as follows: Using the defect area data identified in the key defect location map, the parameters of the neural network are adjusted to match the defect characteristics, and the parameter adjustment formula is applied: P new =P old ×(1+α·tanh(β·D var )) Generate adjusted network parameters; Among them, P new is the adjusted network parameter, P old are the previous parameters, α and β adjust the sensitivity and rate of parameter adjustment, D var is the gradient variance calculated from the defect location map; Using the adjusted network parameters, deep local perception analysis is performed on the defect area, using the deep learning analysis formula: Generate analysis results of defective areas; in, is the adjusted weight matrix, I x+i,y+j represents the pixel value of the defect area, σ is a nonlinear activation function, and A(x,y) represents the analysis result of the defect area; According to the analysis results of the defect area, the defect details in the image are reconstructed using the image reconstruction formula: R=∫∫A(x,y)·φ(x,y,γ)dxdy Generate defect reconstruction results; Among them, φ(x, y, γ) is the image enhancement function adjusted based on the defect characteristics, γ is the enhancement coefficient, and R represents the defect reconstruction result.
Citation Information
Patent Citations
Textile defect detection method based on low-rank matrix reconstruction and generalized convolution
CN113269777A
Fabric flaw prediction method based on digital twinning
CN114880951A
Image recognition method of woven fabric design pattern fabric weave
CN116468715A
Method and system for accurately controlling yarns in tufted carpet production process
CN116971109A
Textile detection method and system based on machine vision
CN117115147A
Cited By
Cloth flaw detection method and system based on machine vision
CN119198751A
Sofa fabric defect intelligent detection system and method based on AI image recognition
CN120318157A
Fabric defect intelligent detection method and system based on AI visual identification
CN120747091A
