Textile production and processing quality identification system based on image analysis
Patent Information
- Application Number
- CN202611188393.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-06
- Publication Date
- 2026-10-23
AI Technical Summary
[0002]传统人工检测纺织品缺陷效率低、误差大,计算机视觉识别成为主流,但现有技术存在通用缺陷样本适配性差、特定场景样本不足、质量风险预警单一等问题,难以满足不同纺织厂个性化生产质量管控需求,具体提出以下技术问题:
[0054](1)、该基于图像分析的纺织品生产加工质量识别系统,通过缺陷样本采集模块的场景化采集与关联信息绑定,结合虚拟样本生成补充模块的场景专属虚拟样本优化,形成覆盖全缺陷类型、全生产场景的个性化增强样本集,使训练后的检测模型深度适配目标纺织厂的材料、工艺及场景特性,从根源提升缺陷识别精准度。
Smart Images

Figure CN122966613A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of textile production quality inspection technology, specifically relating to a textile production and processing quality identification system based on image analysis. Background Technology
[0002] Traditional manual inspection of textile defects is inefficient and prone to errors. While computer vision recognition has become the mainstream, existing technologies suffer from poor adaptability of general defect samples, insufficient samples for specific scenarios, and limited quality risk warnings. These issues make it difficult to meet the personalized production quality control needs of different textile factories. The following technical problems are specifically identified:
[0003] The general defect samples do not match the individual materials, processes, and scenarios of textile factories, resulting in poor adaptability of the detection model;
[0004] In specific production scenarios, the number of defect samples is insufficient and their quality is inconsistent, making it impossible to support efficient model training.
[0005] The quality risk assessment indicators are too simplistic and have low accuracy in early warning, making it difficult to achieve dynamic control and early intervention in production quality. To address this, we propose a textile production and processing quality identification system based on image analysis. Summary of the Invention
[0006] The purpose of this invention is to provide a textile production and processing quality identification system based on image analysis to solve the problems mentioned in the background art.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a textile production and processing quality identification system based on image analysis, comprising:
[0008] Defect Sample Collection Module: Collects real samples of various defects from the target textile factory and corresponding defect association information, organizes them into a set of original samples of various defects, sets subdivided scenarios and matching combinations of association information parameters, matches to form scenario sample groups, calculates the number of samples required for subdivided scenarios, evaluates the sufficiency of scenario samples, and marks defects with sufficient or missing samples.
[0009] Virtual Sample Generation and Supplement Module: To address the defects of missing samples, a generative adversarial network model is constructed based on the scene information to be supplemented. The generated virtual samples are optimized in terms of lighting, surface morphology, and texture features. Virtual defect supplementary samples are selected according to cosine similarity and merged with real samples to obtain a standardized sample set. The entire set of samples is organized, labeled, and a hash index is constructed to form a personalized enhanced sample set.
[0010] Defect Detection and Risk Warning Module: Constructs a textile defect image detection model using a personalized enhanced sample set, detects textiles to be inspected and determines whether they are qualified or not; statistically analyzes non-qualified data during the monitoring period, calculates quality risk assessment values, matches textile processing quality levels, constructs risk change curves, calculates risk warning values, and triggers textile production and processing quality risk warnings when thresholds are exceeded.
[0011] Preferably, the process for forming the scene sample group is as follows:
[0012] Collect real sample images of various defects and simultaneously record complete defect association information corresponding to each sample image. The defect association information includes defect type, textile material type, process parameters and collection environment attributes.
[0013] For each type of defect, all its corresponding sample images are matched one by one with their respective defect association information to form an original sample set for a single type of defect.
[0014] Based on the process parameters and actual production conditions in the field for each type of defect, a list of exclusive sub-scenarios for that type of defect is preset, and each sub-scenarios corresponds to a set of related information parameter matching combinations.
[0015] The sample images and their associated information in the original sample set of each single type of defect are matched with the associated information parameters of each scene in the list of specific sub-scenes for that type of defect. The samples are then assigned to the corresponding sub-scenes to form several scene sample groups for that type of defect.
[0016] Preferably, the specific process for calculating the required sample size for each sub-scenarios and assessing the sufficiency of the scenario samples is as follows:
[0017] A threshold for sufficient overall defect samples is set; for each sub-scenario, the number of times the corresponding defect occurs in that scenario within a preset time period is counted, and the ratio of this number to the total number of occurrences of that type of defect is taken as the scenario defect occurrence rate;
[0018] By comprehensively analyzing the scene defect occurrence rate, scrap rate, and rework rate, the scene defect impact value is obtained;
[0019] The defect impact values of all sub-scenarios under this type of defect are normalized to obtain the sample weight value of each scenario;
[0020] Multiply the overall defect sample sufficiency threshold by the sample weight value of each scenario to obtain the required sample size for each sub-scenario;
[0021] Count the actual number of samples in the scene sample group corresponding to each sub-scene. If the actual number is not less than the required number of samples, it is determined that the defect samples in the scene are sufficient, and a corresponding number of samples are selected from the scene sample group to form a standardized sample set.
[0022] If the actual number is less than the required sample size, the scene is deemed to have insufficient defect samples and is marked as a scene defect sample to be supplemented.
[0023] Preferably, the specific process for marking sample sufficiency defects or missing defects is as follows:
[0024] Record the scene name to be supplemented for each scenario's defect samples, the matching combination of related information parameters, the required sample size, the actual number of samples, and the number of sample gaps;
[0025] If all sub-scenarios have sufficient samples, each type of defect is marked as a sample-sufficient defect; if any sub-scenarios have insufficient samples, it is marked as a sample-missing defect.
[0026] Preferably, the specific process of constructing a generative adversarial network model and optimizing the lighting, surface morphology, and texture features of the generated virtual samples is as follows:
[0027] For each type of missing sample defect, a generative adversarial network model is constructed based on all the scene information to be filled. In this model, the generator adopts the U-Net architecture, and the input random noise vector is matched and combined with the scene-related information parameters to learn scene-specific defect features. The discriminator adopts the CNN architecture, and the input image is matched and combined with the scene-related information parameters to output the true probability of the image. The training objective is to reduce the loss of the generator and the discriminator.
[0028] For scenarios with missing samples, virtual samples are generated using a trained generative adversarial network model. The grayscale of the samples is adjusted according to the lighting parameters to match the optical characteristics of the actual scene. The morphological transformation is used to adjust the defect shape according to the fabric surface condition. The texture features are optimized according to the material type and process parameters to make the defect features fit the reality. Finally, virtual defect samples matching the scene are output.
[0029] Preferably, the specific process of selecting virtual defect supplementary samples and fusing them with real samples to obtain a standardized sample set is as follows:
[0030] For each final virtual defect sample, the feature similarity between it and the corresponding real defect sample template in the scene is calculated using cosine similarity. Samples with similarity not lower than the corresponding preset threshold are selected as virtual defect supplementary samples. The corresponding number of supplementary samples are selected according to the gap in the scene samples to be supplemented, and fused with the existing real samples in the scene. After removing duplicate feature samples by deduplication algorithm, a standardized sample set of defects in the scene is obtained.
[0031] Preferably, the entire sample set is organized, labeled, and a hash index is constructed to form a personalized enhanced sample set. The specific process is as follows:
[0032] Collect standardized sample sets for all scenarios with sufficient samples and standardized sample sets for all scenarios with missing samples, and organize them to form a full defect sample pool.
[0033] Label each standardized sample in the full defect sample pool;
[0034] Construct a hash index mapping based on a labeling system;
[0035] All standardized samples that have undergone standardization, structured annotation, and index construction are integrated to form a personalized enhanced sample set.
[0036] Preferably, the specific process of constructing a textile defect image detection model to detect the textile under inspection and determine whether it is qualified or not is as follows:
[0037] A model for detecting defects in textile images was constructed using a personalized enhanced sample set as training data.
[0038] Acquire images of the textile products to be inspected produced by the target textile factory at each unit of time;
[0039] For each textile image to be detected, the output is fed into the textile defect image detection model for defect detection, identifying whether the textile has defects:
[0040] If defects are found, the textiles are deemed non-conforming, and the type of defect is identified.
[0041] If no defects are found, the textile is deemed acceptable.
[0042] Preferably, the specific process for calculating the quality risk assessment value and matching the textile processing quality grade based on the non-compliant data during the statistical monitoring period is as follows:
[0043] Set a monitoring period and obtain the real-time total number and real-time frequency of non-conforming textiles on the production line during that period;
[0044] Non-conforming textiles are classified according to defect type, and the total number of non-conforming textiles corresponding to each type of defect is counted in real time. Combined with the preset quality impact weight of each type of defect, the cumulative impact value of the defect is calculated.
[0045] For each unit detection time within the monitoring period, the real-time total number of non-conforming textiles, real-time occurrence frequency, and cumulative impact value of defects corresponding to that time are normalized and dimensionless, and then combined with the preset quality assessment weights to obtain the quality risk assessment value.
[0046] Multiple textile processing quality levels are set, and a corresponding quality risk assessment value range is preset for each level. The quality risk assessment value at the current unit testing time is matched with each range, and the corresponding textile processing quality level is output.
[0047] Preferably, a risk change curve is constructed, a risk warning value is calculated, and if the value exceeds the threshold, a risk warning for the quality of textile production and processing is triggered. The specific process is as follows:
[0048] A two-dimensional coordinate system is constructed with the quality risk assessment value as the vertical axis and time as the horizontal axis. The quality risk assessment values of each unit at the detection time within the monitoring period are marked, and the values are connected by a smooth curve in chronological order to obtain the quality risk change curve.
[0049] The area of the statistical curve that exceeds the preset quality risk threshold is the threshold excess area. Summing up all threshold excess areas from the start of monitoring to the current moment yields the total threshold excess product.
[0050] Obtain the slope of the curve between the current unit detection time and the previous unit detection time, and use it as the risk change slope;
[0051] After normalizing and dimensionlessly processing the threshold over-limit product, risk change slope, and quality risk assessment value, the risk warning value is calculated in combination with the preset weight coefficients.
[0052] If the current risk warning value is not lower than the preset threshold, a risk warning for the quality of textile production and processing will be triggered.
[0053] Compared with the prior art, the beneficial effects of the present invention are:
[0054] (1) The image analysis-based textile production and processing quality identification system forms a personalized enhanced sample set covering all defect types and all production scenarios by combining the scenario-based collection and association information binding of the defect sample collection module with the scenario-specific virtual sample optimization of the virtual sample generation supplement module. This enables the trained detection model to deeply adapt to the material, process and scenario characteristics of the target textile factory, thereby improving the accuracy of defect identification from the root.
[0055] (2) The image analysis-based textile production and processing quality recognition system generates virtual samples that fit the real scene through the GAN model. After optimization of lighting, surface morphology, texture features and cosine similarity screening, it accurately fills the sample gaps. At the same time, it realizes the standardized processing and structured annotation of the full set of samples, providing sufficient and standardized high-quality data support for efficient model training.
[0056] (3) The image analysis-based textile production and processing quality identification system integrates the real-time total number of unqualified textiles, the frequency of occurrence, and the cumulative impact value of defects during the monitoring period. After normalization, it generates a quality risk assessment value, which can directly match the preset processing quality levels of "excellent, good, qualified, and unqualified". It transforms the abstract production quality into intuitive and quantifiable indicators, avoiding subjective bias in quality assessment. At the same time, it combines the quality risk change curve, the threshold overshoot product, and the risk change slope to form a full-process quality control mechanism of "quantitative assessment - trend monitoring - comprehensive early warning". It can identify the risk of quality decline in advance, and after triggering the early warning, it can quickly trace the source and intervene in the production process, effectively reducing the output of defective products and ensuring that the quality of textile processing is stable and meets the standards. Attached Figure Description
[0057] Figure 1 This is a flowchart of the present invention;
[0058] Figure 2 This is a graph showing the change in quality risk of the present invention. Detailed Implementation
[0059] The technical solutions of the embodiments of the present invention will be clearly and completely described below 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.
[0060] Example 1;
[0061] Please see Figure 1-2 This invention provides a textile production and processing quality identification system based on image analysis, including: a defect sample acquisition module, a virtual sample generation and supplementation module, and a defect detection and risk warning module.
[0062] Defect Sample Acquisition Module: Collects real samples of various defects from the target textile factory and corresponding defect association information, organizes them into raw sample sets of various defects, sets subdivided scenarios and matching combinations of association information parameters, matches to form scenario sample groups, calculates the required sample size for each subdivided scenario, evaluates the sufficiency of scenario samples, and marks defects with sufficient or missing samples. The specific process is as follows:
[0063] We comprehensively collect real sample images of various defects (covering all in-plant product defects such as yarn breakage, holes, fiber agglomeration, and color difference) from the target textile factory's production history, past quality inspection files, and real-time production inspection scenarios; we simultaneously record complete defect association information corresponding to each sample image, specifically including:
[0064] Basic parameters: Defect type (clearly indicate the defect category to which the sample belongs);
[0065] Production-related attributes: textile material type (such as cotton, linen, blended fabrics, etc.) and process parameters (weaving density, dyeing temperature, etc.).
[0066] Environmental attributes during sample collection: light intensity and fabric surface condition (e.g., smoothness, slight wrinkles, etc.).
[0067] For each type of defect, all corresponding sample images are matched one-to-one with their respective defect association information to form an original sample set for a single type of defect; each sample image uniquely corresponds to a complete set of defect association information to ensure that the sample is bound to the scene attributes without omission;
[0068] For each type of defect, based on the defect's process parameters, actual production conditions in the factory, etc., a list of exclusive sub-scenarios for that type of defect is preset, and each sub-scenarios corresponds to a set of related information parameter matching combinations.
[0069] For example, the sub-scenario of fiber agglomeration defects is 60% cotton + 40% linen + 6:4 ratio + 30m / min combing speed + natural light + smooth surface. The corresponding related information parameter matching combination is "material type: 60% cotton + 40% linen, blend ratio: 6:4, combing speed: 30m / min, light intensity: natural light, surface condition: smooth".
[0070] For each original sample set of a single type of defect, each sample image and its associated information in the set are matched with the associated information parameters of each scene in the exclusive sub-scene list corresponding to that type of defect. The sample is then assigned to the corresponding sub-scene to form several scene sample groups for that type of defect.
[0071] Based on the minimum effective sample size requirement for model training, a pre-set threshold for sufficient overall defect samples is T = ⌈k⋅d / δ⌉.
[0072] in,
[0073] k represents the defect feature dimension: the number of features needed to describe this type of defect (area, perimeter, texture contrast, edge roughness, grayscale mean, shape eccentricity, difference from the fabric background, fiber entanglement density, etc.).
[0074] d represents the number of model parameters: the total number of parameters (such as convolutional layer weights, fully connected layer coefficients, etc.) that need to be learned and adjusted in the AI model used to identify defects.
[0075] δ represents the upper limit of the allowable training error: the acceptable degree of model error.
[0076] ⌈⋅⌉ is the floor function:
[0077] For each sub-scenario in the current defect sub-scenario list, obtain the production logs and quality inspection records of the target textile factory for the past 3 months, count the number of times this type of defect occurs in this sub-scenario, and record it as the scene defect occurrence count; by dividing the scene defect occurrence count by the total occurrence count of this type of defect, the scene defect occurrence rate SF is obtained;
[0078] In this specific scenario, the ratio of the number of times a product is scrapped after this type of defect occurs to the total number of defects in the scenario, and the ratio of the number of times a product is reworked to the total number of defects in the scenario, are statistically analyzed and labeled as the scenario defect scrap rate (BF) and the scenario defect rework rate (CF), respectively.
[0079] The scene defect impact value CY is obtained using the formula: CY=SF×a1+BF×a2+CF×a3; where a1, a2, and a3 are preset weight coefficients.
[0080] The defect impact values of all sub-scenarios under this type of defect are normalized to obtain the sample weight value of each scenario;
[0081] The required sample size for each sub-scenarios is obtained by multiplying the overall sample sufficiency threshold for this type of defect by the sample weight value of each sub-scenarios.
[0082] For each sub-scenario, the actual number of samples in the corresponding scenario sample group is counted;
[0083] If the actual number of samples is greater than or equal to the number of samples required for the scenario, then the defect samples for the scenario are deemed sufficient; and samples are selected from the corresponding scenario sample group according to the required number of samples to form a standardized sample set of defects for the scenario.
[0084] If the actual number of samples is less than the number of samples required for the scenario, then the scenario is determined to have insufficient defective samples and is marked as a scenario defective sample to be supplemented.
[0085] Record the scene information for each scene that is marked as a scene defect sample to be supplemented: including scene name, corresponding associated information parameter matching combination, required sample size for the scene, actual number of samples, and number of sample gaps (number of gaps = required sample size for the scene - actual number of samples).
[0086] For each type of defect, if there are sufficient defect samples in each sub-scenarios in the corresponding sub-scenarios list, then the defect of this type is marked as a defect with sufficient samples; if there are insufficient defect samples in any sub-scenarios, then the defect of this type is marked as a defect with missing samples.
[0087] It should be noted that by comprehensively collecting real defect samples and complete related information (including production and environmental attributes) within the factory, and achieving a unique binding between the samples and scenario attributes, the core problem of mismatch between general samples and the production characteristics of the target textile factory is solved, ensuring that the samples have strong scenario adaptability.
[0088] Scenarios are subdivided according to process and production conditions and samples are matched. The required sample size for each scenario is calculated by combining data such as defect incidence rate and scrap rate, making the sample size assessment more scientific, avoiding sample redundancy or insufficiency, and providing efficient data support for model training.
[0089] Accurately label the sufficiency / deficiency of samples and the information of scenarios that need to be supplemented, clarify the direction of sample gaps, provide accurate targets for the subsequent virtual sample generation module, reduce the generation of invalid samples, and improve the efficiency of the entire sample optimization process;
[0090] The standardized sample set and structured association information formed lay the foundation for subsequent hash index construction and model embedding scene matching linkage functions, helping the detection model to achieve precise linkage of "defect identification - scene tracing" and improve the accuracy of the final detection.
[0091] Virtual Sample Generation and Supplementation Module: Addressing the issue of missing samples, a generative adversarial network (GAN) model is constructed based on the scene information to be supplemented. The generated virtual samples are optimized for lighting, surface morphology, and texture features. Virtual samples are then selected to supplement the missing samples based on cosine similarity, and merged with real samples to obtain a standardized sample set. Finally, all samples are organized, labeled, and a hash index is constructed to form a personalized enhanced sample set. The specific process is as follows:
[0092] For each type of missing sample defect, a generative adversarial network (GAN) model is constructed based on the scene information of all scene defect samples to be supplemented.
[0093] The specific structure of a Generative Adversarial Network (GAN) model is as follows:
[0094] The generator adopts the U-Net architecture, and the input is a random noise vector and a matching combination of relevant information parameters of the corresponding scene (core parameters such as material type, process parameters, light intensity, and surface condition), to ensure that the model learns the specific features of defects in the scene.
[0095] The discriminator uses a CNN architecture. The input is an image and the corresponding associated information parameters, and the output is the true probability of the image.
[0096] The model training objective is to minimize the generator loss. With discriminator loss ;
[0097] Minimize generator loss The expression is:
[0098] ;
[0099] in,
[0100] E: is the mathematical expectation, which is the average of all possible inputs;
[0101] Z: is a random noise vector, which introduces randomness into the generator to ensure sample diversity;
[0102] C: This is a combination of related information parameters, including core parameters such as material type, process parameters, light intensity, and surface condition, used to constrain the generator to generate defect samples for specific scenarios;
[0103] G(∙): is the generator function, which takes Z and C as inputs and outputs the generated virtual defect sample image;
[0104] D(∙): is the discriminator function, which takes the image and C as input and outputs the probability that the image is a real sample;
[0105] Discriminator loss The expression is: ;
[0106] in, The real defect sample image is one of the inputs to the discriminator, used to train the discriminator to distinguish between real and generated samples;
[0107] For scenarios with missing samples, where missing samples need to be supplemented, virtual samples are generated using the trained GAN model according to the following steps:
[0108] The relevant information parameters of the scenario are matched and combined into the generator, and combined with a random noise vector to drive the generator to generate initial virtual defect samples.
[0109] Based on the illumination intensity parameter, through the pixel grayscale distribution function: (in, This is a preset, proprietary lighting adjustment coefficient for this scene. Before illumination adjustment, the coordinates in the sample image are... The original pixel grayscale value, After adjustment for illumination features, the coordinates in the sample image are... The initial virtual defect sample is grayscale adjusted by adjusting the pixel grayscale value to simulate the brightness and darkness changes of the defect area under the corresponding lighting conditions, so that the optical characteristics such as brightness and contrast of the defect in the virtual image are consistent with the actual scene, and the sample image after grayscale feature adjustment is obtained.
[0110] Based on the fabric surface state parameters, morphological transformations are applied: (in Pre-define a dedicated surface state convolution kernel for this scenario. The input sample image for morphological transformation specifically refers to the sample image after grayscale feature adjustment. (The sample image obtained after morphological transformation is used to characterize the defect morphology of the surface state of the scene.) The sample image after grayscale feature adjustment is processed to simulate the defect morphology of the flat, wrinkled or rough surface state corresponding to the scene, and the sample image after surface morphology adaptation is obtained.
[0111] Based on the material type and process parameters, the texture generation weight of the generator is adjusted, and the texture features of the sample image after surface morphology adaptation are optimized so that the defect features of the sample (such as the state of broken yarn edge and fiber agglomeration and entanglement density) are consistent with the real defect features under the material and process; finally, the final virtual defect sample that matches the scene-related information parameters is output.
[0112] For each final virtual defect sample, the feature similarity between the final virtual defect sample and the real defect sample template corresponding to the scene is calculated based on the cosine similarity calculation method.
[0113] A preset feature similarity threshold is set to filter out the final virtual defect samples whose feature similarity is greater than or equal to the corresponding preset threshold, and these samples are recorded as virtual defect supplementary samples.
[0114] Based on the sample gap to be filled in the scene defect samples corresponding to this scene, a corresponding number of samples are selected from the virtual defect supplementary samples to supplement them. The supplemented virtual defect supplementary samples are then fused with the existing real defect samples in this scene. After removing duplicate feature samples through a deduplication algorithm, a standardized sample set of scene defects is obtained.
[0115] Collect standardized sample sets for all scenarios with sufficient samples and standardized sample sets for all scenarios with missing samples, and organize them to form a full defect sample pool. Perform unified preprocessing on all samples in the full defect sample pool, including size normalization, grayscale calibration and noise removal.
[0116] Each standardized sample in the full defect sample pool is labeled, including: basic labels (defect type, scene name), related information labels (corresponding related information matching combination, including material type, process parameters, light intensity, surface condition), and sample attribute labels (sample source: real sample / virtual sample; feature similarity: only virtual sample is labeled).
[0117] A hash index mapping is constructed based on the labeling system, and a unique index address is generated for each standardized sample in the following way:
[0118] First, hash operations are performed on the defect types and associated information matching combinations of the standardized samples to obtain their respective fixed-length hash values; then, an XOR operation is performed on the two fixed-length hash values. By utilizing the irreversibility and uniqueness of the XOR operation, a unique index address is finally generated to ensure that standardized samples with different attributes can be accurately distinguished.
[0119] All standardized samples that have completed standardization, structured annotation, and index construction are integrated to form a personalized enhanced sample set. This sample set covers all defect types and all production scenarios within the factory, while ensuring sufficient sample size, standardized data, and efficient access, fully adapting to the production characteristics and model training needs of the target textile factory.
[0120] It should be noted that the GAN model built to address the lack of samples uses a generator U-Net architecture combined with scene association information parameters and a discriminator CNN architecture to distinguish between real and generated samples. This ensures that the generated virtual samples can learn scene-specific defect features. After optimization of lighting, surface morphology, and texture features, the optical properties, defect morphology, and texture of the virtual samples are highly consistent with the real defects in the actual scene, thus solving the problems of insufficient real samples and poor adaptability of general virtual samples.
[0121] The supplementary samples are selected based on cosine similarity and duplicate feature samples are removed by deduplication algorithm, which effectively ensures the quality of the supplementary samples and avoids low-quality samples from interfering with model training. At the same time, the samples are accurately supplemented according to the sample gap, which not only meets the sample quantity requirements of the scenario, but also avoids sample redundancy.
[0122] All samples are preprocessed uniformly and labeled with structured tags (including basic, related information and attribute tags), and unique addresses are generated through hash indexing, so that the sample data is standardized and uniform, and the distinction is accurate, which greatly improves the efficiency of sample calling and feature matching during subsequent model training.
[0123] The resulting personalized enhanced sample set covers all defect types and production scenarios within the factory, with sufficient sample size and standardized data, fully adapting to the production characteristics of the target textile factory. This lays the core data foundation for the high-accuracy training of the subsequent defect detection model and the realization of the "defect identification - scenario matching" linkage function. At the same time, it connects with the gap marking of the defect sample collection module mentioned above, forming a closed loop of "sample gap identification - accurate supplementation - standardized integration".
[0124] The defect detection and risk warning module constructs a textile defect image detection model using a personalized enhanced sample set to detect textile defects and determine their compliance. It statistically analyzes non-compliant data during the monitoring period, calculates quality risk assessment values, matches textile processing quality levels, constructs a risk change curve, and calculates risk warning values. If a threshold is exceeded, a textile production and processing quality risk warning is triggered. The specific process is as follows:
[0125] Using the personalized enhanced sample set as training data, construct a textile defect image detection model adapted to the production characteristics of the target textile factory;
[0126] Further, the specific steps for constructing the textile defect image detection model are as follows:
[0127] Divide the personalized enhanced sample set into a training set, a validation set, and a test set according to a preset ratio, wherein the training set is used for model parameter learning, the validation set is used for iteratively optimizing hyperparameters (such as learning rate and number of convolution kernels), and the test set is used for evaluating the final performance of the model;
[0128] Adopt a lightweight CNN + attention mechanism architecture (inheriting the CNN foundation of the discriminator in the second module to reduce deployment costs), introduce a channel attention module to enhance defect feature extraction, and embed a hash index mapping association layer of the sample set to realize the linkage of defect recognition and scene matching;
[0129] Taking the cross-entropy loss function as the optimization objective, perform model training in combination with the adaptive momentum optimization algorithm (Adam), and use the validation set to monitor the model accuracy, recall rate and recognition delay in real time; suppress overfitting through gradient clipping, and complete model performance calibration based on the test set, to ensure that the model has a recognition accuracy of ≥98% for various defects in the target textile factory and a single image recognition delay of ≤50ms, meeting the rapid detection requirement;
[0130] Deploy the trained and optimized model to the production inspection terminal of the target textile factory, supporting both real-time image input and batch processing modes.
[0131] Acquire the to-be-inspected textile images produced by the target textile factory in each unit time;
[0132] For each to-be-inspected textile image, preprocess it and output it to the textile defect image detection model for defect detection, to identify whether there is a defect in the textile:
[0133] If a defect exists, determine that the textile is unqualified, and identify the type of the defect;
[0134] If no defect exists, determine that the textile is qualified;
[0135] Set a monitoring period, and acquire the real-time total number BS of unqualified textiles and the real-time occurrence frequency BF of unqualified textiles appearing on the production line within the monitoring period; wherein, the smaller the real-time total number BS of unqualified textiles and the real-time occurrence frequency BF of unqualified textiles, the fewer defects appear in the textiles output on the textile production and processing line, and the higher the overall processing quality of the textiles;
[0136] Non-conforming textiles are classified according to defect type, and the real-time total number of textiles with defects in each type is counted to obtain the real-time total number of non-conforming textiles QSr corresponding to each type of defect, using the formula: The cumulative impact value of the defect, QY, is obtained.
[0137] Where r is the defect category number, r=1,2,...,m; m is the total number of defect categories; Wr is the preset weight coefficient of the quality impact corresponding to the r-th defect; the larger the cumulative impact value of defects, the lower the overall quality of textiles produced on the textile production and processing line.
[0138] For each unit detection time within the monitoring period, after normalizing and dimensionlessly processing the real-time total number of non-conforming textiles (BS), the real-time occurrence frequency (BF) of non-conforming textiles, and the cumulative defect impact value (QY) corresponding to that unit detection time, the formula is used: The quality risk assessment value ZP is obtained; where b1, b2, and b3 are preset quality assessment weight coefficients.
[0139] Multiple textile processing quality grades are set, including: excellent, good, qualified, unqualified, etc.; each textile processing quality grade corresponds to a quality risk assessment value range, where the smaller the upper and lower limits of the quality risk assessment value range, the better the corresponding quality grade;
[0140] By matching the quality risk assessment value corresponding to the current unit detection time with the quality risk assessment value range corresponding to all textile processing quality levels, the corresponding textile processing quality level is output.
[0141] A two-dimensional Cartesian coordinate system is constructed with the quality risk assessment value on the vertical axis and time on the horizontal axis. By labeling the quality risk assessment values corresponding to the detection times of each unit within the monitoring period on the coordinate system, and connecting adjacent labeled data points based on time sequence, a quality risk change curve is obtained, as shown below. Figure 2 ;
[0142] The preset quality risk threshold line is defined as the area enclosed by the portion of the quality risk change curve that exceeds the preset quality risk threshold line during the monitoring period and the preset quality risk threshold line. The total threshold area YZ is obtained by summing all the threshold areas from the start time of monitoring to the current unit detection time.
[0143] The slope of the quality risk change curve between the current unit detection time and the previous unit detection time is obtained and denoted as the risk change slope FK.
[0144] After normalizing and dimensionlessly processing the threshold overshoot product YZ, risk change slope FK, and quality risk assessment value ZP corresponding to the current unit detection time, the risk warning value FYJ is obtained using the formula: FYJ=YZ×d1+FK×d2+ZP×d3, where d1, d2, and d3 are preset weight coefficients.
[0145] A preset risk warning threshold is set. If the risk warning value corresponding to the current unit detection time is greater than or equal to the corresponding preset threshold, a textile production and processing quality risk warning will be triggered, prompting staff to check for quality abnormalities in the current textile production process and to promptly investigate the processing and production process to avoid the generation of defective products in batches.
[0146] It should be noted that the core relies on the personalized enhanced sample set formed above for model training. This sample set covers all defect types and all production scenarios of the target textile factory. Moreover, the samples are closely related to the scenarios and the data is standardized and uniform. This provides a precise and targeted data foundation for the model to learn the factory-specific defect features in deep learning. It ensures that the constructed textile defect image detection model is fully adapted to the production characteristics of the target textile factory, and fundamentally solves the problem of insufficient detection accuracy caused by the mismatch between the general detection model and the specific factory materials, processes and scenarios.
[0147] Based on non-conforming data during the monitoring period, a quality risk assessment value is obtained through multi-dimensional calculation (total number of non-conformities, frequency, and cumulative impact value of defects). The value is matched with a preset level to achieve quantitative quality assessment. The quality trend is then presented intuitively with a risk change curve. The warning value is calculated by combining the threshold over-threshold product (cumulative over-threshold impact) and the risk change slope (quality change rate). This breaks through the limitations of single indicator warning, making risk assessment more comprehensive and warning more accurate.
[0148] Once a risk warning is triggered, it can prompt staff to investigate the production process, effectively preventing the mass production of defective products. At the same time, it can connect with the scenario-related information in the previous module to help trace the production scenario (such as process and environment) corresponding to the defect, providing direction for subsequent process optimization and forming a closed loop of production quality control of "detection-evaluation-early warning-rectification".
[0149] 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 textile production and processing quality identification system based on image analysis, characterized in that, include: Defect Sample Collection Module: Collects real samples of various defects from the target textile factory and corresponding defect association information, organizes them into a set of original samples of various defects, sets subdivided scenarios and matching combinations of association information parameters, matches to form scenario sample groups, calculates the number of samples required for subdivided scenarios, evaluates the sufficiency of scenario samples, and marks defects with sufficient or missing samples. Virtual Sample Generation and Supplement Module: To address the defects of missing samples, a generative adversarial network model is constructed based on the scene information to be supplemented. The generated virtual samples are optimized in terms of lighting, surface morphology, and texture features. Virtual defect supplementary samples are selected according to cosine similarity and merged with real samples to obtain a standardized sample set. The entire set of samples is organized, labeled, and a hash index is constructed to form a personalized enhanced sample set. Defect Detection and Risk Warning Module: Constructs a textile defect image detection model using a personalized enhanced sample set to detect textile defects and determine whether the textile is qualified or not; Non-compliant data during the statistical monitoring period are used to calculate quality risk assessment values, match textile processing quality levels, construct risk change curves, calculate risk warning values, and trigger quality risk warnings for textile production and processing when thresholds are exceeded.
2. The textile production and processing quality identification system based on image analysis according to claim 1, characterized in that: The process of forming scene sample groups is as follows: Collect real sample images of various defects and simultaneously record complete defect association information corresponding to each sample image. The defect association information includes defect type, textile material type, process parameters and collection environment attributes. For each type of defect, all its corresponding sample images are matched one by one with their respective defect association information to form an original sample set for a single type of defect. Based on the process parameters and actual production conditions in the field for each type of defect, a list of exclusive sub-scenarios for that type of defect is preset, and each sub-scenarios corresponds to a set of related information parameter matching combinations. The sample images and their associated information in the original sample set of each single type of defect are matched with the associated information parameters of each scene in the list of specific sub-scenes for that type of defect. The samples are then assigned to the corresponding sub-scenes to form several scene sample groups for that type of defect.
3. The textile production and processing quality identification system based on image analysis according to claim 2, characterized in that: The specific process for calculating the required sample size for each sub-scenarios and assessing the sufficiency of the scenario samples is as follows: A threshold for sufficient overall defect samples is set; for each sub-scenario, the number of times the corresponding defect occurs in that scenario within a preset time period is counted, and the ratio of this number to the total number of occurrences of that type of defect is taken as the scenario defect occurrence rate; By comprehensively analyzing the scene defect occurrence rate, scrap rate, and rework rate, the scene defect impact value is obtained; The defect impact values of all sub-scenarios under this type of defect are normalized to obtain the sample weight value of each scenario; Multiply the overall defect sample sufficiency threshold by the sample weight value of each scenario to obtain the required sample size for each sub-scenario; Count the actual number of samples in the scene sample group corresponding to each sub-scene. If the actual number is not less than the required number of samples, it is determined that the defect samples in the scene are sufficient, and a corresponding number of samples are selected from the scene sample group to form a standardized sample set. If the actual number is less than the required sample size, the scene is deemed to have insufficient defect samples and is marked as a scene defect sample to be supplemented.
4. The textile production and processing quality identification system based on image analysis according to claim 3, characterized in that: The specific process for marking sufficient or missing samples is as follows: Record the scene name to be supplemented for each scenario's defect samples, the matching combination of related information parameters, the required sample size, the actual number of samples, and the number of sample gaps; If all sub-scenarios have sufficient samples, each type of defect is marked as a sample-sufficient defect; if any sub-scenarios have insufficient samples, it is marked as a sample-missing defect.
5. The textile production and processing quality identification system based on image analysis according to claim 4, characterized in that: The specific process of constructing a generative adversarial network model and optimizing the lighting, surface morphology, and texture features of the generated virtual samples is as follows: For each type of missing sample defect, a generative adversarial network model is constructed based on all the scene information to be filled. In this model, the generator adopts the U-Net architecture, and the input random noise vector is matched and combined with the scene-related information parameters to learn scene-specific defect features. The discriminator adopts the CNN architecture, and the input image is matched and combined with the scene-related information parameters to output the true probability of the image. The training objective is to reduce the loss of the generator and the discriminator. For scenarios with missing samples, virtual samples are generated using a trained generative adversarial network model. The grayscale of the samples is adjusted according to the lighting parameters to match the optical characteristics of the actual scene. The morphological transformation is used to adjust the defect shape according to the fabric surface condition. The texture features are optimized according to the material type and process parameters to make the defect features fit the reality. Finally, virtual defect samples matching the scene are output.
6. The textile production and processing quality identification system based on image analysis according to claim 5, characterized in that: The specific process of selecting virtual defect supplementary samples and fusing them with real samples to obtain a standardized sample set is as follows: For each final virtual defect sample, the feature similarity between it and the corresponding real defect sample template in the scene is calculated using cosine similarity. Samples with similarity not lower than the corresponding preset threshold are selected as virtual defect supplementary samples. The corresponding number of supplementary samples are selected according to the gap in the scene samples to be supplemented, and fused with the existing real samples in the scene. After removing duplicate feature samples by deduplication algorithm, a standardized sample set of defects in the scene is obtained.
7. The textile production and processing quality identification system based on image analysis according to claim 6, characterized in that: The entire sample set is processed, labeled, and a hash index is constructed to form a personalized enhanced sample set. The specific process is as follows: Collect standardized sample sets for all scenarios with sufficient samples and standardized sample sets for all scenarios with missing samples, and organize them to form a full defect sample pool. Label each standardized sample in the full defect sample pool; Construct a hash index mapping based on a labeling system; All standardized samples that have undergone standardization, structured annotation, and index construction are integrated to form a personalized enhanced sample set.
8. The textile production and processing quality identification system based on image analysis according to claim 7, characterized in that: The specific process of constructing a defect image detection model for textiles, detecting the textiles to be inspected, and determining whether they are qualified or not is as follows: A model for detecting defects in textile images was constructed using a personalized enhanced sample set as training data. Acquire images of the textile products to be inspected produced by the target textile factory at each unit of time; For each textile image to be detected, the output is fed into the textile defect image detection model for defect detection, identifying whether the textile has defects: If defects are found, the textiles are deemed non-conforming, and the type of defect is identified. If no defects are found, the textile is deemed acceptable.
9. The textile production and processing quality identification system based on image analysis according to claim 8, characterized in that: The specific process for calculating the quality risk assessment value and matching the textile processing quality grade based on non-compliant data during the statistical monitoring period is as follows: Set a monitoring period and obtain the real-time total number and real-time frequency of non-conforming textiles on the production line during that period; Non-conforming textiles are classified according to defect type, and the total number of non-conforming textiles corresponding to each type of defect is counted in real time. Combined with the preset quality impact weight of each type of defect, the cumulative impact value of the defect is calculated. For each unit detection time within the monitoring period, the real-time total number of non-conforming textiles, real-time occurrence frequency, and cumulative impact value of defects corresponding to that time are normalized and dimensionless, and then combined with the preset quality assessment weights to obtain the quality risk assessment value. Multiple textile processing quality levels are set, and a corresponding quality risk assessment value range is preset for each level. The quality risk assessment value at the current unit testing time is matched with each range, and the corresponding textile processing quality level is output.
10. The textile production and processing quality identification system based on image analysis according to claim 9, characterized in that: Construct a risk change curve, calculate the risk warning value, and trigger a risk warning for the quality of textile production and processing if the threshold is exceeded. The specific process is as follows: A two-dimensional coordinate system is constructed with the quality risk assessment value as the vertical axis and time as the horizontal axis. The quality risk assessment values of each unit at the detection time within the monitoring period are marked, and the values are connected by a smooth curve in chronological order to obtain the quality risk change curve. The area of the statistical curve that exceeds the preset quality risk threshold is the threshold excess area. Summing up all threshold excess areas from the start of monitoring to the current moment yields the total threshold excess product. Obtain the slope of the curve between the current unit detection time and the previous unit detection time, and use it as the risk change slope; After normalizing and dimensionlessly processing the threshold over-limit product, risk change slope, and quality risk assessment value, the risk warning value is calculated in combination with the preset weight coefficients. If the current risk warning value is not lower than the preset threshold, a risk warning for the quality of textile production and processing will be triggered.
