Calculation program, calculation method, and information processing device
By varying parameters in the nonlinear least squares method and selecting the most accurate baseline based on peak number and area, the method achieves precise baseline correction, enhancing spectral analysis accuracy.
Patent Information
- Application Number
- JP2023029748
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2024-09-09
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing methods struggle to accurately estimate baselines in spectral data, leading to difficulties in extracting desired information due to masking by baselines and noise, particularly in techniques like nonlinear least squares methods where parameter optimization is subjective and lacks clear criteria.
A method that varies parameters such as λ and the parameter ratio in the nonlinear least squares method to estimate multiple baselines, followed by identifying peaks and selecting the most accurate baseline based on peak number and area, ensuring precise baseline correction.
This approach allows for high-accuracy baseline estimation, revealing hidden peaks and maintaining peak integrity, thereby facilitating quantitative spectral analysis.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a computing program, a computing method, and an information processing device. [Background technology]
[0002] Spectral data may contain a baseline. In order to remove the baseline from the spectral data, a method using a nonlinear least squares method has been proposed (see, for example, Non-Patent Documents 1 to 3). [Prior art documents] [Non-patent literature]
[0003] [Non-Patent Document 1] PHCEilers, Anal.Chem., 75, 3631-3636 (2003). [Non-Patent Document 2] Z.-M. Zhang, S. Chen, and Y.-Z. Liang, Baseline correction using adaptive iteratively reweighted penalized least squares. [Non-Patent Document 3] Sung-June Baek, Aaron Park, Young-Jin Ahn and Jaebum Choo, Baseline correction using asymmetrically reweighted penalized least squares smoothing. Analyst, 140, 250-257 (2015). Summary of the Invention [Problem to be solved by the invention]
[0004] However, it is difficult to estimate the baseline properly.
[0005] In one aspect, an object of the present invention is to provide a calculation program, a calculation method, and an information processing device that can estimate a baseline with high accuracy. [Means for solving the problem]
[0006] In one embodiment, the calculation program causes a computer to execute an acquisition process for determining a baseline using a nonlinear least squares method on base data of spectral data, in which a parameter for determining the baseline is changed to multiple values to obtain multiple estimated baselines estimated for each value; an identification process for determining peaks in multiple graphs representing the differences between the base data and each of the multiple estimated baselines; and a selection process for selecting a first graph from the multiple graphs based on the number of peaks and peak area of each of the multiple graphs. Effect of the Invention
[0007] The baseline can be estimated with high accuracy. [Brief description of the drawings]
[0008] [Figure 1] 1 is a flowchart of a baseline estimation method using a nonlinear least squares method. [Diagram 2] FIG. 2A is a block diagram illustrating an example of an overall configuration of an information processing device, and FIG. 2B is a block diagram illustrating an example of a hardware configuration of the information processing device. [Diagram 3] 11 is a flowchart illustrating an example of an operation of the information processing device. [Figure 4] 11 is a flowchart illustrating an example of an operation of the information processing device. [Diagram 5] This is a measured spectrum obtained by X-ray absorption spectroscopy. [Figure 6] The baseline was estimated using the nonlinear least squares method for the measured spectrum in Figure 5, and the results are shown here. [Figure 7] This is an extract of only the correction spectrum from Figure 6. [Figure 8] This shows the results when the values of the parameter λ and the parameter ratio are changed. [Figure 9] FIG. 1 illustrates an example of base data, a corrected baseline, a corrected spectrum, and a baseline. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] For example, physical and chemical analyses such as nuclear magnetic resonance, Raman spectroscopy, infrared absorption spectroscopy, X-ray photoelectron spectroscopy, and X-ray absorption spectroscopy are performed to obtain physical and chemical information of the analytical sample. The signals (spectral data) obtained from these analyses also contain baselines and noise. These baselines and noises hinder the acquisition of desired information. In particular, the baselines may obscure some or all of the desired information. Therefore, baseline correction is required to properly remove the baselines.
[0010] Conventionally, baseline correction has been performed using a differentiation method or a polynomial fitting method. The differentiation method is a method in which the spectrum is differentiated to emphasize the peaks. The polynomial fitting method is a method in which a function that is likely to be able to express the shape of the background is used for fitting using the least squares method or the like. However, even with these methods, baseline correction can be difficult in some cases.
[0011] In recent years, a method using a nonlinear least squares method incorporating a penalty term has been proposed and its effectiveness has been recognized. In the method using the nonlinear least squares method, assuming that there is a measured value y (vertical axis of the spectrum) for x (horizontal axis of the spectrum), the evaluation function Q is expressed using the degree of fit F of the estimated value weighted by w and the degree of smoothness R of the estimated value, and the baseline estimated value z is obtained. λ is a parameter used for adjustment, and is a so-called hyperparameter.
number
number
number
number
number
number
number
[0012] Finally, the baseline estimate Z can be expressed as the upper equation in the following equation. The weight W is a diagonal matrix, and can be expressed as the lower equation in the following equation with p as a parameter. Given parameters λ and p, the weight W is iteratively determined based on the lower equation while solving the upper equation to update the baseline estimate Z. Then, when the weight W becomes constant or reaches a preset value, the iteration ends and the final baseline estimate Z is determined.
number
number
[0013] To obtain the optimal baseline estimate Z, it is necessary to optimize the parameters λ and p, which are always constant in this case. However, to estimate the baseline estimate Z with higher accuracy, it is necessary to optimize the original signal y i and z obtained in the previous iteration as follows: i Weights based on the difference between w i needs to be set.
number
number
number
[0014] In this approach, the weight vector W is obtained by iteration step t as follows:
number
number
[0015] In this case, the iteration ends when the specified number of times or the limit shown in the following formula is reached.
number
[0016] However, even this approach can have drawbacks: when the original signal is higher than the fitted baseline, i.e., when the following equation holds, the weight is always zero, and when the original signal is lower than the fitted baseline, the weight is larger.
number
[0017] As a result, the final baseline is estimated to be low in areas without peaks, and the height of the peak after baseline correction may be higher than the actual height. Therefore, a method of setting the weights as follows has been proposed.
number
number
number
number
[0018] The iteration is repeated based on a preset parameter ratio until the following relationship is satisfied: The parameter ratio is a parameter relating to the rate of change of weights when performing iterative processing while varying the weights in the nonlinear least squares method.
number
[0019] This method of setting weights as described above is considered to be the most accurate baseline estimation method among the methods using the nonlinear least squares method. Figure 1 shows the flow chart of the method.
[0020] As shown in FIG. 1, first, the base data y of the spectrum data is obtained (step S1). Next, the parameter λ, the parameter ratio, and the number of iterations iter are set (step S2). The number of iterations iter determines the upper limit of the iteration step t. Next, the initial weight w t=1 = [1,1,...,1] (step S3).
[0021] Next, z t-1 (Step S4) is performed. Specifically, z=(W+H) -1 Let Wy. Next, d t =y i -z i t-1 If the result of the determination in step S5 is "Yes," the calculation unit 30 determines whether the weight w i is set to 1 (step S6). If the result of the determination in step S5 is "No", set i=1, 2, ..., N (N: length of y) and set w i t+1 =1 / {1+e 2(di-(-m+2s)) / s} (step S7). Note that m is the average of d, and s is the standard deviation of d.
[0022] After step S6 or step S7 is executed, t -w t+1 ] / 「w t It is determined whether " is less than the parameter ratio (step S8).
[0023] If the result of step S8 is "No", set t=t+1 and w t (Step S9). Then, the process is executed again from Step S4.
[0024] If the answer is "Yes" in step S8, Z is output as the estimated baseline, and Y is output as the baseline-corrected spectrum (step S10).
[0025] The method using the nonlinear least squares method is more versatile than the method using differentiation or the method using polynomial fitting, and the estimation accuracy can be improved by devising the weighting on the degree of fit F. In particular, the method using the weighting as described above shows a significant improvement in the estimated value. However, in order to estimate an appropriate baseline, it is necessary to optimize the parameters for obtaining the baseline estimate. The criteria for optimizing the parameters have not yet been clarified, and the current situation is that a baseline that is subjectively considered appropriate is estimated by repeated trial and error. Therefore, when comparing different spectra, it is difficult to quantitatively evaluate peak intensities and find minute differences in the spectrum after baseline correction.
[0026] In the following embodiment, an example will be described in which a baseline estimate can be obtained with high accuracy by optimizing parameters for obtaining the baseline estimate in the nonlinear least squares method. EXAMPLES
[0027] Fig. 2(a) is a block diagram illustrating an example of the overall configuration of an information processing device 100. As illustrated in Fig. 2(a), the information processing device 100 includes an acquisition unit 10, a parameter setting unit 20, a calculation unit 30, an output unit 40, and the like.
[0028] Fig. 2(b) is a block diagram illustrating an example of a hardware configuration of the information processing device 100. As illustrated in Fig. 2(b), the information processing device 100 includes a CPU 101, a RAM 102, a storage device 103, an input device 104, a display device 105, and the like.
[0029] The CPU (Central Processing Unit) 101 is a central processing unit. The CPU 101 includes one or more cores. The RAM (Random Access Memory) 102 is a volatile memory that temporarily stores a program executed by the CPU 101, data processed by the CPU 101, and the like. The storage device 103 is a non-volatile storage device. For example, a ROM (Read Only Memory), a solid state drive (SSD) such as a flash memory, or a hard disk driven by a hard disk drive can be used as the storage device 103. The storage device 103 stores a calculation program. The input device 104 is an input device such as a keyboard or a mouse. The display device 105 is a display device such as an LCD (Liquid Crystal Display). The CPU 101 executes the calculation program to realize an acquisition unit 10, a parameter setting unit 20, a calculation unit 30, an output unit 40, and the like. Note that hardware such as a dedicated circuit may be used as the acquisition unit 10, the parameter setting unit 20, the calculation unit 30, the output unit 40, and the like.
[0030] 3 and 4 are flowcharts showing an example of the operation of the information processing device 100. As illustrated in Fig. 3 and Fig. 4, the acquiring unit 10 acquires base data y of a measured spectrum (step S11).
[0031] Next, the parameter setting unit 20 sets each parameter (step S12). Specifically, the parameter setting unit 20 sets Δλ, λ_min, λ_max, ratio_min, ratio_max, and the number of iterations (iter). λ_min is the minimum value of the parameter λ. λ_max is the maximum value of the parameter λ. ratio_min is the minimum value of the parameter ratio. ratio_max is the maximum value of the parameter ratio. Δλ is the range of change when λ is changed. The number of iterations iter determines the upper limit of the iteration step t.
[0032] The calculation unit 30 sets the parameter λ to λ_min and the parameter ratio to ratio_min (step S13). By executing step S13, the initial value of the parameter λ is set to λ_min and the initial value of the parameter ratio is set to ratio_min.
[0033] Next, the calculation unit 30 judges whether the parameter λ is smaller than λ_max and the parameter ratio is smaller than ratio_max (step S14). By executing step S14, it is possible to confirm that the parameters λ and ratio have not reached their upper limits.
[0034] If the answer is "Yes" in step S14, the calculation unit 30 sets the initial weight (step S15). t=1 Let be [1,1,…,1].
[0035] Next, the calculation unit 30 calculates z t-1 Specifically, the calculation unit 30 performs fitting of z=(W+H) -1 Let's call it Wy.
[0036] Next, the calculation unit 30 calculates d t =y i -z i t-1 It is determined whether or not is equal to or greater than 0 (step S17).
[0037] If the answer is "Yes" in step S17, the calculation unit 30 calculates the weight w i is set to 1 (step S18).
[0038] If the result of the determination in step S17 is “No”, the calculation unit 30 sets i=1, 2, . . . , N (N: length of y) and i t+1 =1 / {1+e 2(di-(-m+2s)) / s} (step S19). Note that m is the average of d, and s is the standard deviation of d.
[0039] After executing step S18 or step S19, the calculation unit 30 calculates [w t -w t+1 ] / 「w t It is determined whether " is less than the parameter ratio (step S20).
[0040] If the result of the determination in step S20 is "No," the calculation unit 30 sets w t (Step S21). Then, the process is executed again from Step S16.
[0041] If the answer is "Yes" in step S20, the calculation unit 30 sets Z as the estimated baseline and sets Y as the baseline-corrected corrected spectrum (step S22). The corrected spectrum corresponds to a graph showing the difference between the base data and the estimated baseline.
[0042] Next, the calculation unit 30 detects peaks by performing peak picking in the corrected spectrum Y (step S23). Specifically, the calculation unit 30 detects peaks in the corrected spectrum and valleys formed by the peaks.
[0043] Next, the calculation unit 30 acquires the spectrum information of the corrected spectrum Y (step S24). Specifically, the calculation unit 30 acquires the number of peaks n and the peak area s of the corrected spectrum Y. Next, the calculation unit 30 adds Δλ to λ (step S25). After that, the process is executed again from step S14.
[0044] If the answer is "No" in step S14, the calculation unit 30 calculates the number of peaks n=[n λ_min,ratio_min ,…,n λ_max,ratio_max ] and obtain the peak area s = [s λ_min,ratio_min ,…,s λ_max,ratio_max ] is obtained (step S26).
[0045] Next, the calculation section 30 extracts the corrected spectrum Y having the largest number of peaks (step S27).
[0046] Next, the calculation unit 30 extracts the correction spectrum Y with the smallest peak area s from among the correction spectra Y extracted in step S27 (step S28). If only one correction spectrum Y is extracted in step S27, that one correction spectrum is extracted.
[0047] Next, the output unit 40 outputs Y extracted in steps S27 and S28 as a baseline-corrected spectrum (step S29). The information output by the output unit 40 is displayed on the display device 105.
[0048] According to this embodiment, when the baseline is specified using the nonlinear least squares method for the base data, the parameters for specifying the baseline are changed to multiple values, and multiple estimated baselines are repeatedly obtained for each value. This allows the parameters to be changed over a wide range. Furthermore, peak locations are specified in multiple graphs that represent the differences between the base data and each of the multiple estimated baselines, and a specific graph is selected from the multiple graphs according to the number of peaks and the peak area of each graph. This allows the baseline to be estimated with high accuracy. Below, the effects of the present invention will be described with respect to specific spectra.
[0049] Figure 5 shows the measured spectrum obtained by X-ray absorption spectroscopy. Figure 6 shows the results obtained by estimating the baseline for the measured spectrum in Figure 5 using the nonlinear least squares method. Figure 7 shows only the corrected spectrum extracted from Figure 6. Figure 7 shows the correction result in which the peaks in the measured spectrum are not lost and the peak shapes are clearly maintained.
[0050] However, in order to obtain the corrected spectrum shown in FIG. 7, it is necessary to appropriately select the parameters λ and ratio, and trial and error is unavoidable in order to achieve this.
[0051] Therefore, according to this embodiment, the values of the parameter λ and the parameter ratio are set to, for example, 1×e -2 From 1 × e -10 The baseline estimation is repeated by varying the parameter λ and the parameter ratio. Figures 8(a) to 8(d) show the results when the parameters λ and ratio are changed. In each case, the number of peaks is three (circles), and the parameters λ and ratio are set to 1×e -2 From 1 × e -10 It was the largest in the corrected spectrum obtained by swinging to
[0052] Among Figures 8(a) to 8(d), the spectrum with the smallest peak area s of the entire spectrum is Figure 8(d), and therefore Figure 8(d) is the optimal corrected spectrum.
[0053] According to this embodiment, the corrected spectrum having the maximum number of peaks is selected, and from the selected corrected spectrum, the one having the smallest peak area s is selected, thereby enabling optimal baseline correction.
[0054] 9 is a diagram illustrating the base data, the corrected baseline, the corrected spectrum, and the base line. The base line is a base line used when calculating the peak area. The peak area of the base data is the area of the region surrounded by the base data and the base line. The peak area of the corrected spectrum is the area of the region surrounded by the corrected spectrum and the base line.
[0055] The number of peaks in the base data is two, and the number of peaks in the corrected spectrum is three. In the corrected spectrum, a clear peak exists at 8975 eV to 8980 eV, whereas the position of the base data is only slightly bulged and is not recognized as a peak. In this way, the baseline processing according to this embodiment can bring out the buried peaks. On the other hand, there is a risk of crushing the peaks that existed before the baseline processing. Therefore, it is preferable that the number of peaks in this embodiment is set to the lower limit of the number of peaks that existed before the baseline processing. In addition, in consideration of bringing out the buried peaks, it is preferable that the peak area is set to the upper limit of the area of the spectrum of the base data.
[0056] In the above example, when selecting a correction spectrum, one or more correction spectra with the maximum number of peaks are selected, and further, a correction spectrum with the smallest peak area is selected, but this is not limited to the above. For example, when selecting according to the number of peaks, a correction spectrum with the number of peaks equal to or greater than a threshold may be selected. Also, when selecting a correction spectrum according to the peak area, a correction spectrum with a peak area equal to or less than a threshold may be selected. Also, in the above example, the parameters λ and ratio are optimized, but other parameters may be optimized.
[0057] Although the embodiments of the present invention have been described in detail above, the present invention is not limited to such specific embodiments, and various modifications and variations are possible within the scope of the gist of the present invention described in the claims. (Appendix 1) On the computer, A computation program that executes, when a baseline is identified using a nonlinear least squares method for base data of spectrum data, an acquisition process that changes a parameter for identifying the baseline to a plurality of values and acquires a plurality of estimated baselines estimated for each value; an identification process that identifies peaks in a plurality of graphs that represent differences between the base data and each of the plurality of estimated baselines; and a selection process that selects a first graph from the plurality of graphs depending on the number of peaks and the peak area of each of the plurality of graphs. (Appendix 2) The calculation program according to claim 1, characterized in that in the selection process, a graph in which the identified number of peaks is equal to or greater than a threshold is selected. (Appendix 3) The calculation program according to claim 1, characterized in that in the selection process, a graph in which the number of identified peaks is the maximum value is selected. (Appendix 4) The calculation program according to claim 1, characterized in that in the selection process, a graph in which the peak area is equal to or smaller than a threshold value is selected from among the graphs selected according to the number of peaks. (Appendix 5) The calculation program according to claim 1, characterized in that in the selection process, a graph having a minimum peak area is selected from among the graphs selected according to the number of peaks. (Appendix 6) The arithmetic program according to claim 1, wherein the parameters include hyperparameters in the nonlinear least squares method. (Appendix 7) The computation program according to claim 1, wherein the parameter is a parameter relating to a rate of change of the weight when performing iterative processing while varying the weight in the nonlinear least squares method. (Appendix 8) A calculation method characterized in that, when a baseline is identified using a nonlinear least squares method for base data of spectrum data, a computer executes the following steps: an acquisition process for changing a parameter for identifying the baseline to multiple values and acquiring multiple estimated baselines estimated for each value; an identification process for identifying peaks in multiple graphs representing differences between the base data and each of the multiple estimated baselines; and a selection process for selecting a first graph from the multiple graphs depending on the number of peaks and peak area of each of the multiple graphs. (Appendix 9) The calculation method according to claim 8, wherein in the selection process, a graph is selected in which the number of identified peaks is equal to or greater than a threshold value. (Appendix 10) The calculation method according to claim 8, wherein in the selection process, a graph in which the number of identified peaks is the maximum value is selected. (Appendix 11) The calculation method according to claim 8, wherein in the selection process, a graph in which the peak area is equal to or smaller than a threshold value is selected from among the graphs selected according to the number of peaks. (Appendix 12) 9. The calculation method according to claim 8, wherein in the selection process, a graph having a minimum peak area is selected from among the graphs selected according to the number of peaks. (Appendix 13) The calculation method according to claim 8, wherein the parameters include hyperparameters in the nonlinear least squares method. (Appendix 14) The calculation method according to claim 8, wherein the parameter is a parameter related to a rate of change of the weight when performing iterative processing while varying the weight in the nonlinear least squares method. (Appendix 15) An acquisition unit for acquiring base data of the spectrum data; and a calculation unit that, when identifying a baseline using a nonlinear least squares method for the base data, changes a parameter for identifying the baseline to a plurality of values to obtain a plurality of estimated baselines estimated for each value, identifies peaks in a plurality of graphs representing differences between the base data and each of the plurality of estimated baselines, and selects a first graph from the plurality of graphs depending on the number of peaks and the peak area of each of the plurality of graphs. (Appendix 16) The information processing device according to claim 15, wherein the calculation unit, when selecting the first graph, selects a graph in which the identified number of peaks is equal to or greater than a threshold value. (Appendix 17) The information processing device according to claim 15, wherein the calculation unit, when selecting the first graph, selects a graph in which the number of identified peaks is the maximum value. (Appendix 18) The information processing device according to claim 15, wherein the calculation unit selects a graph in which the peak area is equal to or smaller than a threshold value from among the graphs selected according to the number of peaks. (Appendix 19) The information processing device according to claim 15, wherein the calculation unit selects a graph in which the peak area is the smallest value from among the graphs selected according to the number of peaks. (Appendix 20) The information processing device according to claim 15, wherein the parameters include hyperparameters in the nonlinear least squares method. (Appendix 21) The information processing device according to claim 15, wherein the parameter is a parameter related to a rate of change of the weight when performing iterative processing while varying the weight in the nonlinear least squares method. [Explanation of symbols]
[0058] 10 Acquisition Department 20 Parameter setting section 30 Arithmetic section 40 Output section 100 Information processing device 101 CPU 102 RAM 103 Storage device 104 Input Devices 105 Display device
Claims
1. On the computer, 1. A computational program comprising: a computation process for determining a baseline of base data of spectrum data using a nonlinear least squares method, the computation process executing an acquisition process for changing a parameter for determining the baseline to a plurality of values and obtaining a plurality of estimated baselines estimated for each value; a determination process for determining peaks in a plurality of graphs representing differences between the base data and each of the plurality of estimated baselines; and a selection process for selecting a first graph from the plurality of graphs according to the number of peaks and the peak area of each of the plurality of graphs.
2. 2. The computing program according to claim 1, wherein the selection process selects a graph in which the number of identified peaks is equal to or greater than a threshold value.
3. 2. The computing program according to claim 1, wherein the selection process selects a graph in which the number of identified peaks is the maximum.
4. 2. The calculation program according to claim 1, wherein in the selection process, a graph in which the peak area is equal to or smaller than a threshold value is selected from among the graphs selected according to the number of peaks.
5. 2. The calculation program according to claim 1, wherein in the selection process, a graph in which the peak area is the smallest value is selected from among the graphs selected according to the number of peaks.
6. 2. The computing program according to claim 1, wherein the parameters include hyperparameters in the nonlinear least squares method.
7. 2. The computing program according to claim 1, wherein the parameter is a parameter relating to a rate of change of the weight when performing iterative processing while varying the weight in the nonlinear least squares method.
8. A calculation method characterized in that, when a baseline is identified using a nonlinear least squares method for base data of spectral data, a computer executes the following steps: an acquisition process for changing a parameter for identifying the baseline to multiple values and acquiring multiple estimated baselines estimated for each value; an identification process for identifying peaks in multiple graphs representing differences between the base data and each of the multiple estimated baselines; and a selection process for selecting a first graph from the multiple graphs depending on the number of peaks and peak area of each of the multiple graphs.
9. An acquisition unit for acquiring base data of the spectrum data; and a calculation unit that, when identifying a baseline using a nonlinear least squares method on the base data, changes a parameter for identifying the baseline to a plurality of values to obtain a plurality of estimated baselines estimated for each value, identifies peaks in a plurality of graphs representing differences between the base data and each of the plurality of estimated baselines, and selects a first graph from the plurality of graphs depending on the number of peaks and the peak area of each of the plurality of graphs.
