Non-contact textile color fastness automatic rating method and device
By using industrial color cameras and deep learning algorithms to construct a multi-layer perceptron model under the D65 standard light source, analyzing fiber material, fabric structure and environmental factors, the problems of low efficiency and large results deviation of traditional textile color fastness detection are solved, and efficient and accurate automatic rating is achieved.
Patent Information
- Application Number
- CN202510740349.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-08-29
AI Technical Summary
The traditional artificial visual rating textile color fastness method is inefficient and has strong subjectivity. It is difficult for instrument inspection to fully consider the influence of environmental factors, resulting in large deviations in the detection results.
An industrial color camera was used to acquire images under the D65 standard light source, and a multi-layer perceptron model was constructed in combination with a deep learning algorithm, and analyzing fiber material, fabric structure and environmental factors. The color fastness value was calculated through the color discoloration and color staining model, and the RGB value was converted into CIELAB space for rating.
It improves the accuracy and efficiency of inspection, reduces costs, expands the applicability of inspection, can adapt to complex environments, and meets the inspection needs of high-quality textiles.
Smart Images

Figure CN120558867A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of textile testing, and in particular to a non-contact automatic textile color fastness rating method and device. Background Art
[0002] In the textile industry, color fastness is a core quality indicator, directly impacting a product's durability, aesthetics, and consumer experience. Traditional manual visual grading methods have significant drawbacks and are inefficient. Differences in visual sensitivity and experience among inspectors can lead to subjective and widely varying results, severely impacting accuracy and consistency.
[0003] While existing instrument-based testing reduces human error to a certain extent, it also suffers from high equipment costs and complex operation. More critically, it fails to fully account for the combined effects of multiple environmental factors, such as light intensity, ambient temperature, and air humidity, on color fastness. In actual testing, the influence of these environmental factors on test results is complex and difficult to precisely determine, leading to discrepancies between instrument-based test results and actual color fastness.
[0004] With the rapid development of the textile industry and the increasing market demand for textile quality, it is imperative to develop an efficient, accurate, comprehensive, and adaptable non-contact textile color fastness testing technology that can adapt to complex environments. This will not only help improve the overall level of textile quality testing, but also promote the high-quality development of the textile industry and meet the market demand for high-quality textiles. Summary of the Invention
[0005] In view of the shortcomings of the prior art, the present invention aims to provide a non-contact method and device for automatic grading of textile color fastness.
[0006] To achieve the above object, the present invention provides the following technical solutions: A non-contact automatic evaluation method for color fastness of textiles, comprising the following steps: S1 uses an industrial color camera to capture images of textiles to be inspected under a D65 standard light source and obtain RGB values. , and perform bilateral filtering denoising, adaptive contrast enhancement and linear brightness adjustment on the collected images in sequence; S2 uses professional equipment to collect fiber material characteristic data, fabric structure characteristic data and environmental factor data, and performs statistical analysis on the fiber material characteristic data and fabric structure characteristic data to obtain fiber length and fineness The coefficient of variation is used to measure the degree of dispersion of fabric density data. ; Analyze environmental factor data, determine normal intervals and set warning thresholds; S3 builds a color change model using a multi-layer perceptron architecture to encode the chemical composition of the fiber material. , fiber length and fineness values , fabric structure feature vector , fabric density value Density, environmental data vector And the feature vector constructed by measuring the gray scale using a colorimeter As input, after training, the output is the A, B, C, D coefficients in the color fastness conversion formula corresponding to color change; S4 builds a color staining model using a multi-layer perceptron architecture and a gray scale card feature vector. As input, the output after training corresponds to A in the color fastness conversion formula 1j 、B 1j 、C 1j 、D 1j coefficient, j Represents different combinations of sample types and structural features; S5 converts the collected RGB color values into the CIELAB color space and calculates the color difference and brightness difference; S6 calculates the color fastness to color change and color fastness to color staining based on the coefficients of the color fastness to color change or color staining conversion formula and the color difference value; S7 rates color fastness to change and color fastness to staining based on industry standards.
[0007] In S1, (a) Under the D65 standard light source environment, an industrial color camera is used to capture the RGB image of the textile to be inspected. (b) Perform bilateral filtering and denoising on the collected RGB image; (c) Adaptive contrast enhancement is performed on the denoised image. The image is divided into several sub-blocks and the pixel values of each sub-block are adjusted using a histogram equalization algorithm. (d) by Perform linear brightness adjustment on the enhanced image, and dynamically set the gain coefficient α and offset coefficient β according to the average brightness value of the image.
[0008] In S2, (a) Obtaining fiber material characteristic data, including cellulose content, fiber length and fineness, through fiber testing equipment; (b) performing statistical analysis on the fiber material characteristic data, calculating the mean μ and standard deviation σ of the cellulose content, and eliminating outliers based on a preset threshold; (c) Analyze the fabric structure and calculate the mean fabric density and standard deviation , and through the coefficient of variation Evaluate the degree of dispersion, and the calculation formula is:
[0009] (d) Integrate fiber material property data with fabric structure feature data to establish a textile quality analysis database.
[0010] The color change model includes: Input layer, containing the chemical composition code of the fiber material , fiber length and fineness values , fabric structure feature vector , fabric density value Density, environmental data vector And the feature vector constructed by measuring the gray scale using a colorimeter ; The middle layer includes at least one fully connected layer, uses the ReLU activation function, and adds a Dropout layer to prevent overfitting; The output layer generates the A, B, C, and D coefficients in the color fastness conversion formula. The coefficients are trained using the Adam optimization algorithm. The mean square error is used as the loss function during training, and the early stopping method is applied to control the training termination condition.
[0011] The staining model includes: Input layer, containing the feature vector of the stained gray scale ; The middle layer includes at least one fully connected layer, uses the ReLU activation function, and adds a Dropout layer to prevent overfitting; Output layer, generates A in the corresponding color fastness conversion formula 1j 、B 1j 、C 1j 、D 1j coefficient, j Represents different combinations of sample types and structural features. The coefficients are trained using the Adam optimization algorithm. The mean square error is used as the loss function during training, and the early stopping method is applied to control the training termination condition.
[0012] The dropout probability of the middle layer is set to 0.3, the input layer dimension is 100, and the number of neurons in the middle layer is 250.
[0013] The parameters of the Adam optimization algorithm are set to: learning rate The initial value is set to 0.001, and it decays to 0.9 times the original value every 10 epochs. The first-order moment estimates the decay rate β 1 is 0.9, the second-order moment estimate decay rate β 2 is 0.999, Set to 0.00000001.
[0014] The coefficients of the color fastness conversion formula are dynamically selected according to the sample type, fabric structure characteristics or universal fitting coefficients, specifically including: When determining the sample type and fabric structure, the coefficient group obtained by training the corresponding sample type and structural characteristics is selected; When only the sample type is determined, the coefficient group obtained by training the normal data of the corresponding sample type is selected; When the sample information is uncertain, the universal fitting coefficient is selected.
[0015] A device for implementing the above-mentioned non-contact automatic textile color fastness rating method, comprising: The image acquisition module consists of an industrial color camera and a D65 standard light source, and is used to capture images of textile samples under a standard light source environment; Multi-factor data acquisition module, including fiber fineness meter, fiber length analyzer, fabric density detector and environmental monitoring sensor, used for collecting fiber material characteristic data, fabric structure characteristic data and environmental factor data; Data processing module, used to pre-process the collected images and perform statistical analysis on various types of data; The staining model and color change model are built based on the deep learning framework PyTorch and the multi-layer perceptron architecture to obtain the coefficients required for the color fastness conversion formula based on the input; The color fastness calculation and rating module converts RGB values into CIELAB values to calculate color difference values, calculates color fastness values based on the trained model and color fastness conversion formula, and rates them against the standards.
[0016] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned non-contact automatic textile color fastness rating method.
[0017] Beneficial effects of the present invention: Significantly improved detection accuracy: By comprehensively considering the impact of fiber material, fabric structure and environmental factors on color fastness, and using deep learning algorithms to accurately calculate color fastness, compared with traditional detection methods, it greatly reduces errors, making the test results closer to the actual color fastness, and providing a more reliable basis for textile quality assessment.
[0018] Detection efficiency is greatly improved: the automated detection process is realized, manual operation links are reduced, and detection time is significantly shortened. It can meet large-scale detection needs and improve enterprise production efficiency.
[0019] Effective cost reduction: Reduce reliance on expensive testing instruments and lower testing equipment costs. At the same time, automated testing reduces labor input, improves testing efficiency, and indirectly reduces time costs, helping companies reduce operating costs and improve economic benefits while ensuring testing quality.
[0020] Enhanced universality: By generating mixing coefficients, the detection method can be applied to different types of textiles. Whether it is common fiber materials or new fiber materials and complex fabric structures, its color fastness can be accurately detected, which expands the application scope of the detection technology and promotes the improvement of the overall detection level of the textile industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 The figure is a schematic structural diagram of the non-contact automatic textile color fastness rating device of the present invention.
[0022] Figure 2 The figure is a schematic diagram of the overall process of the non-contact automatic evaluation method for textile color fastness of the present invention.
[0023] Figure 3 Schematic diagram of the deep learning model structure for predicting color fastness conversion formula parameters of the present invention.
[0024] Figure 4 Schematic diagram of the deep learning model structure used in the present invention to predict parameters of the color fastness conversion formula for staining.
[0025] Figure 5 The following table shows the correspondence between the color fastness of the present invention and the gray scale grade of color change.
[0026] Figure 6 The following table shows the correspondence between the color fastness to staining and the gray scale for staining of the present invention. DETAILED DESCRIPTION
[0027] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0028] It should be noted that all directional indications in the embodiments of the present invention (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0029] like Figure 2As shown, the present invention provides a non-contact automatic rating method for textile color fastness, which includes the following steps: S1 uses an industrial color camera to capture images of textiles to be inspected under a D65 standard light source and obtain RGB values. , and perform bilateral filtering denoising, adaptive contrast enhancement and linear brightness adjustment on the collected images in sequence; S2 uses professional equipment to collect fiber material characteristic data, fabric structure characteristic data and environmental factor data, and performs statistical analysis on the fiber material characteristic data and fabric structure characteristic data to obtain fiber length and fineness The coefficient of variation is used to measure the degree of dispersion of fabric density data. ; Analyze environmental factor data, determine normal intervals and set warning thresholds; S3 builds a color change model using a multi-layer perceptron architecture to encode the chemical composition of the fiber material. , fiber length and fineness values , fabric structure feature vector , fabric density value Density, environmental data vector And the feature vector constructed by measuring the gray scale using a colorimeter As input, after training, the output is the A, B, C, D coefficients in the color fastness conversion formula corresponding to color change; S4 builds a color staining model using a multi-layer perceptron architecture and a gray scale card feature vector. As input, the output after training corresponds to A in the color fastness conversion formula 1j 、B 1j 、C 1j 、D 1j coefficient, j Represents different combinations of sample types and structural features; S5 converts the collected RGB color values into the CIELAB color space and calculates the color difference and brightness difference; S6 calculates the color fastness to color change and color fastness to color staining based on the coefficients of the color fastness to color change or color staining conversion formula and the color difference value; S7 rates color fastness to change and color fastness to staining based on industry standards.
[0030] Image acquisition and preprocessing Image acquisition: Use an industrial color camera to capture images of textiles to be inspected under a D65 standard light source and obtain RGB values. The D65 standard light source simulates the average daylight color temperature, ensuring that the colors of the captured images truly reflect the actual colors of the textiles, providing a reliable data basis for subsequent accurate analysis.
[0031] Image preprocessing: Bilateral filtering denoising: pixel values after denoising The calculation formula is: (1) in, Represents pixel points Neighborhood, and are Gaussian kernel functions in the spatial domain and the value domain, respectively. Represents pixel points and The spatial distance, Represents pixel value and In practice, the spatial domain Gaussian kernel function is usually Standard deviation Set to 1.5, the range of the Gaussian kernel function Standard deviation Set it to 0.2 to better preserve image edges and details while removing noise.
[0032] Adaptive contrast enhancement: Adaptive histogram equalization algorithm is used to divide the image into multiple sub-blocks. , the enhanced pixel value The calculation formula is: (2) in, is the total number of gray levels, It is a sub-block The gray value is For images with normal resolution, the sub-block size is set to 16×16 pixels and the contrast limit parameter is set to 3.0, which can effectively enhance the image contrast and avoid image distortion caused by over-enhancement.
[0033] Linear brightness adjustment: by formula (3) (3) The brightness of the enhanced image is adjusted, where is the gain coefficient, is the offset coefficient. When the average brightness value of the image is around 128 (0-255 range), if it is too dark, Set to 1.2, Set to 20; if it is too bright, Set to 0.8, Set to -20. Adjust according to the actual situation of the image and value to make the image brightness more suitable for subsequent analysis.
[0034] Multi-factor data collection and integration Analysis of fiber material characteristics: Taking cotton fiber as an example, calculating its cellulose content The mean and standard deviation : (4) (5) in, It is The cellulose content of cotton fiber samples, is the number of samples. The normal range of cellulose content is determined by statistical analysis of a large number of samples. Fiber length and fineness Similar statistical analysis methods are used for the measurement of fiber strength (measured in tex or denier). These parameters are crucial for understanding the physical properties and dyeing performance of fibers. When collecting actual data, professional fiber testing equipment, such as fiber fineness meters and fiber length analyzers, is used to ensure data accuracy. Furthermore, quality control is performed on the collected data to eliminate outliers and ensure data reliability.
[0035] Analysis of fabric structure characteristics: Common fabric structures include plain, twill, satin and jacquard. For fabric density (number of warp and weft yarns per unit area, yarns / square centimeter), calculate its average and standard deviation , introducing the coefficient of variation To measure the discreteness of fabric density data, as shown in formula (6): (6) The larger the coefficient of variation, the greater the dispersion of fabric density between different samples and the worse the uniformity of the fabric structure.
[0036] Environmental factor data recording: long-term use of professional equipment to monitor the temperature in the testing environment ,humidity , light intensity The data are statistically calculated using the mean and standard deviation to determine the normal range of each environmental factor. Usually stable at around 23℃, humidity Controlled at 65% RH, light intensity The ambient temperature is set to 1200 lux. The collected data is transmitted to the monitoring system in real time. Once the environmental parameters exceed the normal range, the system will promptly issue an early warning and initiate corresponding adjustment mechanisms to ensure the stability of the testing environment and improve the accuracy of color fastness testing.
[0037] Model building and training like Figure 3 As shown in the figure, color changing model: a deep learning model is constructed using a multi-layer perceptron (MLP).
[0038] Input layer: contains the chemical composition code of the fiber material , fiber length and fineness values , fabric structure feature vector , fabric density value Density, environmental data vector And the feature vector constructed by measuring the gray scale using a colorimeter For fiber material chemical composition coding, it is assumed that there is Common fiber materials, using the one-hot encoding method, for the fiber material, whose encoding vector The calculation formula is: (7) in, For example, if , representing cotton, wool, polyester fiber, and cotton fiber codes respectively , wool fiber coding , polyester fiber coding .
[0039] Middle layer: Set up multiple fully connected layers, and use ReLU activation function between layers. The formula is The ReLU activation function effectively increases the model's nonlinear expressiveness, enabling it to learn more complex features and relationships. The input layer dimension is set to 100, and the number of neurons in the middle layer is set to 250. To prevent overfitting, a Dropout layer is added to the middle layer with a Dropout probability of 0.3. The middle layer is constructed using the deep learning framework PyTorch, and the fully connected layer, ReLU activation function, and Dropout layer are constructed by calling relevant functions.
[0040] Output layer: This corresponds to the A, B, C, and D coefficients in the colorfastness conversion formula. Initially, the output layer coefficients are randomly set within the range [-0.1, 0.1]. As training progresses, the model continuously adjusts the output layer coefficients based on the loss function to improve prediction accuracy.
[0041] Training process: Using the Adam optimization algorithm, the parameter update formula is as follows: (8) (9) (10) (11) (12) in, and are the first-order moment estimate and the second-order moment estimate of the gradient, and is the exponential decay rate of the moment estimate, is the current gradient, and is the corrected moment estimate, are model parameters, is the learning rate, Is a small constant to prevent division by zero. In actual training, the learning rate The initial value is set to 0.001, and decays to 0.9 times the original value every 10 epochs. Set to 0.9, Set to 0.999, Set to 0.00000001. The Adam optimization algorithm can adaptively adjust the learning rate to speed up the convergence of the model.
[0042] Cost function: The loss function uses the mean square error (MSE), as shown in formula (13): (13) in Is the true color fastness grade, is the colorfastness grade predicted by the model, is the number of samples. By minimizing the mean squared error (MSE), the model's predictions are made as close to the true values as possible. During training, the MSE on the validation set is regularly calculated. Early stopping is used with a patience limit of 10 epochs. Training is terminated when the MSE on the validation set stops decreasing within 10 consecutive epochs. Data is divided and trained separately based on sample type and structural characteristics, and then the entire data is mixed for training to obtain a universal fitting coefficient to improve the model's generalization ability.
[0043] like Figure 4 As shown, the staining model: The structure is similar to the color change model, and the input layer contains the staining gray sample card feature vector , the output layer outputs 、 、 、 coefficient( (representing different combinations of sample types and structural features). The training method is the same as that for the color change model. At the same time, the color staining model is trained specifically based on different sample types and structural feature combinations to improve the model's adaptability to different samples.
[0044] Color space conversion and color fastness calculation Color space conversion: Convert the collected RGB values into CIELAB values using standard formulas , the specific formula is as follows: (14) (15) (16) (17) (18) (19) (20) in, 、 、 Is the tristimulus value under the standard lighting body. Calculate the color difference value (used for color fastness calculation), (used for staining fastness calculation) and lightness difference 、 , the color difference calculation formula is shown in formula (21): (twenty one) The CIELAB color space can more accurately reflect the human eye's perception of color differences and provide a more scientific basis for color fastness calculations.
[0045] Color fastness calculation Color fastness calculation: Calculate the color fastness value according to formula (22), (twenty two) When determining the fiber material (wool, cotton, etc.) and fabric structure (plain, twill, etc.) of the textile, A, B, C, and D are selected from the coefficient group obtained by training the corresponding sample type and structural characteristics. For example, wool plain fabric is selected 、 、 、 If only the sample type is determined, the coefficient group obtained by training the normal data of the corresponding sample type can be selected, such as wool sample 、 、 、 ; When the sample information is uncertain, use the universal color fitting coefficient 、 、 、 .
[0046] Calculation of color fastness to staining: Calculate the color fastness to staining value according to formula (23). The coefficient selection rule is similar to the calculation of color fastness to color change.
[0047] (twenty three) Rating and report generation: Based on the calculated color fastness to color change and color fastness to staining values, and in accordance with relevant industry standards or international standards such as ISO and AATCC, the color fastness is divided into 1-5 grades (grade 1 is the worst and grade 5 is the best) to determine whether the color fastness of the textile meets the requirements. Figure 5 and Figure 6 The system records the colorfastness calculation results and rating of each sample in detail, generating a test report. The report also includes basic sample information such as fiber material, fabric structure, color, and the test environment conditions. This report serves as an important basis for textile quality assessment and can be used for internal quality control, product certification, customer feedback, and more.
[0048] Quality analysis and model optimization Conduct statistical analysis of colorfastness test results from different batches and types of textiles to identify causes of non-compliance. Incorporate new test data into the training set and retrain the discoloration and staining models to enhance their adaptability to multiple samples, improving prediction accuracy and generalization. Regularly evaluate model performance and implement timely optimization and adjustments if any issues are identified.
[0049] like Figure 1 As shown, the present invention also provides a device 1 for implementing the above-mentioned non-contact automatic textile color fastness rating method, which includes: The image acquisition module consists of an industrial color camera and a D65 standard light source, and is used to capture images of textile samples under a standard light source environment; Multi-factor data acquisition module, including fiber fineness meter, fiber length analyzer, fabric density detector and environmental monitoring sensor, used for collecting fiber material characteristic data, fabric structure characteristic data and environmental factor data; Data processing module, used to pre-process the collected images and perform statistical analysis on various types of data; The staining model and color change model are built based on the deep learning framework PyTorch and the multi-layer perceptron architecture to obtain the coefficients required for the color fastness conversion formula based on the input; The color fastness calculation and rating module converts RGB values into CIELAB values to calculate color difference values, calculates color fastness values based on the trained model and color fastness conversion formula, and rates them against the standards.
[0050] A computer-readable storage medium, such as a solid-state hard drive, an optical disc, a cloud server storage unit, etc., stores a computer program, which, when executed by a processor, implements the above-mentioned non-contact automatic textile color fastness rating method.
[0051] Preparation Equipment Procurement and Installation: Purchase an industrial color camera, a D65 standard light source, a fiber fineness meter, a fiber length analyzer, a fabric density tester, temperature, humidity, and light intensity monitoring sensors, and a data acquisition computer. Mount the industrial color camera on an adjustable bracket, ensuring its lens is vertically aligned with the test bench and a vertical distance of 30-50 cm from the test bench. Use a spirit level to calibrate the level. Evenly arrange D65 standard light sources around the test bench. Connect various sensors to the data acquisition computer to ensure stable data transmission.
[0052] Software Installation and Configuration: Install the Python environment and related libraries such as OpenCV, PyTorch, NumPy, pandas, and colormath on data acquisition computer 2. Configure environment variables to ensure that the software and libraries work together properly. Also, adjust image acquisition software parameters such as camera resolution, frame rate, and exposure time according to actual needs to ensure clear and accurate images.
[0053] Sample collection and organization: Collect a wide range of textile samples of different fiber materials (cotton, wool, polyester, etc.), different fabric structures (plain, twill, satin, etc.) and different colors, number each sample, and record its basic information such as fiber material, fabric structure, color, etc. in detail.
[0054] Data collection phase Image acquisition: Under stable illumination from a D65 standard light source, textile samples were placed flat on a testing table and sample images were captured using an industrial color camera. Each captured image was named with a sample number and stored in a designated folder for subsequent processing and analysis.
[0055] Fiber Material Property Data Collection: Using a fiber fineness meter and fiber length analyzer, randomly select 20-30 fibers from each sample. Measure their fineness and length according to the instrument's operating specifications, and calculate the average and standard deviation. The samples are then sent to a specialized laboratory for testing of chemical composition data, including cellulose content, and a detailed test report is obtained.
[0056] Fabric structural characteristic data collection: Use a fabric density tester to measure fabric density 5-8 times at different locations on the sample and calculate the mean, standard deviation, and coefficient of variation. For complex fabric structures, image analysis software can assist in determining fabric structural parameters such as yarn interweaving and periodicity of the weave.
[0057] Environmental factor data collection: During each image acquisition, the environmental monitoring system records the temperature, humidity, and light intensity data in the detection environment in real time, and associates these data with the corresponding sample images and other data and stores them in the database.
[0058] Data processing and analysis Image preprocessing: Using Python's OpenCV library, the collected images are subjected to bilateral filtering denoising, adaptive contrast enhancement, and linear brightness adjustment in accordance with preset parameters. Strictly follow the set standard deviation of the spatial domain Gaussian kernel function. , standard deviation of the domain Gaussian kernel function Perform denoising; for adaptive contrast enhancement, set the sub-block size to 16×16 pixels and the contrast limit parameter to 3.0; linear brightness adjustment is based on the average brightness value of the image, and the gain coefficient is set when it is dark. , offset coefficient , when it is bright , .
[0059] Fiber material and fabric structure data analysis: Using Python's pandas library, statistical analysis is performed on the collected fiber material characteristic data and fabric structure characteristic data. Statistical quantities such as the mean, standard deviation, and coefficient of variation are calculated. By comparing with historical data and referring to industry standards, the normal range of each parameter is determined.
[0060] Environmental Factor Data Analysis: Utilizing the environmental monitoring system's built-in data analysis software, we conduct statistical analysis of long-term environmental data, plotting temperature, humidity, and light intensity over time. This allows us to determine normal ranges for temperature, humidity, and light intensity, and set warning thresholds. If environmental parameters exceed these ranges, the system automatically issues a warning and records the anomaly.
[0061] Model building and training Model Construction: Using the deep learning framework PyTorch in Python, we built the color change and staining models based on the multi-layer perceptron (MLP) architecture. We set up the input, intermediate, and output layers, configuring the parameters and activation functions for each layer. The input layer includes the fiber material chemical composition code, fiber length and fineness values, fabric structure feature vector, fabric density value, environmental data vector, and grayscale feature vector. The intermediate layers consist of multiple fully connected layers, using the ReLU activation function between layers. The number of neurons was set to 250, and a dropout layer was added with a dropout probability of 0.3. The output layer corresponds to the coefficients in the color fastness conversion formula.
[0062] Model training: Divide the collected data into 70% training set, 20% validation set, and 10% test set. Use the Adam optimization algorithm and set the learning rate. The initial value is 0.001, and it decays to 0.9 times of the original value every 10 epochs. , , The model is trained using the mean squared error (MSE) as the loss function. During training, the MSE is regularly calculated on the validation set. Early stopping is used, and training is terminated when the MSE on the validation set stops decreasing for 10 consecutive epochs. Data is divided and trained separately based on sample type and structural characteristics, and then all data are mixed for training to obtain universal fitting coefficients. After training, the model parameters are saved.
[0063] Color fastness calculation and rating Color space conversion: Use Python's colormath library to convert the collected RGB values into CIELAB values according to standard formulas, and calculate the color difference and brightness difference.
[0064] Colorfastness Calculation: Calculates colorfastness to change and staining based on the trained model and corresponding formula. Based on the sample's fiber material and fabric structure, select the coefficient set trained for the sample type and structural characteristics. When sample information is uncertain, use the universal fitting coefficients.
[0065] Grading: Based on the calculated colorfastness values, colorfastness is graded from 1 to 5 (1 being the worst and 5 being the best) against relevant industry or international standards, such as ISO and AATCC, to determine whether the textile meets colorfastness requirements. The grading results are recorded in a test report, which also includes basic sample information, testing environment conditions, and the colorfastness calculation process and results.
[0066] Continuous optimization stage Quality Analysis: Regularly conduct statistical analysis on the color fastness test results of different batches and types of textiles. By comparing the test data of different samples, we can find out the reasons why the color fastness does not meet the standards.
[0067] Model optimization: Incorporate new test data into the model training dataset and retrain the color change and staining models to adapt them to a wider range of textile samples. Regularly evaluate model performance. If significant prediction deviations are found in certain situations, promptly analyze the causes and adjust the model structure or parameters to further improve the accuracy and generalization of the model's predictions.
[0068] The embodiments should not be regarded as limiting the present invention, but any improvements based on the spirit of the present invention should be within the scope of protection of the present invention.
Claims
1. A non-contact automatic evaluation method for color fastness of textiles, characterized by: It includes the following steps: S1 uses an industrial color camera to capture images of textiles to be inspected under a D65 standard light source and obtain RGB values. , and perform bilateral filtering denoising, adaptive contrast enhancement and linear brightness adjustment on the collected images in sequence; S2 uses professional equipment to collect fiber material characteristic data, fabric structure characteristic data and environmental factor data, and performs statistical analysis on the fiber material characteristic data and fabric structure characteristic data to obtain fiber length and fineness The coefficient of variation is used to measure the degree of dispersion of fabric density data. ; Analyze environmental factor data, determine normal intervals and set warning thresholds; S3 builds a color change model using a multi-layer perceptron architecture to encode the chemical composition of the fiber material. , fiber length and fineness values , fabric structure feature vector , fabric density value Density, environmental data vector And the feature vector constructed by measuring the gray scale using a colorimeter As input, after training, the output is the A, B, C, D coefficients in the color fastness conversion formula corresponding to color change; S4 builds a color staining model using a multi-layer perceptron architecture and a gray scale card feature vector. As input, the output after training corresponds to A in the color fastness conversion formula 1j 、B 1j 、C 1j 、D 1j coefficient, j Represents different combinations of sample types and structural features; S5 converts the collected RGB color values into the CIELAB color space and calculates the color difference and brightness difference; S6 calculates the color fastness to color change and color fastness to color staining based on the coefficients of the color fastness to color change or color staining conversion formula and the color difference value; S7 rates color fastness to change and color fastness to staining based on industry standards.
2. The non-contact automatic textile color fastness rating method according to claim 1, characterized in that: In S1, (a) Under the D65 standard light source environment, an industrial color camera is used to capture the RGB image of the textile to be inspected. (b) Perform bilateral filtering and denoising on the collected RGB image; (c) Adaptive contrast enhancement is performed on the denoised image. The image is divided into several sub-blocks and the pixel values of each sub-block are adjusted using a histogram equalization algorithm. (d) by Perform linear brightness adjustment on the enhanced image, and dynamically set the gain coefficient α and offset coefficient β according to the average brightness value of the image.
3. The non-contact automatic textile color fastness rating method according to claim 1, characterized in that: In S2, (a) Obtaining fiber material characteristic data, including cellulose content, fiber length and fineness, through fiber testing equipment; (b) performing statistical analysis on the fiber material characteristic data, calculating the mean μ and standard deviation σ of the cellulose content, and eliminating outliers based on a preset threshold; (c) Analyze the fabric structure and calculate the mean fabric density and standard deviation , and through the coefficient of variation Evaluate the degree of dispersion, and the calculation formula is: (d) Integrate fiber material property data with fabric structure feature data to establish a textile quality analysis database.
4. The non-contact automatic textile color fastness rating method according to claim 1, characterized in that: The color change model includes: Input layer, containing the chemical composition code of the fiber material , fiber length and fineness values , fabric structure feature vector , fabric density value Density, environmental data vector And the feature vector constructed by measuring the gray scale using a colorimeter ; The middle layer includes at least one fully connected layer, uses the ReLU activation function, and adds a Dropout layer to prevent overfitting; The output layer generates the A, B, C, and D coefficients in the color fastness conversion formula. The coefficients are trained using the Adam optimization algorithm. The mean square error is used as the loss function during training, and the early stopping method is applied to control the training termination condition.
5. The non-contact automatic textile color fastness rating method according to claim 1, characterized in that: The staining model includes: Input layer, containing the feature vector of the stained gray scale ; The middle layer includes at least one fully connected layer, uses the ReLU activation function, and adds a Dropout layer to prevent overfitting; Output layer, generates A in the corresponding color fastness conversion formula 1j 、B 1j 、C 1j 、D 1j coefficient, j Represents different combinations of sample types and structural features. The coefficients are trained using the Adam optimization algorithm. The mean square error is used as the loss function during training, and the early stopping method is applied to control the training termination condition.
6. A non-contact automatic textile color fastness rating method according to claim 4 or 5, characterized in that: The dropout probability of the middle layer is set to 0.3, the input layer dimension is 100, and the number of neurons in the middle layer is 250.
7. The non-contact automatic textile color fastness rating method according to claim 4 or 5, characterized in that: The parameters of the Adam optimization algorithm are set to: learning rate The initial value is set to 0.001, and it decays to 0.9 times the original value every 10 epochs. The first-order moment estimates the decay rate β 1 is 0.9, the second-order moment estimate decay rate β 2 is 0.999, Set to 0.00000001.
8. The non-contact automatic textile color fastness rating method according to claim 4 or 5, characterized in that: The coefficients of the color fastness conversion formula are dynamically selected according to the sample type, fabric structure characteristics or universal fitting coefficients, specifically including: When determining the sample type and fabric structure, the coefficient group obtained by training the corresponding sample type and structural characteristics is selected; When only the sample type is determined, the coefficient group obtained by training the normal data of the corresponding sample type is selected; When the sample information is uncertain, the universal fitting coefficient is selected.
9. A device for implementing the non-contact automatic textile color fastness rating method according to any one of claims 1 to 8, characterized in that: It includes: The image acquisition module consists of an industrial color camera and a D65 standard light source, and is used to capture images of textile samples under a standard light source environment; Multi-factor data acquisition module, including fiber fineness meter, fiber length analyzer, fabric density detector and environmental monitoring sensor, used for collecting fiber material characteristic data, fabric structure characteristic data and environmental factor data; Data processing module, used to pre-process the collected images and perform statistical analysis on various types of data; The staining model and color change model are built based on the deep learning framework PyTorch and the multi-layer perceptron architecture to obtain the coefficients required for the color fastness conversion formula based on the input; The color fastness calculation and rating module converts RGB values into CIELAB values to calculate color difference values, calculates color fastness values based on the trained model and color fastness conversion formula, and rates them against the standards.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the non-contact automatic textile color fastness rating method according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Outdoor sunshade fabric color fastness analysis optimization system based on environmental exposure data
CN121384909A
