CN117150387A - Raman spectrum peak fitting method, medium, equipment and device - Google Patents

Raman spectrum peak fitting method, medium, equipment and device Download PDF

Info

Publication number
CN117150387A
CN117150387A CN202311435171.2A CN202311435171A CN117150387A CN 117150387 A CN117150387 A CN 117150387A CN 202311435171 A CN202311435171 A CN 202311435171A CN 117150387 A CN117150387 A CN 117150387A
Authority
CN
China
Prior art keywords
fitting
spectrum
peak
representing
value
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.)
Pending
Application number
CN202311435171.2A
Other languages
Chinese (zh)
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 CN202311435171.2A priority Critical patent/CN117150387A/en
Publication of CN117150387A publication Critical patent/CN117150387A/en
Pending legal-status Critical Current

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
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • G06F18/24155Bayesian classification

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Analytical Chemistry (AREA)
  • Probability & Statistics with Applications (AREA)
  • Pathology (AREA)
  • Immunology (AREA)
  • General Health & Medical Sciences (AREA)
  • Biochemistry (AREA)
  • Chemical & Material Sciences (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Investigating, Analyzing Materials By Fluorescence Or Luminescence (AREA)

Abstract

The application discloses a Raman spectrum peak fitting method, medium, equipment and device, wherein the method comprises the following steps: acquiring an original Raman spectrum, and preprocessing the original Raman spectrum to obtain an initial fitting spectrum; inputting the initial fitting spectrum into a pre-trained naive Bayes multi-classifier to output a corresponding peak number threshold value through the naive Bayes multi-classifier; carrying out peak value searching on the initial fitting spectrum based on multi-scale wavelet transformation, and determining an effective peak value according to a searching result and the peak value number threshold value; calculating fitting parameter values corresponding to each effective peak value by using a nonlinear least square method; performing curve fitting on each effective peak value based on the fitting parameter values to obtain a final fitting spectrum; the influence of baseline signal and noise interference on the number of main peaks of the Raman spectrum can be eliminated in the Raman spectrum peak fitting process, and the accuracy and reliability of final spectrum analysis are further improved.

Description

Raman spectrum peak fitting method, medium, equipment and device
Technical Field
The application relates to the technical field of spectral spectrogram analysis, in particular to a Raman spectrum fitting method, medium, equipment and device.
Background
In spectroscopic analysis, accurate identification and analysis of peak features in the spectrum is a key step in obtaining useful information. Raman spectral peak fitting is typically performed on the basis of a curve fit, during which peaks are searched.
In the related art, when raman spectrum peak fitting is performed, because baseline signals and noise interference often exist in spectrum data, the number of raman spectrum peaks is uncertain, and the accuracy and reliability of final spectrum analysis are further affected. Therefore, an effective raman spectrum peak fitting method is needed to eliminate the influence of baseline signal and noise interference, so as to ensure the accuracy and reliability of spectrum analysis.
Disclosure of Invention
The present application aims to solve at least one of the technical problems in the related art to some extent. Therefore, an object of the present application is to provide a raman spectrum peak fitting method, which can eliminate the influence of baseline signal and noise interference on the number of main peaks of a raman spectrum during the raman spectrum peak fitting process, thereby improving the accuracy and reliability of final spectrum analysis.
In a first aspect, an embodiment of the present application provides a raman spectrum peak fitting method, including the following steps: acquiring an original Raman spectrum, and preprocessing the original Raman spectrum to obtain an initial fitting spectrum; inputting the initial fitting spectrum into a pre-trained naive Bayes multi-classifier to output a corresponding peak number threshold value through the naive Bayes multi-classifier; carrying out peak value searching on the initial fitting spectrum based on multi-scale wavelet transformation, and determining an effective peak value according to a searching result and the peak value number threshold value; calculating fitting parameter values corresponding to each effective peak value by using a nonlinear least square method; and performing curve fitting on each effective peak value based on the fitting parameter values to obtain a final fitting spectrum.
According to the Raman spectrum peak fitting method, firstly, an original Raman spectrum is obtained, and the original Raman spectrum is preprocessed to obtain an initial fitting spectrum; then, inputting the initial fitting spectrum into a pre-trained naive Bayes multi-classifier to output a corresponding peak number threshold value through the naive Bayes multi-classifier; then, carrying out peak value searching on the initial fitting spectrum based on multi-scale wavelet transformation, and determining an effective peak value according to a searching result and the peak value number threshold value; then, calculating fitting parameter values corresponding to each effective peak value by using a nonlinear least square method; then, performing curve fitting on each effective peak value based on the fitting parameter values to obtain a final fitting spectrum; therefore, the influence of baseline signal and noise interference on the number of main peaks of the Raman spectrum is eliminated in the Raman spectrum peak fitting process, and the accuracy and reliability of final spectrum analysis are improved.
In some embodiments, preprocessing the raw raman spectrum to obtain an initial fitted spectrum comprises:
s201, performing polynomial fitting to obtain a first fitting spectrum;
s202, carrying out peak value elimination on the first fitting spectrum to obtain a second fitting spectrum, and calculating a fitting residual value corresponding to the second fitting spectrum;
s203, judging whether the second fitting spectrum completes baseline correction or not based on the fitting residual value; if yes, step S204 is executed, and if no, step S201 is returned to;
s204, taking the second fitting spectrum as an initial fitting spectrum.
In some embodiments, the fitting residual value is calculated by the following formula:
wherein,representing frequency or wave number, +.>Representing a second fitted spectrum, +.>Representing the original raman spectrum of the light,representing the first fitted spectrum, +.>Representing the fitting residual value, +.>Representing the average value of the second fitted spectrum obtained by multiple iterations,/->Representing a second fitted spectrum after the nth iteration.
In some embodiments, peak finding the initial fitted spectrum based on a multi-scale wavelet transform comprises: performing inner product operation based on the multi-scale wavelet function to obtain wavelet coefficients corresponding to each scale; calculating a corresponding local maximum value according to the wavelet coefficient, and constructing a ridge line based on the local maximum value; and carrying out main peak identification according to a preset signal-to-noise ratio threshold value and the constructed ridge line.
In some embodiments, each of the effective peaks is curve fitted by the following formula:
wherein,representing the magnitude after fitting, +.>Represents the center position after fitting, +.>Representing the half-width after the fit,representing the relative relationship between Lorentzian contribution and Gaussian contribution, ++>Representing frequency or wave number, +.>Representing a gaussian distribution->Half-width of Gaussian distribution after fitting, +.>Representing the half-width of the Lorentzian distribution after fitting, where=/>
In a second aspect, embodiments of the present application provide a computer readable storage medium having stored thereon a raman spectral peak fitting program which when executed by a processor implements a raman spectral peak fitting method as described above.
In a third aspect, an embodiment of the present application proposes a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, said processor implementing a raman spectral peak fitting method as described above when executing said program.
In a fourth aspect, an embodiment of the present application provides a raman spectrum peak fitting device, including: the preprocessing module is used for acquiring an original Raman spectrum and preprocessing the original Raman spectrum to obtain an initial fitting spectrum; the peak number prediction module is used for inputting the initial fitting spectrum into a naive Bayes multi-classifier trained in advance so as to output a corresponding peak number threshold value through the naive Bayes multi-classifier; the effective peak value determining module is used for searching the peak value of the initial fitting spectrum based on multi-scale wavelet transformation and determining an effective peak value according to a searching result and the peak value number threshold value; the fitting parameter determining module is used for calculating fitting parameter values corresponding to each effective peak value by using a nonlinear least square method; and the fitting module is used for performing curve fitting on each effective peak value based on the fitting parameter values so as to obtain a final fitting spectrum.
According to the Raman spectrum peak fitting device provided by the embodiment of the application, the preprocessing module is used for acquiring an original Raman spectrum and preprocessing the original Raman spectrum to obtain an initial fitting spectrum; the peak number prediction module is used for inputting the initial fitting spectrum into a pre-trained naive Bayes multi-classifier so as to output a corresponding peak number threshold value through the naive Bayes multi-classifier; the effective peak value determining module is used for searching the peak value of the initial fitting spectrum based on multi-scale wavelet transformation and determining an effective peak value according to the searching result and the peak value number threshold value; the fitting parameter determining module is used for calculating fitting parameter values corresponding to each effective peak value by using a nonlinear least square method; the fitting module is used for performing curve fitting on each effective peak value based on the fitting parameter values so as to obtain a final fitting spectrum; therefore, the influence of baseline signal and noise interference on the number of main peaks of the Raman spectrum is eliminated in the Raman spectrum peak fitting process, and the accuracy and reliability of final spectrum analysis are improved.
In some embodiments, the effective peak value determining module is further configured to perform an inner product operation based on a multi-scale wavelet function, so as to obtain a wavelet coefficient corresponding to each scale; calculating a corresponding local maximum value according to the wavelet coefficient, and constructing a ridge line based on the local maximum value; and carrying out main peak identification according to a preset signal-to-noise ratio threshold value and the constructed ridge line.
In some embodiments, each of the effective peaks is curve fitted by the following formula:
wherein,representing the magnitude after fitting, +.>Represents the center position after fitting, +.>Representing the half-width after the fit,representing the relative relationship between Lorentzian contribution and Gaussian contribution, ++>Representing frequency or wave number, +.>Representing a gaussian distribution->Half-width of Gaussian distribution after fitting, +.>Representing the half-width of the Lorentzian distribution after fitting, where=/>
Additional aspects and advantages of the application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the application.
Drawings
FIG. 1 is a flow chart of a Raman spectrum peak fitting method according to an embodiment of the application;
FIG. 2 is a schematic flow chart of a pretreatment process according to an embodiment of the application;
FIG. 3 is a schematic diagram showing the effect of Raman spectrum pretreatment according to an embodiment of the present application;
FIG. 4 is a diagram illustrating a conventional peak finding result according to an embodiment of the present application;
fig. 5 is a schematic diagram of a result of predicting by a naive bayes multi-classifier and then performing peak searching according to an embodiment of the present application;
FIG. 6 is a block schematic diagram of a computer device according to an embodiment of the application;
fig. 7 is a block schematic diagram of a raman spectral peak fitting device according to an embodiment of the application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative and intended to explain the present application and should not be construed as limiting the application.
The raman spectral peak fitting method according to the embodiment of the present application is described below with reference to the drawings.
Referring to fig. 1, fig. 1 is a flow chart of a raman spectrum peak fitting method according to an embodiment of the application, as shown in fig. 1, the raman spectrum peak fitting method includes the following steps:
s101, acquiring an original Raman spectrum, and preprocessing the original Raman spectrum to obtain an initial fitting spectrum.
That is, raw raman spectral data is acquired and pre-processed (e.g., baseline corrected to eliminate baseline signals in the raman spectral data) to obtain an initial fit spectrum.
In some embodiments, as shown in fig. 2, the original raman spectrum is preprocessed to obtain an initial fit spectrum, including:
s201, performing polynomial fitting to obtain a first fitting spectrum;
s202, carrying out peak value elimination on the first fitting spectrum to obtain a second fitting spectrum, and calculating a fitting residual value corresponding to the second fitting spectrum;
s203, judging whether the second fitting spectrum completes baseline correction or not based on the fitting residual value; if yes, step S204 is executed, and if no, step S201 is returned to;
s204, taking the second fitting spectrum as an initial fitting spectrum.
In some embodiments, the fitting residual value is calculated by the following equation:
wherein,representing frequency or wave number, +.>Representing a second fitted spectrum, +.>Representing the original raman spectrum of the light,representing the first fitted spectrum, +.>Representing the fitting residual value, +.>Representing the average value of the second fitted spectrum obtained by multiple iterations,/->Representing the second after the nth iterationThe spectra were fitted.
As an example, first, a polynomial fit is performed to obtain a first fitted spectrum; then, carrying out peak value elimination on the first fitting spectrum to obtain a second fitting spectrum; specifically, if the actual value in the original Raman spectrum is larger than the fitting value in the first fitting spectrum compared with the original Raman spectrum, the actual value is removed, and the fitting value is adopted for substitution; if the actual value in the Raman spectrum is smaller than or equal to the fitting value in the first fitting spectrum, the actual value is used, and then a second fitting spectrum after peak value elimination is obtained. Then, a fitting residual value of the second fitting spectrum is calculated.
Specifically, the fitting residual value is calculated by the following formula:
wherein,representing frequency or wave number, +.>Representing a second fitted spectrum, +.>Representing the original raman spectrum of the light,representing the first fitted spectrum, +.>Representing the fitting residual value, +.>Representing the average value of the second fitted spectrum obtained by multiple iterations,/->Representing a second fitted spectrum after the nth iteration.
Then, judging whether the cycle termination condition is met; specifically, the output fitting value is the baseline, and the cycle termination judgment condition is: when i=1, the judgment condition is thatThe method comprises the steps of carrying out a first treatment on the surface of the When i is not equal to 1, the judgment condition is +.>The method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Indicate->And residual values.
Then, if the cycle termination condition is met, taking the current second fitting spectrum as an initial fitting spectrum; if the loop termination condition is not satisfied, returning to the step of polynomial fitting.
In order to better explain the baseline correction effect of the present application, fig. 3 is an example, and fig. 3 is a schematic view of the effect of the baseline correction method according to the present application after baseline correction.
S102, inputting the initial fitting spectrum into a pre-trained naive Bayes multi-classifier, and outputting a corresponding peak number threshold value through the naive Bayes multi-classifier.
That is, first, the naive bayes multi-classifier is trained in advance, so that the initial fitting spectrum is predicted through the naive bayes multi-classifier trained in advance, and the corresponding peak number is determined.
As an example, first, a raman spectrum database is established, which contains basic information of 1884 substances, including the names of the substances, CAS numbers (substance number identification numbers) of the substances, raman spectrum scattering intensities of the substances, and the main peak positions of raman spectra of the substances. Next, we take raman spectrum scattering intensity data of each substance in the raman spectrum database as data input to the na iotave bayesian multi-classifier, and we calculate the length of main peak position data of each database as the number of main peaks, and the number of main peaks as the input labels to train the na iotave bayesian multi-classifier.
Specifically, first, according to information in a raman database, raman spectrum data of a substance and raman main peak data keypoint corresponding to the raman spectrum data are obtained, and data and keypoint (key feature points) of the substance are one-dimensional arrays. And obtaining the length of the main peak data keypoint of each substance, namely the number of the main raman peaks corresponding to the raman spectrum data, and marking the number as keypoint_len. Then, taking the acquired Raman spectrum data of the substances as data input into a naive Bayes multi-classifier, wherein the data composed of all the Raman spectrum data in a database is an array of 1884 x 3300 dimensions, 1884 is the number of the substances, and 3300 is the number of coordinate points of the Raman spectrum; and taking the keypoint_len formed by all the Raman spectrum data as a label corresponding to the naive Bayesian multi-classifier data, wherein the label is an array of 1884 x 1 dimension, and the total number of 1884 substances is 1884, and the number of main peaks corresponding to each Raman spectrum data is recorded in 1.
It should be noted that the naive bayes multi-classifier is a classifier based on a naive bayes algorithm, and is used to divide the samples into multiple classes. In contrast to the two-classifier, the multi-classifier needs to model each class and calculate the posterior probability of each class. The samples are then assigned to the class with the highest posterior probability. We input the data and labels into a naive bayes multi-classifier for model training. And the model obtained through training predicts the number of peaks, taking PBAT as an example, and inputting the Raman spectrum data of the PBAT into a trained naive Bayes multi-classifier to predict the number of main peaks to be 7.
S103, carrying out peak value searching on the initial fitting spectrum based on multi-scale wavelet transformation, and determining an effective peak value according to a searching result and a peak value number threshold value.
In some embodiments, peak finding for the initial fit spectrum based on a multi-scale wavelet transform includes: performing inner product operation based on the multi-scale wavelet function to obtain wavelet coefficients corresponding to each scale; calculating a corresponding local maximum value according to the wavelet coefficient, and constructing a ridge line based on the local maximum value; and carrying out main peak identification according to a preset signal-to-noise ratio threshold value and the constructed ridge line.
As an example, it should be noted first that the wavelet transform peak finding method is designed to find peaks in noise data, but by proper parameter selection it should be applicable to different peak shapes. Signal to noise ratio, peak intensity threshold, peak shape, ridge line, maximum, peak width, etc. are all conditions for peak detection. Then, the multi-scale wavelet transform decomposes the signal into approximation coefficients and detail coefficients at different scales, and by changing the scale parameters of the wavelet function, the frequency range of the wavelet function can be adjusted. Smaller dimensions correspond to higher frequencies and larger dimensions correspond to lower frequencies. Here we scale by changing the scaling parameters of the wavelet function. The decomposition process obtains wavelet coefficients of each scale by carrying out inner product operation on the signals and wavelet functions of different scales. Then, after the wavelet coefficients are obtained, local maxima or high energy regions need to be found in the wavelet coefficients. These positions generally correspond to peaks in the signal. The local maxima may be determined by comparing each wavelet coefficient to its neighboring wavelet coefficients. Next, ridge line tracking is performed, and a ridge line is constructed by tracking local maxima on adjacent scales from the local maxima. In the phase tracking, the direction having the largest phase change is selected as the tracking direction. In amplitude tracking, the direction having the largest amplitude variation is selected as the tracking direction. Then, the main peak is identified, a signal-to-noise ratio threshold is set, a higher signal-to-noise ratio indicating a relatively strong signal, possibly the main peak. The wavelet transform formula is as follows:
for controlling the dimensionsScaling of the wavelet function; />Controlling the translation of the wavelet function for the translation amount; />Representing the original signal->Is->Independent variable of->Representing the basis functions. The initial fit spectrum is peaked. For better illustration, as shown in fig. 4 and fig. 5, fig. 4 is a schematic diagram of the result of peak searching without prediction by the na iotave bayesian multi-classifier, and fig. 5 is a schematic diagram of the result of peak searching after prediction by the na iotave bayesian multi-classifier.
S104, calculating fitting parameter values corresponding to each effective peak value by using a nonlinear least square method.
As an example, first, it is to be noted that the nonlinear least squares method (Levenberg-Marquardt) is an optimization algorithm for fitting a nonlinear model. Then, the objective function is determined as: the minimum of the sum of squares of residuals between the observed data and the model predictions, we use the objective function to determine the best parameter values, fitting the peak shape, position and shape parameters of the spectral lines. Then, the initial parameter value is set to: ctr, amp, wid. Wherein, the central position (ctr) is the value of x of the corresponding peak point in the spectrogram; amplitude (amp) is the value of y for the corresponding peak point in the spectrogram; the half-width (wid) initial parameter we set to 60, where the half-width initial parameter can vary in size. Then, a model function is fitted: voigt because the Voigt function is derived from the convolution of a Gaussian function and a Lorentz function. Gaussian functions are well descriptive of spectral lines caused by molecular vibrations, while lorentz functions are useful for describing spectral lines caused by lattice vibrations or other linewidth effects. The form of the Voigt function can simultaneously consider the two effects, so that the fitting result is more accurate. Then, we call here a fitting algorithm: in Python, this can be implemented using the cut_fit function of the SciPy library, which is internally fitted using the Levenberg-Marquardt algorithm. Transferring the objective function, the independent variable and the dependent variable as parameters to the cut_fit function, providing initial parameter values at the same time, and calling the fitting function as follows:
from scipy.optimize import curve_fit
popt, pcov = curve_fit(voigt_func, xdata, ydata, p0)
- "target_func": a defined objective function.
- 'xdata': observation data of the independent variables.
- 'ydata': observation data for dependent variables.
- 'p 0': the array of initial parameter values is an array of (ctr, amp, wid), wherein the three numbers ctr, amp, wid are in one-to-one correspondence.
Then, iterative optimization: the Levenberg-Marquardt algorithm iteratively adjusts the model parameters to minimize the value of the objective function. In the iterative process, the algorithm can adaptively adjust the step size according to the change condition of the parameters so as to balance the trade-off between the Newton method and the gradient descent method. After the algorithm converges, the optimal parameter estimation value is obtained. These parameter values are stored in popt, while the estimated parameter covariance matrix is stored in pcov.
S105, performing curve fitting on each effective peak value based on the fitting parameter values to obtain a final fitting spectrum.
In some embodiments, each effective peak is curve fitted by the following formula:
wherein,representing the magnitude after fitting, +.>Represents the center position after fitting, +.>Representing the half-width after the fit,representing the relative relationship between Lorentzian contribution and Gaussian contribution, ++>Representing frequency or wave number, +.>Representing a gaussian distribution->Half-width of Gaussian distribution after fitting, +.>Representing the half-width of the Lorentzian distribution after fitting, where=/>
As an example, taking the position of a coordinate point (2181, 20) in a PBAT spectrogram as an example, a unimodal fit is performed; first, the nearest ctr to the distance (2181, 20) is selected in p0, and the set of parameters corresponding to the ctr is taken. Then, a curve fitting was performed on the peak at this point. And (3) carrying out voigt function according to the estimated value of the parameter and the data of the X-axis of the Raman spectrum of the user, so as to obtain the fitting curve of the user.
The Voigt formula is as follows:
in raman spectral curve fitting, the Voigt formula is used to describe the shape of the spectral line. Voigt functionThe number is a complex function consisting of a gaussian distribution function and a lorentz distribution function. Wherein,representing the magnitude after fitting, +.>Represents the center position after fitting, +.>Represents the half width after fitting, +.>Representing the relative relationship between Lorentzian contribution and Gaussian contribution, ++>Representing frequency or wave number, +.>Representing a gaussian distribution->Half-width of Gaussian distribution after fitting, +.>Representing the half-width of the Lorentzian distribution after fitting, here +.>=/>
In summary, according to the raman spectrum peak fitting method of the embodiment of the present application, an original raman spectrum is first obtained, and the original raman spectrum is preprocessed to obtain an initial fitted spectrum; then, inputting the initial fitting spectrum into a pre-trained naive Bayes multi-classifier to output a corresponding peak number threshold value through the naive Bayes multi-classifier; then, carrying out peak value searching on the initial fitting spectrum based on multi-scale wavelet transformation, and determining an effective peak value according to a searching result and the peak value number threshold value; then, calculating fitting parameter values corresponding to each effective peak value by using a nonlinear least square method; then, performing curve fitting on each effective peak value based on the fitting parameter values to obtain a final fitting spectrum; therefore, the influence of baseline signal and noise interference on the number of main peaks of the Raman spectrum is eliminated in the Raman spectrum peak fitting process, and the accuracy and reliability of final spectrum analysis are improved.
In order to implement the above-described embodiments, an embodiment of the present application proposes a computer-readable storage medium having stored thereon a raman spectral peak fitting program which, when executed by a processor, implements a raman spectral peak fitting method as described above.
In order to implement the above-mentioned embodiments, as shown in fig. 6, an embodiment of the present application proposes a computer device, including a memory 601, a processor 602, and a computer program stored on the memory 601 and executable on the processor 602, where the processor 602 implements the raman spectral peak fitting method as described above when executing the program.
In order to achieve the above embodiment, an embodiment of the present application provides a raman spectrum peak fitting device, as shown in fig. 7, including: the system comprises a preprocessing module 10, a peak number prediction module 20, an effective peak value determination module 30, a fitting parameter determination module 40 and a fitting module 50.
The preprocessing module 10 is used for acquiring an original raman spectrum and preprocessing the original raman spectrum to obtain an initial fitting spectrum;
the peak number prediction module 20 is configured to input the initial fitting spectrum into a naive bayes multi-classifier trained in advance, so as to output a corresponding peak number threshold value through the naive bayes multi-classifier;
the effective peak value determining module 30 is configured to perform peak value searching on the initial fitted spectrum based on multi-scale wavelet transformation, and determine an effective peak value according to the searching result and the peak value number threshold;
the fitting parameter determining module 40 is configured to calculate a fitting parameter value corresponding to each effective peak value by using a nonlinear least square method;
the fitting module 50 is configured to perform curve fitting on each of the effective peaks based on the fitting parameter values to obtain a final fitted spectrum.
In some embodiments, the effective peak value determining module is further configured to perform an inner product operation based on a multi-scale wavelet function, so as to obtain a wavelet coefficient corresponding to each scale;
calculating a corresponding local maximum value according to the wavelet coefficient, and constructing a ridge line based on the local maximum value;
and carrying out main peak identification according to a preset signal-to-noise ratio threshold value and the constructed ridge line.
In some embodiments, each of the effective peaks is curve fitted by the following formula:
in raman spectral curve fitting, the Voigt formula is used to describe the shape of the spectral line. The Voigt function is a complex function consisting of a gaussian distribution function and a lorentz distribution function. Wherein,representing the magnitude after fitting, +.>Represents the center position after fitting, +.>Represents the half width after fitting, +.>Representing the relative relationship between Lorentzian contribution and Gaussian contribution, ++>Representing frequency or wave number, +.>Representing a gaussian distribution->Half-width of Gaussian distribution after fitting, +.>Representing the half-width of the Lorentzian distribution after fitting, here +.>=/>
It should be noted that the above description of the raman spectral peak fitting method is also applicable to the raman spectral peak fitting device, and will not be described herein.
In summary, according to the raman spectrum peak fitting device provided by the embodiment of the application, the preprocessing module is configured to obtain an original raman spectrum, and preprocess the original raman spectrum to obtain an initial fitting spectrum; the peak number prediction module is used for inputting the initial fitting spectrum into a pre-trained naive Bayes multi-classifier so as to output a corresponding peak number threshold value through the naive Bayes multi-classifier; the effective peak value determining module is used for searching the peak value of the initial fitting spectrum based on multi-scale wavelet transformation and determining an effective peak value according to the searching result and the peak value number threshold value; the fitting parameter determining module is used for calculating fitting parameter values corresponding to each effective peak value by using a nonlinear least square method; the fitting module is used for performing curve fitting on each effective peak value based on the fitting parameter values so as to obtain a final fitting spectrum; therefore, the influence of baseline signal and noise interference on the number of main peaks of the Raman spectrum is eliminated in the Raman spectrum peak fitting process, and the accuracy and reliability of final spectrum analysis are improved.
It should be noted that the logic and/or steps represented in the flowcharts or otherwise described herein, for example, may be considered as a ordered listing of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings are merely for convenience in describing the present application and simplifying the description, and do not indicate or imply that the device or element being referred to must have a specific orientation, be configured and operated in a specific orientation, and therefore should not be construed as limiting the present application.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
In the present application, unless explicitly specified and limited otherwise, the terms "mounted," "connected," "secured," and the like are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; either directly or indirectly, through intermediaries, or both, may be in communication with each other or in interaction with each other, unless expressly defined otherwise. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art according to the specific circumstances.
In the present application, unless expressly stated or limited otherwise, a first feature "up" or "down" a second feature may be the first and second features in direct contact, or the first and second features in indirect contact via an intervening medium. Moreover, a first feature being "above," "over" and "on" a second feature may be a first feature being directly above or obliquely above the second feature, or simply indicating that the first feature is level higher than the second feature. The first feature being "under", "below" and "beneath" the second feature may be the first feature being directly under or obliquely below the second feature, or simply indicating that the first feature is less level than the second feature.
While embodiments of the present application have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the application, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the application.

Claims (10)

1. A raman spectral peak fitting method, comprising the steps of:
acquiring an original Raman spectrum, and preprocessing the original Raman spectrum to obtain an initial fitting spectrum;
inputting the initial fitting spectrum into a pre-trained naive Bayes multi-classifier to output a corresponding peak number threshold value through the naive Bayes multi-classifier;
carrying out peak value searching on the initial fitting spectrum based on multi-scale wavelet transformation, and determining an effective peak value according to a searching result and the peak value number threshold value;
calculating fitting parameter values corresponding to each effective peak value by using a nonlinear least square method;
and performing curve fitting on each effective peak value based on the fitting parameter values to obtain a final fitting spectrum.
2. A raman spectrum peak fitting method according to claim 1, wherein preprocessing the original raman spectrum to obtain an initial fitted spectrum comprises:
s201, performing polynomial fitting to obtain a first fitting spectrum;
s202, carrying out peak value elimination on the first fitting spectrum to obtain a second fitting spectrum, and calculating a fitting residual value corresponding to the second fitting spectrum;
s203, judging whether the second fitting spectrum completes baseline correction or not based on the fitting residual value; if yes, step S204 is executed, and if no, step S201 is returned to;
s204, taking the second fitting spectrum as an initial fitting spectrum.
3. A raman spectral peak fitting method according to claim 2, wherein said fitting residual value is calculated by the following formula:
wherein,representing frequency or wave number, +.>Representing a second fitted spectrum, +.>Representing the original raman spectrum, +.>Representing the first fitted spectrum, +.>Representing the fitting residual value, +.>Representing the average value of the second fitted spectrum obtained by multiple iterations,/->Representing a second fitted spectrum after the nth iteration.
4. A raman spectral peak fitting method according to claim 1, wherein peak finding the initial fitted spectrum based on a multi-scale wavelet transform comprises:
performing inner product operation based on the multi-scale wavelet function to obtain wavelet coefficients corresponding to each scale;
calculating a corresponding local maximum value according to the wavelet coefficient, and constructing a ridge line based on the local maximum value;
and carrying out main peak identification according to a preset signal-to-noise ratio threshold value and the constructed ridge line.
5. A raman spectral peak fitting method according to claim 1, wherein each of said effective peaks is curve fitted by the formula:
wherein,representing the magnitude after fitting, +.>Represents the center position after fitting, +.>Represents the half width after fitting, +.>Representing the relative relationship between Lorentzian contribution and Gaussian contribution, ++>Representing frequency or wave number, +.>The gaussian distribution is represented by the formula,half-width of Gaussian distribution after fitting, +.>Representing the half-width of the Lorentzian distribution after fitting, here +.>=
6. A computer readable storage medium, characterized in that it has stored thereon a raman spectral peak fitting program which, when executed by a processor, implements a raman spectral peak fitting method according to any one of claims 1-5.
7. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the raman spectral peak fitting method according to any one of claims 1-5 when executing the program.
8. A raman spectral peak fitting device, comprising:
the preprocessing module is used for acquiring an original Raman spectrum and preprocessing the original Raman spectrum to obtain an initial fitting spectrum;
the peak number prediction module is used for inputting the initial fitting spectrum into a naive Bayes multi-classifier trained in advance so as to output a corresponding peak number threshold value through the naive Bayes multi-classifier;
the effective peak value determining module is used for searching the peak value of the initial fitting spectrum based on multi-scale wavelet transformation and determining an effective peak value according to a searching result and the peak value number threshold value;
the fitting parameter determining module is used for calculating fitting parameter values corresponding to each effective peak value by using a nonlinear least square method;
and the fitting module is used for performing curve fitting on each effective peak value based on the fitting parameter values so as to obtain a final fitting spectrum.
9. A raman spectral peak fitting apparatus according to claim 8, wherein said effective peak determining module is further configured to perform an inner product operation based on a multi-scale wavelet function to obtain wavelet coefficients corresponding to each scale;
calculating a corresponding local maximum value according to the wavelet coefficient, and constructing a ridge line based on the local maximum value;
and carrying out main peak identification according to a preset signal-to-noise ratio threshold value and the constructed ridge line.
10. A raman spectral peak fitting apparatus according to claim 8, wherein each of said effective peaks is curve fitted by the formula:
wherein,representing the magnitude after fitting, +.>Represents the center position after fitting, +.>Represents the half width after fitting, +.>Representing the relative relationship between Lorentzian contribution and Gaussian contribution, ++>Representing frequency or wave number, +.>The gaussian distribution is represented by the formula,half-width of Gaussian distribution after fitting, +.>Representing the half-width of the Lorentzian distribution after fitting, here +.>=
CN202311435171.2A 2023-11-01 2023-11-01 Raman spectrum peak fitting method, medium, equipment and device Pending CN117150387A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311435171.2A CN117150387A (en) 2023-11-01 2023-11-01 Raman spectrum peak fitting method, medium, equipment and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311435171.2A CN117150387A (en) 2023-11-01 2023-11-01 Raman spectrum peak fitting method, medium, equipment and device

Publications (1)

Publication Number Publication Date
CN117150387A true CN117150387A (en) 2023-12-01

Family

ID=88912518

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311435171.2A Pending CN117150387A (en) 2023-11-01 2023-11-01 Raman spectrum peak fitting method, medium, equipment and device

Country Status (1)

Country Link
CN (1) CN117150387A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220018922A1 (en) * 2018-11-20 2022-01-20 Emory University Systems and Methods for Rapidly Determining One or More Metabolite Measurements from MR Spectroscopy Data
CN114216877A (en) * 2021-12-14 2022-03-22 安徽大学 Automatic detection and reconstruction method and system for spectral peak in tea near infrared spectral analysis
CN114878544A (en) * 2022-05-27 2022-08-09 中国人民解放军32181部队 Method for identifying target component from mixture SERS spectrum
CN116840214A (en) * 2023-06-30 2023-10-03 江苏理工学院 Method for diagnosing brain tumor and cerebral infarction

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220018922A1 (en) * 2018-11-20 2022-01-20 Emory University Systems and Methods for Rapidly Determining One or More Metabolite Measurements from MR Spectroscopy Data
CN114216877A (en) * 2021-12-14 2022-03-22 安徽大学 Automatic detection and reconstruction method and system for spectral peak in tea near infrared spectral analysis
CN114878544A (en) * 2022-05-27 2022-08-09 中国人民解放军32181部队 Method for identifying target component from mixture SERS spectrum
CN116840214A (en) * 2023-06-30 2023-10-03 江苏理工学院 Method for diagnosing brain tumor and cerebral infarction

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李涛涛 等: "基于高斯-洛伦兹分峰拟合的线结构光条中心的提取方法", 《激光与光电子学进展》, vol. 56, no. 07, pages 1 - 9 *
范贤光 等: "基于特征提取的低信噪比拉曼光谱去噪方法研究", 《光谱学与光谱分析》, vol. 36, no. 12, pages 4082 - 4086 *

Similar Documents

Publication Publication Date Title
Wang et al. Recent advances of chemometric calibration methods in modern spectroscopy: Algorithms, strategy, and related issues
Zhang et al. Understanding the learning mechanism of convolutional neural networks in spectral analysis
Anitha et al. Brain tumour classification using two‐tier classifier with adaptive segmentation technique
Trevisan et al. Extracting biological information with computational analysis of Fourier-transform infrared (FTIR) biospectroscopy datasets: current practices to future perspectives
WO2015054666A1 (en) Systems and methods for quantitative analysis of histopathology images using multi-classifier ensemble schemes
US20190339205A1 (en) Method for removing background from spectrogram, method of identifying substances through raman spectrogram, and electronic apparatus
CN105279379B (en) Tera-hertz spectra feature extracting method based on convex combination Kernel principal component analysis
Parfait et al. Classification of prostate magnetic resonance spectra using support vector machine
US20100169051A1 (en) Optimized Stochastic Resonance Signal Detection Method
WO2008019382A2 (en) Quantum resonance interferometry for detecting signals
US11550823B2 (en) Preprocessing for a classification algorithm
Atal et al. A hybrid feature extraction and machine learning approaches for epileptic seizure detection
CN109446962A (en) Land cover interannual variance detection method and system
Sonobe et al. Hyperspectral wavelength selection for estimating chlorophyll content of muskmelon leaves
Mishro et al. Novel fuzzy clustering‐based bias field correction technique for brain magnetic resonance images
CN110688934B (en) Space sampling active learning classification method, electronic equipment and storage medium
CN110648763A (en) Method and apparatus for tumor assessment using artificial intelligence for spectral analysis
CN117150387A (en) Raman spectrum peak fitting method, medium, equipment and device
Ge et al. Self-training algorithm for hyperspectral imagery classification based on mixed measurement k-nearest neighbor and support vector machine
Belov et al. A method of finding optimal parameters of speckle noise reduction filters
Omidikia et al. Uninformative variable elimination assisted by gram–Schmidt orthogonalization/successive projection algorithm for descriptor selection in QSAR
US11610112B2 (en) Method for the computer-aided configuration of a data-driven model on the basis of training data
Sargin et al. Tracing curvilinear structures in live cell images
CN116519661A (en) Rice identification detection method based on convolutional neural network
Wang et al. Synthetic aperture radar image segmentation using fuzzy label field‐based triplet Markov fields model

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