Fabric flatness detection and control method, equipment and application thereof
By combining light transmission and reflection characteristics with adaptive parameter adjustment, multi-threshold judgment and machine learning optimization models, the problem of insufficient detection accuracy and low degree of automation in fabric flatness detection is solved, and efficient and accurate fabric flatness is achieved. Detection, suitable for a variety of fabrics and complex environments.
Patent Information
- Application Number
- CN202410918848.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-07-10
Smart Images

Figure CN118463864B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of detection technology, and in particular to a fabric flatness detection control method, equipment and application thereof. Background Art
[0002] With the rapid development of the textile industry, consumers have higher and higher requirements for fabric quality, and fabric flatness has become one of the important indicators to measure its quality and comfort. Traditional fabric flatness detection methods mostly rely on manual visual inspection or simple mechanical touch methods. These methods are not only inefficient, but also highly subjective, and it is difficult to meet the needs of modern industrial large-scale production.
[0003] In recent years, optical detection technology has been widely used in textile flatness detection. The principle of optical detection is to use a light source to illuminate the surface of the fabric and evaluate the flatness of the fabric by analyzing the distribution of the reflected light. However, the existing technology (such as CN220552428U) still has some shortcomings, mainly including:
[0004] 1. Limitations of data processing algorithms: Existing algorithms often only use a single threshold judgment, which cannot accurately distinguish fabrics of different flatness levels, and lack consideration of the importance of the detection area, affecting the comprehensiveness and accuracy of the detection results.
[0005] 2. Defects in the signal processing algorithm: In the actual detection process, the received signal is easily interfered by environmental noise, and the impact of different fabric materials and colors on the fabric flatness detection results has not been fully considered, resulting in unstable detection results.
[0006] 3. Lack of intelligent detection model: Most of the current detection systems are based on fixed rules and parameters, and fail to make full use of machine learning technology to analyze a large number of fabric samples to achieve more accurate flatness grade determination.
[0007] 4. Lack of result calibration mechanism: Existing technologies are prone to misjudgment when dealing with complex situations such as slight depressions on the surface of fabrics, and lack effective secondary detection and result correction mechanisms.
[0008] 5. Low degree of automation: Although some testing equipment has achieved preliminary automation, manual intervention is still required in fabric positioning, testing process control and result analysis, which reduces testing efficiency and accuracy.
[0009] In view of the above problems, the present invention proposes a set of new fabric flatness detection technology solutions, which aims to significantly improve the accuracy and efficiency of fabric flatness detection by optimizing data processing algorithms, enhancing signal processing capabilities, applying optimization models, establishing result calibration algorithms, and realizing high system automation, so as to meet the needs of the modern textile industry for high-quality and high-efficiency production. The technical solution of the present invention is not only applicable to various types of fabrics, but also can adapt to complex and changeable production environments, and has broad application prospects. Summary of the invention
[0010] The embodiments of the present application provide a fabric flatness detection control method, device and application thereof, which are aimed at the problems existing in the current technology such as insufficient detection accuracy, low intelligence level, low degree of automation and poor adaptability to complex fabrics.
[0011] The core technology of the present invention is mainly a method and system for realizing high-precision automatic detection and evaluation of fabric flatness by utilizing the transmittance and reflection characteristics of light, combined with adaptive parameter adjustment, multi-threshold judgment, machine learning optimization and comprehensive evaluation model.
[0012] In a first aspect, the present application provides a method for detecting fabric flatness, the method comprising the following steps:
[0013] S00, emitting light through a transmitter, receiving the light after passing through the fabric through a receiver, and filtering the received signal for noise, while adjusting the light intensity of the transmitter and / or the sensitivity of the receiver according to the reflection characteristics of different fabrics;
[0014] The transmitter and the receiver cover the entire detection area of the fabric to fully obtain the light intensity distribution data on the fabric surface; the signal received by the receiver is the receiving ratio data, which refers to the ratio between the amount of light received by the receiver and the amount of light emitted by the transmitter;
[0015] S10, based on the light intensity distribution data, using a multi-threshold judgment and a smooth weighted algorithm to calculate the preliminary flatness grade of the fabric as a preliminary assessment to take into account the flatness differences of various parts of the fabric and mark areas where there may be abnormalities;
[0016] S20, inputting the result of the preliminary flatness grade and the receiving ratio data of the receiver into a pre-trained optimization model to optimize the accuracy of the flatness assessment and mark areas where anomalies may exist;
[0017] S30, if there is an area where an abnormality may exist, a secondary test is performed to determine and calibrate the result and use it as the final result data; if there is no area where an abnormality may exist, the data output by the optimization model is used as the final result data;
[0018] S40, analyzing the final result data, and providing a comprehensive evaluation of the flatness of the fabric according to predetermined rules and / or analysis models, and displaying the test results in real time.
[0019] Furthermore, in step S00, the specific steps of adjusting the light intensity of the transmitter and the sensitivity of the receiver according to the reflection characteristics of different fabrics are as follows:
[0020] Before detection, initialize the transmitter and receiver and set the default light intensity and sensitivity;
[0021] During the detection process, the signal strength received by the receiver is monitored in real time, and the signal strength can reflect the reflection characteristics of the fabric to light;
[0022] Analyze the received signal strength and determine whether it exceeds the preset dynamic range;
[0023] If not, it means that the transmitter light intensity is insufficient or the fabric absorbs too much light, and the transmitter light intensity and / or the receiver sensitivity need to be increased; if yes, it means that the transmitter light intensity is too high or the fabric emits too much light, and the transmitter light intensity and / or the receiver sensitivity need to be reduced;
[0024] Adjusting the light intensity of the transmitter and / or the sensitivity of the receiver based on the analysis result; wherein the magnitude of the adjustment is based on a predefined proportionality factor to prevent over-adjustment of the parameters;
[0025] The adjusted parameters are applied to the transmitter and / or receiver, and the signal strength is then re-monitored to form a closed-loop control until the signal strength stabilizes within a preset dynamic range.
[0026] Furthermore, in step S00, the specific steps of adjusting the light intensity of the transmitter and the sensitivity of the receiver according to the reflection characteristics of different fabrics also include:
[0027] Store the optimal parameter settings for different fabric types and colors for direct recall during the next inspection.
[0028] Furthermore, in step S10, multiple thresholds are set according to the light intensity distribution data to distinguish different flatness states as preset flatness grade standards;
[0029] For each set of measurement data, it is classified into different flatness levels according to its relationship with the set threshold;
[0030] Take a weighted average of the flatness level at each location in the fabric’s inspection area;
[0031] Mapping the flatness grade obtained by weighted average to a preset flatness grade standard;
[0032] Output the overall flatness grade of the fabric to reflect the average flatness level of the fabric.
[0033] Furthermore, in step S20, the training steps of the optimization model are as follows:
[0034] Acquire data containing fabric flatness information, including at least an image of the fabric, reception ratio data of the receiver, and fabric type;
[0035] Perform data cleaning to remove invalid or erroneous data and assign a flatness level label to each piece of data after cleaning;
[0036] Extract features from the cleaned data, including at least texture features, color features, and statistical features of the received ratio data of the fabric;
[0037] Divide the data set into training set, validation set and test set;
[0038] Establish a machine learning model and use the training set to train the machine learning model. During the training process, use the validation set data for model selection and hyperparameter tuning to prevent overfitting;
[0039] The generalization ability of the machine learning model is evaluated through the test set until the machine learning model training is completed and an optimized model is obtained.
[0040] Furthermore, in step S40, key features are extracted from the final result data, the key features including texture features of the fabric, reflection features of the color to light, statistical features of the received ratio data, and distribution and severity of abnormal areas;
[0041] The extracted key features are input into predetermined rules and / or analysis models for evaluation to obtain a final flatness evaluation;
[0042] Convert the final roughness evaluation into a roughness grade and establish a feedback mechanism and generate a report that includes charts and graphs, a list of key indicators and recommended actions.
[0043] Furthermore, the method also includes step S50, continuously optimizing the analysis model according to the test results and feedback to improve the accuracy and reliability of the evaluation.
[0044] In a second aspect, the present application provides a fabric flatness detection device, comprising:
[0045] A transmitter and a receiver, wherein the transmitter emits light, the receiver receives the light after passing through the fabric, and performs noise filtering on the received signal, while adjusting the light intensity of the transmitter and / or the sensitivity of the receiver according to the reflection characteristics of different fabrics;
[0046] The transmitter and the receiver cover the entire detection area of the fabric to fully obtain the light intensity distribution data on the fabric surface; the signal received by the receiver is the receiving ratio data, which refers to the ratio between the amount of light received by the receiver and the amount of light emitted by the transmitter;
[0047] The signal preprocessing module, based on the light intensity distribution data, uses a multi-threshold judgment and a smooth weighted algorithm to calculate the preliminary flatness grade of the fabric as a preliminary assessment to take into account the flatness differences of various parts of the fabric and mark out areas where there may be anomalies;
[0048] A preliminary assessment module that inputs the results of the preliminary roughness grade and the receiver's reception ratio data into a pre-trained optimization model to optimize the accuracy of the roughness assessment and mark areas where anomalies may exist;
[0049] An optimization module that inputs the results of the preliminary roughness grade and the receiver's reception ratio data into a pre-trained optimization model to optimize the accuracy of the roughness assessment and mark areas where anomalies may exist;
[0050] The secondary detection module performs secondary detection if there are areas where abnormalities may exist, to determine and calibrate the results and use them as the final result data; if there are no areas where abnormalities may exist, the data output by the optimization model is used as the final result data;
[0051] Comprehensive evaluation module, which analyzes the final result data and gives a comprehensive evaluation of the fabric flatness according to predetermined rules and / or analysis models, and displays the test results in real time;
[0052] Output module, used to output comprehensive evaluation and detection results.
[0053] In a third aspect, the present application provides an electronic device including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the above-mentioned fabric flatness detection method.
[0054] In a fourth aspect, the present application provides a readable storage medium, in which a computer program is stored. The computer program includes a program code for controlling a process to execute a process, and the process includes the above-mentioned fabric flatness detection method.
[0055] The main contributions and innovations of the present invention are as follows:
[0056] 1. Adaptive signal adjustment mechanism: The present invention introduces the function of adaptively adjusting the transmitter light intensity and receiver sensitivity according to the fabric type and color, ensuring accurate detection of different fabric characteristics and solving the detection error problem caused by fixed settings of light intensity or sensitivity in the prior art.
[0057] 2. Multi-threshold and smooth weighted algorithm: Multi-threshold judgment and smooth weighted algorithm are used in the preliminary flatness assessment stage, which can more finely identify the flatness differences of various parts of the fabric, effectively mark abnormal areas, and improve the comprehensiveness and accuracy of the preliminary assessment.
[0058] 3. Optimization model and secondary detection: By inputting the preliminary assessment results and the received ratio data into the pre-trained optimization model, and supplemented by the secondary detection mechanism, the accuracy of flatness assessment is significantly improved, especially for complex or difficult to judge situations, providing a more accurate solution.
[0059] 4. Comprehensive evaluation and feedback mechanism: The comprehensive evaluation module of the present invention not only evaluates based on the key features of the final result data, but also establishes a feedback mechanism and report generation function, which helps to monitor and continuously optimize the detection process in real time, and improves the practicality and efficiency of the overall detection system.
[0060] 5. Intelligent and automated integration: The entire detection method and system design are highly intelligent and automated, forming a closed-loop control system from signal acquisition, preprocessing, evaluation to final result analysis, which greatly reduces manual intervention and improves detection speed and consistency.
[0061] 6. Continuous optimization and iteration capabilities: By establishing a continuous model optimization mechanism, the present invention can continuously adjust and improve the evaluation model according to the test results and feedback, ensure the advancement and adaptability of the technology, and meet the needs of different application scenarios.
[0062] 7. Low-cost transformation: It can be used directly on the basis of existing equipment without modifying the hardware structure of the existing equipment. The upgrade and transformation can be completed by simply introducing the detection method of this application.
[0063] In summary, this application significantly improves the accuracy, efficiency and flexibility of fabric flatness detection by introducing key technologies such as adaptive signal adjustment, multi-threshold judgment, optimized model evaluation, and comprehensive evaluation feedback.
[0064] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0066] Figure 1 is a flow chart of a fabric flatness detection method according to an embodiment of the present application;
[0067] Figure 2 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0068] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0069] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0070] Embodiment 1
[0071] This application aims to propose a method for detecting the flatness of fabrics. Specifically, refer to Figure 1 , the method comprising:
[0072] S00, emitting light through a transmitter, receiving the light after passing through the fabric through a receiver, and performing noise filtering (such as a filter) on the received signal, while adjusting the light intensity of the transmitter and / or the sensitivity of the receiver according to the reflection characteristics of different fabrics;
[0073] The transmitter and the receiver cover the entire detection area of the fabric to fully obtain the light intensity distribution data on the fabric surface; the signal received by the receiver is the receiving ratio data, which refers to the ratio between the amount of light received by the receiver and the amount of light emitted by the transmitter;
[0074] Specifically, the receiver's reception ratio data refers to the ratio of the light intensity or energy received by the receiver to the light intensity or energy emitted by the transmitter. Specifically, when the transmitter emits light to the surface of the fabric, part of the light will be reflected or transmitted by the fabric, and the receiver is responsible for capturing this part of the light. The ratio between the amount of light received by the receiver and the amount of light emitted by the transmitter, that is, the reception ratio data, is one of the key indicators for evaluating the flatness of the fabric. The reason why the reception ratio data is important is that:
[0075] Reflects fabric characteristics: The flatness of a fabric affects how it reflects and transmits light. A flat surface reflects light more evenly, while bumps or wrinkles in the fabric can scatter or block light, changing the amount of light received by the receiver.
[0076] Quantifying Flatness Differences: By comparing the Acceptance Ratio data for different areas, you can quantify the flatness differences between different parts of the fabric. If the Acceptance Ratio for an area is significantly lower than the surrounding areas, this may indicate that the flatness of that area is poor.
[0077] Adapt to different fabric materials and colors: The receiving ratio data can adapt to the different reflection characteristics of different fabric materials and colors to light. Even if the fabric material and color change, by adjusting the parameters of the transmitter and receiver, the receiving ratio data can still effectively reflect the flatness of the fabric.
[0078] Input to the machine learning model: The received ratio data is fed as a feature into the machine learning model, which helps the model learn and recognize patterns related to flatness. The trained model is able to predict the flatness level of the fabric based on the received ratio data, and can make accurate assessments even when faced with new fabric types.
[0079] In this embodiment, the specific steps of adjusting the light intensity of the transmitter and the sensitivity of the receiver according to the reflection characteristics of different fabrics are:
[0080] S01. Before detection, initialize the transmitter and receiver and set the default light intensity and sensitivity;
[0081] S02. During the detection process, the signal strength received by the receiver is monitored in real time. The signal strength can reflect the reflection characteristics of the fabric to light;
[0082] S03. Analyze the received signal strength and determine whether it exceeds the preset dynamic range; if the signal is too weak, it may be because the transmitter light intensity is insufficient or the fabric absorbs too much light; if the signal is too strong, it may be because the transmitter light intensity is too high or the fabric reflects too much light.
[0083] S04. If no, it means that the transmitter light intensity is insufficient or the fabric absorbs too much light, and the transmitter light intensity and / or the receiver sensitivity need to be increased; if yes, it means that the transmitter light intensity is too high or the fabric emits too much light, and the transmitter light intensity and / or the receiver sensitivity need to be reduced;
[0084] S05. Adjusting the light intensity of the transmitter and / or the sensitivity of the receiver based on the analysis result; wherein the magnitude of the adjustment is based on a predefined proportional factor to prevent over-adjustment of the parameters;
[0085] For example, based on the results of signal analysis, adjust the light intensity of the transmitter and the sensitivity of the receiver. For example, if the signal is too weak, you can increase the light intensity of the transmitter; if the signal is too strong, you can reduce the light intensity of the transmitter or increase the gain of the receiver (i.e., increase the sensitivity). The amplitude of the adjustment should be based on a predefined proportional factor, such as 1%, to prevent over-adjustment of the parameters.
[0086] S06, applying the adjusted parameters to the transmitter and / or the receiver, and then re-monitoring the signal strength to form a closed-loop control until the signal strength is stabilized within a preset dynamic range;
[0087] S07. Storing the optimal parameter settings for different fabric types and colors so as to directly call them up during the next inspection.
[0088] That is, in order to improve efficiency, the algorithm can have a memory function, that is, storing the optimal parameter settings for different fabric types and colors. When encountering similar fabrics next time, these parameters can be directly applied to reduce the adjustment process.
[0089] Preferably, steps S01-S07 can be implemented based on a PID controller (proportional-integral-differential controller) or a more advanced adaptive dynamic programming (ADP) algorithm. The PID controller is a common feedback control mechanism that adjusts control parameters through proportional, integral and differential terms to achieve the desired dynamic response and stability. ADP is a reinforcement learning-based method that can learn and optimize control strategies online. The ADP algorithm can learn the impact of fabric material and color on the detection results, and automatically adjust the parameters of the transmitter and receiver to achieve optimal detection performance.
[0090] If you use a PID controller for dynamic range adjustment:
[0091] Proportional term (P): Adjusts directly based on the deviation between the current signal strength and the target strength.
[0092] Integral term (I): accumulates historical deviations and is used to eliminate static errors and avoid deviation accumulation over a long period of time.
[0093] Derivative term (D): Adjusts based on the rate of change of the deviation, helping the system respond to changes more quickly and reducing overshoot.
[0094] By continuously iterating and optimizing PID parameters, the system can achieve ideal detection effects for different fabric materials and colors.
[0095] S10, based on the light intensity distribution data, using a multi-threshold judgment and a smooth weighted algorithm to calculate the preliminary flatness grade of the fabric as a preliminary assessment to take into account the flatness differences of various parts of the fabric and mark areas where there may be abnormalities;
[0096] In this embodiment, the specific steps of calculating the preliminary flatness grade of the fabric using the multi-threshold judgment and smooth weighted algorithm are as follows:
[0097] S11, according to the light intensity distribution data, setting multiple thresholds to distinguish different flatness states as preset flatness grade standards;
[0098] For example, define the thresholds corresponding to the three levels of flatness: high, medium, and low. For example, the high flatness threshold is set to 90%, the medium flatness is 70%-90%, and the flatness is low if it is lower than 70%. By comparing the percentage of light received by the receiver with these thresholds, the flatness level of the fabric is automatically determined. Of course, a decision tree or rule engine can also be introduced to automatically match the closest flatness level according to the reception ratio of the receiver.
[0099] S12. For each set of measurement data, classify it into different flatness levels according to its relationship with the set threshold value; for example, if the measurement value is lower than 70%, it is judged as poor flatness; if the measurement value is between 70% and 90%, it is judged as fair flatness; and so on.
[0100] S13, taking a weighted average of the flatness level of each position in the test area of the fabric; during the test process, sampling is performed on multiple areas of the test fabric, and the flatness measurement result of each area is given different weights according to its importance in the fabric or area size, and finally the weighted average flatness is calculated.
[0101] Of course, in order to comprehensively consider the flatness of each position on the fabric, the flatness level of each position is weighted averaged. The weight can be set according to the importance or detection accuracy of each measurement point on the fabric. For example, the weight of the center area of the fabric may be higher than that of the edge area. The weighted average flatness level G is calculated as follows:
[0102]
[0103] Among them, ω i is the weight of the ith measurement point, g i is the flatness ratio of the area, and N is the total number of measurement points.
[0104] S14, mapping the flatness grade obtained by weighted average to a preset flatness grade standard;
[0105] For example, the flatness grade G obtained by weighted average is mapped to a preset flatness grade standard. This usually means converting continuous flatness values into discrete grades, such as grade A, grade B, grade C, etc.
[0106] S15. Output the overall flatness grade of the fabric to reflect the average flatness level of the fabric. This grade should reflect the average flatness level of the fabric, while also taking into account some local anomalies that may exist on the fabric.
[0107] Thus, in this way, the multi-threshold judgment provides sensitivity to different levels of flatness, while the weighted average ensures the objectivity and accuracy of the overall evaluation and avoids the excessive influence of local anomalies on the overall evaluation.
[0108] S20, inputting the result of the preliminary flatness grade and the receiving ratio data of the receiver into a pre-trained optimization model to optimize the accuracy of the flatness assessment and mark areas where anomalies may exist;
[0109] In this embodiment, the training steps of the optimization model are as follows:
[0110] S21, acquiring data containing fabric flatness information, including at least an image of the fabric, receiving ratio data of the receiver, environmental conditions, fabric type, etc.;
[0111] S22. Perform data cleaning to remove invalid or erroneous data, such as missing value processing, outlier detection and correction, and assign a flatness level label to each piece of data after cleaning. These labels can be manually given by experts or evaluated based on certain standards;
[0112] S23, extracting features from the cleaned data, such as texture features, color features, statistical features of received ratio data, etc.;
[0113] S24. Divide the data set into a training set, a validation set, and a test set. Usually the ratio can be 70% training set, 15% validation set, and 15% test set.
[0114] S25. Establish a machine learning model, and use the training set to train the machine learning model. During the training process, use the validation set data for model selection and hyperparameter tuning to prevent overfitting;
[0115] For example, choose a suitable machine learning model according to the nature of the problem, such as random forest, support vector machine, neural network, etc. For classification problems, you can choose a multi-classification model because the flatness level may have multiple categories.
[0116] Use the training set data to train the model and adjust the model parameters to minimize the training error. During the training process, use the validation set data for model selection and hyperparameter tuning to prevent overfitting. It may take multiple iterations of training, using techniques such as cross-validation to optimize model performance.
[0117] S26. Evaluate the generalization ability of the machine learning model through the test set until the machine learning model is trained and an optimized model is obtained.
[0118] Among them, the evaluation indicators may include accuracy, recall, F1 score, etc., depending on the characteristics of the flatness level prediction task.
[0119] Thus, when the model is used for prediction, the preliminary evaluation results (such as the results of the multi-threshold judgment and smooth weighting algorithm) and the reception ratio data of the receiver are input into the model as features. The model is able to learn the relationship between these features and the level of roughness, identify subtle differences, and thus provide more accurate predictions.
[0120] S30, if there is an area where an abnormality may exist, a secondary test is performed to determine and calibrate the result and use it as the final result data; if there is no area where an abnormality may exist, the data output by the optimization model is used as the final result data;
[0121] S40, analyzing the final result data, and providing a comprehensive evaluation of the flatness of the fabric according to predetermined rules and / or analysis models, and displaying the test results in real time.
[0122] In this embodiment, the specific steps are:
[0123] S41. Extract key features from the final result data, including statistical quantities such as the average value and standard deviation of the received ratio, the distribution and severity of abnormal areas, the material of the fabric, the reflection characteristics of the color to light, and other factors affecting the flatness;
[0124] The final result data can be integrated from all data obtained from different detection methods, including: the reception ratio data of the receiver; the output of the multi-threshold judgment and smoothing weighted algorithm; the result of secondary detection (if any); and any other relevant measurement data, such as temperature, humidity and other environmental factors.
[0125] S42, inputting the extracted key features into a predetermined rule and / or analysis model for evaluation to obtain a final flatness evaluation;
[0126] For example: Rule-based system: predefine a series of rules, such as "if the standard deviation of the acceptance ratio is greater than x, the flatness level is y".
[0127] Machine Learning Models: Use previously trained analytical models, such as random forests, support vector machines, or neural networks, to predict the level of roughness based on features.
[0128] Comprehensive evaluation model: combines the outputs of multiple rules and analysis models to give the final flatness evaluation.
[0129] S43. Convert the final roughness evaluation into a roughness grade and establish a feedback mechanism and generate a report that includes charts and graphs, a list of key indicators, and recommended actions.
[0130] The output of the model is converted into an understandable level of roughness, such as a numerical score, grade (such as A, B, C) or a descriptive evaluation (such as "very smooth", "slightly uneven", "severely uneven").
[0131] Among them, a feedback mechanism is established to feed back the analysis results to the control system or operator so as to: adjust the subsequent production process or parameters according to the flatness level; provide the operator with real-time flatness status so that they can take necessary corrective measures; record and analyze long-term trends to continuously improve process and product quality.
[0132] Among them, automatically generated reports summarizing the test results and comprehensive evaluation can include: charts and graphs to intuitively display the flatness distribution; a list of key indicators such as average flatness, standard deviation, and number of abnormal areas; recommended actions based on the test results and evaluation.
[0133] S50. Based on the test results and feedback, continuously optimize the analysis model to improve the accuracy and reliability of the assessment.
[0134] Through the above steps, the test results can be automatically analyzed, and a comprehensive evaluation of the fabric flatness can be given according to predetermined rules or models, thereby optimizing the production process and ensuring product quality.
[0135] Embodiment 2
[0136] Based on the first embodiment, this embodiment provides a specific example, which will use Python's Scikit-learn library to build a machine learning model for optimizing the evaluation of fabric flatness. In this example, a random forest classifier will be used as a model, but the same process can be applied to other types of machine learning models. The following is a simplified code example for building and training a model:
[0137] import numpy as np
[0138] import pandas as pd
[0139] from sklearn.model_selection import train_test_split
[0140] from sklearn.ensemble import RandomForestClassifier
[0141] from sklearn.metrics import accuracy_score, recall_score, f1_score
[0142] from sklearn.model_selection import GridSearchCV
[0143] # Assume df is a dataset DataFrame containing all necessary features and labels
[0144] # df = pd.read_csv('fabric_data.csv') # Read CSV file
[0145] # The following is a hypothetical dataset for demonstration purposes
[0146] data = {
[0147] 'texture': [0.1, 0.2, 0.3, 0.4, 0.5],
[0148] 'color': ['red', 'blue', 'green', 'yellow', 'purple'],
[0149] 'reception_ratio': [0.9, 0.8, 0.7, 0.6, 0.5],
[0150] 'environment': ['bright', 'dim', 'bright', 'dim', 'bright'],
[0151] 'fabric_type': ['cotton', 'silk', 'wool', 'polyester', 'rayon'],
[0152] 'flatness_level': [1, 2, 3, 2, 1]
[0153] }
[0154] df = pd.DataFrame(data)
[0155] # Data preprocessing, converting non-numerical features into numerical values
[0156] df['color'] = df['color'].astype('category').cat.codes
[0157] df['environment'] = df['environment'].astype('category').cat.codes
[0158] df['fabric_type'] = df['fabric_type'].astype('category').cat.codes
[0159] # Define features and target variables
[0160] X = df.drop('flatness_level', axis=1)
[0161] y = df['flatness_level']
[0162] # Divide the dataset
[0163] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)
[0164] # Model training
[0165] rf_model = RandomForestClassifier(n_estimators=100, random_state=42)
[0166] Hyperparameter Tuning
[0167] param_grid = {'n_estimators': [100, 200, 300], 'max_depth': [None,10, 20]}
[0168] grid_search = GridSearchCV(rf_model, param_grid, cv=5, scoring='accuracy')
[0169] grid_search.fit(X_train, y_train)
[0170] # Best Model
[0171] best_rf_model = grid_search.best_estimator_
[0172] # predict
[0173] y_pred = best_rf_model.predict(X_test)
[0174] Performance Evaluation
[0175] print("Accuracy:", accuracy_score(y_test, y_pred))
[0176] print("Recall:", recall_score(y_test, y_pred, average='weighted'))
[0177] print("F1 Score:", f1_score(y_test, y_pred, average='weighted'))
[0178] Among them, numpy, pandas and scikit-learn are Python libraries, which can be installed through pip, such as pip install numpy pandas scikit-learn. In addition, GridSearchCV is used for hyperparameter tuning to find the best random forest model configuration.
[0179] Preferably, it can also be other machine learning models, such as support vector machines or neural networks.
[0180] Embodiment 3
[0181] Based on Example 1, this example shows the training steps of the analysis model:
[0182] Step 1: Data Preparation
[0183] Feature engineering: Extract key features from the detection data, including but not limited to the texture features of the fabric, color features, statistical features of the received ratio data, distribution and severity of abnormal areas, etc.
[0184] Data cleaning: Clean the data, remove outliers and missing values, and ensure the quality of the data.
[0185] Labeling: Assign a flatness evaluation label to each record in the dataset. These labels can be professional evaluations given by experts or evaluated based on certain standards.
[0186] Step 2: Dataset Division
[0187] Divide the dataset into training, validation, and test sets. A typical split might be 70% training, 15% validation, and 15% test.
[0188] Step 3: Model selection
[0189] Select the appropriate model according to the nature of the problem. For flatness evaluation, a classification model such as random forest, support vector machine (SVM), gradient boosted tree (GBDT) or a deep learning model such as convolutional neural network (CNN) is suitable. The present embodiment is preferably a random forest.
[0190] Step 4: Model training
[0191] The selected model is trained using the training set data. During the training process, the model parameters are adjusted to minimize the training error.
[0192] Use validation set data for model selection and hyperparameter tuning to prevent overfitting. This may include using grid search or randomized search to find the best hyperparameter combination.
[0193] Step 5: Model Evaluation
[0194] Evaluate the generalization ability of the model on the test set. Use evaluation indicators such as accuracy, recall, F1 score, etc. to measure model performance.
[0195] Step 6: Model optimization
[0196] Adjust the model based on the test results. You may need to repeat steps 4 and 5 until you get satisfactory model performance.
[0197] Step 7: Model deployment
[0198] When the model achieves the expected performance, it is deployed in practical applications for real-time or batch processing of fabric flatness evaluation.
[0199] Step 8: Model maintenance and update
[0200] Regularly retrain the model with new data to adapt to possible changes in fabric properties and detection environments to maintain the effectiveness of the model.
[0201] A simplified code example for training a random forest classifier using Python and the scikit-learn library is as follows:
[0202] from sklearn.ensemble import RandomForestClassifier
[0203] from sklearn.model_selection import train_test_split
[0204] from sklearn.metrics import accuracy_score
[0205] # Assume X is the feature matrix and y is the label vector
[0206] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)
[0207] # Create a random forest classifier instance
[0208] clf = RandomForestClassifier(n_estimators=100, random_state=42)
[0209] # Train the model
[0210] clf.fit(X_train, y_train)
[0211] # Predict test set
[0212] y_pred = clf.predict(X_test)
[0213] # Calculate accuracy
[0214] accuracy = accuracy_score(y_test, y_pred)
[0215] print(f"Model Accuracy: {accuracy}")
[0216] The above code shows how to first split the dataset, then create a random forest classifier, and then train the model and evaluate its performance on the test set.
[0217] The reason why random forest is chosen in the second and third embodiments is that random forest is a powerful machine learning algorithm, especially when dealing with classification and regression problems. In the scenario of fabric flatness evaluation, the main reasons for using random forest are as follows:
[0218] 1. Robustness and Accuracy
[0219] Random forests can reduce the risk of overfitting of a single decision tree by building multiple decision trees and aggregating their prediction results, thereby improving the accuracy and stability of the model. Even if some features or sample data are noisy or biased, random forests can provide relatively stable prediction results.
[0220] 2. Feature Importance Assessment
[0221] Random forests can naturally evaluate the importance of features, which is very important for understanding and optimizing feature engineering. In the evaluation of fabric flatness, understanding which features (such as texture, color, reception ratio, etc.) have the greatest impact on the final evaluation can help us optimize the data collection and preprocessing process.
[0222] 3. Dealing with High-Dimensional Data
[0223] Random forests can effectively handle high-dimensional data sets without worrying about the curse of dimensionality. In fabric testing, there may be a large number of features involved (such as multiple physical properties of the fabric, environmental conditions, etc.), and random forests can handle this situation well.
[0224] 4. Parallel processing capabilities
[0225] The random forest construction process can be parallelized, which means that model training can be accelerated on multi-core processors or distributed computing environments, which is especially useful for processing large-scale datasets.
[0226] 5. Easy to understand and explain
[0227] Although random forests are composed of multiple trees, each tree is based on the decision tree principle, which makes the prediction logic of the model relatively easy to understand and explain.
[0228] 6. Strong generalization ability
[0229] Since random forest uses random sampling and feature selection during training, it can effectively reduce overfitting and improve the generalization ability of the model. This means that the model can maintain good prediction performance on new data that has not been seen.
[0230] Embodiment 4
[0231] Based on the same concept, the present application also proposes a fabric flatness detection device, comprising:
[0232] A transmitter and a receiver, wherein the transmitter emits light, the receiver receives the light after passing through the fabric, and performs noise filtering on the received signal, while adjusting the light intensity of the transmitter and / or the sensitivity of the receiver according to the reflection characteristics of different fabrics;
[0233] Among them, the transmitter and the receiver are both existing technologies, such as the solution mentioned in CN220552428U. The present application can be used on the basis of the hardware structure of the patent or make some appropriate modifications to use the solution of the present application, such as increasing the number of transmitters and receivers.
[0234] The transmitter and the receiver cover the entire detection area of the fabric to fully obtain the light intensity distribution data on the fabric surface; the signal received by the receiver is the receiving ratio data, which refers to the ratio between the amount of light received by the receiver and the amount of light emitted by the transmitter;
[0235] The signal preprocessing module, based on the light intensity distribution data, uses a multi-threshold judgment and a smooth weighted algorithm to calculate the preliminary flatness grade of the fabric as a preliminary assessment to take into account the flatness differences of various parts of the fabric and mark out areas where there may be anomalies;
[0236] A preliminary assessment module that inputs the results of the preliminary roughness grade and the receiver's reception ratio data into a pre-trained optimization model to optimize the accuracy of the roughness assessment and mark areas where anomalies may exist;
[0237] An optimization module that inputs the results of the preliminary roughness grade and the receiver's reception ratio data into a pre-trained optimization model to optimize the accuracy of the roughness assessment and mark areas where anomalies may exist;
[0238] The secondary detection module performs secondary detection if there are areas where abnormalities may exist, to determine and calibrate the results and use them as the final result data; if there are no areas where abnormalities may exist, the data output by the optimization model is used as the final result data;
[0239] Comprehensive evaluation module, which analyzes the final result data and gives a comprehensive evaluation of the fabric flatness according to predetermined rules and / or analysis models, and displays the test results in real time;
[0240] Output module, used to output comprehensive evaluation and detection results.
[0241] Embodiment 5
[0242] This embodiment also provides an electronic device, referring to Figure 2, comprises a memory 404 and a processor 402, wherein the memory 404 stores a computer program, and the processor 402 is configured to run the computer program to execute the steps in any of the above method embodiments.
[0243] Specifically, the processor 402 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0244] Among them, the memory 404 may include a large capacity memory 404 for data or instructions. For example, but not limitation, the memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In appropriate cases, the memory 404 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 404 may be inside or outside the data processing device. In a specific embodiment, the memory 404 is a non-volatile memory. In a specific embodiment, the memory 404 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, PROM for short), an erasable PROM (Erasable Programmable Read-Only Memory, EPROM for short), an electrically erasable PROM (Electrically Erasable Programmable Read-Only Memory, EEPROM for short), an electrically alterable ROM (Electrically Alterable Read-Only Memory, EAROM for short) or a flash memory (FLASH) or a combination of two or more of these. In appropriate circumstances, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM may be a fast page mode dynamic random access memory 404 (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0245] The memory 404 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 402 .
[0246] The processor 402 implements any fabric flatness detection method in the above embodiments by reading and executing computer program instructions stored in the memory 404 .
[0247] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408 , wherein the transmission device 406 is connected to the processor 402 , and the input / output device 408 is connected to the processor 402 .
[0248] The transmission device 406 can be used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired or wireless network provided by a communication provider of the electronic device. In one example, the transmission device includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 406 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0249] Input / output devices 408 are used to input or output information.
[0250] Embodiment 6
[0251] This embodiment further provides a readable storage medium, in which a computer program is stored. The computer program includes a program code for controlling a process to execute a process. The process includes the fabric flatness detection method according to the first embodiment.
[0252] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0253] In general, various embodiments may be implemented in hardware or dedicated circuits, software, logic, or any combination thereof. Some aspects of the invention may be implemented in hardware, while other aspects may be implemented in firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flow charts, or using some other graphical representation, it should be understood that, as non-limiting examples, the boxes, devices, systems, techniques, or methods described herein may be implemented in hardware, software, firmware, dedicated circuits or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0254] Embodiments of the present invention can be implemented by computer software, which is executable by a data processor of a mobile device, such as in a processor entity, or implemented by hardware, or implemented by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets and / or macros can be stored in any device readable data storage medium, and they include program instructions for performing specific tasks. Computer program products can include one or more computer executable components configured to perform embodiments when the program is running. One or more computer executable components can be at least one software code or a part thereof. In addition, at this point, it should be noted that any box of the logic flow can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored in physical media such as memory chips or storage blocks implemented in processors, magnetic media such as hard disks or floppy disks, and optical media such as, for example, DVDs and data variants thereof, CDs. Physical media are non-transient media.
[0255] Those skilled in the art should understand that the technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0256] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A fabric flatness detection method, characterized in that: The following steps are involved: S00, emitting light through a transmitter, receiving the light after passing through the fabric through a receiver, and filtering the received signal for noise, while adjusting the light intensity of the transmitter and / or the sensitivity of the receiver according to the reflection characteristics of different fabrics; The transmitter and the receiver cover the entire detection area of the fabric to completely obtain the light intensity distribution data on the surface of the fabric; the signal received by the receiver is the reception ratio data, which refers to the ratio between the amount of light received by the receiver and the amount of light emitted by the transmitter; S10, based on the light intensity distribution data, using a multi-threshold judgment and a smooth weighted algorithm to calculate a preliminary flatness grade of the fabric as a preliminary assessment, so as to take into account the flatness differences of various parts of the fabric and mark areas where abnormalities may exist; S20, inputting the result of the preliminary flatness grade and the receiving ratio data of the receiver into a pre-trained optimization model to optimize the accuracy of the flatness assessment and mark areas where anomalies may exist; S30, if there is an area where an abnormality may exist, a secondary test is performed to determine and calibrate the result and use it as the final result data; if there is no area where an abnormality may exist, the data output by the optimization model is used as the final result data; S40, analyzing the final result data, and providing a comprehensive evaluation of the flatness of the fabric according to a predetermined rule and / or analysis model, and displaying the test results in real time; Among them, in step S00, the specific steps of adjusting the light intensity of the transmitter and the sensitivity of the receiver according to the reflection characteristics of different fabrics are: Before detection, initialize the transmitter and receiver and set the default light intensity and sensitivity; During the detection process, the signal strength received by the receiver is monitored in real time, and the signal strength can reflect the reflection characteristics of the fabric to light; Analyze the received signal strength and determine whether it exceeds the preset dynamic range; If not, it means that the transmitter light intensity is insufficient or the fabric absorbs too much light, and the transmitter light intensity and / or the receiver sensitivity need to be increased; if yes, it means that the transmitter light intensity is too high or the fabric emits too much light, and the transmitter light intensity and / or the receiver sensitivity need to be reduced; Adjusting the light intensity of the transmitter and / or the sensitivity of the receiver based on the analysis result; wherein the magnitude of the adjustment is based on a predefined proportionality factor to prevent over-adjustment of the parameters; Applying the adjusted parameters to the transmitter and / or receiver, and then re-monitoring the signal strength to form a closed-loop control until the signal strength is stabilized within a preset dynamic range; Store the optimal parameter settings for different fabric types and colors for direct recall during the next inspection; In step S10, the specific steps of using the multi-threshold judgment and smooth weighted algorithm to calculate the preliminary flatness grade of the fabric are as follows: According to the light intensity distribution data, a plurality of thresholds are set to distinguish different flatness states as preset flatness grade standards; For each set of measurement data, it is classified into different flatness levels according to its relationship with the set threshold; Take a weighted average of the flatness level at each location in the fabric’s inspection area; Mapping the flatness grade obtained by weighted average to a preset flatness grade standard; Output the overall flatness grade of the fabric to reflect the average flatness level of the fabric; In step S20, the training steps of the optimization model are as follows: Acquire data containing fabric flatness information, including at least an image of the fabric, reception ratio data of the receiver, and fabric type; Perform data cleaning to remove invalid or erroneous data and assign a flatness level label to each piece of data after cleaning; Extract features from the cleaned data, including at least texture features, color features, and statistical features of the received ratio data of the fabric; Divide the data set into training set, validation set and test set; Establish a machine learning model and use the training set to train the machine learning model. During the training process, use the validation set data for model selection and hyperparameter tuning to prevent overfitting; The generalization ability of the machine learning model is evaluated through the test set until the machine learning model training is completed and an optimized model is obtained.
2. The fabric flatness detection method according to claim 1, characterized in that: In step S40, key features are extracted from the final result data, the key features including texture features of the fabric, reflection features of the color to light, statistical features of the received ratio data, and distribution and severity of abnormal areas; The extracted key features are input into predetermined rules and / or analysis models for evaluation to obtain a final flatness evaluation; Convert the final roughness evaluation into a roughness grade and establish a feedback mechanism and generate a report that includes charts and graphs, a list of key indicators and recommended actions.
3. The fabric flatness detection method according to claim 2, characterized in that: It also includes step S50, which continuously optimizes the analysis model based on the test results and feedback to improve the accuracy and reliability of the assessment.
4. A fabric flatness detection device, characterized in that: include: A transmitter and a receiver, wherein the transmitter emits light, the receiver receives the light after passing through the fabric, and performs noise filtering on the received signal, while adjusting the light intensity of the transmitter and / or the sensitivity of the receiver according to the reflection characteristics of different fabrics; The transmitter and the receiver cover the entire detection area of the fabric to completely obtain the light intensity distribution data on the fabric surface; the signal received by the receiver is the reception ratio data, which refers to the ratio between the amount of light received by the receiver and the amount of light emitted by the transmitter; the specific steps of adjusting the light intensity of the transmitter and the sensitivity of the receiver according to the reflection characteristics of different fabrics are: Before detection, initialize the transmitter and receiver and set the default light intensity and sensitivity; During the detection process, the signal strength received by the receiver is monitored in real time, and the signal strength can reflect the reflection characteristics of the fabric to light; Analyze the received signal strength and determine whether it exceeds the preset dynamic range; If not, it means that the transmitter light intensity is insufficient or the fabric absorbs too much light, and the transmitter light intensity and / or the receiver sensitivity need to be increased; if yes, it means that the transmitter light intensity is too high or the fabric emits too much light, and the transmitter light intensity and / or the receiver sensitivity need to be reduced; Adjusting the light intensity of the transmitter and / or the sensitivity of the receiver based on the analysis result; wherein the magnitude of the adjustment is based on a predefined proportionality factor to prevent over-adjustment of the parameters; Applying the adjusted parameters to the transmitter and / or receiver, and then re-monitoring the signal strength to form a closed-loop control until the signal strength is stabilized within a preset dynamic range; Store the optimal parameter settings for different fabric types and colors for direct recall during the next inspection; The signal preprocessing module, based on the light intensity distribution data, uses a multi-threshold judgment and a smooth weighted algorithm to calculate the preliminary flatness grade of the fabric as a preliminary assessment to take into account the flatness differences of various parts of the fabric and mark out areas where there may be anomalies; A preliminary assessment module that inputs the results of the preliminary roughness grade and the receiver's reception ratio data into a pre-trained optimization model to optimize the accuracy of the roughness assessment and mark areas where anomalies may exist; An optimization module that inputs the results of the preliminary roughness grade and the receiver's reception ratio data into a pre-trained optimization model to optimize the accuracy of the roughness assessment and mark areas where anomalies may exist; The secondary detection module performs secondary detection if there are areas where abnormalities may exist, to determine and calibrate the results and use them as the final result data; if there are no areas where abnormalities may exist, the data output by the optimization model is used as the final result data; Comprehensive evaluation module, which analyzes the final result data and gives a comprehensive evaluation of the fabric flatness according to predetermined rules and / or analysis models, and displays the test results in real time; Output module, used to output comprehensive evaluation and test results; The specific steps of using multi-threshold judgment and smooth weighted algorithm to calculate the preliminary flatness grade of the fabric are as follows: According to the light intensity distribution data, a plurality of thresholds are set to distinguish different flatness states as preset flatness grade standards; For each set of measurement data, it is classified into different flatness levels according to its relationship with the set threshold; Take a weighted average of the flatness level at each location in the fabric’s inspection area; Mapping the flatness grade obtained by weighted average to a preset flatness grade standard; Output the overall flatness grade of the fabric to reflect the average flatness level of the fabric; The training steps of the optimization model are as follows: Acquire data containing fabric flatness information, including at least an image of the fabric, reception ratio data of the receiver, and fabric type; Perform data cleaning to remove invalid or erroneous data and assign a flatness level label to each piece of data after cleaning; Extract features from the cleaned data, including at least texture features, color features, and statistical features of the received ratio data of the fabric; Divide the data set into training set, validation set and test set; Establish a machine learning model and use the training set to train the machine learning model. During the training process, use the validation set data for model selection and hyperparameter tuning to prevent overfitting; The generalization ability of the machine learning model is evaluated through the test set until the machine learning model training is completed and an optimized model is obtained.
5. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the fabric flatness detection method according to any one of claims 1 to 3.
6. A readable storage medium, characterized in that: A computer program is stored in the readable storage medium, and the computer program includes a program code for controlling a process to execute the process, and the process includes the fabric flatness detection method according to any one of claims 1 to 3.
