CN117288739B - Asymmetric Raman spectrum baseline correction method, device and storage medium - Google Patents

Asymmetric Raman spectrum baseline correction method, device and storage medium Download PDF

Info

Publication number
CN117288739B
CN117288739B CN202311588058.8A CN202311588058A CN117288739B CN 117288739 B CN117288739 B CN 117288739B CN 202311588058 A CN202311588058 A CN 202311588058A CN 117288739 B CN117288739 B CN 117288739B
Authority
CN
China
Prior art keywords
spline function
raman spectrum
peak area
spline
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311588058.8A
Other languages
Chinese (zh)
Other versions
CN117288739A (en
Inventor
刘鸿飞
黄晓晓
熊康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Optosky Xiamen Optoelectronic Co ltd
Original Assignee
Optosky Xiamen Optoelectronic Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Optosky Xiamen Optoelectronic Co ltd filed Critical Optosky Xiamen Optoelectronic Co ltd
Priority to CN202311588058.8A priority Critical patent/CN117288739B/en
Publication of CN117288739A publication Critical patent/CN117288739A/en
Application granted granted Critical
Publication of CN117288739B publication Critical patent/CN117288739B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/62Systems in which the material investigated is excited whereby it emits light or causes a change in wavelength of the incident light
    • G01N21/63Systems in which the material investigated is excited whereby it emits light or causes a change in wavelength of the incident light optically excited
    • G01N21/65Raman scattering
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16CCOMPUTATIONAL CHEMISTRY; CHEMOINFORMATICS; COMPUTATIONAL MATERIALS SCIENCE
    • G16C20/00Chemoinformatics, i.e. ICT specially adapted for the handling of physicochemical or structural data of chemical particles, elements, compounds or mixtures
    • G16C20/20Identification of molecular entities, parts thereof or of chemical compositions
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16CCOMPUTATIONAL CHEMISTRY; CHEMOINFORMATICS; COMPUTATIONAL MATERIALS SCIENCE
    • G16C20/00Chemoinformatics, i.e. ICT specially adapted for the handling of physicochemical or structural data of chemical particles, elements, compounds or mixtures
    • G16C20/70Machine learning, data mining or chemometrics
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N2201/00Features of devices classified in G01N21/00
    • G01N2201/12Circuits of general importance; Signal processing
    • G01N2201/127Calibration; base line adjustment; drift compensation

Landscapes

  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Crystallography & Structural Chemistry (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Biochemistry (AREA)
  • Artificial Intelligence (AREA)
  • Pathology (AREA)
  • Immunology (AREA)
  • General Physics & Mathematics (AREA)
  • Analytical Chemistry (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Investigating, Analyzing Materials By Fluorescence Or Luminescence (AREA)
  • Spectrometry And Color Measurement (AREA)

Abstract

The invention discloses an asymmetric Raman spectrum baseline correction method, a device and a storage medium, wherein the correction method comprises the following steps: inputting an original Raman spectrum, and preprocessing the original Raman spectrum to obtain a Raman spectrum X; determining the peak area of the raman spectrum X using a smooth derivative method; after selecting X part points of a Raman spectrum as control points, fitting a base line between the control points by using a B spline function, setting the order of the B spline function as 3, setting the control point of the B spline function as 5 in a non-peak area, and setting the control point of the B spline function as 15 in a peak area; taking the result of B spline function fitting as a base line Z, and according to the base line Z and Raman spectrumObtaining Raman spectrumThe method comprises the steps of carrying out a first treatment on the surface of the Setting a termination condition: if it isThe baseline vector Z is output.

Description

Asymmetric Raman spectrum baseline correction method, device and storage medium
Technical Field
The invention belongs to the field of Raman spectrum baseline correction, and particularly relates to a Raman spectrum baseline correction method and device based on asymmetry and a storage medium.
Background
Raman spectroscopy is a molecular vibration spectrum based on raman scattering effect, and information such as the position, intensity, peak width and the like of characteristic peaks can reflect the structural characteristics of molecules, so that detection of substance components can be realized, and therefore, raman spectroscopy is a valuable tool for qualitative and quantitative analysis. However, during actual use, the collected raman spectra have baselines due to external fluorescence effects, which consist of sharp features superimposed on a continuous, slowly varying background, which prevent interpretation of the spectra. Furthermore, the baseline of the different spectra varies greatly, even for otherwise similar samples. In quantitative analysis, these inconsistent baselines will reduce the simplicity and robustness of the calibration model built on these spectra. Therefore, it is necessary to eliminate the occurrence of the baseline wander phenomenon in the spectroscopic analysis.
Many baseline correction methods have been proposed in the art, but almost all baseline correction methods are implementing an algorithm that uses a smoother to predict the smoothing trend and an loss function to adjust the fit. Common smoother include first and second order differential, fourier transforms, polynomial fits, morphological transforms, whittaker smoother, and wavelet transforms. The loss function of most existing methods is least squares loss. The peaks in the original spectrum are generally considered to consist of raman scattering signals represented by peaks and smooth baseline signals forming the bottoms of the peaks, however, a fitting function based on least squares loss will typically cut into the peak region rather than estimating the bottoms of the peaks correctly. For this limitation, several asymmetric loss functions are proposed. A common feature of these asymmetric functions is that for large positive deviations the loss is reduced compared to the least squares loss. The detailed implementation algorithm comprises the following steps: a penalty polynomial (Penalized Polynomial), an asymmetric least squares method (Asymmetric Least Squares), morphology and softening baselines (Morphological and Mollified Baseline), a penalty spline asymmetric least squares method (Penalized Spline Asymmetric Least Squares), a noise median method (Noise Median method), and the like.
For example, one patent of the invention, publication number CN114722339a, discloses a method for estimating the baseline of hydrogen peaks in a carbon-oxygen ratio spectrum, which establishes an objective function of baseline estimation based on the asymmetric least squares principle. And constructing a peak area boundary matrix by selecting a pure baseline area near the peak area boundary, and introducing additional constraint conditions for the objective function. The objective function considers both the smoothness of the estimated baseline and the symmetry of the characteristic peak, and can effectively ensure the accuracy of the estimated baseline result. In the aspect of weight updating, the method utilizes the hyperbolic tangent function to combine the residual error mean value and the standard deviation to calculate the weight value in the iterative process, effectively reduces the influence of noise on the result, and improves the stability of baseline estimation.
For another example, another patent publication No. CN108844939a discloses a raman spectrum detection baseline correction method based on asymmetric weighted least squares, for a raman spectrum to be baseline fitted, a smoothing parameter and an iteration termination condition are set, weights are initialized to an identity matrix at the first iteration, the initial fitting baseline is obtained by minimizing a penalty least square, then the weights are updated according to a difference signal between the original spectrum and the fitting baseline by a softsign function, a new fitting baseline is calculated using the updated weights, and the process is repeated until the termination condition is satisfied. The final fitted baseline is subtracted from the original raman spectrum to achieve baseline correction of the raman spectrum.
To sum up, the prior art solution is to implement the baseline correction method based on the asymmetric least squares method (asLS), but the asymmetric punishment least squares method has a potential problem, in which the weight of the positive residual is too large, the constraint on the second derivative is too small, and the peak is excessively filled, so that the baseline is cut onto the lower part of the peak, and thus an artificial negative peak is generated in the corrected spectrum, resulting in lower accuracy of the extracted baseline. Meanwhile, the asymmetric punishment least square method needs to optimize the non-convex loss function, so that the calculated amount is greatly increased.
Disclosure of Invention
The following presents a simplified summary of embodiments of the invention in order to provide a basic understanding of some aspects of the invention. It should be understood that the following summary is not an exhaustive overview of the invention. It is not intended to identify key or critical elements of the invention or to delineate the scope of the invention. Its purpose is to present some concepts in a simplified form as a prelude to the more detailed description that is discussed later.
Because of unavoidable noise interference in actual measurement, the pure baseline signal may fluctuate to some extent in the area without spectral peaks, which may cause the estimated baseline to deviate from the actual baseline, and the present application will process the peak area differently from the non-peak area to eliminate the influence of noise on the baseline estimation. The asymmetric least squares method uses a Whittaker smoother to predict smoothing trends, while B-spline fits are better. Interpolation with low-order splines can produce similar effects as polynomial interpolation of higher order, and the occurrence of numerical instability called the longlattice phenomenon can be avoided. And the low-order spline interpolation also has the important property of "bump protection". In order to solve the technical problems of low accuracy and complex calculation amount of an asymmetric punishment least square method in the prior art, the application provides a novel weighting method, avoids direct optimization of a non-convex loss function, and simultaneously keeps a baseline estimated value close to a real baseline and well reserves all peaks. The raman spectrum after subtracting the baseline calculated by the present method, the remaining spectrum retains peak intensities in the peak region and intensities near zero in the non-peak region.
According to one aspect of the present application, there is provided an asymmetric raman spectrum baseline correction method comprising:
step 1: inputting an original Raman spectrum, and preprocessing the original Raman spectrum to obtain a Raman spectrum X;
step 2: determining the peak area of the raman spectrum X using a smooth derivative method;
step 3: after selecting X part points of a Raman spectrum as control points, fitting a base line between the control points by using a B spline function, setting the order of the B spline function as 3, setting the control point of the B spline function as 5 in a non-peak area, and setting the control point of the B spline function as 15 in a peak area;
step 4: taking the result of B spline function fitting as a base line Z, and according to the base line Z and Raman spectrumObtaining Raman spectrum->T is the iteration number;
step 5: setting a termination condition: if it isThen outputting a baseline vector Z; otherwise, returning to the step 3; wherein->To terminate accuracy.
Further, the step 1 specifically includes: the original Raman spectrum is subjected to pretreatment operations such as dark current deduction, normalization, sg smoothing and the like to obtain a pretreated Raman spectrum
Further, the determining the peak area in step 2 by using the smooth derivative method specifically includes: detecting peaks by searching for zeros in the smoothed first derivative that exceed the slope threshold and the amplitude threshold; where the smooth derivative method may ignore peak areas that are too low, too wide, or too narrow to obtain the desired normal peak areas. In addition, wavelet transforms, markov smoothing, etc. may be used to determine the peak area.
Further, after selecting the X-part points of the raman spectrum as the control points, the process of fitting the baseline between the control points by using the B-spline function in step 3 specifically includes:
set a set u= { U containing m+1 non-decreasing numbers 0 <= u 2 <= u 3 <= ...<= u m Set U is a node vector, U i Is a node, half-open interval [ u ] i , u i +1) is the i-th node section;
defining B-spline basis functions asWherein p is the order of the basis function, i is the ith p-th order B spline basis function; when the order p is 0, the B-spline basis function is defined as a step function as follows:
defining the rest B spline basis functions:
b-spline function defining k-th orderThe method comprises the following steps:
wherein k is the order, n is the number of control points minus 1,for the value of the j-th control point, +.>A j-th B spline basis function of k-th order; the number n+1 of control points and the number m+1 of nodes satisfy the following conditions: n=m-k-1;
the method comprises the steps of obtaining a peak area in the step 2, setting a control point of a B spline function as 5 in a non-peak area, setting the order of the B spline function as 3, obtaining 5 quartering points of the non-peak area, taking the 5 points as the control points of the B spline function, supplementing the 5 control points, filling 2 points at equal intervals in front and back, and taking the total 9 points as node vectors U; using node vectors formed by 9 nodes and the 5 control points, calculating a 3-order B spline function;
substituting the wave number values of all points in the non-peak area into the B spline function to obtain a fitting value of the B spline function in the non-peak area;
setting a control point of a B spline function as 15 in a peak area, setting the order of the B spline function as 3, acquiring 15 fourteen equally divided points in a non-peak area, taking the 15 points as the control points of the B spline function, supplementing the 15 control points, filling 2 points in front and back at equal intervals, and taking the total 19 points as a node vector U; calculating a 3-order B spline function by using node vectors formed by 19 nodes and the 15 control points;
substituting the wave number values of all points in the peak area into the B spline function to obtain a fitting value of the B spline function in the peak area;
the fitting values of the B-spline function in the non-peak area and the fitting values of the B-spline function in the peak area jointly form a fitting result y of the B-spline function.
Further, the step 4 takes the result of B spline function fitting as a base line Z, and the base line Z and the Raman spectrum are usedObtaining Raman spectrum->The method specifically comprises the following steps:
taking the fitting result y of the B spline function obtained in the step 3 as a base line Z (t) If (if)Less than or equal to baselineThen->Equal to->Otherwise->The method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Represents the ith value in the Raman spectrum of the t-1 th iteration, +.>Representing an ith value in the fitting result of the B-spline function of the t-th iteration; in particular, the Raman spectrum of iteration 0 +.>Namely Raman spectrum after pretreatment +.>The specific calculation formula is as follows:
further, the step 5 specifically includes: setting termination accuracyWhen->When the iteration is stopped, the baseline +.>Otherwise, repeating the steps 3 and 4; when t is 0, < >>Is Raman spectrum after pretreatment->
According to another aspect of the present application, there is provided an asymmetric raman spectrum baseline correction apparatus comprising:
raman spectrum acquisition module: the method comprises the steps of preprocessing an input original Raman spectrum to obtain a Raman spectrum X;
peak area determination module: for determining the peak region of the raman spectrum X using a smooth derivative method;
b spline function fitting module: after the X part point of the Raman spectrum is used as a control point, a B spline function is used for fitting a base line between the control points, the order of the B spline function is set to be 3, the control point of the B spline function is set to be 5 in a non-peak area, and the control point of the B spline function is set to be 15 in a peak area;
updating a Raman spectrum module: taking the result of B spline function fitting as a base line Z, and according to the base line Z and Raman spectrumObtaining Raman spectrum->
And a termination condition setting module: for setting a termination condition: if it isThen output the baseline vector Z, ">For termination accuracy; otherwise, repeating the B spline function fitting module and the updating Raman spectrum module.
According to still another aspect of the present application, there is provided a storage medium storing a program capable of executing the above asymmetric raman spectrum baseline correction method.
The error transformation used in the present method results from an asymmetric loss function, where large positive deviations are penalized less than least squares loss, and thus the present method possesses good characteristics for those estimates in asymmetric losses. Furthermore, the present method uses simple root error adjustment, avoiding the troublesome optimization of non-traditional loss functions required in all asymmetric loss-based methods. Therefore, the correction method is easier to realize, has higher calculation efficiency and is very suitable for automatically analyzing the base line.
Drawings
The invention may be better understood by referring to the following description in conjunction with the accompanying drawings in which like or similar reference numerals are used to indicate like or similar elements throughout the several views. The accompanying drawings, which are included to provide a further illustration of the preferred embodiments of the invention and together with a further understanding of the principles and advantages of the invention, are incorporated in and constitute a part of this specification. In the drawings:
FIG. 1 is a comparison of baseline correction results using the correction method of the present invention.
Detailed Description
Embodiments of the present invention will be described below with reference to the accompanying drawings. Elements and features described in one drawing or embodiment of the invention may be combined with elements and features shown in one or more other drawings or embodiments. It should be noted that the illustration and description of components and processes known to those skilled in the art, which are not relevant to the present invention, have been omitted in the drawings and description for the sake of clarity.
Example 1
The embodiment of the invention provides an asymmetric Raman spectrum baseline correction method, which comprises the following steps:
step 1: acquiring a Raman spectrum: the Raman spectrum is subjected to pretreatment operations such as dark current deduction, normalization, sg smoothing and the like to obtain a pretreated Raman spectrum
Step 2: the peak area is determined using a smooth derivative method: detecting peaks by searching for zeros in the smoothed first derivative that exceed the slope threshold and the amplitude threshold; where the smooth derivative method may ignore peak areas that are too low, too wide, or too narrow to obtain the desired normal peak areas. In addition, wavelet transforms, markov smoothing, etc. may be used to determine the peak area.
Step 3: after selecting X part points of a Raman spectrum as control points, fitting a baseline between the control points by using a B spline function, setting the order of the B spline function to 3, setting the control point of the B spline function to 5 in a non-peak area and setting the control point of the B spline function to 15 in a peak area in order to eliminate noise and reduce calculation amount; the process of B spline function fitting is as follows:
set a set u= { U containing m+1 non-decreasing numbers 0 <= u 2 <= u 3 <= ...<= u m }. Wherein u is i For a node, the set U is a node vector, and the half-open interval [ ui, ui+1) is the i-th node interval.
Defining B-spline basis functions asWherein p is the order of the basis function, i is the ith p-th order B spline basis function; when the order p is 0, the B-spline basis function is defined as a step function as follows:
the remaining B-spline basis functions are defined recursively:
b-spline function defining k-th orderThe method comprises the following steps:
wherein k is the order, n is the number of control points minus 1,for the value of the j-th control point, +.>Is the j-th B spline basis function of k-th order. The number of control points n+1 and the number of nodes m+1 should satisfy n=m-k-1.
And (5) obtaining the division result of the peak area in the step (2). Setting a control point of a B spline function as 5 in a non-peak area, setting the order of the B spline function as 3, obtaining 5 quartering points of the non-peak area, taking the 5 points as the control point of the B spline function, supplementing the 5 control points, filling 2 points in front and back at equal intervals, and taking the total 9 points as a node vector U. Using the node vector of 9 nodes and the 5 control points, a 3-order B-spline function is calculated. Substituting the wave number values of all points in the non-peak area into the B spline function to obtain the fitting value of the B spline function. Setting a control point of a B spline function as 15 in a peak area, setting the order of the B spline function as 3, acquiring 15 fourteen equally divided points in a non-peak area, taking the 15 points as the control point of the B spline function, supplementing the 15 control points, filling 2 points in front and back at equal intervals, and taking the total 19 points as a node vector U. Using the node vector of 19 nodes and the 15 control points, a 3-order B-spline function is calculated. Substituting the wave number values of all points in the peak area into the B spline function to obtain the fitting value of the B spline function. The fitting values of all the B-spline functions form a fitting result y of the B-spline functions.
Step 4: taking the fitting result y of the B spline function obtained in the step 3 as a base line Z (t) If (if)Less than or equal to baseline->Then->Equal to->Otherwise->. Wherein (1)>Represents the ith value in the Raman spectrum of the t-1 th iteration, +.>The ith value in the fitting result of the B-spline function representing the t-th iteration, in particular the raman spectrum of the 0 th iteration +.>Namely Raman spectrum after pretreatment +.>The specific calculation formula is as follows:
step 5: setting termination accuracyWhen->When the iteration is stopped, the baseline +.>Otherwise, repeating the steps 3 and 4. Specifically, when t is 0, +.>Is Raman spectrum after pretreatment->
Wherein the B-spline function of each peak region and the B-spline function of each non-peak region select different functions according to specific requirements. This is a matter of routine skill in the art and will not be described in detail herein.
FIG. 1 is a comparison of baseline correction results using the correction method of the present invention. The error transformation used in the method results from an asymmetric loss function, where large positive deviations are penalized for less than least squares loss. Thus, the present method possesses good characteristics for those estimates in the asymmetry penalty. Furthermore, the present method uses simple root error adjustment, avoiding the troublesome optimization of non-traditional loss functions required in all asymmetric loss-based methods. Therefore, it is easier to implement, more computationally efficient, and well suited for automated analysis of baselines.
Due to unavoidable noise disturbances in the actual measurement, the pure baseline signal may fluctuate to some extent in the region without spectral peaks, which may lead to an estimated baseline deviating from the actual baseline. In contrast, in the baseline correction in the prior art, a smoother is used for predicting the smoothing trend, and then a loss function is used for adjusting fitting; the method and the device respectively process the peak area and the non-peak area, and use B spline to replace a common Whittaker smoother to predict the smoothing trend so as to eliminate the influence of noise on the baseline estimation. In addition, after the partial points of the Raman spectrum are taken as the control points, the B spline function is used for fitting the base line between the control points instead of fitting the curve in the prior art, so that the estimated value of the base line is kept close to the real base line, and all peaks are well reserved.
Example 2
The present embodiment provides an asymmetric raman spectrum baseline correction apparatus, which includes:
raman spectrum acquisition module: the method comprises the steps of preprocessing an input original Raman spectrum to obtain a Raman spectrum X;
peak area determination module: for determining the peak region of the raman spectrum X using a smooth derivative method;
b spline function fitting module: after the X part point of the Raman spectrum is used as a control point, a B spline function is used for fitting a base line between the control points, the order of the B spline function is set to be 3, the control point of the B spline function is set to be 5 in a non-peak area, and the control point of the B spline function is set to be 15 in a peak area;
updating a Raman spectrum module: taking the result of B spline function fitting as a base line Z, and according to the base line Z and Raman spectrumObtaining Raman spectrum->
And a termination condition setting module: for setting a termination condition: if it isThen output the baseline vector Z, ">For termination accuracy; otherwise, repeating the B spline function fitting module and the updating Raman spectrum module.
Example 3
An embodiment of the present invention provides a storage medium storing a program capable of executing the above-described asymmetric raman spectrum baseline correction method.
It should be emphasized that the methods of the present invention are not limited to being performed in the time sequence described in the specification, but may be performed in other time sequences, in parallel or independently. Therefore, the order of execution of the methods described in the present specification does not limit the technical scope of the present invention.
While the invention has been disclosed in the context of specific embodiments, it should be understood that all embodiments and examples described above are illustrative rather than limiting. Various modifications, improvements, or equivalents of the invention may occur to persons skilled in the art and are within the spirit and scope of the following claims. Such modifications, improvements, or equivalents are intended to be included within the scope of this invention.

Claims (6)

1. An asymmetric raman spectrum baseline correction method is characterized in that: comprising the following steps:
step 1: inputting an original Raman spectrum, and preprocessing the original Raman spectrum to obtain a Raman spectrum X; the step 1 specifically includes: the original Raman spectrum is subjected to dark current deduction, normalization and sg smoothing operation to obtain a pretreated Raman spectrum
Step 2: determining the peak area of the raman spectrum X using a smooth derivative method;
step 3: after selecting X part points of a Raman spectrum as control points, fitting a base line between the control points by using a B spline function, setting the order of the B spline function as 3, setting the control point of the B spline function as 5 in a non-peak area, and setting the control point of the B spline function as 15 in a peak area;
after selecting the X part point of the Raman spectrum as a control point, the process of fitting the baseline between the control points by using a B spline function specifically comprises the following steps:
set a set u= { U containing m+1 non-decreasing numbers 0 <= u 2 <= u 3 <= ... <= u m Set U is a node vector, U i Is a node, half-open interval [ u ] i , u i +1) is the i-th node section;
defining B-spline basis functions asWherein p is the order of the basis function, i is the ith p-th order B spline basis function; when the order p is 0, the B-spline basis function is defined as a step function as follows:
defining the rest B spline basis functions:
b-spline function defining k-th orderThe method comprises the following steps:
wherein k is the order, n is the number of control points minus 1,for the value of the j-th control point, +.>A j-th B spline basis function of k-th order; the number n+1 of control points and the number m+1 of nodes satisfy the following conditions: n=m-k-1;
acquiring a peak area in the step 2, setting a control point of a B spline function as 5 in a non-peak area, setting the order of the B spline function as 3, and calculating a B spline function of 3 orders;
substituting the wave number values of all points in the non-peak area into the B spline function to obtain a fitting value of the B spline function in the non-peak area;
setting a control point of the B spline function as 15 in a peak area, setting the order of the B spline function as 3, and calculating a B spline function of 3 orders;
substituting the wave number values of all points in the peak area into the B spline function to obtain a fitting value of the B spline function in the peak area;
fitting values of the B spline function in the non-peak area and fitting values of the B spline function in the peak area jointly form a fitting result y of the B spline function;
step 4: taking the result of B spline function fitting as a base line Z, and according to the base line Z and Raman spectrumObtaining Raman spectrum->T is the iteration number, and specifically includes:
taking the fitting result y of the B spline function obtained in the step 3 as a base line Z (t) If (if)Less than or equal to baseline->Then->Equal to->Otherwise->The method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Represents the ith value in the Raman spectrum of the t-1 th iteration, +.>Raman spectrum representing the t-1 th iteration,/->Raman spectrum representing the t-th iteration, +.>Representing an ith value in the raman spectrum of the t-th iteration; />Representing an ith value in the fitting result of the B-spline function of the t-th iteration; in particular, the Raman spectrum of iteration 0 +.>Namely Raman spectrum after pretreatment +.>The specific calculation formula is as follows:
step 5: setting a termination condition: if it isOutputting a baseline vector Z; otherwise, returning to the step 3; wherein->For termination accuracy;
the step 5 specifically includes: setting termination accuracyWhen->When the iteration is stopped, the baseline +.>Otherwise, repeating the steps 3 and 4; when t is 0, < >>Is Raman spectrum after pretreatment->
2. The asymmetric raman spectrum baseline correction method according to claim 1, wherein: the step 2 of determining the peak area by using the smooth derivative method specifically includes: the peak is detected by searching for zeros in the smoothed first derivative that exceed the slope threshold and the amplitude threshold.
3. The asymmetric raman spectrum baseline correction method according to claim 1, wherein: setting a control point of a B spline function as 5 and an order of the B spline function as 3 in a non-peak area, and calculating the 3-order B spline function, wherein the method specifically comprises the following steps: setting a control point of a B spline function as 5 in a non-peak area, setting the order of the B spline function as 3, obtaining 5 quartering points of the non-peak area, taking the 5 points as the control point of the B spline function, supplementing the 5 control points, filling 2 points in front and back at equal intervals, and taking the total 9 points as a node vector U; using the node vector of 9 nodes and the 5 control points, a 3-order B-spline function is calculated.
4. The asymmetric raman spectrum baseline correction method according to claim 1, wherein: setting a control point of the B spline function as 15 in a peak area, setting the order of the B spline function as 3, and calculating the 3-order B spline function, wherein the method specifically comprises the following steps: setting a control point of a B spline function as 15 in a peak area, setting the order of the B spline function as 3, acquiring 15 fourteen equally divided points in a non-peak area, taking the 15 points as the control points of the B spline function, supplementing the 15 control points, filling 2 points in front and back at equal intervals, and taking the total 19 points as a node vector U; using the node vector of 19 nodes and the 15 control points, a 3-order B-spline function is calculated.
5. An asymmetric raman spectrum baseline correction device, characterized in that: comprising the following steps:
raman spectrum acquisition module: the method comprises the steps of preprocessing an input original Raman spectrum to obtain a Raman spectrum X;
peak area determination module: for determining the peak region of the raman spectrum X using a smooth derivative method;
b spline function fitting module: after the X part point of the Raman spectrum is used as a control point, a B spline function is used for fitting a base line between the control points, the order of the B spline function is set to be 3, the control point of the B spline function is set to be 5 in a non-peak area, and the control point of the B spline function is set to be 15 in a peak area;
in the B spline function fitting module, after selecting X part points of a Raman spectrum as control points, using a B spline function to fit a baseline between the control points specifically comprises the following steps:
set a set u= { U containing m+1 non-decreasing numbers 0 <= u 2 <= u 3 <= ... <= u m Set U is a node vector, U i Is a node, half-open interval [ u ] i , u i +1) is the i-th node section;
defining B-spline basis functions asWherein p is the order of the basis function, i is the ith p-th order B spline basis function; when the order p is 0, the B-spline basis function is defined as a step function as follows:
defining the rest B spline basis functions:
b-spline function defining k-th orderThe method comprises the following steps:
wherein k is the order, n is the number of control points minus 1,for the value of the j-th control point, +.>A j-th B spline basis function of k-th order; the number n+1 of control points and the number m+1 of nodes satisfy the following conditions: n=m-k-1;
obtaining a peak area output by a peak area determining module, setting a control point of a B spline function as 5 in a non-peak area, setting the order of the B spline function as 3, and calculating a B spline function of 3 order;
substituting the wave number values of all points in the non-peak area into the B spline function to obtain a fitting value of the B spline function in the non-peak area;
setting a control point of the B spline function as 15 in a peak area, setting the order of the B spline function as 3, and calculating a B spline function of 3 orders;
substituting the wave number values of all points in the peak area into the B spline function to obtain a fitting value of the B spline function in the peak area;
fitting values of the B spline function in the non-peak area and fitting values of the B spline function in the peak area jointly form a fitting result y of the B spline function;
updating a Raman spectrum module: taking the result of B spline function fitting as a base line Z, and according to the base line Z and Raman spectrumObtaining Raman spectrum->T is the iteration number;
the updated raman spectrum module specifically performs the following processes: taking a fitting result y of the B spline function obtained by the B spline function fitting module as a base line Z (t) If (if)Less than or equal to baseline->Then->Equal to->OtherwiseThe method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Represents the ith value in the Raman spectrum of the t-1 th iteration, +.>Raman spectrum representing the t-1 th iteration,/->Raman spectrum representing the t-th iteration, +.>Representing an ith value in the raman spectrum of the t-th iteration; />Representing an ith value in the fitting result of the B-spline function of the t-th iteration; in particular, the Raman spectrum of iteration 0 +.>Namely Raman spectrum after pretreatment +.>The specific calculation formula is as follows:
and a termination condition setting module: for setting a termination condition: if it isThen output the baseline vector Z, ">For termination accuracy; otherwise, repeatedly executing the B spline function fitting module and updating the Raman spectrum module; the termination condition setting module specifically performs the following process: setting termination precision +.>When->When the iteration is stopped, the baseline +.>Otherwise, repeatedly executing the B spline function fitting module and updating the Raman spectrum module; when t is 0, < >>Is Raman spectrum after pretreatment->
6. A storage medium, characterized by: a program capable of executing the asymmetric raman spectrum baseline correction method according to any one of claims 1 to 4 is stored.
CN202311588058.8A 2023-11-27 2023-11-27 Asymmetric Raman spectrum baseline correction method, device and storage medium Active CN117288739B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311588058.8A CN117288739B (en) 2023-11-27 2023-11-27 Asymmetric Raman spectrum baseline correction method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311588058.8A CN117288739B (en) 2023-11-27 2023-11-27 Asymmetric Raman spectrum baseline correction method, device and storage medium

Publications (2)

Publication Number Publication Date
CN117288739A CN117288739A (en) 2023-12-26
CN117288739B true CN117288739B (en) 2024-02-02

Family

ID=89253904

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311588058.8A Active CN117288739B (en) 2023-11-27 2023-11-27 Asymmetric Raman spectrum baseline correction method, device and storage medium

Country Status (1)

Country Link
CN (1) CN117288739B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118395059A (en) * 2024-06-27 2024-07-26 合肥金星智控科技股份有限公司 Characteristic peak fitting method and device based on spectrum data

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103217409A (en) * 2013-03-22 2013-07-24 重庆绿色智能技术研究院 Raman spectral preprocessing method
WO2014064447A1 (en) * 2012-10-25 2014-05-01 Renishaw Plc Spectroscopic apparatus and methods
CN103948393A (en) * 2014-05-21 2014-07-30 华侨大学 Near-infrared noninvasive detection method and device for contents of blood components
CN106053430A (en) * 2016-06-16 2016-10-26 重庆大学 Envelope line iteration method for trace gas Raman spectral detection baseline correction
CN108802000A (en) * 2018-03-16 2018-11-13 上海交通大学 A kind of lossless quick cholecalciferol-cholesterol content quantitative method based on the full spectrum analysis of Raman
CN108844939A (en) * 2018-03-14 2018-11-20 西安电子科技大学 Raman spectrum based on asymmetric weighted least-squares detects baseline correction method
CN115236062A (en) * 2022-07-14 2022-10-25 北京工商大学 Spectrum baseline correction method based on DE algorithm and non-uniform B-spline curve
CN115436339A (en) * 2022-10-17 2022-12-06 奥谱天成(厦门)光电有限公司 Automatic Raman spectrum wave number calibration device and calibration method thereof

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SG11201701248PA (en) * 2014-08-20 2017-03-30 Inst Nat Sante Rech Med Method for correcting an infrared absorption spectrum
GB201817028D0 (en) * 2018-10-19 2018-12-05 Renishaw Plc Spectroscopic apparatus and methods
US20210270742A1 (en) * 2020-02-28 2021-09-02 Virginia Tech Intellectual Properties, Inc. Peak-preserving and enhancing baseline correction methods for raman spectroscopy

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014064447A1 (en) * 2012-10-25 2014-05-01 Renishaw Plc Spectroscopic apparatus and methods
CN103217409A (en) * 2013-03-22 2013-07-24 重庆绿色智能技术研究院 Raman spectral preprocessing method
CN103948393A (en) * 2014-05-21 2014-07-30 华侨大学 Near-infrared noninvasive detection method and device for contents of blood components
CN106053430A (en) * 2016-06-16 2016-10-26 重庆大学 Envelope line iteration method for trace gas Raman spectral detection baseline correction
CN108844939A (en) * 2018-03-14 2018-11-20 西安电子科技大学 Raman spectrum based on asymmetric weighted least-squares detects baseline correction method
CN108802000A (en) * 2018-03-16 2018-11-13 上海交通大学 A kind of lossless quick cholecalciferol-cholesterol content quantitative method based on the full spectrum analysis of Raman
CN115236062A (en) * 2022-07-14 2022-10-25 北京工商大学 Spectrum baseline correction method based on DE algorithm and non-uniform B-spline curve
CN115436339A (en) * 2022-10-17 2022-12-06 奥谱天成(厦门)光电有限公司 Automatic Raman spectrum wave number calibration device and calibration method thereof

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
基于B样条的拉曼光谱基线校正方法;王昕等;光谱学与光谱分析;第34卷(第8期);全文 *
基于三次样条曲线拟合的激光拉曼光谱基线校正研究;聂磊;陶明;翟中生;;湖北工业大学学报(第01期);全文 *
基于平滑样条曲线结合离散状态转移算法的拉曼光谱基线校正方法;姚泽楷等;中国激光;第49卷(第18期);全文 *

Also Published As

Publication number Publication date
CN117288739A (en) 2023-12-26

Similar Documents

Publication Publication Date Title
CN117288739B (en) Asymmetric Raman spectrum baseline correction method, device and storage medium
CN108844939B (en) Raman spectrum detection baseline correction method based on asymmetric weighted least square
CN103217409B (en) Raman spectral preprocessing method
CN108801950B (en) Ultraviolet spectrum water quality abnormity detection method based on sliding window multi-scale principal component analysis
CN116388733B (en) Spectrum pretreatment method and device suitable for near infrared fruit nondestructive detection
CN117236084B (en) Intelligent management method and system for woodworking machining production
CN110032711A (en) A kind of Fast Kalman on-line checking filtering method adjusted based on dynamic state of parameters
Zhang Calibrating the degrees of freedom for automatic data smoothing and effective curve checking
CN105005978A (en) Spectrum real-time filtering method based on Savitzky-Golay filter parameter optimization
CN116793979A (en) Method for detecting chemical oxygen demand in water sample
CN115586162A (en) Noise reduction method and device for laser absorption spectrum
CN114611582B (en) Method and system for analyzing substance concentration based on near infrared spectrum technology
CN117743768A (en) Signal denoising method and system based on denoising generation countermeasure network and diffusion model
CN115171712A (en) Speech enhancement method suitable for transient noise suppression
CN117169193A (en) Method for judging transformer oil insulation aging based on Raman spectrum peak identification
CN114720433A (en) Automatic removing method for useless scattering of fluorescence spectrum
CN117169886A (en) High-efficiency phase unwrapping method based on unscented Kalman filtering
CN112307434A (en) Actually measured flow intelligent correction method based on Gaussian filtering
CN116484184A (en) Method and device for enhancing partial discharge defect sample of power equipment
CN112801936B (en) Self-adaptive background subtraction method for X-ray fluorescence spectrum
CN115561193A (en) Fourier infrared spectrometer data processing and analyzing system
CN115236062A (en) Spectrum baseline correction method based on DE algorithm and non-uniform B-spline curve
CN117809070B (en) Spectral data intelligent processing method for detecting pesticide residues in vegetables
CN112735386B (en) Voice recognition method based on glottal wave information
CN111175335B (en) Suppression method of nuclear magnetic resonance t1noise

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant