Textile grey fabric defect visibility prediction method, system, medium and computer

The decision tree model predicts the visibility of textile grey fabric defects, which solves the problem of missing detection of defects in the image acquisition stage, achieves higher detection accuracy and stability, and reduces cost and manual dependence.

CN118644459BActive Publication Date: 2025-05-06SHANGHAI ZHIJING INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410783606.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2025-05-06
Estimated Expiration
2044-06-18

AI Technical Summary

Technical Problem

During the automated defect detection process of textile grey fabrics, the defects are not obvious in the image acquisition stage, making it difficult to solve the missed inspection problem. The existing methods are costly or rely on manual experience, and the stability and generalization are insufficient.

Method used

The decision tree model is used to predict the defect visibility of textile grey fabrics. By obtaining cloth type information from the database, data preprocessing and feature enhancement are performed, and the decision tree model is trained to predict the defect visibility of grey fabrics to be detected.

Benefits of technology

It effectively reduces the missed detection problem caused by the inconspicuous defects in the image acquisition stage, improves the accuracy and stability of the detection, reduces the dependence on artificial experience, and enhances the generalization of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118644459B_ABST
    Figure CN118644459B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, system, medium and computer for predicting the visibility of defects in textile grey fabrics; the present invention proposes a method for predicting the visibility of defects in grey fabrics based on the information of grey fabrics, which can effectively reduce the problem of missed detection of defects in grey fabrics caused by the fact that the defects in grey fabrics are not obvious during the image acquisition stage. This method aims at the problem of missed detection caused by the fact that the defects in grey fabrics are not obvious. By predicting in advance whether the defects in grey fabrics are obvious, it is judged whether the type of grey fabric is suitable for automated defect detection, thereby avoiding the problem of missed detection caused by using automated defect detection methods for types of fabrics whose defect imaging is not obvious, and improving the solution to missed detection of defects in grey fabrics, which is conducive to the further implementation and wide application of automated detection of defects in grey fabrics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of defect detection, and more specifically, to a method, system, medium and computer for predicting the visibility of defects in textile grey cloth. Background Art

[0002] With the promotion of vision-based deep learning algorithms in the field of industrial defect detection, the defect detection of grey cloth in the textile industry has also begun to shift from manual detection to automated detection. In the process of automated grey cloth defect detection, missed detection of defects is a common problem. Missed detection causes defective grey cloth to be mistaken for good grey cloth, which may cause losses in subsequent production and sales. Reducing missed detection is of great significance for the continued and widespread application of automated detection of grey cloth defects.

[0003] The problem of missed detection in the automated detection of grey cloth defects has not yet been completely solved. The automated detection process of grey cloth defects is generally implemented in two stages, namely the image acquisition stage and the image detection stage. The current missed detection solution is mainly concentrated in the image detection stage. Although the missed detection problem can be partially solved by improving the algorithm model, the missed detection problem in the image acquisition stage has not yet been well solved.

[0004] During the image acquisition stage, some defects are not obvious or significant. It is difficult for the human eye to identify such defects in the picture, which makes it impossible to label the data and leads to missed detection. The solutions to the above problems mainly include: 1. Upgrading the image acquisition equipment to improve the image clarity and the display effect of the photos so that the relevant staff can identify and mark the defects in the photos; 2. Through workers' advance estimation of whether the human eye can identify the defects, the defects that cannot be identified by the human eye are changed to manual detection to reduce the problem of missed detection. However, method 1 has the problem of high cost. The large-scale use of high-definition cameras will significantly increase the operating costs of the enterprise, and the recognition of high-definition photos will also put forward higher requirements for computing power; method 2 has the problems of weak stability, poor generalization, and poor scalability. The manual judgment method is highly dependent on the work experience of workers, and this method is difficult to use on a large scale.

[0005] Moreover, before the actual production stage, it is difficult to judge whether the defects of a certain grey cloth are obvious and easy to be observed by photos taken by a camera. Relevant staff need to make predictions about the grey cloth based on their own experience and the textile process of the grey cloth. Such pre-judgment has the problems of low accuracy, low efficiency and low stability. Summary of the invention

[0006] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a method, system, medium and computer for predicting the visibility of defects in textile grey fabrics, so as to overcome the AAAA shortcomings existing in the prior art.

[0007] The above technical objectives of the present invention are achieved through the following technical solutions: A method for predicting visibility of defects in textile grey fabrics, comprising:

[0008] S1, obtaining first feature data for training a decision tree from a database;

[0009] S2, preprocessing the abnormal values, missing values ​​and text data in the first feature data to obtain second feature data;

[0010] S3, performing feature enhancement on the second feature data to obtain third feature data;

[0011] S4, inputting the third feature data into a pre-established first decision tree model for training to obtain a trained second decision tree model;

[0012] S5. Obtain fourth characteristic data of the grey cloth to be predicted, input the fourth characteristic data into the second decision tree model for prediction, and obtain a prediction result.

[0013] Optionally, the obtaining first feature data for training the decision tree from a database includes:

[0014] The cloth type information corresponding to each grey cloth fabric is obtained from the current production database; the cloth type information includes: loom type, organization structure, warp yarn count, weft yarn count, warp yarn density and weft yarn density.

[0015] Optionally, preprocessing the abnormal values, missing values, and text data in the first feature data to obtain the second feature data includes:

[0016] Obtain all first fabric type information represented by numerical data; draw box plots corresponding to each fabric type information; determine the 0 percentile value and the 100 percentile value corresponding to each first fabric type information according to the box plots; mark the data less than the 0 percentile value and the data greater than the 100 percentile value in the data corresponding to each first fabric type information as abnormal values, and remove the abnormal values ​​from the first feature data;

[0017] The number of grey cloth types is obtained, recorded as a first value; the number of missing values ​​corresponding to each type of cloth information is obtained, recorded as a second value; the ratio of each second value to the first value is calculated, recorded as a missing ratio; each missing ratio is compared with a preset ratio threshold, and when the missing ratio is less than the ratio threshold, the data of all grey cloth types corresponding to the missing ratio are deleted; when the missing ratio is greater than or equal to the preset ratio threshold, each missing data corresponding to the missing ratio is filled;

[0018] All second cloth type information represented by text data is obtained, and the text data corresponding to each second cloth type information is mapped into numbers.

[0019] Optionally, the second fabric type information includes: loom type and weave structure type;

[0020] The loom types include: air jet loom and water jet loom;

[0021] The types of weave structures include: plain weave, twill weave, satin weave and others;

[0022] The step of mapping the text data corresponding to each second type of information into numbers includes:

[0023] Map the air jet loom to number 0; map the water jet loom to number 1;

[0024] Map plain to number 0; twill to number 1; satin to number 2; and everything else to number 3.

[0025] Optionally, performing feature enhancement on the second feature data to obtain third feature data includes:

[0026] According to the warp yarn count S of each grey fabric 1 , corresponding to the calculation of the warp yarn diameter D of the grey cloth 1 :

[0027]

[0028] According to the weft yarn count S of each grey fabric 2 , corresponding to the calculation of the weft diameter D of the grey cloth 2 :

[0029]

[0030] According to the warp yarn count S of each grey fabric 1 And the warp density B of each grey fabric 1 , corresponding to the calculation of the warp yarn tightness A of the grey cloth 1 :

[0031]

[0032] According to the weft yarn count S of each grey fabric 2 And the weft density B of each grey fabric 2 , corresponding to the calculation of the weft yarn tightness A of the grey cloth 2 :

[0033]

[0034] The second characteristic data, the warp yarn diameter D 1 , weft yarn diameter D 2 , Warp yarn tightness A 1 And the weft yarn tightness A 2 The combined data is recorded as the third feature data.

[0035] Optionally, the step of inputting the third feature data into a pre-established first decision tree model for training to obtain a trained second decision tree model includes:

[0036] Search the hyperparameters in the first decision tree model to obtain three hyperparameters: maximum depth of decision tree, decision tree evaluation criteria, and decision tree division principle;

[0037] The maximum depth search range of the decision tree is set to 2-10;

[0038] The decision tree evaluation criteria search range is set to two modes: 'gini' and 'entropy';

[0039] The search range of the decision tree partitioning principle is set to two modes: 'best' and 'random'.

[0040] Optionally, the step of inputting the third feature data into a pre-established first decision tree model for training to obtain a trained second decision tree model further includes:

[0041] The decision tree model corresponding to each hyperparameter setting mode is recorded as the first decision tree model;

[0042] Divide the third feature data into five sub-feature data evenly, use four of the sub-feature data as training sets, and use the remaining one as a validation set, to obtain five training sets and five validation sets;

[0043] Using five training sets to train each first decision tree model, five corresponding transition decision tree models are obtained; using five validation sets to validate the five transition decision tree models, five validation results are obtained; and the average of the five validation results is calculated as the prediction accuracy corresponding to the first decision tree model.

[0044] The five first decision tree models with the highest prediction accuracy are all recorded as second decision tree models.

[0045] Optionally, the acquiring of fourth characteristic data of the grey cloth to be predicted, inputting the fourth characteristic data into the second decision tree model for prediction, and obtaining a prediction result includes:

[0046] The fourth characteristic data is respectively input into five second decision tree models for prediction to obtain five sub-prediction results, and the average value of the five sub-prediction results is calculated and recorded as the prediction result.

[0047] A textile grey fabric defect visibility prediction system, comprising:

[0048] Data acquisition module: used to acquire first feature data for training the decision tree from a database;

[0049] Data preprocessing module: used for preprocessing abnormal values, missing values ​​and text data in the first feature data to obtain second feature data;

[0050] Data enhancement module: used for performing feature enhancement on the second feature data to obtain third feature data;

[0051] Model training module: used for inputting the third feature data into a pre-established first decision tree model for training to obtain a trained second decision tree model;

[0052] Result prediction module: used for obtaining the fourth characteristic data of the grey cloth to be predicted, inputting the fourth characteristic data into the second decision tree model for prediction, and obtaining the prediction result.

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

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

[0055] In summary, the present invention has the following beneficial effects: The present invention proposes a method for predicting the visibility of grey cloth defects based on grey cloth information, which can effectively reduce the problem of missed detection of grey cloth defects caused by the lack of obvious grey cloth defects during the image acquisition stage. This method aims at the problem of missed detection caused by the lack of obvious grey cloth defects. By predicting in advance whether the grey cloth defects are obvious, it is judged whether the grey cloth type is suitable for automated defect detection, thereby avoiding the problem of missed detection caused by using automated defect detection methods for cloth types with unclear defect imaging, and improving the solution to missed detection of grey cloth defects, which is conducive to the further implementation and wide application of automated detection of grey cloth defects. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a flow chart of the method for predicting visibility of defects in textile grey fabrics of the present invention;

[0057] Figure 2 The structure diagram of the textile grey fabric defect visibility prediction system of the present invention;

[0058] Figure 3 1 is a diagram showing the internal structure of a computer device in an embodiment of the present invention.

[0059] In the figure: 1. Data acquisition module; 2. Data preprocessing module; 3. Data enhancement module; 4. Model training module; 5. Result prediction module. DETAILED DESCRIPTION

[0060] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. Several embodiments of the present invention are shown in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein.

[0061] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances. The terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.

[0062] In the present invention, unless otherwise clearly specified and limited, the first feature being "above" or "below" the second feature may include the first and second features being in direct contact, or may include the first and second features being in contact not directly but through another feature between them. Moreover, the first feature being "above", "above" and "above" the second feature includes the first feature being directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. The first feature being "below", "below" and "below" the second feature includes the first feature being directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature. The terms "vertical", "horizontal", "left", "right", "above", "below" and similar expressions are for illustrative purposes only, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.

[0063] The present invention is described in detail below in conjunction with the accompanying drawings and embodiments.

[0064] The present invention provides a method for predicting the visibility of defects in textile grey fabrics, such as Figure 1 As shown, including:

[0065] S1, obtaining first feature data for training a decision tree from a database;

[0066] S2, preprocessing the abnormal values, missing values ​​and text data in the first feature data to obtain second feature data;

[0067] S3, performing feature enhancement on the second feature data to obtain third feature data;

[0068] S4, inputting the third feature data into a pre-established first decision tree model for training to obtain a trained second decision tree model;

[0069] S5. Obtain fourth characteristic data of the grey cloth to be predicted, input the fourth characteristic data into the second decision tree model for prediction, and obtain a prediction result.

[0070] In practical applications, defect missed detection is a common problem in the process of automated grey cloth defect detection. Missed detection causes defective grey cloth to be mistaken for good grey cloth, which may cause losses in subsequent production and sales. Reducing missed detection is of great significance for the continued and widespread application of automated detection of grey cloth defects. The automated detection process of grey cloth defects is generally implemented in two stages, namely the image acquisition stage and the image detection stage. The current missed detection solution is mainly concentrated in the image detection stage. Although the missed detection problem has been partially solved, the missed detection problem in the image acquisition stage has not been well solved. Because in the image acquisition stage, due to the characteristics of some defects that are not obvious or significant, it is difficult for the human eye to identify such defects in the picture, resulting in the inability to label data and then missed detection. Such defects are difficult to reduce the probability of missed detection through optimization algorithms. At present, in the automated grey cloth defect detection, the missed detection problem caused by the unclear and insignificant defects in the image acquisition stage is mainly optimized by manual methods. Experienced cloth inspectors or weavers predict whether the defects of the cloth to be woven are clearly visible to the human eye based on the cloth surface information, organization method and some other characteristics of the cloth to be woven. For cloth types that may have subtle or insignificant defects, avoid using automated detection methods for defect detection and use manual defect detection instead, thereby reducing the situation where defective grey cloth is mistaken for good grey cloth and reducing the impact on subsequent production and sales processes. Although this method has certain effects, it still has the following defects: First, this method has high requirements on the experience of workers and requires experienced workers to make predictions. When different workers make predictions, the prediction results may have large deviations, and it is highly dependent on specific workers and lacks stability. Secondly, this method is suitable for predicting the current long-woven fabrics. For new fabrics or fabrics with characteristics that are very different from the current long-woven fabrics, the prediction effect is not good and there is a problem of weak generalization.

[0071] In response to the above technical problems, this application uses machine learning methods to establish a model between the information of the type of cloth to be produced and the visibility of defect imaging, which can simulate the process of experienced textile workers predicting the visibility of defects based on the information of the type of cloth to be woven, and the prediction process is more efficient, the prediction results have stronger stability, and the prediction model has stronger generalization. Experienced textile workers can infer the approximate surface texture of the grey cloth to be woven through some main parameters and information of the grey cloth to be woven, such as yarn type, organizational structure, warp and weft count, warp and weft density, etc., and then predict whether the defects of the grey cloth are not obvious or clear. Using machine learning methods to model the main parameters, information and visibility of grey cloth defects, compared with manual prediction, a larger amount of data can be used to train the model. The model obtained based on more data and richer data will also have stronger generalization and robustness when making model predictions.

[0072] Specifically, the present invention selects the decision tree model in machine learning as the main modeling method. The main reason is that the decision tree model has strong interpretability, and the generated decision tree model can be further verified or combined with artificial experience. First, the main features are selected, and then the data of the relevant features are processed. After that, the features are enhanced based on the main features, and the decision tree model is trained and verified using the enhanced data. Finally, a decision tree model that meets the requirements is obtained and used for subsequent predictions.

[0073] Furthermore, the obtaining of first feature data for training the decision tree from a database includes:

[0074] The cloth type information corresponding to each grey cloth fabric is obtained from the current production database; the cloth type information includes: loom type, organization structure, warp yarn count, weft yarn count, warp yarn density and weft yarn density.

[0075] In practical applications, the table reading tool in the Pandas library is used to complete the reading of table data. For the read data, each row is various information of a cloth type, and each column is the information of the same type of cloth type. In this embodiment, the following feature data of each cloth type are mainly selected to train the decision tree model, including: loom type (the type of textile machine that produces the cloth type, common types are air-jet textile machines and water-jet textile machines), organizational structure (texture structure category of the cloth type, common ones include plain weave, twill, satin, etc.), warp yarn count and weft yarn count, warp yarn density and weft yarn density (in inches / root).

[0076] Furthermore, the preprocessing of the abnormal values, missing values ​​and text data in the first feature data to obtain the second feature data includes:

[0077] Obtain all first fabric type information represented by numerical data; draw box plots corresponding to each fabric type information; determine the 0 percentile value and the 100 percentile value corresponding to each first fabric type information according to the box plots; mark the data less than the 0 percentile value and the data greater than the 100 percentile value in the data corresponding to each first fabric type information as abnormal values, and remove the abnormal values ​​from the first feature data;

[0078] The number of grey cloth types is obtained, recorded as a first value; the number of missing values ​​corresponding to each type of cloth information is obtained, recorded as a second value; the ratio of each second value to the first value is calculated, recorded as a missing ratio; each missing ratio is compared with a preset ratio threshold, and when the missing ratio is less than the ratio threshold, the data of all grey cloth types corresponding to the missing ratio are deleted; when the missing ratio is greater than or equal to the preset ratio threshold, each missing data corresponding to the missing ratio is filled;

[0079] All second cloth type information represented by text data is obtained, and the text data corresponding to each second cloth type information is mapped into numbers.

[0080] In practical applications, raw data may often contain abnormal, missing, and unstructured data, which is difficult to use directly as training data for machine learning models. This patent mainly processes raw data in three aspects, as follows:

[0081] Outlier elimination. This mainly processes the numerical data in the same type of fabric information and eliminates the abnormal data in the original data. By drawing a box plot of each numerical feature, we can obtain the 0 percentile value, 25 percentile value, 50 percentile value, 75 percentile value, and 100 percentile value, respectively. The data below the 0 percentile and above the 100 percentile are identified as outliers, and the fabric information they represent is eliminated from the training data.

[0082] Take a set of 14 numbers as an example to explain the outliers: 12, 15, 17, 19, 20, 23, 25, 28, 30, 33, 34, 35, 36, 37;

[0083] 25th percentile value Q 25 The calculation process is as follows:

[0084] First calculate the 25th percentile value Q 25 Location LQ 25 :LQ 25 =(14+1)*0.25=3.75;

[0085] Then calculate the 25th percentile value Q25 The actual value of Q 25 =0.25*17+0.75*19=18.5;

[0086] 50th percentile value Q 25 The calculation process is as follows:

[0087] First calculate the 50th percentile value Q 50 Location LQ 50 :LQ 50 =(14+1)*0.5=7.5;

[0088] Then calculate the 50th percentile value Q 50 The actual value of Q 50 =0.5*25+0.5*28=26.5;

[0089] 75th percentile value Q 75 The calculation process is as follows:

[0090] First calculate the 75th percentile value Q 75 Location LQ 75 :LQ 75 =(14+1)*0.75=11.25;

[0091] Then calculate the 75th percentile value Q 75 The actual value of Q 75 =0.75*34+0.25*35=34.25;

[0092] Calculate the interquartile range IQR: IQR = Q 75 -Q 25 =34.25-18.5=15.75;

[0093] Calculate the upper limit based on the interquartile range IQR: Q 100 =Q 75 +1.5*IQR=57.875;

[0094] Calculate the lower limit based on the interquartile range IQR: Q 0 =Q 25 -1.5*IQR=-5.125; that is to say, data greater than 57.875 and data less than -5.125 are recorded as outliers and deleted. The deletion here means deleting the grey cloth information corresponding to the outlier as a whole to avoid incomplete data affecting the model training.

[0095] Missing value processing. It mainly processes the missing data of the distribution. When the number of missing data accounts for a small proportion of the total data, such as less than 10%, it is preferred to delete the missing data to handle the missing values, so as to minimize the adverse effects of missing value filling on the model effect. When the number of missing data accounts for a large proportion of the total data, such as greater than or equal to 10%, it is preferred to fill the missing values, and the median of the current feature is preferred to fill the missing values.

[0096] Category mapping. For text data, it is necessary to convert it into categories through manual division before use. In this patent, the loom types and organizational structures are mapped into categories. Among them, there are two main types of looms, namely air jet looms and water jet looms, which are mapped to numbers 0 and 1 respectively. In addition, there are four main organizational structures, namely plain weave, twill, satin, and others, which are mapped to numbers 0, 1, 2, and 3 respectively.

[0097] Furthermore, the second fabric type information includes: loom type and weave structure type;

[0098] The loom types include: air jet loom and water jet loom;

[0099] The types of weave structures include: plain weave, twill weave, satin weave and others;

[0100] The step of mapping the text data corresponding to each second type of information into numbers includes:

[0101] Map the air jet loom to number 0; map the water jet loom to number 1;

[0102] Map plain to number 0; twill to number 1; satin to number 2; and everything else to number 3.

[0103] Further, feature enhancement is performed on the second feature data to obtain third feature data, including:

[0104] According to the warp yarn count S of each grey fabric 1 , corresponding to the calculation of the warp yarn diameter D of the grey cloth 1 :

[0105]

[0106] According to the weft yarn count S of each grey fabric 2 , corresponding to the calculation of the weft diameter D of the grey cloth 2 :

[0107]

[0108] According to the warp yarn count S of each grey fabric 1And the warp density B of each grey fabric 1 , corresponding to the calculation of the warp yarn tightness A of the grey cloth 1 :

[0109]

[0110] According to the weft yarn count S of each grey fabric 2 And the weft density B of each grey fabric 2 , corresponding to the calculation of the weft yarn tightness A of the grey cloth 2 :

[0111]

[0112] The second characteristic data, the warp yarn diameter D 1 , weft yarn diameter D 2 , Warp yarn tightness A 1 And the weft yarn tightness A 2 The combined data is recorded as the third feature data.

[0113] In practical applications, feature enhancement. After data processing, the feature information of the cloth has been improved. In order to make the model more expressive, the existing features are used to generate more features. The specific steps are as follows:

[0114] a) Generate warp and weft diameters. The warp and weft diameters represent the thickness of the warp and weft yarns. The thickness of the yarn affects the texture of the fabric and may further affect the visibility of defects. The warp and weft diameters are mainly related to their count s, and are calculated using the following formula: diameter = 0.037*(590.5 / s)^(1 / 2).

[0115] b) Generate warp tightness and weft tightness. The warp tightness and weft tightness are calculated from the count and density. Taking the count and density into consideration, they express the tightness of the grey cloth surface, which affects the visibility of the defects of the grey cloth to a certain extent. It is obtained by the following formula: tightness = density / sqrt(count), where sqrt() represents square root operation.

[0116] Furthermore, the step of inputting the third feature data into a pre-established first decision tree model for training to obtain a trained second decision tree model includes:

[0117] Search the hyperparameters in the first decision tree model to obtain three hyperparameters: maximum depth of decision tree, decision tree evaluation criteria, and decision tree division principle;

[0118] The maximum depth search range of the decision tree is set to 2-10;

[0119] The decision tree evaluation criteria search range is set to two modes: 'gini' and 'entropy';

[0120] The search range of the decision tree partitioning principle is set to two modes: 'best' and 'random'.

[0121] In practical applications, a) Decision tree model parameter search. In order to obtain the decision tree model with the best prediction effect, three hyperparameters of the decision tree model are searched, namely, the maximum depth of the decision tree, the evaluation criteria of the decision tree, and the partitioning principle of the decision tree. In order to avoid overfitting of the decision tree, the depth search range of the decision number is set to 2-10, the search range of the evaluation criteria of the decision number is set to the two modes of 'gini' and 'entropy', and the search range of the partitioning criteria of the decision tree is set to the two modes of 'best' and 'random'.

[0122] Furthermore, the step of inputting the third feature data into a pre-established first decision tree model for training to obtain a trained second decision tree model further includes:

[0123] The decision tree model corresponding to each hyperparameter setting mode is recorded as the first decision tree model;

[0124] Divide the third feature data into five sub-feature data evenly, use four of the sub-feature data as training sets, and use the remaining one as a validation set, to obtain five training sets and five validation sets;

[0125] Using five training sets to train each first decision tree model, five corresponding transition decision tree models are obtained; using five validation sets to validate the five transition decision tree models, five validation results are obtained; and the average of the five validation results is calculated as the prediction accuracy corresponding to the first decision tree model.

[0126] The five first decision tree models with the highest prediction accuracy are all recorded as second decision tree models.

[0127] In practical applications, in order to obtain the decision tree model with the best prediction effect, the three hyperparameters of the decision tree model are searched, namely the maximum depth of the decision tree, the evaluation criteria of the decision tree, and the partitioning principle of the decision tree. In order to avoid overfitting of the decision tree, the depth search range of the decision number is set to 2-10, the search range of the evaluation criteria of the decision number is set to the two modes of 'gini' and 'entropy', and the search range of the partitioning criteria of the decision tree is set to the two modes of 'best' and 'random'.

[0128] Furthermore, the method of obtaining the fourth characteristic data of the grey cloth to be predicted, inputting the fourth characteristic data into the second decision tree model for prediction, and obtaining a prediction result includes: inputting the fourth characteristic data into five second decision tree models for prediction, obtaining five sub-prediction results, and calculating the average value of the five sub-prediction results, which is recorded as the prediction result.

[0129] In practical applications, in order to make the model more generalizable and have balanced and good prediction results on all data, the input data is evenly divided into 5 parts. For each hyperparameter combination, 4 parts of the data are used to train the model in turn, and the remaining 1 part of the data is used to verify the trained model. Each set of hyperparameters will train 5 decision tree models, and the average value of the verification results of the 5 decision tree models will be used as the verification set accuracy of the current hyperparameter combination. The 5 decision tree models with the highest verification set accuracy corresponding to the hyperparameters are output as the optimal model. Model prediction. The fabric features to be predicted are input into the selected 5 models respectively to obtain 5 prediction results, and the average of the 5 results is taken as the final prediction result of the current fabric defect visibility.

[0130] like Figure 2 As shown, the present invention also provides a textile grey fabric defect visibility prediction system, comprising:

[0131] Data acquisition module: used to acquire first feature data for training the decision tree from a database;

[0132] Data preprocessing module: used for preprocessing abnormal values, missing values ​​and text data in the first feature data to obtain second feature data;

[0133] Data enhancement module: used for performing feature enhancement on the second feature data to obtain third feature data;

[0134] Model training module: used for inputting the third feature data into a pre-established first decision tree model for training to obtain a trained second decision tree model;

[0135] Result prediction module: used for obtaining the fourth characteristic data of the grey cloth to be predicted, inputting the fourth characteristic data into the second decision tree model for prediction, and obtaining the prediction result.

[0136] For the specific limitations of the textile grey fabric defect visibility prediction system, please refer to the limitations of the textile grey fabric defect visibility prediction method mentioned above, which will not be repeated here. Each module in the above-mentioned textile grey fabric defect visibility prediction system can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0137] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the method for predicting the visibility of defects in textile grey fabrics is implemented.

[0138] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0139] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0140] S1, obtaining first feature data for training a decision tree from a database;

[0141] S2, preprocessing the abnormal values, missing values ​​and text data in the first feature data to obtain second feature data;

[0142] S3, performing feature enhancement on the second feature data to obtain third feature data;

[0143] S4, inputting the third feature data into a pre-established first decision tree model for training to obtain a trained second decision tree model;

[0144] S5. Obtain fourth characteristic data of the grey cloth to be predicted, input the fourth characteristic data into the second decision tree model for prediction, and obtain a prediction result.

[0145] In one embodiment, the step of obtaining first feature data for training a decision tree from a database includes:

[0146] The cloth type information corresponding to each grey cloth fabric is obtained from the current production database; the cloth type information includes: loom type, organization structure, warp yarn count, weft yarn count, warp yarn density and weft yarn density.

[0147] In one embodiment, preprocessing the abnormal values, missing values, and text data in the first feature data to obtain the second feature data includes:

[0148] Obtain all first fabric type information represented by numerical data; draw box plots corresponding to each fabric type information; determine the 0 percentile value and the 100 percentile value corresponding to each first fabric type information according to the box plots; mark the data less than the 0 percentile value and the data greater than the 100 percentile value in the data corresponding to each first fabric type information as abnormal values, and remove the abnormal values ​​from the first feature data;

[0149] The number of grey cloth types is obtained, recorded as a first value; the number of missing values ​​corresponding to each type of cloth information is obtained, recorded as a second value; the ratio of each second value to the first value is calculated, recorded as a missing ratio; each missing ratio is compared with a preset ratio threshold, and when the missing ratio is less than the ratio threshold, the data of all grey cloth types corresponding to the missing ratio are deleted; when the missing ratio is greater than or equal to the preset ratio threshold, each missing data corresponding to the missing ratio is filled;

[0150] All second cloth type information represented by text data is obtained, and the text data corresponding to each second cloth type information is mapped into numbers.

[0151] In one embodiment, the second fabric type information includes: loom type and weave structure type;

[0152] The loom types include: air jet loom and water jet loom;

[0153] The types of weave structures include: plain weave, twill weave, satin weave and others;

[0154] The step of mapping the text data corresponding to each second type of information into numbers includes:

[0155] Map the air jet loom to number 0; map the water jet loom to number 1;

[0156] Map plain to number 0; twill to number 1; satin to number 2; and everything else to number 3.

[0157] In one embodiment, the second feature data is enhanced to obtain third feature data, including:

[0158] According to the warp yarn count S of each grey fabric 1 , corresponding to the calculation of the warp yarn diameter D of the grey cloth 1 :

[0159]

[0160] According to the weft yarn count S of each grey fabric 2 , corresponding to the calculation of the weft diameter D of the grey cloth 2 :

[0161]

[0162] According to the warp yarn count S of each grey fabric 1 And the warp density B of each grey fabric 1 , corresponding to the calculation of the warp yarn tightness A of the grey cloth 1 :

[0163]

[0164] According to the weft yarn count S of each grey fabric 2 And the weft density B of each grey fabric 2 , corresponding to the calculation of the weft yarn tightness A of the grey cloth 2 :

[0165]

[0166] The second characteristic data, the warp yarn diameter D 1 , weft yarn diameter D 2 , Warp yarn tightness A 1 And the weft yarn tightness A 2 The combined data is recorded as the third feature data.

[0167] In one embodiment, the step of inputting the third feature data into a pre-established first decision tree model for training to obtain a trained second decision tree model includes:

[0168] Search the hyperparameters in the first decision tree model to obtain three hyperparameters: maximum depth of decision tree, decision tree evaluation criteria, and decision tree division principle;

[0169] The maximum depth search range of the decision tree is set to 2-10;

[0170] The decision tree evaluation criteria search range is set to two modes: 'gini' and 'entropy';

[0171] The search range of the decision tree partitioning principle is set to two modes: 'best' and 'random'.

[0172] In one embodiment, the step of inputting the third feature data into a pre-established first decision tree model for training to obtain a trained second decision tree model further includes:

[0173] The decision tree model corresponding to each hyperparameter setting mode is recorded as the first decision tree model;

[0174] Divide the third feature data into five sub-feature data evenly, use four of the sub-feature data as training sets, and use the remaining one as a validation set, to obtain five training sets and five validation sets;

[0175] Using five training sets to train each first decision tree model, five corresponding transition decision tree models are obtained; using five validation sets to validate the five transition decision tree models, five validation results are obtained; and the average of the five validation results is calculated as the prediction accuracy corresponding to the first decision tree model.

[0176] The five first decision tree models with the highest prediction accuracy are all recorded as second decision tree models.

[0177] In one embodiment, the obtaining of the fourth characteristic data of the grey cloth to be predicted, inputting the fourth characteristic data into the second decision tree model for prediction, and obtaining the prediction result includes:

[0178] The fourth characteristic data is respectively input into five second decision tree models for prediction to obtain five sub-prediction results, and the average value of the five sub-prediction results is calculated and recorded as the prediction result.

[0179] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0180] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0181] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A method for predicting visibility of defects in textile grey fabrics, characterized in that: include: S1. Obtaining first feature data for training a decision tree from a database, including: Acquire the fabric type information corresponding to each grey fabric from the current production database; the fabric type information includes: loom type, organization structure, warp yarn count, weft yarn count, warp yarn density and weft yarn density; S2. Preprocessing the abnormal values, missing values ​​and text data in the first feature data to obtain second feature data, including: Obtain all first fabric type information represented by numerical data; draw box plots corresponding to each fabric type information; determine the 0 percentile value and the 100 percentile value corresponding to each first fabric type information according to the box plots; mark the data less than the 0 percentile value and the data greater than the 100 percentile value in the data corresponding to each first fabric type information as abnormal values, and remove the abnormal values ​​from the first feature data; The number of grey cloth types is obtained, recorded as a first value; the number of missing values ​​corresponding to each type of cloth information is obtained, recorded as a second value; the ratio of each second value to the first value is calculated, recorded as a missing ratio; each missing ratio is compared with a preset ratio threshold, and when the missing ratio is less than the ratio threshold, the data of all grey cloth types corresponding to the missing ratio are deleted; when the missing ratio is greater than or equal to the preset ratio threshold, each missing data corresponding to the missing ratio is filled; Acquire all second cloth type information represented by text data, and map the text data corresponding to each second cloth type information into numbers; S3, performing feature enhancement on the second feature data to obtain third feature data; S4, inputting the third feature data into a pre-established first decision tree model for training to obtain a trained second decision tree model; S5. Obtain fourth characteristic data of the grey cloth to be predicted, input the fourth characteristic data into the second decision tree model for prediction, and obtain a prediction result.

2. The method for predicting the visibility of defects in textile grey fabrics according to claim 1, characterized in that: The second fabric type information includes: loom type and weave structure type; The loom types include: air jet loom and water jet loom; The types of weave structures include: plain weave, twill weave, satin weave and others; The step of mapping the text data corresponding to each second type of information into numbers includes: Map the air jet loom to number 0; map the water jet loom to number 1; Map plain to number 0; twill to number 1; satin to number 2; and everything else to number 3.

3. The method for predicting visibility of defects in textile grey fabrics according to claim 1, characterized in that: Performing feature enhancement on the second feature data to obtain third feature data includes: According to the warp yarn count S1 of each grey cloth, the warp yarn diameter D1 of the grey cloth is calculated accordingly: According to the weft yarn count S2 of each grey fabric, the weft yarn diameter D2 of the grey fabric is calculated accordingly: According to the warp yarn count S1 and the warp yarn density B1 of each grey cloth, the warp yarn tightness A1 of the grey cloth is calculated accordingly: According to the weft yarn count S2 and weft yarn density B2 of each grey fabric, the weft yarn tightness A2 of the grey fabric is calculated accordingly: The second characteristic data, the warp yarn diameter D1, the weft yarn diameter D2, the warp yarn tightness A1 and the weft yarn tightness A2 are combined and recorded as the third characteristic data.

4. The method for predicting the visibility of defects in textile grey fabrics according to claim 1, characterized in that: The step of inputting the third feature data into a pre-established first decision tree model for training to obtain a trained second decision tree model comprises: Search the hyperparameters in the first decision tree model to obtain three hyperparameters: maximum depth of decision tree, decision tree evaluation criteria, and decision tree division principle; The maximum depth search range of the decision tree is set to 2-10; The decision tree evaluation criteria search range is set to two modes: 'gini' and 'entropy'; The search range of the decision tree partitioning principle is set to two modes: 'best' and 'random'.

5. The method for predicting visibility of defects in textile grey fabrics according to claim 4, characterized in that: The step of inputting the third feature data into a pre-established first decision tree model for training to obtain a trained second decision tree model further includes: The decision tree model corresponding to each hyperparameter setting mode is recorded as the first decision tree model; The third feature data is evenly divided into five sub-feature data, four of the sub-feature data are used as training sets, and the remaining one is used as a verification set, to obtain five training sets and five verification sets; Using five training sets to train each first decision tree model, five corresponding transition decision tree models are obtained; using five validation sets to validate the five transition decision tree models, five validation results are obtained; and the average of the five validation results is calculated as the prediction accuracy corresponding to the first decision tree model. The five first decision tree models with the highest prediction accuracy are all recorded as second decision tree models.

6. The method for predicting the visibility of defects in textile grey fabrics according to claim 5, characterized in that: The step of obtaining the fourth characteristic data of the grey cloth to be predicted, inputting the fourth characteristic data into the second decision tree model for prediction, and obtaining the prediction result comprises: The fourth characteristic data is respectively input into five second decision tree models for prediction to obtain five sub-prediction results, and the average value of the five sub-prediction results is calculated and recorded as the prediction result.

7. A system for predicting the visibility of defects in textile grey fabrics, characterized in that: include: Data acquisition module: used to acquire first feature data for training the decision tree from the database, including: acquiring fabric type information corresponding to each grey fabric from the current production database; the fabric type information includes: loom type, organization structure, warp yarn count, weft yarn count, warp yarn density and weft yarn density; Data preprocessing module: used to preprocess the abnormal values, missing values ​​and text data in the first feature data to obtain the second feature data, including: obtaining all the first fabric information represented by numerical type data; drawing the box plots corresponding to each fabric information; determining the 0 percentile value and the 100 percentile value corresponding to each first fabric information according to the box plots; marking the data less than the 0 percentile value and the data greater than the 100 percentile value in the data corresponding to each first fabric information as abnormal values, and removing the abnormal values ​​from the first feature data; obtaining the number of grey cloth types, recorded as the first value; obtaining the number of missing values ​​corresponding to each fabric information, recorded as the second value; calculating the proportion of each second value to the first value, recorded as the missing proportion; comparing each missing proportion with a preset proportion threshold, and deleting all the data of the grey cloth type corresponding to the missing proportion when the missing proportion is less than the proportion threshold; filling each missing data corresponding to the missing proportion when the missing proportion is greater than or equal to the preset proportion threshold; obtaining all the second fabric information represented by text data, and mapping the text data corresponding to each second fabric information to numbers; Data enhancement module: used for performing feature enhancement on the second feature data to obtain third feature data; Model training module: used for inputting the third feature data into a pre-established first decision tree model for training to obtain a trained second decision tree model; Result prediction module: used for obtaining the fourth characteristic data of the grey cloth to be predicted, inputting the fourth characteristic data into the second decision tree model for prediction, and obtaining the prediction result.

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

Citation Information

Patent Citations

  • Decision tree construction method and device, storage medium and electronic device

    CN114662574A

  • Textile production quality prediction method based on data identification

    CN117273554A