A method and system for detecting defects in polyester fabrics based on visual images
Through the combination of multi-level expanded convolutional structure and convolutional neural network, combined with federated learning and random forest technology, the multi-scale features and change trajectory characteristics of polyester fabrics are extracted, and the problem of lack of multi-grained feature extraction in the existing technology is solved, and efficient and accurate detection of defects of polyester fabrics is achieved.
Patent Information
- Application Number
- CN202510152902.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2045-02-12
AI Technical Summary
The existing polyester filament wool detection method based on image processing technology lacks the extraction of multi-grained features of polyester images, which leads to the segmentation algorithm being unable to effectively utilize important context information of fabric state changes, affecting the accuracy of defect detection.
Multi-level expanded convolutional structure is used to perform multi-scale analysis on standardized polyester fabric images to extract multi-scale feature maps; combined with the feature changes of each key process in the production process, the change trajectory features are generated; convolutional neural networks are used to integrate features, and feature screening is performed through federated learning and random forest technology, and potential defect areas are finally identified through neural networks.
It improves the accuracy and robustness of defect detection of polyester fabrics, can better sense the characteristics of fabrics due to process changes in production, distinguish between normal process changes and actual defects, and achieve efficient and accurate automated inspection.
Smart Images

Figure CN119648691B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of fabric inspection, and more specifically, to a method and system for detecting defects in polyester fabrics based on visual images. Background Art
[0002] Polyester fabric is a synthetic fabric made of polyester fibers, which are produced by spinning polyester polymers. Due to its excellent abrasion resistance, wrinkle resistance, and good elasticity, polyester fabric is widely used in clothing, home textiles, and industrial textiles. Polyester fabric has the characteristics of light texture, easy to wash and quick drying, and bright colors, making it an ideal choice for various applications.
[0003] Defect detection of polyester fabric refers to identifying and evaluating defects that occur in polyester fabric during production or processing through specific methods and techniques. These defects may include fiber breakage, fabric fuzzing, color difference, holes, or other non-uniformities. The purpose of defect detection is to ensure the quality and consistency of the fabric, prevent unqualified products from entering the market, and thus improve the overall quality of the product and user satisfaction. Among them, defect detection of polyester fabric based on visual images is a method that uses computer vision technology and image processing algorithms to automatically detect defects on polyester fabric. By using a high-resolution imaging device to obtain fabric images, possible defect areas can be identified. This method can improve the speed and accuracy of detection, reduce the errors and labor intensity of manual detection, and is widely used in quality control in the textile industry.
[0004] For example, Chinese Patent CN111415349B discloses a method for detecting hairiness of polyester filaments based on image processing technology, which includes processing polyester filament images using a double-image double-threshold filament and hairiness segmentation method to segment hairiness, determining the background position from non-filament-dry positions and non-hairiness positions, calculating the length of each hairiness using a visual calibration method, and performing statistical processing to complete the detection of hairiness of polyester filaments.
[0005] However, the above method for detecting hairiness of polyester filaments based on image processing technology still has the following deficiencies: lack of extraction of multi-granularity features of polyester images, especially the feature changes in each key process during the production of polyester fabric, resulting in the segmentation algorithm relying only on the visual features of the current image and lacking important context information about the fabric state changes, which is not conducive to the overall effect and accuracy of defect detection.
[0006] Regarding the problems in the related art, no effective solution has been proposed yet. Summary of the Invention
[0007] In view of the problems in the related art, the present invention proposes a method and system for detecting defects in polyester fabric based on visual images to overcome the above-mentioned technical problems existing in the existing related technologies.
[0008] To this end, the specific technical solution adopted by the present invention is as follows:
[0009] According to one aspect of the present invention, a method for detecting defects in polyester fabrics based on visual images is provided, and the method includes:
[0010] S1. Perform multi-scale analysis on the standardized polyester fabric image based on a multi-level dilated convolution structure to obtain a multi-scale feature map of the polyester fabric;
[0011] S2. Obtain the characteristic changes of each key process in the production process of the polyester fabric, and generate the change trajectory characteristics of each key process;
[0012] S3. Use a convolutional neural network to extract the integrated features from the multi-scale feature map of the polyester fabric, and combine the change trajectory characteristics of each key process to construct a multi-granularity feature matrix;
[0013] S4. Based on federated learning and random forest technology, comprehensively score the importance of each feature in the multi-granularity feature matrix, and perform feature screening according to the comprehensive importance score to obtain the input features for polyester fabric defect identification;
[0014] S5. Use a neural network to perform score prediction on the input features for polyester fabric defect identification to identify potential polyester fabric defect areas;
[0015] Further, performing multi-scale analysis on the standardized polyester fabric image based on a multi-level dilated convolution structure to obtain a multi-scale feature map of the polyester fabric includes:
[0016] Segment the standardized polyester fabric image into several image blocks, and design multi-level dilated convolutional layers, each level having a different dilation rate, to form convolutional layers with different receptive fields;
[0017] Pass the standardized image through convolutional layers with different receptive fields in sequence to extract the feature maps at each level;
[0018] Adjust the feature maps at each level to the same size through sampling operations and perform weighted fusion to obtain a multi-scale feature map of the polyester fabric.
[0019] Further, obtaining the characteristic changes of each key process in the production process of the polyester fabric and generating the change trajectory characteristics of each key process includes:
[0020] Obtain the key processes and process sequences of polyester fabric production, and record the baseline characteristic values in the initial state of each key process of the polyester fabric;
[0021] Based on the baseline feature values of the polyester fabric in the initial state of each key process, obtain the feature change data after each key process; according to the feature change data after each key process, generate the change trajectory features of each key process.
[0022] Further, based on the baseline feature values of the polyester fabric in the initial state of each key process, obtaining the feature change data after each key process; generating the change trajectory features of each key process according to the feature change data after each key process includes:
[0023] Compare the feature data after each key process with the baseline feature values in the initial state to obtain the feature change data after each key process;
[0024] Based on the feature change data after each key process, and use numerical methods to quantify the change trajectory features of each key process.
[0025] Further, use a convolutional neural network to extract the integrated features from the multi-scale feature maps of the polyester fabric, and combine the change trajectory features of each key process to construct a multi-granularity feature matrix including:
[0026] Input the multi-scale feature maps of the polyester fabric into the convolutional neural network, and extract features of different levels and scales from the multi-scale feature maps of the polyester fabric through the convolutional neural network;
[0027] Fuse the standardized change trajectory features of each key process with the features in the multi-scale feature maps to obtain a multi-granularity feature matrix.
[0028] Further, based on federated learning and random forest technology, comprehensively score the importance of each feature in the multi-granularity feature matrix, and perform feature screening according to the comprehensive importance score to obtain the input features for polyester fabric defect identification including:
[0029] Use the training dataset based on the multi-granularity feature matrix to train the random forest model, and output the importance scores of the features in each multi-granularity feature matrix through the random forest model;
[0030] Use the federated learning framework to encrypt and aggregate the feature importance scores from various polyester fabric production lines to obtain the comprehensive importance score of the features;
[0031] Use the preset comprehensive importance score threshold and the comprehensive importance scores of each feature to screen each feature in the multi-granularity feature matrix to obtain the input features for polyester fabric defect identification.
[0032] Further, use the training dataset based on the multi-granularity feature matrix to train the random forest model, and the importance scores of the features in each multi-granularity feature matrix output by the random forest model include:
[0033] Construct a training dataset based on the multi-granularity feature matrix, and assign labels to each sample in the training dataset;
[0034] Use the particle swarm algorithm to preliminarily screen the features in the multi-granularity feature matrix to obtain the preliminarily screened features;
[0035] Use the grid search algorithm to optimize the parameters of the random forest model;
[0036] Use the training dataset to train and validate the random forest model, and adjust the structure of the tree through multiple iterations to minimize the classification error;
[0037] Use the information gain algorithm in the trained random forest model to calculate the importance scores of each preliminarily screened feature; sort the preliminarily screened features in descending order of importance scores.
[0038] Further, use the particle swarm algorithm to preliminarily screen the features in the multi-granularity feature matrix, and the obtained preliminarily screened features include:
[0039] Initialize the particle swarm, and each particle represents a feature subset in the multi-granularity feature matrix;
[0040] Calculate the fitness value of each particle, and the fitness value is determined by the classification accuracy of the random forest model;
[0041] Update the velocity and position of the particles, select the optimal feature subset, and use the optimal feature subset as the preliminarily screened features.
[0042] Further, use the federated learning framework to encrypt and aggregate the importance scores of the features from each polyester fabric production line to obtain the comprehensive importance score of the features, including:
[0043] Configure the security protocol for federated learning; each polyester fabric production line encrypts and transmits the local feature importance scores to the central server;
[0044] Execute the encryption aggregation operation on the central server to calculate the comprehensive importance score of each preliminarily screened feature;
[0045] Send the comprehensive importance score of each preliminarily screened feature to each polyester fabric production line;
[0046] Among them, when the central server performs encrypted aggregation operations, a weighted mechanism is used to assign corresponding weights according to the data volume of each production line, and the calculation formula for the comprehensive score of the importance of each initially screened feature is as follows:
[0047] ;
[0048] Among them, Y f represents the comprehensive score of the importance of the f th initially screened feature;
[0049] n i represents the data volume of the i th polyester fabric production line, n j represents the data volume of the j th polyester fabric production line, N represents the total number of polyester fabric production lines participating in federated learning;
[0050] x f,i represents the feature importance score of the i rd feature among the f th initially screened features in the
[0051] Further, a neural network is used to predict the score of the input features for polyester fabric defect recognition, and the potential polyester fabric defect areas to be identified include:
[0052] Pre-train a neural network for polyester fabric defect recognition, and use the neural network for polyester fabric defect recognition to score the input features for polyester fabric defect recognition;
[0053] According to the scores of the input features for polyester fabric defect recognition, identify potential polyester fabric defect areas.
[0054] According to another aspect of the present invention, a polyester fabric defect detection system based on visual images is further provided, and the system includes: a multi-scale analysis module, a change trajectory feature acquisition module, a feature integration module, a feature screening module, and a defect detection module.
[0055] A multi-scale analysis module for performing multi-scale analysis on the standardized polyester fabric image based on a multi-level dilated convolution structure to obtain a multi-scale feature map of the polyester fabric; a change trajectory feature acquisition module for obtaining the feature changes of each key process in the production process of the polyester fabric and generating the change trajectory features of each key process; a feature integration module for using a convolutional neural network to extract the integrated features from the multi-scale feature map of the polyester fabric and combining the change trajectory features of each key process to construct a multi-granularity feature matrix; a feature screening module for comprehensively scoring the importance of each feature in the multi-granularity feature matrix based on federated learning and random forest techniques and performing feature screening according to the comprehensive importance score to obtain the input features for polyester fabric defect recognition; a defect detection module for predicting the score of the input features for polyester fabric defect recognition through a neural network to identify potential polyester fabric defect regions.
[0056] The beneficial effects of the present invention are as follows:
[0057] (1) Improving detection accuracy and robustness: The present invention performs multi-scale analysis on the polyester fabric image through a multi-level dilated convolution structure to extract a multi-scale feature map, effectively capturing image features at different scales and angles, adapting to various sizes and shapes of defects on the polyester fabric, and greatly improving the detection accuracy. At the same time, by combining the change trajectory features of each key process in the production process, the detection can perceive the feature differences caused by process changes during fabric production. This integration helps to better distinguish normal process variations from actual defects, improving the overall detection robustness and accuracy.
[0058] (2) Data privacy protection and multi-source information integration: Using the federated learning framework and random forest techniques for feature importance scoring. This ensures that data privacy can still be protected when sharing data among multiple production lines. At the same time, the combination of random forest and particle swarm algorithm is used to efficiently screen features, ensuring high correlation and low redundancy of the input features, and improving the efficiency and performance of the model. This integration and secure collaboration of multi-source information provide strong support for optimizing the detection process.
[0059] (3) Precise identification: In the final defect identification stage, the pre-trained neural network model uses the screened high-quality features for score prediction, which can efficiently identify potential defect regions on the polyester fabric, achieving efficient and accurate automated detection. Description of the Drawings
[0060] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0061] Figure 1 is a flowchart of a method for detecting defects in polyester fabrics based on visual images according to an embodiment of the present invention;
[0062] Figure 2 is a block diagram of a system for detecting defects in polyester fabrics based on visual images according to an embodiment of the present invention
[0063] In the figure:
[0064] 1. Multi-scale analysis module; 2. Variation trajectory feature acquisition module; 3. Feature integration module; 4. Feature screening module; 5. Defect detection module. Detailed implementation manners
[0065] To further illustrate the embodiments, the present invention provides accompanying drawings. These accompanying drawings are part of the disclosure of the present invention. They are mainly used to illustrate the embodiments and can be used to explain the operating principles of the embodiments in conjunction with the relevant descriptions in the specification. With reference to these contents, those of ordinary skill in the art should be able to understand other possible implementation manners and the advantages of the present invention. The components in the figures are not drawn to scale, and similar component symbols are usually used to represent similar components.
[0066] According to an embodiment of the present invention, a method and system for detecting defects in polyester fabrics based on visual images are provided.
[0067] Now, the present invention will be further described in conjunction with the accompanying drawings and specific implementation manners. As Figure 1 shown, according to an embodiment of the present invention, a method for detecting defects in polyester fabrics based on visual images is provided. The method includes:
[0068] S1. Perform multi-scale analysis on the standardized polyester fabric image based on a multi-level dilated convolution structure to obtain a multi-scale feature map of the polyester fabric.
[0069] In one embodiment, performing multi-scale analysis on the standardized polyester fabric image based on a multi-level dilated convolution structure to obtain a multi-scale feature map of the polyester fabric includes:
[0070] Segment the standardized polyester fabric image into several image blocks, and design multi-level dilated convolution layers, each level having a different dilation rate, to form convolution layers with different receptive fields.
[0071] The standardized image is successively passed through convolutional layers with different receptive fields to extract feature maps at each level.
[0072] The feature maps at each level are adjusted to the same size through sampling operations and weighted fusion is performed to obtain the multi-scale feature maps of the polyester fabric.
[0073] It should be noted that dividing the image into several image blocks is to more effectively process large-size images and provide more fine-grained feature extraction. The main role of dilated convolution is to expand the receptive field by inserting holes between the convolution kernels without increasing the number of parameters. The choice of dilation rate should be adjusted according to the fabric characteristics and the expected size of the defects. Adjusting the feature maps at each level to the same size is achieved through sampling operations, which usually involves interpolation techniques (such as bilinear interpolation). Weighted fusion is to integrate the information at each level, and the choice of weights should be based on the contribution of the features at each level to the final goal (such as defect recognition).
[0074] The multi-scale feature maps not only enhance the sensitivity to defects of different sizes and shapes, but also provide rich and cross-scale consistent input features for the subsequent neural network model. These feature maps can help improve the generalization ability of the model in subsequent model training.
[0075] S2. Obtain the characteristic changes of each key process in the production process of the polyester fabric and generate the change trajectory characteristics of each key process.
[0076] In one embodiment, obtaining the characteristic changes of each key process in the production process of the polyester fabric and generating the change trajectory characteristics of each key process includes:
[0077] Obtain the key processes and process sequences of the polyester fabric production, and record the baseline characteristic values in the initial state of each key process of the polyester fabric.
[0078] Based on the baseline characteristic values in the initial state of each key process of the polyester fabric, obtain the characteristic change data after each key process; according to the characteristic change data after each key process, generate the change trajectory characteristics of each key process.
[0079] In one embodiment, based on the baseline characteristic values in the initial state of each key process of the polyester fabric, obtaining the characteristic change data after each key process; according to the characteristic change data after each key process, generating the change trajectory characteristics of each key process includes:
[0080] Compare the characteristic data after each key process with the baseline characteristic values in the initial state to obtain the characteristic change data after each key process.
[0081] Based on the characteristic change data after each key process, numerical methods (such as difference calculation, percentage change) are used to quantify the change trajectory characteristics of each key process. For example, color is represented by ΔE, texture change is calculated by image analysis software for texture complexity change, thickness is measured by the difference in micrometers, and strength is represented by the strength change value obtained from mechanical testing.
[0082] Among them, the baseline characteristic values can significantly reflect the characteristics of the changes that occur in the polyester fabric during each key process. When measuring the baseline characteristic values, precise and standardized methods should be ensured (such as color measurement under a standard light source, standard mechanical testing equipment). The acquisition frequency of the characteristic change data during the process should be determined according to the process characteristics and the dynamics of the fabric change. The use of ΔE for color change is based on the color difference formula of the International Commission on Illumination and should be adjusted according to the actual light source and observation conditions. The calculation of texture complexity uses the gray-level co-occurrence matrix or other image analysis techniques. When measuring the thickness, the elasticity and compressibility of the fabric should be considered, and the mechanical testing should be carried out under controlled environmental temperature and humidity conditions.
[0083] The change trajectory characteristics are stored in a structured form for subsequent analysis and processing. Using the generated change trajectory characteristics for data analysis can identify problems or trends in the production process. This not only helps to immediately adjust the production parameters but also can prevent potential production problems through trend prediction.
[0084] S3. Use a convolutional neural network to extract integrated features from the multi-scale feature maps of the polyester fabric and combine them with the change trajectory characteristics of each key process to construct a multi-granularity feature matrix.
[0085] In one embodiment, using a convolutional neural network to extract integrated features from the multi-scale feature maps of the polyester fabric and combining them with the change trajectory characteristics of each key process to construct a multi-granularity feature matrix includes:
[0086] Input the multi-scale feature maps of the polyester fabric into the convolutional neural network, and use the convolutional neural network to extract features of different levels and scales from the multi-scale feature maps of the polyester fabric.
[0087] Fuse the standardized change trajectory characteristics of each key process with the features in the multi-scale feature maps to obtain a multi-granularity feature matrix.
[0088] It should be noted that inputting the multi-scale feature maps into the convolutional neural network allows the convolutional neural network to extract features at different scales. This multi-scale property helps to detect defects in polyester fabrics of different sizes and shapes, enabling the convolutional neural network to not only identify local details but also understand broader context information.
[0089] Fusing the change trajectory features with the multi-scale features usually adopts feature concatenation, weighted averaging or other more complex fusion methods, such as the attention mechanism. The purpose of constructing the multi-granularity feature matrix is to unify features of different levels and types in a structured representation. Such a matrix not only enhances the feature expression ability but also facilitates the processing and analysis by subsequent machine learning algorithms. It usually contains feature vectors output from the convolutional neural network, as well as feature vectors generated by the change trajectories of each process, forming a comprehensive feature set.
[0090] S4. Based on federated learning and random forest techniques, comprehensively score the importance of each feature in the multi-granularity feature matrix, and perform feature screening according to the comprehensive importance score to obtain the input features for polyester fabric defect recognition.
[0091] In one embodiment, based on federated learning and random forest techniques, comprehensively score the importance of each feature in the multi-granularity feature matrix, and perform feature screening according to the comprehensive importance score to obtain the input features for polyester fabric defect recognition, including:
[0092] Use the training dataset based on the multi-granularity feature matrix to train the random forest model, and output the importance scores of the features in each multi-granularity feature matrix through the random forest model.
[0093] Utilize the federated learning framework to encrypt and aggregate the feature importance scores from each polyester fabric production line source to obtain the comprehensive importance score of the features.
[0094] Use the preset comprehensive importance score threshold and the comprehensive importance scores of each feature to screen each feature in the multi-granularity feature matrix to obtain the input features for polyester fabric defect recognition.
[0095] In one embodiment, using the training dataset based on the multi-granularity feature matrix to train the random forest model, and outputting the importance scores of the features in each multi-granularity feature matrix includes:
[0096] Construct a training dataset based on the multi-granularity feature matrix, and assign labels to each sample in the training dataset.
[0097] Use the particle swarm optimization algorithm to preliminarily screen the features in the multi-granularity feature matrix to obtain the preliminarily screened features.
[0098] Use the grid search algorithm to optimize the parameters of the random forest model, including the number of trees, the maximum number of features, the maximum depth of the tree, and the minimum number of samples.
[0099] Utilize the training dataset to train and validate the random forest model, and adjust the structure of the tree through multiple iterations to minimize the classification error.
[0100] Use the information gain algorithm in the trained random forest model to calculate the importance scores of each feature after preliminary screening; sort the features after preliminary screening in descending order of importance scores.
[0101] In one embodiment, use the particle swarm algorithm to perform preliminary screening on the features in the multi-granularity feature matrix, and the features obtained after preliminary screening include:
[0102] Initialize the particle swarm, and each particle represents a subset of features in the multi-granularity feature matrix.
[0103] Calculate the fitness value of each particle, and the fitness value is determined by the classification accuracy of the random forest model.
[0104] Update the velocity and position of the particles, select the optimal subset of features, and use the optimal subset of features as the features after preliminary screening.
[0105] Specifically, the first step in constructing the training dataset is to extract samples from the multi-granularity feature matrix and assign labels to each sample. The labels can be binary (e.g., defective or not) or multi-class (different types of defects).
[0106] The particle swarm algorithm is an optimization algorithm based on swarm intelligence. By simulating the information sharing among individuals in the group, it dynamically adjusts the positions and velocities of the particles to find the feature combination with the optimal classification performance. The features after preliminary screening can reduce the data dimension and improve the model training efficiency. Grid search is a hyperparameter optimization method. By defining a grid of candidate parameters (such as the number of trees, the maximum number of features, the maximum tree depth, the minimum number of samples, etc.), it evaluates the performance of each parameter combination one by one. The optimization goal is usually to improve the accuracy or F1 score of the model. The results of grid search directly affect the performance and stability of the random forest model.
[0107] The information gain in the random forest is used to measure the impact of features on the classification results. The information gain is usually based on metrics such as entropy and Gini impurity, reflecting the contribution of the feature in reducing the uncertainty of the dataset. By calculating the splitting contribution of each feature at each tree node, the features can be sorted to identify the most discriminative features.
[0108] In one embodiment, using the federated learning framework, encrypt and aggregate the feature importance scores from each polyester fabric production line source to obtain the comprehensive importance score of the features, including:
[0109] Configure the security protocol of federated learning, such as homomorphic encryption or secure multi-party computation (MPC), to ensure that the data is always encrypted during transmission and aggregation; each polyester fabric production line transmits the locally encrypted feature importance scores to the central server.
[0110] Perform an encrypted aggregation operation on the central server to calculate the comprehensive importance score of each feature after preliminary screening.
[0111] Send the comprehensive importance score of each feature after preliminary screening to each polyester fabric production line.
[0112] Among them, when performing the encrypted aggregation operation on the central server, a weighted mechanism is used to assign corresponding weights according to the data volume of each production line, and the calculation formula for the comprehensive importance score of each feature after preliminary screening is:
[0113] ;
[0114] Among them, Y f represents the comprehensive importance score of the f th feature after preliminary screening; n i represents the data volume of the i th polyester fabric production line, n j represents the data volume of the j th polyester fabric production line, N represents the total number of polyester fabric production lines participating in federated learning; x f,i represents the feature importance score of the i th feature in the f th production line among the
[0115] Specifically, homomorphic encryption directly performs addition and multiplication operations on encrypted data, and the result is still correct after decryption, and aggregation can be performed without decrypting the data. Secure multi-party computation ensures that multiple participating parties complete the computing task without disclosing any private data.
[0116] The purpose of the weighted mechanism is to adjust the score according to the data volume of each production line to ensure that the production line with a large data volume has a greater impact on the final result. The calculated comprehensive importance score is distributed back to each participating production line in an encrypted state. Ensure that each production line can obtain information from a global perspective without disclosing local data, which helps to optimize local feature selection and model training.
[0117] S5. Perform score prediction on the input features for polyester fabric defect recognition through a neural network to identify potential polyester fabric defect areas.
[0118] In one embodiment, performing score prediction on the input features for polyester fabric defect recognition through a neural network to identify potential polyester fabric defect areas includes:
[0119] Pre-train a neural network for polyester fabric defect recognition, and use the neural network for polyester fabric defect recognition to score the input features for polyester fabric defect recognition.
[0120] Identify potential polyester fabric defect areas based on the scores of the input features for polyester fabric defect recognition.
[0121] Specifically, the pre-trained neural network uses a large amount of labeled data (including defective and non-defective samples) to build a model capable of identifying polyester fabric defects. The steps of pre-training include:
[0122] (1) Collect and label a large dataset of polyester fabric images, ensuring that the dataset contains various types of defects.
[0123] (2) Select a suitable neural network structure, such as a convolutional neural network (CNN), because CNN performs well in image recognition tasks.
[0124] (3) Use the labeled dataset to train the model and adjust the network weights to minimize the training error. Data augmentation techniques (such as flipping, rotating, scaling) may be used during the process to increase data diversity and improve the generalization ability of the model.
[0125] (4) Conduct model validation and testing to ensure good performance of the model on unseen data.
[0126] After the neural network goes through the pre-training stage, the pre-trained neural network processes each input feature and calculates the score or probability of each feature through forward propagation. This score represents the likelihood that the area is a defective area. Set a threshold, and areas with scores exceeding this threshold are marked as potential defective areas.
[0127] As Figure 2 shown, according to another embodiment of the present invention, there is also provided a polyester fabric defect detection system based on visual images, which includes: a multi-scale analysis module 1, a change trajectory feature acquisition module 2, a feature integration module 3, a feature screening module 4, and a defect detection module 5.
[0128] The multi-scale analysis module 1 is used to perform multi-scale analysis on the standardized polyester fabric image based on a multi-level dilated convolutional structure to obtain a multi-scale feature map of the polyester fabric; the change trajectory feature acquisition module 2 is used to obtain the feature changes of each key process in the production process of the polyester fabric and generate the change trajectory features of each key process; the feature integration module 3 is used to extract the integrated features from the multi-scale feature map of the polyester fabric using a convolutional neural network and construct a multi-granularity feature matrix in combination with the change trajectory features of each key process; the feature screening module 4 is used to comprehensively score the importance of each feature in the multi-granularity feature matrix based on federated learning and random forest techniques and perform feature screening according to the comprehensive importance score to obtain the input features for polyester fabric defect recognition; the defect detection module 5 is used to perform score prediction on the input features for polyester fabric defect recognition through a neural network to identify potential polyester fabric defect regions.
[0129] To facilitate the understanding of the above technical solution of the present invention, the working principle of the present invention in the actual process will be described in detail below.
[0130] I. Extract multi-scale features from the standardized polyester fabric image.
[0131] The size of the input polyester fabric image is obtained as 224x224 pixels. The image is standardized before being input into the network so that each pixel value is between [0, 1]. The standardized image is segmented into several image patches of 56x56 pixels.
[0132] A multi-level dilated convolutional layer is designed, and the dilation rates of the convolutional layers are 1, 2, and 3 respectively. Each convolutional layer is applied to the image patches to obtain feature maps with different receptive fields.
[0133] The size of the feature map extracted after each convolution is 56x56, and it is unified to 224x224 through a sampling operation. The feature maps extracted with different dilation rates are weighted and fused to obtain the final multi-scale feature map. For example:
[0134] The feature map F1 extracted by the first convolution (dilation rate = 1) has a size of 224x224.
[0135] The feature map F2 extracted by the second convolution (dilation rate = 2) has a size of 224x224.
[0136] The feature map F3 extracted by the third convolution (dilation rate = 3) has a size of 224x224.
[0137] The fused feature map F combined , is expressed as a weighted sum:
[0138] F combined= w1⋅F1 + w2⋅F2 + w3⋅F3, where w1, w2, and w3 are the preset weights of F1, F2, and F3 respectively.
[0139] II. Obtaining the characteristic changes of key processes of polyester fabrics
[0140] (1) Obtaining key processes
[0141] The production process of polyester fabrics is divided into 4 key processes: weaving, dyeing, coating treatment, and final shaping.
[0142] (2) Recording baseline characteristic values
[0143] For each key process, record the baseline characteristics of its initial state. For example, at the beginning of the weaving process, the baseline characteristic values of the polyester fabric are: [0.8, 1.2, 0.9, 1.1] (parameters such as fabric density and fabric stretch).
[0144] (3) Obtaining the characteristic changes after each process
[0145] After the dyeing process, the characteristic changes are: [0.1, -0.05, 0.03, 0.05].
[0146] After the coating treatment, the characteristic changes are: [-0.02, 0.1, -0.03, 0.07].
[0147] After the shaping process, the characteristic changes are: [0.05, 0.03, 0.1, 0.08].
[0148] (4) Generating change trajectory characteristics
[0149] Based on the characteristic change data after each process, generate the change trajectory characteristics [0.9, 1.15, 0.93, 1.15] for each process.
[0150] III. Using a convolutional neural network to extract and integrate features and construct a multi-granularity feature matrix
[0151] (1) Inputting into the convolutional neural network
[0152] Input the multi-scale feature map into the convolutional neural network to further extract multi-level features. After training, the output feature vector obtained by the convolutional neural network is: F cnn = [0.12, 0.34, 0.56, 0.78, 0.91].
[0153] (2) Fusing change trajectory characteristics
[0154] The multi-granularity feature matrix is: [0.12, 0.34, 0.56, 0.78, 0.91, 0.9, 1.15, 0.93, 1.15].
[0155] IV. Feature Screening Based on Federated Learning and Random Forest
[0156] (1) Feature Importance Scoring
[0157] Train the multi-granularity feature matrix using the random forest model to obtain the importance score of each feature. For example, the scores of F1, F2, and F3 are as follows:
[0158] F1 (0.12): Importance score = 0.85.
[0159] F2 (0.34): Importance score = 0.92.
[0160] F3 (0.56): Importance score = 0.75.
[0161] (2) Federated Learning Encrypted Aggregation
[0162] Each polyester fabric production line (assumed to be 2 production lines) sends the local feature importance score to the central server through encryption. The central server uses the federated learning framework for encrypted aggregation to obtain the comprehensive importance score of the features.
[0163] (3) Feature Screening
[0164] Set the comprehensive threshold of the importance score to 0.80, and screen out the features with a comprehensive importance score higher than this threshold. For example:
[0165] F1: Comprehensive importance score = 0.85, retained.
[0166] F2: Comprehensive importance score = 0.92, retained.
[0167] F3: Comprehensive importance score = 0.75, discarded.
[0168] V. Defect Identification and Region Prediction
[0169] (1) Neural Network Score Prediction
[0170] Input the screened features into the neural network for prediction. After neural network scoring, obtain the defect prediction score for each region. For example:
[0171] Position (x = 45, y = 120) Score = 0.95 (indicating a defect at this position)
[0172] Position (x = 120, y = 150) Score = 0.78 (indicating normal at this position)
[0173] (2) Identification of Potential Defect Regions
[0174] Identify potential defect areas of polyester fabrics by setting a threshold (e.g., 0.85):
[0175] The position (x = 45, y = 120) is identified as a defect area.
[0176] The position (x = 120, y = 150) is considered a normal area.
[0177] In summary, the present invention performs multi-scale analysis on polyester fabric images through a multi-level dilated convolution structure, extracts multi-scale feature maps, effectively captures image features at different scales and angles, adapts to defects of various sizes and shapes on polyester fabrics, and greatly improves the accuracy of detection. At the same time, by combining the change trajectory features of each key process in the production process, the feature differences caused by process changes during fabric production can be perceived during detection. This integration helps to better distinguish normal process variations from actual defects, improving the overall detection robustness and accuracy. The feature importance scoring is carried out using the federated learning framework and random forest technology. This ensures that data privacy can still be protected when sharing data among multiple production lines. At the same time, the combination of random forest and particle swarm algorithm is used to efficiently screen features, ensuring high correlation and low redundancy of the input features, and improving the efficiency and performance of the model. The integration and secure collaboration of such multi-source information provide strong support for optimizing the detection process. In the final defect identification stage, the pre-trained neural network model uses the screened high-quality features for score prediction, and can efficiently identify potential defect areas on polyester fabrics, realizing efficient and accurate automated detection.
[0178] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A polyester fabric defect detection method based on visual images, characterized in that: The method includes: S1. Perform multi-scale analysis on the standardized polyester fabric image based on a multi-level dilated convolution structure to obtain a multi-scale feature map of the polyester fabric. S2. Obtain the characteristic changes of each key process in the production process of polyester fabrics, and generate the change trajectory characteristics of each key process; S3. Use convolutional neural network to extract integrated features from the multi-scale feature map of polyester fabric, and combine the change trajectory characteristics of each key process to construct a multi-granularity feature matrix; S4. Based on federated learning and random forest technology, each feature in the multi-granularity feature matrix is scored comprehensively in terms of importance, and features are screened according to the comprehensive importance scores to obtain input features for polyester fabric defect recognition; S5, scoring and predicting the polyester fabric defect recognition input features through a neural network to identify potential polyester fabric defect areas; The multi-scale analysis of the standardized polyester fabric image based on the multi-level dilated convolution structure to obtain the multi-scale feature map of the polyester fabric includes: The standardized polyester fabric image is divided into several image blocks, and a multi-level dilated convolutional layer is designed. Each level has a different dilation rate to form a convolutional layer with different receptive fields. The standardized image is sequentially passed through convolutional layers with different receptive fields to extract the feature maps at each level; The feature maps at each level are adjusted to the same size through sampling operations and weighted fusion is performed to obtain multi-scale feature maps of polyester fabrics.
2. The polyester fabric defect detection method based on visual images according to claim 1 is characterized in that: The method of obtaining characteristic changes of each key process in the production process of polyester fabric and generating the change trajectory characteristics of each key process includes: Obtain the key processes and process sequences of polyester fabric production, and record the baseline characteristic values of polyester fabric in the initial state of each key process; Based on the baseline characteristic values of polyester fabric in the initial state of each key process, the characteristic change data after each key process is obtained; according to the characteristic change data after each key process, the change trajectory characteristics of each key process are generated.
3. The polyester fabric defect detection method based on visual images according to claim 2 is characterized in that: The characteristic change data after each key process is obtained based on the baseline characteristic value of the polyester fabric in the initial state of each key process; According to the characteristic change data after each key process, the change trajectory characteristics of each key process are generated, including: The characteristic data after each key process is compared with the baseline characteristic value in the initial state to obtain the characteristic change data after each key process; Based on the characteristic change data after each key process, numerical methods are used to quantify the change trajectory characteristics of each key process.
4. The polyester fabric defect detection method based on visual images according to claim 1 is characterized in that: The method of extracting integrated features from the multi-scale feature map of polyester fabric using a convolutional neural network and combining the change trajectory features of each key process to construct a multi-granularity feature matrix includes: The multi-scale feature map of polyester fabric is input into the convolutional neural network, and the convolutional neural network is used to extract the multi-scale feature map of polyester fabric at different levels and scales. The standardized change trajectory features of each key process are fused with the features in the multi-scale feature map to obtain a multi-granularity feature matrix.
5. The polyester fabric defect detection method based on visual images according to claim 1 is characterized in that: Based on the federated learning and random forest technology, each feature in the multi-granularity feature matrix is scored comprehensively in terms of importance, and features are screened according to the comprehensive importance scores, and the polyester fabric defect recognition input features obtained include: A random forest model is trained using a training dataset based on a multi-granularity feature matrix, and the importance score of the features in each multi-granularity feature matrix is output by the random forest model; Using the federated learning framework, the feature importance scores of each polyester fabric production line source are encrypted and aggregated to obtain a comprehensive score of feature importance; Using the preset importance comprehensive scoring threshold and the importance comprehensive score of each feature, each feature in the multi-granularity feature matrix is screened to obtain the input features for polyester fabric defect recognition.
6. The polyester fabric defect detection method based on visual images according to claim 5 is characterized in that: The random forest model is trained using a training data set based on a multi-granularity feature matrix, and the importance score of the features in each multi-granularity feature matrix output by the random forest model includes: Construct a training data set based on a multi-granularity feature matrix and assign a label to each sample in the training data set; Use the particle swarm algorithm to preliminarily screen the features in the multi-granularity feature matrix to obtain the preliminarily screened features; Use grid search algorithm to optimize the parameters of random forest model; The random forest model is trained and validated using the training dataset, and the tree structure is adjusted through multiple iterations to minimize the classification error. The information gain algorithm in the trained random forest model is used to calculate the importance score of each initially screened feature; the initially screened features are sorted from high to low according to their importance score.
7. The polyester fabric defect detection method based on visual images according to claim 6 is characterized in that: The particle swarm algorithm is used to preliminarily screen the features in the multi-granularity feature matrix, and the features obtained after the preliminary screening include: Initialize a particle swarm, and each particle represents a feature subset in a multi-granularity feature matrix; Calculate the fitness value of each particle, and the fitness value is determined by the classification accuracy of the random forest model; Update the velocity and position of the particle, select the optimal feature subset, and use the optimal feature subset as the initial screening feature.
8. The polyester fabric defect detection method based on visual images according to claim 6 is characterized in that: The federated learning framework is used to encrypt and aggregate the feature importance scores of each polyester fabric production line source to obtain a comprehensive score of feature importance, including: Configure the security protocol of federated learning; each polyester fabric production line transmits the local feature importance score to the central server after encryption; Perform encrypted aggregation operations on the central server to calculate the comprehensive importance score of each feature after preliminary screening; The comprehensive importance score of each feature after the initial screening is sent to each polyester fabric production line; Among them, when the central server performs the encrypted aggregation operation, a weighted mechanism is used to assign corresponding weights according to the amount of data for each production line, and the calculation formula for the comprehensive importance score of each feature after preliminary screening is: ; in, Y f Indicates f Comprehensive score of importance of features after initial screening; n i Indicates i The amount of data for a polyester fabric production line, n j Indicates j The amount of data for a polyester fabric production line, N represents the total number of polyester fabric production lines participating in federated learning; x f,i Indicates i Production line f The feature importance scores of the initial screened features.
9. The polyester fabric defect detection method based on visual images according to claim 1 is characterized in that: The scoring and prediction of the polyester fabric defect recognition input features by the neural network to identify potential polyester fabric defect areas includes: Pre-training a neural network for polyester fabric defect recognition, and using the neural network for polyester fabric defect recognition to score polyester fabric defect recognition input features; Based on the scores of polyester fabric defect identification input features, potential polyester fabric defect areas are identified.
10. A polyester fabric defect detection system based on visual images, used to implement the polyester fabric defect detection method based on visual images according to any one of claims 1 to 9, characterized in that: The system includes: a multi-scale analysis module, a change trajectory feature acquisition module, a feature integration module, a feature screening module and a defect detection module; The multi-scale analysis module is used to perform multi-scale analysis on the standardized polyester fabric image based on a multi-level dilated convolution structure to obtain a multi-scale feature map of the polyester fabric; The change trajectory feature acquisition module is used to acquire the feature changes of each key process in the production process of polyester fabrics and generate the change trajectory features of each key process; The feature integration module is used to extract integrated features from the multi-scale feature map of polyester fabric using a convolutional neural network, and to construct a multi-granularity feature matrix in combination with the change trajectory features of each key process; The feature screening module is used to perform a comprehensive importance score on each feature in the multi-granularity feature matrix based on federated learning and random forest technology, and screen features according to the comprehensive importance score to obtain input features for polyester fabric defect recognition; The defect detection module is used to score and predict the polyester fabric defect recognition input features through a neural network to identify potential polyester fabric defect areas.
Citation Information
Patent Citations
A method for detecting fuzzy fibers in polyester filaments based on image processing technology
CN111415349B
Network security communication high-precision intrusion detection method and system based on multi-scale convolutional neural network
CN118869313A
Intelligent machine vision detection method and system based on image processing and storage medium
CN119205719A