A method for quantitative analysis of nitride concentration based on relative position matrix method and Raman spectrum

By using the relative position matrix method and a multimodal fusion neural network model, one-dimensional Raman spectra are converted into two-dimensional images, solving the problem of extracting overlapping peaks and weak peaks in the Raman spectra of mixtures, and realizing high-precision quantitative analysis of nitrate and nitrite concentrations in water.

CN120064237BActive Publication Date: 2025-11-28CHONGQING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510144736.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2025-11-28
Estimated Expiration
2045-02-10

AI Technical Summary

Technical Problem

Existing technologies are difficult to effectively extract the characteristics of overlapping peaks and weak peaks in the Raman spectra of mixtures, and the versatility and efficiency of two-dimensional conversion methods are limited, making it difficult to quantitatively detect nitrogen compounds in water.

Method used

The relative position matrix method is used to convert one-dimensional Raman spectra into two-dimensional images. Combined with a multimodal fusion neural network model, one-dimensional and two-dimensional features are extracted to achieve simultaneous quantitative analysis of nitrate and nitrite concentrations.

Benefits of technology

It improves the feature extraction capability and model versatility of Raman spectra of mixtures, and realizes high-precision quantitative analysis of nitrate and nitrite concentrations in water, thereby improving the accuracy and reliability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120064237B_ABST
    Figure CN120064237B_ABST
Patent Text Reader

Abstract

The application relates to a nitride concentration quantitative analysis method based on a relative position matrix method and Raman spectrum, and belongs to the field of Raman spectrum quantitative analysis. The method comprises the following steps: collecting Raman spectrum data of a sample through a Raman spectrometer, and establishing a Raman spectrum data set; performing smoothing and baseline deduction on the Raman spectrum data set, performing data enhancement and data normalization on the data set; performing two-dimensional conversion on the pretreated data set by using a relative position matrix method; training a multi-modal fusion neural network model based on original one-dimensional spectrum data and converted two-dimensional image data; and realizing quantitative detection of nitrate and nitrite concentrations in water by using the trained model. The application combines Raman spectrum and the relative position matrix method, realizes quantitative detection of the nitride concentration in a water sample, and provides technical support for large-scale application of Raman spectrum in actual water sample detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of Raman spectrum quantitative analysis, and relates to a nitride concentration quantitative analysis method based on a relative position matrix method and Raman spectrum. BACKGROUND

[0002] Nitrate and nitrite are common pollutants in surface water and groundwater. High concentration of nitrate can lead to water eutrophication, promote the rapid reproduction of plankton, consume dissolved oxygen in water, and destroy water quality. Long-term absorption of nitrite in the human body can increase the amount of methemoglobin in the blood, which has a risk of carcinogenesis. Therefore, it is of great significance to accurately monitor the concentration of nitrate and nitrite in water. Nitrate and nitrite exist simultaneously in water nitrogen, and it is difficult to detect them simultaneously using traditional detection methods. Raman spectrum can simultaneously detect the characteristic peaks of multiple substances, and has a natural advantage in detecting nitrogen compounds. As a kind of inelastic scattering spectrum, Raman spectrum can provide fingerprint information of sample structure, and has the advantages of non-destructive, rapid, high sensitivity, no need for sample pretreatment, etc. Therefore, it is widely used in disease diagnosis, substance identification, drug detection and other fields. However, in practical application, the intensity of Raman scattering signal is weak. Although multiple substances can be detected simultaneously, the interference of overlapping peaks and background in the mixture makes it difficult to realize the quantitative detection of substances directly through Raman signal.

[0003] Traditional machine learning algorithms cannot meet the high precision requirement of quantitative analysis of mixture Raman spectrum. Therefore, it is necessary to combine deep learning method to realize the quantitative detection of nitrogen compounds in water. In recent years, deep learning technology has made the most advanced achievements in many fields, including natural language processing, image recognition, speech recognition, signal analysis, etc. Deep learning has stronger model representation ability than machine learning, and has more advantages in the quantitative analysis task of Raman spectrum. However, the composition of actual water sample is complex, and the feature extraction ability of one-dimensional Raman spectrum based deep learning method is limited, which makes it difficult to extract the features of overlapping peaks and weak peaks in mixture Raman spectrum, hindering the quantitative detection of nitrogen compounds in actual water sample.

[0004] The deep learning method based on two-dimensional image can fully extract the features of overlapping peaks and weak peaks in mixture Raman spectrum, but the existing wavelet coefficient method needs to select the matching wavelet basis according to the spectrum, which limits its universality. Half of the information in the image generated by the Gram angle field is repeated, which limits the utilization rate of the image. Therefore, using a more universal and efficient Raman spectrum analysis scheme can effectively promote the large-scale application of Raman spectrum in actual water sample detection. SUMMARY

[0005] Therefore, the present application aims to provide a nitride concentration quantitative analysis method based on a relative position matrix method and Raman spectrum, so as to overcome the problems that it is difficult to extract overlapping peak and weak peak characteristics in the Raman spectrum of a mixture in the prior art, and the universality and efficiency of the existing two-dimensional conversion method are limited, and realize two-dimensional conversion of the Raman spectrum by using the relative position matrix method, and simultaneous quantitative analysis of nitrate and nitrite concentrations in water by using a multi-modal fusion neural network model.

[0006] To achieve the above-mentioned purpose, the present application provides the following technical solutions:

[0007] A nitride concentration quantitative analysis method based on a relative position matrix method and Raman spectrum, the method comprising:

[0008] Step one, collecting Raman spectrum data of a mixed solution of potassium nitrate and sodium nitrite by an optical experiment platform, and establishing a Raman spectrum data set;

[0009] Step two, performing curve smoothing and baseline correction on the collected Raman spectrum data set, and performing data enhancement on the data set to expand the sample quantity and sample diversity of the data set;

[0010] Step three, applying the relative position matrix method to the preprocessed Raman spectrum data set to convert one-dimensional Raman spectrum into two-dimensional image data;

[0011] Step four, training a multi-modal fusion neural network model based on one-dimensional Raman spectrum and two-dimensional image data to extract features of different dimensions;

[0012] Step five, inputting the Raman spectrum of a water sample to be tested into the trained multi-modal fusion model to simultaneously obtain the concentrations of nitrate and nitrite in the water sample.

[0013] Further, in step one, the concentration categories of the prepared potassium nitrate and sodium nitrite solution are not less than 9, and the number of spectra in the data set is not less than 1000;

[0014] Further, in step two, the airPLS algorithm is used to subtract the baseline of the Raman spectrum, and the data is enhanced in the way that the Raman peak shift and background noise occurring in the simulation spectrum acquisition process are used, in which algorithm, first, the original Raman spectrum is subjected to random horizontal displacement in the range of [-10cm -1 , 10cm -1 ] wave number, and then a new spectrum is generated by superimposing Gaussian white noise with a mean value of 0 and a variance of 10 -5 .

[0015] Further, in the third step, the Raman spectrum with a size of 1024*1 is cropped to 200*1, and the cropped spectrum is subjected to dimension conversion using the relative position matrix method, and the size of the converted image is 200*200, and there are a total of 40000 pixel points.

[0016] Further, in the fourth step, the multi-modal fusion neural network model comprises three parts, the first two parts extract one-dimensional and two-dimensional features respectively, and the third part is used for feature fusion.

[0017] The VGG module of the first part is used for extracting two-dimensional image features, and VGG16 is used as a basic network architecture, wherein the size of the input layer is 200*200, the size of the convolution kernel is 3*3, the size of the pooling kernel is 2*2, the activation function is LeakyReLU, there are two fully connected layers with 64 neurons, and there is a Dropout layer with a discard ratio of 0.2;

[0018] The LSTM module of the second part is used for extracting one-dimensional spectral features, and the structure comprises an input layer with a size of 200*1, an LSTM layer with 64 neurons, two fully connected layers with 64 neurons, and a Dropout layer with a discard ratio of 0.2;

[0019] The feature fusion module of the third part is used for fusing one-dimensional and two-dimensional features, and the structure comprises a one-dimensional fusion layer, a two-dimensional fusion layer, and a feature fusion layer.

[0020] The loss function of the model training is MSE, and the calculation formula is:

[0021]

[0022] In the formula, N is the total number of samples, and represent the predicted result and the true result respectively.

[0023] Further, in the fifth step, the test set is input into the trained model for quantitative analysis of the concentration of nitrate and nitrite, and the model performance is compared with the model without using the relative position matrix method.

[0024] The present application has the following advantages:

[0025] The application provides a mixture Raman spectrum quantitative analysis method based on a relative position matrix method, a one-dimensional Raman spectrum is converted into a two-dimensional image by using the relative position matrix method, characteristics of overlapping peaks and weak peaks in the mixture Raman spectrum can be fully mined, and the method has stronger universality and high image resource utilization rate, one-dimensional features and two-dimensional features are extracted simultaneously through a multi-modal fusion model, and finally, simultaneous quantitative analysis of concentrations of nitrate and nitrite in water is realized.

[0026] Additional advantages, objects, and features of the application will be set forth in part by the description that follows, and in part will become apparent to those skilled in the art upon examination of the following specification or can be learned by practice of the application. The objects and other advantages of the application can be realized and attained by the methods and techniques particularly pointed out in the specification. BRIEF DESCRIPTION OF DRAWINGS

[0027] In order to make the objects, technical solutions and advantages of the present application clearer, the preferred embodiments of the present application will be described in detail below with reference to the drawings, in which:

[0028] Fig. 1 The overall flowchart of the present application.

[0029] Fig. 2 The schematic diagram of the average Raman spectrum of the data set.

[0030] Fig. 3 The schematic diagram of the data enhancement step.

[0031] Fig. 4 The structure schematic diagram of the multi-modal fusion model.

[0032] Fig. 5 The two-dimensional image of the one-dimensional Raman spectrum converted by the relative position matrix in the embodiment of the present application. DETAILED DESCRIPTION

[0033] The embodiments of the present application are described below through specific and concrete examples, and those skilled in the art can easily understand other advantages and effects of the present application from the disclosure of the specification. The present application can also be implemented or applied through other different specific embodiments, and each detail in the specification can be modified or changed based on different views and applications without departing from the spirit of the present application. It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present application in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0034] Among them, the drawings are only used for illustrative description, and the representation is only a schematic diagram, not a physical diagram, and cannot be understood as a limitation on the present application; in order to better illustrate the embodiments of the present application, some components of the drawings will be omitted, enlarged or reduced, and do not represent the size of the actual product; for those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings can be omitted.

[0035] The same or similar reference numerals in the drawings of the embodiments of the present application correspond to the same or similar components; in the description of the present application, it should be understood that if the terms "upper", "lower", "left", "right", "front", "back" and the like indicate the orientation or positional relationship shown in the drawings, only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, therefore the positional relationship described in the drawings is only used for illustrative description, and cannot be understood as a limitation on the present application, for those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.

[0036] As shown in Figs. 1-5 , a nitride Raman spectrum quantitative analysis method based on relative position matrix method, comprising the following steps:

[0037] Step 1: Collecting Raman spectrum data of potassium nitrate and sodium nitrite mixed solution by optical experiment platform, and establishing Raman spectrum data set.

[0038] The experimental reagents used are potassium nitrate standard solution (KNO3, 1000 mg / L) and sodium nitrite solid (NaNO2 powder). The dilution of the solution uses ultrapure water with a resistivity of 18.2 Megaohm. By configuration, 9 groups of mixed solution samples with different concentrations are obtained, and the concentrations of potassium nitrate and sodium nitrite are 100mg / L:100mg / L, 100mg / L:10mg / L, 70mg / L:70mg / L, 50mg / L:50mg / L, 30mg / L:30mg / L, 10mg / L:10mg / L, 10mg / L:1mg / L, 1mg / L:1mg / L, 1mg / L:0.1mg / L. The Raman spectrometer with a power of 10mw and a wavelength of 632.8nm and an integral time of 6s is used to collect the Raman spectrum data of the samples, each group of concentration contains 140 spectrum data, and a total of 1260 data Raman spectrum data set is established.

[0039] Step 2, baseline correction and normalization are performed on the collected Raman spectrum data set, and data enhancement is performed on the data set to expand the sample number and sample diversity of the data set;

[0040] Due to the interference of fluorescence background in actual detection of Raman spectrum and the background noise of the instrument itself, the subsequent data analysis process will be disturbed, so it is necessary to correct the baseline of the original Raman spectrum. The airPLS algorithm commonly used in Raman spectrum pretreatment is used as the baseline correction algorithm in the application, which can balance the accuracy of the original data and the roughness of the fitting data, and adaptively calculate the weight in each iteration, thereby efficiently estimating and deducting the baseline.

[0041] In order to reduce the time cost of Raman spectrum acquisition, the Raman spectrum data set after deducting the baseline is data enhanced, and the sample quantity and diversity are expanded. The specific steps are as follows:

[0042] 1. Classify the Raman spectrum data set, then expand each class one by one.

[0043] 2. Select a sample in a certain class, then randomly select another sample in the same class.

[0044] 3. Perform Raman peak shift simulation: apply a horizontal displacement of ±10cm -1 to the sample .

[0045] 4. Perform linear combination: randomly generate a scaling factor in the range of [0, 1]. Linearly weight and superimpose the sample and the sample with the sample and the sample as weights to generate a new sample , the specific formula is as follows:

[0046]

[0047] 5. Perform background noise simulation: superimpose Gaussian white noise with mean 0 and variance 10 -5 on the sample to obtain new data.

[0048] The number of spectra in each concentration group is expanded from 140 to 200 after data enhancement, and the total number of spectra in the data set is expanded from 1260 to 1800.

[0049] Finally, the intensity range of the Raman spectrum is scaled to the interval [0, 1] using the maximum and minimum value normalization to eliminate the influence of the order of magnitude on the subsequent model training, and the formula for normalization is:

[0050]

[0051] where and These represent the minimum and maximum intensity values ​​in the original spectrum, respectively. Represents the original spectral intensity. The value is the normalized Raman spectral intensity.

[0052] Step 3: Apply the relative position matrix method to the preprocessed Raman spectrum dataset to perform dimensionality transformation, converting the one-dimensional Raman spectrum into two-dimensional image data.

[0053] Since the original Raman spectrum has 1024 data points, corresponding to a wavenumber range of 0-3755 cm⁻¹, -1 The characteristic peaks of potassium nitrate and sodium nitrite, which need to be detected, are located at 1050 cm⁻¹. -1 and 1330cm -1 The original Raman spectrum contains a large number of wavenumber ranges unrelated to the detected object. Therefore, the original Raman spectrum is cropped to a certain extent, retaining 200 data points with a wavenumber range of 732-1455 cm⁻¹. -1 .

[0054] The one-dimensional spectrum after range clipping is transformed into a two-dimensional matrix using the relative position matrix method. By calculating the intensity difference between each wavelength and other wavelengths in the spectrum, a two-dimensional matrix containing relative information between different wavelengths can be obtained. This transforms a spectrum of length n into a matrix of size n. The matrix, This represents the intensity corresponding to each wavelength in the spectrum. The transformation equation is as follows:

[0055]

[0056] In this embodiment, the converted 2D images are used as the training dataset for the neural network model. The dataset is randomly divided, with 360 samples randomly selected from a total of 1800 samples as the test set. During model training, a 5-fold cross-validation method is used. The remaining 1440 samples are randomly divided into 5 groups, each containing 288 spectral data points. One group is selected as the validation set, and the other 4 groups are used as the training set for model training. This process is repeated 5 times to ensure that all 5 groups of data have been used in the validation set. Finally, the average result of the 5 training iterations is used as the final result of the model. This step effectively avoids random errors caused by dataset distribution and enhances the reliability of model performance analysis.

[0057] Step four: Based on one-dimensional Raman spectroscopy and two-dimensional image data, train a multimodal fusion neural network model to extract features from different dimensions. The specific steps are as follows:

[0058] The two-dimensional feature extraction module of the multi-modal fusion model adopts a VGG network as the backbone, the input layer size is 200x200, which is consistent with the size of the two-dimensional image generated in step three, the convolution kernel size is 3x3, the pooling kernel size is 2x2, the activation function is LeakyReLU, and there are a total of 16 convolution layers and 5 pooling layers. After the two-dimensional image is processed by the last pooling layer in the VGG module, a feature map with a size of 6x6x512 will be obtained, and then a one-dimensional feature map with a size of 18432x1 will be obtained after flattening , and finally a prediction result will be obtained after passing through two fully connected layers with 64 neurons and a Dropout layer with a discard ratio of 0.2 for subsequent feature splicing.

[0059] The one-dimensional feature extraction module adopts an LSTM network as the backbone, the input layer size is 200x1, and a one-dimensional feature map with a size of 64x1 will be obtained after passing through an LSTM layer with 64 neurons , and finally a prediction result will be obtained after passing through two fully connected layers with 64 neurons and a Dropout layer with a discard ratio of 0.2

[0060] The feature fusion module adopts a hybrid fusion form, first splicing the feature maps of the last layer of the first two modules and the prediction results of their respective fully connected layers to obtain and , then splicing and to obtain the final fusion feature . Finally, inputting the fusion feature into two fully connected layers with 1 neuron each to obtain the concentration prediction results of nitrate and nitrite by the multi-modal fusion model.

[0061] The activation function of the last fully connected layer of the multi-modal fusion model is Sigmoid, and the calculation formula is:

[0062]

[0063] This function can map the output of the model to the interval of 0 to 1, which is the same as the interval after the maximum and minimum normalization in data preprocessing, which is convenient for subsequent reverse normalization of the output results of the model to obtain specific material concentration data.

[0064] The loss function used in the model training process is MSE, and the calculation formula is:

[0065]

[0066] wherein R represents the total number of samples, and respectively represent the predicted result and the true result of the sample by the model, the model finds the optimal parameter weight by reducing the error between the predicted result and the true result in the training process, and improves the model precision.

[0067] Step five, input the Raman spectrum of the water sample to be tested into the trained multi-modal fusion model, and obtain the concentration of nitrate and nitrite in the water sample. In this embodiment, the coefficient of determination R 2 is also selected as the evaluation index of the model, and the calculation formula is:

[0068]

[0069] In the formula, and respectively represent the predicted result and the true result, R represents the total number of samples, and respectively represent the average value of the predicted result and the true result, and R 2 is closer to 1, which represents that the fitting degree and the prediction performance of the model are better.

[0070] Table 1

[0071]

[0072] Table 1 is the concentration prediction result of potassium nitrate and sodium nitrite by different methods. As shown in Table 1, in this embodiment, the multi-modal fusion model (Multi Modal Fusion, MMF) combined with the relative position matrix (Relative Position Matrix, RPM) has the MSE and R 2 of 0.0078 and 0.9476 for the concentration prediction result of nitrate on the validation set, the MSE and R 2 of 0.0028 and 0.9753 for the concentration prediction result of nitrite, and the average MSE and R 2 of 0.0053 and 0.9615. Among them, the R 2 of MMF-RPM is improved by 0.0328 and 0.0336 compared with CNN-1D and VGG-1D using one-dimensional Raman spectrum. And the R 2 of CNN-RPM using the relative position matrix method is also improved by 0.0139 compared with CNN-1D, which proves the effectiveness of the present application.

[0073] The application initiates a mixture Raman spectrum quantitative analysis method based on a relative position matrix method, namely, one-dimensional Raman spectrum is converted into a two-dimensional image, and characteristics of overlapping peaks and weak peaks in the mixture Raman spectrum are fully mined; a multi-modal fusion neural network model is established, and one-dimensional Raman spectrum characteristics and two-dimensional image characteristics are extracted, compared with a single model, more comprehensive characteristics can be provided, and differences of single modes are made up; quantitative analysis of nitrate and nitrite in water can be effectively realized, and the method is expected to provide method support for large-scale application of Raman spectrum in actual detection.

[0074] Finally, it should be pointed out that the above embodiments are only used to illustrate the technical solutions of the present application but not limit the present application, although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the purpose and scope of the technical solutions, and all should be covered in the scope of claims of the present application.

Claims

1. A method for quantitative analysis of nitride concentration based on relative position matrix method and Raman spectroscopy, characterized by: The method comprises: Step one, collecting Raman spectrum data of a mixed solution of potassium nitrate and sodium nitrite through an optical experiment platform, and establishing a Raman spectrum data set; Step two, performing curve smoothing and baseline correction on the collected Raman spectrum data set, and performing data enhancement on the data set to expand the sample quantity and sample diversity of the data set; Step three, applying a relative position matrix method to the preprocessed Raman spectrum data set to convert one-dimensional Raman spectrum into two-dimensional image data; Step four, training a multi-modal fusion neural network model based on one-dimensional Raman spectrum and two-dimensional image data to extract features of different dimensions; Step five, inputting the Raman spectrum of the water sample to be tested into the trained multi-modal fusion model to obtain the concentrations of nitrate and nitrite in the water sample; In step three, the Raman spectrum with a size of 1024x1 is cropped to 200x1, and the cropped spectrum is subjected to dimension conversion using the relative position matrix method, and the converted image size is 200x200, with a total of 40000 pixel points; In step four, the multi-modal fusion neural network model comprises three parts, the first two parts extract one-dimensional and two-dimensional features respectively, and the third part is used for feature fusion; The VGG module of the first part is used for extracting two-dimensional image features, and VGG16 is used as the basic network architecture, wherein the input layer size is 200x200, the convolution kernel size is 3x3, the pooling kernel size is 2x2, the activation function is LeakyReLU, there are two fully connected layers with 64 neurons, and there is a Dropout layer with a discard ratio of 0.2; The LSTM module of the second part is used for extracting one-dimensional spectrum features, and the structure thereof comprises an input layer with a size of 200x1, an LSTM layer with 64 neurons, two fully connected layers with 64 neurons, and a Dropout layer with a discard ratio of 0.2; The feature fusion module of the third part is used for fusing one-dimensional and two-dimensional features, and the structure thereof comprises a one-dimensional fusion layer for splicing the features extracted by the LSTM layer in the second part and the results obtained by the fully connected layer thereof; a two-dimensional fusion layer for splicing the features extracted by the last convolution layer of the VGG module in the second part and the results obtained by the fully connected layer thereof; and a feature fusion layer for splicing the results obtained by the one-dimensional fusion layer and the two-dimensional fusion layer; The loss function of model training is MSE, and the calculation formula is: where N is the total number of samples, and represent the predicted and true results, respectively.

2. The method according to claim 1, wherein: In step one, the concentration categories of the prepared potassium nitrate and sodium nitrite solution are not less than 9, and the number of spectra in the data set is not less than 1000.

3. The method according to claim 1, wherein: In the second step, the baseline of the Raman spectrum is deducted using the airPLS algorithm, and the data is enhanced by simulating the Raman peak shift and background noise that occurs in the spectrum acquisition process. In this algorithm, first, the original Raman spectrum is randomly horizontally shifted in the range of [-10cm -1 , 10cm -1 ] wave number, and then a new spectrum is generated by superimposing a Gaussian white noise with a mean of 0 and a variance of 10 -5 .

4. The method according to claim 1, wherein: In the fifth step, the test set is input into the trained model for quantitative analysis of the concentrations of nitrate and nitrite, and the model performance is compared with the model without using the relative position matrix method.

Citation Information

Patent Citations

  • Method for rapidly authenticating real or adulterated white wine through Raman spectrum-principal component analysis

    CN108896527A

  • Quantitative detection method for nitrate radicals in water based on Raman spectrum

    CN114965429A