Real-time local modeling method and device and storage medium

By receiving and preprocessing infrared spectra, screening and analyzing similar spectra for modeling, it solves the problem of low model prediction accuracy of traditional near-infrared analysis instruments when sample temperature changes and type differences are large, and achieves improved model prediction. accuracy effects.

CN118553335AInactive Publication Date: 2024-08-27INTELLIGENT ANALYSIS SERVICE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410605361.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-16
Publication Date
2024-08-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional near-infrared analysis instruments are difficult to establish accurate models when processing samples with wide temperature changes and large differences in types, resulting in nonlinear spectral effects and low model prediction accuracy.

Method used

By receiving infrared spectra sent by at least two infrared spectrometers, performing comparison and preprocessing, screening out similar spectra for principal component analysis, obtaining a reference spectrum, and modeling based on the reference spectrum to predict the physical and chemical indicators of the target spectrum.

Benefits of technology

It improves the prediction accuracy of the model, reduces the risk of excess similar samples participating in the modeling, and enhances the stability and prediction accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000
    Figure 00000000_0000
Patent Text Reader

Abstract

The invention discloses a real-time local modeling method and device and a storage medium, and relates to the technical field of infrared measurement, and the method comprises the steps: receiving infrared spectrums transmitted by at least two infrared spectrometers; the received at least two infrared spectrums are compared with the sample infrared spectrum, n similar spectrums are obtained through screening, and n is an integer larger than 2; performing principal component analysis on the n spectrums to obtain a reference spectrum with reference significance; modeling according to the reference spectrum to obtain a target model; the target model is used for predicting the target spectrum to obtain predicted physicochemical indexes. The problem of low prediction accuracy of the model obtained by modeling in the prior art is solved, and the effect of improving the prediction accuracy of the model is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a real-time local modeling method, device and storage medium, and belongs to the technical field of infrared measurement. Background Art

[0002] Traditional near-infrared analysis instruments usually use several source machines to collect sample spectra of different contents, sizes, and temperatures to form a mixed calibration set, establish an adaptable and robust mixed calibration model, and then use the model in each instrument.

[0003] However, in actual operation, the temperature variation range of the sample is wide, the types of samples vary greatly, and the impact on the spectrum is a nonlinear response. It is difficult to establish a model with high accuracy using the above method. Summary of the invention

[0004] The object of the present invention is to provide a real-time local modeling method, device and storage medium to solve the problems existing in the prior art.

[0005] In order to achieve the above object, the present invention provides the following technical solutions:

[0006] According to a first aspect, an embodiment of the present invention provides a real-time local modeling method, the method comprising:

[0007] receiving infrared spectra sent by at least two infrared spectrometers;

[0008] Compare the at least two received infrared spectra with the sample infrared spectrum, and screen out n similar spectra, where n is an integer greater than 2;

[0009] Performing principal component analysis on the n spectra to obtain a reference spectrum with reference significance;

[0010] Modeling is performed based on the reference spectrum to obtain a target model; the target model is used to predict the target spectrum to obtain predicted physical and chemical indicators.

[0011] Optionally, the comparing the received at least two infrared spectra with the sample infrared spectrum to screen out n similar spectra includes:

[0012] Preprocessing the at least two infrared spectra;

[0013] Compare at least two preprocessed infrared spectra with the sample infrared spectrum to obtain the Euclidean distance;

[0014] According to the calculated Euclidean distances, n spectra with similar Euclidean distances are determined as the n spectra.

[0015] Optionally, the preprocessing of the at least two infrared spectra includes:

[0016] De-noising the at least two infrared spectra according to the signal-to-noise ratio;

[0017] and / or,

[0018] The at least two infrared spectra are normalized.

[0019] Optionally, performing principal component analysis on the n spectra to obtain a reference spectrum with reference significance includes:

[0020] Perform principal component analysis on the n spectra to obtain corresponding scores;

[0021] The reference spectrum is obtained by screening according to the scores of the n spectra.

[0022] Optionally, the screening and obtaining the reference spectrum according to the scores of the n spectra includes:

[0023] According to the scores of the n spectra, a score matrix ranked in the top i is obtained, where i is a positive integer;

[0024] Calculate the average score value of the score matrix;

[0025] The reference spectrum is screened according to the scores of the n spectra and the average score value.

[0026] Optionally, screening the reference spectrum according to the scores of the n spectra and the average score value includes:

[0027] For the n spectra, calculating the Euclidean distance between the scores of the spectra and the average score value;

[0028] Sort the calculated n Euclidean distances;

[0029] Divide the minimum distance and the maximum distance into j intervals, where j is a positive integer;

[0030] m / j spectra are selected from each interval, and the selected m spectra are determined as the reference spectra.

[0031] Optionally, the performing modeling according to the reference spectrum to obtain a target model includes:

[0032] Obtaining the physical and chemical indicators corresponding to the reference spectrum;

[0033] The target model is trained according to the reference spectrum and the physicochemical indicators of the reference spectrum.

[0034] Optionally, the training the target model according to the reference spectrum and the physical and chemical indicators of the reference spectrum includes:

[0035] Performing SNV spectrum preprocessing on the reference spectrum;

[0036] Modeling is performed based on the preprocessed reference spectrum and the physicochemical indicators to obtain the target model.

[0037] In a second aspect, a real-time local modeling device is provided, the device comprising a memory and a processor, the memory storing at least one program instruction, the processor implementing the method as described in the first aspect by loading and executing the at least one program instruction.

[0038] In a third aspect, a computer storage medium is provided, wherein at least one program instruction is stored in the computer storage medium, and the at least one program instruction is loaded and executed by a processor to implement the method according to any one of claims 1 to 8.

[0039] By receiving infrared spectra sent by at least two infrared spectrometers; comparing the at least two infrared spectra received with the sample infrared spectrum, screening out n similar spectra, where n is an integer greater than 2; performing principal component analysis on the n spectra to obtain a reference spectrum with reference significance; modeling based on the reference spectrum to obtain a target model; the target model is used to predict the target spectrum to obtain predicted physical and chemical indicators. The problem of low prediction accuracy of the model obtained by modeling in the prior art is solved, and the effect of improving the prediction accuracy of the model is achieved.

[0040] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present invention in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A method flow chart of a real-time local modeling method provided by one embodiment of the present invention;

[0042] Figure 2 A scatter plot using global modeling prediction provided by one embodiment of the present invention;

[0043] Figure 3 A scatter plot using local modeling prediction is provided for one embodiment of the present invention. DETAILED DESCRIPTION

[0044] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0046] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0047] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0048] Please refer to Figure 1 , which shows a method flow chart of a real-time local modeling method provided by an embodiment of the present application, such as Figure 1 As shown, the method includes:

[0049] Step 101, receiving infrared spectra sent by at least two infrared spectrometers;

[0050] An information reporting module is set in the infrared spectrometer, and after collecting the infrared spectrum, the collected infrared spectrum is reported to the server. The information reporting module can be a 4G module, a 5G module or a communication module of other modes, which is not limited in this embodiment.

[0051] Step 102, comparing the received at least two infrared spectra with the sample infrared spectrum, and screening out n similar spectra, where n is an integer greater than 2;

[0052] After receiving the reported infrared spectrum, the server selects n similar spectra from the received infrared spectrum.

[0053] Specifically, this step includes:

[0054] First, preprocessing the at least two infrared spectra;

[0055] The pre-processing step includes at least one of the following methods:

[0056] (1) denoising the at least two infrared spectra according to the signal-to-noise ratio;

[0057] Taking the received infrared spectrum of 900-1700nm as an example, the received infrared spectrum is removed from the first and last preset number of absorbance spectra with low signal-to-noise ratio (930-1670nm). In actual implementation, the preset number can be determined according to the number of received infrared spectra, and its specific number is not limited.

[0058] (2) performing normalization processing on the at least two infrared spectra.

[0059] In order to eliminate the influence of dimension, the at least two received infrared spectra may be normalized. The normalization method includes: Where X' is the normalized value, X is the original value, and X min is the minimum value, X max is the maximum value.

[0060] second, comparing at least two preprocessed infrared spectra with the sample infrared spectrum to obtain the Euclidean distance;

[0061] After preprocessing the infrared spectra, at least two preprocessed infrared spectra are compared with the sample spectrum to calculate the Euclidean distance.

[0062] Among them, the Euclidean distance is calculated as follows: Among them, x i is the preprocessed spectrum, x j is a sample spectrum in the database.

[0063] The sample spectrum may be a spectrum pre-stored in the server, and the sample spectrum includes sample spectra of different contents, different sizes, and different temperatures collected by different instruments in advance and the corresponding physical and chemical values.

[0064] Third, according to the calculated Euclidean distances, n spectra with similar Euclidean distances are determined as the n spectra.

[0065] The calculated Euclidean distances are sorted in ascending order, and n spectra with similar Euclidean distances are selected as the screened spectra. For example, when n=1000, 1000 similar spectra are screened.

[0066] Step 103, performing principal component analysis on the n spectra to obtain a reference spectrum with reference significance;

[0067] First, perform principal component analysis on the n spectra to obtain corresponding scores;

[0068] Calculate the score for each principal component.

[0069] Second, the reference spectrum is obtained by screening according to the scores of the n spectra.

[0070] (1) screening the scores of the n spectra to obtain a score matrix ranked in the top i, where i is a positive integer;

[0071] Select the score matrix X of the first i principal components score .

[0072] (2) Calculate the average score of the score matrix;

[0073] The calculated score matrix is ​​averaged by column to obtain the average score value.

[0074] (3) Filtering the reference spectrum according to the scores of the n spectra and the average score value.

[0075] For the n spectra, calculating the Euclidean distance between the scores of the spectra and the average score value;

[0076] Sort the calculated n Euclidean distances;

[0077] Divide the minimum distance and the maximum distance into j intervals, where j is a positive integer;

[0078] m / j spectra are selected from each interval, and the selected m spectra are determined as the reference spectra.

[0079] In a possible embodiment, the minimum distance and the maximum distance are equally divided into four intervals, 100 spectra are selected in each interval, and 400 reference spectra are screened to obtain.

[0080] By selecting m reference spectra, subsequent modeling can be performed based on spectra that are of reference significance, that is, representative, thereby reducing the participation of excessive similar samples in modeling and improving the stability of model prediction.

[0081] Step 104, modeling is performed based on the reference spectrum to obtain a target model; the target model is used to predict the target spectrum to obtain predicted physical and chemical indicators.

[0082] First, obtaining the physical and chemical indicators corresponding to the reference spectrum;

[0083] Second, the target model is trained according to the reference spectrum and the physical and chemical indicators of the reference spectrum.

[0084] (1) performing SNV (standard normal transformation) spectrum preprocessing on the reference spectrum;

[0085] (2) Modeling is performed based on the preprocessed reference spectrum and the physicochemical indicators to obtain the target model.

[0086] Optionally, PLS modeling can be performed based on the pre-processed reference spectrum and physical and chemical treatment. In addition, in actual implementation, after modeling, a leave-one-out method is used for cross-validation to select the best number of principal factors, and the model using the best number of principal factors is used as the target model.

[0087] After the target model is obtained through training, the target spectrum can be predicted through the target model to obtain the predicted physical and chemical indicators.

[0088] Optionally, the target spectrum after SNV preprocessing can be predicted to obtain predicted physical and chemical indicators. For example, y = k1*x1+k2*x2+k3*x3+......+b, where k is the weight of the model and b is the intercept of the model.

[0089] In a possible implementation of this embodiment, please refer to Figure 2 and Figure 3 , Figure 2 To predict the set of scatter plots using global modeling, Figure 3 Scatter plot for predictions using local modeling. Figure 2 and Figure 3 In this embodiment, for the same data set, the prediction standard deviation of the local model in this embodiment is 0.1857 lower than the prediction standard deviation of the global model, which greatly improves the accuracy of the model.

[0090] In summary, by receiving infrared spectra sent by at least two infrared spectrometers; comparing the at least two received infrared spectra with the sample infrared spectrum, screening out n similar spectra, where n is an integer greater than 2; performing principal component analysis on the n spectra to obtain a reference spectrum with reference significance; modeling based on the reference spectrum to obtain a target model; the target model is used to predict the target spectrum to obtain predicted physical and chemical indicators. The problem of low prediction accuracy of the model obtained by modeling in the prior art is solved, and the effect of improving the prediction accuracy of the model is achieved.

[0091] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0092] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.

Claims

1. A real-time local modeling method, characterized in that: The method comprises: receiving infrared spectra sent by at least two infrared spectrometers; Compare the at least two received infrared spectra with the sample infrared spectrum, and screen out n similar spectra, where n is an integer greater than 2; Performing principal component analysis on the n spectra to obtain a reference spectrum with reference significance; Modeling is performed based on the reference spectrum to obtain a target model; the target model is used to predict the target spectrum to obtain predicted physical and chemical indicators.

2. The method according to claim 1, characterized in that The step of comparing the received at least two infrared spectra with the sample infrared spectrum to screen out n similar spectra includes: Preprocessing the at least two infrared spectra; Compare at least two preprocessed infrared spectra with the sample infrared spectrum to obtain the Euclidean distance; According to the calculated Euclidean distances, n spectra with similar Euclidean distances are determined as the n spectra.

3. The method according to claim 2, characterized in that The preprocessing of the at least two infrared spectra comprises: De-noising the at least two infrared spectra according to the signal-to-noise ratio; and / or, The at least two infrared spectra are normalized.

4. The method according to claim 1, characterized in that: The performing principal component analysis on the n spectra to obtain a reference spectrum with reference significance includes: Perform principal component analysis on the n spectra to obtain corresponding scores; The reference spectrum is obtained by screening according to the scores of the n spectra.

5. The method according to claim 4, characterized in that The step of screening and obtaining the reference spectrum according to the scores of the n spectra includes: According to the scores of the n spectra, a score matrix ranked in the top i is obtained, where i is a positive integer; Calculate the average score value of the score matrix; The reference spectrum is screened according to the scores of the n spectra and the average score value.

6. The method according to claim 5, characterized in that The step of screening the reference spectrum according to the scores of the n spectra and the average score value comprises: For the n spectra, calculating the Euclidean distance between the scores of the spectra and the average score value; Sort the calculated n Euclidean distances; Divide the minimum distance and the maximum distance into j intervals, where j is a positive integer; m / j spectra are selected from each interval, and the selected m spectra are determined as the reference spectra.

7. The method according to claim 1, characterized in that The step of modeling according to the reference spectrum to obtain a target model comprises: Obtaining the physical and chemical indicators corresponding to the reference spectrum; The target model is trained according to the reference spectrum and the physicochemical indicators of the reference spectrum.

8. The method according to claim 7, characterized in that The training of the target model according to the reference spectrum and the physical and chemical indicators of the reference spectrum includes: Performing SNV spectrum preprocessing on the reference spectrum; Modeling is performed based on the preprocessed reference spectrum and the physicochemical indicators to obtain the target model.

9. A real-time local modeling device, characterized in that: The device includes a memory and a processor, wherein the memory stores at least one program instruction, and the processor implements the method according to any one of claims 1 to 8 by loading and executing the at least one program instruction.

10. A computer storage medium, characterized in that: The computer storage medium stores at least one program instruction, and the at least one program instruction is loaded and executed by a processor to implement the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for predicting crude oil characteristic through near infrared spectrum

    CN105388123A

  • Crude oil type near infrared spectrum identification method

    CN105424641A

  • Method for constructing model for rapid and nondestructive real-time prediction of crude oil properties and application thereof

    CN107817223A

  • Spectral data analysis method and spectral data analysis apparatus

    CN109115692A