A method and system for identifying quaternary ammonium salt extract spectra in textiles
By combining Raman spectroscopy and Fourier transform infrared spectroscopy, using similarity analysis and convolutional neural networks, the presence and concentration of quaternary ammonium salts in textiles can be quickly and accurately detected, solving the problems of low detection efficiency and poor accuracy in existing technologies and realizing real-time monitoring and quality control of textile production.
Patent Information
- Application Number
- CN202511040079.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-28
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-07-28
AI Technical Summary
Existing technologies have difficulty in quickly and accurately detecting the content of quaternary ammonium salts in textiles, especially in complex matrices, where there are problems of misjudgment and high computing resource requirements.
Raman spectroscopy was used to quickly detect the presence of quaternary ammonium salts. Samples were screened through similarity analysis and weight coefficients. The concentration was determined by combining Fourier transform infrared spectroscopy. A convolutional neural network was used to establish a quaternary ammonium salt concentration prediction model.
It improves detection efficiency and accuracy, reduces computing resources, realizes real-time monitoring and accurate quaternary ammonium salt concentration assessment, and avoids product quality problems.
Smart Images

Figure CN120539126B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of material detection, and in particular to a method and system for identifying a spectrum of a quaternary ammonium salt extract in textiles. Background Art
[0002] In the production and application of modern textiles, quaternary ammonium salts are widely used as important chemical additives in textile finishing and functionalization. These salts not only impart excellent antistatic properties, softness, and wrinkle resistance to textiles, but also improve the fabric's feel and comfort. However, with increasing concern for the environment and human health, the use of quaternary ammonium salts has been subject to certain restrictions. Excessive or misused quaternary ammonium salts can cause environmental pollution and potential skin irritation.
[0003] Traditional quaternary ammonium salt detection method usually relies on chemical analysis means, such as acid-base titration, chromatography, etc., but is complicated to operate, time-consuming, and requires professional laboratory equipment and experienced technicians. In addition, these methods are difficult to realize on-site rapid detection, which limits its application in large-scale textile production and quality control. And by spectrum, the quaternary ammonium salt detection method can quickly detect the quaternary ammonium salt in the sample, such as near-infrared spectroscopy, Raman spectroscopy, etc., but by the spectral detection method, such as dyeing or complex matrix in the textile can affect the detection spectrum at different wavebands, causing the detection of quaternary ammonium salt to have misjudgment, therefore determining the strong expression waveband of quaternary ammonium salt feature in the spectrum, is very necessary. In addition, although near-infrared spectroscopy, Raman spectroscopy, etc. are fast and suitable for online monitoring, in the complex matrix when low concentration detection and complex sample analysis, effective information can also be provided, so that the information of quaternary ammonium salt is diluted, and it is impossible to accurately obtain the concentration data of quaternary ammonium salt in the textile simultaneously. Therefore, how to quickly and accurately detect and evaluate the content of quaternary ammonium salt in textile becomes a technical problem urgently to be solved in the textile industry.
[0004] In the prior art, publication number CN116257776A discloses an infrared spectrogram identification method and device based on similarity matching. The method includes: extracting a first characteristic peak from the infrared spectrogram to be identified of the substance to be identified, and extracting a second characteristic peak from the sample infrared spectrograms of multiple sample substances in a basic sample library; performing a similarity matching operation based on the peak position of the first characteristic peak and the peak position of the second characteristic peak, and determining at least one candidate infrared spectrogram in the multiple sample infrared spectrograms; performing a similarity matching operation on the infrared spectrogram to be identified and the candidate infrared spectrograms based on the peak position matching degree between the infrared spectrogram to be identified and the at least one candidate infrared spectrogram, the peak interval of the third characteristic peak, and the peak interval of the first characteristic peak, and determining a target infrared spectrogram in the at least one candidate infrared spectrogram; obtaining an identification result of the infrared spectrogram to be identified based on the target infrared spectrum. If this method is used for the detection of quaternary ammonium salts in textiles, due to not considering the situation where complex matrices provide effective information, the similarity matching operation has a large error. At the same time, it is necessary to prepare a large number of comparison template libraries, which requires a large amount of computing resources. Therefore, the real-time performance and effectiveness of the detection method are reduced.
[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art. Summary of the Invention
[0006] The object of the present invention is to provide a method and system for identifying the spectrum of quaternary ammonium salt extracts in textiles to solve the problems raised in the above background technology.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] A method for identifying a spectrum of a quaternary ammonium salt extract in a textile, comprising the following steps:
[0009] Obtaining several textile samples of the same type as the textile to be tested, including a reference sample without quaternary ammonium salt and control samples containing different concentrations of quaternary ammonium salt, extracting the quaternary ammonium salt from each textile to prepare a corresponding extract, and collecting a Raman spectrum image of each extract;
[0010] Each Raman spectrum image is divided into several sub-band regions according to the same division standard, and the spectral image feature data of each sub-band region is extracted. The similarity between each control sample and the reference sample in the same sub-band region is calculated, and the weight coefficient of each band region is determined based on the similarity distribution;
[0011] Calculate the similarity between the textile to be tested and the reference sample in the same sub-band area, and combine the weight coefficient to generate a judgment similarity used to judge the degree of similarity between the two;
[0012] A corresponding similarity threshold is set, and the judged similarity is compared with the similarity threshold. If the judged similarity is less than the similarity threshold, it is determined that the textile to be tested does not contain quaternary ammonium salt. Otherwise, a Fourier transform infrared spectrum of the extract to be tested is collected.
[0013] The obtained Fourier transform infrared spectrum is passed through a pre-trained quaternary ammonium salt concentration prediction model. The quaternary ammonium salt concentration prediction model outputs a corresponding quaternary ammonium salt concentration prediction value based on the input image to determine the quaternary ammonium salt concentration of the textile to be tested.
[0014] Furthermore, the logic for extracting the quaternary ammonium salt from each textile to produce the corresponding extract is as follows: determining extraction conditions, placing the collected textiles into an extraction solvent to extract the quaternary ammonium salt to produce the extract, wherein the determined extraction conditions include the extraction solvent composition and the extraction time, and the extract is produced according to the determined extraction conditions.
[0015] Further, extracting spectral image feature data within the corresponding sub-band region and calculating the similarity of the images within the sub-band region, wherein the spectral image feature data within the corresponding sub-band region includes the width of the characteristic peak, the distance between adjacent characteristic peaks, the peak value of the characteristic peak and the corresponding wavelength, and the sub-band region contains at least one complete characteristic peak;
[0016] The similarity of images in the sub-band area is calculated based on the following formula:
[0017] ;
[0018] Where, is the similarity between the reference sample and the qth control sample in the i-th sub-band area, is the peak similarity between the reference sample and the qth control sample in the i-th sub-band area, is the signal intensity of the qth control sample at the corresponding wavelength j in the i-th sub-band area, is the signal strength of the reference sample at the corresponding wavelength j in the i-th sub-band area, where i is the index of the sub-band area, , is the total number of sub-band regions, j is the wavelength value in the sub-band region, , is the starting wavelength in the sub-band area, is the cutoff wavelength in the sub-band region, where q is the index of the control sample, , Q is the total number of control samples.
[0019] Furthermore, the peak similarity of the i-th sub-band region The specific calculation formula is:
[0020] ;
[0021] Where, is the peak value of the pth characteristic peak of the qth control sample in the i-th sub-band area, is the peak value of the pth characteristic peak of the reference sample in the i-th sub-band area, is the average distance between adjacent characteristic peaks of the qth control sample in the i-th sub-band area, is the Raman spectrum of the reference sample, and in the ith sub-band, the average distance between adjacent characteristic peaks is: is the Raman spectrum of the qth concentration of the quaternary ammonium salt control sample. In the i-th sub-band area, the peak point of the p-th characteristic peak corresponds to the wavelength. For the Raman spectrum of the reference sample, in the ith sub-band region, the peak point of the pth characteristic peak corresponds to the wavelength, where p is the index of the characteristic peak in the sub-band region, , m is the number of characteristic peaks in the sub-band area.
[0022] Furthermore, based on the similarity distribution, the weight coefficient of each band area is determined; the specific formula for calculating the weight coefficient of each band area is:
[0023] ;
[0024] Where, is the weight coefficient of the ith sub-band, and the weight coefficient of each sub-band is obtained as follows: , is the similarity variance of the qth and bth control samples in the i-th sub-band, and are the concentrations of quaternary ammonium salts in the qth control sample and the bth control sample, respectively, where b is the index of the control sample. and ; represents the number of combinations of selecting 2 from Q control samples.
[0025] The similarity variance of the qth and bth control samples in the i-th sub-band The calculation is based on the formula:
[0026] ;
[0027] Where, is the average similarity between the qth and bth control samples in the i-th sub-band, is the similarity of the a-th control sample in the i-th sub-band, a is the index of the control sample, .
[0028] Furthermore, the similarity between the textile to be tested and the reference sample in the same sub-band area is calculated, and combined with the weight coefficient, a judgment similarity is generated to determine the degree of similarity between the two. The formula for calculating the judgment similarity is:
[0029] ;
[0030] Where, is the similarity of the textiles to be tested, is the image similarity of the textile to be detected in the i-th sub-band area;
[0031] Set the corresponding similarity threshold and compare the judged similarity with the similarity threshold. The specific judgment logic is as follows:
[0032] when When the test result is 0, it is determined that the textile to be tested does not contain quaternary ammonium salt;
[0033] when When the detected textile contains quaternary ammonium salt, Fourier transform infrared spectrum is collected for analysis;
[0034] in is the similarity threshold.
[0035] Furthermore, the quaternary ammonium salt concentration prediction model is established based on a convolutional neural network, wherein the convolutional neural network is composed of an input layer, a convolutional layer, a pooling layer, a fully connected layer and an output layer, wherein the activation function in the convolutional layer is function, The specific expression of the function is:
[0036] ;
[0037] in, Indicates the The corresponding convolutional layers, It means the The corresponding convolutional layer The feature map eigenvalues;
[0038] For the fully connected layer, the number of neurons in the fully connected layer is set to 32, the initial neural network learning rate is set to 0.001, and the number of training rounds is 100;
[0039] The specific training steps of the quaternary ammonium salt concentration prediction model are as follows: collecting several Fourier transform infrared spectra with known quaternary ammonium salt concentrations, preprocessing the Fourier transform infrared spectra, inputting them into the quaternary ammonium salt concentration prediction model, and training the prediction model using the quaternary ammonium salt concentration corresponding to the spectral image as a label.
[0040] The present invention also provides a system for identifying a spectrum of a quaternary ammonium salt extract in a textile. The system is used to perform the above-mentioned method for identifying a spectrum of a quaternary ammonium salt extract in a textile, comprising:
[0041] an extraction method determination module, configured to obtain a plurality of textile samples of the same type as the textile to be tested, including a reference sample without quaternary ammonium salt and control samples containing quaternary ammonium salt at different concentrations, extract the quaternary ammonium salt from each textile to prepare a corresponding extract, and collect a Raman spectrum image of each extract;
[0042] An image feature characterization module is used to divide each Raman spectrum image into several sub-band regions according to the same division standard, extract the spectral image feature data of each sub-band region, calculate the similarity between each control sample and the reference sample in the same sub-band region, and determine the weight coefficient of each band region based on the similarity distribution;
[0043] The weight analysis characterization module is used to calculate the similarity between the textile to be tested and the reference sample in the same sub-band area, and combine the weight coefficient to generate a judgment similarity used to judge the degree of similarity between the two;
[0044] A primary classification judgment module is used to set a corresponding similarity threshold, compare the judged similarity with the similarity threshold, and if the judged similarity is less than the similarity threshold, it is judged that the textile to be tested does not contain quaternary ammonium salt; otherwise, the Fourier transform infrared spectrum of the extract to be tested is collected;
[0045] The quaternary ammonium salt concentration prediction module is used to pass the obtained Fourier transform infrared spectrum through a pre-trained quaternary ammonium salt concentration prediction model. The quaternary ammonium salt concentration prediction model outputs a corresponding quaternary ammonium salt concentration prediction value based on the input image to determine the quaternary ammonium salt concentration of the textile to be tested.
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] First, this method significantly improves the detection efficiency of quaternary ammonium salts. Traditional detection techniques typically require complex chemical reagents and lengthy experimental steps, but this method achieves rapid, non-destructive detection through Raman spectroscopy. Raman spectroscopy can quickly detect the presence of quaternary ammonium salts, and if present, the concentration is determined using Fourier transform infrared spectroscopy. Since Fourier transform infrared spectroscopy is relatively complex to obtain, a pre-step of Raman spectroscopy detection allows for primary classification, screening out samples that need further analysis, effectively saving computing resources. This high efficiency enables real-time monitoring during the production process, effectively avoiding product quality issues caused by excessive quaternary ammonium salts and providing timely feedback for textile production.
[0048] Secondly, the accuracy and reliability of the method have been significantly improved. By systematically analyzing quaternary ammonium salt samples of varying concentrations and extracting spectral signature data, a quantitative relationship between concentration and spectral signature can be effectively established. This data-based model not only improves measurement accuracy but also reduces errors caused by human manipulation, thereby enhancing the credibility of the test results. Furthermore, by setting similarity thresholds and weighting coefficients, interference from complex matrices can be avoided, ensuring good detection performance under various conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 Schematic diagram of the overall method flow of the present invention;
[0050] Figure 2 It is a point-line graph of characteristic peaks and adjacent spacing data in different bands of samples without quaternary ammonium salt;
[0051] Figure 3 The data point line graph of characteristic peak-to-peak values and corresponding wavelengths in different bands of samples without quaternary ammonium salt;
[0052] Figure 4 This is a bar graph comparing the width and spacing of characteristic peaks of samples without quaternary ammonium salts and samples containing quaternary ammonium salts;
[0053] Figure 5 This is a dot-line graph comparing the peak values and wavelengths of characteristic peaks of samples without quaternary ammonium salts and samples containing quaternary ammonium salts;
[0054] Figure 6 Calculate statistical graphs for weight coefficients of different sub-band regions;
[0055] Figure 7 This is a statistical chart of the prediction accuracy of the quaternary ammonium salt concentration prediction model;
[0056] Figure 8 Schematic diagram of the overall system structure of the present invention. DETAILED DESCRIPTION
[0057] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to specific embodiments.
[0058] It should be noted that, unless otherwise defined, the technical or scientific terms used in the present invention should have the usual meanings understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative position relationships. When the absolute position of the object being described changes, the relative position relationship may also change accordingly.
[0059] Example:
[0060] See also Figure 1-Figure 7 , the present invention provides a technical solution:
[0061] A method for identifying a spectrum of a quaternary ammonium salt extract in a textile, comprising the following steps:
[0062] Step 1: Obtain several textile samples of the same type as the textile to be tested, including a reference sample without quaternary ammonium salt and control samples containing different concentrations of quaternary ammonium salt. Extract the quaternary ammonium salt from each textile to prepare a corresponding extract, and collect Raman spectral images of each extract.
[0063] The specific logic for extracting the quaternary ammonium salt from each textile to produce the corresponding extract is as follows: determining extraction conditions, placing the collected textiles into an extraction solvent to extract the quaternary ammonium salt to produce the extract, wherein the determined extraction conditions include the extraction solvent composition and the extraction time, and the extract is produced according to the determined extraction conditions.
[0064] Here is a specific quaternary ammonium salt extraction pretreatment protocol: Quaternary ammonium salt extraction pretreatment protocol 1: Weigh 1g of sample to the nearest 0.001g. For a 1mL sample, add 70mL of 0.5% formic acid in methanol to a 100mL volumetric flask (pipette 5mL of formic acid into a 1000mL volumetric flask and bring to volume with methanol). Vortex for 1min to thoroughly mix the sample and extraction solvent. Ultrasonic extraction is performed for 20min. The volume is then brought to the mark with 0.5% formic acid in methanol. A portion of the sample is centrifuged at 8000r / min for 10min, filtered through a 0.22μm filter membrane, and the filtrate is used as the test sample. If the content of the component to be tested is high, dilute with 0.5% formic acid in methanol, filter through a 0.22μm filter membrane, and use the filtrate as the test sample.
[0065] Quaternary ammonium salt extraction pretreatment plan 2: Accurately weigh 0.2 g of sample, accurate to 0.0001 g, place it in a 25 mL stoppered colorimetric tube, add 10 mL of methanol, vortex and oscillate for 30 seconds to fully mix the sample and extraction solvent, perform ultrasonic extraction for 30 minutes, dilute to 25 mL with methanol, vortex and mix, remove the lower layer solution and filter it through a 0.22 μm filter membrane, and the filtrate is used as the test solution.
[0066] Quaternary ammonium salt extraction pretreatment protocol 3: Weigh 1.0 g (accurate to 0.001 g) of homogenized sample into a 50 mL centrifuge tube, add 18 mL of 90% methanol-water solution (containing 0.5% formic acid), vortex for 20 minutes, ultrasonically extract for 10 minutes, and centrifuge at 10,000 rpm for 10 minutes. Transfer the supernatant to a 50 mL centrifuge tube and adjust the volume to 20 mL with 90% methanol-water solution (containing 0.5% formic acid). After mixing, transfer 1 mL of the supernatant to a 15 mL centrifuge tube containing 100 mg of PSA evolving agent. Vortex for 1 minute, centrifuge at 10,000 rpm for 5 minutes, and directly inject the purified supernatant into the sample for analysis.
[0067] Quaternary Ammonium Salt Extraction Pretreatment Protocol 4: Accurately weigh 2.0 ± 0.05 g of sample into a 50 mL centrifuge tube, add 15 mL of acetonitrile solution, vortex for 1 minute, then homogenize for 3 minutes. Centrifuge at 9500 rpm for 5 minutes. Collect the supernatant into another clean centrifuge tube. Add 5 mL of acetonitrile to the residue and extract again. Combine the supernatants and add 3 mL of acetonitrile-saturated n-hexane solution. Vortex for 1 minute, let stand, and discard the upper n-hexane layer. Make up to 25 mL with acetonitrile, mix thoroughly, and prepare for purification. For solid or semi-solid samples with low moisture content, accurately weigh and mix with 3 mL of warm water before extraction.
[0068] Samples of different types of textiles, where the type specifically refers to the material and processing method of the textile. These textile materials include natural fibers, such as cotton: soft and breathable, commonly used in everyday clothing and home textiles. Linen: has good moisture absorption and breathability, suitable for summer clothing. Silk: smooth and high-gloss, often used in high-end clothing and accessories. Wool: good warmth retention, often used in winter clothing and woolen fabrics.
[0069] Synthetic Fibers: Polyester (polyester): abrasion-resistant and wrinkle-resistant, commonly used in sportswear and outdoor gear. Polyurethane (spandex / lycra): elastic and commonly used in tights and sportswear. Nylon: strong and abrasion-resistant, commonly used in outerwear and sports gear.
[0070] Processing methods include dyed fabrics, which come in a variety of colors. Printed fabrics: Fabrics with printed patterns, commonly used in fashion apparel and home decor. Functional treatments: Fabrics with anti-fouling and antibacterial treatments enhance the fabric's performance.
[0071] The specific steps for collecting Raman spectra of each sample extract include: using a Raman spectrometer to ensure proper functioning of the equipment. Checking parameters such as the laser wavelength, spectral range, and detector. Placing the extract into an appropriate sample cell (such as a quartz optical glass cell or microtiter plate) to ensure sample homogeneity.
[0072] Laser settings: Select the appropriate laser wavelength and the appropriate light source according to the characteristics of the sample. Quaternary ammonium salts usually contain elements such as nitrogen, carbon, and hydrogen, which have obvious characteristic peaks in the Raman spectrum. When using a shorter wavelength, such as a 532nm laser, it may be easier to obtain the signals of these characteristic peaks. Given the influence of water on Raman signals, the proportion of water in the extract needs to be considered when selecting the laser wavelength. If the sample contains a high concentration of water, it is recommended to use a 785nm laser to reduce water interference. If the concentration of quaternary ammonium salts in the extract is low, using a 532nm laser may enhance the signal and help better identify the characteristic peaks.
[0073] Set the laser power, exposure time, and integration time to optimize the signal-to-noise ratio. Adjust the spectrometer's spectral resolution to ensure the peaks of interest are resolved. Start the spectrometer to acquire data. Multiple scans are typically performed to improve signal stability. Record the Raman spectrum for each scan and save it in a suitable file format (e.g., CSV, TXT, etc.).
[0074] Step 2: Divide each Raman spectrum image into several sub-band regions according to the same division standard, extract the spectral image feature data of each sub-band region, calculate the similarity between each control sample and the reference sample in the same sub-band region, and determine the weight coefficient of each band region based on the similarity distribution.
[0075] Extracting spectral image feature data within the corresponding sub-band region and calculating the image similarity within the sub-band region, wherein the spectral image feature data within the corresponding sub-band region includes the width of the characteristic peak, the distance between adjacent characteristic peaks, the peak value of the characteristic peak and the corresponding wavelength, and the sub-band region contains at least one complete characteristic peak;
[0076] In a spectral image, first identify the sub-band region of interest. Typically, this can be done in the following ways: Manual selection: Manually select a wavelength range based on prior knowledge. Automatic selection: Automatically identify the region of interest using an algorithm, such as a preliminary analysis based on characteristic peaks. Feature data is extracted from the selected sub-band region and preprocessed, including smoothing: using methods such as moving average and Savitzky-Golay filtering to reduce the impact of noise on the results. Baseline correction: Removes baseline drift. Common baseline correction methods include polynomial fitting or least squares.
[0077] Peak detection can be performed by automatically identifying characteristic peaks in a spectrum using a peak detection algorithm (such as the find_peaks function in the SciPy library). The wavelength corresponding to each peak is then extracted. For each pair of adjacent peaks identified, the wavelength difference or wavenumber difference is calculated as the distance between the two peaks. The width of a characteristic peak refers to the width of the peak at the corresponding wavelength.
[0078] Extracting spectral image feature data within the corresponding sub-band region and calculating the image similarity within the sub-band region, wherein the spectral image feature data within the corresponding sub-band region includes the width of the characteristic peak, the distance between adjacent characteristic peaks, the peak value of the characteristic peak and the corresponding wavelength, and the sub-band region contains at least one complete characteristic peak;
[0079] The similarity of images in the sub-band area is calculated based on the following formula:
[0080] ;
[0081] Where, is the similarity between the reference sample and the qth control sample in the i-th sub-band area, is the peak similarity between the reference sample and the qth control sample in the i-th sub-band area, is the signal intensity of the qth control sample at the corresponding wavelength j in the i-th sub-band area, is the signal strength of the reference sample at the corresponding wavelength j in the i-th sub-band area, where i is the index of the sub-band area, , is the total number of sub-band regions, j is the wavelength value in the sub-band region, , is the starting wavelength in the sub-band area, is the cutoff wavelength in the sub-band region, where q is the index of the control sample, , Q is the total number of control samples.
[0082] It should be noted that the image similarity between the Raman spectrum of the textile extract containing quaternary ammonium salt in the ith sub-band region and the spectral image of the corresponding type of sample without quaternary ammonium salt in the ith sub-band region is The smaller it is, the smaller the difference between the spectral image and the sample without quaternary ammonium salt is. The larger the value is, the greater the difference is from the spectral image of the sample without quaternary ammonium salt, and the greater the probability that the textile contains quaternary ammonium salt.
[0083] The peak similarity of the i-th sub-band region The specific calculation formula is:
[0084] ;
[0085] Where, is the peak value of the pth characteristic peak of the qth control sample in the i-th sub-band area, is the peak value of the pth characteristic peak of the reference sample in the i-th sub-band area, is the average distance between adjacent characteristic peaks of the qth control sample in the i-th sub-band area, is the Raman spectrum of the reference sample, and in the ith sub-band, the average distance between adjacent characteristic peaks is: is the Raman spectrum of the qth concentration of the quaternary ammonium salt control sample. In the i-th sub-band area, the peak point of the p-th characteristic peak corresponds to the wavelength. For the Raman spectrum of the reference sample, in the ith sub-band region, the peak point of the pth characteristic peak corresponds to the wavelength, where p is the index of the characteristic peak in the sub-band region, , m is the number of characteristic peaks in the sub-band area.
[0086] It should be noted that the peak similarity between the reference sample and the qth control sample in the i-th sub-band area is Used to describe the difference in characteristic peaks within the i-th sub-band area, where The larger the value of , the greater the difference in characteristic peaks between the reference sample and the qth control sample in the i-th sub-band region.
[0087] The absolute difference of this part Reflects the difference in characteristic peak spacing between the qth sample and the reference sample. A change in spacing may mean that the position of the characteristic peak has changed, which may be related to changes in the composition or concentration of the sample. A large difference will lead to The increase indicates that the difference is large and the composition difference with the reference sample is large, indicating that the detection response to quaternary ammonium salts is more sensitive in this sub-band area.
[0088] Wavelength difference This reflects a change in the position of the characteristic peak, which may be due to a change in the chemical environment or physical state of the sample. If the wavelength of the characteristic peak changes significantly, it indicates that the physical and chemical properties of the sample have changed, indicating a large difference, and a large difference in composition from the reference sample, indicating that the detection response to quaternary ammonium salts is more sensitive in this sub-band area.
[0089] The change in the intensity of the characteristic peak reflects changes in the concentration of components or certain chemical environments in the sample. If the intensity of the characteristic peak of the control sample is significantly higher or lower than that of the reference sample, it means that the difference is large and the composition is different from the reference sample, indicating that the detection response to quaternary ammonium salts in this sub-band area is more sensitive.
[0090] The Raman spectrum of the qth concentration of the quaternary ammonium salt control sample and the peak value of the pth characteristic peak of the qth control sample in the i-th sub-band region are a set of corresponding data. The changes will affect The change, therefore, is multiplied by Indicates the corresponding connection relationship.
[0091] Based on the similarity distribution, the weight coefficient of each band area is determined; the specific formula for calculating the weight coefficient of each band area is:
[0092] ;
[0093] Where, is the weight coefficient of the ith sub-band, and the weight coefficient of each sub-band is obtained as follows: , is the similarity variance of the qth and bth control samples in the i-th sub-band, and are the concentrations of quaternary ammonium salts in the qth control sample and the bth control sample, respectively, where b is the index of the control sample. and . represents the number of combinations of selecting 2 from Q control samples.
[0094] It should be noted that through Indicates the total number of selected combinations. The variance of the similarity of two control samples in the ith sub-band under different concentration differences reflects the degree of similarity change of the two samples in the band, indicating the sensitivity of quaternary ammonium salt detection in the sub-band. It measures the degree of dispersion of the similarity distribution between the qth and bth samples in the i-th sub-band. A larger variance indicates that there are significant differences between samples, indicating that the band may have a higher value in distinguishing sample categories. When the variance increases, An increase in the value means that this sub-band is more important than other bands in distinguishing samples of different concentrations.
[0095] A larger concentration difference indicates that there are obvious differences in composition between samples, which may lead to significant differences in spectral characteristics. When the concentration difference is small, the larger the similarity variance, the more sensitive the sub-band is to the detection of quaternary ammonium salts.
[0096] The similarity variance of the qth and bth control samples in the i-th sub-band The calculation is based on the formula:
[0097] ;
[0098] Where, is the average similarity between the qth and bth control samples in the i-th sub-band, is the similarity of the a-th control sample in the i-th sub-band, a is the index of the control sample, Among them, Table 1 shows some statistical data on the weight coefficients of each band determined according to the sensitivity of different bands to quaternary ammonium salt detection.
[0099] Table 1: Band weight coefficient data calculation statistics
[0100]
[0101] As shown in Table 1, the peak similarity and similarity of the sub-band region show different characteristics in different regions, reflecting the distribution of similarity and weight coefficient of each sub-band. In the data table, the peak similarity ranges from 12 to 80, indicating that there are significant differences in the similarity between different sub-band regions. The highest peak similarity value is 80, which appears in the 14th sub-band region, indicating that this interval has a higher similarity with other regions in specific indicators. This may mean that this region shows more consistent characteristics under specific conditions and has stronger representativeness. The 14th sub-band region performs outstandingly in various indicators, with high peak similarity (80), similarity (82) and weight coefficient (0.1090), indicating its importance in the overall analysis. The weight coefficient ranges from 0.0187 to 0.1090, indicating that different sub-bands contribute to the overall characteristics to different degrees. The region with the highest weight coefficient is the 14th sub-band (0.1090), which means that this region occupies an important position in the overall analysis, reflecting its priority in research or application. The weight coefficients of other sub-bands are relatively low, especially the second sub-band (0.0187), indicating that they have little effect on the characteristics of quaternary ammonium salts.
[0102] Step 3: Calculate the similarity between the textile to be tested and the reference sample in the same sub-band area, and combine the weight coefficient to generate a judgment similarity used to judge the degree of similarity between the two.
[0103] Calculate the similarity between the textile to be tested and the reference sample in the same sub-band area, and combine the weight coefficient to generate the judgment similarity used to judge the degree of similarity between the two. The formula for calculating the judgment similarity is:
[0104] ;
[0105] Where, is the similarity of the textiles to be tested, is the image similarity of the textile to be detected in the i-th sub-band area;
[0106] Set the corresponding similarity threshold and compare the judged similarity with the similarity threshold. The specific judgment logic is as follows:
[0107] when When the test result is 0, it is determined that the textile to be tested does not contain quaternary ammonium salt;
[0108] when When the detected textile contains quaternary ammonium salt, Fourier transform infrared spectrum is collected for analysis;
[0109] in is the similarity threshold.
[0110] Since the similarity is calculated by combining the similarity of the images in each sub-band area with the weight coefficient of the corresponding sub-band area, the similarity of the textiles to be tested is The larger the value is, the greater the difference is from the spectrum image of the sample without quaternary ammonium salt. When determining whether the textile to be tested contains quaternary ammonium salts, Fourier transform infrared spectroscopy is collected for analysis. Fourier transform infrared spectroscopy is generally considered to be the most accurate method, especially in detecting specific functional groups and chemical structures. Fourier transform infrared spectroscopy can effectively identify and quantitatively analyze the characteristic absorption peaks of quaternary ammonium salts and is suitable for accurate measurement in a laboratory environment. It is convenient to obtain the concentration of quaternary ammonium salts. The similarity threshold It can be determined based on expert experience and the type of textile identified.
[0111] Step 4: Set a corresponding similarity threshold, and compare the judged similarity with the similarity threshold. If the judged similarity is less than the similarity threshold, it is determined that the textile to be tested does not contain quaternary ammonium salt. Otherwise, collect the Fourier transform infrared spectrum of the extract to be tested.
[0112] The similarity between the image in each sub-band area of the spectral image of the sample without quaternary ammonium salt is calculated, and the weight coefficient of the corresponding sub-band area is combined to calculate the judgment similarity. The formula for the judgment similarity calculation is:
[0113] ;
[0114] Where, Determine the similarity of the textiles to be tested;
[0115] Set the corresponding similarity threshold and compare the judged similarity with the similarity threshold. The specific judgment logic is as follows:
[0116] when When the test result is 0, it is determined that the textile to be tested does not contain quaternary ammonium salt;
[0117] when When the detected textile contains quaternary ammonium salt, Fourier transform infrared spectrum is collected for analysis;
[0118] in is the similarity threshold.
[0119] Since the similarity is calculated by combining the similarity of the images in each sub-band area with the weight coefficient of the corresponding sub-band area, the similarity of the textiles to be tested is The larger the value is, the greater the difference is from the spectrum image of the sample without quaternary ammonium salt. When determining whether the textile to be tested contains quaternary ammonium salts, Fourier transform infrared spectroscopy is collected for analysis. Fourier transform infrared spectroscopy is generally considered to be the most accurate method, especially in detecting specific functional groups and chemical structures. Fourier transform infrared spectroscopy can effectively identify and quantitatively analyze the characteristic absorption peaks of quaternary ammonium salts and is suitable for accurate measurement in a laboratory environment. It is convenient to obtain the concentration of quaternary ammonium salts. The similarity threshold It can be determined based on expert experience and the type of textile identified.
[0120] Step 5: The obtained Fourier transform infrared spectrum is passed through a pre-trained quaternary ammonium salt concentration prediction model. The quaternary ammonium salt concentration prediction model outputs a corresponding quaternary ammonium salt concentration prediction value based on the input image to determine the quaternary ammonium salt concentration of the textile to be tested.
[0121] The quaternary ammonium salt concentration prediction model is established based on a convolutional neural network, wherein the convolutional neural network consists of an input layer, a convolutional layer, a pooling layer, a fully connected layer and an output layer, wherein the activation function in the convolutional layer is function, The specific expression of the function is:
[0122] ;
[0123] in, Indicates the The corresponding convolutional layers, It means the The corresponding convolutional layer The feature map eigenvalues;
[0124] For the fully connected layer, the number of neurons in the fully connected layer is set to 32, the initial neural network learning rate is set to 0.001, and the number of training rounds is 100;
[0125] The training steps for the quaternary ammonium salt concentration prediction model are as follows: Fourier transform infrared spectra of known quaternary ammonium salt concentrations are collected, preprocessed, and then input into the quaternary ammonium salt concentration prediction model. The prediction model is trained using the quaternary ammonium salt concentration corresponding to the spectral image as a label. Table 2 shows the accuracy of the concentration prediction values output by the trained quaternary ammonium salt concentration prediction model.
[0126] Table 2: Statistics of output accuracy of quaternary ammonium salt concentration prediction model
[0127]
[0128] As shown in Table 2, the experimental and predicted values for quaternary ammonium salt concentrations exhibited some fluctuation and accuracy across samples. The highest prediction accuracy rates were achieved for the fifth sample (9.00 mg / L) and the fourth sample (1.80 mg / L), at 95.89% and 94.44%, respectively, demonstrating the model's relative stability when dealing with extreme or low concentrations. The discrepancies between the experimental and predicted values for quaternary ammonium salt concentrations reflect some volatility. For example, the difference between the experimental value (8.20 mg / L) and the predicted value (7.62 mg / L) for the second sample was 0.58 mg / L, while the difference for the ninth sample was 0.57 mg / L. These fluctuations were within a reasonable range, demonstrating the model's adaptability to varying concentrations. Overall, the agreement between the experimental and predicted values was good, with prediction accuracy exceeding 90% for the vast majority of samples. This demonstrates that the model effectively captures the changing characteristics of quaternary ammonium salt concentration.
[0129] See also Figure 8 The present invention also provides a system for identifying a spectrum of a quaternary ammonium salt extract in a textile. The system for identifying a spectrum of a quaternary ammonium salt extract in a textile is used to perform the above-mentioned method for identifying a spectrum of a quaternary ammonium salt extract in a textile, comprising:
[0130] an extraction method determination module, configured to obtain a plurality of textile samples of the same type as the textile to be tested, including a reference sample without quaternary ammonium salt and control samples containing quaternary ammonium salt at different concentrations, extract the quaternary ammonium salt from each textile to prepare a corresponding extract, and collect a Raman spectrum image of each extract;
[0131] An image feature characterization module is used to divide each Raman spectrum image into several sub-band regions according to the same division standard, extract the spectral image feature data of each sub-band region, calculate the similarity between each control sample and the reference sample in the same sub-band region, and determine the weight coefficient of each band region based on the similarity distribution;
[0132] The weight analysis characterization module is used to calculate the similarity between the textile to be tested and the reference sample in the same sub-band area, and combine the weight coefficient to generate a judgment similarity used to judge the degree of similarity between the two;
[0133] A primary classification judgment module is used to set a corresponding similarity threshold, compare the judged similarity with the similarity threshold, and if the judged similarity is less than the similarity threshold, it is judged that the textile to be tested does not contain quaternary ammonium salt; otherwise, the Fourier transform infrared spectrum of the extract to be tested is collected;
[0134] The quaternary ammonium salt concentration prediction module is used to pass the obtained Fourier transform infrared spectrum through a pre-trained quaternary ammonium salt concentration prediction model. The quaternary ammonium salt concentration prediction model outputs a corresponding quaternary ammonium salt concentration prediction value based on the input image to determine the quaternary ammonium salt concentration of the textile to be tested.
[0135] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters in the formulas are set by technicians in this field according to actual conditions.
[0136] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software depends on the specific application and design constraints of the technical solution.
[0137] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, and may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment as needed.
[0138] The above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.
Claims
1. A method for identifying spectra of quaternary ammonium salt extracts in textiles, characterized in that: The specific steps include: Obtaining several textile samples of the same type as the textile to be tested, including a reference sample without quaternary ammonium salt and control samples containing different concentrations of quaternary ammonium salt, extracting the quaternary ammonium salt from each textile to prepare a corresponding extract, and collecting a Raman spectrum image of each extract; Each Raman spectrum image is divided into several sub-band regions according to the same division standard, and the spectral image feature data of each sub-band region is extracted. The similarity between each control sample and the reference sample in the same sub-band region is calculated, and the weight coefficient of each band region is determined based on the similarity distribution; Calculate the similarity between the textile to be tested and the reference sample in the same sub-band area, and combine the weight coefficient to generate a judgment similarity used to judge the degree of similarity between the two; A corresponding similarity threshold is set, and the judged similarity is compared with the similarity threshold. If the judged similarity is less than the similarity threshold, it is determined that the textile to be tested does not contain quaternary ammonium salt. Otherwise, a Fourier transform infrared spectrum of the extract to be tested is collected. The obtained Fourier transform infrared spectrum is passed through a pre-trained quaternary ammonium salt concentration prediction model, which outputs a corresponding quaternary ammonium salt concentration prediction value based on the input image to determine the quaternary ammonium salt concentration of the textile to be tested; The spectral image characteristic data in the corresponding sub-band area includes the width of the characteristic peak, the distance between adjacent characteristic peaks, the peak value of the characteristic peak and the corresponding wavelength, and the sub-band area contains at least one complete characteristic peak; The similarity of images in the sub-band area is calculated based on the following formula: , Where, is the similarity between the reference sample and the qth control sample in the i-th sub-band area, is the peak similarity between the reference sample and the qth control sample in the i-th sub-band area, is the signal intensity of the qth control sample at the corresponding wavelength j in the i-th sub-band area, is the signal strength of the reference sample at the corresponding wavelength j in the i-th sub-band area, where i is the index of the sub-band area, , is the total number of sub-band regions, j is the wavelength value in the sub-band region, , is the starting wavelength in the sub-band area, is the cutoff wavelength in the sub-band region, where q is the index of the control sample, , Q is the total number of control samples; The peak similarity of the i-th sub-band region The specific calculation formula is: , Where, is the peak value of the pth characteristic peak of the qth control sample in the i-th sub-band area, is the peak value of the pth characteristic peak of the reference sample in the i-th sub-band area, is the average distance between adjacent characteristic peaks of the qth control sample in the i-th sub-band area, is the Raman spectrum of the reference sample, and in the ith sub-band, the average distance between adjacent characteristic peaks is: is the Raman spectrum of the qth concentration of the quaternary ammonium salt control sample. In the i-th sub-band area, the peak point of the p-th characteristic peak corresponds to the wavelength. is the Raman spectrum of the reference sample. In the ith sub-band region, the peak point of the pth characteristic peak corresponds to the wavelength, where p is the index of the characteristic peak in the sub-band region. , m is the number of characteristic peaks in the sub-band area; The specific formula for calculating the weight coefficient of each band area is: , Where, is the weight coefficient of the ith sub-band, and the weight coefficient of each sub-band is obtained as follows: , is the similarity variance of the qth and bth control samples in the i-th sub-band, and are the concentration values of quaternary ammonium salt in the qth control sample and the bth control sample, respectively, where b is the index of the control sample, and ; represents the number of combinations of selecting 2 from Q control samples; The similarity variance of the qth and bth control samples in the i-th sub-band The calculation is based on the formula: , Where, is the average similarity between the qth and bth control samples in the i-th sub-band, is the similarity of the a-th control sample in the i-th sub-band, a is the index of the control sample, ; Calculate the similarity between the textile to be tested and the reference sample in the same sub-band area, and combine the weight coefficient to generate the judgment similarity used to judge the degree of similarity between the two. The formula for calculating the judgment similarity is: , Where, is the similarity of the textiles to be tested, is the image similarity of the textile to be detected in the i-th sub-band area; Set the corresponding similarity threshold and compare the judged similarity with the similarity threshold. The specific judgment logic is as follows: when When the test result is 0, it is determined that the textile to be tested does not contain quaternary ammonium salt; when When the detected textile contains quaternary ammonium salt, Fourier transform infrared spectrum is collected for analysis; in is the similarity threshold.
2. The method for identifying a spectrum of a quaternary ammonium salt extract in a textile according to claim 1, wherein: The specific logic for extracting the quaternary ammonium salt from each textile to produce the corresponding extract is as follows: determining extraction conditions, placing the collected textiles into an extraction solvent to extract the quaternary ammonium salt to produce the extract, wherein the determined extraction conditions include the extraction solvent composition and the extraction time, and the extract is produced according to the determined extraction conditions.
3. The method for identifying a spectrum of a quaternary ammonium salt extract in a textile according to claim 1, wherein: The quaternary ammonium salt concentration prediction model is established based on a convolutional neural network, wherein the convolutional neural network consists of an input layer, a convolutional layer, a pooling layer, a fully connected layer and an output layer, wherein the activation function in the convolutional layer is function, The specific expression of the function is: , in, Indicates the The corresponding convolutional layers, It means the The corresponding convolutional layer The feature map eigenvalues; For the fully connected layer, the number of neurons in the fully connected layer is set to 32, the initial neural network learning rate is set to 0.001, and the number of training rounds is 100; The specific training steps of the quaternary ammonium salt concentration prediction model are as follows: collecting several Fourier transform infrared spectra with known quaternary ammonium salt concentrations, preprocessing the Fourier transform infrared spectra, inputting them into the quaternary ammonium salt concentration prediction model, and training the prediction model using the quaternary ammonium salt concentration corresponding to the spectral image as a label.
4. A spectrum recognition system for quaternary ammonium salt extracts in textiles, characterized by: The system for identifying a spectrum of a quaternary ammonium salt extract in a textile is used to perform the method for identifying a spectrum of a quaternary ammonium salt extract in a textile according to any one of claims 1 to 3, comprising: an extraction method determination module, configured to obtain a plurality of textile samples of the same type as the textile to be tested, including a reference sample without quaternary ammonium salt and control samples containing quaternary ammonium salt at different concentrations, extract the quaternary ammonium salt from each textile to prepare a corresponding extract, and collect a Raman spectrum image of each extract; An image feature characterization module is used to divide each Raman spectrum image into several sub-band regions according to the same division standard, extract the spectral image feature data of each sub-band region, calculate the similarity between each control sample and the reference sample in the same sub-band region, and determine the weight coefficient of each band region based on the similarity distribution; The weight analysis characterization module is used to calculate the similarity between the textile to be tested and the reference sample in the same sub-band area, and combine the weight coefficient to generate a judgment similarity used to judge the degree of similarity between the two; A primary classification judgment module is used to set a corresponding similarity threshold, compare the judged similarity with the similarity threshold, and if the judged similarity is less than the similarity threshold, it is judged that the textile to be tested does not contain quaternary ammonium salt; otherwise, the Fourier transform infrared spectrum of the extract to be tested is collected; The quaternary ammonium salt concentration prediction module is used to pass the obtained Fourier transform infrared spectrum through a pre-trained quaternary ammonium salt concentration prediction model. The quaternary ammonium salt concentration prediction model outputs a corresponding quaternary ammonium salt concentration prediction value based on the input image to determine the quaternary ammonium salt concentration of the textile to be tested.
Citation Information
Patent Citations
Infrared spectrogram identification method and device based on similarity matching
CN116257776A
Tunnel multi-component high-risk harmful gas detection system and method based on spectrum technology
CN118518614A
Determination and early warning method and system for mercury content in food raw materials and storage medium
CN119880872A
