Cloth category judgment method and device and storage medium

By constructing a fabric Raman spectrum library and performing category threshold analysis, the accuracy and automation issues of existing fabric category determination methods are solved, achieving efficient and accurate fabric category determination.

CN121786645APending Publication Date: 2026-04-03BEIJING HUATAI NOVA TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing methods for determining fabric categories rely on human experience and are easily influenced by subjectivity. Incineration is highly destructive, and large-scale visual analysis is easily affected by fabric color and weaving methods, and is not suitable for large-scale testing.

Method used

By importing and preprocessing multiple original fabric Raman spectra, a Raman spectral library is constructed, and category threshold analysis is performed. After updating the analysis, the target fabric Raman spectral library is obtained, thus enabling fabric category determination.

Benefits of technology

It improves the accuracy of fabric category identification, reduces the false positive rate, and is suitable for automated identification of large-scale fabric samples, avoiding manual operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121786645A_ABST
    Figure CN121786645A_ABST
Patent Text Reader

Abstract

The invention provides a cloth category determination method and device and a storage medium, and belongs to the technical field of cloth determination, and the method comprises the following steps: importing a plurality of first original cloth Raman spectrums, and respectively preprocessing each first original cloth Raman spectrum to obtain preprocessed cloth Raman spectrums, constructing an original cloth Raman spectrum library through all the pretreated cloth Raman spectrums; performing category threshold analysis on all the preprocessed cloth Raman spectrums to obtain a first category threshold; and importing a plurality of second original fabric Raman spectrums, and updating and analyzing all the first category threshold values according to the original fabric Raman spectrum library and all the second original fabric Raman spectrums to obtain second category threshold values. According to the method, interference of abnormal samples is avoided, the cloth category judgment accuracy is improved, the misjudgment probability is reduced, meanwhile, calculation parameters are few, the calculation amount is small, manual operation is not needed, and the method is suitable for the conditions that the cloth sample size is large and continuous collection is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of fabric identification technology, specifically to a method, apparatus, and storage medium for identifying fabric categories. Background Technology

[0002] Different types of fabrics, such as leather and wool, have different values, leading to numerous problems of inferior products being passed off as superior ones and counterfeit goods being sold. Currently, methods for determining fabric type rely on three main approaches: human experience, examining the odor or residue produced by burning, and large-scale visual analysis. Human experience requires a certain level of expertise and is overly dependent on subjective judgment, making it susceptible to human influence. Burning is destructive and unsuitable for large-scale testing. Large-scale visual analysis is limited to the image level and is easily affected by factors such as fabric color and weaving methods. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide a method, device and storage medium for determining fabric type, in order to address the shortcomings of the prior art.

[0004] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: A method for determining fabric type, comprising the following steps: Multiple first original fabric Raman spectra are imported, and each first original fabric Raman spectrum is preprocessed to obtain preprocessed fabric Raman spectra corresponding to each first original fabric Raman spectrum. An original fabric Raman spectrum library is constructed using all the preprocessed fabric Raman spectra. Category threshold analysis was performed on the Raman spectra of all the pre-processed fabrics to obtain the first category threshold corresponding to each category. Import multiple second original fabric Raman spectra, and update and analyze all first category thresholds based on the original fabric Raman spectrum library and all second original fabric Raman spectra to obtain second category thresholds corresponding to each category; Input all the second original fabric Raman spectra into the original fabric Raman spectrum library to obtain the target fabric Raman spectrum library; Import the Raman spectrum of the fabric to be determined, and perform a determination analysis on the Raman spectrum of the fabric to be determined based on the target fabric Raman spectrum library and all the second category thresholds to obtain the fabric category determination result.

[0005] Another technical solution of the present invention to solve the above-mentioned technical problems is as follows: A fabric category determination device, comprising: The import module is used to import multiple first-source Raman spectra of the fabric. The preprocessing module is used to preprocess each of the first original fabric Raman spectra to obtain preprocessed fabric Raman spectra corresponding to each of the first original fabric Raman spectra, and to construct an original fabric Raman spectrum library through all the preprocessed fabric Raman spectra. The threshold analysis module is used to perform category threshold analysis on all the preprocessed fabric Raman spectra to obtain the first category threshold corresponding to each category. The import module is also used to import multiple second original fabric Raman spectra; The update analysis module is used to update and analyze all the first category thresholds based on the original fabric Raman spectrum library and all the second original fabric Raman spectra, to obtain the second category thresholds corresponding to each category. The spectral library acquisition module is used to input all the second original fabric Raman spectra into the original fabric Raman spectral library to obtain the target fabric Raman spectral library; The import module is also used to import the Raman spectrum of the fabric to be judged; The determination result acquisition module is used to perform determination analysis on the Raman spectrum of the fabric to be determined based on the target fabric Raman spectrum library and all the second category thresholds, and obtain the fabric category determination result.

[0006] Based on the above-mentioned method for determining fabric category, the present invention also provides a fabric category determination system.

[0007] Another technical solution of the present invention to solve the above-mentioned technical problems is as follows: a fabric category determination system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the fabric category determination method as described above.

[0008] Based on the above-mentioned method for determining fabric type, the present invention also provides a computer-readable storage medium.

[0009] Another technical solution of the present invention to solve the above-mentioned technical problems is as follows: a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the fabric category determination method as described above.

[0010] The beneficial effects of this invention are as follows: Preprocessing the first original fabric Raman spectrum yields a preprocessed fabric Raman spectrum; an original fabric Raman spectrum library is constructed using the preprocessed fabric Raman spectrum; a first category threshold is obtained through category threshold analysis of the preprocessed fabric Raman spectrum; a second category threshold is obtained through updating the first category threshold based on the original fabric Raman spectrum library and the second original fabric Raman spectrum; the second original fabric Raman spectrum is input into the original fabric Raman spectrum library to obtain the target fabric Raman spectrum library; and the fabric category determination result is obtained through the determination analysis of the Raman spectrum of the fabric to be determined based on the target fabric Raman spectrum library and the second category threshold. This avoids interference from abnormal samples, improves the accuracy of fabric category determination, and reduces the probability of misjudgment. Furthermore, it requires fewer computational parameters and less computational load, does not require manual operation, and is suitable for situations with a large number of fabric samples and continuous acquisition. Attached Figure Description

[0011] Figure 1 This is a flowchart illustrating the fabric category determination method provided in an embodiment of the present invention. Figure 2 Spectral diagrams of four fabric samples for the fabric category determination method provided in this embodiment of the invention; Figure 3 Spectral diagrams of nine fabric samples for the fabric category determination method provided in this embodiment of the invention; Figure 4 This is a block diagram of a fabric category determination device provided in an embodiment of the present invention. Detailed Implementation

[0012] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.

[0013] Figure 1 This is a flowchart illustrating a method for determining fabric type according to an embodiment of the present invention.

[0014] like Figure 1 As shown, a method for determining fabric category includes the following steps: S1: Import multiple first original fabric Raman spectra, preprocess each first original fabric Raman spectrum to obtain preprocessed fabric Raman spectra corresponding to each first original fabric Raman spectrum, and construct an original fabric Raman spectrum library through all the preprocessed fabric Raman spectra. S2: Perform category threshold analysis on the Raman spectra of all the pre-processed fabrics to obtain the first category threshold corresponding to each category; S3: Import multiple second original fabric Raman spectra, update and analyze all first category thresholds based on the original fabric Raman spectrum library and all second original fabric Raman spectra, and obtain the second category thresholds corresponding to each category; S4: Input all the second original fabric Raman spectra into the original fabric Raman spectrum library to obtain the target fabric Raman spectrum library; S5: Import the Raman spectrum of the fabric to be determined, and perform a determination analysis on the Raman spectrum of the fabric to be determined based on the target fabric Raman spectrum library and all the second category thresholds to obtain the fabric category determination result.

[0015] It should be understood that appropriate measurement conditions are selected to scan and obtain the material spectrum (i.e., the first original fabric Raman spectrum); appropriate measurement conditions are selected to scan the unknown sample to be tested and obtain the material spectrum (i.e., the second original fabric Raman spectrum); appropriate measurement conditions are selected to scan the unknown sample to be tested and obtain the material spectrum (i.e., the fabric Raman spectrum to be determined).

[0016] In the above embodiments, the preprocessed Raman spectrum of the first original fabric is obtained by preprocessing the first original fabric Raman spectrum, and an original fabric Raman spectrum library is constructed using the preprocessed fabric Raman spectrum. The category threshold of the preprocessed fabric Raman spectrum is analyzed to obtain a first category threshold. The first category threshold is obtained by updating the first category threshold based on the original fabric Raman spectrum library and the second original fabric Raman spectrum. The second original fabric Raman spectrum is input into the original fabric Raman spectrum library to obtain the target fabric Raman spectrum library. The fabric category determination result is obtained by analyzing the Raman spectrum of the fabric to be determined based on the target fabric Raman spectrum library and the second category threshold. This avoids the interference of abnormal samples, improves the accuracy of fabric category determination, and reduces the probability of misjudgment. At the same time, it has few calculation parameters, low computational load, and does not require manual operation, making it suitable for situations with a large number of fabric samples and continuous collection.

[0017] Optionally, as an embodiment of the present invention, the process of preprocessing the Raman spectra of each of the first original fabrics to obtain the preprocessed Raman spectra of the fabrics corresponding to the Raman spectra of each of the first original fabrics includes: The Raman spectra of each of the first original fabrics are subjected to spectral cleaning to obtain the Raman spectra of the cleaned fabrics corresponding to the Raman spectra of each of the first original fabrics. The Raman spectra of each of the cleaned fabrics were labeled according to their categories to obtain the Raman spectra of the pretreated fabrics corresponding to the Raman spectra of each of the first original fabrics.

[0018] It should be understood that the obtained material spectra (i.e., the first original fabric Raman spectra) are subjected to spectral cleaning to remove abnormal samples. The remaining spectra (i.e., the cleaned fabric Raman spectra) are labeled according to categories and saved as a model library (i.e., the original fabric Raman spectrum library). Here, it is assumed that there are m categories and s samples (i.e., preprocessed fabric Raman spectra).

[0019] In the above embodiments, the Raman spectra of each first original fabric are preprocessed to obtain the preprocessed Raman spectra of the fabric, which avoids interference from abnormal samples and improves the accuracy of fabric category determination.

[0020] Optionally, as an embodiment of the present invention, the process of performing category threshold analysis on the Raman spectra of all the pretreated fabrics to obtain a first category threshold corresponding to each category includes: S21: Calculate the correlation coefficients for each of the pre-treated fabric Raman spectra and any remaining pre-treated fabric Raman spectra to obtain multiple first correlation coefficients for each category corresponding to each of the pre-treated fabric Raman spectra. S22: Sort the multiple first correlation coefficients of each category corresponding to the Raman spectra of each pre-treated fabric in descending order to obtain multiple second correlation coefficients corresponding to each category of the Raman spectra of each pre-treated fabric. S23: Take the first n second correlation coefficients of each category corresponding to the Raman spectra of each pre-treated fabric as third correlation coefficients, thereby obtaining multiple third correlation coefficients with each category corresponding to the Raman spectra of each pre-treated fabric. S24: Calculate the average value of multiple third correlation coefficients corresponding to each category of the Raman spectra of each pretreated fabric, and obtain the first category correlation coefficients corresponding to each category of the Raman spectra of each pretreated fabric; S25: Perform a first-category threshold analysis on all the correlation coefficients of the first category to obtain the first-category threshold corresponding to each category.

[0021] It should be understood that any remaining pre-treated fabric Raman spectrum refers to any pre-treated fabric Raman spectrum other than the current pre-treated fabric Raman spectrum.

[0022] Specifically, the correlation coefficients between each pair of all samples (i.e., the pre-processed fabric Raman spectra) are calculated. These correlation coefficients (i.e., the first correlation coefficients) can be calculated using Pearson correlation or the cosine similarity method. Each sample (i.e., the pre-processed fabric Raman spectra) corresponds to *s* correlation coefficients (i.e., the first correlation coefficients), denoted as the Correlation Coefficient Set of Sample (CCSS), with a size of *s* × *s*. Each sample's CCSS includes *m* categories.

[0023] It should be understood that in this invention, 'n' represents the same numerical value.

[0024] Specifically, for each sample (i.e., the pre-processed fabric Raman spectrum), the maximum n values ​​corresponding to a certain category in the CCSS are calculated, and the mean is taken, which is denoted as the Correlation Coefficient of Category (CCn) (i.e., the first-class correlation coefficient). Here, n is a limited window width, which is greater than 0 and less than the number of samples in the class with the fewest samples. CCn represents the best correlation between each sample and samples of a certain category when the window width is n. Here, each sample corresponds to m CCn values.

[0025] In the above embodiments, the first category threshold is obtained by performing category threshold analysis on the Raman spectra of all preprocessed fabrics, which avoids interference from abnormal samples, improves the accuracy of fabric category determination, and reduces the probability of misjudgment. At the same time, there are few calculation parameters and a small amount of computation, and no manual operation is required, making it suitable for situations where the number of fabric samples is large and continuous collection is required.

[0026] Optionally, as an embodiment of the present invention, the process of S25 includes: The first category correlation coefficients of the Raman spectra of each pre-processed fabric are sorted in descending order to obtain the second category correlation coefficients of the Raman spectra of each pre-processed fabric. The maximum value is selected from multiple second-category correlation coefficients corresponding to the Raman spectra of each pre-processed fabric, and the third-category correlation coefficient corresponding to each pre-processed fabric Raman spectra is obtained after the selection. If the category corresponding to the third category correlation coefficient is the same as the category corresponding to the Raman spectrum of the pre-processed fabric, then the third category correlation coefficient is used as the fourth category correlation coefficient, thereby obtaining the fourth category correlation coefficient with each category corresponding to the Raman spectrum of each pre-processed fabric. According to the category, the preprocessed Raman spectra of the fabrics corresponding to the correlation coefficients of all the fourth categories are divided to obtain multiple unprocessed Raman spectra of the fabrics corresponding to each category. Correlation coefficients are calculated for each Raman spectrum of the fabric to be processed corresponding to each category and for any Raman spectrum of the fabric to be processed corresponding to each category, to obtain the correlation coefficients between multiple first categories corresponding to the Raman spectra of each fabric to be processed in each category. The correlation coefficients between multiple first categories corresponding to the Raman spectra of each category and each fabric to be processed are sorted in descending order to obtain the correlation coefficients between multiple second categories corresponding to the Raman spectra of each category and each fabric to be processed. The first n second-category correlation coefficients corresponding to the Raman spectra of each category and each of the fabrics to be processed are respectively used as third-category correlation coefficients, thereby obtaining multiple third-category correlation coefficients corresponding to the Raman spectra of each category and each of the fabrics to be processed. The average value of the correlation coefficients between multiple third categories corresponding to the Raman spectra of each of the categories and each of the fabrics to be processed is calculated to obtain the correlation coefficients between multiple fourth categories corresponding to each of the categories. The correlation coefficients between the multiple fourth categories corresponding to each category are sorted in descending order to obtain the correlation coefficients between the multiple fifth categories corresponding to each category. Each of the first two fifth categories corresponding to each of the aforementioned categories is used as the sixth category correlation coefficient, thereby obtaining multiple sixth category correlation coefficients corresponding to each of the aforementioned categories. Calculate the average value of the correlation coefficients among the multiple sixth categories corresponding to each category to obtain the first category threshold corresponding to each category.

[0027] Specifically, for each sample (i.e., the pre-processed fabric Raman spectrum), the m CCn (i.e., the first-category correlation coefficients) are sorted from largest to smallest. Generally, each sample (i.e., the pre-processed fabric Raman spectrum) has the best correlation with its category; therefore, the largest CCn corresponds to its category and is denoted as CCn-max. 。 If the CCn-max of a sample is not in its own category, it indicates that the sample has poor relevance in its own category and is prone to misjudgment. The same sample should be added (the number should not be less than n) or the sample should be removed.

[0028] Specifically, the correlation between categories is calculated based on the category correlation of each sample. Assuming there are m categories A, B, C, etc., and category A has a samples (i.e., the Raman spectra of the fabric to be processed), then the correlation between categories A and A will have a values ​​of CCn. The average of the n largest values ​​is taken and denoted as the correlation value between categories A themselves, denoted as CCn. (A-A) This indicates that the correlation value CCn between category A and category B is calculated accordingly. (A-B) The correlation value CCn between category A and category C (A-C) There are m correlation values ​​between category A and other categories. The correlation values ​​between category B, category C, etc., and other categories are calculated sequentially. Finally, the correlation value between each category and other categories is obtained, denoted as the correlation coefficient between categories (CCBC) (i.e., the first category correlation coefficient), with a size of m×m. Here, n is the window width, greater than 0 and less than the number of samples in the class with the fewest samples. n can be the same as or different from the value in 3), preferably the same. Furthermore, m is the number of categories.

[0029] It should be understood that the two largest values ​​in the CCBC for each category are calculated, and their average is recorded as the threshold for that category. This process is repeated to obtain the thresholds for all categories (i.e., the first category threshold), denoted by T.

[0030] In the above embodiments, the first category threshold is obtained by performing first category threshold analysis on all first category correlation coefficients, which improves the accuracy of fabric category determination and reduces the probability of misjudgment. At the same time, there are few calculation parameters and little computational load, and no manual operation is required, making it suitable for situations where the sample size of fabrics is large and continuous collection is required.

[0031] Optionally, as an embodiment of the present invention, the process of updating and analyzing all first category thresholds based on the original fabric Raman spectrum library and all second original fabric Raman spectra to obtain second category thresholds corresponding to each category includes: Correlation coefficients are calculated for each of the second original fabric Raman spectra and for any preprocessed fabric Raman spectra in the original fabric Raman spectrum library, to obtain multiple fourth correlation coefficients corresponding to each of the categories of the second original fabric Raman spectra. The fourth correlation coefficients corresponding to the Raman spectra of each of the second original fabrics are sorted in descending order to obtain the fifth correlation coefficients corresponding to the Raman spectra of each of the second original fabrics. The first n fifth correlation coefficients corresponding to the Raman spectra of each of the second original fabrics are taken as the sixth correlation coefficients, thereby obtaining multiple sixth correlation coefficients corresponding to the Raman spectra of each of the second original fabrics. The average value of multiple sixth correlation coefficients corresponding to the Raman spectra of each of the second original fabrics is calculated to obtain the fifth category correlation coefficient corresponding to the Raman spectra of each of the second original fabrics. All first category correlation coefficients and all fifth category correlation coefficients are used as sixth category correlation coefficients to obtain multiple sixth category correlation coefficients, and S25 is executed to obtain the second category threshold corresponding to each category.

[0032] It should be understood that after the threshold calculation / model building part is completed, subsequent calculations can be performed incrementally if additional samples are added (such as new samples added to the library, or samples added after prediction errors).

[0033] Specifically, the correlation coefficient between the new sample and all samples in the model library is calculated, which is called the correlation coefficient set of new sample (i.e., the fourth correlation coefficient), or CCSNS for short.

[0034] It should be understood that, in calculating the CCSNS (i.e., the fourth correlation coefficient) of the newly added samples, the average of the n largest values ​​for each category is taken and denoted as the correlation coefficient of category of new sample (hereinafter referred to as CCNn) (i.e., the fifth category correlation coefficient). Here, n is a limited window width, and n is greater than 0 and less than the number of samples in the class with the fewest samples.

[0035] It should be understood that the CCNn (i.e., the fifth category correlation coefficient) of the new sample is combined with the original CCn (i.e., the first category correlation coefficient) to form a new CCn (i.e., the sixth category correlation coefficient).

[0036] In the above embodiments, the first category threshold is updated and analyzed based on the original fabric Raman spectrum library and the second original fabric Raman spectrum to obtain the second category threshold, which improves the accuracy of fabric category determination and reduces the probability of misjudgment. At the same time, there are few calculation parameters and little computational load, and no manual operation is required.

[0037] Optionally, as an embodiment of the present invention, the target fabric Raman spectrum library includes multiple target fabric Raman spectra, and the process of performing a determination analysis on the Raman spectrum of the fabric to be determined based on the target fabric Raman spectrum library and all the second category thresholds to obtain the fabric category determination result includes: Correlation coefficients are calculated for the Raman spectra of the fabric to be determined and the Raman spectra of any target fabric in the target fabric Raman spectrum library, respectively, to obtain multiple seventh correlation coefficients for each category corresponding to the Raman spectra of the fabric to be determined; The seventh correlation coefficients of the Raman spectra of the fabric to be determined are sorted in descending order to obtain the eighth correlation coefficients of the Raman spectra of the fabric to be determined for each category. The first n eighth correlation coefficients of each category corresponding to the Raman spectrum of the fabric to be determined are taken as the ninth correlation coefficients, thereby obtaining multiple ninth correlation coefficients with each category corresponding to the Raman spectrum of the fabric to be determined. The average value of multiple ninth correlation coefficients corresponding to each category of the Raman spectrum of the fabric to be determined is calculated to obtain the seventh category correlation coefficient with each category of the Raman spectrum of the fabric to be determined. The first formula is used to calculate the seventh category correlation coefficient and the second category threshold corresponding to each category of the Raman spectrum of the fabric to be judged, respectively, to obtain the category score value corresponding to each category. , in, For category score, This is the seventh category correlation coefficient. The threshold for the second category; The maximum value is selected from all the category scores, and the category corresponding to the maximum category score is used as the fabric category determination result.

[0038] It should be understood that the correlation coefficient between the unknown sample to be tested (i.e., the Raman spectrum of the fabric to be determined) and all samples in the model library (i.e., the Raman spectrum of the target fabric) is calculated, namely the CCSS (i.e., the seventh correlation coefficient).

[0039] Specifically, the n values ​​with the highest relevance for each category in the CCSS (seventh correlation coefficient) of the test sample are calculated, and the mean is recorded as the category correlation coefficient of the test set (hereinafter referred to as CCT). n (i.e., the seventh category correlation coefficient). Here, n is the window width, preferably consistent with the value in the threshold calculation. Since there are m categories in the model library, there are a total of m CCTn (i.e., the seventh category correlation coefficient).

[0040] It should be understood that, for each category, the corresponding CCT is used.n The value obtained by dividing the seventh category correlation coefficient by the category threshold (i.e., the second category threshold) is the score of the test set in that category (hereinafter referred to as ST). n (i.e., category score). ST n (i.e., category score) indicates that when the window width is n, there are m categories in the model library, and here there are m STs. n Value (i.e., category score).

[0041] It should be understood that the category with the highest score is determined as the category of the sample being tested. In practical applications, the above measurement can be repeated K times, and the sum of ST values ​​can be accumulated. n The category with the highest final score is the classification category of the unknown sample (i.e., the fabric category classification result). Here, k is prioritized 5 times.

[0042] In the above embodiments, the Raman spectrum of the fabric to be judged is analyzed based on the target fabric Raman spectrum library and the second category threshold to obtain the fabric category judgment result, which improves the accuracy of fabric category judgment and reduces the probability of misjudgment. At the same time, there are few calculation parameters and little computation, and no manual operation is required.

[0043] Optionally, as another embodiment of the present invention, commonly used qualitative analysis algorithms include Partial Least Squares Discriminant Analysis (PLSDA), K-Nearest Neighbors (KNN), Soft Independent Modeling (SIMCA), and Support Vector Machine (SVM). PLSDA, KNN, SIMCA, and SVM methods generally extract feature information through dimensionality reduction, decomposition, and independent variables, and then use this feature information for classification. These methods have two problems: First, they are less adaptable to samples with indistinct features. In actual production, interference factors such as color and texture on the surface of fabric samples can significantly obscure Raman information, resulting in fewer extracted Raman spectral features, often requiring qualitative classification based only on the overall trend. Second, the training process requires professional operation, such as modifying parameters and deleting samples, which is not conducive to automated modeling and calculation. There are many types of fabric samples, and collection needs to be frequent and continuous. Traditional methods require manual model updates each time a sample is added, consuming significant manpower, time, and costs. To address these problems, the present invention proposes a fabric category determination algorithm.

[0044] Optionally, as another embodiment of the present invention, the correlation calculation in this invention involves sequentially calculating the consistency between the test sample and all samples in the model library, without extracting feature information, and mainly based on trend judgment, which conforms to the characteristics of Burley Raman spectroscopy. However, the method of calculating a one-to-one correspondence between the test sample and the samples in the model library, and only taking the maximum correlation value, has low accuracy. To improve this phenomenon, the present invention proposes the following two methods.

[0045] First, the concept of category sets was added. Each category was treated as a whole, and the category correlation between the test sample and the category set was calculated, thus avoiding misjudgment caused by a single sample.

[0046] Secondly, the concepts of category thresholds and scoring are introduced. The correlation between samples in each category varies. For categories with low inherent correlation, misclassification based solely on category correlation can still occur. Therefore, a category threshold is introduced. For each category, a category threshold is calculated based on the training dataset; the higher the correlation between samples and a category, the higher the category threshold. During prediction, the category correlation between the sample to be tested and each category is first calculated, then divided by the category threshold. The result is called the score, and the category with the highest score is the final classification. This method reduces misclassification caused by varying correlations between category samples.

[0047] The advantages of this invention are: 1. Introduce the concept of categories to avoid interference from abnormal samples and improve the accuracy of cloth classification.

[0048] 2. Introduce category thresholds and scoring methods. Use category thresholds to perform secondary scoring calculations on the correlation analysis results of the substances to be tested, thereby reducing misjudgments.

[0049] 3. Automated Calculation. This method requires few calculation parameters and no manual operation is needed. The results can be automatically calculated in a streamlined process. It is very suitable for situations with a large number of fabric samples and continuous collection.

[0050] 4. The program has a small computational load and does not involve performing complex calculations, so it can be implemented on various computing platforms.

[0051] Optionally, as another embodiment of the present invention, based on correlation analysis, the present invention adds a category threshold (i.e., a threshold for each category of substance), assigns a score to the substance to be tested according to the threshold, and qualitatively identifies the substance to be tested by accumulating the score. The threshold calculation part constitutes model building, and the qualitative part after assigning scores based on the threshold constitutes prediction of unknown samples.

[0052] Alternatively, as another embodiment of the present invention, such as Figure 2 As shown, there are four fabric samples (designated a / b / c / d) with minimal differences between them. For each fabric, 80 samples were taken to measure their spectra, resulting in 80 spectra. The spectral data from these four fabrics were scanned sequentially and used as the calibration set, yielding a total of 320 spectra. Additionally, 10 samples from each fabric were selected to measure their spectra as test spectra. The spectral data from these four fabrics were scanned sequentially and used as the validation set, yielding a total of 40 test spectra. The prediction accuracy of the validation set was calculated to determine the effectiveness of the proposed solution.

[0053] According to the steps of the threshold calculation section of the present invention, the threshold in this embodiment is calculated as follows: 1) In this embodiment, there are 4 categories. 80 samples are used for training in each category, for a total of 320 samples in the training set. The window width for each category is set to 10. 10 samples are selected for testing in each category, for a total of 40 samples in the test set. 2) Calculate the correlation between pairs of spectra in the correction set. In this embodiment, the correlation calculation is Pearson correlation calculation.

[0054] 3) Calculate the class correlation between each spectrum and all classes.

[0055] 4) Calculate the correlation between categories. The results are shown in Table 1. As can be seen from the table, category a is most similar to category d, category b is most similar to category a, category c is most similar to category b, and category d is most similar to category a. Find the most similar category and calculate the average correlation between it and its own category to obtain the category threshold. Table 1 shows the correlation results between categories for the four fabric samples.

[0056] Table 1 5) Category threshold calculation. As shown in Table 2, the category threshold is obtained according to (4). Once the category threshold is obtained, the modeling stage ends. Table 2 shows the category thresholds obtained for the four fabric samples.

[0057] Table 2 6) Based on the category threshold and the sample spectrum of the model library, predictions were made on the test set. The prediction results are shown in Table 3. Among them, 1 sample was predicted incorrectly, and 39 samples were predicted correctly, with an accuracy rate of 97.5%. Table 3 shows the prediction results for the four types of fabric samples.

[0058] Table 3 Alternatively, as another embodiment of the present invention, such as Figure 3 As shown, there are nine fabric samples (101, 102, 103, 201, 202, 203, 301, 302, and 401, respectively), with minimal differences between them. Eighty samples of each fabric were taken to measure their spectra, resulting in 80 spectra. The spectral data from these nine fabrics were scanned sequentially and used as the calibration set, yielding a total of 720 spectra. Additionally, 20 samples of each fabric were selected to measure their spectra as test spectra. The spectral data from these nine fabrics were scanned sequentially and used as the validation set, yielding a total of 180 test spectra. The prediction accuracy of the validation set was calculated to determine the effectiveness of the proposed solution.

[0059] (1) As shown in Table 4, the nine types of fabrics were calibrated and trained according to the method in this invention to obtain the category thresholds of the nine types of fabrics. Table 4 shows the category thresholds of the nine types of fabrics.

[0060] Table 4 (2) Based on the category threshold and the sample spectrum of the model library, the test set was predicted and statistically predicted. As shown in Table 5, all predictions were correct. Table 5 shows the prediction results for nine types of fabrics.

[0061] Table 5 Alternatively, as another embodiment of the present invention, such as Figure 2 As shown, SVM analysis is used. First, the model is trained using the calibration set samples, and then the accuracy of the model is verified using the validation set.

[0062] I. This process uses the SVM method based on Libsvm, employing the C-SVC mode and selecting the radial basis function (RBF) kernel. The training process includes two parameters: the penalty vector (C) and the gamma parameter (G).

[0063] II. Parameter Optimization: The optimization process for C and G uses a conventional grid optimization method, with a range of 10. -2 ~10 2 Between, according to 10 -2 10 -1.5 10 -1 10 -0.5 10 0 10 0.5 10 1 10 1.5 10 2 The calculation results are divided into 9 levels, totaling 81 points. Table 6 shows the calculation results for four fabric samples.

[0064] Table 6 *Acc: The accuracy of the classification calculation during the optimization process.

[0065] Third, first select the parameter combination with the highest accuracy, then select the one with the smallest G (the smaller the Gamma, the lower the boundary complexity, avoiding overfitting), and finally select the one with the smallest C (the smaller the penalty vector, the better the model robustness). Ultimately, C and G are chosen to be 10. 1.5 10 -2 combination.

[0066] Fourth, use the parameters from the previous step to calculate the model and obtain the model.

[0067] V. The model was used to calculate the validation set data, and the prediction results are shown in Table 7. Among them, 4 samples were predicted incorrectly, and 36 samples were predicted correctly, with an accuracy rate of 90.0%. Table 7 shows the prediction results for the four types of fabric samples.

[0068] Table 7 Alternatively, as another embodiment of the present invention, such as Figure 3 As shown, SVM analysis is used. First, the model is trained using the calibration set samples, and then the accuracy of the model is verified using the validation set.

[0069] (a) The SVM method based on Libsvm is still used, employing the C-SVC model. The radial basis function (RBF) kernel is selected, and the penalty vector (C) and Gamma parameter (G) are optimized within a range of 10. -2 ~10 2 Between, still according to 10 -2 10 -1.5 10 -1 10 -0.5 10 0 10 0.5 10 1 10 1.5 10 2 The data is divided into 9 levels, with a total of 81 points. The calculation results are shown in Table 8, which presents the calculation results for nine fabric samples.

[0070] Table 8 *Acc: The accuracy of the classification calculation during the optimization process.

[0071] (ii) First, select the parameter combination with the highest accuracy, then select the one with the smallest G (the smaller the Gamma, the lower the boundary complexity, avoiding overfitting), and finally select the one with the smallest C (the smaller the penalty vector, the better the model robustness). Ultimately, C and G are chosen to be 10. 1.5 10 -1 The model is obtained by combining and calculating.

[0072] (III) The model obtained in (II) was used to calculate the validation set data, and the prediction results are shown in Table 9. Among them, 16 samples were predicted incorrectly, and 164 samples were predicted correctly, with an accuracy rate of 91.1%. Table 9 shows the prediction results for the four types of fabric samples.

[0073] Table 9 Alternatively, as another embodiment of the present invention, Raman spectroscopy is a technique that uses the Raman scattering phenomenon of matter to analyze it, and has the advantages of being fast, non-destructive, and low-cost. Different types of fabrics, such as leather, cotton, and wool, have different compositions and therefore produce different Raman spectra. By analyzing the spectra, the material of the fabric can be identified at the molecular level.

[0074] Raman spectroscopy analysis requires qualitative analysis techniques. In actual production, Raman spectroscopy is used for qualitative analysis of fabrics. Due to the inherent factors of the fabrics themselves, a qualitative analysis method that utilizes trend correlation analysis and can be automatically modeled needs to be developed.

[0075] Figure 4 This is a block diagram of a fabric category determination device provided in an embodiment of the present invention.

[0076] Alternatively, as another embodiment of the present invention, such as Figure 4 As shown, a fabric category determination device includes: The import module is used to import multiple first-source Raman spectra of the fabric. The preprocessing module is used to preprocess each of the first original fabric Raman spectra to obtain preprocessed fabric Raman spectra corresponding to each of the first original fabric Raman spectra, and to construct an original fabric Raman spectrum library through all the preprocessed fabric Raman spectra. The threshold analysis module is used to perform category threshold analysis on all the preprocessed fabric Raman spectra to obtain the first category threshold corresponding to each category. The import module is also used to import multiple second original fabric Raman spectra; The update analysis module is used to update and analyze all the first category thresholds based on the original fabric Raman spectrum library and all the second original fabric Raman spectra, to obtain the second category thresholds corresponding to each category. The spectral library acquisition module is used to input all the second original fabric Raman spectra into the original fabric Raman spectral library to obtain the target fabric Raman spectral library; The import module is also used to import the Raman spectrum of the fabric to be judged; The determination result acquisition module is used to perform determination analysis on the Raman spectrum of the fabric to be determined based on the target fabric Raman spectrum library and all the second category thresholds, and obtain the fabric category determination result.

[0077] Optionally, as an embodiment of the present invention, the preprocessing module performs preprocessing on each of the first original fabric Raman spectra to obtain preprocessed fabric Raman spectra corresponding to each of the first original fabric Raman spectra, including: The Raman spectra of each of the first original fabrics are subjected to spectral cleaning to obtain the Raman spectra of the cleaned fabrics corresponding to the Raman spectra of each of the first original fabrics. The Raman spectra of each of the cleaned fabrics were labeled according to their categories to obtain the Raman spectra of the pretreated fabrics corresponding to the Raman spectra of each of the first original fabrics.

[0078] Optionally, another embodiment of the present invention provides a fabric category determination system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the fabric category determination method as described above. This system can be a computer or similar system.

[0079] Optionally, another embodiment of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the fabric category determination method as described above.

[0080] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0081] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and unit can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0082] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0083] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention, depending on actual needs.

[0084] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0085] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0086] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for determining fabric category, characterized in that, Includes the following steps: Multiple first original fabric Raman spectra are imported, and each first original fabric Raman spectrum is preprocessed to obtain preprocessed fabric Raman spectra corresponding to each first original fabric Raman spectrum. An original fabric Raman spectrum library is constructed using all the preprocessed fabric Raman spectra. Category threshold analysis was performed on the Raman spectra of all the pre-processed fabrics to obtain the first category threshold corresponding to each category. Import multiple second original fabric Raman spectra, and update and analyze all first category thresholds based on the original fabric Raman spectrum library and all second original fabric Raman spectra to obtain second category thresholds corresponding to each category; Input all the second original fabric Raman spectra into the original fabric Raman spectrum library to obtain the target fabric Raman spectrum library; Import the Raman spectrum of the fabric to be determined, and perform a determination analysis on the Raman spectrum of the fabric to be determined based on the target fabric Raman spectrum library and all the second category thresholds to obtain the fabric category determination result.

2. The fabric category determination method according to claim 1, characterized in that, The process of preprocessing the Raman spectra of each of the first original fabrics to obtain the preprocessed Raman spectra of the fabrics corresponding to the Raman spectra of each of the first original fabrics includes: The Raman spectra of each of the first original fabrics are subjected to spectral cleaning to obtain the Raman spectra of the cleaned fabrics corresponding to the Raman spectra of each of the first original fabrics. The Raman spectra of each of the cleaned fabrics were labeled according to their categories to obtain the Raman spectra of the pretreated fabrics corresponding to the Raman spectra of each of the first original fabrics.

3. The fabric category determination method according to claim 1, characterized in that, The process of performing category threshold analysis on all the preprocessed fabric Raman spectra to obtain the first category threshold corresponding to each category includes: S21: Calculate the correlation coefficients for each of the pre-treated fabric Raman spectra and any remaining pre-treated fabric Raman spectra to obtain multiple first correlation coefficients for each category corresponding to each of the pre-treated fabric Raman spectra. S22: Sort the multiple first correlation coefficients of each category corresponding to the Raman spectra of each pre-treated fabric in descending order to obtain multiple second correlation coefficients corresponding to each category of the Raman spectra of each pre-treated fabric. S23: Take the first n second correlation coefficients of each category corresponding to the Raman spectra of each pre-treated fabric as third correlation coefficients, thereby obtaining multiple third correlation coefficients with each category corresponding to the Raman spectra of each pre-treated fabric. S24: Calculate the average value of multiple third correlation coefficients corresponding to each category of the Raman spectra of each pretreated fabric, and obtain the first category correlation coefficients corresponding to each category of the Raman spectra of each pretreated fabric; S25: Perform a first-category threshold analysis on all the correlation coefficients of the first category to obtain the first-category threshold corresponding to each category.

4. The fabric category determination method according to claim 3, characterized in that, The process in S25 includes: The first category correlation coefficients of the Raman spectra of each pre-processed fabric are sorted in descending order to obtain the second category correlation coefficients of the Raman spectra of each pre-processed fabric. The maximum value is selected from multiple second-category correlation coefficients corresponding to the Raman spectra of each pre-processed fabric, and the third-category correlation coefficient corresponding to each pre-processed fabric Raman spectra is obtained after the selection. If the category corresponding to the third category correlation coefficient is the same as the category corresponding to the Raman spectrum of the pre-processed fabric, then the third category correlation coefficient is used as the fourth category correlation coefficient, thereby obtaining the fourth category correlation coefficient with each category corresponding to the Raman spectrum of each pre-processed fabric. According to the category, the preprocessed Raman spectra of the fabrics corresponding to the correlation coefficients of all the fourth categories are divided to obtain multiple unprocessed Raman spectra of the fabrics corresponding to each category; Correlation coefficients are calculated for each Raman spectrum of the fabric to be processed corresponding to each category and for any Raman spectrum of the fabric to be processed corresponding to each category, to obtain the correlation coefficients between multiple first categories corresponding to the Raman spectra of each fabric to be processed in each category. The correlation coefficients between multiple first categories corresponding to the Raman spectra of each category and each fabric to be processed are sorted in descending order to obtain the correlation coefficients between multiple second categories corresponding to the Raman spectra of each category and each fabric to be processed. The first n second-category correlation coefficients corresponding to the Raman spectra of each category and each of the fabrics to be processed are respectively used as third-category correlation coefficients, thereby obtaining multiple third-category correlation coefficients corresponding to the Raman spectra of each category and each of the fabrics to be processed. The average value of the correlation coefficients between multiple third categories corresponding to the Raman spectra of each of the categories and each of the fabrics to be processed is calculated to obtain the correlation coefficients between multiple fourth categories corresponding to each of the categories. The correlation coefficients between the multiple fourth categories corresponding to each category are sorted in descending order to obtain the correlation coefficients between the multiple fifth categories corresponding to each category. Each of the first two fifth categories corresponding to each of the aforementioned categories is used as the sixth category correlation coefficient, thereby obtaining multiple sixth category correlation coefficients corresponding to each of the aforementioned categories. Calculate the average value of the correlation coefficients among the multiple sixth categories corresponding to each of the categories to obtain the first category threshold corresponding to each of the categories.

5. The fabric category determination method according to claim 3, characterized in that, The process of updating and analyzing all first category thresholds based on the original fabric Raman spectral library and all second original fabric Raman spectra to obtain the second category thresholds corresponding to each category includes: Correlation coefficients are calculated for each of the second original fabric Raman spectra and for any preprocessed fabric Raman spectra in the original fabric Raman spectrum library, to obtain multiple fourth correlation coefficients corresponding to each of the categories of the second original fabric Raman spectra. The fourth correlation coefficients corresponding to the Raman spectra of each of the second original fabrics are sorted in descending order to obtain the fifth correlation coefficients corresponding to the Raman spectra of each of the second original fabrics. The first n fifth correlation coefficients corresponding to the Raman spectra of each of the second original fabrics are taken as the sixth correlation coefficients, thereby obtaining multiple sixth correlation coefficients corresponding to the Raman spectra of each of the second original fabrics. The average value of multiple sixth correlation coefficients corresponding to the Raman spectra of each of the second original fabrics is calculated to obtain the fifth category correlation coefficient corresponding to the Raman spectra of each of the second original fabrics. All first category correlation coefficients and all fifth category correlation coefficients are used as sixth category correlation coefficients to obtain multiple sixth category correlation coefficients, and S25 is executed to obtain the second category threshold corresponding to each category.

6. The fabric category determination method according to claim 1, characterized in that, The target fabric Raman spectral library includes multiple target fabric Raman spectra. The process of analyzing the Raman spectra of the fabric to be determined based on the target fabric Raman spectral library and all the second category thresholds to obtain the fabric category determination result includes: Correlation coefficients are calculated for the Raman spectra of the fabric to be determined and the Raman spectra of any target fabric in the target fabric Raman spectrum library, respectively, to obtain multiple seventh correlation coefficients for each category corresponding to the Raman spectra of the fabric to be determined; The seventh correlation coefficients of the Raman spectra of the fabric to be determined are sorted in descending order to obtain the eighth correlation coefficients of the Raman spectra of the fabric to be determined for each category. The first n eighth correlation coefficients of each category corresponding to the Raman spectrum of the fabric to be determined are taken as the ninth correlation coefficients, thereby obtaining multiple ninth correlation coefficients with each category corresponding to the Raman spectrum of the fabric to be determined. The average value of multiple ninth correlation coefficients corresponding to each category of the Raman spectrum of the fabric to be determined is calculated to obtain the seventh category correlation coefficient with each category of the Raman spectrum of the fabric to be determined. The first formula is used to calculate the seventh category correlation coefficient and the second category threshold corresponding to each category of the Raman spectrum of the fabric to be judged, respectively, to obtain the category score value corresponding to each category. , in, For category score, This is the seventh category correlation coefficient. The threshold for the second category; The maximum value is selected from all the category scores, and the category corresponding to the maximum category score is used as the fabric category determination result.

7. A fabric category determination device, characterized in that, include: The import module is used to import multiple first-generation Raman spectra of the fabric. The preprocessing module is used to preprocess each of the first original fabric Raman spectra to obtain preprocessed fabric Raman spectra corresponding to each of the first original fabric Raman spectra, and to construct an original fabric Raman spectrum library through all the preprocessed fabric Raman spectra. The threshold analysis module is used to perform category threshold analysis on all the preprocessed fabric Raman spectra to obtain the first category threshold corresponding to each category. The import module is also used to import multiple second original fabric Raman spectra; The update analysis module is used to update and analyze all the first category thresholds based on the original fabric Raman spectrum library and all the second original fabric Raman spectra, to obtain the second category thresholds corresponding to each category. The spectral library acquisition module is used to input all the second original fabric Raman spectra into the original fabric Raman spectral library to obtain the target fabric Raman spectral library; The import module is also used to import the Raman spectrum of the fabric to be judged; The determination result acquisition module is used to perform determination analysis on the Raman spectrum of the fabric to be determined based on the target fabric Raman spectrum library and all the second category thresholds, and obtain the fabric category determination result.

8. The fabric category determination device according to claim 7, characterized in that, The preprocessing module performs preprocessing on each of the first original fabric Raman spectra to obtain preprocessed fabric Raman spectra corresponding to each of the first original fabric Raman spectra, including: The Raman spectra of each of the first original fabrics are subjected to spectral cleaning to obtain the Raman spectra of the cleaned fabrics corresponding to the Raman spectra of each of the first original fabrics. The Raman spectra of each of the cleaned fabrics were labeled according to their categories to obtain the Raman spectra of the pretreated fabrics corresponding to the Raman spectra of each of the first original fabrics.

9. A fabric category determination device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the fabric category determination method as described in any one of claims 1 to 6.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the fabric category determination method as described in any one of claims 1 to 6.