Fourier infrared spectrum automatic peak separation processing method based on multi-start and constraint optimization
The automated peak-splitting method for Fourier infrared spectroscopy, which utilizes multiple starting points and constraint optimization, achieves fully automated peak-splitting without human intervention. This solves the problems of low automation and insufficient accuracy in existing technologies, improves peak-splitting efficiency and fitting accuracy, and is suitable for batch spectral data processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA UNIV OF MINING & TECH
- Filing Date
- 2026-04-24
- Publication Date
- 2026-07-21
AI Technical Summary
Existing infrared spectral peak fitting techniques suffer from low automation and insufficient accuracy, making it difficult to meet the needs of scientific research and industrial fields for rapid and accurate processing of batches of spectral data.
An automated peak-splitting method based on multi-starting point and constraint optimization of Fourier infrared spectroscopy is adopted, including data preprocessing, candidate peak generation, random initialization of peak parameters at multiple starting points, constraint-based nonlinear fitting optimization, residual peak-guided model refinement, and adaptive peak number scanning, to achieve fully automated peak-splitting and batch processing without human intervention.
It significantly improves peak separation efficiency and fitting accuracy, reduces human error, ensures the physical rationality and reliability of the results, supports batch data processing, and is compatible with CSV format spectral data from different sources.
Smart Images

Figure CN122432772A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of spectral analysis and data processing technology, and in particular to an automated peak-splitting method for Fourier infrared spectroscopy based on multiple starting points and constraint optimization. Background Technology
[0002] Fourier transform infrared spectroscopy (FTIR), as an important tool for analyzing the chemical composition and structure of substances, directly reflects the vibrational information of different functional groups in the output spectrum through characteristic absorption peaks corresponding to different wavenumbers. It is a crucial basis for qualitative and quantitative analysis of substances. In practical applications, the infrared spectra of samples often exhibit complex multi-peak superposition, with single characteristic peaks commonly covered or overlapped by other peaks. It is difficult to accurately obtain key parameters such as the center position, intensity, width, and shape of each component peak through visual observation or simple data processing alone, thus affecting the accuracy and reliability of substance composition analysis. Therefore, peak fitting processing after FTIR experiments has become a necessary step in interpreting spectral data and extracting structural information from substances.
[0003] Currently, infrared spectral peak fitting mainly relies on two technical approaches, but both have significant limitations. On the one hand, traditional peak fitting methods require significant manual intervention. Commonly used analysis software such as Peakfit and Origin requires operators to manually set baselines and repeatedly adjust the number and position of peaks to achieve a match between the fitted spectrum and the original spectrum. Since the spectra of complex samples can often be resolved to have a dozen or even twenty peaks, the manual fitting process is time-consuming and laborious, and the goodness of fit often fails to reach the high precision requirement of 0.99 or higher. At the same time, key steps such as peak position selection and peak number determination are highly dependent on the operator's experience, leading to multiple peak fitting results for the same spectrum, highlighting the problems of strong subjectivity and poor consistency. On the other hand, although the few existing automatic peak finding algorithms attempt to simplify the operation process, they generally suffer from insufficient fitting accuracy: not only is the fit to the original spectrum low, but they are also prone to missing weak peaks and misclassifying noise as valid peaks, resulting in large errors in the peak fitting results and failing to meet the needs of accurate analysis.
[0004] In summary, existing technologies struggle to balance automation, analytical accuracy, and efficiency in peak fitting, failing to meet the practical needs of scientific research and industry for rapid and accurate processing of batch spectral data. There is an urgent need for a highly automated infrared spectral peak fitting technology capable of completing the entire process—baseline subtraction, peak candidate identification, initial parameter setting, and fitting optimization—without manual intervention. This technology should employ scientifically designed algorithms to ensure the physical rationality and accuracy of the peak fitting results, while simultaneously supporting batch data processing, shortening the analysis cycle, and providing technical support for the efficient analysis of large-scale FTIR spectral data. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides an automated peak-splitting method for Fourier infrared spectroscopy based on multi-starting point and constraint optimization. This method enables fully automated peak splitting, accurate fitting, and batch processing without human intervention, significantly improving peak splitting efficiency, fitting accuracy, and result reliability.
[0006] The technical solution adopted by this invention to solve its technical problem is: an automated peak-splitting method for Fourier infrared spectroscopy based on multi-starting point and constraint optimization, comprising the following steps: S1. Data preprocessing: Read multiple CSV format Fourier transform infrared transmittance spectrum data, convert the transmittance data into absorbance data, automatically extract the spectral data within the preset target wavenumber range as the analysis interval, fit the background baseline of the spectrum within the analysis interval using a second-order polynomial function and subtract it to obtain the absorbance spectrum with zero baseline. S2. Candidate Peak Generation: Define the peak model as a pseudo-Voigt function, which is a linear combination of Gaussian peak function and Lorentz peak function. Identify the peak positions of the absorbance spectrum with zero baseline through a dual-channel peak finding method. Merge and remove duplicate peak position sets obtained by the two peak finding methods to obtain a candidate peak position set. Sort the peaks in the candidate peak position set according to the prominence of the peaks to form a candidate peak center list. S3. Random initialization of peak parameters from multiple starting points: Randomly select peak positions within a preset range from the candidate peak center list as initial peak centers. When selecting, the distance between any two initial peak centers shall not be less than the minimum allowable peak spacing. Introduce random perturbation to the initial peak center position, and simultaneously assign random initial values to the peak width, peak intensity, and shape mixing factor to generate multiple different combinations of initial peak parameters. S4. Constrained Nonlinear Fitting Optimization: For each set of initial peak parameter combinations, the least squares algorithm is used to perform nonlinear peak fitting iterative optimization to minimize the sum of squared residuals between the fitted spectrum and the original absorbance spectrum. During the fitting process, physical rationality constraints are applied to the peak parameters. After the fitting is completed, the fitting result is determined to be a valid solution by a preset quality evaluation standard. If it is an invalid solution, the initial peak parameter combination is changed and the fitting is re-fitted. The result with the highest fitting goodness is selected from multiple valid solutions as the preliminary fitting result. S5. Residual Peak-Guided Model Refinement: Calculate the residual spectrum of the preliminary fitting result, detect the remaining peaks in the residual spectrum that are higher than the noise threshold, extract the position of the remaining peak as the position of the missing true peak, select the weak peak with the smallest contribution in the preliminary fitting result, replace the peak center of the weak peak with the position of the missing true peak, and use this as a new initial condition to re-fit and optimize. Iterate the above operations until there are no obvious peak signals in the residual spectrum or the upper limit of the number of peak models is reached, and obtain the refined fitting model. S6. Peak Number Adaptive Scan: Within the preset peak number range, the absorbance spectrum is processed one by one through steps S2 to S5. The fitting calculations for different peak numbers are performed in parallel. When the refined fitting model for a certain peak number reaches the preset goodness-of-fit threshold, the fitting calculation for higher peak numbers is terminated in advance, and the refined fitting model corresponding to that peak number is selected as the optimal fitting model. S7. Result Output: For each input spectrum, a fitting curve is generated based on the optimal fitting model, and a peak parameter table containing key parameters of each peak is output, realizing batch processing and result output of multiple spectra.
[0007] Furthermore, in step S1, the formula for converting transmittance data into absorbance data is as follows: , In the formula, Abs(x) is the absorbance at wavenumber x, and T(x) is the transmittance percentage at wavenumber x, where x represents the wavenumber in cm. -1 ; The preset target wavenumber range is 1000-1800 cm⁻¹. -1 It also supports user-defined adjustments; The expression for the second-order polynomial function is: The formula for calculating baseline deduction is: ; In the formula, B(x) is the baseline intensity at wavenumber x, c0, c1 and c2 are the constant, linear and quadratic coefficients of the second-order polynomial, respectively, and y(x) is the absorbance at wavenumber x after baseline correction.
[0008] Furthermore, in step S2, the expression for the Gaussian peak function is: ; The expression for the Lorentz peak function is: ; The expression for the pseudo-Voigt function is: ; In the formula, G(x;x0,σ) is the Gaussian peak function value at wavenumber x, L(x;x0,σ) is the Lorentz peak function value at wavenumber x, x0 is the peak center position, σ is the peak width parameter, and P i (x) represents the value of the i-th pseudo-Voigt peak function at wavenumber x, A i For peak intensity, η i x is the shape blending factor. 0i Let σ be the peak center position of the i-th peak. i Let be the peak width parameter of the i-th peak.
[0009] Furthermore, in step S2, the specific operation of the dual-channel peak-finding method includes: Step-a1, Peak Finding in the Original Spectrum: Scan the absorbance spectrum of the zero baseline. When the sampling point meets the peak finding criteria... and When the sampling point is determined to be a local maximum point, it is used as the original spectral peak position to form the signal peak position set Csignal; In the formula, y(x k y(x) represents the absorbance value at the k-th sampling point. k-1 ), y(x k+1 ) represent the absorbance values of the adjacent sampling points before and after the k-th sampling point, respectively, x k The wavenumber position of the k-th sampling point; Step-a2, Second Derivative Peak Finding: Calculate the second derivative curve of the absorbance spectrum of the zero baseline. The approximate formula for calculating the second derivative is: In the formula, y''(x k ) represents the second derivative value at the k-th sampling point, and Δx represents the wavenumber interval between adjacent sampling points; Potential peak positions are obtained at the curvature maxima of the second derivative curve, forming a curvature peak position set Ccurvature; the candidate peak position set C = Csignal∪Ccurvature, where ∪ represents the set union operation.
[0010] Furthermore, in step S3, the formula for the random perturbation of the initial peak center position is: ; In the formula, Let x be the initial center position of the i-th peak. 0i δ represents the center position of the candidate peak. i The random disturbance quantity follows a uniform distribution on the interval [-J, J], where J is the disturbance amplitude parameter; The peak width σ i The range of random initial values is [σ]. min ,σ max Peak intensity A i The initial random value is non-negative, and the shape mixing factor η i The random initial value ranges from [0,1].
[0011] Furthermore, in step S4, the least squares algorithm is the Levenberg-Marquardt algorithm; the specific physical rationality constraints are as follows: (1) Peak center location That is, the peak center position x 0i Only in the initial position Fine-tune within a 2W range, always keeping it within the preset target wavenumber range; (2) The range of values for the peak width parameter σi is [σmin ,σ max ]; (3) Peak intensity A i It is a non-negative value and does not exceed the preset upper limit. (4) Shape mixing factor η i The value range is [0,1].
[0012] Furthermore, in step S4, the formula for calculating the sum of squared residuals is: ; In the formula, SSE is the sum of squared residuals, y(x k ) represents the original absorbance value at the k-th sampling point. Let ∑ be the fitted spectral value at the k-th sampling point. k This represents summing over all sample points; The preset quality assessment criteria include goodness-of-fit determination and peak parameter rationality check. The goodness-of-fit is measured by the coefficient of determination R², and the calculation formula is as follows: In the formula, The threshold for the determination coefficient R² is set to ≥0.99, representing the average value of the original absorbance data. The peak parameter rationality check includes: the half-width at half maximum (WHM) of each sub-peak is within a physically reasonable range, and the percentage of the area of each sub-peak to the total peak area is not less than a preset ratio threshold.
[0013] Furthermore, the formula for calculating the peak area is: The formula for calculating the percentage of peak area to total peak area is: ; In the formula, Area i P represents the area of the i-th peak. i (x k ) represents the function value of the i-th peak at the k-th sampling point, i.e., the absorbance value calculated by the pseudo-Voigt function, reflecting the peak intensity at that point; Δx is the wavenumber interval between adjacent sampling points; The preset ratio threshold is 1%, which is the sum of the areas of all peaks.
[0014] Furthermore, in step S5, the formula for calculating the residual spectrum is: ; In the formula, e(x) is the residual value at wavenumber x, and y(x) is the original absorbance value at wavenumber x. The fitted spectral value at wavenumber x; The weakest peak with the smallest contribution is the peak with the smallest area, through... Determine the index j of the weak peak; where, Indicates that Area i The peak number corresponding to the minimum value; Areai Let be the area of the i-th peak. The assignment operation for replacing the weak peak center is represented as follows: ; where x 0j x represents the position of the center of the j-th weak peak; R This represents the location of the missed true peak detected in the residual spectrum; the symbol " " indicates an assignment operation, that is, using x R Update x 0j .
[0015] Furthermore, in step S6, if the preset goodness-of-fit threshold is not reached even up to the maximum number of peaks, then a determination coefficient R within the range of peak numbers is selected. 2 The highest refined fit model is selected as the optimal fit model, and suggestions are made to increase the number of peaks or check the quality of the spectral data.
[0016] The beneficial effects of this invention are: 1. Fully automated process, eliminating human error and efficiency loss: This method requires no manual intervention from data reading, absorbance conversion, baseline correction to peak finding, fitting, model refinement and result output. It eliminates the need to manually set peak positions and adjust parameters, solving the problems of strong subjectivity, time consumption and non-unique fitting results of manual peak finding. At the same time, it is compatible with CSV format spectral data from different sources, and has good versatility and ease of use.
[0017] 2. Significantly improved fitting accuracy and closer fit to the true shape of spectral peaks: The pseudo-Voigt function is used as the peak model, which combines the advantages of Gaussian and Lorentz peak shapes, and can flexibly fit the true shape of actual infrared spectral peaks; combined with the dual-channel peak finding and the weak peak replacement iteration refinement strategy guided by residual peaks, it can not only ensure that both strong and weak peaks are effectively identified, but also capture the subtle peak features missed in the initial fitting, and greatly reduce the fitting residual.
[0018] 3. Multi-starting point initialization effectively avoids local optimum traps: By randomly selecting the initial peak center from multiple starting points, random perturbation is introduced and multiple sets of differentiated initial parameters are generated, which increases the probability of the optimization algorithm finding the global optimum solution, avoids fitting bias caused by a single initial value, and makes the final peak parameters closer to the true value, thus improving the reliability of the peak division results.
[0019] 4. Constraints ensure physical rationality: During the fitting process, strict physical boundary constraints are imposed on the peak center, peak width, peak intensity, and shape mixing factor. Simultaneously, the determination coefficient R0 is used to ensure physical rationality. 2 The fitting results were screened using indicators such as peak area ratio and full width at half maximum (FWHM), which effectively avoided the occurrence of unreasonable peaks and ensured that the peaking results conformed to the physical laws of infrared spectroscopy analysis.
[0020] 5. Adaptive peak number control, balancing fitting accuracy and overfit prevention: Parallel scanning within a preset peak number range and setting an early stopping strategy based on goodness of fit can adaptively determine the optimal peak number according to the actual complexity of the spectrum. While ensuring sufficient fitting of spectral peak characteristics, it avoids overfitting to noise due to an excessive number of peaks, achieving dynamic control of model complexity and improving the robustness of the method.
[0021] 6. Supports batch parallel processing and standardized multi-format output: The solution can perform batch parallel fitting calculations on multiple Fourier transform infrared spectral data, significantly reducing data processing time and meeting the actual needs of scientific research and industrial fields for efficient processing of batch spectral data; the output results include intuitive fitting curves and structured peak parameter tables, support multiple formats, and can be seamlessly integrated into existing spectral data analysis workflows, improving the overall automation level of infrared spectral analysis; at the same time, the solution is based on Python, has no additional hardware dependencies, has low implementation costs, and is easy to promote and apply. Attached Figure Description
[0022] Figure 1 A flowchart of an embodiment of the present invention.
[0023] Figure 2 A schematic diagram of the Fourier transform infrared spectrum peak fitting results in an embodiment of the present invention. Detailed Implementation
[0024] The present invention will be further described in detail below with reference to the accompanying drawings.
[0025] This invention discloses an automated peak-splitting method for Fourier infrared spectroscopy based on multiple starting points and constraint optimization.
[0026] An automated peak-segmentation method for Fourier transform infrared (FTIR) spectroscopy based on multi-starting point and constraint optimization is proposed. This method automates the entire process of Fourier transform infrared peak-segmentation and fitting without manual intervention. It can batch process multiple Fourier transform infrared transmittance spectra in CSV format, effectively solving the problems of high subjectivity, low efficiency, and insufficient fitting accuracy of traditional peak-segmentation methods. Furthermore, through strategies such as multi-starting point initialization, constraint optimization, and residual refinement, it avoids fitting getting trapped in local optima, ensuring the physical rationality of peak parameters, and ultimately achieving accurate and efficient peak-segmentation. The method includes the following steps: S1. Data Preprocessing: The core objective is to eliminate background interference in the original spectra and convert the data into a form suitable for peak segmentation analysis. In practice, multiple CSV-format Fourier transform infrared transmittance spectra are first read, and the transmittance data is converted into absorbance data. The spectral data within the preset target wavenumber range is automatically extracted as the analysis interval. Then, baseline correction is performed on the spectra within the analysis interval. Since the actual detected spectral data may have a tilted or curved baseline due to instrument errors, sample background, and other factors, a second-order polynomial function is used to fit the background baseline of the spectra within the analysis interval and subtract it to obtain an absorbance spectrum with a zero baseline. At this point, the fluctuations in the spectrum near zero absorbance only correspond to the actual absorption peak signal of the substance, which greatly improves the accuracy of subsequent peak finding and fitting.
[0027] The formula for converting transmittance data into absorbance data is as follows: , In the formula, Abs(x) is the absorbance at wavenumber x, and T(x) is the transmittance percentage at wavenumber x, where x represents the wavenumber in cm. -1 This conversion is based on the fundamental principle of infrared spectroscopy analysis, where absorbance is linearly correlated with the concentration of a substance, which better aligns with the logic of identifying and quantitatively analyzing characteristic absorption peaks.
[0028] In this embodiment, the preset target wavenumber range is 1000-1800 cm⁻¹. -1 This range covers the characteristic absorption peaks of most organic functional groups, and also allows users to customize and adjust the wavenumber range according to the actual test samples and analysis needs.
[0029] The expression for a second-order polynomial function is: The formula for calculating baseline deduction is: ; Where B(x) is the baseline intensity at wavenumber x, c0, c1 and c2 are the constant, linear and quadratic coefficients of the second-order polynomial, respectively, and y(x) is the absorbance at wavenumber x after baseline correction.
[0030] S2. Candidate Peak Generation: The core objective is to determine comprehensive and reliable peak position candidates to provide a basis for peak parameter initialization. In practice, the peak model is first defined as a pseudo-Voigt function, which is a linear combination of Gaussian peak function and Lorentz peak function. The peak positions of the absorbance spectrum with zero baseline are identified by a dual-channel peak finding method. The peak position sets obtained by the two peak finding methods are merged and deduplicated to obtain a set of candidate peak positions. The peaks in the candidate peak position set are sorted according to their prominence to form a list of candidate peak centers.
[0031] The expression for the Gaussian peak function is: ; The expression for the Lorentz peak function is: ; The expression for the pseudo-Voigt function is: ; In the formula, G(x;x0,σ) is the Gaussian peak function value at wavenumber x, L(x;x0,σ) is the Lorentz peak function value at wavenumber x, x0 is the peak center position, σ is the peak width parameter, and P i (x) represents the value of the i-th pseudo-Voigt peak function at wavenumber x, A i For peak intensity, η i x is the shape blending factor. 0i Let σ be the peak center position of the i-th peak. i Let be the peak width parameter of the i-th peak.
[0032] After defining the peak model, a dual-channel peak-finding method is used to identify the peak positions in the zero-baseline absorbance spectrum. A single peak-finding method is prone to missing weak peaks or shoulder peaks covered by strong peaks, while dual-channel peak-finding can identify both significant peaks and potential peaks. The specific operation of the dual-channel peak-finding method includes: Step-a1, Peak Finding in the Original Spectrum: Scan the absorbance spectrum with a zero baseline. When the sampling points meet the following conditions... and When the sampling point is determined to be a local maximum point, it is used as the original spectral peak position to form the signal peak position set Csignal; In the formula, y(x k y(x) represents the absorbance value at the k-th sampling point. k-1 ), y(x k+1 ) represent the absorbance values of the adjacent sampling points before and after the k-th sampling point, respectively, x k The wavenumber position of the k-th sampling point; Step-a2, Second Derivative Peak Finding: Calculate the second derivative curve of the absorbance spectrum with zero baseline. The approximate formula for calculating the second derivative is: ; In the formula, y''(x k ) represents the second derivative value at the k-th sampling point, and Δx represents the wavenumber interval between adjacent sampling points; Potential peak positions are obtained at the curvature maxima of the second derivative curve, forming a curvature peak position set Ccurvature; the candidate peak position set C = Csignal∪Ccurvature, where ∪ represents the set union operation.
[0033] S3. Random initialization of peak parameters from multiple starting points: Randomly select peak positions within a preset range from the candidate peak center list as initial peak centers. When selecting, the distance between any two initial peak centers shall not be less than the minimum allowable peak spacing. Introduce random perturbation to the initial peak center position, and assign random initial values to the peak width, peak intensity, and shape mixing factor to generate multiple different combinations of initial peak parameters.
[0034] In this embodiment, the preset number of peak positions is 15-22; the random perturbation formula for the initial peak center position is: ; In the formula, Let x be the initial center position of the i-th peak. 0i δ represents the center position of the candidate peak. i The random disturbance quantity follows a uniform distribution on the interval [-J, J], where J is the disturbance amplitude parameter; Wherein, peak width σ i The range of random initial values is [σ]. min ,σ max Peak intensity A i The initial random value is non-negative, and the shape mixing factor η i The random initial value ranges from [0,1].
[0035] S4. Constrained Nonlinear Fitting Optimization: For each initial peak parameter combination, the least squares algorithm is used to perform nonlinear peak fitting iterative optimization to minimize the sum of squared residuals between the fitted spectrum and the original absorbance spectrum. During the fitting process, physical rationality constraints are applied to the peak parameters. After the fitting is completed, the fitting result is determined to be a valid solution by a preset quality evaluation standard. If it is an invalid solution, the initial peak parameter combination is changed and the fitting is re-fitted. The result with the highest goodness of fit is selected from multiple valid solutions as the preliminary fitting result.
[0036] The least squares algorithm used is the Levenberg-Marquardt algorithm; the specific physical rationality constraints are as follows: (1) Peak center location That is, the peak center position x 0i Only in the initial position Fine-tuning is performed within a 2W range, always staying within the preset target wavenumber range; where W refers to the pre-defined search window width in this scheme, in cm. -1 The wavenumber unit is consistent with that of the infrared spectrum, typically 5-10 cm⁻¹. -1 ; (2) The range of values for the peak width parameter σi is [σ min ,σ max ]; (3) Peak intensity A iIt is a non-negative value and does not exceed the preset upper limit. (4) Shape mixing factor η i The value range is [0,1].
[0037] The formula for calculating the sum of squared residuals is: Where SSE is the sum of squared residuals, y(x k ) represents the original absorbance value at the k-th sampling point. Let ∑ be the fitted spectral value at the k-th sampling point. k This represents summing over all sample points; The preset quality assessment criteria include goodness-of-fit determination and peak parameter rationality check. Goodness-of-fit is measured by the coefficient of determination R², and the calculation formula is as follows: ,in, The threshold for the determination coefficient R² is set to ≥0.99, representing the average value of the original absorbance data. Peak parameter rationality checks include: the full width at half maximum (FWHM) of each sub-peak is within a physically reasonable range, and the percentage of the area of each sub-peak to the total peak area is not less than a preset threshold ratio.
[0038] The formula for calculating the peak area is: The formula for calculating the percentage of peak area to total peak area is: ; In the formula, Area i P represents the area of the i-th peak. i (x k ) represents the function value of the i-th peak at the k-th sampling point, i.e., the absorbance value calculated by the pseudo-Voigt function, reflecting the peak intensity at that point; Δx is the wavenumber interval between adjacent sampling points; The sum of the areas of all peaks is used, with a preset threshold of 1%.
[0039] S5. Residual Peak-Guided Model Refinement: Calculate the residual spectrum of the preliminary fitting results, detect the remaining peaks in the residual spectrum that are higher than the noise threshold, extract the positions of the remaining peaks as the positions of the missing true peaks, select the weak peaks that contribute the least in the preliminary fitting results, replace the peak center of the weak peaks with the positions of the missing true peaks, and use this as a new initial condition to re-fit and optimize. Iterate the above operations until there are no obvious peak signals in the residual spectrum or the upper limit of the number of peak models is reached, and obtain the refined fitting model. This model can effectively capture the subtle peak features missed in the preliminary fitting, further reduce the fitting residuals, and improve the fitting accuracy.
[0040] The formula for calculating the residual spectrum is as follows: In the formula, e(x) is the residual value at wavenumber x, and y(x) is the original absorbance value at wavenumber x. The fitted spectral value at wavenumber x; The weakest peak with the smallest contribution is the smallest peak area, through... Determine the index j of the weak peak; where, This indicates the peak number that makes Area reach its minimum value; Area i Let be the area of the i-th peak. The assignment operation for replacing the peak center of a weak peak is represented as: ; where x 0j x represents the position of the center of the j-th weak peak; R This represents the location of the missed true peak detected in the residual spectrum; the symbol " " indicates an assignment operation, that is, using x R Update x 0j .
[0041] S6. Peak Number Adaptive Scanning: Within the preset peak number range, steps S2 to S5 are executed sequentially for each absorbance spectrum, performing fitting calculations for different peak numbers in parallel. When the refined fitting model for a certain peak number reaches the preset goodness-of-fit threshold, the fitting calculation for higher peak numbers is terminated early, and the refined fitting model corresponding to that peak number is selected as the optimal fitting model. If the preset goodness-of-fit threshold is not reached even up to the maximum peak number, the determination coefficient R within the peak number range is selected. 2 The highest-performing refined fit model is selected as the optimal fit model, and suggestions are made to increase the number of peaks or check the quality of the spectral data. This scanning strategy can adapt to infrared spectra of varying complexity, enabling adaptive selection of the number of peaks and improving the robustness of the method. The preset range for the number of peaks is 15–22, and the preset goodness-of-fit threshold is the coefficient of determination R0. 2 ≥0.99.
[0042] S7. Result Output: For each input spectrum, a fitting curve is generated based on the optimal fitting model, and a peak parameter table containing key parameters of each peak is output, realizing batch processing and result output of multiple spectra.
[0043] The fitting curve includes the original absorbance spectrum curve, the baseline correction curve, and the total fitted spectrum curve obtained by superimposing each fitted peak. It can intuitively display the baseline correction effect and the degree of spectral fitting, making it convenient for users to manually review and verify the fitting results. The peak parameter table includes at least one parameter information of each sub-peak, such as the center wavenumber, peak intensity, peak area, full width at half maximum, and shape mixing factor, to meet the quantitative analysis needs in different scenarios. The result output format supports graphs, tables, and JSON format, and is adapted to the standardized output of batch spectra and integration with subsequent data analysis processes.
[0044] Based on the above-described preferred embodiments of the present invention, and through the foregoing description, those skilled in the art can make various changes and modifications without departing from the inventive concept. The technical scope of this invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.
Claims
1. An automated peak-splitting method for Fourier transform infrared spectroscopy based on multi-starting point and constraint optimization, characterized in that: Includes the following steps: S1. Data preprocessing: Read multiple CSV format Fourier transform infrared transmittance spectrum data, convert the transmittance data into absorbance data, automatically extract the spectral data within the preset target wavenumber range as the analysis interval, fit the background baseline of the spectrum within the analysis interval using a second-order polynomial function and subtract it to obtain the absorbance spectrum with zero baseline. S2. Candidate Peak Generation: Define the peak model as a pseudo-Voigt function, which is a linear combination of Gaussian peak function and Lorentz peak function. Identify the peak positions of the absorbance spectrum with zero baseline through a dual-channel peak finding method. Merge and remove duplicate peak position sets obtained by the two peak finding methods to obtain a candidate peak position set. Sort the peaks in the candidate peak position set according to the prominence of the peaks to form a candidate peak center list. S3. Random initialization of peak parameters from multiple starting points: Randomly select peak positions within a preset range from the candidate peak center list as initial peak centers. When selecting, the distance between any two initial peak centers shall not be less than the minimum allowable peak spacing. Introduce random perturbation to the initial peak center position, and simultaneously assign random initial values to the peak width, peak intensity, and shape mixing factor to generate multiple different combinations of initial peak parameters. S4. Constrained Nonlinear Fitting Optimization: For each set of initial peak parameter combinations, the least squares algorithm is used to perform nonlinear peak fitting iterative optimization to minimize the sum of squared residuals between the fitted spectrum and the original absorbance spectrum. During the fitting process, physical rationality constraints are applied to the peak parameters. After the fitting is completed, the fitting result is determined to be a valid solution by a preset quality evaluation standard. If it is an invalid solution, the initial peak parameter combination is changed and the fitting is re-fitted. The result with the highest fitting goodness is selected from multiple valid solutions as the preliminary fitting result. S5. Residual Peak-Guided Model Refinement: Calculate the residual spectrum of the preliminary fitting result, detect the remaining peaks in the residual spectrum that are higher than the noise threshold, extract the position of the remaining peak as the position of the missing true peak, select the weak peak with the smallest contribution in the preliminary fitting result, replace the peak center of the weak peak with the position of the missing true peak, and use this as a new initial condition to re-fit and optimize. Iterate the above operations until there are no obvious peak signals in the residual spectrum or the upper limit of the number of peak models is reached, and obtain the refined fitting model. S6. Peak Number Adaptive Scan: Within the preset peak number range, the absorbance spectrum is processed one by one through steps S2 to S5. The fitting calculations for different peak numbers are performed in parallel. When the refined fitting model for a certain peak number reaches the preset goodness-of-fit threshold, the fitting calculation for higher peak numbers is terminated in advance, and the refined fitting model corresponding to that peak number is selected as the optimal fitting model. S7. Result Output: For each input spectrum, a fitting curve is generated based on the optimal fitting model, and a peak parameter table containing key parameters of each peak is output, realizing batch processing and result output of multiple spectra.
2. The automated peak-splitting method for Fourier infrared spectroscopy based on multi-starting point and constraint optimization according to claim 1, characterized in that: In step S1, the formula for converting transmittance data into absorbance data is as follows: , In the formula, Abs(x) is the absorbance at wavenumber x, and T(x) is the transmittance percentage at wavenumber x, where x represents the wavenumber in cm. -1 ; The preset target wavenumber range is 1000-1800 cm⁻¹. -1 It also supports user-defined adjustments; The expression for the second-order polynomial function is: The formula for calculating baseline deduction is: ; In the formula, B(x) is the baseline intensity at wavenumber x, c0, c1 and c2 are the constant, linear and quadratic coefficients of the second-order polynomial, respectively, and y(x) is the absorbance at wavenumber x after baseline correction.
3. The automated peak-splitting method for Fourier infrared spectroscopy based on multi-starting point and constraint optimization according to claim 2, characterized in that: In step S2, the expression for the Gaussian peak function is: ; The expression for the Lorentz peak function is: ; The expression for the pseudo-Voigt function is: ; In the formula, G(x;x0,σ) is the Gaussian peak function value at wavenumber x, L(x;x0,σ) is the Lorentz peak function value at wavenumber x, x0 is the peak center position, σ is the peak width parameter, and P i (x) represents the value of the i-th pseudo-Voigt peak function at wavenumber x, A i For peak intensity, η i x is the shape blending factor. 0i Let σ be the peak center position of the i-th peak. i Let be the peak width parameter of the i-th peak.
4. The automated peak-splitting method for Fourier infrared spectroscopy based on multi-starting point and constraint optimization according to claim 3, characterized in that: In step S2, the specific operation of the dual-channel peak finding method includes: Step-a1, Peak Finding in the Original Spectrum: Scan the absorbance spectrum of the zero baseline. When the sampling point meets the peak finding criteria... and When the sampling point is determined to be a local maximum point, it is used as the original spectral peak position to form the signal peak position set Csignal; In the formula, y(x k y(x) represents the absorbance value at the k-th sampling point. k-1 ), y(x k+1 ) represent the absorbance values of the adjacent sampling points before and after the k-th sampling point, respectively, x k The wavenumber position of the k-th sampling point; Step-a2, Second Derivative Peak Finding: Calculate the second derivative curve of the absorbance spectrum of the zero baseline. The approximate formula for calculating the second derivative is: In the formula, y''(x k ) represents the second derivative value at the k-th sampling point, and Δx represents the wavenumber interval between adjacent sampling points; Potential peak positions are obtained at the curvature maxima of the second derivative curve, forming a curvature peak position set Ccurvature; the candidate peak position set C = Csignal∪Ccurvature, where ∪ represents the set union operation.
5. The automated peak-splitting method for Fourier infrared spectroscopy based on multi-starting point and constraint optimization according to claim 4, characterized in that: In step S3, the formula for the random perturbation of the initial peak center position is: ; In the formula, Let x be the initial center position of the i-th peak. 0i δ represents the center position of the candidate peak. i The random disturbance quantity follows a uniform distribution on the interval [-J, J], where J is the disturbance amplitude parameter; The peak width σ i The range of random initial values is [σ]. min ,σ max Peak intensity A i The initial random value is non-negative, and the shape mixing factor η i The random initial value ranges from [0,1].
6. The automated peak-splitting method for Fourier infrared spectroscopy based on multi-starting point and constraint optimization according to claim 5, characterized in that: In step S4, the least squares algorithm is the Levenberg-Marquardt algorithm; the specific physical rationality constraints are as follows: (1) Peak center location That is, the peak center position x 0i Only in the initial position Fine-tune within a 2W range, always keeping it within the preset target wavenumber range; (2) The range of values for the peak width parameter σi is [σ min ,σ max ]; (3) Peak intensity A i It is a non-negative value and does not exceed the preset upper limit. (4) Shape mixing factor η i The value range is [0,1].
7. The automated peak-splitting method for Fourier infrared spectroscopy based on multi-starting point and constraint optimization according to claim 6, characterized in that: In step S4, the formula for calculating the sum of squared residuals is: ; In the formula, SSE is the sum of squared residuals, y(x k ) represents the original absorbance value at the k-th sampling point. Let ∑ be the fitted spectral value at the k-th sampling point. k This represents summing over all sample points; The preset quality assessment criteria include goodness-of-fit determination and peak parameter rationality check. The goodness-of-fit is measured by the coefficient of determination R², and the calculation formula is as follows: In the formula, The threshold for the determination coefficient R² is set to ≥0.99, representing the average value of the original absorbance data. The peak parameter rationality check includes: the half-width at half maximum (WHM) of each sub-peak is within a physically reasonable range, and the percentage of the area of each sub-peak to the total peak area is not less than a preset ratio threshold.
8. The automated peak-splitting method for Fourier infrared spectroscopy based on multi-starting point and constraint optimization according to claim 7, characterized in that: The formula for calculating the peak area is: The formula for calculating the percentage of peak area to total peak area is: ; In the formula, Area i P represents the area of the i-th peak. i (x k ) represents the function value of the i-th peak at the k-th sampling point, i.e., the absorbance value calculated by the pseudo-Voigt function, reflecting the peak intensity at that point; Δx is the wavenumber interval between adjacent sampling points; The preset ratio threshold is 1%, which is the sum of the areas of all peaks.
9. The automated peak-splitting method for Fourier infrared spectroscopy based on multi-starting point and constraint optimization according to claim 8, characterized in that: In step S5, the formula for calculating the residual spectrum is: ; In the formula, e(x) is the residual value at wavenumber x, and y(x) is the original absorbance value at wavenumber x. The fitted spectral value at wavenumber x; The weakest peak with the smallest contribution is the peak with the smallest area, through... Determine the index j of the weak peak; where, Indicates that Area i The peak number corresponding to the minimum value; Area i Let be the area of the i-th peak. The assignment operation for replacing the weak peak center is represented as follows: ; where x 0j x represents the position of the center of the j-th weak peak; R This represents the location of the missed true peak detected in the residual spectrum; the symbol " " indicates an assignment operation, that is, using x R Update x 0j .
10. The automated peak-splitting method for Fourier infrared spectroscopy based on multi-starting point and constraint optimization according to claim 9, characterized in that: In step S6, if the preset goodness-of-fit threshold is not reached even up to the maximum number of peaks, then a decision coefficient R is selected within the range of peak numbers. 2 The highest refined fit model is selected as the optimal fit model, and suggestions are made to increase the number of peaks or check the quality of the spectral data.