Method for training a model for analyzing the content of dimethyl ether and content analysis method based on the same

CN122413357BActive Publication Date: 2026-10-16CHINESE PEOPLES ARMED POLICE FORCE NON-COMMISSIONED OFFICER SCHOOL
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202610893486.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-22
Publication Date
2026-10-16
Estimated Expiration
2046-06-22

AI Technical Summary

Technical Problem

[0005]然而,偏最小二乘回归本质上属于线性建模方法,在处理复杂光谱体系时,难以充分刻画光谱数据中的非线性特征关系,特别是在多组分混合或宽浓度范围条件下,模型对复杂变化的表达能力存在一定局限

Benefits of technology

根据所述下一迭代步的历史光谱数据和下一迭代步的浓度残差再次提取得分向量,直到满足预设迭代次数,将历次迭代步得到的得分向量,通过线性组合构建潜变量数据。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122413357B_ABST
    Figure CN122413357B_ABST
Patent Text Reader

Abstract

The application relates to the field of spectral analysis and chemometrics, and discloses a dimethyl ether content analysis model training method and a content analysis method based on the same, wherein sampling data of diesel oil samples is acquired to construct a spectral training set, wherein the spectral training set comprises historical spectral data and concentration labels; the spectral training set is subjected to a preset double-channel model to acquire latent variable data for representing overall changes of the spectral training set and spectral peak data for representing local changes of the spectral training set, and fusion data is constructed through data fusion; a dimethyl ether content analysis model is trained based on the concentration labels and the fusion data, so that a predicted concentration is output through the trained dimethyl ether content analysis model. The technical scheme provided in the application can extract a fusion structure of global and local features for cooperatively representing spectral data, and improve the prediction capability of the model for a complex sample system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of spectroscopic analysis and chemometrics, and in particular to a training method for a methyl acetal content analysis model and a content analysis method based thereon. Background Technology

[0002] Currently, commonly used methods for detecting adulteration in diesel fuel mainly include gas chromatography, liquid chromatography, and mass spectrometry. These methods identify adulterants by detecting the chemical components in the sample, offering high detection accuracy. However, these methods typically require complex sample pretreatment processes, expensive and time-consuming testing equipment, and demand a high level of expertise from operators. Consequently, they are mostly limited to laboratory testing and cannot meet the needs of rapid and on-site detection.

[0003] In recent years, Raman spectroscopy has been increasingly applied in the field of oil product testing due to its significant advantages, including being non-destructive, rapid, requiring no sample pretreatment, and enabling in-situ detection. Based on the Raman scattering effect, Raman spectroscopy analyzes the inelastic scattering spectrum produced after an incident laser irradiates a sample to obtain information on molecular vibrations and rotations, thereby reflecting the chemical structural characteristics of the molecules. Different chemical substances possess specific Raman characteristic peaks; therefore, Raman spectroscopy can achieve qualitative identification and quantitative analysis of target components in complex mixtures, making it an effective technique for the rapid quantitative detection of diesel adulteration.

[0004] In the field of quantitative spectral analysis, partial least squares regression (PLSR) is a widely used chemometric method. This method extracts the latent variable with the largest covariance to the dependent variable, projects high-dimensional spectral data into a low-dimensional latent variable space, and establishes a linear regression relationship between spectrum and concentration. It effectively solves the problem of high-dimensional collinearity in spectral data and has been widely applied in the quantitative analysis of near-infrared and Raman spectroscopy.

[0005] However, partial least squares regression is essentially a linear modeling method. When dealing with complex spectral systems, it struggles to fully characterize the nonlinear relationships within the spectral data, especially under conditions of multi-component mixing or wide concentration ranges, where the model's ability to express complex variations is limited. Furthermore, related methods are constrained by single feature extraction strategies, making it difficult to simultaneously capture both the global and local trends of spectral data, resulting in insufficient expressive power for complex sample systems.

[0006] Therefore, how to construct a fusion structure that can collaboratively characterize the global and local features of spectral data and improve the model's predictive ability for complex sample systems has become a technical problem that needs to be solved. Summary of the Invention

[0007] This application provides a training method for a methyl acetal content analysis model and a content analysis method based thereon, which solves the problem of how to construct a fusion structure that can collaboratively characterize the global and local features of spectral data, thereby improving the model's predictive ability for complex sample systems.

[0008] To achieve the above objectives, the main technical solutions adopted in this application include: In a first aspect, embodiments of this application provide a method for training a methyl acetal content analysis model, the method comprising: A spectral training set is constructed by acquiring sampling data of diesel samples, wherein the spectral training set includes historical spectral data and concentration labels; The spectral training set is processed through a preset dual-channel model to obtain latent variable data for characterizing the overall changes in the spectral training set and spectral peak data for characterizing the local changes in the spectral training set, and then fused data is constructed through data fusion. A methyl acetal content analysis model is trained based on the concentration labels and the fused data, so as to output the predicted concentration through the trained methyl acetal content analysis model.

[0009] The methylal content analysis model training method provided in this embodiment acquires Raman spectral data of diesel samples and performs standard normal variable transformation preprocessing to eliminate baseline drift and scattering effects. Simultaneously, Gaussian noise enhancement is used to expand the training set size, providing a high-quality spectral training set for subsequent training. The preprocessed spectral training set is input into a dual-channel model. The first channel iteratively extracts latent variable data along the concentration label covariance direction to characterize the global trend. The second channel, after weighted window sliding weighting, batch normalization, and positive excitation filtering, selects peak data by the maximum value of the compression window to retain local significant peak features. The two are linearly concatenated to form fused data that considers both global and local characteristics. The methylal content analysis model is trained based on the fused data and concentration labels. Cosine annealing learning rate scheduling and weight decay regularization are combined to optimize the model, and leave-one-out cross-validation is used to evaluate generalization performance under small sample conditions. This embodiment, with dual-channel multi-scale feature extraction as its core, combined with preprocessing enhancement and rigorous evaluation strategies, achieves high-precision and highly robust quantitative analysis of diesel methylal adulteration concentration.

[0010] In one implementation, obtaining latent variable data and spectral peak data from the spectral training set using a preset dual-channel model includes: The first channel of the dual-channel model extracts the changing trend of the concentration label to obtain a score vector, and constructs latent variable data by linear combination based on the score vector; The second channel of the dual-channel model constructs spectral peak data by weighting and summing along the wavelength variation direction of the historical spectral data through a preset weight window.

[0011] This embodiment iteratively extracts latent variables along the covariance direction of the concentration label using the first channel, capturing the overall spectral change trend highly correlated with the target component concentration and filtering out irrelevant noise and background interference. The second channel extracts the strongest local response through a sliding weighted window, retaining the positions and intensities of significant peaks with discriminative value in the spectrum and suppressing minor fluctuations and weak interference components. This achieves a comprehensive interpretation of the data, avoiding analysis that only considers the overall data while missing key local changes. The fused features formed after linear splicing take into account both the macroscopic evolution of the spectral sequence and the microscopic peak details, providing richer and more robust feature inputs for subsequent predictive analysis, and helping to improve generalization performance and prediction accuracy under small sample conditions.

[0012] In one implementation, the first channel of the dual-channel model extracts the trend of change of the concentration label to obtain a score vector, and constructs latent variable data by linear combination based on the score vector, including: Based on the covariance direction of the historical spectral data of the current iteration step and the concentration label of the current iteration step, determine the potential weights that maximize the correlation between the historical spectral data of the current iteration step and the concentration label of the current iteration step. The potential weights are multiplied by the historical spectral data of the current iteration step to determine the score vector of the current iteration step; The historical spectral data of the previous iteration step is compressed based on the score vector to obtain a spectral load vector, and the concentration label of the current iteration step is compressed based on the score vector to obtain a concentration load vector. Based on the score vector, the spectral loading vector, and the concentration loading vector, the historical spectral data of the current iteration step and the concentration label residual of the current iteration step are reduced to obtain the historical spectral data of the next iteration step and the concentration residual of the next iteration step. Based on the score vector, the spectral loading vector, and the concentration loading vector, the historical spectral data of the current iteration step and the concentration label residual of the current iteration step are reduced to obtain the historical spectral data of the next iteration step and the concentration residual of the next iteration step. Based on the historical spectral data of the next iteration step and the concentration residual of the next iteration step, the score vector is extracted again until the preset number of iterations is met. The score vectors obtained from each iteration step are then used to construct latent variable data through linear combination.

[0013] This embodiment iteratively extracts the projection direction with the largest covariance between historical spectral data and concentration labels to construct a score vector, and successively reduces the spectral residuals to obtain latent variable data, thus achieving an effective representation of the global linear features of the spectrum. The score vector extracted in this embodiment, based on maximizing covariance, can compress data dimensionality while retaining the most relevant information related to the concentration labels and filtering out irrelevant noise and redundancy. The iterative reduction method improves the accuracy and stability of subsequent feature fusion. The final latent variable data, as a compact low-dimensional representation, can be directly used for cross-channel feature fusion.

[0014] In one implementation, the second channel of the dual-channel model is used to construct spectral peak data by weighted summation along the wavelength variation direction of the historical spectral data through a preset weighted window, including: The initial characteristic response is determined by weighted summation along the wavelength variation direction of the historical spectral data through a preset weight window, combined with a nonlinear mapping applied by a bias term. The initial feature response is batch normalized and outlier values ​​are removed to obtain feature data; The feature data is filtered according to a preset compression window and preset selection rules to construct the spectral peak data.

[0015] This embodiment obtains feature data by sliding a weighted window along the wavelength direction of historical spectral data, followed by batch normalization and outlier removal. The maximum value of the compressed window is then used to select the feature data to construct spectral peak data. This embodiment utilizes the significant peak shape features in historical spectral data through a sliding window method, and a screening mechanism suppresses noise and irrelevant background components. The selection of the maximum value of the compressed window effectively reduces the feature dimensionality while preserving the position and intensity of key peaks, forming a compact and highly discriminative spectral peak representation, providing high-quality input for subsequent modeling.

[0016] In one implementation, the step of filtering the feature data according to a preset compression window and a preset selection rule to construct the spectral peak data includes: Slide the compression window over the feature data and select the maximum value of the feature data within the compression window as the retained data. The spectral peak data is constructed based on the multiple retained data obtained.

[0017] This embodiment employs a step-by-step sliding compression of the feature data along the window edge, retaining only the maximum value within each window and discarding the rest. The retained values ​​from each window are then sequentially stitched together to form spectral peak data. This embodiment significantly reduces the feature dimension using a local maximum compression method, effectively filtering out minor fluctuations and noise interference while fully preserving the positions and intensities of significant peaks in the spectral response, resulting in more compact and discriminative spectral peak data.

[0018] In one implementation, the step of constructing fused feature data through data fusion includes: The latent variable data and the spectral peak data are linearly spliced ​​to construct fused feature data.

[0019] This embodiment constructs fused feature data through data fusion, which integrates the global change trend and local change details of historical spectral data, realizes the complementary expression of multi-scale features, and provides more discriminative joint feature input for subsequent training output of predicted concentration.

[0020] Secondly, embodiments of this application provide a method for analyzing the content of methylal, the method comprising: Obtain real-time spectral data of diesel samples; The real-time spectral data is input into the methyl acetal content analysis model obtained by any of the training methods described above to obtain the predicted concentration.

[0021] Thirdly, embodiments of this application provide a training device for a methylal content analysis model, the device comprising: The data acquisition unit is used to acquire sampling data of diesel samples to construct a spectral training set, wherein the spectral training set includes historical spectral data and concentration labels; The data processing unit is used to obtain latent variable data for characterizing the overall changes of the spectral training set and spectral peak data for characterizing the local changes of the spectral training set through a preset dual-channel model, and to construct fused data through data fusion. The model training unit is used to train a methylal content analysis model based on the concentration labels and the fused data, so as to output the predicted concentration through the trained methylal content analysis model.

[0022] Fourthly, embodiments of this application provide a computer device, including: The system includes a memory and a processor, which are interconnected. The memory stores computer instructions, and the processor executes the computer instructions to perform any of the above-described methods for training the methyl acetal content analysis model or the analysis method.

[0023] Fifthly, embodiments of this application provide a computer-readable storage medium storing computer instructions, which are used to cause a computer to execute the methyl acetal content analysis model training method or the analysis method described above. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0025] Figure 1 A flowchart illustrating a method for training a methylal content analysis model, as provided in this application embodiment; Figure 2 A flowchart of step S31 provided in an embodiment of this application; Figure 3 A flowchart of step S311 provided in an embodiment of this application; Figure 4 A flowchart of step S331 provided in an embodiment of this application; Figure 5 This is a schematic diagram of a training device for a methyl acetal content analysis model provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0027] Diesel fuel is an important petroleum fuel widely used in transportation, agricultural machinery, construction machinery, and industrial production. The quality of diesel fuel directly affects engine combustion efficiency, operational stability, and equipment lifespan. With the continuous growth in diesel market demand, some unscrupulous operators, in order to reduce costs and gain illegal profits, are adulterating diesel fuel with cheap chemical substances, leading to a growing problem of diesel adulteration and seriously disrupting the fuel market order.

[0028] Dimethoxymethane (DMM) is a common adulterant of diesel fuel. DMM has a high oxygen content and good solubility, and is relatively cheap, so it is often mixed into diesel fuel by unscrupulous operators to reduce fuel costs. However, after DMM is mixed in, the viscosity, flash point, lubricity and other physical and chemical properties of the diesel fuel will change significantly, leading to a decrease in engine combustion efficiency, corrosion of the fuel injection system and damage to the seals, and possibly increasing the emission of harmful pollutants in the exhaust. Therefore, accurately determining the amount of DMM mixed in diesel fuel is of great significance for maintaining order in the fuel market, ensuring the safe operation of equipment, and protecting the environment.

[0029] In recent years, Raman spectroscopy has gradually been applied in the field of oil detection due to its advantages of non-destructive, rapid, no sample pretreatment, and in-situ detection. Raman spectroscopy is based on the Raman scattering effect, which analyzes the non-elastic scattering spectrum of the incident laser irradiated sample to obtain the vibration and rotation information of the molecule, thereby reflecting the chemical structure characteristics of the molecule. Different chemical substances have specific Raman characteristic peaks, so Raman spectroscopy technology can realize the qualitative identification and quantitative analysis of target components in complex mixed systems, and is an effective technical means for rapid quantitative detection of diesel fuel adulteration.

[0030] In the field of spectral quantitative analysis, Partial Least Squares Regression (PLSR) is a widely used chemometric method. This method extracts latent variables with the largest covariance with the dependent variable, projects high-dimensional spectral data into low-dimensional latent variable space, establishes a linear regression relationship between the spectrum and the concentration, effectively solving the high-dimensional collinearity problem of spectral data, and has been widely used in near-infrared spectroscopy and Raman spectroscopy quantitative analysis.

[0031] However, partial least squares regression is essentially a linear modeling method, and when dealing with complex spectral systems, it is difficult to fully characterize the nonlinear characteristic relationship in the spectral data, especially under the conditions of multi-component mixing or wide concentration range, the model has certain limitations in expressing complex changes. At the same time, the method is limited by a single feature extraction strategy, and it is difficult to capture both the global trend and the local trend of spectral data, resulting in insufficient expression of complex sample systems.

[0032] In summary, how to construct a fusion structure that can cooperatively represent the global and local features of spectral data and improve the expression ability of the model for complex sample systems is a technical problem that needs to be solved.

[0033] To solve the above technical problems, according to the embodiment of the present application, a method for training a methylal content analysis model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from here.

[0034] In the present embodiment, a method for training a methylal content analysis model is provided, Figure 1 The flowchart of the method for training a methylal content analysis model provided in the present application is shown in Figure 1 , which includes the following steps: Step S1, acquiring the sampling data of the diesel sample to construct a spectrum training set, wherein the spectrum training set includes historical spectrum data and concentration labels.

[0035] Specifically, Raman spectrum data collection is performed on diesel samples with different methylal adulteration concentrations. The concentration range is 0% to 10%, and multiple concentration gradients (such as 21 concentration points) are set in this range, and at least 2 to 3 repeated spectrum sampling samples are collected at each concentration point to ensure the stability and reliability of the data. Let the total number of spectrum sampling samples finally obtained be . The spectrum collection parameters are set as follows: the wave number range is about to , the number of sampling points (wave number points) is (e.g. 512 or 1024 wave number points), and the laser power, integration time and collection mode are set according to the instrument performance. The th spectrum sampling sample is represented as , wherein represents the spectrum intensity of the th sample at the th wave number point (maximum available ). The corresponding methylal concentration is denoted as . All sampling samples are constructed as historical spectrum data ( rows columns) and concentration labels (m-dimensional column vector).

[0036] In the historical spectrum data preprocessing stage, the historical spectrum data will be affected by factors such as instrument noise, baseline drift and sample scattering differences during the collection process, so the historical spectrum data needs to be preprocessed before being constructed. The method for preprocessing the spectrum intensity in each sample adopted in the present embodiment is represented as follows: wherein, , . is the mean of the first spectral sampling sample, is the variance of the spectral sampling sample, is the spectral intensity of the first sample in the first wavenumber point in the first sample in the spectral sampling sample. represents each data in the preprocessed spectral sampling sample.

[0037] The historical spectral data of each sample is standardized, so that the mean is normalized to 0 and the standard deviation is normalized to 1, thereby effectively eliminating baseline drift and multiplicative scattering effects and improving the comparability between different samples.

[0038] In addition, the embodiment can use a smaller total amount of samples (about 30) for training. In order to avoid fitting risk in subsequent training, the spectral data is subjected to data enhancement processing before training. The specific method is: a Gaussian random noise with a mean of 0 and a preset standard deviation is superimposed on each training spectral data, a plurality of expanded samples are generated according to a set expansion multiple, and the expanded historical spectral data is combined with the original historical spectral data for subsequent methylal content analysis model training. In the embodiment, the noise standard deviation is pre-set to 0.005, and the expansion multiple is set to 5, that is, 5 noise samples are generated for each historical spectral data, and the training set size is increased to 6 times the original. Data enhancement is only applied to the training set, and the test set remains unchanged to ensure the reliability of the evaluation results.

[0039] Step S3, passing the spectral training set through a preset double-channel model to obtain latent variable data for representing the overall change of the spectral training set and spectral peak data for representing the local change of the spectral training set, and constructing fusion data through data fusion.

[0040] Specifically, through double-channel parallel processing, latent variable data and spectral peak data are constructed respectively. The first channel iteratively extracts score vectors along the covariance direction of the concentration label and linearly combines them to obtain latent variable data reflecting the global trend of the spectrum. The second channel extracts the initial response by sliding weighted with a weight window, and after batch normalization and outlier rejection, the spectral peak data retaining significant peak characteristics are constructed by selecting the maximum value of the compression window. Finally, the two are spliced to form fusion features, which take into account both global change trends and local spectral peak details.

[0041] Step S5, training a methylal content analysis model based on the concentration label and the fusion data, so as to output a predicted concentration through the trained methylal content analysis model.

[0042] Specifically, based on concentration labels and fused data, a fully connected neural network is used as the regression function to perform a nonlinear mapping on the fused features, outputting the predicted concentration ŷ, i.e. ,in This represents a nonlinear mapping function. During the training of the methyl acetal content analysis model, the mean squared error is used as the loss function to calculate the mean of the squared errors between the predicted concentration and the concentration label (true concentration) of all fused data. Its representation is as follows: Wherein, the loss function is , This refers to the total number of spectral samples mentioned earlier. For the first The predicted concentration corresponding to the spectral sample. For the first Concentration labels corresponding to spectral sampling samples.

[0043] The parameters of the convolutional neural network and the regression model are jointly optimized using the backpropagation algorithm. The Adam optimization algorithm is adopted, and the initial learning rate is set to... Furthermore, a cosine annealing learning rate scheduling strategy is employed to smoothly decrease the learning rate from its initial value to near zero during training, which helps the methyl acetal content analysis model converge to a better solution. Simultaneously, L2 weight decay is introduced into the Adam optimizer to achieve parameter regularization, with the weight decay coefficient set to... This further suppresses overfitting. The number of training epochs is set to 300, and the batch size is set to 8.

[0044] To address the limited sample data in this embodiment, leave-one-out cross-validation is used to evaluate the generalization performance of the fusion model. The specific process is as follows: each time, from all... One sample from each spectral sample is taken as the test set for the spectral training set, and the rest... Using a sample as the model training set for the spectral training set, data augmentation is performed on the model training set to train the methyl acetal content analysis model, and predictions are made for the test samples. This process is repeated iteratively. The prediction process continues until each sample is predicted once. The root mean square error and coefficient of determination are calculated using the prediction results for all samples as evaluation metrics for the methylal content analysis model. Compared to K-fold cross-validation, leave-one-out cross-validation maximizes the use of limited samples for training, and the resulting evaluation results more accurately reflect the model's actual predictive ability under small sample conditions.

[0045] The methanol content analysis model training method provided by the embodiment collects Raman spectrum data of diesel samples and performs standard normal variable transformation preprocessing to eliminate baseline drift and scattering effects, and at the same time, the training set scale is expanded by Gaussian noise enhancement to provide a high-quality spectrum training set for subsequent training. The preprocessed spectrum training set is input into a double-channel model, the first channel iteratively extracts latent variable data along the concentration label covariance direction to represent the global trend, and the second channel is weighted and summed along the wavelength variation direction of the historical spectrum data through a preset weight window to construct spectral peak data.

[0046] Figure 2 The flowchart for obtaining latent variable data and spectral peak data of the spectrum training set provided by the embodiment through the preset double-channel model can include the following steps: Step S31, the first channel of the double-channel model obtains a score vector by extracting the change trend of the concentration label, and constructs latent variable data by linear combination according to the score vector.

[0047] Specifically, the direction with the maximum covariance with the concentration label in the spectrum data is extracted by iteration: first, the latent weight is calculated and the score vector is obtained by projection to capture the most relevant comprehensive features with the concentration; then, the current spectrum and the concentration label are reduced by using the score vector and the concentration load vector, and the updated data is entered into the next iteration. A plurality of score vectors are extracted in turn, and finally combined into latent variables to represent the global linear features and overall change trend of the historical spectrum data.

[0048] Step S33, the second channel of the double-channel model constructs spectral peak data by weighting and summing along the wavelength variation direction of the historical spectrum data through a preset weight window.

[0049] Specifically, by sliding the weight window along the wavelength direction, the data in the window is weighted and summed and biased, and then standardized features are obtained through nonlinear mapping and batch normalization; then, the feature data is obtained by data rejection. Then, a fixed compression window is slid on the feature data to extract the strongest response of each window, and the spectral peak data is combined in order to retain the significant peak position and intensity while reducing the dimension and suppressing secondary fluctuations, forming a more discriminative compact representation.

[0050] The embodiment extracts the latent variable along the covariance direction of the concentration label of the first channel by iteration, captures the overall spectral change trend highly related to the concentration of the target component, and filters out irrelevant noise and background interference; the second channel extracts the local strongest response by sliding the weight window, retains the significant peak position and intensity in the spectrum with discriminative significance, and suppresses the secondary fluctuation and weak interference component. The comprehensive interpretation of the data is realized, and the lack of local key changes in the overall analysis of the data is avoided. The fusion feature formed after linear splicing takes into account the macro evolution law and micro spectral peak details of the spectral sequence, provides richer and more robust feature input for subsequent prediction analysis, and helps to improve the generalization performance and prediction accuracy under the condition of small sample.

[0051] Figure 3 A flowchart of step S311 provided by the embodiment of the present application can include the following steps: Step S311, determining the latent weight that makes the correlation between the historical spectral data of the current iteration step and the concentration label maximum according to the covariance direction of the concentration label of the current iteration step and the historical spectral data of the current iteration step.

[0052] Specifically, in the calculation of the first latent weight, the current iteration step is 1, the historical spectral data of the current iteration step is X1, and the concentration label of the current iteration step is y1. The calculation of the first latent weight is as follows: The calculation of the first latent weight is as follows: The calculation of the first latent weight is as follows: The calculation of the first latent weight is as follows: The calculation of the first latent weight is as follows: The calculation of the first latent weight is as follows: The calculation of the first latent weight is as follows: The calculation of the first latent weight is as follows: The calculation of the first latent weight is as follows: The calculation of the first latent weight is as follows: The calculation of the first latent weight is as follows: Wherein, ||X1|| represents the norm (Euclidean norm) of X1, that is, the projection that makes the correlation between the historical spectral data of the current iteration step and the concentration label maximum. Step S313, multiplying the latent weight and the historical spectral data of the current iteration step to determine the score vector of the current iteration step.

[0053] Specifically, according to the obtained first latent weight vector w1 and the historical spectral data X1 of the current iteration step, the multiplication operation is performed to obtain the first score vector s1, and the expression form is as follows:

[0054] Specifically, according to the obtained first latent weight vector w1 and the historical spectral data X1 of the current iteration step, the multiplication operation is performed to obtain the first score vector s1, and the expression form is as follows: ​​​​ Score Vector This represents the projection of historical spectral data onto the weight direction in the current iteration step, reflecting the comprehensive feature with the strongest correlation between historical spectral data and concentration labels.

[0055] Step S315: Compress the historical spectral data of the previous iteration step according to the score vector to obtain the spectral load vector, and compress the concentration label of the current iteration step according to the score vector to obtain the concentration load vector.

[0056] Specifically, using the first score vectors For the first Historical spectral data after the next iteration Perform projection and calculate the spectral load vector. Its representation is as follows: Specifically, using the first score vectors For the first Transpose of the concentration label after the next iteration Perform calculations to determine the concentration loading vector. Its representation is as follows: Wherein, the spectral loading vector Characterization score vector Interpretive power of historical spectral data, concentration loading vector Characterization score vector The ability to interpret concentration labels.

[0057] Step S317: Based on the score vector, spectral loading vector, and concentration loading vector, reduce the historical spectral data and concentration label residual of the current iteration step to obtain the historical spectral data and concentration residual of the next iteration step.

[0058] Specifically, using the score vector and spectral load vector Historical spectral data for the current iteration step The data is reduced to obtain the historical spectral data for the next iteration. Its representation is as follows: At the same time, using the score vector and concentration loading vector Concentration label residual for the current iteration step Reduce the concentration to obtain the concentration residual for the next iteration. Its representation is as follows: This process removes the part explained by the first latent variable from the current historical spectral data, leaving the remaining historical spectral data for extracting the next latent variable.

[0059] Step S319, the score vector is extracted again according to the historical spectral data of the next iteration step and the concentration residual of the next iteration step, until the preset number of iterations is met, and the score vectors obtained in each iteration step are combined by linear combination to construct the latent variable data.

[0060] Specifically, with the updated historical spectral data and the concentration label as new inputs, the above steps are repeatedly executed to extract the latent weight , the score vector and the concentration load vector of each iteration step in turn until H score vectors are extracted. All score vectors obtained in each iteration step are combined to form the latent variable data , which is used to represent the global linear features and overall change trend of the historical spectral data, as subsequent feature fusion.

[0061] The embodiment extracts the projection direction with the maximum covariance between the historical spectral data and the concentration label by iteration, constructs the score vector, and gradually reduces the spectral residual to obtain the latent variable data, thereby effectively representing the global linear features of the spectrum. The score vector extracted by the embodiment according to the criterion of maximizing the covariance can retain the effective information related to the concentration label to the greatest extent while compressing the data dimension, and filter out irrelevant noise and redundancy; the iterative manner of gradually reducing improves the accuracy and stability of subsequent feature fusion; and the finally constructed latent variable data can be directly used for cross-channel feature fusion as a compact low-dimensional representation.

[0062] Figure 4 A flowchart of step S331 provided by the embodiment of the present application can include the following steps: Step S331, weighted summation is performed along the wavelength variation direction of the historical spectral data through a preset weight window, and a nonlinear mapping is applied in combination with a bias term to determine an initial feature response.

[0063] Specifically, the weight window is set, and each layer of the weight window contains K weight coefficients, so that the weight window of the i-th layer can be expressed as: ( ), wherein ​For the number of channels, take the first layer as an example, the output channel number C = 32, each channel corresponds to the value of the initial feature response extracted by the weight window. The weight window is slid along the wavelength variation direction of the historical spectral data, and at each position, the sum of the product of each data point of the historical spectral data in the window and the corresponding weight coefficient is calculated, and a bias term b is added, and then the sum is passed through a nonlinear activation function Mapping is performed, which is represented as: is the initial feature response of the historical spectral data under the weight window. Wherein, represents each data point of the historical spectral data currently covered by the weight window.

[0064] Step S333, the initial feature response is obtained by batch normalization and abnormal value rejection to obtain the feature data.

[0065] Specifically, the initial feature response is first normalized to a distribution with a mean of 0 and a variance of 1 in each channel to accelerate subsequent training and improve stability. When processing the normalized initial feature response, the prediction rejection window is used. When the rejection window is slid on the normalized initial feature response, the response value generated at each position reflects the matching relationship between the normalized initial feature response and the weight pattern in the rejection window. If the response value is greater than zero, it indicates that the input content is positively correlated with the weight pattern in the rejection window, which is valid excitation, and is identified as positive excitation and retained; if the response value is less than or equal to zero, it indicates that the input content is negatively correlated with the weight pattern or irrelevant, which is usually derived from noise fluctuations or background components irrelevant to the target feature, and is identified as negative response and suppressed. Through this screening process, only the response part with positive excitation is retained to obtain the feature data, which eliminates the distribution shift of the values and filters out part of the noise.

[0066] Step S335, according to the preset compression window, the feature data is filtered according to the preset selection rule to construct the spectral peak data.

[0067] Specifically, a compression window (such as a pooling window) of a preset size is defined, and is slid along the wavelength direction of the feature data at a fixed step. At each sliding position, a most representative value is selected from the feature data segment covered by the compression window according to the preset selection rule (such as the maximum value selection rule). The values selected by all windows are arranged in spatial order to construct the spectral peak data. This embodiment extracts the locally strongest response through the compression window, which not only retains the significant peak position and intensity in the spectrum, but also reduces the feature dimension and suppresses the secondary fluctuations, forming a more discriminative compact representation.

[0068] This embodiment obtains feature data by sliding a weighted window along the wavelength direction of historical spectral data, followed by batch normalization and outlier removal. The maximum value of the compressed window is then used to select the feature data to construct spectral peak data. This embodiment utilizes the significant peak shape features in historical spectral data through a sliding window method, and a screening mechanism suppresses noise and irrelevant background components. The selection of the maximum value of the compressed window effectively reduces the feature dimensionality while preserving the position and intensity of key peaks, forming a compact and highly discriminative spectral peak representation, providing high-quality input for subsequent modeling.

[0069] In an optional implementation, feature data is filtered according to a preset compression window and preset selection rules to construct spectral peak data, including...

[0070] Slide the compression window across the feature data and select the maximum value of the feature data within the compression window as the retained data.

[0071] Based on the multiple retained data obtained, spectral peak data are constructed.

[0072] Specifically, define a one-dimensional compression window of a fixed size (e.g. The window slides gradually along the sequence direction of the feature data with a preset step size. At each sliding position (e.g., sliding sequence 1, 5, 9), all feature data points within the coverage area of ​​the compression window are extracted (e.g., when sliding to sequence 1, extract rows 1, 2, 3, 4, and columns 1, 2, 3, 4). The feature data points within the window are compared and the maximum value is selected as the retained data at that location by the compression window, while the remaining data points within the window are discarded. After the compression window traverses all feature data, the retained data generated at each window location are sequentially spliced ​​in sliding order to form spectral peak data. This spectral peak data compresses the dimensionality of the original feature data in the form of local maxima, effectively preserving the positions and intensities of significant peaks in the spectral response while filtering out minor fluctuations and noise interference.

[0073] This embodiment employs a step-by-step sliding compression of the feature data along the window edge, retaining only the maximum value within each window and discarding the rest. The retained values ​​from each window are then sequentially stitched together to form spectral peak data. This embodiment significantly reduces the feature dimension using a local maximum compression method, effectively filtering out minor fluctuations and noise interference while fully preserving the positions and intensities of significant peaks in the spectral response, resulting in more compact and discriminative spectral peak data.

[0074] In an optional implementation, fused feature data is constructed through data fusion, including: Latent variable data and spectral peak data are linearly spliced ​​to construct fused feature data.

[0075] Specifically, the latent variable data extracted from the first channel Spectrum peak data extracted by the second channel Linear splicing is performed. Among them, the latent variable data is a dimension vector, reflecting the global linear characteristics and overall change trend of the spectrum data; the spectrum peak data is a vector that retains the local discriminant information and local changes of the significant peak position and intensity in the historical spectrum data. The two are connected head to tail along the feature dimension to construct the fusion feature data, and its representation form is: The fusion feature data integrates the global trend information and local spectrum peak details of the historical spectrum data, realizes the complementary expression of multi-scale features, and provides more discriminative joint feature input for subsequent training and output of predicted concentration.

[0076] In this embodiment, the fusion feature data is constructed by data fusion, so that the fusion feature integrates the global change trend and local change details of the historical spectrum data, realizes the complementary expression of multi-scale features, and provides more discriminative joint feature input for subsequent training and output of predicted concentration.

[0077] In an optional embodiment, real-time spectrum data of the diesel sample is obtained.

[0078] The real-time spectrum data is input into the methylal content analysis model of diesel obtained by the S1 to S5 training method to obtain the predicted concentration.

[0079] Correspondingly, please refer to Figure 5 a block diagram of a methylal content analysis model training device provided by the embodiment of the present application, which comprises: A data acquisition unit 101 is configured to obtain sampling data of a diesel sample to construct a spectrum training set, wherein the spectrum training set comprises historical spectrum data and concentration labels.

[0080] A data processing unit 103 is configured to obtain latent variable data for representing overall changes of the spectrum training set and spectrum peak data for representing local changes of the spectrum training set by a preset double-channel model, and construct fusion data by data fusion.

[0081] A model training unit 105 is configured to train a methylal content analysis model based on the concentration labels and the fusion data, so as to output a predicted concentration by the trained methylal content analysis model.

[0082] In some optional embodiments, the data processing unit 103 comprises: The first channel of the double-channel model obtains a score vector by extracting the change trend of the concentration labels, and constructs the latent variable data by linear combination according to the score vector.

[0083] The second channel of the double-channel model is weighted and summed along the wavelength variation direction of the historical spectral data through a preset weight window to construct spectral peak data.

[0084] In some optional embodiments, the data processing unit 103 comprises: According to the covariance direction of the historical spectral data of the current iteration step and the concentration label, a potential weight is determined to maximize the correlation between the historical spectral data of the current iteration step and the concentration label.

[0085] The potential weight is multiplied by the historical spectral data of the current iteration step to determine a score vector of the current iteration step.

[0086] According to the score vector, the concentration label is compressed to obtain a concentration load vector.

[0087] According to the score vector and the concentration load vector, the historical spectral data of the previous iteration step is reduced to obtain the historical spectral data of the next iteration step.

[0088] The score vector is obtained again according to the historical spectral data of the next iteration step, until a preset number of iterations is met, and the score vectors obtained in each iteration step are combined linearly to construct latent variable data.

[0089] In some optional embodiments, the data processing unit 103 comprises: The initial feature response is determined by weighted summation along the wavelength variation direction of the historical spectral data through a preset weight window, and combined with a bias term to apply a nonlinear mapping.

[0090] The initial feature response is obtained by batch normalization and outlier removal to obtain feature data.

[0091] According to a preset compression window, the feature data is filtered through a preset selection rule to construct the spectral peak data.

[0092] In some optional embodiments, the data processing unit 103 comprises: The compression window is slid on the feature data, and the maximum value of the feature data in the compression window is selected as reserved data.

[0093] According to the obtained multiple reserved data, the spectral peak data is constructed.

[0094] In some optional embodiments, the data processing unit 103 comprises: The latent variable data and the spectral peak data are linearly spliced to construct fusion feature data.

[0095] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0096] In this embodiment, the methyl acetal content analysis model training device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0097] Please see Figure 6 , Figure 6 This application provides a schematic diagram of the structure of a computer device, as shown in the embodiment of the present application. Figure 6 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 6 Take a processor 10 as an example.

[0098] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0099] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.

[0100] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system, application programs, etc. required by at least one function. The data storage area can store data created by the computer device, etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-transitory memory such as at least one disk memory device, a flash memory device, or other non-transitory solid state memory device. In some alternative embodiments, the memory 20 can optionally include memory that is remotely located with respect to the processor 10, and which can be connected to the computer device through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communications network, and combinations thereof.

[0101] The memory 20 can include a volatile memory, such as a random access memory. The memory can also include a non-volatile memory, such as a flash memory, a hard disk or a solid state disk. The memory 20 can also include a combination of the above-mentioned kinds of memory.

[0102] The computer device also includes a communication interface 30 for the computer device to communicate with other devices or communication networks.

[0103] The embodiments of the present application also provide a computer readable storage medium. The above-mentioned method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or implemented as computer code stored in a remote storage medium or non-transitory machine readable storage medium and stored in a local storage medium to be downloaded through a network, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor or programmable or special purpose hardware. The storage medium can be a disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk or a solid state disk, etc. Further, the storage medium can also include a combination of the above-mentioned kinds of memory. It can be understood that the computer, processor, microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code, which, when accessed and executed by the computer, processor or hardware, implements the method shown in the above embodiments.

[0104] The apparatuses and units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0105] For the convenience of description, the above apparatus is described in various units by function for separate description. Of course, the functions of the units can be implemented in one or more software and / or hardware in implementing the present application.

[0106] Those skilled in the art will understand that the embodiments of the present application can be provided as methods, apparatuses. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.

[0107] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices, and apparatuses according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus generate an apparatus for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one flow or multiple flows and / or blocks Figure 1 an apparatus that performs the functions specified in the flowcharts and / or block diagrams.

[0108] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction apparatus, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 one flow or multiple flows and / or blocks Figure 1 an apparatus that performs the functions specified in the flowcharts and / or block diagrams.

[0109] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable data processing apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable data processing apparatus provide a process for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one flow or multiple flows and / or blocks Figure 1 an apparatus that performs the functions specified in the flowcharts and / or block diagrams.

[0110] It should also be noted that the terms "comprises" "comprising", or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without further constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0111] Various embodiments are described herein with reference to the drawings. The same or like elements in the drawings are denoted by the same reference numerals, and a repeated description is omitted. Each of the various embodiments is described in a progressive manner, and the same or similar parts between the various embodiments can be mutually referred to. Each of the various embodiments focuses on a difference from other embodiments. In particular, the device embodiments are described simply because they are substantially similar to the method embodiments, and the relevant parts can be referred to the description of the method embodiments.

[0112] The above only describes the embodiments of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.

[0113] Although the embodiments of the present application are described with reference to the drawings, those skilled in the art can make various modifications and changes without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the appended claims.

Claims

1. A training method for a methyl acetal content analysis model, characterized in that, include: A spectral training set is constructed by acquiring sampling data of diesel samples, wherein the spectral training set includes historical spectral data and concentration labels; The spectral training set is processed through a preset dual-channel model to obtain latent variable data characterizing the overall changes in the spectral training set and spectral peak data characterizing the local changes in the spectral training set, and fused feature data is constructed through data fusion; wherein, obtaining latent variable data and spectral peak data from the spectral training set through the preset dual-channel model includes: determining the latent weights that maximize the correlation between the historical spectral data and the concentration label of the current iteration step based on the covariance direction of the historical spectral data and the concentration label of the current iteration step; multiplying the latent weights and the historical spectral data of the current iteration step to determine the score vector of the current iteration step; compressing the historical spectral data of the current iteration step according to the score vector to obtain the spectral loading vector, and compressing the concentration label of the current iteration step according to the score vector to obtain the concentration loading vector; and compressing the historical spectral data of the current iteration step according to the score vector to obtain the concentration loading vector; and so on. The vector, the spectral loading vector, and the concentration loading vector are used to reduce the historical spectral data and the concentration label residual of the current iteration step to obtain the historical spectral data and the concentration residual of the next iteration step. A score vector is extracted again based on the historical spectral data and the concentration residual of the next iteration step until a preset number of iterations is met. The score vectors obtained from each iteration step are used to construct latent variable data through linear combination. A weighted sum is performed along the wavelength variation direction of the historical spectral data using a preset weighted window, and a nonlinear mapping is applied in conjunction with a bias term to determine the initial feature response. The initial feature response is then batch normalized and outlier values ​​are removed to obtain feature data. The compression window is slid across the feature data, and the maximum value of the feature data within the compression window is selected as the retained data. The spectral peak data is constructed based on the multiple retained data. A methylal content analysis model is trained based on the concentration label and the fused feature data, so as to output the predicted concentration through the trained methylal content analysis model.

2. The method according to claim 1, characterized in that, The construction of fused feature data through data fusion includes: The latent variable data and the spectral peak data are linearly spliced ​​to construct fused feature data.

3. A method for analyzing the content of methyl acetal, characterized in that, The analytical method includes: Obtain real-time spectral data of diesel samples; The real-time spectral data is input into the methyl acetal content analysis model obtained by the training method described in any one of claims 1-2 to obtain the predicted concentration.

4. An apparatus for implementing the training method for the methylal content analysis model according to any one of claims 1-2, characterized in that, The device includes: The data acquisition unit is used to acquire sampling data of diesel samples to construct a spectral training set, wherein the spectral training set includes historical spectral data and concentration labels; The data processing unit is used to obtain latent variable data for characterizing the overall changes of the spectral training set and spectral peak data for characterizing the local changes of the spectral training set through a preset dual-channel model, and to construct fused feature data through data fusion. The model training unit is used to train a methylal content analysis model based on the concentration label and the fused feature data, so as to output the predicted concentration through the trained methylal content analysis model.

5. A computer device, characterized in that, include: The system includes a memory and a processor, which are interconnected. The memory stores computer instructions, and the processor executes the computer instructions to perform the training method for the methyl acetal content analysis model according to any one of claims 1 to 2 or the analysis method according to claim 3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the methyl acetal content analysis model training method according to any one of claims 1 to 2 or the analysis method according to claim 3.

Citation Information

Patent Citations

  • Universality and stability verification method for model specific to frying oil polar component detection

    CN110672578A

  • Oil spectrum analysis method based on CNN and Transform parallel double-branch model

    CN121431481A

  • Diesel oil Raman spectrum detection method, device and equipment based on convolutional neural network

    CN121830628A