Spectral attribute prediction method based on sparse Bayesian learning baseline correction
Through the method based on sparse Bayesian learning, a sparse hierarchical model is constructed and deep feature extraction is performed, which solves the problem of baseline correction in existing spectral analysis without exploiting spectral wavelength correlation, achieving higher spectral data quality and analysis accuracy sex.
Patent Information
- Application Number
- CN202411522573.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-14
AI Technical Summary
The existing spectral analysis methods fail to effectively utilize the correlation between spectral wavelengths during the baseline correction process, resulting in the impact of the accuracy and completeness of spectral data.
Using a sparse Bayesian learning method, a sparse hierarchical model is constructed, the spectral data is split into baseline components, eigens spectral components and noise components, and deep feature extraction is performed through convolutional neural network to improve the accuracy of spectral analysis. and reliability.
It effectively improves the quality of spectral data, enhances the accuracy of spectral information characterization and model application, and expands the scope of spectral analysis applications.
Smart Images

Figure CN119441730A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of spectral data analysis, and in particular to a spectral attribute prediction method based on sparse Bayesian learning baseline correction. Background Art
[0002] Spectral analysis methods based on material and spectral characterization are currently the main analytical methods in key fields such as petrochemicals, medicine, agriculture, forestry, and food. By collecting and analyzing the spectral data and property data of the material, and combining chemometric analysis methods to establish a qualitative or quantitative prediction model for the corresponding indicators, rapid, accurate, and non-destructive testing and analysis can be achieved. In the spectral analysis process, the accurate characterization of the process material characteristics by spectral data is the basis for model application. However, in actual applications, the collected spectrum is usually composed of intrinsic spectrum, baseline, and noise.
[0003] In order to solve the problem of baseline drift in the measured spectrum, the existing spectral preprocessing methods mainly realize the baseline correction of the analysis signal by adopting appropriate data analysis methods. However, the existing baseline correction methods mainly perform independent baseline correction for each spectral wavelength, without considering the structural characteristics of the measured spectrum, that is, the correlation of adjacent spectral wavelength information. In fact, the measured spectrum that characterizes material information has a local wavelength correlation characteristic, that is, the adjacent spectral wavelengths within the spectral characteristic peak interval are related to each other. Establishing a spectral baseline correction method using the spectral wavelength structural characteristics of the measured spectrum itself is conducive to improving the accuracy and completeness of the measured spectral information characterization, and affects the characterization and model application of spectral information. Summary of the invention
[0004] A brief summary of one or more aspects is given below to provide a basic understanding of these aspects. This summary is not an exhaustive overview of all conceived aspects, and is neither intended to identify the key or critical elements of all aspects nor to define the scope of any or all aspects. Its only purpose is to give some concepts of one or more aspects in a simplified form as a prelude to a more detailed description that will be given later.
[0005] The purpose of the present invention is to solve the above problems and provide a spectral attribute prediction method based on sparse Bayesian learning baseline correction. Gaussian information enhancement is used to convert the sample one-dimensional spectrum into a sample two-dimensional spectrum, and then deep feature extraction is performed through a trained convolutional neural network, thereby improving the accuracy and reliability of spectral analysis.
[0006] The technical solution of the present invention is:
[0007] The present invention provides a spectral attribute prediction method based on sparse Bayesian learning baseline correction, comprising the following steps:
[0008] Step S1: collecting sample spectrum data and attribute data of the sample, and performing data cleaning on the sample spectrum data to construct a sample spectrum analysis data set;
[0009] Step S2: constructing a sparse hierarchical model of sample spectral data based on the sample spectral analysis data set after data cleaning, and performing sparse Bayesian learning on the sparse hierarchical model of sample spectral data, thereby performing baseline correction on the sample spectral data to obtain a corrected spectral data set; wherein the corrected spectral data set includes the spectral data after baseline correction and the corresponding attribute data;
[0010] Step S3: randomly dividing the corrected spectral data set after sparse Bayesian learning into a training set and a test set, and constructing a spectral attribute prediction model with the spectral data as input and the attribute data as output, and using the divided training set to train the constructed spectral attribute prediction model;
[0011] Step S4: Use the trained spectral attribute prediction model to predict the corrected spectral data in the test set, and determine whether the prediction result is consistent with the corresponding attribute data in the test set; if so, complete the model training to obtain a verified spectral attribute prediction model; if not, re-perform baseline correction and model training;
[0012] Step S5: Use the spectral attribute prediction model verified in step S4 to predict the spectral data of the actual production sample after baseline correction to obtain the attribute data corresponding to the actual production sample.
[0013] According to an embodiment of the spectral attribute prediction method based on sparse Bayesian learning baseline correction of the present invention, in step S1, the spectral attribute prediction method based on sparse Bayesian learning baseline correction collects corresponding sample spectral data in the form of a two-dimensional array according to the type of sample spectrum collected; after the spectral attribute prediction method based on sparse Bayesian learning baseline correction obtains the sample spectral data in the form of a two-dimensional array, outliers are eliminated on the collected sample spectral data, thereby obtaining a sample spectral analysis data set after data cleaning.
[0014] According to an embodiment of the spectral attribute prediction method based on sparse Bayesian learning baseline correction of the present invention, the sample spectrum types are divided into ultraviolet-visible spectrum, near infrared spectrum, mid-infrared spectrum, Raman spectrum and fluorescence spectrum; wherein,
[0015] If the sample spectrum is UV-visible spectrum, near infrared spectrum, or mid-infrared spectrum, the horizontal axis of the two-dimensional array represents wavelength, and the vertical axis represents absorbance;
[0016] If the sample spectrum is a Raman spectrum, the abscissa of the two-dimensional array represents the Raman shift, and the ordinate represents the corresponding light intensity;
[0017] If the sample spectrum is a fluorescence spectrum, the horizontal axis of the two-dimensional array represents the excitation light wavelength, and the vertical axis represents the spectrum intensity.
[0018] According to an embodiment of the spectral attribute prediction method based on sparse Bayesian learning baseline correction of the present invention, when constructing a sparse hierarchical model of sample spectral data, the ordinate of the sample spectral data is first used to construct a sparse matrix representing the sparsity of the intrinsic spectrum, and the intrinsic spectrum based on the sparsity representation is used to establish a second-order difference matrix for smoothing constraints on the spectral baseline component, and then the number of adjacent variable couplings used to characterize the adjacent wavelength characteristics of the spectrum is set according to the intrinsic spectral component to establish a coupled hierarchical sparse representation model, and finally the overall sparse hierarchical model of sample spectral data is constructed based on the variance of the spectral noise component and the variance of the intrinsic spectrum.
[0019] According to an embodiment of the spectral attribute prediction method based on sparse Bayesian learning baseline correction of the present invention, when the spectral attribute prediction method based on sparse Bayesian learning baseline correction constructs a sparse matrix representing the sparsity of the intrinsic spectrum, the spectral data x represented based on the sparsity representation is represented by the following formula:
[0020] x=Aw+b+n
[0021] Among them, s = Aw represents the intrinsic spectral component based on sparsity representation, A represents a sparse matrix, w represents a sparse coefficient, and n represents a mean of 0 and a variance of α. -1 The measurement noise is b, and b represents the smooth baseline.
[0022] According to an embodiment of the spectral attribute prediction method based on sparse Bayesian learning baseline correction of the present invention, after the spectral attribute prediction method based on sparse Bayesian learning baseline correction establishes the second-order difference matrix of the smooth baseline b, for the variance α -1 The measurement noise is set by the following formula to establish the constraint of the smooth baseline b:
[0023] p(b|β)=N(b|0,(βD T D) -1 ) (2)
[0024] Where p(b|β) represents the conditional probability distribution of the smoothed baseline b with respect to the baseline accuracy parameter β, and D is the second-order difference matrix.
[0025] According to an embodiment of the spectral attribute prediction method based on sparse Bayesian learning baseline correction of the present invention, the spectral attribute prediction method based on sparse Bayesian learning baseline correction establishes a coupled hierarchical sparse representation model of the intrinsic spectral component s=Aw through the following formula:
[0026]
[0027] p(w i |…, γ i-1 , γ i , γ i+1 ,…)=N(w i |0,(…+κ i-1 γ i-1 +κ i γ i +κ i+1 γ i+1 +…) -1 )
[0028] Among them, p(w|γ) represents the conditional probability distribution of coefficient w with respect to parameter γ, is the precision vector representing the coefficient w, represents the coupling correlation coefficient.
[0029] According to an embodiment of the spectral attribute prediction method based on sparse Bayesian learning baseline correction of the present invention, the spectral attribute prediction method based on sparse Bayesian learning baseline correction establishes a sparse hierarchical model of spectral data x through the following formula:
[0030] p(x|w,b,α)=N(x|Aw+b,α -1 I)
[0031] Where p(x|w, b, α) represents the conditional probability distribution of spectral data x with respect to parameter w, sparse matrix A, smooth baseline b and parameter α, N(.) represents normal distribution, and I represents the identity matrix.
[0032] According to an embodiment of the spectral attribute prediction method based on sparse Bayesian learning baseline correction of the present invention, the noise accuracy α and the baseline accuracy β are set to satisfy the gamma distribution of p(α)=Γ(α|c, d) and p(β)=Γ(β|e, f), and the overall sparse hierarchical model of sample spectral data is expressed as follows:
[0033] p(x|Θ)=p(x|w,b,α)p(w|γ)p(b|β)p(α)p(β)p(γ)
[0034] Among them, c and e represent shape parameters, and d and f represent location parameters.
[0035] According to an embodiment of the spectral attribute prediction method based on sparse Bayesian learning baseline correction of the present invention, after the spectral attribute prediction method based on sparse Bayesian learning baseline correction constructs a sparse hierarchical model of sample spectral data, variational Bayesian learning is performed on the sparse hierarchical model of sample spectral data, and the sample spectral data is split into baseline components, intrinsic spectral components and noise components, thereby realizing baseline correction of the sample spectral data; wherein, when performing component splitting of spectral data, the spectral attribute prediction method based on sparse Bayesian learning baseline correction first performs variational Bayesian approximation on the hierarchical sparse model, and determines the parameter calculation expressions of different components through variational inference, and then, within the range of the number of iterations, the mean and variance of the spectral sparse coefficients, the noise variance and the baseline variance are respectively updated, thereby determining the baseline component, intrinsic spectral component and noise component of the spectral data.
[0036] According to an embodiment of the spectral attribute prediction method based on sparse Bayesian learning baseline correction of the present invention, after the spectral attribute prediction method based on sparse Bayesian learning baseline correction completes the prediction of the test set, the determination coefficient R is used. 2 The prediction results of the test set are verified by using the root mean square error (RMSE) to adjust the structure of the sparse hierarchical model of the sample spectral data. 2 The calculation formula for the root mean square error RMSE is as follows:
[0037]
[0038]
[0039] Among them, y represents the true value, represents the predicted value, and T represents the number of predicted samples.
[0040] The present invention also provides a computer readable medium storing a computer program code, wherein the computer program code implements the method as described above when executed by a processor.
[0041] The present invention also provides a spectral baseline correction device based on sparse Bayesian learning, comprising:
[0042] a memory for storing instructions executable by a processor; and
[0043] A processor is used to execute the instructions to implement the method as described above.
[0044] Compared with the prior art, the present invention has the following beneficial effects: for measuring spectra with baseline drift, the present invention establishes a sparse hierarchical model in combination with the spectral wavelength structure characteristics of the measured spectrum itself, and uses the sparse hierarchical model to split the spectral data into baseline components, intrinsic spectral components and noise components to complete the spectral baseline correction. Then, a spectral attribute prediction model is constructed and trained using the spectral data that has completed the baseline correction, so that the spectral attribute prediction model is used to predict the spectral data of the actual production sample to obtain the corresponding attribute data. Compared with the prior art, the present invention can perform baseline correction and noise filtering on different types of spectral data, effectively improving the quality of spectral data. At the same time, the present invention can adaptively learn spectral features without the need for manual parameter optimization, effectively expanding the scope of application of spectral analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The above features and advantages of the present invention can be better understood after reading the detailed description of the embodiments of the present disclosure in conjunction with the following drawings. In the drawings, the components are not necessarily drawn to scale, and components with similar related properties or features may have the same or similar reference numerals.
[0046] Figure 1 Detailed description of the invention is a flow chart showing an embodiment of a spectral attribute prediction method based on sparse Bayesian learning baseline correction according to the present invention.
[0047] Figure 2 It is a schematic diagram showing an embodiment of a hierarchical sparse model based on sparse Bayesian learning of the present invention.
[0048] Figure 3 It is a schematic diagram showing an embodiment of the diesel spectrum and correction baseline based on sparse Bayesian learning of the present invention. DETAILED DESCRIPTION
[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.
[0050] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0051] Unless otherwise specifically stated, the relative arrangement, numerical expressions and numerical values of the parts and steps set forth in these embodiments do not limit the scope of the present application. At the same time, it should be understood that, for ease of description, the sizes of the various parts shown in the accompanying drawings are not drawn according to the actual proportional relationship. The technology, method and equipment known to those of ordinary skill in the relevant field may not be discussed in detail, but in appropriate cases, the technology, method and equipment should be considered as a part of the authorization specification. In all examples shown and discussed here, any specific value should be interpreted as being merely exemplary, rather than as a limitation. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so that once a certain item is defined in an accompanying drawing, it does not need to be further discussed in subsequent drawings.
[0052] When describing the embodiments of the present invention in detail, for the sake of convenience, the cross-sectional views showing the device structure will not be partially enlarged according to the general scale, and the schematic views are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.
[0053] In the description of the present application, it should be understood that the directions or positional relationships indicated by directional words such as "front, back, up, down, left, right", "lateral, vertical, perpendicular, horizontal" and "top, bottom" are usually based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present application and simplifying the description. Unless otherwise specified, these directional words do not indicate or imply that the device or element referred to must have a specific direction or be constructed and operated in a specific direction, and therefore cannot be understood as limiting the scope of protection of the present application; the directional words "inside and outside" refer to the inside and outside relative to the contours of each component itself.
[0054] Disclosed herein is an embodiment of a spectral attribute prediction method based on sparse Bayesian learning baseline correction. Figure 1 is a flow chart showing an embodiment of a spectral attribute prediction method based on sparse Bayesian learning baseline correction of the present invention. Figure 1 ,The following is a detailed description of each step of the spectral attribute prediction method based on sparse Bayesian learning baseline correction.
[0055] Step S1: Collect sample spectral data and attribute data of the sample, perform data cleaning on the sample spectral data, and construct a sample spectral analysis data set.
[0056] In this embodiment, when collecting sample spectrum data and attribute data, the corresponding sample spectrum data is collected in the form of a two-dimensional array according to the type of sample spectrum collected. After obtaining the sample spectrum data in the form of a two-dimensional array, the collected sample spectrum data is subjected to outlier removal, and abnormal samples and spectrum wavelengths containing obvious noise are removed, thereby obtaining a sample spectrum analysis data set after data cleaning.
[0057] Specifically, in this embodiment, the sample spectrum data type includes ultraviolet-visible spectrum, near-infrared spectrum, mid-infrared spectrum, Raman spectrum and fluorescence spectrum. For ultraviolet-visible spectrum, near-infrared spectrum and mid-infrared spectrum, the horizontal coordinate of the two-dimensional array can usually be expressed as wavelength (or wave number), and the vertical coordinate can usually be expressed as absorbance. For Raman spectrum, the horizontal coordinate of the two-dimensional array can usually represent Raman shift, and the vertical coordinate can usually be expressed as corresponding light intensity. For fluorescence spectrum, the horizontal coordinate of the two-dimensional array can usually represent the wavelength of excitation light, and the vertical coordinate can usually be expressed as spectral intensity. Therefore, after obtaining any of the above types of sample spectrum data, the sample data including the sample absorbance deviating from the sample average spectrum due to the experimental environment and the wavelengths containing obvious noise at both ends are eliminated, thereby obtaining the sample spectrum analysis data set after data cleaning.
[0058] Taking the prediction of diesel cetane number and gasoline octane number as an example, 381 representative diesel samples were obtained, and then a near-infrared spectrometer was used to collect spectral data of the collected samples. The near-infrared spectrum of the diesel sample was measured by inserting the probe into each sample bottle, and the cetane number of the diesel sample was measured according to the relevant national or industry standards. The final spectral wavelength range was 900-1550nm, with a resolution of 4.72nm, and the abnormal spectrum of the measured diesel was eliminated, and the wavelengths with obvious noise at both ends were cut to obtain the final spectral analysis data set.
[0059] Step S2: construct a spectral data sparse hierarchical model based on the sample spectral analysis data set after data cleaning, and perform sparse Bayesian learning on the sample spectral data sparse hierarchical model, so as to perform baseline correction on the sample spectral data to obtain a corrected spectral data set; wherein the corrected spectral data set includes the spectral data after baseline correction and the corresponding attribute data.
[0060] In this embodiment, when constructing a sparse hierarchical model of sample spectral data, the vertical coordinates of the sample spectral data are first used to construct a sparse matrix representing the sparsity of the intrinsic spectrum, and the intrinsic spectrum based on the sparsity representation is used to establish a second-order difference matrix for smoothing constraints on the spectral baseline component. Then, a coupled hierarchical sparse representation model is established based on the number of adjacent variable couplings set by the intrinsic spectral component to characterize the adjacent wavelength characteristics of the spectrum. Finally, the overall sparse hierarchical model of sample spectral data is constructed based on the variance of the spectral noise component and the variance of the intrinsic spectrum.
[0061] Specifically, in this embodiment, for the spectral data x, a sparse matrix A for representing the sparsity of the intrinsic spectrum s is constructed, and a second-order difference matrix D for the smooth constraint of the baseline b is established. The expression of the spectral data x based on the sparsity representation is as follows:
[0062] x=Aw+b+n(9)
[0063] In the formula, s = Aw represents the eigenspectrum based on sparsity representation, A represents a sparse matrix, w represents a sparse coefficient, and n is a matrix with a mean of 0 and a variance of α. -1 The measurement noise is , and b represents the smooth baseline. After constructing the second-order difference matrix for establishing the smooth baseline b, the constraint of the smooth baseline b is established by the following formula:
[0064] p(b|β)=N(b|0,(βD T D) -1 ) (2)
[0065] Where p(b|β) represents the conditional probability distribution of the smoothed baseline b with respect to the baseline accuracy parameter β, D is the second-order difference matrix, and assuming that the representation coefficient w of the intrinsic spectral component s=Aw obeys a normal distribution, the coupled hierarchical sparse representation model is as follows:
[0066]
[0067] p(w i |…,γ i-1 ,γ i ,γ i+1 ,…)=N(w i |0,(…+κ i-1 γ i-1 +κ i γ i +κ i+1 γ i+1 +…) -1 )
[0068] Among them, p(w|γ) represents the conditional probability distribution of coefficient w with respect to parameter γ, is the precision vector representing the coefficient w, Represents the coupling correlation coefficient. Based on the above, the hierarchical sparse model of the spectral data x can be obtained as:
[0069] p(x|w,b,α)=N(x|Aw+b,α -1 I)
[0070] Among them, p(x|w,b,α) represents the conditional probability distribution of spectral data x with respect to parameter w, sparse matrix A, smooth baseline b and parameter α, N(·) represents normal distribution, and I represents the identity matrix. Assuming that the noise accuracy α and baseline accuracy β satisfy the gamma distribution of p(α)=Γ(α|c,d) and p(β)=Γ(β|e,f), the overall sparse hierarchical model of sample spectral data is expressed as follows:
[0071] p(x|Θ)=p(x|w,b,α)p(w|γ)p(b|β)p(α)p(β)p(γ)
[0072] Among them, c and e represent shape parameters, and d and f represent location parameters.
[0073] In this embodiment, after the sparse hierarchical model of sample spectral data is constructed through the above steps, sparse Bayesian learning is performed on the sparse hierarchical model of the spectral data, so as to perform baseline correction on the sample spectral data and obtain a corrected spectral data set. When performing baseline correction of spectral data, firstly, variational Bayesian approximation is performed on the hierarchical sparse model, and the parameter calculation expressions of different components are determined by variational inference, and then within the range of the number of iterations, the mean and variance of the spectral sparse coefficients, the noise variance and the baseline variance are updated respectively, so as to split the sample spectral data into baseline components, intrinsic spectral components and noise components, and realize baseline correction of the sample spectral data.
[0074] Step S3: randomly divide the corrected spectral data set after sparse Bayesian learning into a training set and a test set, and construct a spectral attribute prediction model with spectral data as input and attribute data as output, and use the divided training set to train the constructed spectral attribute prediction model.
[0075] After completing the baseline correction of the sample spectral data through the above steps, the corrected spectral data set after sparse Bayesian learning is randomly divided into a training set and a test set. The spectral data of the training set is used as input and the attribute data is used as output to establish a spectral attribute prediction model to perform qualitative or quantitative prediction of the sample properties. The established spectral attribute prediction model is trained using the training set to obtain a spectral attribute prediction model for predicting spectral attribute data.
[0076] Taking the above diesel spectrum data as an example, the following is constructed through the above steps: Figure 2 The wavelength coupling model of the diesel spectrum data is shown. Then set the hyperparameters {c, d, e, f} = 10 -8 The number of iterations is set to K = 500, and after baseline correction, the spectral data set X is obtained. C The baseline correction of the diesel average spectrum is as follows: Figure 3 shown.
[0077] Step S4: Use the trained spectral attribute prediction model to predict the corrected spectral data in the test set, and determine whether the prediction result is consistent with the corresponding attribute data in the test set; if so, complete the model training and obtain a verified spectral attribute prediction model; if not, re-perform baseline correction and model training.
[0078] In this embodiment, after the spectral attribute prediction model is trained, the prediction performance of the obtained model can be verified on the test set, and the analysis results of the sample spectral data and the calibrated spectral data can be compared to optimize the model parameters. When verifying the test set results, the determination coefficient R 2 And root mean square error RMSE to verify the convolutional neural network model, and its determination coefficient R 2 The calculation formula for the root mean square error RMSE is as follows:
[0079]
[0080]
[0081] Among them, y represents the true value, Represents the predicted value, and T represents the number of predicted samples. Taking the above diesel spectrum as an example, the spectral data of the training set is used as input and the attribute data is used as output. A prediction model for the diesel cetane number based on partial least squares is established, and the test set samples are predicted and analyzed. Among them, the optimal number of latent variables of the cross-validation model is set to 8, the determination coefficient of the training set is 0.9782, the root mean square error is 0.2130, the determination coefficient of the test set is 0.9767, and the root mean square error is 0.2161. The experimental results of prediction by the method of the present invention are as follows:
[0082]
[0083] It can be seen from the above table that the spectral baseline correction method disclosed in the present invention is feasible and accurate in practice.
[0084] Step S5: Use the spectral attribute prediction model verified in step S4 to predict the spectral data of the actual production sample after baseline correction to obtain the attribute data corresponding to the actual production sample.
[0085] In this embodiment, after completing the verification of the model through the above steps, the verified spectral attribute prediction model can be used to predict the attributes of the spectral data of the actual production sample. After the spectral data of the actual production sample is baseline corrected through the above step S2, it is input into the spectral attribute prediction model, and the attribute data corresponding to the actual production sample can be output. This specification also provides a computer readable medium storing computer program code, which, when executed by a processor, implements the spectral attribute prediction method based on sparse Bayesian learning baseline correction as described above.
[0086] This specification also provides a spectral baseline correction device based on sparse Bayesian learning, including an instruction memory for storing instructions executable by a processor, and a processor for executing instructions in the instruction memory to implement the spectral attribute prediction method based on sparse Bayesian learning baseline correction as described above.
[0087] The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be apparent to those skilled in the art, and the general principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein, but should be granted the widest scope consistent with the principles and novel features disclosed herein.
[0088] Those skilled in the art will further appreciate that the various illustrative logic blocks, modules, circuits, and algorithm steps described in conjunction with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or a combination of the two. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps are generally described above in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the specific application and the design constraints imposed on the overall system. The technician may implement the described functionality in different ways for each specific application, but such implementation decisions should not be interpreted as resulting in a departure from the scope of the present invention.
[0089] The various illustrative logic blocks, modules, and circuits described in conjunction with the embodiments disclosed herein may be implemented or performed with a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in cooperation with a DSP core, or any other such configuration.
[0090] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software module may reside in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read and write information from / to the storage medium. In an alternative, a storage medium may be integrated into a processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and the storage medium may reside in a user terminal as discrete components.
[0091] In one or more exemplary embodiments, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented as a computer program product in software, each function may be stored on or transmitted by a computer-readable medium as one or more instructions or codes. Computer-readable media include both computer storage media and communication media, including any medium that facilitates the transfer of a computer program from one place to another. Storage media may be any available medium that can be accessed by a computer. As an example and not limitation, such a computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer. Any connection is also properly referred to as a computer-readable medium. For example, if the software is transmitted from a website, a server, or other remote source using a coaxial cable, a fiber optic cable, a twisted pair, a digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwaves, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwaves are included in the definition of the medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, wherein disk often reproduces data magnetically, while disc reproduces data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
Claims
1. A spectral attribute prediction method based on sparse Bayesian learning baseline correction, characterized in that: The following steps are involved: Step S1: collecting sample spectrum data and attribute data of the sample, and performing data cleaning on the sample spectrum data to construct a sample spectrum analysis data set; Step S2: constructing a sparse hierarchical model of sample spectral data based on the sample spectral analysis data set after data cleaning, and performing sparse Bayesian learning on the sparse hierarchical model of sample spectral data, thereby performing baseline correction on the sample spectral data to obtain a corrected spectral data set; wherein the corrected spectral data set includes the spectral data after baseline correction and the corresponding attribute data; Step S3: randomly dividing the corrected spectral data set after sparse Bayesian learning into a training set and a test set, and constructing a spectral attribute prediction model with the spectral data as input and the attribute data as output, and using the divided training set to train the constructed spectral attribute prediction model; Step S4: Use the trained spectral attribute prediction model to predict the corrected spectral data in the test set, and determine whether the prediction result is consistent with the corresponding attribute data in the test set; if so, complete the model training to obtain a verified spectral attribute prediction model; if not, re-perform baseline correction and model training; Step S5: Use the spectral attribute prediction model verified in step S4 to predict the spectral data of the actual production sample after baseline correction to obtain the attribute data corresponding to the actual production sample.
2. The spectral attribute prediction method based on sparse Bayesian learning baseline correction according to claim 1, characterized in that: In step S1, the spectral attribute prediction method based on sparse Bayesian learning baseline correction collects corresponding sample spectral data in the form of a two-dimensional array according to the type of sample spectrum collected; after the spectral attribute prediction method based on sparse Bayesian learning baseline correction obtains the sample spectral data in the form of a two-dimensional array, outliers are eliminated from the collected sample spectral data, thereby obtaining a sample spectral analysis data set after data cleaning.
3. The spectral attribute prediction method based on sparse Bayesian learning baseline correction according to claim 2, characterized in that: The sample spectrum types are divided into UV-visible spectrum, near-infrared spectrum, mid-infrared spectrum, Raman spectrum and fluorescence spectrum; among them, If the sample spectrum is UV-visible spectrum, near infrared spectrum, or mid-infrared spectrum, the horizontal axis of the two-dimensional array represents wavelength, and the vertical axis represents absorbance; If the sample spectrum is a Raman spectrum, the abscissa of the two-dimensional array represents the Raman shift, and the ordinate represents the corresponding light intensity; If the sample spectrum is a fluorescence spectrum, the horizontal axis of the two-dimensional array represents the excitation light wavelength, and the vertical axis represents the spectrum intensity.
4. The spectral attribute prediction method based on sparse Bayesian learning baseline correction according to claim 1, characterized in that: When constructing a sparse hierarchical model of sample spectral data using the spectral attribute prediction method based on sparse Bayesian learning baseline correction, the ordinate of the sample spectral data is first used to construct a sparse matrix representing the sparsity of the intrinsic spectrum, and the intrinsic spectrum based on the sparsity representation is used to establish a second-order difference matrix for smoothing constraints on the spectral baseline component. Then, the number of adjacent variable couplings used to characterize the adjacent wavelength characteristics of the spectrum is set according to the intrinsic spectral component to establish a coupled hierarchical sparse representation model. Finally, the overall sparse hierarchical model of sample spectral data is constructed based on the variance of the spectral noise component and the variance of the intrinsic spectrum.
5. The spectral attribute prediction method based on sparse Bayesian learning baseline correction according to claim 4, characterized in that: When the spectral attribute prediction method based on sparse Bayesian learning baseline correction constructs a sparse matrix representing the sparsity of the intrinsic spectrum, the spectral data x based on the sparsity representation is represented by the following formula: x=Aw+b+n Among them, s = Aw represents the intrinsic spectral component based on sparsity representation, A represents a sparse matrix, w represents a sparse coefficient, and n represents a mean of 0 and a variance of α. -1 The measurement noise is b, and b represents the smooth baseline.
6. The spectral attribute prediction method based on sparse Bayesian learning baseline correction according to claim 4, characterized in that: After establishing the second-order difference matrix of the smooth baseline b based on the spectral attribute prediction method of sparse Bayesian learning baseline correction, the variance is α -1 The measurement noise is taken into account, and the constraint of the smooth baseline b is established by the following formula: p(b|β)=N(b|0,(βD T D) -1 ) (2) Where p(b|β) represents the conditional probability distribution of the smoothed baseline b with respect to the baseline accuracy parameter β, and D is the second-order difference matrix.
7. The spectral attribute prediction method based on sparse Bayesian learning baseline correction according to claim 4, characterized in that: The spectral attribute prediction method based on sparse Bayesian learning baseline correction establishes a coupled hierarchical sparse representation model of the intrinsic spectral component s=Aw through the following formula: p(w i |…,c i-1 ,c i ,c i+1 ,…)=N(w i |0,(…+k i-1 c i-1 +k i c i +k i+1 c i+1 +…) -1 ) Among them, p(w|γ) represents the conditional probability distribution of coefficient w with respect to parameter γ, is the precision vector representing the coefficient w, represents the coupling correlation coefficient.
8. The spectral attribute prediction method based on sparse Bayesian learning baseline correction according to claim 4, characterized in that: The spectral attribute prediction method based on sparse Bayesian learning baseline correction establishes a sparse hierarchical model of spectral data x through the following formula: p(x|w,b,α)N(x|Yes+b,α -1 I) Where p(x|w,b,α) represents the conditional probability distribution of spectral data x with respect to parameter w, sparse matrix A, smoothed baseline b and parameter α, N(·) represents the normal distribution, and I represents the identity matrix.
9. The spectral attribute prediction method based on sparse Bayesian learning baseline correction according to claim 8, characterized in that: Assuming that the noise accuracy α and baseline accuracy β satisfy the gamma distribution of p(α) = Γ(α|c, d) and p(β) = Γ(β|e, f), the overall sparse hierarchical model of sample spectral data is expressed as follows: p(x|Θ)=p(x|w,b,α)p(w|γ)p(b|β)p(α)p(β)p(γ) Among them, c and e represent shape parameters, and d and f represent location parameters.
10. The spectral attribute prediction method based on sparse Bayesian learning baseline correction according to claim 1, characterized in that: After the spectral attribute prediction method based on sparse Bayesian learning baseline correction constructs a sparse hierarchical model of sample spectral data, variational Bayesian learning is performed on the sparse hierarchical model of sample spectral data to split the sample spectral data into baseline components, intrinsic spectral components and noise components, thereby achieving baseline correction of the sample spectral data; wherein, when performing component splitting of spectral data, the spectral attribute prediction method based on sparse Bayesian learning baseline correction first performs variational Bayesian approximation on the hierarchical sparse model, and determines the parameter calculation expressions of different components through variational inference, and then, within the range of the number of iterations, updates the mean and variance of the spectral sparse coefficients, the noise variance and the baseline variance, respectively, thereby determining the baseline component, intrinsic spectral component and noise component of the spectral data.
11. The spectral attribute prediction method based on sparse Bayesian learning baseline correction according to claim 1, characterized in that: After the spectral attribute prediction method based on sparse Bayesian learning baseline correction completes the prediction of the test set, the determination coefficient R is used 2 The prediction results of the test set are verified by using the root mean square error (RMSE) to adjust the structure of the sparse hierarchical model of the sample spectral data. 2 The calculation formula for the root mean square error RMSE is as follows: Among them, y represents the true value, represents the predicted value, and T represents the number of predicted samples.
12. A computer readable medium storing computer program code, characterized in that: The computer program code implements the method according to any one of claims 1 to 11 when executed by a processor.
13. A spectral baseline correction device based on sparse Bayesian learning, characterized in that: include: a memory for storing instructions executable by a processor; as well as A processor, configured to execute the instructions to implement the method according to any one of claims 1 to 11.