Gas mixed spectrum analysis method combining SSA-FastICA algorithm and EMD-KPCA-LSTM model
Patent Information
- Application Number
- CN202411128015.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-03
Smart Images

Figure CN119069028A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of gas mixture spectrum analysis, and in particular to a gas mixture spectrum analysis method combining an SSA-FastICA algorithm and an EMD-KPCA-LSTM model. Background Art
[0002] Nowadays, laser spectroscopy technology has been widely used in the field of measuring gas concentration. It has the characteristics of high sensitivity and high resolution. Based on this principle, the concentration of a single gas in a mixed gas can be detected. However, under the influence of factors such as ambient temperature, pressure, instrument noise, and stability of the light source, the absorption of photons by gas components does not produce discrete spectral lines, but rather appears as absorption peaks in the form of Lorentz line type, Gaussian line type, Voigt line type, etc. When there are many types of gases in the mixed gas and the physical and chemical properties of the components to be detected are very similar, the spectral signal will be mixed with a large number of spectral peaks with similar structures and overlapping with each other. In this case, it is difficult to achieve qualitative or quantitative detection of the components of the mixed gas. Summary of the invention
[0003] In view of the shortcomings of the prior art, the present invention provides a gas mixture spectral analysis method combining the SSA-FastICA algorithm and the EMD-KPCA-LSTM model, which solves the problem that it is difficult to achieve qualitative or quantitative detection of the components of the mixed gas when there are many types of gases in the mixed gas and the physical and chemical properties of the components to be detected are very similar.
[0004] To achieve the above object, the present invention provides the following technical solutions:
[0005] A gas mixture spectrum analysis method combining the SSA-FastICA algorithm and the EMD-KPCA-LSTM model, the analysis method comprising the following steps:
[0006] S1. Obtaining gas mixture spectrum lines of the mixed gas;
[0007] S2, filtering the mixed spectral lines by using the SG adaptive filtering algorithm based on Bayesian optimization to filter out the noise signal and obtain the filtered spectral lines;
[0008] S3, judging whether the number of spectrum curve samples is greater than or equal to the number of types of mixed gases to be tested identified in the filtered spectrum line;
[0009] If yes, the filtered spectrum lines are separated by PCA-FastICA algorithm to obtain the absorption spectrum of a single gas in the mixed gas;
[0010] If not, the filtered spectrum lines are separated by the SSA-FastICA algorithm to obtain the absorption spectrum of a single gas in the mixed gas;
[0011] S4. The absorption spectrum of a single gas is analyzed by the EMD-KPCA-LSTM model to obtain analysis results including gas type, gas concentration, Gaussian linewidth and Lorentz linewidth.
[0012] Preferably, in step S2, the following steps are specifically included:
[0013] S21, constructing an MLP model of SG adaptive filtering based on Bayesian optimization, the model includes an input layer, three hidden layers and an output layer;
[0014] S22, superimposing Gaussian white noise on the simulated data in the Hitran database to obtain first spectrum data;
[0015] S23, putting the first spectrum data including the wave number and the absorption coefficient into the SG parameter calculator, outputting the SG filter parameters including the polynomial order and the window length, and putting the parameters into the data set as output, and taking the first spectrum data as input of the data set;
[0016] S24, repeating steps S22-S23 to obtain a data set including a plurality of inputs and corresponding outputs, and dividing the data set into a test set and a training set;
[0017] S25, set the size of the hidden layer to 10×20×30, use the Adam optimizer for training, and define a hyperparameter space including L2 regularization and learning rate;
[0018] S26, finding the hyperparameters that minimize the loss of the MLP model through the Bayesian optimization algorithm, retraining the MLP model using the hyperparameters, and evaluating the model accuracy through the predicted values and true values of the spectral signals of the test set;
[0019] S27, inputting the gas mixture spectrum line into the MLP model to obtain the filtered spectrum line.
[0020] Preferably, in step S3, the following steps are specifically included:
[0021] S31, constructing a spectrum matrix according to the filtered spectrum lines;
[0022] S32, performing singular value decomposition on the spectrum matrix; the expression for performing singular value decomposition on the spectrum matrix is:
[0023]
[0024] In the above formula, A represents the spectral matrix, um and v m are the mth singular value σ m The corresponding left and right singular vectors;
[0025] S33, obtaining the number of types of the mixed gas to be tested according to the decomposed spectrum matrix;
[0026] S34, determining whether the number of spectrum curve samples is greater than or equal to the number of types of mixed gases to be tested identified in the filtered spectrum line;
[0027] If yes, proceed to step S35;
[0028] If not, proceed to step S36;
[0029] S35, processing the filtered spectrum lines by PCA algorithm to obtain the first several first eigenvalues, and constructing a whitening matrix according to the first eigenvalues, wherein the number of the first eigenvalues is equal to the number of types of the mixed gas to be measured;
[0030] S36, processing the filtered spectrum lines by an SSA algorithm to obtain a plurality of second eigenvalues, and constructing an input matrix according to the second eigenvalues, wherein the number of the second eigenvalues is equal to the number of types of the mixed gas to be measured;
[0031] S37. The whitening matrix and the input matrix are processed by the FastICA algorithm to obtain the absorption spectrum of a single gas in the mixed gas.
[0032] Preferably, in step S35, the following steps are specifically included:
[0033] S351, grouping the filtered spectrum lines according to the number of gas types to be measured to obtain a first spectrum matrix, and centralizing the first spectrum matrix; the expression of the first spectrum matrix after centralization is:
[0034]
[0035]
[0036] In the above formula, represents the first spectral matrix after centering, The matrix vector representing the first spectrum of the tth row after centering, X i (t) represents the matrix vector of the first spectrum of the tth row before centering, E[X i (t)] represents the average value of the matrix vector of the first spectrum in the tth row before centering, and i is the integer part of the ratio of the number of spectral samples to the number of gas species;
[0037] S352, calculating the covariance matrix of the first spectral matrix after centralization; the calculation formula of the covariance matrix is:
[0038]
[0039] In the above formula, C represents the covariance matrix, F represents the length of the spectral matrix after centering, represents the first spectral matrix after centering;
[0040] S353, eigendecomposing the covariance matrix to obtain a first matrix composed of the first several first eigenvalues in columns, and a diagonal matrix composed of the first eigenvalues, wherein the number of eigenvalues is equal to the number of types of the mixed gas to be measured; the expression for eigendecomposing the covariance matrix is:
[0041] C=VAV -1
[0042] In the above formula, C represents the covariance matrix, V is the first matrix composed of the first several eigenvalues in columns, and A is the diagonal matrix composed of eigenvalues;
[0043] S354, calculate the whitened matrix after whitening according to the first matrix and the diagonal matrix, and then enter step S37; the expression of the whitened matrix is:
[0044]
[0045] In the above formula, X w Represents the whitening matrix.
[0046] Preferably, in step S36, the following steps are specifically included:
[0047] S361, selecting one of the observation vectors in the filtered spectrum line; the expression of the mixed spectrum data vector of one of the observations in the filtered spectrum line is:
[0048] X=[X(1),X(2),...,X(G)]
[0049] Where G represents the length of the observation signal, X is one of the observation vectors in the filtered spectrum line, and X(G) represents the matrix of the observation signal with a length of G;
[0050] S362, constructing a trajectory matrix according to one of the observation vectors in the filtered spectrum line; the expression of the trajectory matrix is:
[0051]
[0052] In the above formula, M is the number of gas types to be measured, which is also the number of columns of the trajectory matrix, and L is the number of rows of the trajectory matrix. L and M satisfy the relationship: M = G-L+1;
[0053] S363, performing singular value decomposition on the trajectory matrix; the expression for performing singular value decomposition on the trajectory matrix is:
[0054]
[0055] In the above formula, Y represents the trajectory matrix, r is the rank of the trajectory matrix, σ i is the i-th eigenvalue, u i and v i They are the singular values σ i The corresponding left and right singular vectors;
[0056] S364, each non-zero singular value is grouped separately to divide the trajectory matrix into a number of linearly independent sub-matrices; the expression of the sub-matrix is: {I1,I2,...,I r}, where I r represents the submatrix corresponding to the rth non-zero singular value;
[0057] S365, calculate the average value of all anti-diagonal lines in each sub-matrix in turn, and establish an input matrix; the calculation formula for the average value of all anti-diagonal lines in the sub-matrix is:
[0058]
[0059] In the above formula, Q(n) represents the nth row vector of any row of the input matrix, N represents the number of anti-diagonals, N=M+L-1, M represents the number of columns of the submatrix, L represents the number of rows of the submatrix, L and M satisfy M=G-L+1, r is the rank of the trajectory matrix, which is also the number of submatrices.
[0060] Preferably, in step S37, the following steps are specifically included:
[0061] S371. Select a random unit vector as the initial value of the weight vector, and apply the following update rule to the weight vector until convergence; the update rule is as follows:
[0062]
[0063] In the above formula, W n+1 represents the weight vector after n+1 iterations, g(·) is a nonlinear function used to capture non-Gaussian shapes, g'(·) is its derivative, and R wi represents the observation vector of the i-th row of the whitening matrix or input matrix, w n Represents the row vector of the separation matrix for the nth iteration;
[0064] S372, normalize the weight vector of each iteration to generate a separation matrix, and project the whitening matrix or the input matrix onto the independent components through the separation matrix to obtain an absorption spectrum matrix of a single gas composed of the spectral line data after spectral line separation; the absorption spectrum matrix of a single gas:
[0065] S=W T R w
[0066] In the above formula, S is the absorption spectrum matrix of a single gas composed of spectral line data after spectral line separation, W represents the final separation matrix obtained after several iterations, and R w Represents the whitening matrix or input matrix.
[0067] Preferably, in step S4, the following steps are specifically included:
[0068] S41, calculating the correlation coefficient between the absorption spectrum of a single gas and the spectra of all gases with absorption peaks in the same wave number range in the Hitran database;
[0069] S42, judging whether the absorption spectrum of the single gas is the gas type corresponding to the gas spectrum in the Hitran database according to whether the correlation coefficient is greater than the correlation coefficient threshold;
[0070] If so, the absorption spectrum of the gas is the gas type corresponding to the gas spectrum in the Hitran database;
[0071] If not, return to step S41 and reselect the gas spectrum in the Hitran database;
[0072] S43, constructing a data set of the EMD-KPCA-LSTM model, the input of the data set is four input features of wave number, absorption coefficient, temperature and pressure, and the output of the data set is three output features of gas concentration, Gaussian line width and Lorentz line width;
[0073] S44, performing empirical mode decomposition on each input feature in the data set of the EMD-KPCA-LSTM model to obtain a plurality of first feature sequences;
[0074] S45, reducing the dimension of the first feature sequence by a kernel principal component analysis algorithm to obtain a second feature sequence after dimension reduction;
[0075] S46, inputting the second feature sequence into the LSTM model for training and model accuracy evaluation to obtain an EMD-KPCA-LSTM model that meets the accuracy requirements;
[0076] S47, inputting the wave number, absorption coefficient, temperature and pressure of the absorption spectrum of a single gas into the EMD-KPCA-LSTM model to obtain output results including gas concentration, Gaussian linewidth and Lorentzian linewidth;
[0077] S48. Output analysis results including gas type, gas concentration, Gaussian line width and Lorentz line width.
[0078] Preferably, in step S44, the following steps are specifically included:
[0079] S441, composing the four input features of wave number, absorption coefficient, temperature and pressure into an input data sequence;
[0080] S442, finding all the maximum value points of the input data sequence, and fitting all the maximum value points with a cubic spline interpolation function to form an upper envelope of the data;
[0081] S443, finding all the minimum points of the input data sequence, and fitting all the minimum points through a cubic spline interpolation function to form a lower envelope of the data;
[0082] S444, obtaining the mean of the upper envelope and the lower envelope to generate a mean sequence;
[0083] S445. Subtract the mean sequence from the input data sequence to obtain a first sequence; the expression of the first sequence is:
[0084] h i (t) = X i (t)-m i (t)
[0085] In the above formula, h i (t) represents the first sequence of the i-th cycle, X i (t) represents the input data sequence of the i-th cycle, m i (t) represents the mean sequence of the i-th cycle;
[0086] S446, determining whether there is a negative local maximum or a positive local minimum in the first sequence;
[0087] If yes, the first sequence is marked as the input data sequence, and the process returns to step S442;
[0088] If not, proceed to step S447;
[0089] S447, constructing a first characteristic sequence according to the first sequence of several cycles; the expression of the first characteristic sequence is:
[0090]
[0091] In the above formula, x(t) represents the first characteristic sequence, h i (t) represents the first sequence of the i-th cycle, the total number of cycles is q, r q (t) represents the residual wave of the qth cycle.
[0092] Preferably, in step S45, the following steps are specifically included:
[0093] S451, calculating the kernel matrix of the first characteristic sequence; the expression of the kernel matrix is:
[0094]
[0095] In the above formula, K(x i ,x j ) indicates that the two input features are the i-th x in the first feature sequence i and the jth feature x j The kernel matrix when , σ is the parameter that controls the shape of the kernel function;
[0096] S452, centralize the kernel matrix to obtain a third eigenvalue and a corresponding eigenvector;
[0097] S453, selecting eigenvectors corresponding to the first several largest third eigenvalues as principal components, thereby constructing a dimensionality reduction space, the selection of the third eigenvalue is determined according to the information proportion of the eigenvector, a threshold is set, and the eigenvectors whose information proportion is greater than the threshold are selected as principal components;
[0098] S454, projecting the input features of the data set into the dimension reduction space to obtain a second feature sequence after dimension reduction.
[0099] Preferably, in step S46, the following steps are specifically included:
[0100] S461, normalizing the data in the second feature sequence as a data set for the LSTM model, and dividing the data set into a training set and a test set;
[0101] S462, initializing the parameters of the LSTM model, and inputting the training set of the LSTM model into the LSTM model for training until the accuracy of the LSTM model reaches the target accuracy;
[0102] S463. After the LSTM model training is completed, the test set of the LSTM model is input into the LSTM model for testing, and the root mean square error, mean absolute error and determination coefficient are used to evaluate the model accuracy to obtain an LSTM model that meets the target accuracy.
[0103] Compared with the prior art, the present invention provides a gas mixture spectrum analysis method combining the SSA-FastICA algorithm and the EMD-KPCA-LSTM model, which has the following beneficial effects:
[0104] 1. The present invention uses the SSA-FastICA algorithm to separate overlapping mixed spectral lines, which can separate the mixed gas type when it is unknown, identify the abnormal or noise components in the data, and remove the abnormal data that is not easy to detect in the mixed noise. At the same time, considering the different situations of more and less samples of the mixed gas measurement spectral line, different methods are used for processing, so that when separating the spectral data, no matter how many groups of observed spectral samples there are, the separation can be completed, and it can also ensure that when the measured spectral lines are separated, the original signal is basically retained, the error is reduced, and the gas type is obtained by comparing with the standard data.
[0105] 2. The present invention adopts the SG adaptive filtering algorithm based on Bayesian optimization and designs an SG filtering parameter calculator to produce a model training data set. The trained model can automatically find the optimal filtering parameters, greatly improving the filtering effect.
[0106] 3. The present invention introduces a long short-term memory network model based on empirical mode decomposition and kernel principal component analysis, which can better capture the local and global characteristics, short-term fluctuations and long-term trends in the measurement data during long-term continuous detection of gas concentration, solves the problems of overfitting or slow convergence of traditional neural networks due to too many input variables, and comprehensively considers the characteristics of gas concentration changing with time when monitoring mixed gases for a long time, thereby improving the concentration prediction accuracy of the model.
[0107] 4. The present invention filters the spectral lines and separates the mixed spectra, and then obtains the gas type corresponding to each spectral line by comparing with the standard data. Finally, the optimized long short-term memory network model is used to continue analyzing the separated spectral data, and the concentration of each gas in the mixed gas, the Gaussian line width and the Lorentz line width of the spectral lines are obtained in real time, helping researchers to study the spectral data more accurately. BRIEF DESCRIPTION OF THE DRAWINGS
[0108] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0109] Figure 1 is a flow chart of the gas mixture spectral analysis method of the present invention;
[0110] Figure 2 It is a structural logic diagram of the SG parameter calculator of the present invention;
[0111] Figure 3 Flow chart of the LSTM model of the present invention. DETAILED DESCRIPTION
[0112] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods, so that the implementation process of how the present application uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly.
[0113] Those skilled in the art can understand that all or part of the steps in the following embodiments can be completed by instructing the relevant hardware through a program, so the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0114] According to the Beer-Lambert law, ideally, the absorption spectrum should be expressed as a combination of discrete absorption spectral lines. Based on this principle, the single gas concentration of the mixed gas can be detected. However, under the influence of factors such as ambient temperature, pressure, instrument noise, and stability of the light source, the absorption of photons by the gas components does not produce discrete spectral lines, but is expressed as absorption spectral peaks in the form of Lorentz line type, Gaussian line type, Voigt line type, etc. When there are many types of gases in the mixed gas and the physical and chemical properties of the components to be detected are very similar, the spectral signal will be mixed with a large number of spectral peaks with similar structures and overlapping with each other. In this case, it is very difficult to achieve qualitative or quantitative detection of the components of the mixed gas. In order to improve the resolution and accuracy of the detection and analysis of the spectral signal of the mixed gas so that it can be used for qualitative and quantitative analysis, it is necessary to separate the overlapping parts of the spectral signal. The separation of the mixed spectral lines is affected by factors such as the degree of spectral line overlap and the separation method, which may cause the loss of the original spectral signal.
[0115] In terms of gas concentration measurement, for the absorption spectrum of a single gas, the traditional method obtains the fitting area by fitting the curve contour, compares it with the gas volume and number of molecules under ideal conditions, and then obtains the gas concentration value. The accuracy of the concentration information obtained by this method depends on the accuracy of the fitting area, which is easily affected by the ambient pressure and temperature. The measurement error is large, and it is impossible to obtain the concentration in real time, which is not conducive to real-time monitoring of gas concentration. Nowadays, a scientific research team has proposed introducing deep learning algorithms into the field of concentration information acquisition. Although these methods can predict the gas concentration based on the input spectral data and perform well in processing static data sets, in real-time or near real-time prediction scenarios, since the gas concentration is related to the gas absorption coefficient, temperature and pressure information, and shows nonlinear changes with environmental factors, as the input variables increase, the model convergence speed will slow down, and overfitting may occur. At the same time, when monitoring the concentration of each component of the mixed gas in real time, it is also necessary to consider the characteristics of the gas concentration changing over time, which is difficult to achieve using traditional neural networks, limiting the improvement of prediction accuracy.
[0116] In order to solve the problem that it is difficult to achieve qualitative or quantitative detection of the components of the mixed gas when there are many types of gases in the mixed gas and the physical and chemical properties of the components to be detected are very similar, the present invention provides a gas mixture spectral analysis method combining the SSA-FastICA algorithm and the EMD-KPCA-LSTM model, such as Figure 1 As shown, the whole process includes three parts: spectral line filtering, spectral line separation and spectral line analysis. Finally, the Gaussian line width and Lorentz line width of the spectral line corresponding to each gas in the mixed gas, as well as the corresponding gas concentration are obtained. The analysis method includes the following steps:
[0117] S1. Obtaining gas mixture spectrum lines of the mixed gas;
[0118] S2, filtering the mixed spectral lines by using the SG adaptive filtering algorithm based on Bayesian optimization to filter out the noise signal and obtain the filtered spectral lines; automatically finding the optimal filtering parameters by using the SG adaptive filtering algorithm based on Bayesian optimization to filter the spectral curve to improve the signal-to-noise ratio. In step S2, the following steps are specifically included:
[0119] S21, constructing an MLP model of SG adaptive filtering based on Bayesian optimization, the model includes an input layer, three hidden layers and an output layer;
[0120] S22, superimposing Gaussian white noise on the simulated data in the Hitran database to obtain first spectrum data;
[0121] S23, putting the first spectrum data including the wave number and the absorption coefficient into the SG parameter calculator, outputting the SG filter parameters including the polynomial order and the window length, and putting the parameters into the data set as output, and taking the first spectrum data as input of the data set; the construction idea of the SG parameter calculator is as follows Figure 2 As shown, a for loop is used in MATLAB to freely combine k and b within a certain range, and the signal-to-noise ratio of the spectrum after SG filtering under each set of parameters is calculated, and finally the parameter corresponding to the highest signal-to-noise ratio is obtained;
[0122] S24, repeating steps S22-S23 to obtain a data set including a plurality of inputs and corresponding outputs, and dividing the data set into a test set and a training set;
[0123] S25, set the size of the hidden layer to 10×20×30, use the Adam optimizer for training, and define a hyperparameter space including L2 regularization and learning rate;
[0124] S26, finding the hyperparameters that minimize the loss of the MLP model through the Bayesian optimization algorithm, retraining the MLP model using the hyperparameters, and evaluating the model accuracy through the predicted values and true values of the spectral signals of the test set;
[0125] S27, inputting the gas mixture spectrum line into the MLP model to obtain the filtered spectrum line.
[0126] S3, judging whether the number of spectrum curve samples is greater than or equal to the number of types of mixed gases to be tested identified in the filtered spectrum line;
[0127] If yes, the filtered spectrum lines are separated by PCA-FastICA algorithm to obtain the absorption spectrum of a single gas in the mixed gas;
[0128] If not, the filtered spectrum lines are separated by the SSA-FastICA algorithm to obtain the absorption spectrum of a single gas in the mixed gas;
[0129] In order to improve the resolution and accuracy of the detection and analysis of mixed gas spectral signals so that they can be used for qualitative and quantitative analysis, it is necessary to separate the overlapping parts of the spectral signals. The separation of mixed spectral lines is affected by factors such as the degree of spectral line overlap and the separation method, which may lead to the loss of the original spectral signals. Now, after research, it is found that the overlapping spectral lines can be separated by the fast independent component analysis method FastICA, but it is required that the number of input observation signals is equal to or greater than the number of actual components in the mixture. When the number of observation signals is small, the measurement result error is large. Therefore, this puts forward requirements for the number of mixed gas spectral samples, making it difficult to obtain accurate results with fewer spectral data samples. Therefore, fewer spectral data samples need to be processed to make them suitable for the fast independent component analysis method FastICA. In step S3, the following steps are specifically included:
[0130] S31. Construct a spectrum matrix based on the filtered spectrum lines; the expression of the spectrum matrix is: A∈C z×b (z≥b), where A represents the spectral matrix, C z×b represents a matrix with z rows and b columns;
[0131] S32, performing singular value decomposition on the spectrum matrix; the expression for performing singular value decomposition on the spectrum matrix is:
[0132]
[0133] In the above formula, A represents the spectral matrix, u m and v m are the mth singular value σ m The corresponding left and right singular vectors;
[0134] S33, obtaining the number of types of the mixed gas to be tested according to the decomposed spectral matrix; for each singular vector after singular value decomposition, the curves drawn by the first few singular vectors will have obvious waveform changes, and the curves drawn by other singular vectors will have almost no change near 0, which is very different. By observing several singular vectors after singular value decomposition, the number of singular vectors with obvious waveforms is the number of types in the gas to be tested;
[0135] S34, determining whether the number of spectrum curve samples is greater than or equal to the number of types of mixed gases to be tested identified in the filtered spectrum line;
[0136] If yes, proceed to step S35;
[0137] If not, proceed to step S36;
[0138] S35, processing the filtered spectrum lines by PCA algorithm to obtain the first several first eigenvalues, and constructing a whitening matrix according to the first eigenvalues, wherein the number of the first eigenvalues is equal to the number of types of the mixed gas to be measured; independent component analysis is an optimization problem, and in order to make the problem solvable, the following constraints need to be met:
[0139] ① The source data are statistically independent of each other;
[0140] ② The mixed spectral data matrix has full column rank, that is, it is an overdetermined or positive definite model;
[0141] ③There is at most one Gaussian signal in the source signal;
[0142] ④ Each signal in the source signal vector group is a stationary random process with unit variance and zero mean.
[0143] In order to make the spectral line data of the filtered spectrum line meet the constraint condition ④, it needs to be centered and whitened to be a zero-mean signal with a variance of 1. In step S35, the following steps are specifically included:
[0144] S351, grouping the filtered spectrum lines according to the number of gas types to be measured to obtain a first spectrum matrix, and centralizing the first spectrum matrix; the expression of the first spectrum matrix after centralization is:
[0145]
[0146]
[0147] In the above formula, represents the first spectral matrix after centering, The matrix vector representing the first spectrum of the tth row after centering, X i (t) represents the matrix vector of the first spectrum of the tth row before centering, E[X i (t)] represents the average value of the matrix vector of the first spectrum in the tth row before centering, and i is the integer part of the ratio of the number of spectral samples to the number of gas species;
[0148] S352, calculating the covariance matrix of the first spectral matrix after centralization; the calculation formula of the covariance matrix is:
[0149]
[0150] In the above formula, C represents the covariance matrix, F represents the length of the spectral matrix after centering, represents the first spectral matrix after centering;
[0151] S353, eigendecomposing the covariance matrix to obtain a first matrix composed of the first several first eigenvalues in columns, and a diagonal matrix composed of the first eigenvalues, wherein the number of eigenvalues is equal to the number of types of the mixed gas to be measured; the expression for eigendecomposing the covariance matrix is:
[0152] C=VAV -1
[0153] In the above formula, C represents the covariance matrix, V is the first matrix composed of the first several eigenvalues in columns, and A is the diagonal matrix composed of eigenvalues;
[0154] S354, calculate the whitened matrix after whitening according to the first matrix and the diagonal matrix, and then enter step S37; the expression of the whitened matrix is:
[0155]
[0156] In the above formula, X w represents the whitening matrix;
[0157] S36, processing the filtered spectrum lines through the SSA algorithm to obtain a number of second eigenvalues, and constructing an input matrix according to the second eigenvalues, wherein the number of second eigenvalues is equal to the number of types of the mixed gas to be measured; since ICA decomposition must satisfy that the number of spectrum curve samples is greater than or equal to the number of types of the mixed gas to be measured identified in the filtered spectrum lines, otherwise the error will be very large, the present invention adopts a singular spectrum analysis algorithm SSA combined with a fast independent component analysis algorithm FastICA to separate the spectrum lines, firstly decompose and reconstruct the original small number of observed spectrum curve samples through SSA, so that the signal meets the use conditions of FastICA, and then use FastICA to separate the spectrum lines to obtain the absorption spectrum corresponding to a single gas. In step S36, the following steps are specifically included:
[0158] S361, selecting one of the observation vectors in the filtered spectrum line; the expression of the mixed spectrum data vector of one of the observations in the filtered spectrum line is:
[0159] X=[X(1),X(2),...,X(G)]
[0160] Where G represents the length of the observation signal, X is one of the observation vectors in the filtered spectrum line, and X(G) represents the matrix of the observation signal with a length of G;
[0161] S362, constructing a trajectory matrix according to one of the observation vectors in the filtered spectrum line; the expression of the trajectory matrix is:
[0162]
[0163] In the above formula, M is the number of gas types to be measured, which is also the number of columns of the trajectory matrix, and L is the number of rows of the trajectory matrix. L and M satisfy the relationship: M = G-L+1;
[0164] S363, performing singular value decomposition on the trajectory matrix; the expression for performing singular value decomposition on the trajectory matrix is:
[0165]
[0166] In the above formula, Y represents the trajectory matrix, r is the rank of the trajectory matrix, σ i is the i-th eigenvalue, u i and v i They are the singular values σ i The corresponding left and right singular vectors;
[0167] S364, each non-zero singular value is grouped separately to divide the trajectory matrix into a number of linearly independent sub-matrices; the expression of the sub-matrix is: {I1,I2,...,I r}, where I r represents the submatrix corresponding to the rth non-zero singular value;
[0168] S365, calculate the average value of all anti-diagonal lines in each sub-matrix in turn, and establish an input matrix; the calculation formula for the average value of all anti-diagonal lines in the sub-matrix is:
[0169]
[0170] In the above formula, Q(n) represents the nth row vector of any row of the input matrix, N represents the number of anti-diagonals, N=M+L-1, M represents the number of columns of the submatrix, L represents the number of rows of the submatrix, L and M satisfy M=G-L+1, r is the rank of the trajectory matrix, which is also the number of submatrices; through this step, a number of input signals equal to the number of gas types to be measured can be obtained, and these signals are used as a group to construct an input matrix to obtain a number of observation signals that meet the FastICA usage conditions, and the input matrix can be input into the next step of the FastICA algorithm.
[0171] S37, the whitening matrix and the input matrix are processed by the FastICA algorithm to obtain the absorption spectrum of a single gas in the mixed gas. The whitening matrix and the input matrix corresponding to the mixed gas need to be processed to achieve spectral separation. In step S37, the following steps are specifically included:
[0172] S371. Select a random unit vector as the initial value of the weight vector, and apply the following update rule to the weight vector until convergence; the update rule is as follows:
[0173]
[0174] In the above formula, W n+1 represents the weight vector after n+1 iterations, g(·) is a nonlinear function used to capture non-Gaussian shapes, g'(·) is its derivative, and R wi represents the observation vector of the i-th row of the whitening matrix or input matrix, w n represents the separation matrix row vector of the nth iteration. One iteration can only get one separation matrix row vector. In order to separate a number of signals with the same number of gas types as the measured gas, the same number of iterations is required to obtain a separation matrix W0. After each iteration, W n+1 Normalization is performed and the new weight vectors need to be orthogonalized to ensure that they are independent of each other;
[0175] S372, normalize the weight vector of each iteration to generate a separation matrix, and project the whitening matrix or the input matrix onto the independent components through the separation matrix to obtain an absorption spectrum matrix of a single gas composed of the spectral line data after spectral line separation; the absorption spectrum matrix of a single gas:
[0176]
[0177] In the above formula, S is the absorption spectrum matrix of a single gas composed of the spectrum line data after spectrum line separation, W0 represents the final separation matrix obtained after several iterations, and R w Represents the whitening matrix or input matrix.
[0178] S4. The absorption spectrum of a single gas is analyzed by the EMD-KPCA-LSTM model to obtain analysis results including gas type, gas concentration, Gaussian linewidth and Lorentz linewidth. After separating the spectral lines, the absorption spectrum of each gas needs to be analyzed. The present invention calculates the correlation coefficient between each absorption spectrum and all gas spectra with absorption peaks in the same wavenumber range in the Hitran database. Generally, when the correlation coefficient is greater than 0.8, it indicates a good match, and the name of the gas type corresponding to the spectral line can be determined. Then, the long short-term memory network model (EMD-KPCA-LSTM) of empirical mode decomposition and nuclear principal component analysis is used to analyze the spectral lines, and finally the Gaussian linewidth, Lorentz linewidth and corresponding gas concentration of the spectral lines are obtained. Specifically, in step S4, the following steps are specifically included:
[0179] S41, calculating the correlation coefficient between the absorption spectrum of a single gas and the spectra of all gases with absorption peaks in the same wave number range in the Hitran database;
[0180] S42. Determine whether the absorption spectrum of a single gas is the gas type corresponding to the gas spectrum in the Hitran database according to whether the correlation coefficient is greater than the correlation coefficient threshold; after separating the mixed spectral lines, the absorption spectrum of each single gas is obtained. If you want to know the gas type corresponding to each spectral line, you need to find all gas spectra with absorption peaks in the wave number range in the Hitran database, calculate the correlation coefficient between the separated spectral line and each gas spectrum, and the gas type of the gas spectral line with the largest correlation coefficient (generally greater than 0.8) is the type corresponding to the separated spectral line;
[0181] If so, the absorption spectrum of the gas is the gas type corresponding to the gas spectrum in the Hitran database;
[0182] If not, return to step S41 and reselect the gas spectrum in the Hitran database;
[0183] S43. Construct a data set for the EMD-KPCA-LSTM model. The input of the data set is four input features, namely wave number, absorption coefficient, temperature and pressure. The output of the data set is three output features, namely gas concentration, Gaussian line width and Lorentz line width. The input data of the data set can be obtained from the Hitran database. After determining the temperature and pressure, the simulation data under ideal conditions in the database is downloaded. During the experiment, the measured data with high credibility can also be added to the data set to enhance the richness of the data set. The gas concentration in the output data of the data set is determined according to the coefficient multiplied by the simulation data. The Hitran database corresponds to a gas concentration of 100%. The absorption coefficient corresponding to gases of different concentrations is simulated by multiplying different coefficients. The Gaussian line width and Lorentz line width at the output end are obtained by fitting the ideal spectral line using software.
[0184] S44, perform empirical mode decomposition on each input feature in the data set of the EMD-KPCA-LSTM model to obtain several first feature sequences; the empirical mode decomposition algorithm EMD is an adaptive data processing method suitable for processing nonlinear time series. The key to this method is that it can decompose complex signals into a finite number of intrinsic mode functions (IMFs). The decomposed IMF components contain local characteristic signals of different time scales of the original signal, thereby reflecting the volatility, periodicity and change trend of the original environmental sequence. In step S44, the following steps are specifically included:
[0185] S441, composing the four input features of wave number, absorption coefficient, temperature and pressure into an input data sequence;
[0186] S442, finding all the maximum value points of the input data sequence, and fitting all the maximum value points with a cubic spline interpolation function to form an upper envelope of the data;
[0187] S443, finding all the minimum points of the input data sequence, and fitting all the minimum points through a cubic spline interpolation function to form a lower envelope of the data;
[0188] S444, obtaining the mean of the upper envelope and the lower envelope to generate a mean sequence;
[0189] S445. Subtract the mean sequence from the input data sequence to obtain a first sequence; the expression of the first sequence is:
[0190] h i (t) = X i (t)-m i (t)
[0191] In the above formula, h i (t) represents the first sequence of the i-th cycle, X i (t) represents the input data sequence of the i-th cycle, m i (t) represents the mean sequence of the i-th cycle;
[0192] S446, determining whether there is a negative local maximum or a positive local minimum in the first sequence;
[0193] If yes, the first sequence is marked as the input data sequence, and the process returns to step S442;
[0194] If not, then proceed to step S447. The final first sequence obtained is the eigenmode function. Then, a wave with irregular frequency can be transformed into multiple waves with single frequency and a residual wave, that is, the first characteristic sequence mentioned in step S447. q (t) is the eigenmode function;
[0195] S447, constructing a first characteristic sequence according to the first sequence of several cycles; the expression of the first characteristic sequence is:
[0196]
[0197] In the above formula, x(t) represents the first characteristic sequence, h i (t) represents the first sequence of the i-th cycle, the total number of cycles is q, r q (t) represents the residual wave of the qth cycle;
[0198] S45, the first feature sequence is reduced in dimension by the kernel principal component analysis algorithm to obtain the second feature sequence after dimension reduction; the data sequence obtained by EMD decomposition enriches the number of feature sequences, but the dimension of the input variable also increases accordingly. In order to improve the prediction accuracy while maintaining the calculation speed of the LSTM network model and overcome the problem of overfitting, the input variables need to be processed by selecting the principal component through KPCA. Under the premise of ensuring the validity and representativeness of the information, the calculation efficiency and accuracy of the model are improved. All the features after the empirical mode decomposition are subjected to kernel principal component analysis, and several larger eigenvalues are selected as the principal components to construct a new dimension reduction space, and the redundancy and correlation of different time series data obtained by EMD decomposition are eliminated. In step S45, the following steps are specifically included:
[0199] S451, calculating the kernel matrix of the first characteristic sequence; the expression of the kernel matrix is:
[0200]
[0201] In the above formula, K(x i ,x j ) indicates that the two input features are the i-th x in the first feature sequence i and the jth feature x j The kernel matrix when , σ is the parameter that controls the shape of the kernel function;
[0202] S452, centralize the kernel matrix to obtain a third eigenvalue and a corresponding eigenvector;
[0203] S453, selecting eigenvectors corresponding to the first several largest third eigenvalues as principal components, thereby constructing a dimensionality reduction space, the selection of the third eigenvalue is determined according to the information proportion of the eigenvector, a threshold is set, and the eigenvectors whose information proportion is greater than the threshold are selected as principal components;
[0204] S454. Project the input features of the data set to the dimensionality reduction space to obtain the second feature sequence after dimensionality reduction; after empirical mode decomposition and kernel principal component analysis, the initial complex, nonlinear, and non-stationary input data is converted into multiple simpler subsequences, and then the main and most representative features are selected and mapped to the low-dimensional space, which is conducive to simplifying the learning task of the model. The next step is to use the processed data as a data set to train the long short-term memory network model.
[0205] S46, input the second feature sequence into the LSTM model for training and model accuracy evaluation to obtain an EMD-KPCA-LSTM model that meets the accuracy requirements; the hidden layer cell structure of the LSTM is as follows Figure 3As shown in the figure, by introducing the control gate, the deep neural network expanded in time becomes easier to train, and its forward calculation process satisfies the following relationship:
[0206]
[0207] In the above formula, i represents the input gate, f represents the forget gate, c represents the cell state, o represents the output gate, W represents the corresponding weight coefficient matrix, b represents the corresponding bias term, σ represents the sigmoid activation function, and tanh represents the hyperbolic tangent activation function.
[0208] To further illustrate the construction of the LSTM model in the present invention, in step S46, the following steps are specifically included:
[0209] S461, normalizing the data in the second feature sequence as a data set for the LSTM model, and dividing the data set into a training set and a test set;
[0210] S462, initializing the parameters of the LSTM model, and inputting the training set of the LSTM model into the LSTM model for training until the accuracy of the LSTM model reaches the target accuracy;
[0211] S463. After the LSTM model training is completed, the test set of the LSTM model is input into the LSTM model for testing, and the model accuracy is evaluated using the root mean square error, mean absolute error and determination coefficient to obtain an LSTM model that meets the target accuracy;
[0212] S47, inputting the wave number, absorption coefficient, temperature and pressure of the absorption spectrum of a single gas into the EMD-KPCA-LSTM model to obtain output results including gas concentration, Gaussian linewidth and Lorentzian linewidth;
[0213] S48. Output analysis results including gas type, gas concentration, Gaussian line width and Lorentz line width.
[0214] When the absorption spectrum of a mixed gas is measured, and the gas types contained in the mixed gas are unknown, it is first necessary to filter the mixed spectral lines through the SG adaptive filtering algorithm based on deep learning to filter out the noise signal, and then enter the spectral line separation stage. First, the spectral matrix composed of the filtered spectral data is subjected to singular value decomposition, and the type of mixed gas is judged by observing the singular vector waveform after decomposition. When the spectral line sample is greater than or equal to the number of gas types to be measured, the spectral matrix composed of the spectral lines is first subjected to principal component analysis, and then input into the fast independent component analysis algorithm FastICA for spectral line separation, and the absorption spectrum of each single gas can be obtained. When the spectral curve sample When the number is less than the number of gas types to be tested, the singular spectrum analysis algorithm SSA is first used to process the spectral lines, and then input into the fast independent component analysis algorithm FastICA for spectral separation. After completing the above processing, the separated spectral lines are input into the trained long short-term memory network EMD-KPCA-LSTM based on empirical mode decomposition and nuclear principal component analysis, and finally the Gaussian line width, Lorentz line width and corresponding gas concentration of each spectral line are output. At the same time, each single spectral line can be fitted with different gas data in the corresponding wavenumber range in the Hitran database, and then the gas corresponding to the spectrum can be determined according to the correlation coefficient, and finally the gas type contained in the mixed gas can be determined.
[0215] The above implementation methods have been described in detail. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A gas mixture spectrum analysis method combining the SSA-FastICA algorithm and the EMD-KPCA-LSTM model, characterized in that: The analysis method includes the following steps: S1. obtaining a gas mixture spectrum line of the mixed gas; S2, filtering the mixed spectral lines by using the SG adaptive filtering algorithm based on Bayesian optimization to filter out the noise signal and obtain the filtered spectral lines; S3, determining whether the number of spectral curve samples is greater than or equal to the number of types of mixed gases to be measured identified in the filtered spectral line; If so, the filtered spectrum lines are separated by PCA-FastICA algorithm to obtain the absorption spectra of the single gas in the mixed gas; If not, the filtered spectrum lines are separated by the SSA-FastICA algorithm to obtain the absorption spectra of the single gas in the mixed gas; S4. The absorption spectrum of a single gas is analyzed using the EMD-KPCA-LSTM model to obtain analysis results including gas type, gas concentration, Gaussian linewidth, and Lorentz linewidth.
2. The analysis method according to claim 1, characterized in that In step S2, the following steps are specifically included: S21. Construct an MLP model of SG adaptive filtering based on Bayesian optimization, which includes an input layer, three hidden layers and an output layer; S22, superimposing Gaussian white noise on the simulated data in the Hitran database to obtain first spectral data; S23, putting the first spectrum data including the wave number and the absorption coefficient into the SG parameter calculator, outputting the SG filter parameters including the polynomial order and the window length, and putting the parameters into the data set as output, and taking the first spectrum data as input of the data set; S24, repeating steps S22-S23 to obtain a data set containing several inputs and corresponding outputs, and dividing the data set into a test set and a training set; S25. Set the size of the hidden layer to 10×20×30, use the Adam optimizer for training, and define a hyperparameter space including L2 regularization and learning rate; S26. Use the Bayesian optimization algorithm to find the hyperparameters that minimize the loss of the MLP model, use the hyperparameters to retrain the MLP model, and evaluate the model accuracy by comparing the predicted and true values of the spectral signals of the test set; S27. Input the gas mixture spectrum line into the MLP model to obtain the filtered spectrum line.
3. The analysis method according to claim 1, characterized in that In step S3, the following steps are specifically included: S31, constructing a spectrum matrix according to the filtered spectrum lines; S32. Perform singular value decomposition on the spectral matrix. The expression for performing singular value decomposition on the spectral matrix is: In the above formula, A represents the spectral matrix, u m and v m are the mth singular value σ m The corresponding left and right singular vectors; S33, obtaining the number of types of the mixed gas to be measured according to the decomposed spectrum matrix; S34, determining whether the number of spectrum curve samples is greater than or equal to the number of types of mixed gases to be measured identified in the filtered spectrum line; If yes, proceed to step S35; If not, proceed to step S36; S35, processing the filtered spectrum lines using a PCA algorithm to obtain the first several first eigenvalues, and constructing a whitening matrix based on the first eigenvalues, where the number of the first eigenvalues is equal to the number of types of the mixed gas to be measured; S36. Processing the filtered spectrum lines using an SSA algorithm to obtain a plurality of second eigenvalues, and constructing an input matrix based on the second eigenvalues, where the number of the second eigenvalues is equal to the number of types of the mixed gas to be measured; S37. Process the whitening matrix and the input matrix using the FastICA algorithm to obtain the absorption spectrum of a single gas in the mixed gas.
4. The analysis method according to claim 3, characterized in that In step S35, the following steps are specifically included: S351. Group the filtered spectrum lines according to the number of gas types to be measured to obtain a first spectrum matrix, and center the first spectrum matrix; the expression of the first spectrum matrix after centering is: In the above formula, represents the first spectral matrix after centering, The matrix vector representing the first spectrum of the tth row after centering, X i (t) represents the matrix vector of the first spectrum of the tth row before centering, E[X i (t)] represents the average value of the matrix vector of the first spectrum in the t-th row before centering, and i is the integer part of the ratio of the number of spectral samples to the number of gas species; S352. Calculate the covariance matrix of the first spectral matrix after the centralization. The calculation formula of the covariance matrix is: In the above formula, C represents the covariance matrix, F represents the length of the spectral matrix after centering, represents the first spectral matrix after centering; S353, perform eigendecomposition on the covariance matrix to obtain a first matrix consisting of the first several first eigenvalues in columns, and a diagonal matrix consisting of the first eigenvalues, where the number of eigenvalues is equal to the number of types of mixed gases to be measured; the expression for eigendecomposition of the covariance matrix is: C=VAV -1 In the above formula, C represents the covariance matrix, V is the first matrix composed of the first several eigenvalues in columns, and A is the diagonal matrix composed of eigenvalues; S354: Calculate the whitened matrix based on the first matrix and the diagonal matrix, and then proceed to step S37; the expression of the whitened matrix is: In the above formula, X w represents the whitening matrix.
5. The analysis method according to claim 3, characterized in that In step S36, the following steps are specifically included: S361, selecting one of the observation vectors in the filtered spectrum line; the expression of the mixed spectrum data vector of one of the observations in the filtered spectrum line is: X=[X(1),X(2),...,X(G)] Where G represents the length of the observation signal, X is the observation vector of one of the filtered spectrum lines, and X(G) represents the matrix of the observation signal with a length of G. S362. Construct a trajectory matrix based on one of the observation vectors in the filtered spectrum line. The expression of the trajectory matrix is: In the above formula, M is the number of gas types to be measured, which is also the number of columns of the trajectory matrix, and L is the number of rows of the trajectory matrix. L and M satisfy the relationship: M = G - L + 1; S363. Perform singular value decomposition on the trajectory matrix. The expression for performing singular value decomposition on the trajectory matrix is: In the above formula, Y represents the trajectory matrix, r is the rank of the trajectory matrix, σ i is the i-th eigenvalue, u i and v i They are the singular values σ i The corresponding left and right singular vectors; S364. Each non-zero singular value is grouped separately to divide the trajectory matrix into several linearly independent sub-matrices; the expression of the sub-matrix is: {I1,I2,...,I r }, where I r represents the submatrix corresponding to the rth non-zero singular value; S365. Calculate the average value of all anti-diagonals in each sub-matrix in sequence and establish an input matrix. The calculation formula for the average value of all anti-diagonals in the sub-matrix is: In the above formula, Q(n) represents the nth row vector of any row of the input matrix, N represents the number of anti-diagonals, N = M + L - 1, M represents the number of columns of the submatrix, L represents the number of rows of the submatrix, L and M satisfy M = G - L + 1, r is the rank of the trajectory matrix, which is also the number of submatrices.
6. The analysis method according to claim 3, characterized in that In step S37, the following steps are specifically included: S371. Select a random unit vector as the initial value of the weight vector and apply the following update rule to the weight vector until convergence. The update rule is as follows: In the above formula, W n+1 represents the weight vector after n+1 iterations, g(·) is a nonlinear function used to capture non-Gaussian, g'(·) is its derivative, and R wi Represents the observation vector of the whitening matrix or the i-th row of the input matrix, w n Represents the row vector of the separation matrix for the nth iteration; S372. Normalize the weight vector of each iteration to generate a separation matrix, and project the whitening matrix or the input matrix onto the independent components through the separation matrix to obtain an absorption spectrum matrix of a single gas composed of the spectral line data after spectral line separation; the absorption spectrum matrix of a single gas is: S=W T R w In the above formula, S is the absorption spectrum matrix of a single gas composed of spectral line data after spectral line separation, W is the final separation matrix obtained after several iterations, and R w Represents the whitening matrix or input matrix.
7. The analysis method according to claim 1, characterized in that In step S4, the following steps are specifically included: S41. Calculate the correlation coefficient between the absorption spectrum of a single gas and the spectra of all gases with absorption peaks in the same wavenumber range in the Hitran database; S42, judging whether the absorption spectrum of the single gas is the gas type corresponding to the gas spectrum in the Hitran database based on whether the correlation coefficient is greater than the correlation coefficient threshold; If so, the absorption spectrum of the gas is the gas type corresponding to the gas spectrum in the Hitran database; If not, return to step S41 and reselect the gas spectrum in the Hitran database; S43. Construct a data set for the EMD-KPCA-LSTM model. The input of the data set is four input features: wave number, absorption coefficient, temperature, and pressure. The output of the data set is three output features: gas concentration, Gaussian linewidth, and Lorentz linewidth. S44. Performing empirical mode decomposition on each input feature in the data set of the EMD-KPCA-LSTM model to obtain a plurality of first feature sequences; S45, reducing the dimension of the first feature sequence by a kernel principal component analysis algorithm to obtain a second feature sequence after dimensionality reduction; S46. Input the second feature sequence into the LSTM model for training and model accuracy evaluation to obtain an EMD-KPCA-LSTM model that meets the accuracy requirements; S47, inputting the wave number, absorption coefficient, temperature, and pressure of the absorption spectrum of a single gas into the EMD-KPCA-LSTM model to obtain output results including gas concentration, Gaussian linewidth, and Lorentzian linewidth; S48. Output analysis results including gas type, gas concentration, Gaussian linewidth and Lorentz linewidth.
8. The analysis method according to claim 7, characterized in that In step S44, the following steps are specifically included: S441, composing the four input features of wave number, absorption coefficient, temperature and pressure into an input data sequence; S442, finding all the maximum points of the input data sequence, and fitting all the maximum points with a cubic spline interpolation function to form an upper envelope of the data; S443, finding all the minimum points of the input data sequence, and fitting all the minimum points through a cubic spline interpolation function to form a lower envelope of the data; S444. Obtain the mean of the upper envelope and the lower envelope to generate a mean sequence; S445. Subtract the mean sequence from the input data sequence to obtain a first sequence; the expression of the first sequence is: h i (t)=X i (t)-m i (t) In the above formula, h i (t) represents the first sequence of the i-th cycle, X i (t) represents the input data sequence of the i-th cycle, m i (t) represents the mean sequence of the i-th cycle; S446. Determine whether there is a negative local maximum or a positive local minimum in the first sequence; If yes, mark the first sequence as the input data sequence and return to step S442; If not, proceed to step S447; S447. Construct a first characteristic sequence based on the first sequence of several cycles; the expression of the first characteristic sequence is: In the above formula, x(t) represents the first characteristic sequence, h i (t) represents the first sequence of the i-th cycle, and the total number of cycles is q, r q (t) represents the residual wave of the qth cycle.
9. The analysis method according to claim 7, characterized in that In step S45, the following steps are specifically included: S451, calculate the kernel matrix of the first characteristic sequence; the expression of the kernel matrix is: In the above formula, K(x i ,x j ) indicates that the two input features are the i-th x in the first feature sequence i and the jth feature x j The kernel matrix when , σ is the parameter that controls the shape of the kernel function; S452. Center the kernel matrix to obtain the third eigenvalue and the corresponding eigenvector; S453. Select the eigenvectors corresponding to the first several largest third eigenvalues as principal components to construct a dimensionality reduction space. The selection of the third eigenvalue is determined by the information ratio of the eigenvector. A threshold is set, and the eigenvectors with information ratio greater than the threshold are selected as principal components. S454: Project the input features of the data set into the dimensionality reduction space to obtain a second feature sequence after dimensionality reduction.
10. The analysis method according to claim 7, characterized in that In step S46, the following steps are specifically included: S461, normalizing the data in the second feature sequence as a data set for the LSTM model, and dividing the data set into a training set and a test set; S462, initializing the parameters of the LSTM model, inputting the training set of the LSTM model into the LSTM model for training until the accuracy of the LSTM model reaches the target accuracy; S463. After the LSTM model training is completed, the test set of the LSTM model is input into the LSTM model for testing, and the root mean square error, mean absolute error and determination coefficient are used to evaluate the model accuracy to obtain an LSTM model that meets the target accuracy.
Citation Information
Patent Citations
Laser gas absorption spectrum analyzing method
CN101706423A
ELM coal gangue rapid identification method based on near infrared spectroscopy and SSA optimization
CN111626224A
Laser spectrum noise reduction method and device based on deep learning optimization S-G filtering
CN111678599A
Cited By
Container fumigation gas concentration detection method and system and infrared sensing device
CN120177405A
A container fumigation gas concentration detection method, system and infrared sensing device
CN120177405B
